Changeset 1438
- Timestamp:
- Nov 1, 2009 2:12:48 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/BSPsplit/coin.m4
r1433 r1438 3430 3430 3431 3431 ########################################################################### 3432 # COIN_PKG_CHECK_PROJECT_EXISTS # 3433 ########################################################################### 3434 3435 # COIN_PKG_CHECK_PROJECT_EXISTS(PROJECT, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 3436 # 3437 # Check to see whether a particular project exists. Similar 3438 # to PKG_CHECK_MODULES(), but set only the variables $1_VERSION and $1_PKG_ERRORS variables 3439 # 3440 AC_DEFUN([AC_COIN_PKG_CHECK_PROJECT_EXISTS], 3441 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG]) 3442 if test -n "$PKG_CONFIG" ; then 3443 if $PKG_CONFIG --exists "m4_tolower($1)"; then 3444 m4_toupper($1)[]_VERSION=`$PKG_CONFIG --modversion "m4_tolower($1)" 2>/dev/null` 3445 m4_ifval([$2], [$2], [:]) 3446 else 3447 m4_toupper($1)_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "m4_tolower($1)"` 3448 $3 3449 fi 3450 else 3451 AC_MSG_ERROR("Cannot check for existance of module $1 without pkg-config") 3452 fi 3453 ]) 3454 3455 ########################################################################### 3432 3456 # COIN_PKG_CHECK_MODULE_EXISTS # 3433 3457 ########################################################################### … … 3469 3493 3470 3494 AC_COIN_PKG_CHECK_MODULE_EXISTS([$1],[$2], 3471 [ m4_toupper($1)[]_CFLAGS=`$PKG_CONFIG --cflags "m4_tolower($ 1)" 2>/dev/null`3472 m4_toupper($1)[]_LIBS=`$PKG_CONFIG --libs "m4_tolower($ 1)" 2>/dev/null`3473 m4_toupper($1)[]_DATA=`$PKG_CONFIG --variable=datadir "m4_tolower($ 1)" 2>/dev/null`3495 [ m4_toupper($1)[]_CFLAGS=`$PKG_CONFIG --cflags "m4_tolower($2)" 2>/dev/null` 3496 m4_toupper($1)[]_LIBS=`$PKG_CONFIG --libs "m4_tolower($2)" 2>/dev/null` 3497 m4_toupper($1)[]_DATA=`$PKG_CONFIG --variable=datadir "m4_tolower($2)" 2>/dev/null` 3474 3498 $3 3475 3499 ], … … 3479 3503 3480 3504 ########################################################################### 3481 # COIN_MAIN_SUBDIR2 3505 # COIN_MAIN_SUBDIR2 (deprecated) # 3482 3506 ########################################################################### 3483 3507 … … 3488 3512 # where $2 = . if not given 3489 3513 AC_DEFUN([AC_COIN_MAIN_SUBDIR2], 3490 [AC_ ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration])3491 3492 AC_MSG_CHECKING([for project $1]) 3514 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG]) 3515 AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration]) 3516 3493 3517 # First check, if the sub-project is actually available 3494 3518 … … 3602 3626 3603 3627 ########################################################################### 3628 # COIN_MAIN_PACKAGEDIR # 3629 ########################################################################### 3630 3631 # This is the macro for AC_COIN_MAIN_SUBDIRS taking care of ONE (or two or three) argument(s) 3632 # It calles AC_COIN_HAS_PROJECT with the given argument(s) and adds $1 to the CONFIG_SUBDIRS, if 3633 # either argument $3 is given and the file $2/$1/$3 is available in $srcdir, 3634 # or $3 is not given and the file $2/$1/configure is available in $srcdir, 3635 # where $2 = . if not given 3636 AC_DEFUN([AC_COIN_MAIN_PACKAGEDIR], 3637 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG]) 3638 AC_MSG_CHECKING([whether project $1 is available]) 3639 3640 m4_tolower(coin_has_$1)=notGiven 3641 3642 # check if user wants to skip project in any case 3643 AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration]) 3644 if test x"$COIN_SKIP_PROJECTS" != x; then 3645 for dir in $COIN_SKIP_PROJECTS; do 3646 if test $dir = "$1"; then 3647 m4_tolower(coin_has_$1)=skipping 3648 fi 3649 if test $dir = "$2/$1"; then 3650 m4_tolower(coin_has_$1)=skipping 3651 fi 3652 done 3653 fi 3654 3655 if test $m4_tolower(coin_has_$1) != skipping; then 3656 if test $PACKAGE_TARNAME = m4_tolower($1); then 3657 m4_tolower(coin_has_$1)=. 3658 fi 3659 3660 AC_ARG_WITH([m4_tolower($1)-lib], 3661 AC_HELP_STRING([--with-m4_tolower($1)-lib], 3662 [linker flags for using project $1]), 3663 [m4_tolower(coin_has_$1)=installed], 3664 []) 3665 3666 AC_ARG_WITH([m4_tolower($1)-incdir], 3667 AC_HELP_STRING([--with-m4_tolower($1)-incdir], 3668 [directory with header files for using project $1]), 3669 [m4_tolower(coin_has_$1)=installed], 3670 []) 3671 3672 AC_ARG_WITH([m4_tolower($1)-datadir], 3673 AC_HELP_STRING([--with-m4_tolower($1)-datadir], 3674 [directory with data files for using project $1]), 3675 [m4_tolower(coin_has_$1)=installed], 3676 []) 3677 fi 3678 3679 if test $m4_tolower(coin_has_$1) = notGiven; then 3680 #only if pkg-config is available: 3681 #see if user gives directory where project might be installed: assemble search path for pkg-config 3682 if test -n "$PKG_CONFIG" ; then 3683 coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" 3684 AC_ARG_WITH([coin-instdir], 3685 AC_HELP_STRING([--with-coin-instdir], 3686 [prefix of installation directory for precompiled COIN packages]), 3687 [if test -d "$withval"; then : ; else 3688 AC_MSG_ERROR([argument for --with-coin-instdir not a directory]) 3689 fi 3690 PKG_CONFIG_PATH="$withval/lib/$2/pkgconfig:$PKG_CONFIG_PATH" 3691 ],[]) 3692 3693 # let pkgconfig check if the project is already installed somewhere 3694 # need to export variable to be sure that the following pkg-config call gets these values 3695 export PKG_CONFIG_PATH 3696 AC_COIN_PKG_CHECK_PROJECT_EXISTS([$1], [m4_tolower(coin_has_$1)="$m4_toupper($1)_VERSION"]) 3697 3698 PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" 3699 fi 3700 fi 3701 3702 # if not found yet, check if project is available in present directory 3703 if test "$m4_tolower(coin_has_$1)" = notGiven; then 3704 if test -d $srcdir/$2/$1; then 3705 coin_pkg_is_here=no 3706 m4_ifvaln([$3], 3707 [for i in $srcdir/$2/$1/$3; do 3708 if test -r $i; then 3709 coin_pkg_is_here=yes 3710 fi 3711 done], 3712 [ coin_pkg_is_here=yes ]) 3713 if test $coin_pkg_is_here = yes; then 3714 m4_tolower(coin_has_$1)=$2/$1 3715 fi 3716 fi 3717 fi 3718 3719 AC_MSG_RESULT([$m4_tolower(coin_has_$1)]) 3720 3721 AC_MSG_CHECKING(whether project $1 need to be configured) 3722 if test "$m4_tolower(coin_has_$1)" != skipping && 3723 test "$m4_tolower(coin_has_$1)" != notGiven && 3724 test "$m4_tolower(coin_has_$1)" != installed; then 3725 3726 if test -r $srcdir/$2/$1/configure; then 3727 coin_subdirs="$coin_subdirs m4_ifval($2,[$2/],)$1" 3728 AC_MSG_RESULT(yes) 3729 AC_CONFIG_SUBDIRS(m4_ifval($2,[$2/],)$1) 3730 else 3731 AC_MSG_RESULT(no) 3732 fi 3733 else 3734 AC_MSG_RESULT(no) 3735 fi 3736 ]) 3737 3738 ########################################################################### 3604 3739 # COIN_HAS_PROJECT2 # 3605 3740 ########################################################################### … … 3758 3893 # check if directory $srcdir/../$1 exists and add ../$1 to the PKG_CONFIG_PATH 3759 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 3760 3896 if test -d $srcdir/../$pkgname; then 3761 3897 PKG_CONFIG_PATH="../$pkgname:$PKG_CONFIG_PATH" 3762 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 3763 3906 ]) # AC_COIN_HAS_MODULE_HELPER 3764 3907 … … 3801 3944 AC_SUBST(m4_toupper($1_CFLAGS)) 3802 3945 AC_SUBST(m4_toupper($1_DATA)) 3946 AC_SUBST(REQUIREDPACKAGES) 3803 3947 3804 3948 #check if user provided LIBS, CFLAGS, and DATA for module … … 3809 3953 [linker flags for using module $1]), 3810 3954 [m4_tolower(coin_has_$1)=yes 3811 m4_toupper($1_LIBS)="$withval"], 3955 m4_toupper($1_LIBS)="$withval" 3956 ADDLIBS="$ADDLIBS $withval" 3957 ], 3812 3958 []) 3813 3959 … … 3838 3984 AC_MSG_ERROR([argument for --with-coin-instdir not a directory]) 3839 3985 fi 3840 PKG_CONFIG_PATH="$withval/lib/pkgconfig:$ PKG_CONFIG_PATH",3986 PKG_CONFIG_PATH="$withval/lib/pkgconfig:$withval/lib/ThirdParty/pkgconfig:$withval/lib/Data/pkgconfig:$PKG_CONFIG_PATH", 3841 3987 ],[]) 3842 3988 … … 3859 4005 AC_MSG_RESULT([yes: $m4_toupper($1)_VERSIONS]) 3860 4006 REQUIREDPACKAGES="$REQUIREDPACKAGES $module_content" 3861 AC_SUBST(REQUIREDPACKAGES)3862 4007 ], 3863 4008 [ m4_tolower(coin_has_$1)=notGiven … … 3876 4021 if test $m4_tolower(coin_has_$1) != skipping && 3877 4022 test $m4_tolower(coin_has_$1) != notGiven ; then 3878 if test "x$m4_toupper($1)_CFLAGS" != x; then4023 if test -n "$m4_toupper($1)_CFLAGS" ; then 3879 4024 AC_MSG_NOTICE([$1 CFLAGS are $m4_toupper($1)_CFLAGS]) 3880 4025 fi 3881 if test "x$m4_toupper($1)_LIBS" != x; then4026 if test -n "$m4_toupper($1)_LIBS" ; then 3882 4027 AC_MSG_NOTICE([$1 LIBS are $m4_toupper($1)_LIBS]) 3883 4028 fi 3884 if test "x$m4_toupper($1)_DATA" != x; then4029 if test -n "$m4_toupper($1)_DATA" ; then 3885 4030 AC_MSG_NOTICE([$1 DATA is $m4_toupper($1)_DATA]) 3886 4031 fi
Note: See TracChangeset
for help on using the changeset viewer.