Changeset 1623


Ignore:
Timestamp:
Jul 21, 2010 8:44:56 AM (9 years ago)
Author:
stefan
Message:

use COIN_PKG_CONFIG_PATH also in AC_COIN_MAIN_PACKAGEDIR

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r1622 r1623  
    34793479AC_SUBST(PKG_CONFIG)
    34803480
    3481 # assemble search path for pkg-config, if we are in a project setup
     3481# assemble search path for pkg-config
     3482COIN_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
     3483
     3484# 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
     3485# best would actually to use ${libdir}, since .pc files get installed into ${libdir}/pkgconfig,
     3486# unfortunately, ${libdir} expands to ${exec_prefix}/lib and ${exec_prefix} to ${prefix}...
     3487if test -d "${prefix}"; then
     3488  COIN_PKG_CONFIG_PATH="${prefix}/lib/pkgconfig:${COIN_PKG_CONFIG_PATH}"
     3489fi
     3490
     3491AC_ARG_WITH([coin-instdir],
     3492  AC_HELP_STRING([--with-coin-instdir],
     3493                 [prefix of installation directory for precompiled COIN packages]),
     3494  [if test -d "$withval"; then : ; else
     3495     AC_MSG_ERROR([argument for --with-coin-instdir not a directory])
     3496   fi
     3497   COIN_PKG_CONFIG_PATH="$withval/lib/pkgconfig:${COIN_PKG_CONFIG_PATH}"
     3498  ],[])
     3499
    34823500if test x$coin_projectdir = xyes ; then
    3483   COIN_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
    3484 
    3485   # 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
    3486   # best would actually to use ${libdir}, since .pc files get installed into ${libdir}/pkgconfig,
    3487   # unfortunately, ${libdir} expands to ${exec_prefix}/lib and ${exec_prefix} to ${prefix}...
    3488   if test -d "${prefix}"; then
    3489     COIN_PKG_CONFIG_PATH="${prefix}/lib/pkgconfig:${COIN_PKG_CONFIG_PATH}"
    3490   fi
    3491 
    3492   AC_ARG_WITH([coin-instdir],
    3493     AC_HELP_STRING([--with-coin-instdir],
    3494                    [prefix of installation directory for precompiled COIN packages]),
    3495     [if test -d "$withval"; then : ; else
    3496        AC_MSG_ERROR([argument for --with-coin-instdir not a directory])
    3497      fi
    3498      COIN_PKG_CONFIG_PATH="$withval/lib/pkgconfig:${COIN_PKG_CONFIG_PATH}"
    3499     ],[])
    3500 
    3501   # in a classic setup, we want to find uninstalled projects
     3501  # if we are in a project setup, then in a classic setup, we want to find uninstalled projects
    35023502  # their (relative) location is written to coin_subdirs.txt by the configure in the project base directory
    35033503  # unfortunately, if the user set prefix, then we do not know where the project base directory is located
     
    35103510    done
    35113511  fi
    3512    
     3512
    35133513  if test -e ../../coin_subdirs.txt ; then
    35143514    for i in `cat ../../coin_subdirs.txt` ; do
     
    35193519  fi
    35203520
    3521   AC_SUBST(COIN_PKG_CONFIG_PATH)
    3522 fi
    3523 
     3521fi
     3522
     3523AC_SUBST(COIN_PKG_CONFIG_PATH)
    35243524])
    35253525
     
    35623562  if $PKG_CONFIG --exists "$2"; then
    35633563    m4_toupper($1)[]_VERSIONS="`$PKG_CONFIG --modversion $2 2>/dev/null`"
    3564     m4_ifval([$3], [$3], [:])
     3564    $3
    35653565  else
    35663566    m4_toupper($1)_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors $2`
     
    36873687
    36883688if test $m4_tolower(coin_has_$1) = notGiven; then
    3689   #only if pkg-config is available:
    3690   #see if user gives directory where project might be installed: assemble search path for pkg-config
     3689  #check for project by using pkg-config, if pkg-config is available
    36913690  if test -n "$PKG_CONFIG" ; then
    3692     coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
    3693    
    3694     # 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
    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     # let pkgconfig check if the project is already installed somewhere
    3709     # need to export variable to be sure that the following pkg-config call gets these values
    3710     export PKG_CONFIG_PATH
    3711     AC_COIN_PKG_CHECK_PROJECT_EXISTS(m4_ifval([$4],[$4],[$1]), [m4_tolower(coin_has_$1)="$m4_toupper(m4_ifval([$4],[$4],[$1]))_VERSION"])
    3712 
    3713     PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH"
     3691    ( PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" ; export PKG_CONFIG_PATH
     3692      m4_ifval([$4],
     3693        [AC_COIN_PKG_CHECK_PROJECT_EXISTS([$4],
     3694                [m4_tolower(coin_has_$1)="$m4_toupper([$4])_VERSION"])],
     3695              [AC_COIN_PKG_CHECK_PROJECT_EXISTS([$1],
     3696                [m4_tolower(coin_has_$1)="$m4_toupper([$1])_VERSION"])]) )
    37143697  fi
    37153698fi
Note: See TracChangeset for help on using the changeset viewer.