Changeset 1660 for trunk/Cbc/src


Ignore:
Timestamp:
Jun 9, 2011 9:09:23 AM (8 years ago)
Author:
stefan
Message:

change to new way of using and installing configuration header files

Location:
trunk/Cbc/src
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcConfig.h

    r1578 r1660  
    1 /* $Id$ */
    2 /*
     1/* Copyright (C) 2011
     2 * All Rights Reserved.
     3 * This code is published under the Eclipse Public License.
     4 *
     5 * $Id$
     6 *
    37 * Include file for the configuration of Cbc.
    48 *
     
    1216 * macros that depend on the operating system and the compiler.  The
    1317 * macros that define the configuration of the particular user setting
    14  * (e.g., presence of other COIN packages or third party code) are set
    15  * here.  The project maintainer needs to remember to update this file
    16  * and choose reasonable defines.  A user can modify the default
    17  * setting by editing this file here.
     18 * (e.g., presence of other COIN-OR packages or third party code) are set
     19 * by the files config_*default.h. The project maintainer needs to remember
     20 * to update these file and choose reasonable defines.
     21 * A user can modify the default setting by editing the config_*default.h files.
    1822 *
    1923 */
     
    2327
    2428#ifdef HAVE_CONFIG_H
     29#ifdef CBC_BUILD
     30#include "config.h"
     31#else
    2532#include "config_cbc.h"
    26 
    27 /* undefine macros that could conflict with those in other config.h
    28    files */
    29 #undef PACKAGE
    30 #undef PACKAGE_BUGREPORT
    31 #undef PACKAGE_NAME
    32 #undef PACKAGE_STRING
    33 #undef PACKAGE_TARNAME
    34 #undef PACKAGE_VERSION
    35 #undef VERSION
     33#endif
    3634
    3735#else /* HAVE_CONFIG_H */
    3836
    39 /* include the COIN-wide system specific configure header */
    40 #include "configall_system.h"
    41 
    42 /***************************************************************************/
    43 /*             HERE DEFINE THE CONFIGURATION SPECIFIC MACROS               */
    44 /***************************************************************************/
    45 
    46 /* Define to the debug sanity check level (0 is no test) */
    47 #define COIN_CBC_CHECKLEVEL 0
    48 
    49 /* Define to the debug verbosity level (0 is no output) */
    50 #define COIN_CBC_VERBOSITY 0
    51 
    52 /* Define to 1 if the Cbc package is used */
    53 #define COIN_HAS_CBC 1
    54 
    55 /* Define to 1 if the Cgl package is used */
    56 #define COIN_HAS_CGL 1
    57 
    58 /* Define to 1 if the Clp package is used */
    59 #define COIN_HAS_CLP 1
    60 
    61 /* Define to 1 if the CoinUtils package is used */
    62 #define COIN_HAS_COINUTILS 1
    63 
    64 /* Define to 1 if the Osi package is used */
    65 #define COIN_HAS_OSI 1
    66 
    67 /* Define to 1 if the Vol package is used */
    68 #define COIN_HAS_VOL 1
    69 
    70 /* Define to 1 if the Cplex package is used */
    71 /* #undef COIN_HAS_CPX */
    72 
    73 /* Define to 1 if the Dylp package is used */
    74 /* #undef COIN_HAS_DYLP */
    75 
    76 /* Define to 1 if the FortMP package is used */
    77 /* #undef COIN_HAS_FMP */
    78 
    79 /* Define to 1 if the Glpk package is used */
    80 /* #undef COIN_HAS_GLPK */
    81 
    82 /* Define to 1 if the Mosek package is used */
    83 /* #undef COIN_HAS_MSK */
    84 
    85 /* Define to 1 if the Osl package is used */
    86 /* #undef COIN_HAS_OSL */
    87 
    88 /* Define to 1 if the Soplex package is used */
    89 /* #undef COIN_HAS_SPX */
    90 
    91 /* Define to 1 if the Sym package is used */
    92 /* #undef COIN_HAS_SYM */
    93 
    94 /* Define to 1 if the Xpress package is used */
    95 /* #undef COIN_HAS_XPR */
    96 
    97 /* Cbc version */
    98 #define CBC_VERSION "trunk"
    99 
    100 /*
    101   For additional information about how to set OSICBC_DFLT_SOLVER,
    102   OSICBC_DFLT_SOLVER_CLP, and OSICBC_DFLT_SOLVER_HPP, please see comments at
    103   the beginning of OsiCbcSolverInterface.cpp. Unless you know what you're
    104   doing, you should use clp with OsiCbc. Just uncomment the next three
    105   defines.
    106 */
    107 /*
    108   Define to the name of the default solver interface class, e.g.,
    109   OsiClpSolverInterface.
    110 */
    111 /* #define OSICBC_DFLT_SOLVER OsiClpSolverInterface */
    112 
    113 /* Define this symbol if clp is the default solver. */
    114 /* #define OSICBC_DFLT_SOLVER_CLP 1 */
    115 
    116 /*
    117   Define to the name of the .hpp file for the default solver interface class,
    118   e.g., "OsiClpSolverInterface.hpp" (include quotes)
    119 */
    120 /* #define OSICBC_DFLT_SOLVER_HPP "OsiClpSolverInterface.hpp" */
     37#ifdef CBC_BUILD
     38#include "config_default.h"
     39#else
     40#include "config_cbc_default.h"
     41#endif
    12142
    12243#endif /* HAVE_CONFIG_H */
    12344
    124 #endif /* __CBCCONFIG_H__ */
     45#endif /*__CBCCONFIG_H__*/
  • trunk/Cbc/src/Makefile.am

    r1598 r1660  
    186186AM_CPPFLAGS += -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG
    187187
    188 # This line is necessary to allow VPATH compilation with MS compilers
    189 # on Cygwin
    190 DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
     188# This line is necessary to allow VPATH compilation
     189DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src
    191190
    192191########################################################################
     
    198197includecoindir = $(includedir)/coin
    199198includecoin_HEADERS = \
    200         ../inc/config_cbc.h \
    201199        Cbc_C_Interface.h \
    202200        CbcBranchActual.hpp \
     
    269267        ClpAmplObjective.hpp
    270268
    271 #############################################################################
    272 # Create the Config.h file that always defines HAVE_CONFIG_H and install it #
    273 #############################################################################
    274 
    275 # You only need to adapt the following line
    276 ConfigHeader = CbcConfig.h
    277 
    278269install-exec-local:
    279         echo "#ifndef HAVE_CONFIG_H" >bla
    280         echo "#define HAVE_CONFIG_H" >>bla
    281         echo "#endif" >> bla
    282         cat $(srcdir)/$(ConfigHeader) >> bla
    283         $(install_sh_DATA) bla $(DESTDIR)$(includecoindir)/$(ConfigHeader)
    284         rm -f bla
     270        $(install_sh_DATA) config_cbc.h $(DESTDIR)$(includecoindir)/CbcConfig.h
    285271
    286272uninstall-local:
    287         rm -f $(DESTDIR)$(includecoindir)/$(ConfigHeader)
     273        rm -f $(DESTDIR)$(includecoindir)/CbcConfig.h
  • trunk/Cbc/src/Makefile.in

    r1646 r1660  
    6969subdir = src
    7070DIST_COMMON = $(includecoin_HEADERS) $(srcdir)/Makefile.am \
    71         $(srcdir)/Makefile.in
     71        $(srcdir)/Makefile.in $(srcdir)/config.h.in \
     72        $(srcdir)/config_cbc.h.in
    7273ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    7374am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
     
    7677        $(ACLOCAL_M4)
    7778mkinstalldirs = $(install_sh) -d
    78 CONFIG_HEADER = $(top_builddir)/inc/config_cbc.h
     79CONFIG_HEADER = config.h config_cbc.h
    7980CONFIG_CLEAN_FILES =
    8081am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
     
    646647@CBC_BUILD_CBC_GENERIC_TRUE@cbc_generic_LDFLAGS = -rpath $(libdir)
    647648
    648 # This line is necessary to allow VPATH compilation with MS compilers
    649 # on Cygwin
    650 DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
     649# This line is necessary to allow VPATH compilation
     650DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src
    651651
    652652########################################################################
     
    658658includecoindir = $(includedir)/coin
    659659includecoin_HEADERS = \
    660         ../inc/config_cbc.h \
    661660        Cbc_C_Interface.h \
    662661        CbcBranchActual.hpp \
     
    729728        ClpAmplObjective.hpp
    730729
    731 
    732 #############################################################################
    733 # Create the Config.h file that always defines HAVE_CONFIG_H and install it #
    734 #############################################################################
    735 
    736 # You only need to adapt the following line
    737 ConfigHeader = CbcConfig.h
    738 all: all-recursive
     730all: config.h config_cbc.h
     731        $(MAKE) $(AM_MAKEFLAGS) all-recursive
    739732
    740733.SUFFIXES:
     
    769762$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
    770763        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
     764
     765config.h: stamp-h1
     766        @if test ! -f $@; then \
     767          rm -f stamp-h1; \
     768          $(MAKE) stamp-h1; \
     769        else :; fi
     770
     771stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
     772        @rm -f stamp-h1
     773        cd $(top_builddir) && $(SHELL) ./config.status src/config.h
     774$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
     775        cd $(top_srcdir) && $(AUTOHEADER)
     776        rm -f stamp-h1
     777        touch $@
     778
     779config_cbc.h: stamp-h2
     780        @if test ! -f $@; then \
     781          rm -f stamp-h2; \
     782          $(MAKE) stamp-h2; \
     783        else :; fi
     784
     785stamp-h2: $(srcdir)/config_cbc.h.in $(top_builddir)/config.status
     786        @rm -f stamp-h2
     787        cd $(top_builddir) && $(SHELL) ./config.status src/config_cbc.h
     788
     789distclean-hdr:
     790        -rm -f config.h stamp-h1 config_cbc.h stamp-h2
    771791install-libLTLIBRARIES: $(lib_LTLIBRARIES)
    772792        @$(NORMAL_INSTALL)
     
    10561076tags: TAGS
    10571077
    1058 TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
     1078TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in config_cbc.h.in $(TAGS_DEPENDENCIES) \
    10591079                $(TAGS_FILES) $(LISP)
    10601080        tags=; \
     
    10731093          fi; \
    10741094        done; \
    1075         list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
     1095        list='$(SOURCES) $(HEADERS) config.h.in config_cbc.h.in $(LISP) $(TAGS_FILES)'; \
    10761096        unique=`for i in $$list; do \
    10771097            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
     
    10851105        fi
    10861106ctags: CTAGS
    1087 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
     1107CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in config_cbc.h.in $(TAGS_DEPENDENCIES) \
    10881108                $(TAGS_FILES) $(LISP)
    10891109        tags=; \
    10901110        here=`pwd`; \
    1091         list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
     1111        list='$(SOURCES) $(HEADERS) config.h.in config_cbc.h.in $(LISP) $(TAGS_FILES)'; \
    10921112        unique=`for i in $$list; do \
    10931113            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
     
    11081128
    11091129distdir: $(DISTFILES)
    1110         $(mkdir_p) $(distdir)/../inc
    11111130        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    11121131        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
     
    11521171check-am: all-am
    11531172check: check-recursive
    1154 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
     1173all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) config.h \
     1174                config_cbc.h
    11551175install-binPROGRAMS: install-libLTLIBRARIES
    11561176
     
    11931213        -rm -f Makefile
    11941214distclean-am: clean-am distclean-compile distclean-generic \
    1195         distclean-libtool distclean-tags
     1215        distclean-hdr distclean-libtool distclean-tags
    11961216
    11971217dvi: dvi-recursive
     
    12421262        clean clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
    12431263        clean-libtool clean-recursive ctags ctags-recursive distclean \
    1244         distclean-compile distclean-generic distclean-libtool \
    1245         distclean-recursive distclean-tags distdir dvi dvi-am html \
    1246         html-am info info-am install install-am install-binPROGRAMS \
    1247         install-data install-data-am install-exec install-exec-am \
    1248         install-exec-local install-includecoinHEADERS install-info \
    1249         install-info-am install-libLTLIBRARIES install-man \
    1250         install-strip installcheck installcheck-am installdirs \
    1251         installdirs-am maintainer-clean maintainer-clean-generic \
    1252         maintainer-clean-recursive mostlyclean mostlyclean-compile \
    1253         mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
    1254         pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
     1264        distclean-compile distclean-generic distclean-hdr \
     1265        distclean-libtool distclean-recursive distclean-tags distdir \
     1266        dvi dvi-am html html-am info info-am install install-am \
     1267        install-binPROGRAMS install-data install-data-am install-exec \
     1268        install-exec-am install-exec-local install-includecoinHEADERS \
     1269        install-info install-info-am install-libLTLIBRARIES \
     1270        install-man install-strip installcheck installcheck-am \
     1271        installdirs installdirs-am maintainer-clean \
     1272        maintainer-clean-generic maintainer-clean-recursive \
     1273        mostlyclean mostlyclean-compile mostlyclean-generic \
     1274        mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
     1275        tags tags-recursive uninstall uninstall-am \
    12551276        uninstall-binPROGRAMS uninstall-includecoinHEADERS \
    12561277        uninstall-info-am uninstall-libLTLIBRARIES uninstall-local
     
    12581279
    12591280install-exec-local:
    1260         echo "#ifndef HAVE_CONFIG_H" >bla
    1261         echo "#define HAVE_CONFIG_H" >>bla
    1262         echo "#endif" >> bla
    1263         cat $(srcdir)/$(ConfigHeader) >> bla
    1264         $(install_sh_DATA) bla $(DESTDIR)$(includecoindir)/$(ConfigHeader)
    1265         rm -f bla
     1281        $(install_sh_DATA) config_cbc.h $(DESTDIR)$(includecoindir)/CbcConfig.h
    12661282
    12671283uninstall-local:
    1268         rm -f $(DESTDIR)$(includecoindir)/$(ConfigHeader)
     1284        rm -f $(DESTDIR)$(includecoindir)/CbcConfig.h
    12691285# Tell versions [3.59,3.63) of GNU make to not export all variables.
    12701286# Otherwise a system limit (for SysV at least) may be exceeded.
  • trunk/Cbc/src/OsiCbc/Makefile.am

    r1568 r1660  
    6666endif
    6767
    68 # This line is necessary to allow VPATH compilation with MS compilers
    69 # on Cygwin
    70 DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
     68# This line is necessary to allow VPATH compilation
     69DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I..
    7170
    7271########################################################################
  • trunk/Cbc/src/OsiCbc/Makefile.in

    r1646 r1660  
    6363        $(ACLOCAL_M4)
    6464mkinstalldirs = $(install_sh) -d
    65 CONFIG_HEADER = $(top_builddir)/inc/config_cbc.h
     65CONFIG_HEADER = $(top_builddir)/src/config.h \
     66        $(top_builddir)/src/config_cbc.h
    6667CONFIG_CLEAN_FILES =
    6768am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
     
    450451        $(am__append_7) $(am__append_8)
    451452
    452 # This line is necessary to allow VPATH compilation with MS compilers
    453 # on Cygwin
    454 DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
     453# This line is necessary to allow VPATH compilation
     454DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I..
    455455
    456456########################################################################
Note: See TracChangeset for help on using the changeset viewer.