Changeset 1455
- Timestamp:
- Nov 29, 2009 3:48:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/BSPsplit/coin.m4
r1452 r1455 3396 3396 3397 3397 ########################################################################### 3398 # COIN_PKG_CHECK_EXISTS (deprecated) #3399 ###########################################################################3400 3401 # COIN_PKG_CHECK_EXISTS(MODULE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])3402 #3403 # Check to see whether a particular module exists. Similar3404 # to PKG_CHECK_MODULES(), but set only the variables $1_VERSION and $1_PKG_ERRORS variables3405 #3406 AC_DEFUN([AC_COIN_PKG_CHECK_EXISTS],3407 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG])3408 if test -n "$PKG_CONFIG" ; then3409 if $PKG_CONFIG --exists "m4_tolower($1)"; then3410 m4_toupper($1)[]_VERSION=`$PKG_CONFIG --modversion "m4_tolower($1)" 2>/dev/null`3411 m4_ifval([$2], [$2], [:])3412 else3413 m4_toupper($1)_PKG_ERRORS=`$PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "m4_tolower($1)"`3414 $33415 fi3416 else3417 AC_MSG_ERROR("Cannot check for existance of module $1 without pkg-config")3418 fi3419 ])3420 3421 3422 ###########################################################################3423 # COIN_PKG_CHECK_MODULE (deprecated) #3424 ###########################################################################3425 3426 # COIN_PKG_CHECK_MODULE(MODULE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])3427 #3428 # Checks whether a pkg-config file for a given module is available.3429 # If so, sets MODULE_CFLAGS, MODULE_LIBS, and MODULES_DATA and executes ACTION-IF-FOUND.3430 # If not, then ACTION-IF-NOT-FOUND is executed.3431 # A reason for not finding a package is stored in MODULE_PKG_ERRORS3432 #3433 # --------------------------------------------------------------3434 AC_DEFUN([AC_COIN_PKG_CHECK_MODULE],3435 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG])3436 3437 AC_COIN_PKG_CHECK_EXISTS([$1],3438 [ m4_toupper($1)[]_CFLAGS=`$PKG_CONFIG --cflags "m4_tolower($1)" 2>/dev/null`3439 m4_toupper($1)[]_LIBS=`$PKG_CONFIG --libs "m4_tolower($1)" 2>/dev/null`3440 m4_toupper($1)[]_DATA=`$PKG_CONFIG --variable=datadir "m4_tolower($1)" 2>/dev/null`3441 $23442 ],3443 [ $3 ])3444 3445 ])# PKG_CHECK_MODULES3446 3447 ###########################################################################3448 3398 # COIN_PKG_CHECK_PROJECT_EXISTS # 3449 3399 ########################################################################### … … 3497 3447 ########################################################################### 3498 3448 3499 # COIN_PKG_ CHECK_MODULE(MODULE, PACKAGES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])3449 # COIN_PKG_HAS_MODULE(MODULE, PACKAGES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 3500 3450 # 3501 3451 # Checks whether pkg-config files for a given set of packages is available. … … 3519 3469 3520 3470 ########################################################################### 3521 # COIN_MAIN_SUBDIR2 (deprecated) # 3522 ########################################################################### 3523 3524 # This is the macro for AC_COIN_MAIN_SUBDIRS taking care of ONE (or two or three) argument(s) 3525 # It calles AC_COIN_HAS_PROJECT with the given argument(s) and adds $1 to the CONFIG_SUBDIRS, if 3526 # either argument $3 is given and the file $2/$1/$3 is available in $srcdir, 3527 # or $3 is not given and the file $2/$1/configure is available in $srcdir, 3528 # where $2 = . if not given 3529 AC_DEFUN([AC_COIN_MAIN_SUBDIR2], 3471 # COIN_MAIN_PACKAGEDIR # 3472 ########################################################################### 3473 3474 # This macro substitutes COIN_MAIN_SUBDIR. 3475 # If $2/$1 or $1 is in COIN_SKIP_PROJECTS, do nothing. 3476 # If --with-$1-lib, --with-$1-incdir, or --with-$1-datadir is given, then assume that the package is installed. 3477 # Otherwise, if pkg-config is available, use it to check whether package is available. 3478 # Otherwise, if the directory subdir/package and the file subdir/package/file exist, check whether subdir/package/configure exists. 3479 # If so, include this directory into the list of directories where configure and make recourse into. 3480 # tolower(coin_has_$1) is set to notGiven, skipping, installed, or the projects main directory (if uninstalled). 3481 3482 AC_DEFUN([AC_COIN_MAIN_PACKAGEDIR], 3530 3483 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG]) 3484 AC_MSG_CHECKING([whether project $1 is available]) 3485 3486 m4_tolower(coin_has_$1)=notGiven 3487 3488 # check if user wants to skip project in any case 3531 3489 AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration]) 3532 3533 # First check, if the sub-project is actually available3534 3535 m4_tolower(coin_has_$1)=notGiven3536 3537 # check if user wants to skip project in any case3538 3490 if test x"$COIN_SKIP_PROJECTS" != x; then 3539 3491 for dir in $COIN_SKIP_PROJECTS; do … … 3572 3524 3573 3525 if test $m4_tolower(coin_has_$1) = notGiven; then 3526 #only if pkg-config is available: 3574 3527 #see if user gives directory where project might be installed: assemble search path for pkg-config 3575 coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" 3576 AC_ARG_WITH([coin-instdir], 3577 AC_HELP_STRING([--with-coin-instdir], 3578 [prefix of installation directory for precompiled COIN packages]), 3579 [if test -d "$withval"; then : ; else 3580 AC_MSG_ERROR([argument for --with-coin-instdir not a directory]) 3581 fi 3582 PKG_CONFIG_PATH="$withval/lib/$2/pkgconfig:$PKG_CONFIG_PATH" 3583 ],[]) 3584 3585 # AC_ARG_WITH([m4_tolower($1)], 3586 # AC_HELP_STRING([--with-m4_tolower($1)], 3587 # [prefix of installation directory for precompiled $1 package]), 3588 # [if test -d "$withval"; then : ; else 3589 # AC_MSG_ERROR([argument for --with-m4_tolower($1) not a directory]) 3590 # fi 3591 # # maybe the user points directly to the directory with the .pc file 3592 # PKG_CONFIG_PATH="$withval:$PKG_CONFIG_PATH" 3593 # # maybe the user points to a project main directory 3594 # if test -d "$withval/lib/$2/pkgconfig"; then 3595 # PKG_CONFIG_PATH="$withval/lib/$2/pkgconfig:$PKG_CONFIG_PATH" 3596 # fi 3597 # ],[]) 3598 3599 # let pkgconfig check if the project is already installed somewhere 3600 # need to export variable to be sure that the following pkg-config call gets these values 3601 export PKG_CONFIG_PATH 3602 AC_COIN_PKG_CHECK_EXISTS([$1], [m4_tolower(coin_has_$1)="$m4_toupper($1)_VERSION"]) 3603 3604 PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" 3528 if test -n "$PKG_CONFIG" ; then 3529 coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" 3530 3531 # 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 3532 if test -d "$prefix"; then 3533 PKG_CONFIG_PATH="$prefix/lib/$2/pkgconfig:$PKG_CONFIG_PATH" 3534 fi 3535 3536 AC_ARG_WITH([coin-instdir], 3537 AC_HELP_STRING([--with-coin-instdir], 3538 [prefix of installation directory for precompiled COIN packages]), 3539 [if test -d "$withval"; then : ; else 3540 AC_MSG_ERROR([argument for --with-coin-instdir not a directory]) 3541 fi 3542 PKG_CONFIG_PATH="$withval/lib/$2/pkgconfig:$PKG_CONFIG_PATH" 3543 ],[]) 3544 3545 # let pkgconfig check if the project is already installed somewhere 3546 # need to export variable to be sure that the following pkg-config call gets these values 3547 export PKG_CONFIG_PATH 3548 AC_COIN_PKG_CHECK_PROJECT_EXISTS([$1], [m4_tolower(coin_has_$1)="$m4_toupper($1)_VERSION"]) 3549 3550 PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH" 3551 fi 3605 3552 fi 3606 3553 … … 3640 3587 fi 3641 3588 ]) 3642 3643 ###########################################################################3644 # COIN_MAIN_PACKAGEDIR #3645 ###########################################################################3646 3647 # This is the macro for AC_COIN_MAIN_SUBDIRS taking care of ONE (or two or three) argument(s)3648 # It calles AC_COIN_HAS_PROJECT with the given argument(s) and adds $1 to the CONFIG_SUBDIRS, if3649 # either argument $3 is given and the file $2/$1/$3 is available in $srcdir,3650 # or $3 is not given and the file $2/$1/configure is available in $srcdir,3651 # where $2 = . if not given3652 AC_DEFUN([AC_COIN_MAIN_PACKAGEDIR],3653 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG])3654 AC_MSG_CHECKING([whether project $1 is available])3655 3656 m4_tolower(coin_has_$1)=notGiven3657 3658 # check if user wants to skip project in any case3659 AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration])3660 if test x"$COIN_SKIP_PROJECTS" != x; then3661 for dir in $COIN_SKIP_PROJECTS; do3662 if test $dir = "$1"; then3663 m4_tolower(coin_has_$1)=skipping3664 fi3665 if test $dir = "$2/$1"; then3666 m4_tolower(coin_has_$1)=skipping3667 fi3668 done3669 fi3670 3671 if test $m4_tolower(coin_has_$1) != skipping; then3672 if test $PACKAGE_TARNAME = m4_tolower($1); then3673 m4_tolower(coin_has_$1)=.3674 fi3675 3676 AC_ARG_WITH([m4_tolower($1)-lib],3677 AC_HELP_STRING([--with-m4_tolower($1)-lib],3678 [linker flags for using project $1]),3679 [m4_tolower(coin_has_$1)=installed],3680 [])3681 3682 AC_ARG_WITH([m4_tolower($1)-incdir],3683 AC_HELP_STRING([--with-m4_tolower($1)-incdir],3684 [directory with header files for using project $1]),3685 [m4_tolower(coin_has_$1)=installed],3686 [])3687 3688 AC_ARG_WITH([m4_tolower($1)-datadir],3689 AC_HELP_STRING([--with-m4_tolower($1)-datadir],3690 [directory with data files for using project $1]),3691 [m4_tolower(coin_has_$1)=installed],3692 [])3693 fi3694 3695 if test $m4_tolower(coin_has_$1) = notGiven; then3696 #only if pkg-config is available:3697 #see if user gives directory where project might be installed: assemble search path for pkg-config3698 if test -n "$PKG_CONFIG" ; then3699 coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"3700 AC_ARG_WITH([coin-instdir],3701 AC_HELP_STRING([--with-coin-instdir],3702 [prefix of installation directory for precompiled COIN packages]),3703 [if test -d "$withval"; then : ; else3704 AC_MSG_ERROR([argument for --with-coin-instdir not a directory])3705 fi3706 PKG_CONFIG_PATH="$withval/lib/$2/pkgconfig:$PKG_CONFIG_PATH"3707 ],[])3708 3709 # let pkgconfig check if the project is already installed somewhere3710 # need to export variable to be sure that the following pkg-config call gets these values3711 export PKG_CONFIG_PATH3712 AC_COIN_PKG_CHECK_PROJECT_EXISTS([$1], [m4_tolower(coin_has_$1)="$m4_toupper($1)_VERSION"])3713 3714 PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH"3715 fi3716 fi3717 3718 # if not found yet, check if project is available in present directory3719 if test "$m4_tolower(coin_has_$1)" = notGiven; then3720 if test -d $srcdir/$2/$1; then3721 coin_pkg_is_here=no3722 m4_ifvaln([$3],3723 [for i in $srcdir/$2/$1/$3; do3724 if test -r $i; then3725 coin_pkg_is_here=yes3726 fi3727 done],3728 [ coin_pkg_is_here=yes ])3729 if test $coin_pkg_is_here = yes; then3730 m4_tolower(coin_has_$1)=$2/$13731 fi3732 fi3733 fi3734 3735 AC_MSG_RESULT([$m4_tolower(coin_has_$1)])3736 3737 AC_MSG_CHECKING(whether project $1 need to be configured)3738 if test "$m4_tolower(coin_has_$1)" != skipping &&3739 test "$m4_tolower(coin_has_$1)" != notGiven &&3740 test "$m4_tolower(coin_has_$1)" != installed; then3741 3742 if test -r $srcdir/$2/$1/configure; then3743 coin_subdirs="$coin_subdirs m4_ifval($2,[$2/],)$1"3744 AC_MSG_RESULT(yes)3745 AC_CONFIG_SUBDIRS(m4_ifval($2,[$2/],)$1)3746 else3747 AC_MSG_RESULT(no)3748 fi3749 else3750 AC_MSG_RESULT(no)3751 fi3752 ])3753 3754 ###########################################################################3755 # COIN_HAS_PROJECT2 (deprecated) #3756 ###########################################################################3757 3758 # This macro sets up usage of a Coin package. It defines the3759 # PKG_CFLAGS and PKG_LIBS variables, refering to the compiler and linker3760 # flags to use when linking against this package.3761 # It also defines a COIN_HAS_PKG preprocessor macro and makefile conditional.3762 # The argument should be the name (Pkg) of the project (in correct lower3763 # and upper case), optionally a directory where to look at it, and3764 # optionally a file that need to be present in the package directory.3765 #3766 # It is also possible to specify a preinstalled version of this Coin3767 # package or to specify only the linker and compiler flags.3768 3769 AC_DEFUN([AC_COIN_HAS_PROJECT2],3770 [AC_MSG_CHECKING([for COIN project $1])3771 3772 m4_tolower(coin_has_$1)=notGiven3773 3774 # check if user wants to skip project in any case3775 if test x"$COIN_SKIP_PROJECTS" != x; then3776 for dir in $COIN_SKIP_PROJECTS; do3777 if test $dir = "$1"; then3778 m4_tolower(coin_has_$1)=skipping3779 fi3780 if test $dir = "$2/$1"; then3781 m4_tolower(coin_has_$1)=skipping3782 fi3783 done3784 fi3785 3786 m4_toupper($1_LIBS)=3787 m4_toupper($1_CFLAGS)=3788 m4_toupper($1_DATA)=3789 AC_SUBST(m4_toupper($1_LIBS))3790 AC_SUBST(m4_toupper($1_CFLAGS))3791 AC_SUBST(m4_toupper($1_DATA))3792 3793 if test $m4_tolower(coin_has_$1) != skipping; then3794 if test $PACKAGE_TARNAME = m4_tolower($1); then3795 m4_tolower(coin_has_$1)=.3796 fi3797 3798 AC_ARG_WITH([m4_tolower($1)-lib],3799 AC_HELP_STRING([--with-m4_tolower($1)-lib],3800 [linker flags for using project $1]),3801 [m4_tolower(coin_has_$1)=yes3802 m4_toupper($1_LIBS)="$withval"],3803 [])3804 3805 AC_ARG_WITH([m4_tolower($1)-incdir],3806 AC_HELP_STRING([--with-m4_tolower($1)-incdir],3807 [directory with header files for using project $1]),3808 [m4_tolower(coin_has_$1)=yes3809 m4_toupper($1_CFLAGS)="-I$withval"],3810 [])3811 3812 AC_ARG_WITH([m4_tolower($1)-datadir],3813 AC_HELP_STRING([--with-m4_tolower($1)-datadir],3814 [directory with data files for using project $1]),3815 [m4_tolower(coin_has_$1)=yes3816 m4_toupper($1_DATA)="$withval"],3817 [])3818 fi3819 3820 if test $m4_tolower(coin_has_$1) = notGiven; then3821 #assemble search path for pkg-config3822 coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"3823 3824 AC_ARG_WITH([coin-instdir],3825 AC_HELP_STRING([--with-coin-instdir],3826 [prefix of installation directory for precompiled COIN packages]),3827 [if test -d "$withval"; then : ; else3828 AC_MSG_ERROR([argument for --with-coin-instdir not a directory])3829 fi3830 PKG_CONFIG_PATH="$withval/lib/$2/pkgconfig:$PKG_CONFIG_PATH",3831 ],[])3832 3833 # AC_ARG_WITH([m4_tolower($1)],3834 # AC_HELP_STRING([--with-m4_tolower($1)],3835 # [prefix of installation directory for precompiled $1 package]),3836 # [if test -d "$withval"; then : ; else3837 # AC_MSG_ERROR([argument for --with-m4_tolower($1) not a directory])3838 # fi3839 # #if the user points directly to the directory with the .pc file3840 # PKG_CONFIG_PATH="$withval:$PKG_CONFIG_PATH"3841 # #if the user points to a project main directory3842 # if test -d "$withval/lib/$2/pkgconfig"; then3843 # PKG_CONFIG_PATH="$withval/lib/$2/pkgconfig:$PKG_CONFIG_PATH"3844 # fi3845 # ],[])3846 3847 # check if uninstalled project can be found in ../$2/$13848 # this is for the classic setup when this macro is called from the project main directory3849 if test -d $srcdir/../$2/$1; then3850 coin_pkg_is_here=no3851 m4_ifvaln([$3],3852 [for i in $srcdir/../$2/$1/$3; do3853 if test -r $i; then3854 coin_pkg_is_here=yes3855 fi3856 done],3857 [ coin_pkg_is_here=yes ])3858 if test $coin_pkg_is_here = yes; then3859 PKG_CONFIG_PATH="../$2/$1:$PKG_CONFIG_PATH"3860 fi3861 fi3862 3863 # let pkg-config do it's magic3864 # need to export variable to be sure that the following pkg-config gets these values3865 export PKG_CONFIG_PATH3866 AC_COIN_PKG_CHECK_MODULE([$1],3867 [ m4_tolower(coin_has_$1)=$m4_toupper($1)_VERSION3868 AC_MSG_RESULT([$m4_tolower(coin_has_$1)])3869 ],3870 [ m4_tolower(coin_has_$1)=notGiven3871 AC_MSG_RESULT([not given: $m4_toupper($1)_PKG_ERRORS])3872 ])3873 3874 PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH"3875 3876 else3877 AC_MSG_RESULT([$m4_tolower(coin_has_$1)])3878 fi3879 3880 if test $m4_tolower(coin_has_$1) != skipping &&3881 test $m4_tolower(coin_has_$1) != notGiven ; then3882 if test "x$m4_toupper($1)_CFLAGS" != x ; then3883 AC_MSG_NOTICE([$1 CFLAGS are $m4_toupper($1)_CFLAGS])3884 fi3885 if test "x$m4_toupper($1)_LIBS" != x ; then3886 AC_MSG_NOTICE([$1 LIBS are $m4_toupper($1)_LIBS])3887 ADDLIBS="$m4_toupper($1)_LIBS $ADDLIBS"3888 fi3889 if test "x$m4_toupper($1)_DATA" != x ; then3890 AC_MSG_NOTICE([$1 DATA is $m4_toupper($1)_DATA])3891 fi3892 AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],[Define to 1 if the $1 package is used])3893 fi3894 3895 # Define the Makefile conditional3896 AM_CONDITIONAL(m4_toupper(COIN_HAS_$1),3897 [test $m4_tolower(coin_has_$1) != notGiven &&3898 test $m4_tolower(coin_has_$1) != skipping])3899 3900 ]) # AC_COIN_HAS_PROJECT23901 3589 3902 3590 ###########################################################################
Note: See TracChangeset
for help on using the changeset viewer.