Changes between Version 2 and Version 3 of pm-switch

Oct 26, 2010 7:48:18 PM (11 years ago)



  • pm-switch

    v2 v3  
     128== {{{Root/Xxx/}}}==
     130This is the template for the pkg-config file that will be produced at configure time. It has a very simple form something like the following.
     137Name: Xxx
     138Description: Xxx does nothing useful
     139Version: @PACKAGE_VERSION@
     140Libs: -L${libdir} -lXxx @XXXLIB_PCLIBS@
     141Cflags: -I${includedir}
     142Requires: @XXXLIB_PCREQUIRES@
     145== {{{Root/Xxx/}}}==
     147This the pkg-config file for finding uninstalled versions of a given library built from source. It's almost identical to the above with just a few path differences.
     153Name: Xxx
     154Description: Xxx does nothing useful
     155Version: @PACKAGE_VERSION@
     156Libs: -L${libdir} -lXxx @XXXLIB_PCLIBS@
     157Cflags: -I${includedir} -I@ABSBUILDDIR@/inc
     158Requires: @XXXLIB_PCREQUIRES@
     161== {{{Root/Xxx/src/}}} ==
     163The main difference in the construction of the various {{{}}} files is that not so much work has to be done now to build up the command lines and lists of dependent libraries. This is all done automatically. For each package Yyy defined in {{{}}}, there are now two variables: {{{YYY_CFLAGS}}} and {{{YYY_LIBS}}} that hold the command line for compiling individual C and C++ files (i.e., the include paths, etc.) and the link line for linking to dependent libraries, respectively. The situation will be slightly different for each project, but for the most part, we can replace blocks like
     165AM_CPPFLAGS = \
     166        -I`$(CYGPATH_W) $(COINUTILSSRCDIR)/src` \
     167        -I`$(CYGPATH_W) $(COINUTILSOBJDIR)/inc` \
     168        -I`$(CYGPATH_W) $(OSISRCDIR)/src`       \
     169        -I`$(CYGPATH_W) $(OSISRCDIR)/inc`
     170        -I`$(CYGPATH_W) $(CLPSRCDIR)/src` \
     171        -I`$(CYGPATH_W) $(OSISRCDIR)/src/OsiClp`   \
     172        -I`$(CYGPATH_W) $(CLPOBJDIR)/inc`
     173LDADD = $(COINUTILSOBJDIR)/src/    \
     174        $(OSIOBJDIR)/src/    \
     175        $(OSIOBJDIR)/src/OsiClp/    \
     176        $(CLPOBJDIR)/src/
     178with something simpler like this:
     183Note that the names of the variables correspond exactly to the names given to the libraries and binaries in the third argument {{{AC_COIN_HAS_PACKAGE()}}}, as described in the section on the {{{Root/Xxx/}}} file above. Hence, the command {{{AC_COIN_HAS_PACKAGE(CoinDepend, [coinutils = trunk osi = trunk alps = trunk], [XxxLib])}}} will result in the libraries and flags for each of those dependencies being put into variables called {{{XXXLIB_LIBS}}} and {{{XXXLIB_CFLAGS}}} respectively. One curcial difference between these two variables, though, is that the {{{LIBS}}} variable includes secondary and tertiary dependencies, whereas the {{{CFLAGS}}} variable does not. So there's a little more work involved in building up the flags than the libraries. We will try to change this.
     185A final different is that there is no longer any need to use the {{{ADDLIBS}}} variable at all (it is not even defined), as the additional libraries are all included as dependencies when the lists of libraries are built up.
     187== {{{Root/Xxx/test/}}} ==
     189The changes here are similar to those described above.
     191== {{{Root/Xxx/examples}}} ==
     193Again, the main difference here is that one has to build from the new set of variables defined above in linking to the installed libraries. Alternatively, if you would like to check for or assume the presence of pkg-config on the system the examples will be buitl on, the most ideal thing would be to build your example Makefiles to show to use pkg-config, as this is the exact use case we are attempting to support.