Ignore:
Timestamp:
May 18, 2006 4:06:33 PM (14 years ago)
Author:
andreasw
Message:

changed Config.h behavior

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/Makefile.am

    r324 r325  
    242242        CbcTreeLocal.hpp
    243243
    244 ########################################################################
    245 #     Generating the configure header that is to be distributed        #
    246 ########################################################################
    247 
    248 CONFIG_DIST = CbcConfig.hpp
    249 CONFIG_H = config_cbc.h
    250 $(libCbc_la_OBJECTS) $(cbc_OBJECTS) $(solve_OBJECTS): ../inc/$(CONFIG_DIST)
    251 
    252 nodist_include_HEADERS = ../inc/$(CONFIG_DIST)
    253 
    254 ../inc/$(CONFIG_DIST): ../inc/$(CONFIG_H)
    255         echo "/** Required defines from $(CONFIG_H) */" >bla.tmp
    256         echo "#ifndef __$(CONFIG_DIST)__" | sed -e 's/\./_/g' >>bla.tmp
    257         echo "#define __$(CONFIG_DIST)__" | sed -e 's/\./_/g' >>bla.tmp
    258         $(EGREP) 'COIN_|CBC_DEFAULT_SOLVER' $< >>bla.tmp
    259         echo "#endif" >>bla.tmp
    260         if test -r ../inc/$(CONFIG_DIST); then \
    261           if diff ../inc/$(CONFIG_DIST) bla.tmp >/dev/null 2>&1 ; then \
    262             rm -f bla.tmp; \
    263           else \
    264             rm -f ../inc/$(CONFIG_DIST); \
    265             mv bla.tmp ../inc/$(CONFIG_DIST); \
    266           fi; \
    267         else \
    268           mv bla.tmp ../inc/$(CONFIG_DIST); \
    269         fi
    270 
    271 CLEANFILES = bla.tmp
    272 
    273 DISTCLEANFILES = ../inc/$(CONFIG_DIST)
     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
     249ConfigHeader = CbcConfig.h
     250
     251install-exec-local:
     252        echo "#ifndef HAVE_CONFIG_H" >bla
     253        echo "#define HAVE_CONFIG_H" >>bla
     254        echo "#endif" >> bla
     255        cat $(srcdir)/$(ConfigHeader) >> bla
     256        $(install_sh_DATA) bla $(DESTDIR)$(includedir)/$(ConfigHeader)
     257        rm -f bla
     258
     259uninstall-local:
     260        rm -f $(DESTDIR)$(includedir)/$(ConfigHeader)
Note: See TracChangeset for help on using the changeset viewer.