Changes between Version 2 and Version 3 of pm-source-make


Ignore:
Timestamp:
Jun 2, 2006 12:25:13 AM (14 years ago)
Author:
andreasw
Comment:

finished first draft

Legend:

Unmodified
Added
Removed
Modified
  • pm-source-make

    v2 v3  
    8080For now, just use the above line for your library, no matter if it is installed or not. 
    8181
     82=== Collecting Objects from Other Libraries ===
     83
     84{{{
     85# We want to have also the objects from the DylpStdLib in this library
     86libDylp_la_LIBADD = ../DylpStdLib/libDylpStdLib.la
     87}}}
     88
     89 * If you distribute the source code for a library into several directories, you will have to tell Automake, which libraries should be included in the final library that is going to be installed.  In the above example, taken from the DyLP project, the final library to be installed is {{{libDylp}}} (with the approprate extension, such as "{{{.a}}}").  In the {{{Makefile.am}}} for this library you would find those lines.  The '''LIBADD''' primary tells Autoconf, that the objects from the specified lLbtool libraries should be included in the final library.
     90
    8291---------------------------------
    8392
     
    161170
    162171 * Additional "{{{-D}}}" preprocessor flags should also be added to the '''AM_CPPFLAGS''' variable.
     172
     173=== Correction for Default Include Flags ===
     174
     175{{{
     176# This line is necessary to allow VPATH compilation with MS compilers
     177# on Cygwin
     178DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
     179}}}
     180
     181 * 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 have the {{{CYGPATH_W}}}.
     182
     183-------------------------
    163184
    164185== Installation of Header Files ==
     
    189210}}}
    190211
    191  * In order to use a COIN library (which 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
     212 * In order to use a COIN library (which 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 requires header files (which mighy only be a subset of all header files in the source directory) in the '''include_HEADERS''' Automake variable.  The prefix '''include_''' tells {{{automake}}} that those files should be copied into the {{{include}}} installation directory.   Note that you should make sure that also the configuration header file (usually in the {{{inc}}} directory) is installed.
     213
     214 {{{
     215 #############################################################################
     216# Create the Config.h file that always defines HAVE_CONFIG_H and install it #
     217#############################################################################
     218
     219# You only need to adapt the following line
     220ConfigHeader = ClpConfig.h
     221
     222install-exec-local:
     223        echo "#ifndef HAVE_CONFIG_H" >bla
     224        echo "#define HAVE_CONFIG_H" >>bla
     225        echo "#endif" >> bla
     226        cat $(srcdir)/$(ConfigHeader) >> bla
     227        $(install_sh_DATA) bla $(DESTDIR)$(includedir)/$(ConfigHeader)
     228        rm -f bla
     229
     230uninstall-local:
     231        rm -f $(DESTDIR)$(includedir)/$(ConfigHeader)
     232 }}}
     233
     234 * As discussed in the [wiki:pm-autotools-intro Autotools introduction page], in COIN we don't include the configuration header file (above {{{config_clp.h}}}) directly.  Instead, this is done via the '''''Pkg''Config.h''' file, to make sure that the compilation can also be done smoothly with the Developer Studio.  Therefore, this header file should also be installed, but it has to be modified slightly.  This is done with the lines above; you should have those 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}}}.