Ignore:
Timestamp:
Nov 4, 2009 5:31:07 AM (11 years ago)
Author:
stefan
Message:

change COIN_HAS_MODULE again: require list of packages in only one string and pick up search path from project base directory (if existing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/BSPsplit/coin.m4

    r1438 r1440  
    37373737
    37383738###########################################################################
    3739 #                            COIN_HAS_PROJECT2                            #
     3739#                            COIN_HAS_PROJECT2 (deprecated)               #
    37403740###########################################################################
    37413741
     
    38843884]) # AC_COIN_HAS_PROJECT2
    38853885
    3886 AC_DEFUN([AC_COIN_HAS_MODULE_HELPER],
    3887 [
    3888 module_content="$module_content m4_tolower($1)"
    3889 
    3890 # extract the package name: get everything before first space
    3891 pkgname=`echo "$1" | sed -e 's/ .*//g'`
    3892 
    3893 # check if directory $srcdir/../$1 exists and add ../$1 to the PKG_CONFIG_PATH
    3894 # this is for the classic setup where an uninstalled project can be found in ../$1
    3895 # we do the same for ThirdParty/$1 and Data/$1; it's not nice but the only way I see to easily get around these nonstandard locations
    3896 if test -d $srcdir/../$pkgname; then
    3897   PKG_CONFIG_PATH="../$pkgname:$PKG_CONFIG_PATH"
    3898 fi
    3899 if test -d $srcdir/../ThirdParty/$pkgname; then
    3900   PKG_CONFIG_PATH="../ThirdParty/$pkgname$PKG_CONFIG_PATH"
    3901 fi
    3902 if test -d $srcdir/../Data/$pkgname; then
    3903   PKG_CONFIG_PATH="../Data/$pkgname:$PKG_CONFIG_PATH"
    3904 fi
    3905 
    3906 ]) # AC_COIN_HAS_MODULE_HELPER
    3907 
    39083886###########################################################################
    39093887#                            COIN_HAS_MODULE                              #
     
    39173895# Further, tolower(coin_has_$1) is set to "yes" and the packages of the module are added to
    39183896# the REQUIREDPACKAGES variable, which can be used to setup a .pc file.
    3919 # The argument should be the name (MODULE) of the module (in correct lower
    3920 # and upper case), and a list of projects that belong to this module.
     3897# The first argument should be the name (MODULE) of the module (in correct lower
     3898# and upper case).
     3899# The second argument should be a (space separated) list of projects which this
     3900# module consists of. Optionally, required version numbers could be added.
    39213901#
    39223902# It is also possible to specify a preinstalled version of this module
     
    39743954
    39753955if test $m4_tolower(coin_has_$1) = notGiven; then
    3976   #assemble search path for pkg-config
    39773956  if test -n "$PKG_CONFIG" ; then
     3957    # assemble search path for pkg-config
    39783958    coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
    39793959
     
    39873967      ],[])
    39883968
    3989     # go through $2 to ... and assemble PKG_CONFIG_PATH with ../$2 and module search string
    3990     module_content=""
    3991     m4_ifvaln([$2], AC_COIN_HAS_MODULE_HELPER([$2]))
    3992     m4_ifvaln([$3], AC_COIN_HAS_MODULE_HELPER([$3]))
    3993     m4_ifvaln([$4], AC_COIN_HAS_MODULE_HELPER([$4]))
    3994     m4_ifvaln([$5], AC_COIN_HAS_MODULE_HELPER([$5]))
    3995     m4_ifvaln([$6], AC_COIN_HAS_MODULE_HELPER([$6]))
    3996     m4_ifvaln([$7], AC_COIN_HAS_MODULE_HELPER([$7]))
    3997     m4_ifvaln([$8], AC_COIN_HAS_MODULE_HELPER([$8]))
    3998     m4_ifvaln([$9], AC_COIN_HAS_MODULE_HELPER([$9]))
     3969    if test -e ${prefix}/coin_subdirs.txt ; then
     3970      for i in `cat ${prefix}/coin_subdirs.txt` ; do
     3971        PKG_CONFIG_PATH="${prefix}/$i:$PKG_CONFIG_PATH"
     3972      done
     3973    fi
    39993974
    40003975    # let pkg-config do it's magic
    40013976    # need to export variable to be sure that the following pkg-config gets these values
    40023977    export PKG_CONFIG_PATH
    4003     AC_COIN_PKG_HAS_MODULE([$1],[$module_content],
     3978    AC_COIN_PKG_HAS_MODULE([$1],[$2],
    40043979      [ m4_tolower(coin_has_$1)=yes
    40053980        AC_MSG_RESULT([yes: $m4_toupper($1)_VERSIONS])
    4006         REQUIREDPACKAGES="$REQUIREDPACKAGES $module_content"
     3981        REQUIREDPACKAGES="$REQUIREDPACKAGES $2"
    40073982      ],
    40083983      [ m4_tolower(coin_has_$1)=notGiven
     
    40394014
    40404015]) # AC_COIN_HAS_MODULE
    4041 
Note: See TracChangeset for help on using the changeset viewer.