2002-12-02 15:39:26 -08:00
# get rid of that stupid cache mechanism
rm -f config.cache
2009-07-29 00:54:14 -07:00
AC_INIT([eet], [1.2.2], [enlightenment-devel@lists.sourceforge.net])
2008-10-16 01:41:40 -07:00
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
2004-02-16 23:11:28 -08:00
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
2007-11-04 01:10:50 -08:00
2009-10-06 09:54:26 -07:00
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
AM_CONFIG_HEADER([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
2002-12-02 15:39:26 -08:00
2007-11-04 01:10:50 -08:00
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL
2007-11-12 07:55:04 -08:00
VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
2007-11-04 01:10:50 -08:00
version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
2009-04-21 07:17:42 -07:00
#release="ver-pre-svn-00"
#release_info="-release $release"
release_info=""
2007-11-04 01:10:50 -08:00
AC_SUBST(version_info)
2009-04-21 07:17:42 -07:00
AC_SUBST(release_info)
2008-05-16 08:07:03 -07:00
2008-10-26 00:05:11 -07:00
### Default options with respect to host
2004-10-12 09:15:54 -07:00
case "$host_os" in
2008-11-01 11:11:27 -07:00
mingw* | cegcc*)
2008-11-13 08:31:13 -08:00
want_gnutls="no"
2008-10-26 00:05:11 -07:00
want_openssl="no"
2008-11-13 08:31:13 -08:00
want_cipher="no"
2008-10-26 00:05:11 -07:00
want_signature="no"
;;
*)
2008-11-13 08:31:13 -08:00
want_gnutls="auto"
2008-10-26 00:05:11 -07:00
want_openssl="auto"
2008-11-13 08:31:13 -08:00
want_cipher="yes"
2008-10-26 00:05:11 -07:00
want_signature="yes"
2008-10-20 23:13:26 -07:00
;;
2008-10-16 01:41:40 -07:00
esac
2008-10-20 23:13:26 -07:00
2008-10-26 00:05:11 -07:00
requirement_eet=""
### Additional options to configure
2009-11-02 00:41:43 -08:00
AC_ARG_ENABLE([amalgamation],
[AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
[if test "x${enableval}" = "xyes"; then
do_amalgamation="yes"
else
do_amalgamation="no"
fi
],
[do_amalgamation="no"]
)
AM_CONDITIONAL(EET_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
2008-10-26 00:05:11 -07:00
# Old eet file format support
old_eet_file_format="yes"
AC_ARG_ENABLE(old-eet-file-format,
[AC_HELP_STRING(
[--disable-old-eet-file-format],
[disable old eet file format support. [[default=enabled]]]
)],
[old_eet_file_format=$enableval]
)
AC_MSG_CHECKING([whether to support old eet file format])
2008-10-26 01:18:14 -07:00
AC_MSG_RESULT([${old_eet_file_format}])
2008-10-26 00:05:11 -07:00
if test "x${old_eet_file_format}" = "xyes" ; then
AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
else
AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 0, [support old eet file format])
fi
2008-11-13 08:31:13 -08:00
# Gnutls support
AC_ARG_ENABLE([gnutls],
[AC_HELP_STRING([--disable-gnutls], [disable gnutls eet support])],
[want_gnutls=$enableval]
)
AC_MSG_CHECKING([whether to use Gnutls])
AC_MSG_RESULT([${want_gnutls}])
2009-04-16 05:15:56 -07:00
# Specific GNUTLS improvement
new_gnutls_api="no"
AC_ARG_ENABLE(new-gnutls-api,
[AC_HELP_STRING(
[--enable-new-gnutls-api],
[enable use of gnutls_x509_crt_verify_hash. [[default=disable]]]
)],
[new_gnutls_api=$enableval]
)
AC_MSG_CHECKING([whether to use gnutls_x509_crt_verify_hash])
AC_MSG_RESULT([${new_gnutls_api}])
if test "x${new_gnutls_api}" = "xyes" ; then
AC_DEFINE(EET_USE_NEW_GNUTLS_API, 1, [use gnutls_x509_crt_verify_hash])
else
AC_DEFINE(EET_USE_NEW_GNUTLS_API, 0, [don't use gnutls_x509_crt_verify_hash])
fi
2008-10-26 00:05:11 -07:00
# Openssl support
AC_ARG_ENABLE([openssl],
[AC_HELP_STRING([--disable-openssl], [disable openssl eet support])],
[want_openssl=$enableval]
)
AC_MSG_CHECKING([whether to use OpenSSL])
AC_MSG_RESULT([${want_openssl}])
# Cryptography support
2008-11-13 08:31:13 -08:00
AC_ARG_ENABLE([cipher],
[AC_HELP_STRING([--disable-cipher], [disable cipher support for eet API])],
[want_cipher=$enableval]
2008-10-26 00:05:11 -07:00
)
2008-11-13 08:31:13 -08:00
AC_MSG_CHECKING([whether to use cipher])
AC_MSG_RESULT([${want_cipher}])
2008-10-26 00:05:11 -07:00
AC_ARG_ENABLE([signature],
[AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
[want_signature=$enableval]
)
AC_MSG_CHECKING([whether to use signature])
AC_MSG_RESULT([${want_signature}])
# Assert or fail.
prefer_assert="no"
AC_ARG_ENABLE([assert],
[AC_HELP_STRING([--enable-assert], [enable assert, [[default=disabled]]])],
[prefer_assert=$enableval]
)
# Unit tests, coverage and benchmarking
EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
if test "x${prefer_assert}" = "xno"; then
DEBUG_CFLAGS="-DNDEBUG"
else
# use debug symbols and set DEBUG if coverage support is enabled
DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}"
fi
AC_SUBST(DEBUG_CFLAGS)
2008-11-01 11:11:27 -07:00
### Checks for programs
AC_PROG_CC
2009-09-09 08:50:52 -07:00
# pkg-config
PKG_PROG_PKG_CONFIG
# Check whether pkg-config supports Requires.private
if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
pkgconfig_requires_private="Requires.private"
else
pkgconfig_requires_private="Requires"
fi
AC_SUBST(pkgconfig_requires_private)
2008-11-01 11:11:27 -07:00
# doxygen program for documentation building
2008-10-26 00:05:11 -07:00
2008-11-01 11:11:27 -07:00
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
### Checks for libraries
2008-10-26 00:05:11 -07:00
# Evil library for compilation on Windows
EFL_EET_BUILD=""
2008-10-16 01:41:40 -07:00
case "$host_os" in
2008-10-26 00:05:11 -07:00
mingw* | cegcc*)
2008-11-01 11:11:27 -07:00
PKG_CHECK_MODULES([EVIL], [evil])
AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
requirement_eet="evil ${requirement_eet}"
EFL_EET_BUILD="-DEFL_EET_BUILD"
2008-10-26 00:05:11 -07:00
;;
2004-10-12 09:15:54 -07:00
esac
2008-10-26 00:05:11 -07:00
AC_SUBST(EFL_EET_BUILD)
2004-10-12 09:15:54 -07:00
2008-11-01 11:11:27 -07:00
EET_LIBS=""
case "$host_os" in
mingw32ce*)
EET_LIBS="-lws2"
;;
cegcc*)
EET_LIBS="-lws2"
;;
mingw*)
EET_LIBS="-lws2_32"
;;
esac
AC_SUBST(EET_LIBS)
2008-10-26 00:05:11 -07:00
# Eina library
PKG_CHECK_MODULES(EINA, [eina-0])
requirement_eet="eina-0 ${requirement_eet}"
2008-11-13 08:31:13 -08:00
# Gnutls library
have_gnutls="no"
if test "x${want_gnutls}" = "xyes" -o "x${want_gnutls}" = "xauto" ; then
PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.7.6],
[
have_gnutls="yes"
2009-03-26 08:25:15 -07:00
want_openssl="no"
2008-11-13 08:31:13 -08:00
AC_DEFINE(HAVE_GNUTLS, 1, [Have Gnutls support])
requirement_eet="gnutls ${requirement_eet}"
],
2009-11-11 12:05:47 -08:00
[have_gnutls="no"])
if test "x${have_gnutls}" = "xyes" ; then
AC_PATH_GENERIC([libgcrypt], [], [have_gnutls="yes"], [have_gnutls="no"])
if test "x${have_gnutls}" = "xyes" ; then
GNUTLS_CFLAGS="${GNUTLS_CFLAGS} ${LIBGCRYPT_CFLAGS}"
GNUTLS_LIBS="${GNUTLS_LIBS} ${LIBGCRYPT_LIBS}"
fi
fi
2008-11-13 08:31:13 -08:00
fi
2008-10-26 00:05:11 -07:00
# Openssl library
have_openssl="no"
if test "x${want_openssl}" = "xyes" -o "x${want_openssl}" = "xauto" ; then
PKG_CHECK_MODULES(OPENSSL, openssl,
[
have_openssl="yes"
AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
requirement_eet="openssl ${requirement_eet}"
2008-11-01 11:11:27 -07:00
],
[have_openssl="no"])
2008-10-26 00:05:11 -07:00
fi
2008-11-13 08:31:13 -08:00
have_cipher="no"
if test "x${have_gnutls}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
have_cipher="yes"
AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
elif test "x${have_openssl}" = "xyes" -a "x${want_cipher}" = "xyes" ; then
have_cipher="yes"
AC_DEFINE(HAVE_CIPHER, 1, [Have cipher support built in eet])
2008-10-26 00:05:11 -07:00
fi
2008-11-13 08:31:13 -08:00
AC_MSG_CHECKING(whether to activate cipher support in eet)
AC_MSG_RESULT(${have_cipher})
2008-10-26 00:05:11 -07:00
have_signature="no"
2008-11-13 08:31:13 -08:00
if test "x${have_gnutls}" = "xyes" -a "x${want_signature}" = "xyes" ; then
have_signature="yes"
AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
elif test "x${have_openssl}" = "xyes" -a "x${want_signature}" = "xyes" ; then
2008-10-26 00:05:11 -07:00
have_signature="yes"
AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
fi
AC_MSG_CHECKING(whether to activate signature support in eet)
AC_MSG_RESULT(${have_signature})
### Checks for header files
2008-04-03 12:47:07 -07:00
2008-10-16 01:41:40 -07:00
AC_CHECK_HEADER([zlib.h],
[dummy="yes"],
[AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
AC_CHECK_HEADER([jpeglib.h],
[dummy="yes"],
[AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
2008-03-01 22:49:48 -08:00
AC_CHECK_HEADERS(netinet/in.h)
2008-10-16 01:41:40 -07:00
AC_CHECK_HEADER([fnmatch.h],
[dummy="yes"],
[AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file])])
2004-10-12 09:15:54 -07:00
2008-10-26 00:05:11 -07:00
### Checks for types
### Checks for structures
### Checks for compiler characteristics
AM_PROG_CC_C_O
AC_C_CONST
AC_C_INLINE
AC_PROG_CC_STDC
AC_C___ATTRIBUTE__
# Check whether the null pointer is zero on this arch
AC_TRY_RUN(
[
2005-05-26 08:33:26 -07:00
#include <stdlib.h>
2006-01-14 00:59:42 -08:00
int main (int argc, char **argv) {
void *foo = NULL;
int bar = (int)foo;
return (int)foo;
}
2008-10-26 00:05:11 -07:00
],
[have_null="yes"],
[have_null="no"],
[
AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
have_null="yes"
])
AC_MSG_CHECKING([value of the null pointer])
AC_MSG_RESULT([${have_null}])
2008-05-16 08:07:03 -07:00
2008-10-26 00:05:11 -07:00
if test ! "x${have_null}" = "xyes" ; then
AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
2008-09-08 02:19:57 -07:00
fi
2008-10-26 00:05:11 -07:00
# These are needed for fmemopen/open_memstream
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
2008-09-08 02:19:57 -07:00
2008-10-26 00:05:11 -07:00
EET_CPPFLAGS=""
EET_CFLAGS=""
case "$host_os" in
mingw32ce*)
EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
;;
cegcc*)
EET_CPPFLAGS="-D_WIN32_WCE=0x0420"
EET_CFLAGS="-mwin32"
;;
esac
AC_SUBST(EET_CPPFLAGS)
AC_SUBST(EET_CFLAGS)
2008-10-16 01:41:40 -07:00
2008-10-26 00:05:11 -07:00
### Checks for linker characteristics
2008-09-08 02:19:57 -07:00
2009-01-09 09:29:06 -08:00
# use --enable-auto-import on Windows
2008-10-26 00:05:11 -07:00
lt_enable_auto_import=""
case "$host_os" in
mingw* | cegcc*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
AC_SUBST(lt_enable_auto_import)
2008-05-16 08:07:03 -07:00
2009-01-09 09:29:06 -08:00
# use --as-needed if supported
LDFLAGS_SAVE=${LDFLAGS}
LDFLAGS="${LDFLAGS} -Wl,--as-needed"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [])],
[ld_as_needed="-Wl,--as-needed"],
[ld_as_needed=""]
)
LDFLAGS=${LDFLAGS_SAVE}
AC_SUBST(ld_as_needed)
2008-05-16 08:07:03 -07:00
2008-10-26 00:05:11 -07:00
### Checks for library functions
AC_FUNC_ALLOCA
2008-05-19 08:23:41 -07:00
2008-10-26 00:05:11 -07:00
AC_CHECK_FUNCS(fmemopen open_memstream realpath)
fnmatch_libs=""
AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
if test "x$res" = "xno"; then
AC_SEARCH_LIBS([fnmatch],
2008-11-13 12:48:37 -08:00
[fnmatch evil iberty],
2008-10-26 00:05:11 -07:00
[res="yes"],
[res="no"])
if test "x$res" = "xno"; then
AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
fi
fnmatch_libs="${ac_cv_search_fnmatch}"
2008-06-26 08:47:25 -07:00
fi
2008-10-26 00:05:11 -07:00
AC_SUBST(fnmatch_libs)
2008-06-26 08:47:25 -07:00
2008-10-20 02:17:00 -07:00
2008-10-26 00:05:11 -07:00
AC_SUBST(requirement_eet)
2005-09-27 15:10:09 -07:00
2002-12-02 15:39:26 -08:00
AC_OUTPUT([
2002-12-02 16:26:34 -08:00
Makefile
2003-05-08 00:59:58 -07:00
eet.pc
2008-10-16 01:41:40 -07:00
doc/Makefile
2008-10-26 00:05:11 -07:00
doc/eet.dox
2002-12-02 16:26:34 -08:00
src/Makefile
src/lib/Makefile
2007-09-08 02:35:41 -07:00
src/bin/Makefile
2008-05-16 08:07:03 -07:00
src/tests/Makefile
2005-03-02 18:29:18 -08:00
README
2005-03-02 17:34:03 -08:00
eet.spec
2002-12-02 15:39:26 -08:00
])
2005-09-27 15:10:09 -07:00
#####################################################################
## Info
echo
echo
echo
echo "------------------------------------------------------------------------"
2008-03-29 01:27:44 -07:00
echo "$PACKAGE_NAME $PACKAGE_VERSION"
2005-09-27 15:10:09 -07:00
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
2008-11-13 08:31:13 -08:00
echo " Gnutls...............: ${have_gnutls}"
2008-09-08 02:19:57 -07:00
echo " Openssl..............: ${have_openssl}"
2008-11-13 08:31:13 -08:00
echo " Cipher support.....: ${have_cipher}"
2008-09-08 02:19:57 -07:00
echo " Signature..........: ${have_signature}"
2008-10-16 01:41:40 -07:00
echo
2009-11-02 00:41:43 -08:00
echo " Amalgamation.........: ${do_amalgamation}"
2009-01-22 13:14:12 -08:00
echo " Documentation........: ${build_doc}"
2008-05-16 08:07:03 -07:00
echo " Tests................: ${enable_tests}"
echo " Coverage.............: ${enable_coverage}"
echo
2008-05-19 08:23:41 -07:00
echo " Old eet file format..: ${old_eet_file_format}"
echo
2005-09-27 15:10:09 -07:00
echo " Compilation..........: make"
echo
echo " Installation.........: make install"
echo
2007-09-25 11:26:49 -07:00
echo " prefix.............: $prefix"
2005-09-27 15:10:09 -07:00
echo