Qpid
  1. Qpid
  2. QPID-243

Inconsistent use of paths in #includes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6
    • Component/s: C++ Broker, C++ Client
    • Labels:
      None

      Description

      1. With the new release, I have to specify -I$

      {QPID_REL}

      /include/qpidc,
      -I${QPID_REL/include/qpidc/framing and -I${QPID_REL/include/qpidc/sys when
      I build which is really naff.

      This is because things like Connector.h do a #include
      <framing/InputHandler.h>, but then "framing/InputHandler.h" only #include
      <AMQFrame.h> and AMQFrame.h is located in the framing sub-directory.

        Issue Links

          Activity

          Hide
          Alan Conway added a comment -

          To be resolved by a directory re-organization as follows:

          Goals:

          • consistent mapping between file paths and class names.
          • consistent #include usage for svn and installed headers.
          • consistent source paths for debuggers, valgrind etc.
          • flexible packaging into libraries, executables (e.g. libqpidc, libqpidd)
          • full dependencies, e.g. from clean co "make test/FooBarTest.so"
            can build all the dependencies to run that test.
            ? Faster build - single makefile tends to be faster, esp as tree gets bigger.
          • consistent user #includes. User has 2 options:
          • install in standard place, no -I, #include <qpid/client/Message.h>
          • -I /usr/include/qpid, #include <client/Message.h>

          Approach:

          • single makefile in src/ builds all libs, exes, tests.
          • subdirectory per namespace
          • files named after classes
          • #includes in .h files are relative:
          • in src: #include "client/Message.h"
          • in subdir: #include "../client/Message.h"
          • .cpp files: #include "client/Message.h"
          • User code with installed headers as above.

          Outline:

          src/
          Makefile.am - include makefile.mk from subdirs
          *.cpp *.h - sources in qpid namespace

          client/ - sources in qpid::client namespace
          makefile.mk - lists client sources with path, e.g. client/Message.cpp
          *.cpp, *.h - client sources

          broker/ \
          sys/ - As for client/ for other namespaces
          framing/ /

          tests/ - test code.
          makefile.mk - test make fragment.

          NOTES:
          Use: "g++ -c -o path/file.cpp path/file.o" to put .o files in subdir.
          Autoconf/automake supports use of -o.
          Autoconf needs to check for -o option: AM_PROG_CC_C_O is for C, verify
          if this works for C++ or there's another option.

          Show
          Alan Conway added a comment - To be resolved by a directory re-organization as follows: Goals: consistent mapping between file paths and class names. consistent #include usage for svn and installed headers. consistent source paths for debuggers, valgrind etc. flexible packaging into libraries, executables (e.g. libqpidc, libqpidd) full dependencies, e.g. from clean co "make test/FooBarTest.so" can build all the dependencies to run that test. ? Faster build - single makefile tends to be faster, esp as tree gets bigger. consistent user #includes. User has 2 options: install in standard place, no -I, #include <qpid/client/Message.h> -I /usr/include/qpid, #include <client/Message.h> Approach: single makefile in src/ builds all libs, exes, tests. subdirectory per namespace files named after classes #includes in .h files are relative: in src: #include "client/Message.h" in subdir: #include "../client/Message.h" .cpp files: #include "client/Message.h" User code with installed headers as above. Outline: src/ Makefile.am - include makefile.mk from subdirs *.cpp *.h - sources in qpid namespace client/ - sources in qpid::client namespace makefile.mk - lists client sources with path, e.g. client/Message.cpp *.cpp, *.h - client sources broker/ \ sys/ - As for client/ for other namespaces framing/ / tests/ - test code. makefile.mk - test make fragment. NOTES: Use: "g++ -c -o path/file.cpp path/file.o" to put .o files in subdir. Autoconf/automake supports use of -o. Autoconf needs to check for -o option: AM_PROG_CC_C_O is for C, verify if this works for C++ or there's another option.

            People

            • Assignee:
              Andrew Stitcher
              Reporter:
              Alan Conway
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development