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

          Alan Conway created issue -
          Alan Conway made changes -
          Field Original Value New Value
          Assignee Alan Conway [ aconway ]
          Alan Conway made changes -
          Assignee Alan Conway [ aconway ]
          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.
          Alan Conway made changes -
          Link This issue blocks QPID-399 [ QPID-399 ]
          Alan Conway made changes -
          Link This issue depends on QPID-400 [ QPID-400 ]
          Andrew Stitcher made changes -
          Assignee Alan Conway [ aconway ] Andrew Stitcher [ astitcher ]
          Andrew Stitcher made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Alan Conway made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Gavin made changes -
          Workflow jira [ 12393513 ] QPid [ 12438451 ]
          Gavin made changes -
          Workflow QPid [ 12438451 ] QPid Workflow [ 12439745 ]
          Gavin made changes -
          Link This issue depends on QPID-400 [ QPID-400 ]
          Gavin made changes -
          Link This issue depends upon QPID-400 [ QPID-400 ]
          Gavin made changes -
          Link This issue blocks QPID-399 [ QPID-399 ]
          Gavin made changes -
          Link This issue is depended upon by QPID-399 [ QPID-399 ]
          Justin Ross made changes -
          Fix Version/s 0.6 [ 12313728 ]
          Justin Ross made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          88d 11h 29m 1 Andrew Stitcher 02/Apr/07 09:40
          In Progress In Progress Resolved Resolved
          240d 12h 1 Alan Conway 28/Nov/07 20:40
          Resolved Resolved Closed Closed
          2069d 22h 12m 1 Justin Ross 29/Jul/13 19:53

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development