Changeset ba0017c for configure.in


Ignore:
Timestamp:
10/28/05 14:52:27 (16 years ago)
Author:
Daniel Lawson <dlawson@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
b190686
Parents:
779d445
Message:

fixes in configure.in:

  • properly test for zlib
  • use perl -pi -e instead of sed -i
  • improved test for attribute pure, still not quite working - use --without-pure if it fails to test correclty
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    rab9a63d rba0017c  
    128128                           [use __attribute__((pure)) for optimisation]),
    129129[
    130         if test "$withval" = no
     130        if test "$withval" = no -o "$withval" = false
    131131        then
    132132                test_pure=false
     
    142142        AC_MSG_CHECKING([if compiler supports __attribute__((pure))])
    143143        AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
    144                            [[#define SIMPLE_FUNCTION __attribute__((pure))]])],
     144                           [[
     145#define SIMPLE_FUNCTION __attribute__((pure))
     146SIMPLE_FUNCTION
     147void foo() {
     148}
     149                           ]])],
    145150                [AC_DEFINE(HAVE_ATTR_PURE,1,[define to test for __attribute__((pure)) support]) libtrace_pure=true],
    146151                [AC_DEFINE(HAVE_ATTR_PURE,0,[define to test for __attribute__((pure)) support]) libtrace_pure=false])
    147152
    148153        AC_MSG_RESULT($libtrace_pure)
    149 fi
    150 
    151 if test "$libtrace_pure" = true; then
    152          sed -i 's/#define HAVE_ATTR_PURE.*/#define HAVE_ATTR_PURE 1/' lib/libtrace.h
    153 else
    154          sed -i 's/#define HAVE_ATTR_PURE.*/#define HAVE_ATTR_PURE 0/' lib/libtrace.h
    155 fi
    156 
     154
     155        if test "$libtrace_pure" = true; then
     156                perl -pi -e 's/#define HAVE_ATTR_PURE.*/#define HAVE_ATTR_PURE 1/' lib/libtrace.h
     157        else
     158                perl -pi -e 's/#define HAVE_ATTR_PURE.*/#define HAVE_ATTR_PURE 0/' lib/libtrace.h
     159        fi
     160
     161fi
    157162
    158163# configure time options for man pages
     
    270275    [ac_cv_use_zlib_path=/usr/lib])
    271276
     277libtrace_zlib=false
    272278if test "$ac_cv_use_zlib" != no; then
    273     ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
    274279   
    275280    zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so"
     
    278283    if test x"${ac_cv_use_zlib_path}" == x"/usr/lib"; then
    279284            AC_CHECK_LIB(${ac_cv_use_zlib}, gzopen,
    280                          have_libzlib=yes,
    281                          have_libzlib=no)
    282             if test x"{have_libzlib}" == xno; then
    283                 AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
    284                 AC_MSG_ERROR([Exiting]);
    285             fi
     285                         libtrace_zlib=true,
     286                         libtrace_zlib=false)
    286287    else
    287288        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
     
    291292                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
    292293                AC_MSG_ERROR([Exiting]);
    293         fi
     294        else
     295                libtrace_zlib=true
     296        fi
    294297    fi
    295     AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support])
    296     libtrace_zlib=true
     298fi
     299
     300if test $libtrace_zlib = true; then
     301        ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
     302        AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support])
    297303else
    298     AC_DEFINE(HAVE_ZLIB,0,[Conditional for building zlib support])   
    299     libtrace_zlib=false
     304        AC_DEFINE(HAVE_ZLIB,0,[Conditional for building zlib support])   
    300305fi
    301306
     
    312317
    313318function reportopt() {
    314         if test x"$2" = xtrue; then
     319        if test x"$2" = xtrue -o x"$2" = xyes; then
    315320                AC_MSG_NOTICE([$1: Yes])
    316321        else
Note: See TracChangeset for help on using the changeset viewer.