Changeset 1380


Ignore:
Timestamp:
Jul 26, 2009 4:03:41 PM (11 years ago)
Author:
stefan
Message:

allow second argument for COIN_MAIN_SUBDIR and COIN_HAS_PROJECT to make recognition of project optionally depend on existence on further file (similar to COIN_THIRDPARTY_SUBDIR)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/BSPsplit/coin.m4

    r1375 r1380  
    1717###########################################################################
    1818
    19 # This is the macro for AC_COIN_MAIN_SUBDIRS taking care of ONE argument
     19# This is the macro for AC_COIN_MAIN_SUBDIRS taking care of ONE (or two) argument(s)
     20# It calles AC_COIN_HAS_PROJECT for the project given in $1 and adds $1 to the CONFIG_SUBDIRS, if
     21# either argument $2 is given and the file $1/$2 is available in $srcdir,
     22# or $2 is not given and the file $1/configure is available in $srcdir
    2023AC_DEFUN([AC_COIN_MAIN_SUBDIR],
    2124[AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration])
    2225
    23 # This is a hack to find out if there is a "/" in the name, which would
    24 # break the AC_COIN_HAS_PROJECT macro
    25 m4_case($1,m4_bpatsubsts($1,[/],[_]),
    26 [# We have no "/" in the $1 argument
    27   AC_COIN_HAS_PROJECT($1)
    28   AC_MSG_CHECKING(whether directory $1 should be recursed into)
    29   if test "$m4_tolower(coin_has_$1)" != skipping &&
    30      test "$m4_tolower(coin_has_$1)" != installed; then
    31     if test -r $srcdir/$1/configure; then
    32       coin_subdirs="$coin_subdirs $1"
    33       AC_MSG_RESULT(yes)
    34       AC_CONFIG_SUBDIRS($1)
    35     else
    36       AC_MSG_RESULT(no)
    37     fi
    38   else
    39     AC_MSG_RESULT(no)
    40   fi],
    41 [# This must be Data/Simple or something else
    42   AC_MSG_CHECKING(whether directory $1 should be recursed into)
    43   coin_skip=no
    44   if test x"$COIN_SKIP_PROJECTS" != x; then
    45     for dir in $COIN_SKIP_PROJECTS; do
    46       if test $dir = $1; then
    47         coin_skip=yes
    48       fi
    49     done
    50   fi
    51   if test $coin_skip = yes; then
    52     AC_MSG_RESULT(skipping)
    53   elif test -r $srcdir/$1/configure; then
     26#replace backslashes by underscore
     27m4_define([escape], m4_bpatsubsts([$1],[/],[_]))
     28
     29# AC_COIN_HAS_PROJECT also checks whether $2 is available in $1, if not it sets coin_has... to notGiven
     30AC_COIN_HAS_PROJECT($1,$2)
     31AC_MSG_CHECKING(whether directory $1 should be recursed into)
     32if test "$m4_tolower(coin_has_[]escape($1))" != skipping &&
     33   test "$m4_tolower(coin_has_[]escape($1))" != notGiven &&
     34   test "$m4_tolower(coin_has_[]escape($1))" != installed; then
     35
     36  if test -r $srcdir/$1/configure; then
    5437    coin_subdirs="$coin_subdirs $1"
    5538    AC_MSG_RESULT(yes)
     
    5740  else
    5841    AC_MSG_RESULT(no)
    59   fi])
     42  fi
     43else
     44  AC_MSG_RESULT(no)
     45fi
    6046])
    6147
     
    24532439    if test "$m4_tolower(coin_has_[]escape($1))" = notGiven; then
    24542440      if test -d $srcdir/../$1; then
    2455         m4_tolower(coin_has_[]escape($1))=../$1
     2441        m4_ifvaln([$2],
     2442          [if test -r $srcdir/$1/$2; then
     2443            m4_tolower(coin_has_[]escape($1))=../$1
     2444          fi],
     2445          [ m4_tolower(coin_has_[]escape($1))=../$1 ]
     2446        )
    24562447      fi
    24572448    fi
Note: See TracChangeset for help on using the changeset viewer.