Changeset 9902272 for configure.in


Ignore:
Timestamp:
02/17/12 11:21:49 (9 years ago)
Author:
Shane Alcock <salcock@…>
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:
00d49b6
Parents:
4eac98f
Message:
  • Allow users to build libtrace without zlib, bzip2, lzo or ncurses if they want. This should also help Gentoo users who have problems with automagic optional dependencies -- they're still automagic by default but can be explicitly disabled now using the --with-FOO=no configure option.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    ra0ec6f1 r9902272  
    369369#DAG_VERSION_NUM=$dag_drv_v
    370370
    371 have_ncurses=yes
    372371
    373372# Checks for various "optional" libraries
    374 AC_CHECK_LIB(z, deflate, have_zlib=1, have_zlib=0)
    375 AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=1, have_bzip=0)
    376 AC_CHECK_LIB(lzo2, lzo1x_1_compress, have_lzo=1, have_lzo=0)
    377373AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0)
    378374
    379375# Check for ncurses
    380 AC_SEARCH_LIBS(mvprintw, ncurses, have_ncurses=yes, have_ncurses=no)
    381 LIBS=
    382376
    383377# These libraries have to be explicitly linked in OpenSolaris
    384 AC_SEARCH_LIBS(getservent, socket, have_socket=1, have_socket=0, -lnsl)         
     378AC_SEARCH_LIBS(getservent, socket, have_socket=1, have_socket=0, -lnsl)
    385379LIBS=
    386380
     
    400394fi
    401395
    402 
    403 if test "$have_zlib" = 1; then
    404         LIBTRACE_LIBS="$LIBTRACE_LIBS -lz"
    405         AC_DEFINE(HAVE_LIBZ, 1, [Set to 1 if zlib is supported])
    406 fi
    407 
    408 if test "$have_bzip" = 1; then
    409         LIBTRACE_LIBS="$LIBTRACE_LIBS -lbz2"
    410         AC_DEFINE(HAVE_LIBBZ2, 1, [Set to 1 if bzip2 is supported])
    411 fi
    412 
    413 if test "$have_lzo" = 1; then
    414         LIBTRACE_LIBS="$LIBTRACE_LIBS -llzo2"
    415         AC_DEFINE(HAVE_LIBLZO2, 1, [Set to 1 if lzo2 is supported])
    416 fi
    417 
    418396if test "$have_pthread" = 1; then
    419397        LIBTRACE_LIBS="$LIBTRACE_LIBS -lpthread"
     
    421399fi
    422400
    423 if test "$have_ncurses" = "yes"; then
    424         if test "$ac_cv_search_mvprintw" != "none required"; then
    425                 TOOLS_LIBS="$TOOLS_LIBS $ac_cv_search_mvprintw"
    426         fi
    427 fi
    428401
    429402if test "$have_nsl" = 1; then
     
    445418# just set libs to null here to avoid linking against them by default
    446419LIBS=
    447 
    448420
    449421# For now, the user has to explicitly ask for the LLVM stuff, as it's a bit
     
    490462fi
    491463
     464AC_ARG_WITH([ncurses],
     465        AC_HELP_STRING([--with-ncurses], [build tracetop (requires ncurses)]))
     466
     467AS_IF([test "x$with_ncurses" != "xno"],
     468        [AC_SEARCH_LIBS(mvprintw, ncurses, have_ncurses=yes, have_ncurses=no)
     469         LIBS=
     470        ], [have_ncurses=no])
     471
     472AS_IF([test "x$have_ncurses" = "xyes"], [
     473        if test "$ac_cv_search_mvprintw" != "none required"; then
     474                TOOLS_LIBS="$TOOLS_LIBS $ac_cv_search_mvprintw"
     475        fi
     476        HAVE_NCURSES=1
     477        with_ncurses=yes],
     478
     479       
     480        [AS_IF([test "x$with_ncurses" = "xyes"],
     481                [AC_MSG_ERROR([ncurses requested but not found])])
     482        HAVE_NCURSES=0
     483        with_ncurses=no]
     484)
     485                       
     486AC_ARG_WITH([bzip2],
     487        AC_HELP_STRING([--with-bzip2], [build with support for bzip2 compressed files]))
     488
     489AS_IF([test "x$with_bzip2" != "xno"],
     490        [
     491        AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no)
     492        ], [have_bzip=no])
     493
     494AS_IF([test "x$have_bzip" = "xyes"], [
     495        if test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" != "none required"; then
     496                LIBTRACE_LIBS="$LIBTRACE_LIBS -lbz2"
     497        fi
     498        HAVE_LIBBZ2=1
     499        with_bzip2=yes],
     500
     501       
     502        [AS_IF([test "x$with_bzip2" = "xyes"],
     503                [AC_MSG_ERROR([bzip2 requested but not found])])
     504        HAVE_LIBBZ2=0
     505        with_bzip2=no]
     506)
     507
     508AC_ARG_WITH([zlib],
     509        AC_HELP_STRING([--with-zlib], [build with support for zlib compressed files]))
     510
     511AS_IF([test "x$with_zlib" != "xno"],
     512        [
     513        AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no)
     514        ], [have_zlib=no])
     515
     516AS_IF([test "x$have_zlib" = "xyes"], [
     517        if test "$ac_cv_lib_z_deflate" != "none required"; then
     518                LIBTRACE_LIBS="$LIBTRACE_LIBS -lz"
     519        fi
     520        HAVE_LIBZ=1
     521        with_zlib=yes],
     522
     523       
     524        [AS_IF([test "x$with_zlib" = "xyes"],
     525                [AC_MSG_ERROR([zlib requested but not found])])
     526        HAVE_LIBZ=0
     527        with_zlib=no]
     528)
     529
     530AC_ARG_WITH([lzo],
     531        AC_HELP_STRING([--with-lzo], [build with support for writing lzo compressed files]))
     532
     533AS_IF([test "x$with_lzo" != "xno"],
     534        [
     535        AC_CHECK_LIB(lzo2, lzo1x_1_compress, have_lzo=yes, have_lzo=yes)
     536        ], [have_lzo=no])
     537
     538AS_IF([test "x$have_lzo" = "xyes"], [
     539        if test "$ac_cv_lib_lzo2_lzo1x_1_compress" != "none required"; then
     540                LIBTRACE_LIBS="$LIBTRACE_LIBS -llzo2"
     541        fi
     542        HAVE_LIBLZO2=1
     543        with_lzo=yes],
     544
     545       
     546        [AS_IF([test "x$with_lzo" = "xyes"],
     547                [AC_MSG_ERROR([lzo requested but not found])])
     548        HAVE_LIBLZO2=0
     549        with_lzo=no]
     550)
     551
    492552
    493553# Define automake conditionals for use in our Makefile.am files
     
    496556AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24])
    497557AM_CONDITIONAL([DAG2_5], [test "$libtrace_dag_version" = 25])
    498 AM_CONDITIONAL([HAVE_ZLIB], [test "$have_zlib" = 1])
    499 AM_CONDITIONAL([HAVE_BZLIB], [test "$have_bzip" = 1])
    500 AM_CONDITIONAL([HAVE_LZO], [test "$have_lzo" = 1])
    501558AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true])
    502559AM_CONDITIONAL([HAVE_LIBGDC], [test "$ac_cv_header_gdc_h" = yes])
    503560AM_CONDITIONAL([HAVE_LLVM], [test "x$JIT" != "xno" ])
    504 AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncurses" = "xyes"])
     561AM_CONDITIONAL([HAVE_NCURSES], [test "$HAVE_NCURSES" != 0])
     562AM_CONDITIONAL([HAVE_BZLIB], [test "$HAVE_LIBBZ2" != 0])
     563AM_CONDITIONAL([HAVE_ZLIB], [test "$HAVE_LIBZ" != 0])
     564AM_CONDITIONAL([HAVE_LZO], [ test "$HAVE_LIBLZO2" != 0])
    505565
    506566# Check for miscellaneous programs
     
    553613fi
    554614
    555 reportopt "Compiled with compressed trace (zlib) support" $ac_cv_lib_z_deflate
    556 reportopt "Compiled with compressed trace (bz2) support" $ac_cv_lib_bz2_BZ2_bzDecompressInit
    557 reportopt "Compiled with compressed trace (lzo write only) support" $ac_cv_lib_lzo2_lzo1x_1_compress
     615reportopt "Compiled with compressed trace (zlib) support" $with_zlib
     616reportopt "Compiled with compressed trace (bz2) support" $with_bzip2
     617reportopt "Compiled with compressed trace (lzo write only) support" $with_lzo
    558618if test x"$libtrace_dag" = xtrue; then
    559619        if test "$libtrace_dag_version" = 24; then
     
    569629reportopt "Compiled with LLVM BPF JIT support" $JIT
    570630reportopt "Building man pages/documentation" $libtrace_doxygen
    571 reportopt "Building tracetop (requires libncurses)" $have_ncurses
     631reportopt "Building tracetop (requires libncurses)" $with_ncurses
    572632
    573633# Report any errors relating to missing bison, flex, etc.
Note: See TracChangeset for help on using the changeset viewer.