Changeset 2873 for trunk/configure.ac


Ignore:
Timestamp:
Nov 13, 2012, 12:15:37 PM (10 years ago)
Author:
Peter
Message:

prefer using YAT_MSG_ERROR and simplify computation of YAT_PRIMARY_LIBS and YAT_LIBS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r2872 r2873  
    6161                  silent-rules subdir-objects])
    6262
     63dnl When fatal error are detected we use macro YAT_MSG_ERROR that
     64dnl collects all error messages and aborts configure [just] before
     65dnl creating output files with this message below plus collected
     66dnl messages from YAT_MSG_ERROR calls.
    6367YAT_MSG_ERROR_PREPARE([
    6468        Some pre-requisites were not fulfilled, aborting configure.
     
    201205AC_MSG_NOTICE([checking for libraries])
    202206AC_CHECK_LIBM
     207LIBS="$LIBS $LIBM"
    203208
    204209# find library implementing BLAS C API, or use gslcblas
    205210YAT_LIB_CBLAS([YAT_CBLAS_LIB=$CBLAS_LIB], [YAT_CBLAS_LIB=-lgslcblas])
     211LIBS="$LIBS $YAT_CBLAS_LIB"
    206212
    207213# GNU Scientific Library, GSL http://www.gnu.org/software/gsl/, checks
     
    209215gsl_version="1.8"
    210216AC_SUBST(gsl_version)
    211 gsl_ok=yes
    212 YAT_CHECK_GSL([$gsl_version],[gsl_ok=yes],[gsl_ok=no])
     217YAT_CHECK_GSL([$gsl_version],[LIBS="$LIBS -lgsl"],[YAT_MSG_ERROR([dnl
     218GSL $gsl_version (or newer) not found. The GNU Scientific Library
     219(GSL) library cannot be found. Please make sure GSL is
     220installed. Please refer to warnings above for more details])
     221])
    213222
    214223# Boost http://www.boost.org
    215224boost_version=1.35
    216225AC_SUBST(boost_version)
    217 AX_BOOST_BASE(["$boost_version"], [boost_ok=yes], [boost_ok=no])
     226AX_BOOST_BASE(["$boost_version"], [], [YAT_MSG_ERROR([dnl
     227Boost ${boost_version} (or newer) not found. Please install boost, or provide
     228CPPFLAGS=-I/path/to/boost])
     229])
    218230# skip boost link tests if boost is not wanted (--without-boost)
    219231AS_IF([test x"$want_boost" = x"yes"],[
     
    223235  YAT_LD_ADD_FLAG([LDFLAGS], [$BOOST_LDFLAGS])
    224236  # boost tests above only test compilation, so let's try link in the libs
    225   save_LIBS=$LIBS
    226237  LIBS="$LIBS $BOOST_THREAD_LIB $BOOST_SYSTEM_LIB"
    227238  AC_MSG_CHECKING([for thread_specific_ptr])
     
    231242                 [AC_MSG_RESULT([yes])],
    232243                 [AC_MSG_RESULT([no])
    233                   boost_ok=no])
    234   LIBS=$save_LIBS
     244                  YAT_MSG_ERROR([Boost thread library not found. Please install library boost-thread.])
     245                 ])
    235246])
    236247
     
    377388# configure is halted prematurely.
    378389
    379 # used to trigger exit before creation of output
    380 all_reqs_ok="true"
    381 
    382 # Non-existing GSL is fatal -- sub-sequent compilation will fail.
    383 if test "x$gsl_ok" != "xyes" ; then
    384   all_reqs_ok="false"
    385   AC_MSG_WARN([
    386   GSL $gsl_version (or newer) not found. The GNU Scientific Library
    387   (GSL) library cannot be found. Please make sure GSL is
    388   installed. Please refer to warnings above for more details])
    389 fi
    390 
    391 if test "x$want_boost" = "xyes"; then
    392 # Too old Boost is fatal -- sub-sequent compilation will fail.
    393 AS_IF([test "${boost_ok}" != "yes"],[
    394   all_reqs_ok="false"
    395   AC_MSG_WARN([
    396   Boost ${boost_version} (or newer) not found. Please make sure Boost
    397   is installed.])
    398 ], [
    399   AS_IF([test x$ax_cv_boost_thread = xno], [
    400     all_reqs_ok="false"
    401     AC_MSG_WARN([
    402   Boost thread library not found. Please make sure library boost-thread is
    403   is installed.])
    404   ])
    405 ])
    406 fi
    407 
    408 if (test "$all_reqs_ok" = "false") ; then
    409   AC_MSG_FAILURE([
    410   Some pre-requisites were not fulfilled, aborting configure.
    411   Please consult the 'README' file for more information about what
    412   is needed to compile yat and refer to above warning messages.
    413   Needed files were NOT created.])
    414 fi
    415 
    416390# Reset flags
    417391APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, YAT_)
     
    420394APR_RESTORE_THE_ENVIRONMENT(LIBS, YAT_)
    421395
    422 YAT_PRIMARY_LIBS="-lgsl $BOOST_THREAD_LIB $BOOST_SYSTEM_LIB"
    423 YAT_LIBS="$YAT_PRIMARY_LIBS $YAT_CBLAS_LIB $LIBM"
     396# YAT_LIBS minus cblas and math libraries
     397YAT_PRIMARY_LIBS=
     398for lib in $YAT_LIBS; do
     399  AS_CASE([$lib], [$YAT_CBLAS_LIB], [],
     400          [$LIBM], [],
     401          [YAT_PRIMARY_LIBS="$YAT_PRIMARY_LIBS $lib"])
     402done
    424403AC_SUBST(YAT_PRIMARY_LIBS)
    425404AC_SUBST(YAT_LIBS)
Note: See TracChangeset for help on using the changeset viewer.