Changeset 1900


Ignore:
Timestamp:
Dec 4, 2010 10:23:54 AM (9 years ago)
Author:
stefan
Message:

create X_DEPENDENCIES variable which is content of X_LIBS variable, with everything starting with '-' substituted out; AC_SUBST _INSTALLED variables also if pkg-config is available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r1879 r1900  
    39243924# This macro checks for the existance of a COIN-OR package and provides compiler and linker flags to compile against this package.
    39253925# A package can consists of one or more COIN-OR or other projects.
    3926 # It defines the PACKAGE_CFLAGS, PACKAGE_LIBS, and PACKAGE_DATA variables, referring to the compiler and linker
    3927 # flags to use when linking against this module and the directories where the module data resists.
     3926# It defines the PACKAGE_CFLAGS, PACKAGE_LIBS, PACKAGE_DEPENDENCIES, and PACKAGE_DATA variables, referring to the compiler and linker
     3927# flags to use when linking against this module, the libraries the package depends on, and the directories where the module data resists.
     3928# The difference between PACKAGE_LIBS and PACKAGE_DEPENDENCIES is that PACKAGE_DEPENDENCIES does not contain arguments starting with '-',
     3929# so it can be used to setup the _DEPENDENCIES variable in a Makefile.am.
    39283930# It also defines a COIN_HAS_PACKAGE preprocessor macro and makefile conditional.
    39293931# Further, tolower(coin_has_$1) is set to "yes".
     
    39313933# then the compiler and linker variables and .pc file setup variable corresponding to this build target
    39323934# are extended with the values for this package.
    3933 # That is, for each build target X, the variables X_CFLAGS, X_LIBS, X_PCLIBS, X_PCREQUIRES are setup,
     3935# That is, for each build target X, the variables X_CFLAGS, X_LIBS, X_DEPENDENCIES, X_PCLIBS, X_PCREQUIRES are setup,
    39343936# whereas the last two specify the values to put into the "Libs:" and "Requires:" fields of the .pc file, resp.
    39353937#
     
    39683970AC_SUBST(m4_toupper($1_CFLAGS))
    39693971AC_SUBST(m4_toupper($1_DATA))
     3972AC_SUBST(m4_toupper($1_DEPENDENCIES))
     3973AC_SUBST(m4_toupper($1_LIBS_INSTALLED))
     3974AC_SUBST(m4_toupper($1_CFLAGS_INSTALLED))
     3975AC_SUBST(m4_toupper($1_DATA_INSTALLED))
    39703976coin_foreach_w([myvar], [$3], [
    39713977  AC_SUBST(m4_toupper(myvar)_CFLAGS)
     
    39733979  AC_SUBST(m4_toupper(myvar)_PCLIBS)
    39743980  AC_SUBST(m4_toupper(myvar)_PCREQUIRES)
     3981  AC_SUBST(m4_toupper(myvar)_DEPENDENCIES)
     3982  AC_SUBST(m4_toupper(myvar)_CFLAGS_INSTALLED)
     3983  AC_SUBST(m4_toupper(myvar)_LIBS_INSTALLED)
    39753984])
    39763985
     
    40484057   test $m4_tolower(coin_has_$1) != notGiven ; then
    40494058  AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],[Define to 1 if the $1 package is available])
    4050    
     4059
     4060  # construct dependencies variables from LIBS variables
     4061  # we add an extra space in LIBS so we can substitute out everything starting with " -"
     4062  m4_toupper($1)_DEPENDENCIES=`echo " $m4_toupper($1)_LIBS" | [sed -e 's/ -[^ ]*//g']`
     4063  coin_foreach_w([myvar], [$3], [
     4064    m4_toupper(myvar)_DEPENDENCIES=`echo " $m4_toupper(myvar)_LIBS" | [sed -e 's/ -[^ ]*//g']`
     4065  ])
     4066
    40514067  if test 1 = 0 ; then  #change this test to enable a bit of debugging output
    40524068    if test -n "$m4_toupper($1)_CFLAGS" ; then
     
    40564072      AC_MSG_NOTICE([$1 LIBS   are $m4_toupper($1)_LIBS])
    40574073    fi
     4074    if test -n "$m4_toupper($1)_DEPENDENCIES" ; then
     4075      AC_MSG_NOTICE([$1 DEPENDENCIES are $m4_toupper($1)_DEPENDENCIES])
     4076    fi
    40584077    if test -n "$m4_toupper($1)_DATA" ; then
    40594078      AC_MSG_NOTICE([$1 DATA   is  $m4_toupper($1)_DATA])
     
    40654084      AC_MSG_NOTICE([myvar CFLAGS are $m4_toupper(myvar)_CFLAGS])
    40664085      AC_MSG_NOTICE([myvar LIBS   are $m4_toupper(myvar)_LIBS])
     4086      AC_MSG_NOTICE([myvar DEPENDENCIES are $m4_toupper(myvar)_DEPENDENCIES])
    40674087    ])
    40684088  fi
     
    43074327    m4_toupper(myvar)_CFLAGS_INSTALLED="$m4_toupper($1)_CFLAGS_INSTALLED $m4_toupper(myvar)_CFLAGS_INSTALLED"
    43084328    m4_toupper(myvar)_LIBS_INSTALLED="$m4_toupper($1)_LIBS_INSTALLED $m4_toupper(myvar)_LIBS_INSTALLED"
    4309     AC_SUBST(m4_toupper(myvar)_CFLAGS_INSTALLED)
    4310     AC_SUBST(m4_toupper(myvar)_LIBS_INSTALLED)
    43114329  ])
    4312   AC_SUBST(m4_toupper($1)_DATA_INSTALLED)
    4313 
    4314   if test 1 = 0 ; then  #change this test to enable a bit of debugging output
    4315     if test -n "$m4_toupper($1)_CFLAGS" ; then
    4316       AC_MSG_NOTICE([$1 CFLAGS are $m4_toupper($1)_CFLAGS])
    4317     fi
    4318     if test -n "$m4_toupper($1)_LIBS" ; then
    4319       AC_MSG_NOTICE([$1 LIBS   are $m4_toupper($1)_LIBS])
    4320     fi
    4321     if test -n "$m4_toupper($1)_DATA" ; then
    4322       AC_MSG_NOTICE([$1 DATA   is  $m4_toupper($1)_DATA])
    4323     fi
    4324     if test -n "$m4_toupper($1)_CFLAGS_INSTALLED" ; then
    4325       AC_MSG_NOTICE([$1 CFLAGS_INSTALLED are $m4_toupper($1)_CFLAGS_INSTALLED])
    4326     fi
    4327     if test -n "$m4_toupper($1)_LIBS_INSTALLED" ; then
    4328       AC_MSG_NOTICE([$1 LIBS_INSTALLED   are $m4_toupper($1)_LIBS_INSTALLED])
    4329     fi
    4330     if test -n "$m4_toupper($1)_DATA_INSTALLED" ; then
    4331       AC_MSG_NOTICE([$1 DATA_INSTALLED   is  $m4_toupper($1)_DATA_INSTALLED])
    4332     fi
    4333     coin_foreach_w([myvar], [$3], [
    4334       AC_MSG_NOTICE([])
    4335       AC_MSG_NOTICE([myvar CFLAGS are $m4_toupper(myvar)_CFLAGS])
    4336       AC_MSG_NOTICE([myvar LIBS   are $m4_toupper(myvar)_LIBS])
    4337       AC_MSG_NOTICE([myvar CFLAGS_INSTALLED are $m4_toupper(myvar)_CFLAGS_INSTALLED])
    4338       AC_MSG_NOTICE([myvar LIBS_INSTALLED   are $m4_toupper(myvar)_LIBS_INSTALLED])
    4339     ])
    4340   fi
    43414330
    43424331fi
Note: See TracChangeset for help on using the changeset viewer.