Changeset 11615


Ignore:
Timestamp:
07/26/11 13:34:03 (13 years ago)
Author:
tbretz
Message:
Added check for libz.
Location:
trunk/FACT++
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/configure

    r11391 r11615  
    751751IS_FALSE_FALSE
    752752IS_FALSE_TRUE
     753HAS_ZLIB_FALSE
     754HAS_ZLIB_TRUE
    753755HAS_FITS_FALSE
    754756HAS_FITS_TRUE
     
    10311033with_motif_includes
    10321034with_motif_libraries
     1035with_zlib
     1036with_zlib_include
     1037with_zlib_libdir
    10331038with_cfitsio
    10341039with_cfitsio_include
     
    17351740  --with-motif-includes=DIR    Motif include files are in DIR
    17361741  --with-motif-libraries=DIR   Motif libraries are in DIR
     1742  --with-zlib=DIR       root directory of zlib installation
     1743  --with-zlib-include=DIR        specify exact include dir for zlib headers (e.g. zlib.h)
     1744  --with-zlib-libdir=DIR        specify exact library dir for zlib library (e.g. libz)
     1745  --without-zlib        disables zlib usage completely
    17371746  --with-cfitsio=DIR    root directory of cfitsio installation
    17381747  --with-cfitsio-include=DIR        specify exact include dir for cfitsio headers (e.g. fitsio.h)
     
    47954804  lt_cv_nm_interface="BSD nm"
    47964805  echo "int some_variable = 0;" > conftest.$ac_ext
    4797   (eval echo "\"\$as_me:4797: $ac_compile\"" >&5)
     4806  (eval echo "\"\$as_me:4806: $ac_compile\"" >&5)
    47984807  (eval "$ac_compile" 2>conftest.err)
    47994808  cat conftest.err >&5
    4800   (eval echo "\"\$as_me:4800: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
     4809  (eval echo "\"\$as_me:4809: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
    48014810  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
    48024811  cat conftest.err >&5
    4803   (eval echo "\"\$as_me:4803: output\"" >&5)
     4812  (eval echo "\"\$as_me:4812: output\"" >&5)
    48044813  cat conftest.out >&5
    48054814  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     
    60066015*-*-irix6*)
    60076016  # Find out which ABI we are using.
    6008   echo '#line 6008 "configure"' > conftest.$ac_ext
     6017  echo '#line 6017 "configure"' > conftest.$ac_ext
    60096018  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
    60106019  (eval $ac_compile) 2>&5
     
    76677676   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    76687677   -e 's:$: $lt_compiler_flag:'`
    7669    (eval echo "\"\$as_me:7669: $lt_compile\"" >&5)
     7678   (eval echo "\"\$as_me:7678: $lt_compile\"" >&5)
    76707679   (eval "$lt_compile" 2>conftest.err)
    76717680   ac_status=$?
    76727681   cat conftest.err >&5
    7673    echo "$as_me:7673: \$? = $ac_status" >&5
     7682   echo "$as_me:7682: \$? = $ac_status" >&5
    76747683   if (exit $ac_status) && test -s "$ac_outfile"; then
    76757684     # The compiler can only warn and ignore the option if not recognized
     
    80068015   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    80078016   -e 's:$: $lt_compiler_flag:'`
    8008    (eval echo "\"\$as_me:8008: $lt_compile\"" >&5)
     8017   (eval echo "\"\$as_me:8017: $lt_compile\"" >&5)
    80098018   (eval "$lt_compile" 2>conftest.err)
    80108019   ac_status=$?
    80118020   cat conftest.err >&5
    8012    echo "$as_me:8012: \$? = $ac_status" >&5
     8021   echo "$as_me:8021: \$? = $ac_status" >&5
    80138022   if (exit $ac_status) && test -s "$ac_outfile"; then
    80148023     # The compiler can only warn and ignore the option if not recognized
     
    81118120   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    81128121   -e 's:$: $lt_compiler_flag:'`
    8113    (eval echo "\"\$as_me:8113: $lt_compile\"" >&5)
     8122   (eval echo "\"\$as_me:8122: $lt_compile\"" >&5)
    81148123   (eval "$lt_compile" 2>out/conftest.err)
    81158124   ac_status=$?
    81168125   cat out/conftest.err >&5
    8117    echo "$as_me:8117: \$? = $ac_status" >&5
     8126   echo "$as_me:8126: \$? = $ac_status" >&5
    81188127   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    81198128   then
     
    81668175   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    81678176   -e 's:$: $lt_compiler_flag:'`
    8168    (eval echo "\"\$as_me:8168: $lt_compile\"" >&5)
     8177   (eval echo "\"\$as_me:8177: $lt_compile\"" >&5)
    81698178   (eval "$lt_compile" 2>out/conftest.err)
    81708179   ac_status=$?
    81718180   cat out/conftest.err >&5
    8172    echo "$as_me:8172: \$? = $ac_status" >&5
     8181   echo "$as_me:8181: \$? = $ac_status" >&5
    81738182   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    81748183   then
     
    1055010559  lt_status=$lt_dlunknown
    1055110560  cat > conftest.$ac_ext <<_LT_EOF
    10552 #line 10552 "configure"
     10561#line 10561 "configure"
    1055310562#include "confdefs.h"
    1055410563
     
    1064610655  lt_status=$lt_dlunknown
    1064710656  cat > conftest.$ac_ext <<_LT_EOF
    10648 #line 10648 "configure"
     10657#line 10657 "configure"
    1064910658#include "confdefs.h"
    1065010659
     
    1260212611   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1260312612   -e 's:$: $lt_compiler_flag:'`
    12604    (eval echo "\"\$as_me:12604: $lt_compile\"" >&5)
     12613   (eval echo "\"\$as_me:12613: $lt_compile\"" >&5)
    1260512614   (eval "$lt_compile" 2>conftest.err)
    1260612615   ac_status=$?
    1260712616   cat conftest.err >&5
    12608    echo "$as_me:12608: \$? = $ac_status" >&5
     12617   echo "$as_me:12617: \$? = $ac_status" >&5
    1260912618   if (exit $ac_status) && test -s "$ac_outfile"; then
    1261012619     # The compiler can only warn and ignore the option if not recognized
     
    1270112710   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1270212711   -e 's:$: $lt_compiler_flag:'`
    12703    (eval echo "\"\$as_me:12703: $lt_compile\"" >&5)
     12712   (eval echo "\"\$as_me:12712: $lt_compile\"" >&5)
    1270412713   (eval "$lt_compile" 2>out/conftest.err)
    1270512714   ac_status=$?
    1270612715   cat out/conftest.err >&5
    12707    echo "$as_me:12707: \$? = $ac_status" >&5
     12716   echo "$as_me:12716: \$? = $ac_status" >&5
    1270812717   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1270912718   then
     
    1275312762   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1275412763   -e 's:$: $lt_compiler_flag:'`
    12755    (eval echo "\"\$as_me:12755: $lt_compile\"" >&5)
     12764   (eval echo "\"\$as_me:12764: $lt_compile\"" >&5)
    1275612765   (eval "$lt_compile" 2>out/conftest.err)
    1275712766   ac_status=$?
    1275812767   cat out/conftest.err >&5
    12759    echo "$as_me:12759: \$? = $ac_status" >&5
     12768   echo "$as_me:12768: \$? = $ac_status" >&5
    1276012769   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1276112770   then
     
    1821418223fi
    1821518224
     18225# Check for zlib and exit with error if not found (defines HAVE_LIBZ)
     18226
     18227
     18228
     18229# Check whether --with-zlib was given.
     18230if test "${with_zlib+set}" = set; then :
     18231  withval=$with_zlib; with_zlib=$withval
     18232if test "${with_zlib}" != yes; then
     18233        zlib_include="$withval/include"
     18234        zlib_libdir="$withval/lib"
     18235fi
     18236
     18237fi
     18238
     18239
     18240
     18241# Check whether --with-zlib-include was given.
     18242if test "${with_zlib_include+set}" = set; then :
     18243  withval=$with_zlib_include; zlib_include="$withval"
     18244fi
     18245
     18246
     18247
     18248# Check whether --with-zlib-libdir was given.
     18249if test "${with_zlib_libdir+set}" = set; then :
     18250  withval=$with_zlib_libdir; zlib_libdir="$withval"
     18251fi
     18252
     18253
     18254if test "${with_zlib}" != no ; then
     18255        OLD_LIBS=$LIBS
     18256        OLD_LDFLAGS=$LDFLAGS
     18257        OLD_CFLAGS=$CFLAGS
     18258        OLD_CPPFLAGS=$CPPFLAGS
     18259
     18260        if test "${zlib_libdir}" ; then
     18261                LDFLAGS="$LDFLAGS -L${zlib_libdir}"
     18262        fi
     18263        if test "${zlib_include}" ; then
     18264                CPPFLAGS="$CPPFLAGS -I${zlib_include}"
     18265                CFLAGS="$CFLAGS -I${zlib_include}"
     18266        fi
     18267
     18268        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5
     18269$as_echo_n "checking for inflateEnd in -lz... " >&6; }
     18270if test "${ac_cv_lib_z_inflateEnd+set}" = set; then :
     18271  $as_echo_n "(cached) " >&6
     18272else
     18273  ac_check_lib_save_LIBS=$LIBS
     18274LIBS="-lz  $LIBS"
     18275cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     18276/* end confdefs.h.  */
     18277
     18278/* Override any GCC internal prototype to avoid an error.
     18279   Use char because int might match the return type of a GCC
     18280   builtin and then its argument prototype would still apply.  */
     18281#ifdef __cplusplus
     18282extern "C"
     18283#endif
     18284char inflateEnd ();
     18285int
     18286main ()
     18287{
     18288return inflateEnd ();
     18289  ;
     18290  return 0;
     18291}
     18292_ACEOF
     18293if ac_fn_c_try_link "$LINENO"; then :
     18294  ac_cv_lib_z_inflateEnd=yes
     18295else
     18296  ac_cv_lib_z_inflateEnd=no
     18297fi
     18298rm -f core conftest.err conftest.$ac_objext \
     18299    conftest$ac_exeext conftest.$ac_ext
     18300LIBS=$ac_check_lib_save_LIBS
     18301fi
     18302{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5
     18303$as_echo "$ac_cv_lib_z_inflateEnd" >&6; }
     18304if test "x$ac_cv_lib_z_inflateEnd" = x""yes; then :
     18305  cat >>confdefs.h <<_ACEOF
     18306#define HAVE_LIBZ 1
     18307_ACEOF
     18308
     18309  LIBS="-lz $LIBS"
     18310
     18311else
     18312  no_good=yes
     18313fi
     18314
     18315        ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
     18316if test "x$ac_cv_header_zlib_h" = x""yes; then :
     18317
     18318else
     18319  no_good=yes
     18320fi
     18321
     18322
     18323        if test "$no_good" = yes; then
     18324                HAVE_ZLIB=no
     18325
     18326                LIBS=$OLD_LIBS
     18327                LDFLAGS=$OLD_LDFLAGS
     18328                CPPFLAGS=$OLD_CPPFLAGS
     18329                CFLAGS=$OLD_CFLAGS
     18330        else
     18331                HAVE_ZLIB=yes
     18332
     18333                $as_echo "#define HAVE_PKG_zlib 1" >>confdefs.h
     18334
     18335        fi
     18336
     18337fi
     18338
     18339
     18340
     18341#AC_CHECK_FILE(gui/RawEventsViewer(izstream.h, [action.if-yes], [action-if-no])
     18342#AC_CHECK_FILE(gui/RawEventsViewer(fits.h    , [action.if-yes], [action-if-no])
     18343
    1821618344# Needed to compile FACT++
    1821718345
     
    2168621814
    2168721815                cat > conftest.$ac_ext <<EOF
    21688 #line 21688 "configure"
     21816#line 21816 "configure"
    2168921817#include "confdefs.h"
    2169021818#include <qglobal.h>
     
    2238722515fi
    2238822516
     22517 if test "$HAVE_ZLIB" = yes; then
     22518  HAS_ZLIB_TRUE=
     22519  HAS_ZLIB_FALSE='#'
     22520else
     22521  HAS_ZLIB_TRUE='#'
     22522  HAS_ZLIB_FALSE=
     22523fi
     22524
    2238922525
    2239022526 if test "x" = "y"; then
     
    2241122547if test "$ROOTEXEC" != no; then
    2241222548  $as_echo "#define HAVE_ROOT 1" >>confdefs.h
     22549
     22550fi
     22551if test "$HAVE_ZLIB" = yes; then
     22552  $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
    2241322553
    2241422554fi
     
    2272222862if test -z "${HAS_FITS_TRUE}" && test -z "${HAS_FITS_FALSE}"; then
    2272322863  as_fn_error $? "conditional \"HAS_FITS\" was never defined.
     22864Usually this means the macro was only invoked conditionally." "$LINENO" 5
     22865fi
     22866if test -z "${HAS_ZLIB_TRUE}" && test -z "${HAS_ZLIB_FALSE}"; then
     22867  as_fn_error $? "conditional \"HAS_ZLIB\" was never defined.
    2272422868Usually this means the macro was only invoked conditionally." "$LINENO" 5
    2272522869fi
     
    2511225256{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
    2511325257$as_echo "$as_me: " >&6;}
     25258{ $as_echo "$as_me:${as_lineno-$LINENO}:  zlib                   / 'zlib.h'          found: $HAVE_ZLIB" >&5
     25259$as_echo "$as_me:  zlib                   / 'zlib.h'          found: $HAVE_ZLIB" >&6;}
    2511425260{ $as_echo "$as_me:${as_lineno-$LINENO}:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&5
    2511525261$as_echo "$as_me:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&6;}
     
    2527225418{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
    2527325419$as_echo "$as_me: " >&6;}
     25420if test "$HAVE_ZLIB" = yes; then
     25421  :
     25422else
     25423  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  zlib not found. Support for reading zipped files disabled!" >&5
     25424$as_echo "$as_me: WARNING:  zlib not found. Support for reading zipped files disabled!" >&2;}
     25425
     25426fi
    2527425427if test "$lt_cv_libxp" = "yes"; then
    2527525428  :
  • trunk/FACT++/configure.ac

    r11391 r11615  
    106106   AC_MSG_WARN([ Motif/lesstif not found!])
    107107)
     108
     109# Check for zlib and exit with error if not found (defines HAVE_LIBZ)
     110AC_CHECK_PACKAGE(zlib, inflateEnd, z, zlib.h,
     111                 HAVE_ZLIB=yes, HAVE_ZLIB=no)
     112
     113#AC_CHECK_FILE(gui/RawEventsViewer(izstream.h, [action.if-yes], [action-if-no])
     114#AC_CHECK_FILE(gui/RawEventsViewer(fits.h    , [action.if-yes], [action-if-no])
    108115
    109116# Needed to compile FACT++
     
    282289AM_CONDITIONAL(HAS_CCFITS,    [test "$HAVE_CCFITS" = yes])
    283290AM_CONDITIONAL(HAS_FITS,      [test "$HAVE_CFITSIO" = yes -a "$HAVE_CCFITS" = yes])
     291AM_CONDITIONAL(HAS_ZLIB,      [test "$HAVE_ZLIB" = yes])
    284292
    285293AM_CONDITIONAL(IS_FALSE,      [test "x" = "y"])
     
    288296AM_COND_IF(HAS_FITS, [AC_DEFINE(HAVE_FITS)], )
    289297AM_COND_IF(HAS_ROOT, [AC_DEFINE(HAVE_ROOT)], )
     298AM_COND_IF(HAS_ZLIB, [AC_DEFINE(HAVE_ZLIB)], )
    290299
    291300##########################################################################
     
    335344AC_MSG_NOTICE(--------------------------------------------------------------------)
    336345AC_MSG_NOTICE()
     346AC_MSG_NOTICE([ zlib                   / 'zlib.h'          found: $HAVE_ZLIB])
    337347AC_MSG_NOTICE([ cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO])
    338348AC_MSG_NOTICE([ CCfits                 / 'CCfits/CCfits'   found: $HAVE_CCFITS])
     
    416426AC_MSG_NOTICE(--------------------------------------------------------------------)
    417427AC_MSG_NOTICE()
     428AM_COND_IF(HAS_ZLIB,,
     429      AC_MSG_WARN([ zlib not found. Support for reading zipped files disabled!])
     430)
    418431AM_COND_IF(HAS_LIBXP,,
    419432      AC_MSG_WARN([ Motif/lesstif not found. The dim gui did will not be built!])
Note: See TracChangeset for help on using the changeset viewer.