Changeset 1308
- Timestamp:
- Jul 7, 2009 12:45:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/BSPsplit/coin.m4
r1272 r1308 17 17 ########################################################################### 18 18 19 # This is the macro for AC_COIN_MAIN_SUBDIRS taking care of ONE argument 20 AC_DEFUN([AC_COIN_MAIN_SUBDIR], 21 [AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration]) 22 23 addthis=no 24 case $1 in 25 */* ) 26 # This must be Data/Simple or something else 27 AC_MSG_CHECKING(whether directory $1 should be recursed into) 28 coin_skip=no 29 if test x"$COIN_SKIP_PROJECTS" != x; then 30 for dir in $COIN_SKIP_PROJECTS; do 31 if test $dir = $1; then 32 coin_skip=yes 33 fi 34 done 35 fi 36 if test $coin_skip = yes; then 37 AC_MSG_RESULT(skipping) 38 elif test -r $srcdir/$1/configure; then 39 coin_subdirs="$coin_subdirs $1" 40 AC_MSG_RESULT(yes) 41 addthis=yes 42 else 43 AC_MSG_RESULT(no) 44 fi 45 ;; 46 * ) 47 AC_COIN_HAS_PROJECT($1) 48 AC_MSG_CHECKING(whether directory $1 should be recursed into) 49 if test "$m4_tolower(coin_has_$1)" != skipped && 50 test "$m4_tolower(coin_has_$1)" != installed; then 51 if test -r $srcdir/$1/configure; then 52 coin_subdirs="$coin_subdirs $1" 53 AC_MSG_RESULT(yes) 54 addthis=yes 55 else 56 AC_MSG_RESULT(no) 57 fi 58 else 59 AC_MSG_RESULT(no) 60 fi 61 ;; 62 esac 63 if test $addthis = yes; then 64 AC_CONFIG_SUBDIRS($1) 65 fi 66 ]) 67 19 68 # This macro sets up the recursion into configure scripts into 20 69 # subdirectories. Each possible subdirectory should be provided as a … … 23 72 24 73 AC_DEFUN([AC_COIN_MAIN_SUBDIRS], 25 [AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration]) 26 27 m4_ifvaln([$1],[AC_MSG_CHECKING(whether directory $1 is available) 28 coin_skip=no 29 if test x"$COIN_SKIP_PROJECTS" != x; then 30 for dir in $COIN_SKIP_PROJECTS; do 31 if test $dir = $1; then 32 coin_skip=yes 33 fi 34 done 35 fi 36 if test $coin_skip = yes; then 37 AC_MSG_RESULT(skipping) 38 elif test -r $srcdir/$1/configure; then 39 coin_subdirs="$coin_subdirs $1" 40 AC_MSG_RESULT(yes) 41 AC_CONFIG_SUBDIRS($1) 42 else 43 AC_MSG_RESULT(no) 44 fi]) 45 m4_ifvaln([$2],[AC_MSG_CHECKING(whether directory $2 is available) 46 coin_skip=no 47 if test x"$COIN_SKIP_PROJECTS" != x; then 48 for dir in $COIN_SKIP_PROJECTS; do 49 if test $dir = $2; then 50 coin_skip=yes 51 fi 52 done 53 fi 54 if test $coin_skip = yes; then 55 AC_MSG_RESULT(skipping) 56 elif test -r $srcdir/$2/configure; then 57 coin_subdirs="$coin_subdirs $2" 58 AC_MSG_RESULT(yes) 59 AC_CONFIG_SUBDIRS($2) 60 else 61 AC_MSG_RESULT(no) 62 fi]) 63 m4_ifvaln([$3],[AC_MSG_CHECKING(whether directory $3 is available) 64 coin_skip=no 65 if test x"$COIN_SKIP_PROJECTS" != x; then 66 for dir in $COIN_SKIP_PROJECTS; do 67 if test $dir = $3; then 68 coin_skip=yes 69 fi 70 done 71 fi 72 if test $coin_skip = yes; then 73 AC_MSG_RESULT(skipping) 74 elif test -r $srcdir/$3/configure; then 75 coin_subdirs="$coin_subdirs $3" 76 AC_MSG_RESULT(yes) 77 AC_CONFIG_SUBDIRS($3) 78 else 79 AC_MSG_RESULT(no) 80 fi]) 81 m4_ifvaln([$4],[AC_MSG_CHECKING(whether directory $4 is available) 82 coin_skip=no 83 if test x"$COIN_SKIP_PROJECTS" != x; then 84 for dir in $COIN_SKIP_PROJECTS; do 85 if test $dir = $4; then 86 coin_skip=yes 87 fi 88 done 89 fi 90 if test $coin_skip = yes; then 91 AC_MSG_RESULT(skipping) 92 elif test -r $srcdir/$4/configure; then 93 coin_subdirs="$coin_subdirs $4" 94 AC_MSG_RESULT(yes) 95 AC_CONFIG_SUBDIRS($4) 96 else 97 AC_MSG_RESULT(no) 98 fi]) 99 m4_ifvaln([$5],[AC_MSG_CHECKING(whether directory $5 is available) 100 coin_skip=no 101 if test x"$COIN_SKIP_PROJECTS" != x; then 102 for dir in $COIN_SKIP_PROJECTS; do 103 if test $dir = $5; then 104 coin_skip=yes 105 fi 106 done 107 fi 108 if test $coin_skip = yes; then 109 AC_MSG_RESULT(skipping) 110 elif test -r $srcdir/$5/configure; then 111 coin_subdirs="$coin_subdirs $5" 112 AC_MSG_RESULT(yes) 113 AC_CONFIG_SUBDIRS($5) 114 else 115 AC_MSG_RESULT(no) 116 fi]) 117 m4_ifvaln([$6],[AC_MSG_CHECKING(whether directory $6 is available) 118 coin_skip=no 119 if test x"$COIN_SKIP_PROJECTS" != x; then 120 for dir in $COIN_SKIP_PROJECTS; do 121 if test $dir = $6; then 122 coin_skip=yes 123 fi 124 done 125 fi 126 if test $coin_skip = yes; then 127 AC_MSG_RESULT(skipping) 128 elif test -r $srcdir/$6/configure; then 129 coin_subdirs="$coin_subdirs $6" 130 AC_MSG_RESULT(yes) 131 AC_CONFIG_SUBDIRS($6) 132 else 133 AC_MSG_RESULT(no) 134 fi]) 135 m4_ifvaln([$7],[AC_MSG_CHECKING(whether directory $7 is available) 136 coin_skip=no 137 if test x"$COIN_SKIP_PROJECTS" != x; then 138 for dir in $COIN_SKIP_PROJECTS; do 139 if test $dir = $7; then 140 coin_skip=yes 141 fi 142 done 143 fi 144 if test $coin_skip = yes; then 145 AC_MSG_RESULT(skipping) 146 elif test -r $srcdir/$7/configure; then 147 coin_subdirs="$coin_subdirs $7" 148 AC_MSG_RESULT(yes) 149 AC_CONFIG_SUBDIRS($7) 150 else 151 AC_MSG_RESULT(no) 152 fi]) 153 m4_ifvaln([$8],[AC_MSG_CHECKING(whether directory $8 is available) 154 coin_skip=no 155 if test x"$COIN_SKIP_PROJECTS" != x; then 156 for dir in $COIN_SKIP_PROJECTS; do 157 if test $dir = $8; then 158 coin_skip=yes 159 fi 160 done 161 fi 162 if test $coin_skip = yes; then 163 AC_MSG_RESULT(skipping) 164 elif test -r $srcdir/$8/configure; then 165 coin_subdirs="$coin_subdirs $8" 166 AC_MSG_RESULT(yes) 167 AC_CONFIG_SUBDIRS($8) 168 else 169 AC_MSG_RESULT(no) 170 fi]) 171 m4_ifvaln([$9],[AC_MSG_CHECKING(whether directory $9 is available) 172 coin_skip=no 173 if test x"$COIN_SKIP_PROJECTS" != x; then 174 for dir in $COIN_SKIP_PROJECTS; do 175 if test $dir = $9; then 176 coin_skip=yes 177 fi 178 done 179 fi 180 if test $coin_skip = yes; then 181 AC_MSG_RESULT(skipping) 182 elif test -r $srcdir/$9/configure; then 183 coin_subdirs="$coin_subdirs $9" 184 AC_MSG_RESULT(yes) 185 AC_CONFIG_SUBDIRS($9) 186 else 187 AC_MSG_RESULT(no) 188 fi]) 189 m4_ifvaln([$10],[AC_MSG_CHECKING(whether directory $10 is available) 190 coin_skip=no 191 if test x"$COIN_SKIP_PROJECTS" != x; then 192 for dir in $COIN_SKIP_PROJECTS; do 193 if test $dir = $10; then 194 coin_skip=yes 195 fi 196 done 197 fi 198 if test $coin_skip = yes; then 199 AC_MSG_RESULT(skipping) 200 elif test -r $srcdir/$10/configure; then 201 coin_subdirs="$coin_subdirs $10" 202 AC_MSG_RESULT(yes) 203 AC_CONFIG_SUBDIRS($10) 204 else 205 AC_MSG_RESULT(no) 206 fi]) 74 [m4_ifvaln([$1],[AC_COIN_MAIN_SUBDIR($1)]) 75 m4_ifvaln([$2],[AC_COIN_MAIN_SUBDIR($2)]) 76 m4_ifvaln([$3],[AC_COIN_MAIN_SUBDIR($3)]) 77 m4_ifvaln([$4],[AC_COIN_MAIN_SUBDIR($4)]) 78 m4_ifvaln([$5],[AC_COIN_MAIN_SUBDIR($5)]) 79 m4_ifvaln([$6],[AC_COIN_MAIN_SUBDIR($6)]) 80 m4_ifvaln([$7],[AC_COIN_MAIN_SUBDIR($7)]) 81 m4_ifvaln([$8],[AC_COIN_MAIN_SUBDIR($8)]) 82 m4_ifvaln([$9],[AC_COIN_MAIN_SUBDIR($9)]) 83 m4_ifvaln([$10],[AC_COIN_MAIN_SUBDIR($10)]) 84 207 85 ]) # AC_COIN_MAIN_SUBDIRS 208 86 … … 2473 2351 # a COIN_HAS_PKG preprocessor macro and makefile conditional. The 2474 2352 # argument should be the name (Pkg) of the project (in correct lower 2475 # and upper case) 2353 # and upper case). 2354 # 2355 # It is also possible to specify a preinstalled version of this Coin 2356 # package. In this case, only PKGINSTDIR is set to the prefix of that 2357 # installation. If the user is providing such a preinstalled version, 2358 # this macro checks for a header (second argument) and the existance 2359 # of a library file (third argument - only the stub without extension 2360 # is to be given, e.g., "libCoinUtils"). 2476 2361 2477 2362 AC_DEFUN([AC_COIN_HAS_PROJECT], … … 2481 2366 # other locations) 2482 2367 2483 m4_tolower(coin_has_$1)= unavailable2368 m4_tolower(coin_has_$1)=notGiven 2484 2369 if test x"$COIN_SKIP_PROJECTS" != x; then 2485 2370 for dir in $COIN_SKIP_PROJECTS; do … … 2490 2375 fi 2491 2376 2377 AC_SUBST(m4_toupper($1SRCDIR)) 2378 AC_SUBST(m4_toupper($1OBJDIR)) 2379 AC_SUBST(m4_toupper($1DOCDIR)) 2380 AC_SUBST(m4_toupper($1INSTDIR)) 2381 m4_toupper($1SRCDIR)=This_Variable_Is_Not_Set 2382 m4_toupper($1OBJDIR)=This_Variable_Is_Not_Set 2383 m4_toupper($1DOCDIR)=This_Variable_Is_Not_Set 2384 m4_toupper($1INSTDIR)=This_Variable_Is_Not_Set 2385 2492 2386 if test $m4_tolower(coin_has_$1) != skipping; then 2493 2387 if test $PACKAGE_TARNAME = m4_tolower($1); then 2494 2388 m4_tolower(coin_has_$1)=. 2495 2389 else 2496 if test -d $srcdir/../$1; then 2497 m4_tolower(coin_has_$1)=../$1 2498 fi 2499 fi 2500 fi 2501 2502 if test $m4_tolower(coin_has_$1) != unavailable && 2390 AC_ARG_WITH([m4_tolower($1)-instdir], 2391 AC_HELP_STRING([--with-m4_tolower($1)-instdir], 2392 [prefix of installation directory for precompiled $1 package]), 2393 [m4_tolower(coin_has_$1)=installed 2394 if test -d "$withval"; then : ; else 2395 AC_MSG_ERROR([argument for --with-m4_tolower($1)-instdir not a directory]) 2396 fi 2397 m4_toupper($1INSTDIR)=`cd $withval; pwd`], []) 2398 2399 AC_ARG_WITH([m4_tolower($1)-srcdir], 2400 AC_HELP_STRING([--with-m4_tolower($1)-srcdir], 2401 [source directory for $1 package]), 2402 [if test "$m4_tolower(coin_has_$1)" = installed; then 2403 AC_MSG_ERROR([--with-$m4_tolower($1)-srcdir cannot be given together with --with-m4_tolower($1)-instdir]) 2404 fi 2405 if test -d "$withval"; then : ; else 2406 AC_MSG_ERROR([argument for --with-m4_tolower($1)-srcdir not a directory]) 2407 fi 2408 m4_tolower(coin_has_$1)=$withval 2409 m4_toupper($1SRCDIR)=`cd $withval; pwd`], []) 2410 2411 AC_ARG_WITH([m4_tolower($1)-objdir], 2412 AC_HELP_STRING([--with-m4_tolower($1)-objdir], 2413 [object directory for $1 package (if different from source directory in VPATH compilation)]), 2414 [if test "$m4_tolower(coin_has_$1)" = installed; then 2415 AC_MSG_ERROR([--with-m4_tolower($1)-objdir cannot be given together with --with-m4_tolower($1)-instdir]) 2416 fi 2417 if test "$m4_tolower(coin_has_$1)" = notGiven; then 2418 AC_MSG_ERROR([--with-m4_tolower($1)-objdir must be accompanied by --with-m4_tolower($1)-srcdir]) 2419 fi 2420 if test -d "$withval"; then : ; else 2421 AC_MSG_ERROR([argument for --with-m4_tolower($1)-objdir not a directory]) 2422 fi 2423 m4_toupper($1OBJDIR)=`cd $withval; pwd`], [m4_toupper($1OBJDIR)="$m4_toupper($1SRCDIR)"]) 2424 2425 # if we still don't have a location, check for generic flag 2426 if test "$m4_tolower(coin_has_$1)" = notGiven; then 2427 AC_ARG_WITH([coin-instdir], 2428 AC_HELP_STRING([--with-coin-instdir], 2429 [prefix of installation directory for precompiled COIN packages]), 2430 [m4_tolower(coin_has_$1)=installed 2431 if test -d "$withval"; then : ; else 2432 AC_MSG_ERROR([argument for --with-coin-instdir not a directory]) 2433 fi 2434 m4_toupper($1INSTDIR)=`cd $withval; pwd`], []) 2435 fi 2436 2437 if test "$m4_tolower(coin_has_$1)" = notGiven; then 2438 if test -d $srcdir/../$1; then 2439 m4_tolower(coin_has_$1)=../$1 2440 fi 2441 fi 2442 fi 2443 fi 2444 2445 if test $m4_tolower(coin_has_$1) != notGiven && 2503 2446 test $m4_tolower(coin_has_$1) != skipping; then 2504 2447 # Set the #define if the component is available 2505 2448 AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],[Define to 1 if the $1 package is used]) 2506 2449 2507 # Set the variables for source and object code location 2508 AC_SUBST(m4_toupper($1SRCDIR)) 2509 m4_toupper($1SRCDIR)=`cd $srcdir/$m4_tolower(coin_has_$1); pwd` 2510 AC_SUBST(m4_toupper($1OBJDIR)) 2511 m4_toupper($1OBJDIR)=`pwd`/$m4_tolower(coin_has_$1) 2512 AC_SUBST(m4_toupper($1DOCDIR)) 2513 m4_toupper($1DOCDIR)=$abs_lib_dir/../share/doc/coin/$1 2450 if test $m4_tolower(coin_has_$1) = installed; then 2451 m4_toupper($1DOCDIR)=$m4_toupper($1INSTDIR)/share/doc/coin/$1 2452 else 2453 if test "$m4_toupper($1OBJDIR)" = This_Variable_Is_Not_Set; then 2454 # Set the variables for source and object code location 2455 m4_toupper($1SRCDIR)=`cd $srcdir/$m4_tolower(coin_has_$1); pwd` 2456 m4_toupper($1OBJDIR)=`pwd`/$m4_tolower(coin_has_$1) 2457 m4_toupper($1DOCDIR)=$abs_lib_dir/../share/doc/coin/$1 2458 else 2459 # This is just a guess: 2460 m4_toupper($1DOCDIR)=$m4_toupper($1OBJDIR)/../share/doc/coin/$1 2461 fi 2462 fi 2514 2463 fi 2515 2464 2516 2465 # Define the Makefile conditional 2517 2466 AM_CONDITIONAL(m4_toupper(COIN_HAS_$1), 2518 [test $m4_tolower(coin_has_$1) != unavailable&&2467 [test $m4_tolower(coin_has_$1) != notGiven && 2519 2468 test $m4_tolower(coin_has_$1) != skipping]) 2520 AC_MSG_RESULT([$m4_tolower(coin_has_$1)]) 2469 AM_CONDITIONAL(m4_toupper(COIN_HAS_$1_INSTALLED), 2470 [test $m4_tolower(coin_has_$1) = installed]) 2471 2472 if test $m4_tolower(coin_has_$1) = installed; then 2473 AC_MSG_RESULT([installed in $m4_toupper($1INSTDIR)]) 2474 # Check for header 2475 m4_ifvaln([$2],[tmp=$m4_toupper($1INSTDIR)/include/coin 2476 AC_MSG_CHECKING(whether header $2 is available in $tmp) 2477 if test -r $tmp/$2; then 2478 AC_MSG_RESULT([yes]) 2479 else 2480 AC_MSG_RESULT([no]) 2481 AC_MSG_ERROR([Header $2 not available in $1 installation directory]) 2482 fi]) 2483 # Check for library (this is not qo reliable) 2484 m4_ifvaln([$3],[tmp=$m4_toupper($1INSTDIR)/lib 2485 AC_MSG_CHECKING(whether library $3.* is available in $tmp) 2486 bla=`ls $tmp/$3.* 2>/dev/null | head -n 1` 2487 if test x"$bla" = x; then 2488 AC_MSG_RESULT([no]) 2489 AC_MSG_ERROR([Library $3.* not available in $1 installation directory]) 2490 else 2491 AC_MSG_RESULT([found $bla]) 2492 fi]) 2493 else 2494 AC_MSG_RESULT([$m4_tolower(coin_has_$1)]) 2495 fi 2521 2496 ]) # AC_COIN_HAS_PROJECT 2522 2497
Note: See TracChangeset
for help on using the changeset viewer.