Changes between Version 13 and Version 14 of pm-source-make


Ignore:
Timestamp:
Jun 6, 2011 10:10:08 AM (9 years ago)
Author:
stefan
Comment:

update on config header files

Legend:

Unmodified
Added
Removed
Modified
  • pm-source-make

    v13 v14  
    195195
    196196{{{
    197 # This line is necessary to allow VPATH compilation with MS compilers on Cygwin.
    198 DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
    199 }}}
    200 
    201  * You should have the lines above somewhere in your {{{Makefile.am}}} file, to make sure that users can compile your code under Cygwin using the native Windows compilers in a VPATH configuration.  The default setting for '''DEFAULT_INCLUDES''' does not use the {{{CYGPATH_W}}} variable.
     197# This line is necessary to allow VPATH compilation
     198DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src
     199}}}
     200
     201 * You should have the lines above somewhere in your {{{Makefile.am}}} file, to make sure that users can compile your code in a VPATH configuration.  The default setting for '''DEFAULT_INCLUDES''' does not use the {{{CYGPATH_W}}} variable and does not add the include for the src subdirectory of the build directory.
     202 The latter is needed to find [wiki:pm-config-header automatically generated config header files] (provided they are put into this directory).
    202203
    203204-------------------------
     
    214215includecoindir = $(includedir)/coin
    215216includecoin_HEADERS = \
    216         ../inc/config_cbc.h \
    217217        CbcBranchActual.hpp \
    218218        CbcBranchBase.hpp \
     
    232232
    233233 * In order to use a COIN-OR library (if it is written in C or C++), a user will need some of the header files in the source directories to compile her/his own code.  For this reason, we specify the required header files (which might only be a subset of all header files in the source directory) in the '''_HEADERS''' Automake variable.  The specification of '''includecoindir''' and the prefix '''includecoin_''' tells {{{automake}}} that these files should be copied into the coin subdirectory of the {{{include}}} installation directory.[[BR]]
    234  Note that you should make sure that the ''public'' configuration header file (usually in the {{{inc}}} directory) is also installed. '''Do not install the ''private'' configuration header file {{{config.h}}}''', recall the information [wiki:pm-config-header here].
     234 The configuration header file is installed separately (next point).
    235235
    236236{{{
     
    242242
    243243{{{
    244 #############################################################################
    245 # Create the Config.h file that always defines HAVE_CONFIG_H and install it #
    246 #############################################################################
    247 
    248 # You only need to adapt the following line
     244#######################################################################
     245# Create the Config.h file that has all public defines and install it #
     246#######################################################################
     247
    249248ConfigHeader = ClpConfig.h
    250249
    251250install-exec-local:
    252         echo "#ifndef HAVE_CONFIG_H" >bla
    253         echo "#define HAVE_CONFIG_H" >>bla
     251        echo "#ifndef __CLP_CONFIG_H__" > bla
     252        echo "#define __CLP_CONFIG_H__" >> bla
     253        tail -n +3 config_clp.h >> bla
    254254        echo "#endif" >> bla
    255         cat $(srcdir)/$(ConfigHeader) >> bla
    256         $(install_sh_DATA) bla $(DESTDIR)$(includedir)/$(ConfigHeader)
     255        $(install_sh_DATA) bla $(DESTDIR)$(includecoindir)/$(ConfigHeader)
    257256        rm -f bla
    258257
    259258uninstall-local:
    260259        rm -f $(DESTDIR)$(includedir)/$(ConfigHeader)
    261  }}}
    262 
    263  * As discussed in the [wiki:pm-config-header Configuration Header files page], in COIN-OR we don't include the configuration header files {{{config*.h}}} directly.  Instead, this is done via the '''''Pkg''Config.h''' file, to make sure that the compilation can also be done smoothly in a non-autotools setup. Therefore, the ''Pkg''Config.h header file should also be installed, but it has to be modified slightly.  This is done with the lines above; you should have these in one of your source code {{{Makefile.am}}} files, and adapt the '''!ConfigHeader''' variable for your project.  The {{{install-exec-local}}} is run by the generated Makefile for a {{{make install}}}, and the commands for {{{uninstall-local}}} are executed for the {{{make uninstall}}}.
     260}}}
     261
     262 Note that you should make sure that the ''public'' configuration header file is also installed. '''Do not install the ''private'' configuration header file {{{config.h}}}''', recall the information [wiki:pm-config-header here].
     263
     264
     265 * As discussed in the [wiki:pm-config-header Configuration Header files page], in COIN-OR we don't include the configuration header files {{{config*.h}}} directly.  Instead, this is done via the '''''Pkg''Config.h''' file, to make sure that the compilation can also be done smoothly in a non-autotools setup. To build against an installed version of a project, the '''''Pkg''Config.h''' only needs to contain the content of the ''public'' configuration header file. The above lines ensure this, see [wiki:pm-config-header here] for more details.
     266 The {{{install-exec-local}}} is run by the generated Makefile for a {{{make install}}}, and the commands for {{{uninstall-local}}} are executed for the {{{make uninstall}}}.