Changeset 1541 for branches


Ignore:
Timestamp:
May 1, 2010 6:14:51 AM (12 years ago)
Author:
stefan
Message:

setup pkg-config search path in COIN_HAS_PKGCONFIG and AC_SUBST it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/split/coin.m4

    r1540 r1541  
    34063406AC_SUBST(PKG_CONFIG)
    34073407
     3408# assemble search path for pkg-config, if we are in a project setup
     3409if test x$coin_projectdir = xyes ; then
     3410  COIN_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
     3411
     3412  # let's assume that when installing into $prefix, then the user may have installed some other coin projects there before, so it's worth to have a look into there
     3413  # best would actually to use ${libdir}, since .pc files get installed into ${libdir}/pkgconfig,
     3414  # unfortunately, ${libdir} expands to ${exec_prefix}/lib and ${exec_prefix} to ${prefix}...
     3415  if test -d "${prefix}"; then
     3416    COIN_PKG_CONFIG_PATH="${prefix}/lib/pkgconfig:${COIN_PKG_CONFIG_PATH}"
     3417  fi
     3418
     3419  AC_ARG_WITH([coin-instdir],
     3420    AC_HELP_STRING([--with-coin-instdir],
     3421                   [prefix of installation directory for precompiled COIN packages]),
     3422    [if test -d "$withval"; then : ; else
     3423       AC_MSG_ERROR([argument for --with-coin-instdir not a directory])
     3424     fi
     3425     COIN_PKG_CONFIG_PATH="$withval/lib/pkgconfig:${COIN_PKG_CONFIG_PATH}"
     3426    ],[])
     3427
     3428  # in a classic setup, we want to find uninstalled projects
     3429  # their (relative) location is written to coin_subdirs.txt by the configure in the project base directory
     3430  # unfortunately, if the user set prefix, then we do not know where the project base directory is located
     3431  # but it is likely to be either .. (if we are a usual coin project) or ../.. (if we are a unusual coin project like ThirdParty or Data)
     3432  if test -e ../coin_subdirs.txt ; then
     3433    for i in `cat ../coin_subdirs.txt` ; do
     3434      COIN_PKG_CONFIG_PATH="`cd ../$i; pwd`:${COIN_PKG_CONFIG_PATH}"
     3435    done
     3436  fi
     3437   
     3438  if test -e ../../coin_subdirs.txt ; then
     3439    for i in `cat ../../coin_subdirs.txt` ; do
     3440      COIN_PKG_CONFIG_PATH="`cd ../../$i; pwd`:${COIN_PKG_CONFIG_PATH}"
     3441    done
     3442  fi
     3443
     3444  AC_SUBST(COIN_PKG_CONFIG_PATH)
     3445fi
     3446
    34083447])
    34093448
     
    36873726if test $m4_tolower(coin_has_$1) = notGiven; then
    36883727  if test -n "$PKG_CONFIG" ; then
    3689     # assemble search path for pkg-config
     3728    # set search path for pkg-config
     3729    # need to export variable to be sure that the following pkg-config gets these values
    36903730    coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
    3691 
    3692     # let's assume that when installing into $prefix, then the user may have installed some other coin projects there before, so it's worth to have a look into there
    3693     # best would actually to use ${libdir}, since .pc files get installed into ${libdir}/pkgconfig,
    3694     # unfortunately, ${libdir} expands to ${exec_prefix}/lib and ${exec_prefix} to ${prefix}...
    3695     if test -d "${prefix}"; then
    3696       PKG_CONFIG_PATH="${prefix}/lib/pkgconfig:$PKG_CONFIG_PATH"
    3697     fi
    3698 
    3699     AC_ARG_WITH([coin-instdir],
    3700       AC_HELP_STRING([--with-coin-instdir],
    3701                      [prefix of installation directory for precompiled COIN packages]),
    3702       [if test -d "$withval"; then : ; else
    3703          AC_MSG_ERROR([argument for --with-coin-instdir not a directory])
    3704        fi
    3705        PKG_CONFIG_PATH="$withval/lib/pkgconfig:$PKG_CONFIG_PATH"
    3706       ],[])
    3707 
    3708     # in a classic setup, we want to find uninstalled projects
    3709     # their (relative) location is written to coin_subdirs.txt by the configure in the project base directory
    3710     # unfortunately, if the user set prefix, then we do not know where the project base directory is located
    3711     # but it is likely to be either .. (if we are a usual coin project) or ../.. (if we are a unusual coin project like ThirdParty or Data)
    3712     if test -e ../coin_subdirs.txt ; then
    3713       for i in `cat ../coin_subdirs.txt` ; do
    3714         PKG_CONFIG_PATH="../$i:$PKG_CONFIG_PATH"
    3715       done
    3716     fi
    3717    
    3718     if test -e ../../coin_subdirs.txt ; then
    3719       for i in `cat ../../coin_subdirs.txt` ; do
    3720         PKG_CONFIG_PATH="../../$i:$PKG_CONFIG_PATH"
    3721       done
    3722     fi
     3731    PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH"
     3732    export PKG_CONFIG_PATH
    37233733   
    37243734    # let pkg-config do it's magic
    3725     # need to export variable to be sure that the following pkg-config gets these values
    3726     export PKG_CONFIG_PATH
    37273735    AC_COIN_PKG_HAS_MODULE([$1],[$2],
    37283736      [ m4_tolower(coin_has_$1)=yes
     
    37343742      ])
    37353743
     3744    # reset PKG_CONFIG_PATH variable
    37363745    PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH"
    37373746  else
Note: See TracChangeset for help on using the changeset viewer.