1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
AC_INIT(libwfut, 0.2.1, simon@worldforge.org)
AC_CONFIG_SRCDIR([libwfut/WFUT.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([nostdinc])
LIBWFUT_CURRENT=2 ## Increment if interface changes
LIBWFUT_REVISION=0 ## Increment if source changes. 0 if current is incremented
LIBWFUT_AGE=1 ## Increment if current is incremented, but interface is
## backwards compatible
AC_PROG_CXX
AC_PROG_LIBTOOL
## Enable all compiler warnings
CXXFLAGS="$CXXFLAGS -Wall"
## Tell Tiny XML to use STL classes.
CXXFLAGS="$CXXFLAGS -DTIXML_USE_STL=1"
AC_LANG_PUSH(C++)
PKG_CHECK_MODULES(SIGC, sigc++-2.0 != 2.0.8,
[
CXXFLAGS="$CXXFLAGS $SIGC_CFLAGS"
LDFLAGS="$LDFLAGS $SIGC_LIBS"
LIBWFUT_REQUIRES="$LIBWFUT_REQUIRES sigc++-2.0"
],
[
AC_MSG_ERROR([Couldn't find sigc++ library, or an invalid version was found. Please see http://libsigc.sourceforge.net/ and obtain sigc++ 2.0.])
]
)
CURL_VERSION=7.15.0
PKG_CHECK_MODULES(CURL, libcurl >= $CURL_VERSION,
[
CXXFLAGS="$CXXFLAGS $CURL_CFLAGS"
LDFLAGS="$LDFLAGS $CURL_LIBS"
LIBWFUT_REQUIRES="$LIBWFUT_REQUIRES libcurl"
],
[
AC_MSG_ERROR([Couldn't find curl library. Please see http://curl.haxx.se/ and obtain a curl version greater than $CURL_VERSION])
]
)
PKG_CHECK_MODULES(CURL_PIPE, libcurl >= 7.16.0,
[
AC_DEFINE(HAVE_CURL_MULTI_PIPELINING, 1, [Define if curl is recent enough to have the pipelining option.])
],
UNUSED=1
]
)
# Try to find system-wide installation of tinyxml
# If found, add define to config.h, set LIBS and add automake conditional
AC_CHECK_LIB(tinyxml, main,
[
AC_DEFINE(HAVE_LIBTINYXML, 1, [Define to 1 if you have the `tinyxml' library (-ltinyxml).])
LIBS="-ltinyxml $LIBS"
have_tinyxml=true
],
[
have_tinyxml=false
]
)
AM_CONDITIONAL(HAVE_LIBTINYXML, [test x$have_tinyxml = xtrue])
AC_LANG_POP(C++)
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR([Unable to find zlib])])
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
LIBWFUT_LIB_SUFFIX="-0.2"
LIBWFUT_LIBS="-lwfut$LIBWFUT_LIB_SUFFIX"
LIBWFUT_VERSION_INFO=$LIBWFUT_CURRENT:$LIBWFUT_REVISION:$LIBWFUT_AGE
AC_SUBST(LIBWFUT_LIB_SUFFIX)
AC_SUBST(LIBWFUT_LIBS)
AC_SUBST(LIBWFUT_REQUIRES)
AC_SUBST(LIBWFUT_VERSION_INFO)
# make python binding?
AC_ARG_WITH([python], AS_HELP_STRING([--without-python], [build without Python bindings (default: test)]))
if test "x$with_python" != "xno"; then
AM_PATH_PYTHON(2.2,,
[with_python=no
AC_MSG_WARN([Python not found; disabling Python binding])])
fi
if test "x$with_python" != "xno"; then
AM_CHECK_PYTHON_HEADERS(,
[with_python=no
AC_MSG_WARN([Python headers not found])])
fi
# need SWIG too
if test "x$with_python" != "xno"; then
AC_CHECK_PROG(HAVE_SWIG, swig, [yes])
if test "x$HAVE_SWIG" != "xyes"; then
with_python=no
AC_MSG_WARN([SWIG not found; disabling Python binding])
else
with_python=yes
fi
fi
if test "x$with_python" = "xyes"; then
AM_CONDITIONAL(HAVE_PYTHON, true)
else
AM_CONDITIONAL(HAVE_PYTHON, false)
fi
if test "$enable_shared" = yes; then
if test "x$CYGWIN" = xyes -o "x$MINGW32" = xyes; then
LIBWFUT_DLL=libwfut$LIBWFUT_LIB_SUFFIX.dll
AC_SUBST(LIBWFUT_DLL)
AC_CHECK_TOOL(DLLWRAP, dllwrap)
AC_CHECK_TOOL(DLLTOOL, dlltool)
BUILD_IT=true
else
BUILD_IT=false
fi
else
BUILD_IT=false
fi
AM_CONDITIONAL(BUILD_DLL, test $BUILD_IT = true, true, false)
AC_SUBST(BUILD_IT)
AC_CONFIG_FILES([
libwfut.spec
libwfut-0.2.pc
Makefile
libwfut/Makefile
tools/Makefile
man/Makefile
man/man1/Makefile
python/Makefile
])
AC_OUTPUT
|