📄 acinclude_custom.m4
字号:
AC_DEFUN([AC_CXX_RPO],[ CXXRPOFLAGS= RPO_YES='#' RPO_NO='' if test x$GXX = xyes ; then AC_ARG_ENABLE([rpo], AC_HELP_STRING([--enable-rpo], [Enable compilation with option -frepo]), [ac_rpo=$enableval], [ac_rpo=no] ) if test x$ac_rpo != xno ; then CXXRPOFLAGS='-frepo -fno-rtti' RPO_YES='' RPO_NO='#' fi fi AC_SUBST(CXXRPOFLAGS) AC_SUBST(RPO_YES) AC_SUBST(RPO_NO)])dnl ------------------------------------------------------------------dnl @synopsis AC_PATH_GNUWIN32([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])dnl Process option --with-gnuwin32.dnl Try to determine where GNUWIN32 is locateddnl Define GNUWIN32 accordingly (either blank or PATH)dnl Also update the LDFLAGS and CFLAGS accordinglydnl ------------------------------------------------------------------AC_DEFUN([AC_PATH_GNUWIN32],[ # Test whether we are running on Windows. This test is becoming # useless because other environments exist under Windows, such # as mingw, whihc gives host i686-pc-mingw32. Just remove this test # for now by setting variable to yes all the time.# AC_REQUIRE([AC_CANONICAL_HOST])[]dnl# case $host_os in# *cygwin* ) USING_CYGWIN_OR_MINGW=yes;;# *mingw* ) USING_CYGWIN_OR_MINGW=yes;;# * ) USING_CYGWIN_OR_MINGW=no;;# esac USING_CYGWIN_OR_MINGW=yes # If running on Windows, do some tests if test x$USING_CYGWIN_OR_MINGW = xyes ; then AC_ARG_VAR(GNUWIN32_DIR,[Base directory of GnuWin32 packages]) ac_gnuwin32=no AC_ARG_WITH(gnuwin32, AC_HELP_STRING([--with-gnuwin32=DIR], [where the GnuWin32 packages are installed]), [ac_gnuwin32=$withval], [ac_gnuwin32=yes] ) # Process specification AC_MSG_CHECKING([for GnuWin32 directory]) if test x$ac_gnuwin32 = xyes ; then # GNUWIN32_BASE could have been set on the command line if test x$GNUWIN32_BASE != x ; then if test -d "$GNUWIN32_BASE" ; then AC_MSG_RESULT([verified at $GNUWIN32_BASE]) else # AC_MSG_RESULT([no GnuWin32 at $GNUWIN32_BASE. Looking elsewhere]) GNUWIN32_BASE= fi # Otherwise, GNUWIN32 is an environment variable that the user can set elif test x$GNUWIN32 != x ; then if test -d "$GNUWIN32" ; then GNUWIN32_BASE=$GNUWIN32 AC_MSG_RESULT([verified at $GNUWIN32_BASE]) else # AC_MSG_RESULT([no GnuWin32 at $GNUWIN32. Looking elsewhere]) GNUWIN32_BASE= fi fi # Look in default locations if needed: if test x$GNUWIN32_BASE = x ; then if test -d "C:/Program Files/GnuWin32" ; then GNUWIN32_BASE="C:/Program Files/GnuWin32" AC_MSG_RESULT([$GNUWIN32_BASE]) elif test -d "C:/pckg/GnuWin32" ; then GNUWIN32_BASE="C:/pckg/GnuWin32" AC_MSG_RESULT([$GNUWIN32_BASE]) else AC_MSG_RESULT([not found]) fi fi # If directory location specified on command line elif test x$ac_gnuwin32 != xno ; then if test -d "$ac_gnuwin32" ; then GNUWIN32_BASE="$ac_gnuwin32" AC_MSG_RESULT([verified at $GNUWIN32_BASE]) else GNUWIN32_BASE= AC_MSG_RESULT([not found]) fi fi # Now we can update LDFLAGS, CFLAGS and CXXFLAGS # Do it in such a way that GnuWin32 has precedence # over system includes and libraries if test x$GNUWIN32_BASE != x ; then CFLAGS="-I$GNUWIN32_BASE/include $CFLAGS" CXXFLAGS="-I$GNUWIN32_BASE/include $CXXFLAGS" if test x$CXX != xcl.exe ; then LDFLAGS="-L$GNUWIN32_BASE/lib $LDFLAGS" fi fi # If not running on cygwin, GNUWIN32 is useless else GNUWIN32_BASE= fi # Finally, sets automake conditional AM_CONDITIONAL(HAVE_GNUWIN32, test x$GNUWIN32_BASE != x)])dnl ------------------------------------------------------------------dnl @synopsis AC_PATH_JPEG([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])dnl Process option --with-jpeg.dnl Search JPEG along the extradnl Define HAVE_JPEG.dnl Set output variable JPEG_CFLAGS and JPEG_LIBSdnl Designed by Leon. Unused at the moment.dnl ------------------------------------------------------------------AC_DEFUN([AC_PATH_JPEG],[ AC_ARG_VAR(JPEG_LIBS) AC_ARG_VAR(JPEG_CFLAGS) ac_jpeg=no AC_ARG_WITH(jpeg, AC_HELP_STRING([--with-jpeg=DIR], [where the IJG jpeg library is located]), [ac_jpeg=$withval], [ac_jpeg=yes] ) # Process specification if test x$ac_jpeg = xyes ; then test x${JPEG_LIBS+set} != xset && JPEG_LIBS="-ljpeg" elif test x$ac_jpeg != xno ; then test x${JPEG_LIBS+set} != xset && JPEG_LIBS="-L$ac_jpeg -ljpeg" test x${JPEG_CFLAGS+set} != xset && JPEG_CFLAGS="-I$ac_jpeg" fi # Try linking if test x$ac_jpeg != xno ; then AC_MSG_CHECKING([for jpeg library]) save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" save_LIBS="$LIBS" CFLAGS="$CFLAGS $JPEG_CFLAGS" CXXFLAGS="$CXXFLAGS $JPEG_CFLAGS" LIBS="$LIBS $JPEG_LIBS" AC_TRY_LINK([#ifdef __cplusplusextern "C" {#endif#include <stdio.h> #include <jpeglib.h>#ifdef __cplusplus}#endif ],[jpeg_CreateDecompress(0,0,0);], [ac_jpeg=yes], [ac_jpeg=no] ) CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" LIBS="$save_LIBS" AC_MSG_RESULT($ac_jpeg) fi # Finish if test x$ac_jpeg = xno; then JPEG_CFLAGS= ; JPEG_LIBS= ifelse([$2],,:,[$2]) else AC_DEFINE(HAVE_JPEG,1,[Define if you have the IJG JPEG library.]) AC_MSG_RESULT([setting JPEG_CFLAGS=$JPEG_CFLAGS]) AC_MSG_RESULT([setting JPEG_LIBS=$JPEG_LIBS]) ifelse([$1],,:,[$1]) fi])dnl ------------------------------------------------------------------dnl @synopsis AC_PATH_LIBTIFF([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])dnl Process option --with-libtiff.dnl Search LIBTIFF along the extradnl Define HAVE_LIBTIFF.dnl Set output variable LIBTIFF_CFLAGS and LIBTIFF_LIBSdnl -- inspired from previous AC_PATH_JPEGdnl ------------------------------------------------------------------AC_DEFUN([AC_PATH_LIBTIFF],[ AC_REQUIRE([AC_CANONICAL_HOST]) case $host in *msdos* | *go32* | *mingw32* | *cygwin* | *windows*) USING_WIN=yes ;; *) USING_WIN=no esac AC_REQUIRE([AC_PATH_GNUWIN32]) AC_ARG_VAR(LIBTIFF_LIBS,[Tiff library to link against]) AC_ARG_VAR(LIBTIFF_CFLAGS,[Compile flags needed for TIFF support]) ac_libtiff=no AC_ARG_WITH(libtiff, AC_HELP_STRING([--with-libtiff=DIR], [where the www.libtiff.org libtiff library is located]), [ac_libtiff=$withval], [ac_libtiff=yes] ) AC_MSG_CHECKING([for Leffler libtiff library]) # Need to define TOP_SRCDIR for the cases where the LIBTIFF library # is checked in with the code, at the top-level TOP_SRCDIR=`cd $srcdir; pwd` LOCAL_LIBTIFFDIR=$TOP_SRCDIR/libtiff # First of all, deal with the case when 'cl.exe' is used as compiler # indeed, when this is the case, we can only rely on finding # the right library and includes, but we can't try compiling # and linking. In addition, library needs to be specifically # supplied on the link line and special flags are needed... if test "x$CXX" = "xcl.exe" ; then if test "x$ac_libtiff" = "xyes" ; then # If LIBTIFF_LIBS has been set on configure command line # or as environment variable, just use it if it exists if test "x$LIBTIFF_LIBS" != "x" ; then AC_MSG_RESULT(user specified as $LIBTIFF_LIBS) if test "x$LIBTIFF_CFLAGS" = "x" ; then AC_MSG_WARN(LIBTIFF_CFLAGS is empty) fi fi # Otherwise, test if libtiff is at top level directory, under libtiff if test "x$LIBTIFF_LIBS" = "x" && test -r "$LOCAL_LIBTIFFDIR/lib/libtiff.a" && test -r "$LOCAL_LIBTIFFDIR/lib/libjpeg.a" && test -r "$LOCAL_LIBTIFFDIR/lib/libz.a" ; then AC_MSG_RESULT($LOCAL_LIBTIFFDIR/lib/libtiff.a) LIBTIFF_LIBS="$LOCAL_LIBTIFFDIR/lib/libtiff.a $LOCAL_LIBTIFFDIR/lib/libjpeg.a $LOCAL_LIBTIFFDIR/lib/libz.a user32.lib" LIBTIFF_CFLAGS="-I$LOCAL_LIBTIFFDIR/include" fi # Otherwise, if GnuWin32 was previously located if test "x$LIBTIFF_LIBS" = "x" && test -r "$GNUWIN32_BASE/lib/libtiff.a" && test -r "$GNUWIN32_BASE/lib/libjpeg.a" && test -r "$GNUWIN32_BASE/lib/libz.a" ; then AC_MSG_RESULT($GNUWIN32_BASE/lib/libtiff.a) AC_MSG_WARN($GNUWIN32_BASE/lib/libtiff.a version 3.5.7 works. Some versions like 3.6.1 do not!) LIBTIFF_LIBS="$GNUWIN32_BASE/lib/libtiff.a $GNUWIN32_BASE/lib/libjpeg.a $GNUWIN32_BASE/lib/libz.a user32.lib" fi if test "x$LIBTIFF_LIBS" = "x" ; then AC_MSG_RESULT(not found or incomplete) ac_libtiff=no fi elif test "x$ac_libtiff" != "xno" ; then test x${LIBTIFF_LIBS+set} != xset && LIBTIFF_LIBS="$ac_libtiff/libtiff" test x${LIBTIFF_CFLAGS+set} != xset && LIBTIFF_CFLAGS="-I$ac_libtiff" fi # If we are not using CL, that is we are either using gcc/cygwin # or we are not running under Windows: else # Process specification if test "x$ac_libtiff" = "xyes" ; then if test "x$LIBTIFF_LIBS" = "x" ; then # If local libtiff exists at top level, and we are running windows, use it first: if test "x$USING_WIN" = "xyes" && test -r "$LOCAL_LIBTIFFDIR/lib/libtiff.a" && test -r "$LOCAL_LIBTIFFDIR/lib/libjpeg.a" && test -r "$LOCAL_LIBTIFFDIR/lib/libz.a" ; then AC_MSG_RESULT($LOCAL_LIBTIFFDIR/lib/libtiff.a) LIBTIFF_LIBS="$LOCAL_LIBTIFFDIR/lib/libtiff.a $LOCAL_LIBTIFFDIR/lib/libjpeg.a $LOCAL_LIBTIFFDIR/lib/libz.a -lole32 -luuid -lwsock32" LIBTIFF_CFLAGS="-I$LOCAL_LIBTIFFDIR/include" fi # If GNUWIN32_BASE is defined, it means we are running under # Windows and we should use these builds if available because # they are the best bet if test "x$LIBTIFF_LIBS" = "x" && test "x$GNUWIN32_BASE" != "x" ; then # With version 3.5.7 of gnuwin32 libtiff, we do not need to link # against "$GNUWIN32_BASE/lib/libgw32c.a", so no need to test if test -r "$GNUWIN32_BASE/lib/libtiff.a" && test -r "$GNUWIN32_BASE/lib/libjpeg.a" && test -r "$GNUWIN32_BASE/lib/libz.a" ; then AC_MSG_RESULT($GNUWIN32_BASE/lib/libtiff.a) # With 3.5.7 version of libtiff, no need to add # $GNUWIN32_BASE/lib/libgw32c.a after $GNUWIN32_BASE/lib/libz.a LIBTIFF_LIBS="$GNUWIN32_BASE/lib/libtiff.a $GNUWIN32_BASE/lib/libjpeg.a $GNUWIN32_BASE/lib/libz.a -lole32 -luuid -lwsock32" else AC_MSG_RESULT([GNUWIN32 not found or incomplete. Trying something else]) fi fi # If LIBTIFF_LIBS is still not defined after potentially going # the GNUWIN32 route, then try using home built versions if test "x$LIBTIFF_LIBS" = "x" ; then TIFF_PACKAGE="$HOME_UNIX/packages/libtiff/libtiff" if test -d "$TIFF_PACKAGE" ; then LIBTIFF_LIBS="$TIFF_PACKAGE/libtiff.a" LIBTIFF_CFLAGS="-I$TIFF_PACKAGE" else LIBTIFF_LIBS="-ltiff" fi fi fi elif test "x$ac_libtiff" != "xno" ; then test "x${LIBTIFF_LIBS+set}" != "xset" && LIBTIFF_LIBS="$ac_libtiff/libtiff.a" test "x${LIBTIFF_CFLAGS+set}" != "xset" && LIBTIFF_CFLAGS="-I$ac_libtiff" fi # Try linking - recall that -Wall is typically on, and any warning # will cause this test to fail... This, by the way, is one of the # reasons we cannot run this test when using the Microsoft compiler (cl), # which outputs tons of "garbage" on stdout: if test "x$ac_libtiff" != "xno" ; then AC_MSG_CHECKING([linking with $LIBTIFF_LIBS]) save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" save_LIBS="$LIBS" CFLAGS="$CFLAGS $LIBTIFF_CFLAGS" CXXFLAGS="$CXXFLAGS $LIBTIFF_CFLAGS" LIBS="$LIBS $LIBTIFF_LIBS -lm" AC_TRY_LINK([#ifdef __cplusplusextern "C" {#endif#include <stdio.h> #include <tiffio.h>#ifdef __cplusplus}#endif ],[TIFFClose((TIFF *) 0);], [ac_libtiff=ok],[ac_libtiff=no]) CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" LIBS="$save_LIBS" AC_MSG_RESULT($ac_libtiff) fi fi # Finish if test "x$ac_libtiff" = "xno"; then LIBTIFF_CFLAGS= ; LIBTIFF_LIBS= ifelse([$2],,:,[$2]) else AC_DEFINE(HAVE_LIBTIFF,1,[Define if you have the www.libtiff.org LIBTIFF library.]) AC_MSG_RESULT([setting LIBTIFF_CFLAGS=$LIBTIFF_CFLAGS]) AC_MSG_RESULT([setting LIBTIFF_LIBS=$LIBTIFF_LIBS]) CFLAGS="$LIBTIFF_CFLAGS $CFLAGS" CXXFLAGS="$LIBTIFF_CFLAGS $CXXFLAGS" if test "x$CXX" = "xcl.exe" ; then LIBS="$LIBTIFF_LIBS $LIBS" else LIBS="$LIBTIFF_LIBS $LIBS -lm" fi ifelse([$1],,:,[$1]) fi AM_CONDITIONAL(HAVE_LIBTIFF, test x$ac_libtiff != xno)])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -