ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/ac-tools/aclocal.m4
(Generate patch)

Comparing trunk/OOPSE-2.0/ac-tools/aclocal.m4 (file contents):
Revision 2265 by gezelter, Wed Jul 20 17:04:42 2005 UTC vs.
Revision 2315 by gezelter, Tue Sep 20 22:03:35 2005 UTC

# Line 1240 | Line 1240 | dnl Outer loop checked for user override term here
1240    fi dnl
1241  
1242   ])dnl EOMACRO DEF
1243 +
1244 + AC_DEFUN([ACX_CHECK_ZLIB],
1245 + #
1246 + # Handle user hints
1247 + #
1248 + [AC_MSG_CHECKING(if zlib is wanted)
1249 + AC_ARG_WITH(zlib,
1250 + [  --with-zlib=DIR root directory path of zlib installation [defaults to
1251 +                    /usr/local or /usr if not found in /usr/local]
1252 +  --without-zlib to disable zlib usage completely],
1253 + [if test "$withval" != no ; then
1254 +  AC_MSG_RESULT(yes)
1255 +  if test -d "$withval"
1256 +  then
1257 +    ZLIB_HOME="$withval"
1258 +  else
1259 +    AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
1260 +  fi
1261 + else
1262 +  AC_MSG_RESULT(no)
1263 + fi])
1264 +
1265 + ZLIB_HOME=/usr/local
1266 + if test ! -f "${ZLIB_HOME}/include/zlib.h"
1267 + then
1268 +        ZLIB_HOME=/usr
1269 + fi
1270 +
1271 + #
1272 + # Locate zlib, if wanted
1273 + #
1274 + if test -n "${ZLIB_HOME}"
1275 + then
1276 +        ZLIB_OLD_LDFLAGS=$LDFLAGS
1277 +        ZLIB_OLD_CPPFLAGS=$LDFLAGS
1278 +        LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
1279 +        CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
1280 +        AC_LANG_SAVE
1281 +        AC_LANG_C
1282 +        AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
1283 +        AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
1284 +        AC_LANG_RESTORE
1285 +        if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
1286 +        then
1287 +                #
1288 +                # If both library and header were found, use them
1289 +                #
1290 +                AC_CHECK_LIB(z, inflateEnd)
1291 +                AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
1292 +                AC_MSG_RESULT(ok)
1293 +        else
1294 +                #
1295 +                # If either header or library was not found, revert and bomb
1296 +                #
1297 +                AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
1298 +                LDFLAGS="$ZLIB_OLD_LDFLAGS"
1299 +                CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
1300 +                AC_MSG_RESULT(failed)
1301 +                AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)
1302 +        fi
1303 + fi
1304 +
1305 + ])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines