Changeset 2108


Ignore:
Timestamp:
Feb 20, 2011 3:34:50 PM (9 years ago)
Author:
stefan
Message:

fix last commit on AC_COIN_MAIN_PACKAGEDIR macro and simplify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r2106 r2108  
    28832883# Otherwise, if the directory $2/$1 and the file $2/$1/$3 exist, check whether $2/$1/configure exists.
    28842884#   If so, include this directory into the list of directories where configure and make recourse into.
    2885 # tolower(coin_has_$1) is set to a string starting with "no" if the project source is not available or
    2886 # will not be compiled. Otherwise, it will be set to a string starting with "yes".
     2885# tolower(coin_has_$1) is set to "no" if the project source is not available or will not be compiled.
     2886# Otherwise, it will be set to "yes".
    28872887
    28882888AC_DEFUN([AC_COIN_MAIN_PACKAGEDIR],[
    28892889AC_MSG_CHECKING([whether source of project $1 is available and should be compiled])
    28902890
    2891 m4_tolower(coin_has_$1)=no
    2892 coin_have_project_dir=no
     2891m4_tolower(coin_has_$1)=notGiven
     2892coin_reason=
    28932893
    28942894# check if user wants to skip project in any case
     
    28972897  for dir in $COIN_SKIP_PROJECTS; do
    28982898    if test $dir = "$1"; then
    2899       m4_tolower(coin_has_$1)="no, $1 has been specified in COIN_SKIP_PROJECTS"
     2899      m4_tolower(coin_has_$1)="no"
     2900      coin_reason="$1 has been specified in COIN_SKIP_PROJECTS"
    29002901    fi
    29012902    m4_ifval($2,[
    29022903    if test $dir = "$2/$1"; then
    2903       m4_tolower(coin_has_$1)="no, $2/$1 has been specified in COIN_SKIP_PROJECTS"
     2904      m4_tolower(coin_has_$1)="no"
     2905      coin_reason="$2/$1 has been specified in COIN_SKIP_PROJECTS"
    29042906    fi])
    29052907  done
    29062908fi
    29072909
    2908 if test "$m4_tolower(coin_has_$1)" != skipping; then
    2909   if test $PACKAGE_TARNAME = m4_tolower($1); then
    2910     m4_tolower(coin_has_$1)=yes
    2911     coin_have_project_dir=yes
    2912   fi
    2913 
     2910if test "$m4_tolower(coin_has_$1)" != no; then
    29142911  AC_ARG_WITH([m4_tolower($1)-lib],
    29152912    AC_HELP_STRING([--with-m4_tolower($1)-lib],
    29162913                   [linker flags for using project $1]),
    29172914    [if test "$withval" = no ; then
    2918        m4_tolower(coin_has_$1)="no, --without-m4_tolower($1)-lib has been specified"
     2915       m4_tolower(coin_has_$1)="no"
     2916       coin_reason="--without-m4_tolower($1)-lib has been specified"
    29192917     else
    2920        m4_tolower(coin_has_$1)="no, --with-m4_tolower($1)-lib has been specified"
     2918       m4_tolower(coin_has_$1)="no"
     2919       coin_reason="--with-m4_tolower($1)-lib has been specified"
    29212920     fi],
    29222921    [])
    29232922fi
    29242923
    2925 if test "$m4_tolower(coin_has_$1)" != skipping; then
     2924if test "$m4_tolower(coin_has_$1)" != no; then
    29262925  AC_ARG_WITH([m4_tolower($1)-incdir],
    29272926    AC_HELP_STRING([--with-m4_tolower($1)-incdir],
    29282927                   [directory with header files for using project $1]),
    29292928    [if test "$withval" = no ; then
    2930        m4_tolower(coin_has_$1)="no, --without-m4_tolower($1)-incdir has been specified"
     2929       m4_tolower(coin_has_$1)="no"
     2930       coin_reason="--without-m4_tolower($1)-incdir has been specified"
    29312931     else
    2932        m4_tolower(coin_has_$1)="no, --with-m4_tolower($1)-incdir has been specified"
     2932       m4_tolower(coin_has_$1)="no"
     2933       coin_reason="--with-m4_tolower($1)-incdir has been specified"
    29332934     fi],
    29342935    [])
    29352936fi
    29362937
    2937 if test "$m4_tolower(coin_has_$1)" != skipping; then
     2938if test "$m4_tolower(coin_has_$1)" != no; then
    29382939  AC_ARG_WITH([m4_tolower($1)-datadir],
    29392940    AC_HELP_STRING([--with-m4_tolower($1)-datadir],
    29402941                   [directory with data files for using project $1]),
    29412942    [if test "$withval" = no ; then
    2942        m4_tolower(coin_has_$1)="no, --without-m4_tolower($1)-datadir has been specified"
     2943       m4_tolower(coin_has_$1)="no"
     2944       coin_reason="--without-m4_tolower($1)-datadir has been specified"
    29432945     else
    2944        m4_tolower(coin_has_$1)="no, --with-m4_tolower($1)-datadir has been specified"
     2946       m4_tolower(coin_has_$1)="no"
     2947       coin_reason="--with-m4_tolower($1)-datadir has been specified"
    29452948     fi],
    29462949    [])
     
    29482951
    29492952m4_if(m4_tolower($1), blas, [
    2950   if test $m4_tolower(coin_has_$1) != skipping; then
     2953  if test $m4_tolower(coin_has_$1) != no; then
    29512954    #--with-blas can overwrite --with-blas-lib, and can be set to BUILD to enforce building blas
    29522955    AC_ARG_WITH([blas],
    29532956      AC_HELP_STRING([--with-blas], [specify BLAS library (or BUILD to enforce use of ThirdParty/Blas)]),
    2954         [if test x"$withval" = "xBUILD" ; then
    2955            coin_has_blas=notGiven
    2956          elif test x"$withval" = "xno" ; then
    2957            coin_has_blas="no, --without-blas has been specified"
    2958          else
    2959            coin_has_blas="no, --with-blas has been specified"
     2957        [if test x"$withval" = "xno" ; then
     2958           coin_has_blas="no"
     2959           coin_reason="--without-blas has been specified"
     2960         elif test x"$withval" != "xBUILD" ; then
     2961           coin_has_blas="no"
     2962           coin_reason="--with-blas has been specified"
    29602963         fi],
    29612964        [])
     
    29682971    AC_ARG_WITH([lapack],
    29692972      AC_HELP_STRING([--with-lapack], [specify LAPACK library (or BUILD to enforce use of ThirdParty/Lapack)]),
    2970         [if test x"$withval" = "xBUILD" ; then
    2971            coin_has_lapack=notGiven
    2972          elif test x"$withval" = "xno" ; then
    2973            coin_has_lapack="no, --without-lapack has been specified"
    2974          else
    2975            coin_has_lapack="no, --with-lapack has been specified"
     2973        [if test x"$withval" = "xno" ; then
     2974           coin_has_lapack="no"
     2975           coin_reason="--without-lapack has been specified"
     2976         elif test x"$withval" != "xBUILD" ; then
     2977           coin_has_lapack="no"
     2978           coin_reason="--with-lapack has been specified"
    29762979         fi],
    29772980        [])
     
    29812984# check if project is available in present directory
    29822985if test "$m4_tolower(coin_has_$1)" = notGiven; then
    2983   $m4_tolower(coin_has_$1)=no
    2984   if test -d $srcdir/$2/$1; then
     2986  m4_tolower(coin_has_$1)=no
     2987  if test -d $srcdir/m4_ifval($2,[$2/],)$1; then
     2988    coin_reason="source in m4_ifval($2,[$2/],)$1"
    29852989    # If a third argument is given, then we have to check if one one the files given in that third argument is present.
    29862990    # If none of the files in the third argument is available, then we consider the project directory as non-existing.
     
    29892993      [for i in $srcdir/m4_ifval($2,[$2/],)$1/$3; do
    29902994         if test -r $i; then
    2991            coin_have_project_dir=yes
     2995           m4_tolower(coin_has_$1)="yes"
     2996         else
     2997           m4_tolower(coin_has_$1)="no"
     2998           coin_reason="source file $i not available"
     2999           break
    29923000         fi
    29933001       done],
    2994       [ coin_have_project_dir=yes ])
    2995     if test $coin_have_project_dir = yes; then
    2996       m4_tolower(coin_has_$1)="yes, source in m4_ifval($2,[$2/],)$1"
    2997     fi
    2998   fi
    2999 fi
    3000 
    3001 AC_MSG_RESULT([$m4_tolower(coin_has_$1)])
    3002 
    3003 if test "$coin_have_project_dir" = yes ; then
     3002      [ m4_tolower(coin_has_$1)="yes" ])
     3003  fi
     3004fi
     3005
     3006if test -z "$coin_reason" ; then
     3007  AC_MSG_RESULT([$m4_tolower(coin_has_$1)])
     3008else
     3009  AC_MSG_RESULT([$m4_tolower(coin_has_$1), $coin_reason])
     3010fi
     3011
     3012if test "$m4_tolower(coin_has_$1)" = yes ; then
    30043013  if test -r $srcdir/m4_ifval($2,[$2/],)$1/configure; then
    30053014    coin_subdirs="$coin_subdirs m4_ifval($2,[$2/],)$1"
Note: See TracChangeset for help on using the changeset viewer.