Changeset 2106 for trunk


Ignore:
Timestamp:
Feb 20, 2011 2:59:59 PM (9 years ago)
Author:
stefan
Message:

define COIN_PRJCT variable in PROJECTDIR_INIT instead of DEBUG macro; revise some docu; no need to check for installed versions of projects in AC_MAIN_PACKAGEDIR, change output of AC_MAIN_PACKAGEDIR

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r2105 r2106  
    8282
    8383# Set the project's version number
    84 if test "x$1" != x; then
    85   AC_DEFINE_UNQUOTED(m4_toupper($1_VERSION), ["$PACKAGE_VERSION"],
    86                      [Version number of project])
    87 fi
    88 
    89 # Set the project's SVN revision number. The complicated sed expression
    90 # (made worse by quadrigraphs) ensures that things like 4123:4168MS end up
    91 # as a single number.
    92 AC_CHECK_PROG([have_svnversion],[svnversion],[yes],[no])
    93 if test "x$have_svnversion" = xyes && test "x$1" != x; then
    94   AC_SUBST(m4_toupper($1_SVN_REV))
    95   svn_rev_tmp=`cd $srcdir/$m4_tolower(coin_has_$1) ; svnversion`
    96   m4_toupper($1_SVN_REV)=`echo $svn_rev_tmp | sed -n -e 's/^@<:@0-9@:>@*://' -e 's/\(@<:@0-9@:>@\)@<:@^0-9@:>@*$/\1/p'`
    97   if test $m4_toupper($1_SVN_REV) != exported; then
    98     AC_DEFINE_UNQUOTED(m4_toupper($1_SVN_REV), $m4_toupper($1_SVN_REV),
    99                        [SVN revision number of project])
    100   fi
    101 fi
     84m4_ifvaln([$1],[
     85  AC_DEFINE_UNQUOTED(m4_toupper($1_VERSION), ["$PACKAGE_VERSION"],[Version number of project])
     86
     87  # We use the following variable to have a string with the upper case
     88  # version of the project name
     89  COIN_PRJCT=m4_toupper($1)
     90
     91  # Set the project's SVN revision number. The complicated sed expression
     92  # (made worse by quadrigraphs) ensures that things like 4123:4168MS end up
     93  # as a single number.
     94  AC_CHECK_PROG([have_svnversion],[svnversion],[yes],[no])
     95  if test "x$have_svnversion" = xyes; then
     96    AC_SUBST(m4_toupper($1_SVN_REV))
     97    svn_rev_tmp=`cd $srcdir/$m4_tolower(coin_has_$1) ; svnversion`
     98    m4_toupper($1_SVN_REV)=`echo $svn_rev_tmp | sed -n -e 's/^@<:@0-9@:>@*://' -e 's/\(@<:@0-9@:>@\)@<:@^0-9@:>@*$/\1/p'`
     99    if test $m4_toupper($1_SVN_REV) != exported; then
     100      AC_DEFINE_UNQUOTED(m4_toupper($1_SVN_REV), $m4_toupper($1_SVN_REV), [SVN revision number of project])
     101    fi
     102  fi
     103 ])
    102104
    103105# Capture libtool library version, if given.
    104106m4_ifvaln([$2],[coin_libversion=$2],[])
     107
    105108]) # AC_COIN_PROJECTDIR_INIT
    106109
     
    189192                    m4_tolower($coin_$1_checklevel),
    190193                    [Define to the debug sanity check level (0 is no test)])
    191 
    192 # We use the following variable to have a string with the upper case
    193 # version of the project name
    194 COIN_PRJCT=m4_toupper($1)
    195 
    196194]) # m4_ifvaln([$1],
    197195 
     
    20782076# conditional COIN_HAS_ZLIB and defines the C preprocessor variable
    20792077# COIN_HAS_ZLIB.  Further, for a (space separated) list of arguments X,
    2080 # it adds the linker flag to the variables X_LIBS and X_PCLIBS.
     2078# it adds the linker flag to the variables X_LIBS, X_PCLIBS, and X_LIBS_INSTALLED.
    20812079
    20822080AC_DEFUN([AC_COIN_CHECK_GNU_ZLIB],
     
    21172115# This macro checks for the libbz2 library.  If found, it defines the C
    21182116# preprocessor variable COIN_HAS_BZLIB.  Further, for a (space separated) list
    2119 # of arguments X, it adds the linker flag to the variables X_LIBS and X_PCLIBS.
     2117# of arguments X, it adds the linker flag to the variables X_LIBS, X_PCLIBS, and X_LIBS_INSTALLED.
    21202118
    21212119AC_DEFUN([AC_COIN_CHECK_GNU_BZLIB],
     
    21572155# in the source file before the #include<readline/readline.h>
    21582156# If found, it defines the C preprocessor variable COIN_HAS_READLINE.
    2159 # Further, for a (space separated) list of arguments X, it adds the linker flag to the variable X_LIBS and X_PCLIBS.
     2157# Further, for a (space separated) list of arguments X, it adds the
     2158# linker flag to the variable X_LIBS, X_PCLIBS, and X_LIBS_INSTALLED.
    21602159
    21612160AC_DEFUN([AC_COIN_CHECK_GNU_READLINE],
     
    28822881# If $2/$1 or $1 is in COIN_SKIP_PROJECTS, do nothing.
    28832882# If --with-$1-lib, --with-$1-incdir, or --with-$1-datadir is given, then assume that the package is installed.
    2884 # Otherwise, if pkg-config is available, use it to check whether the package is available.
    2885 #   If $4 is given, then pkg-config is asked for the existance of $4, otherwise tolower($1) is used.
    28862883# Otherwise, if the directory $2/$1 and the file $2/$1/$3 exist, check whether $2/$1/configure exists.
    28872884#   If so, include this directory into the list of directories where configure and make recourse into.
    2888 # tolower(coin_has_$1) is set to notGiven, skipping, installed, the version of an installed project, or the projects main directory (if uninstalled).
    2889 
    2890 AC_DEFUN([AC_COIN_MAIN_PACKAGEDIR],
    2891 [AC_REQUIRE([AC_COIN_HAS_PKGCONFIG])
    2892 AC_MSG_CHECKING([whether project $1 is available])
    2893 
    2894 m4_tolower(coin_has_$1)=notGiven
     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".
     2887
     2888AC_DEFUN([AC_COIN_MAIN_PACKAGEDIR],[
     2889AC_MSG_CHECKING([whether source of project $1 is available and should be compiled])
     2890
     2891m4_tolower(coin_has_$1)=no
    28952892coin_have_project_dir=no
    28962893
     
    29002897  for dir in $COIN_SKIP_PROJECTS; do
    29012898    if test $dir = "$1"; then
    2902       m4_tolower(coin_has_$1)=skipping
     2899      m4_tolower(coin_has_$1)="no, $1 has been specified in COIN_SKIP_PROJECTS"
    29032900    fi
     2901    m4_ifval($2,[
    29042902    if test $dir = "$2/$1"; then
    2905       m4_tolower(coin_has_$1)=skipping
    2906     fi
     2903      m4_tolower(coin_has_$1)="no, $2/$1 has been specified in COIN_SKIP_PROJECTS"
     2904    fi])
    29072905  done
    29082906fi
     
    29182916                   [linker flags for using project $1]),
    29192917    [if test "$withval" = no ; then
    2920        m4_tolower(coin_has_$1)=skipping
     2918       m4_tolower(coin_has_$1)="no, --without-m4_tolower($1)-lib has been specified"
    29212919     else
    2922        m4_tolower(coin_has_$1)="yes, via --with-m4_tolower($1)-lib"
     2920       m4_tolower(coin_has_$1)="no, --with-m4_tolower($1)-lib has been specified"
    29232921     fi],
    29242922    [])
     
    29302928                   [directory with header files for using project $1]),
    29312929    [if test "$withval" = no ; then
    2932        m4_tolower(coin_has_$1)=skipping
     2930       m4_tolower(coin_has_$1)="no, --without-m4_tolower($1)-incdir has been specified"
    29332931     else
    2934        m4_tolower(coin_has_$1)="yes, via --with-m4_tolower($1)-incdir"
     2932       m4_tolower(coin_has_$1)="no, --with-m4_tolower($1)-incdir has been specified"
    29352933     fi],
    29362934    [])
     
    29422940                   [directory with data files for using project $1]),
    29432941    [if test "$withval" = no ; then
    2944        m4_tolower(coin_has_$1)=skipping
     2942       m4_tolower(coin_has_$1)="no, --without-m4_tolower($1)-datadir has been specified"
    29452943     else
    2946        m4_tolower(coin_has_$1)="yes, via --with-m4_tolower($1)-datadir"
     2944       m4_tolower(coin_has_$1)="no, --with-m4_tolower($1)-datadir has been specified"
    29472945     fi],
    29482946    [])
     
    29572955           coin_has_blas=notGiven
    29582956         elif test x"$withval" = "xno" ; then
    2959            coin_has_blas=skipping
     2957           coin_has_blas="no, --without-blas has been specified"
    29602958         else
    2961            coin_has_blas="yes, via --with-blas"
     2959           coin_has_blas="no, --with-blas has been specified"
    29622960         fi],
    29632961        [])
     
    29732971           coin_has_lapack=notGiven
    29742972         elif test x"$withval" = "xno" ; then
    2975            coin_has_lapack=skipping
     2973           coin_has_lapack="no, --without-lapack has been specified"
    29762974         else
    2977            coin_has_lapack="yes, via --with-lapack"
     2975           coin_has_lapack="no, --with-lapack has been specified"
    29782976         fi],
    29792977        [])
     
    29832981# check if project is available in present directory
    29842982if test "$m4_tolower(coin_has_$1)" = notGiven; then
     2983  $m4_tolower(coin_has_$1)=no
    29852984  if test -d $srcdir/$2/$1; then
    29862985    # If a third argument is given, then we have to check if one one the files given in that third argument is present.
     
    30002999fi
    30013000
    3002 # check for project by using pkg-config, if pkg-config is available
    3003 if test "$m4_tolower(coin_has_$1)" = notGiven; then
    3004   #we are only interested in installed packages here, so we do not search in $COIN_PKG_CONFIG_PATH_UNINSTALLED
    3005   if test -n "$PKG_CONFIG" ; then
    3006     coin_save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
    3007     PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" ; export PKG_CONFIG_PATH
    3008       m4_ifval([$4],
    3009         [AC_COIN_PKG_CHECK_PROJECT_EXISTS([$4],
    3010                 [m4_tolower(coin_has_$1)="yes, found installed version $m4_toupper([$4])_VERSION"])],
    3011               [AC_COIN_PKG_CHECK_PROJECT_EXISTS([$1],
    3012                 [m4_tolower(coin_has_$1)="yes, found installed version $m4_toupper([$1])_VERSION"])])
    3013     PKG_CONFIG_PATH="$coin_save_PKG_CONFIG_PATH"
    3014     export PKG_CONFIG_PATH
    3015   fi
    3016 fi
    3017 
    3018 if test "$m4_tolower(coin_has_$1)" = notGiven; then
    3019   m4_case(m4_tolower($1),
    3020     [blas],
    3021     [AC_MSG_RESULT([no (but will check for system blas later)])],
    3022     [lapack],
    3023     [AC_MSG_RESULT([no (but will check for system lapack later)])],
    3024     [AC_MSG_RESULT([not given])]
    3025   )
    3026 else
    3027   AC_MSG_RESULT([$m4_tolower(coin_has_$1)])
    3028 fi
     3001AC_MSG_RESULT([$m4_tolower(coin_has_$1)])
    30293002
    30303003if test "$coin_have_project_dir" = yes ; then
Note: See TracChangeset for help on using the changeset viewer.