2012-09-11 09:04:21 -07:00
m4_define([v_maj], [1])
m4_define([v_min], [7])
m4_define([v_mic], [99])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
#### FIXME: i am sure that we can do some m4 to automagically do the stuff below for release and snapshots
##-- When released, remove the dnl on the below line
dnl m4_undefine([v_rev])
##-- When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
m4_ifdef([v_rev], [m4_define([efl_version], [v_maj.v_min.v_mic.v_rev])], [m4_define([efl_version], [v_maj.v_min.v_mic])])
m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
AC_INIT([efl], [efl_version], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.59])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AH_TOP([
#ifndef EFL_CONFIG_H__
#define EFL_CONFIG_H__
])
AH_BOTTOM([
#endif /* EFL_CONFIG_H__ */
])
AC_GNU_SOURCE
AC_SYS_LARGEFILE
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])
AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])
AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])
AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])
VMAJ=v_maj
AC_SUBST([VMAJ])
#### Default values
requirements_libs_evil=""
requirements_libs_eina=""
2012-10-10 10:40:35 -07:00
requirements_libs_eo=""
2012-09-11 09:04:21 -07:00
requirements_libs_eet=""
2012-09-21 01:15:58 -07:00
requirements_libs_deps_evil=""
requirements_libs_deps_eina=""
2012-10-10 10:40:35 -07:00
requirements_libs_deps_eo=""
2012-09-21 01:15:58 -07:00
requirements_libs_deps_eet=""
2012-10-10 10:40:35 -07:00
requirements_pc_evil=""
2012-09-11 09:04:21 -07:00
requirements_pc_eina=""
2012-09-25 23:56:52 -07:00
requirements_pc_eo=""
2012-10-10 10:40:35 -07:00
requirements_pc_eet=""
2012-09-11 09:04:21 -07:00
2012-10-10 10:40:35 -07:00
requirements_pc_deps_evil=""
2012-09-21 01:15:58 -07:00
requirements_pc_deps_eina=""
2012-10-10 10:40:35 -07:00
requirements_pc_deps_eo=""
2012-09-21 01:15:58 -07:00
requirements_pc_deps_eet=""
2012-09-11 09:04:21 -07:00
AC_SUBST([requirements_libs_evil])
AC_SUBST([requirements_libs_eina])
2012-10-10 10:40:35 -07:00
AC_SUBST([requirements_libs_eo])
2012-09-11 09:04:21 -07:00
AC_SUBST([requirements_libs_eet])
2012-10-10 10:40:35 -07:00
AC_SUBST([requirements_pc_evil])
2012-09-11 09:04:21 -07:00
AC_SUBST([requirements_pc_eina])
2012-09-25 23:56:52 -07:00
AC_SUBST([requirements_pc_eo])
2012-10-10 10:40:35 -07:00
AC_SUBST([requirements_pc_eet])
2012-09-11 09:04:21 -07:00
AC_CANONICAL_HOST
2012-10-10 11:43:15 -07:00
AC_ARG_WITH([profile],
[AC_HELP_STRING([--with-profile=PROFILE],
[use the predefined build profile, one of: dev, release.
@<:@default=dev@:>@])],
[build_profile=${withval}],
[build_profile=dev])
2012-10-10 11:46:27 -07:00
case "$build_profile" in
dev|release)
;;
*)
AC_MSG_ERROR([Unknown build profile --with-profile=${build_profile}])
;;
esac
2012-10-10 10:59:15 -07:00
# TODO: move me to m4 file that setups module/so related variables
2012-09-11 09:04:21 -07:00
have_wince="no"
have_win32="no"
have_windows="no"
case "$host_os" in
cegcc*)
AC_MSG_ERROR([ceGCC compiler is not supported anymore. Exiting...])
;;
mingw32ce*)
have_wince="yes"
have_windows="yes"
2012-09-16 03:57:48 -07:00
MODULE_ARCH="$host_os-$host_cpu"
MODULE_EXT=".dll"
2012-09-11 09:04:21 -07:00
;;
mingw*)
have_win32="yes"
have_windows="yes"
2012-09-16 03:57:48 -07:00
MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
MODULE_EXT=".dll"
;;
*)
MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
MODULE_EXT=".so"
2012-09-11 09:04:21 -07:00
;;
esac
2012-09-16 03:57:48 -07:00
AC_DEFINE_UNQUOTED([MODULE_ARCH], ["${MODULE_ARCH}"], ["Module architecture"])
AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects])
2012-10-10 10:59:15 -07:00
# TODO: move me to m4 file that setups the windows related variables
2012-09-11 09:04:21 -07:00
AM_CONDITIONAL([HAVE_WINCE], [test "x${have_wince}" = "xyes"])
AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
AM_CONDITIONAL([HAVE_WINDOWS], [test "x${have_windows}" = "xyes"])
#### Additional options to configure
2012-09-26 21:46:30 -07:00
2012-09-11 09:04:21 -07:00
#### Checks for programs
### libtool
if test "x${have_windows}" = "xyes" ; then
lt_cv_deplibs_check_method='pass_all'
fi
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL
version_info="lt_cur:lt_rev:lt_age"
AC_SUBST([version_info])
release_info="v_rel"
AC_SUBST([release_info])
### compilers
2012-09-11 10:11:37 -07:00
AM_PROG_AS
2012-09-11 09:04:21 -07:00
AC_PROG_CXX
AC_LANG(C)
AC_PROG_CPP
AC_PROG_CC
# pkg-config
PKG_PROG_PKG_CONFIG
2012-09-11 10:27:21 -07:00
if test "x${PKG_CONFIG}" = "x" ; then
AC_MSG_ERROR([pkg-config tool not found. Install it or set PKG_CONFIG environment variable to that path tool. Exiting...])
2012-09-11 09:04:21 -07:00
fi
2012-09-16 03:57:48 -07:00
# 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])
2012-09-11 09:04:21 -07:00
# doxygen program for documentation building
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
#### Checks for libraries
#### Checks for header files
2012-09-17 09:35:38 -07:00
EFL_CHECK_PATH_MAX
2012-09-11 09:04:21 -07:00
#### Checks for types
#### Checks for structures
#### Checks for compiler characteristics
2012-09-17 09:35:38 -07:00
AC_C_BIGENDIAN
AC_C_INLINE
2012-09-11 09:04:21 -07:00
# EFL_CHECK_COMPILER_FLAGS([MY_LIB], [-Wall -Wextra])
#### Checks for linker characteristics
2012-10-10 10:59:15 -07:00
# TODO: do we really need this? maybe setup in the specific m4 file that
# does the windows related variables? Do we need to manually specify this
# for every module? it's annoying and easy to forget!
2012-09-11 09:04:21 -07:00
lt_enable_auto_import=""
case "${host_os}" in
mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
AC_SUBST([lt_enable_auto_import])
#### Checks for library functions
2012-09-17 09:35:38 -07:00
AC_FUNC_ALLOCA
2012-09-11 09:04:21 -07:00
###################### EFL ######################
#### Evil
if test "x${have_windows}" = "xyes" ; then
2012-09-16 03:57:48 -07:00
AC_MSG_NOTICE([Evil checks])
2012-09-11 09:04:21 -07:00
### Default values
### Additional options to configure
EFL_SELECT_WINDOWS_VERSION
### Checks for programs
### Checks for libraries
2012-10-10 10:59:15 -07:00
# TODO: are these needed here? parts of this are replicated for EVERY LIB :-(
2012-09-11 09:04:21 -07:00
EVIL_LIBS=""
EVIL_DLFCN_LIBS=""
case "$host_os" in
mingw32ce*)
EVIL_LIBS="-lws2"
EVIL_DLFCN_LIBS="-ltoolhelp"
;;
*)
2012-09-11 10:44:59 -07:00
EVIL_LIBS="-luuid -lole32 -lws2_32 -lsecur32"
2012-09-11 09:04:21 -07:00
EVIL_DLFCN_LIBS="-lpsapi"
;;
esac
requirements_libs_evil="${EVIL_LIBS}"
2012-09-16 03:57:48 -07:00
2012-09-11 09:04:21 -07:00
AC_SUBST([EVIL_LIBS])
AC_SUBST([EVIL_DLFCN_LIBS])
2012-09-16 03:57:48 -07:00
AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
2012-09-11 09:04:21 -07:00
### Checks for header files
AC_CHECK_HEADERS([errno.h])
### Checks for types
### Checks for structures
### Checks for compiler characteristics
EVIL_CPPFLAGS="-DEFL_EVIL_BUILD"
2012-09-11 10:44:59 -07:00
EVIL_DLFCN_CPPFLAGS="-DEFL_EVIL_DLFCN_BUILD -DPSAPI_VERSION=1"
2012-09-21 01:15:58 -07:00
EVIL_CFLAGS="-Wall -Wextra -Wshadow -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wpointer-arith -mms-bitfields"
2012-09-11 09:04:21 -07:00
EVIL_CXXFLAGS=""
if test "x${have_win32}" = "xyes" ; then
EVIL_CXXFLAGS="-fno-rtti -fno-exceptions"
EVIL_CPPFLAGS="${EVIL_CPPFLAGS} -DSECURITY_WIN32"
fi
AC_SUBST([EVIL_CPPFLAGS])
2012-09-11 10:44:59 -07:00
AC_SUBST([EVIL_DLFCN_CPPFLAGS])
2012-09-11 09:04:21 -07:00
AC_SUBST([EVIL_CFLAGS])
AC_SUBST([EVIL_CXXFLAGS])
### Checks for linker characteristics
### Checks for library functions
fi
#### End of Evil
#### Eina
2012-09-16 03:57:48 -07:00
AC_MSG_NOTICE([Eina checks])
2012-09-11 09:04:21 -07:00
### Default values
2012-09-16 03:57:48 -07:00
2012-09-11 09:04:21 -07:00
### Additional options to configure
2012-09-16 03:57:48 -07:00
2012-10-10 11:43:15 -07:00
have_magic_debug="yes"
have_safety_checks="yes"
want_log="yes"
case "$build_profile" in
dev)
with_max_log_level=""
have_stringshare_usage="yes"
want_valgrind="no" # TODO: "yes" is not working: relocation R_X86_64_32S against `vgPlain_interim_stack' can not be used when making a shared object; recompile with -fPIC
want_debug_malloc="yes"
;;
release)
with_max_log_level="3"
have_stringshare_usage="no"
want_valgrind="no"
want_debug_malloc="no"
;;
esac
2012-09-16 03:57:48 -07:00
if test "x${have_magic_debug}" = "xyes" ; then
EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
fi
AC_SUBST([EINA_CONFIGURE_MAGIC_DEBUG])
if test "x${have_safety_checks}" = "xyes" ; then
AC_DEFINE([EINA_SAFETY_CHECKS], [1], [disable safety checks for NULL pointers and like.])
EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
fi
AC_SUBST([EINA_CONFIGURE_SAFETY_CHECKS])
AM_CONDITIONAL([SAFETY_CHECKS], [test "x$have_safety_checks" = "xyes"])
2012-10-10 11:43:15 -07:00
if test -n "$with_max_log_level"; then
AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${with_max_log_level}])
AC_DEFINE_UNQUOTED([EINA_LOG_LEVEL_MAXIMUM], [${with_max_log_level}], [if set, logging is limited to this amount.])
fi
if test "x${have_stringshare_usage}" = "xyes"; then
AC_DEFINE([EINA_STRINGSHARE_USAGE], [1], [Report Eina stringshare usage pattern])
fi
2012-09-16 03:57:48 -07:00
# Choose best memory pool
2012-10-10 12:57:53 -07:00
EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
2012-09-16 03:57:48 -07:00
AC_SUBST([EINA_CONFIGURE_DEFAULT_MEMPOOL])
2012-09-11 09:04:21 -07:00
### Checks for programs
2012-09-16 03:57:48 -07:00
2012-09-11 09:04:21 -07:00
### Checks for libraries
2012-09-16 03:57:48 -07:00
## Compatibility layers
# Evil library for compilation on Windows
EFL_EINA_BUILD=""
case "$host_os" in
mingw*)
2012-10-10 10:59:15 -07:00
# TODO: WHAT? evil was build before, so it should already define this
# AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
2012-09-16 03:57:48 -07:00
requirements_pc_eina="${requirements_pc_eina} evil"
EFL_EINA_BUILD="-DEFL_EINA_BUILD"
;;
esac
AC_SUBST([EFL_EINA_BUILD])
# Escape library for compilation on Playstation 3
case "$host_vendor" in
ps3*)
2012-10-10 10:59:15 -07:00
# TODO: add back whenever escape is merged into efl single tree
# PKG_CHECK_EXISTS([escape])
# AC_DEFINE([HAVE_ESCAPE], [1], [Set to 1 if Escape package is installed])
# requirements_pc_eina="${requirements_pc_eina} escape"
2012-09-16 03:57:48 -07:00
;;
esac
2012-09-17 09:35:38 -07:00
# Exotic library for compilation on Coyote
2012-09-16 03:57:48 -07:00
2012-10-10 10:59:15 -07:00
# TODO: add back whenever exotic is merged into efl single tree
#PKG_CHECK_EXISTS([exotic],
# [
# enable_exotic="yes"
# AC_DEFINE([HAVE_EXOTIC_H], [1], [Define to 1 if you have Exotic.])
# EINA_CONFIGURE_HAVE_EXOTIC="#define EINA_HAVE_EXOTIC"
# requirements_pc_eina="exotic ${requirements_pc_eina}"
# ],
# [enable_exotic="no"])
2012-09-16 03:57:48 -07:00
AM_CONDITIONAL([EINA_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"])
AC_SUBST([EINA_CONFIGURE_HAVE_EXOTIC])
## Options
# Valgrind
2012-10-10 11:43:15 -07:00
if test "x${want_valgrind}" = "xyes"; then
2012-09-16 03:57:48 -07:00
PKG_CHECK_MODULES([VALGRIND], [valgrind >= 2.4.0],
[
have_valgrind="yes"
2012-09-21 01:15:58 -07:00
requirements_pc_eina="valgrind >= 2.4.0 ${requirements_pc_eina}"
requirements_pc_deps_eina="valgrind ${requirements_pc_deps_eina}"
2012-09-16 03:57:48 -07:00
],
[
have_valgrind="no"
2012-10-10 11:43:15 -07:00
AC_MSG_ERROR([Valgrind >= 2.4.0 is required])
2012-09-16 03:57:48 -07:00
])
else
AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
fi
if test "x${ac_cv_func_malloc_usable_size}" = "xyes" && test "x${want_debug_malloc}" = "xyes"; then
AC_DEFINE([EINA_DEBUG_MALLOC], [1], [Turn on debugging overhead in mempool])
fi
## Modules
2012-09-21 01:15:58 -07:00
if ! test "x${requirements_pc_deps_eina}" = "x" ; then
PKG_CHECK_MODULES([EINA], [${requirements_pc_deps_eina}])
fi
2012-09-16 03:57:48 -07:00
## Examples
2012-10-10 10:40:35 -07:00
# TODO: add once ecore-evas is merged:
#PKG_CHECK_MODULES([ECORE_EVAS],
# [ecore-evas ecore evas],
# [build_tiler_example="yes"],
# [build_tiler_example="no"])
2012-09-16 03:57:48 -07:00
AM_CONDITIONAL([BUILD_TILER_EXAMPLE], [test "x${build_tiler_example}" = "xyes"])
## Tests
EFL_CHECK_TESTS(EINA)
2012-09-16 07:25:29 -07:00
## Benchmarks
PKG_CHECK_MODULES([GLIB],
[glib-2.0],
[have_glib="yes"],
[have_glib="no"])
if test "x${have_glib}" = "xyes" ; then
GLIB_CFLAGS="${GLIB_CFLAGS} -DEINA_BENCH_HAVE_GLIB"
fi
2012-09-11 09:04:21 -07:00
### Checks for header files
2012-09-16 03:57:48 -07:00
AC_HEADER_ASSERT
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h execinfo.h mcheck.h])
# sys/mman.h could be provided by evil/escape/exotic so we need to set CFLAGS accordingly
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} ${EINA_CFLAGS}"
AC_CHECK_HEADERS([sys/mman.h])
CFLAGS="${CFLAGS_save}"
if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"
AC_DEFINE([HAVE_INTTYPES_H], [1], [Define to 1 if you have the <inttypes.h> header file.])
fi
AC_SUBST([EINA_CONFIGURE_HAVE_INTTYPES_H])
if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"
AC_DEFINE([HAVE_STDINT_H], [1], [Define to 1 if you have the <stdint.h> header file.])
fi
AC_SUBST([EINA_CONFIGURE_HAVE_STDINT_H])
2012-09-11 09:04:21 -07:00
### Checks for types
2012-09-16 03:57:48 -07:00
# wchar_t
AC_CHECK_SIZEOF([wchar_t])
EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
AC_SUBST([EINA_SIZEOF_WCHAR_T])
AC_CHECK_TYPES([siginfo_t], [], [],
[[
#include <signal.h>
#if HAVE_SIGINFO_H
# include <siginfo.h>
#endif
]])
# struct dirent
AC_CHECK_TYPES([struct dirent], [have_dirent="yes"], [have_dirent="no"],
[[
#include <dirent.h>
]])
if test "x${have_dirent}" = "xyes" ; then
EINA_CONFIGURE_HAVE_DIRENT_H="#define EINA_HAVE_DIRENT_H"
AC_DEFINE([HAVE_DIRENT_H], [1], [Define to 1 if you have a valid <dirent.h> header file.])
fi
AC_SUBST([EINA_CONFIGURE_HAVE_DIRENT_H])
2012-09-11 09:04:21 -07:00
### Checks for structures
2012-09-16 03:57:48 -07:00
2012-09-11 09:04:21 -07:00
### Checks for compiler characteristics
2012-09-16 03:57:48 -07:00
m4_ifdef([v_ver],
[
EFL_CHECK_COMPILER_FLAGS([EINA], [-Wall -Wextra])
])
2012-09-21 01:15:58 -07:00
EFL_CHECK_COMPILER_FLAGS([EINA], [-Wshadow -Wpointer-arith])
2012-09-16 03:57:48 -07:00
2012-09-11 09:04:21 -07:00
### Checks for linker characteristics
2012-09-16 03:57:48 -07:00
EFL_CHECK_LINKER_FLAGS([EINA], [-fno-strict-aliasing])
2012-09-11 09:04:21 -07:00
### Checks for library functions
2012-09-16 03:57:48 -07:00
AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp backtrace backtrace_symbols malloc_usable_size mtrace])
EFL_CHECK_FUNCS([EINA], [dirfd dlopen dladdr fnmatch iconv shm_open setxattr])
enable_log="no"
if test "x${efl_func_fnmatch}" = "xyes" && test "x${want_log}" = "xyes" ; then
enable_log="yes"
fi
AC_MSG_CHECKING([wether to build Eina_Log infrastructure])
AC_MSG_RESULT([${enable_log}])
if test "x${enable_log}" = "xyes"; then
EINA_CONFIGURE_ENABLE_LOG="#define EINA_ENABLE_LOG"
AC_DEFINE([HAVE_LOG], [1], [Define to 1 if we log support is on])
fi
AC_SUBST([EINA_CONFIGURE_ENABLE_LOG])
EFL_CHECK_THREADS
2012-10-10 13:24:45 -07:00
EINA_CONFIGURE_HAVE_THREADS="#define EINA_HAVE_THREADS"
2012-09-16 03:57:48 -07:00
AC_SUBST(EINA_CONFIGURE_HAVE_THREADS)
if test "x${efl_have_debug_threads}" = "xyes"; then
EINA_CONFIGURE_HAVE_DEBUG_THREADS="#define EINA_HAVE_DEBUG_THREADS"
fi
AC_SUBST(EINA_CONFIGURE_HAVE_DEBUG_THREADS)
AM_CONDITIONAL([EINA_DEBUG_THREADS], [test "x${efl_have_debug_threads}" = "xyes"])
if ! test "x${efl_have_on_off_threads}" = "xno"; then
EINA_CONFIGURE_HAVE_ON_OFF_THREADS="#define EINA_HAVE_ON_OFF_THREADS"
fi
AC_SUBST(EINA_CONFIGURE_HAVE_ON_OFF_THREADS)
AM_CONDITIONAL([EINA_ON_OFF_THREADS], [! test "x${efl_have_on_off_threads}" = "xno"])
### Modules
2012-10-10 12:57:53 -07:00
EINA_CHECK_MODULE([chained-pool], [static], [chained pool])
EINA_CHECK_MODULE([pass-through], [static], [pass through])
EINA_CHECK_MODULE([one-big], [static], [one big])
2012-09-16 03:57:48 -07:00
2012-09-11 09:04:21 -07:00
#### End of Eina
2012-09-16 03:57:48 -07:00
#### Eet
2012-09-23 12:56:44 -07:00
efl_have_eet="no"
2012-09-17 09:35:38 -07:00
AC_MSG_NOTICE([Eet checks])
2012-09-16 03:57:48 -07:00
### Default values
2012-09-17 09:35:38 -07:00
2012-09-16 03:57:48 -07:00
### Additional options to configure
2012-09-17 09:35:38 -07:00
EFL_ENABLE_BIN([eet])
2012-10-10 12:26:56 -07:00
AC_ARG_WITH([crypto],
[AC_HELP_STRING([--with-crypto=CRYPTO],
[use the predefined build crypto, one of:
openssl, gnutls or none.
@<:@default=openssl@:>@])],
[build_crypto=${withval}],
[build_crypto=openssl])
case "$build_crypto" in
openssl|gnutls|none)
;;
*)
AC_MSG_ERROR([Unknown build crypto --with-crypto=${build_crypto}])
;;
esac
2012-09-17 09:35:38 -07:00
2012-09-16 03:57:48 -07:00
### Checks for programs
2012-09-17 09:35:38 -07:00
2012-09-16 03:57:48 -07:00
### Checks for libraries
2012-09-17 09:35:38 -07:00
## Compatibility layers
# Evil library for compilation on Windows
EFL_EET_BUILD=""
case "$host_os" in
mingw*)
2012-10-10 10:59:15 -07:00
# TODO: WHAT? evil was build before, so it should already define this
# AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
2012-09-17 09:35:38 -07:00
requirements_pc_eet="evil ${requirements_pc_eet}"
EFL_EET_BUILD="-DEFL_EET_BUILD"
;;
esac
AC_SUBST(EFL_EET_BUILD)
# Exotic library for compilation on Coyote
2012-10-10 10:59:15 -07:00
# TODO: add back whenever exotic is merged into efl single tree
#PKG_CHECK_EXISTS([exotic],
# [
# enable_exotic="yes"
# AC_DEFINE([HAVE_EXOTIC_H], [1], [Define to 1 if you have Exotic.])
# requirements_pc_eet="exotic ${requirements_pc_eet}"
# ],
# [enable_exotic="no"])
2012-09-17 09:35:38 -07:00
## Secure layer
2012-10-10 12:26:56 -07:00
case "$build_crypto" in
gnutls)
PKG_CHECK_MODULES([GNUTLS], [gnutls >= 1.7.6])
AC_DEFINE([HAVE_GNUTLS], [1], [Have Gnutls support])
requirements_pc_eet="gnutls >= 1.7.6 ${requirements_pc_eet}"
requirements_pc_deps_eet="gnutls >= 1.7.6 ${requirements_pc_deps_eet}"
# TODO: do we need this?
# libgcrypt
AC_PATH_GENERIC([libgcrypt], [], [:],
[AC_MSG_ERROR([libgcrypt required but not found])])
2012-09-17 09:35:38 -07:00
requirements_libs_eet="${LIBGCRYPT_LIBS} ${requirements_libs_eet}"
2012-09-21 01:15:58 -07:00
requirements_libs_deps_eet="${LIBGCRYPT_LIBS} ${requirements_libs_deps_eet}"
2012-09-17 09:35:38 -07:00
2012-10-10 12:26:56 -07:00
# TODO: do we need this? can't we just bump required version?
# Specific GNUTLS improvement
CFLAGS_save="${CFLAGS}"
LIBS_save="${LIBS}"
CFLAGS="${GNUTLS_CFLAGS}"
LIBS="${GNUTLS_LIBS}"
AC_CHECK_LIB([gnutls], [gnutls_x509_crt_verify_hash],
[
AC_DEFINE([EET_USE_NEW_GNUTLS_API], [1], [use gnutls_x509_crt_verify_hash])
], [AC_MSG_NOTICE([Optional gnutls_x509_crt_verify_hash not present.])])
CFLAGS="${CFLAGS_save}"
LIBS="${LIBS_save}"
# TODO: do we need this? can't we just bump required version?
CFLAGS_save="${CFLAGS}"
LIBS_save="${LIBS}"
CFLAGS="${GNUTLS_CFLAGS}"
LIBS="${GNUTLS_LIBS}"
AC_CHECK_LIB([gnutls], [gnutls_privkey_sign_data],
[
AC_DEFINE([EET_USE_NEW_PRIVKEY_SIGN_DATA], [1], [use gnutls_privkey_sign_data])
], [AC_MSG_NOTICE([Optional gnutls_privkey_sign_data not present.])])
CFLAGS="${CFLAGS_save}"
LIBS="${LIBS_save}"
# TODO: do we need this? can't we just bump required version?
CFLAGS_save="${CFLAGS}"
LIBS_save="${LIBS}"
CFLAGS="${GNUTLS_CFLAGS}"
LIBS="${GNUTLS_LIBS}"
AC_CHECK_LIB([gnutls], [gnutls_pubkey_verify_hash],
[
AC_DEFINE([EET_USE_NEW_PUBKEY_VERIFY_HASH], [1], [use gnutls_pubkey_verify_hash])
])
CFLAGS="${CFLAGS_save}"
LIBS="${LIBS_save}"
;;
2012-09-17 09:35:38 -07:00
2012-10-10 12:26:56 -07:00
openssl)
PKG_CHECK_MODULES([OPENSSL], [openssl])
AC_DEFINE([HAVE_OPENSSL], [1], [Have Openssl support])
requirements_pc_eet="openssl ${requirements_pc_eet}"
requirements_pc_deps_eet="openssl ${requirements_pc_deps_eet}"
;;
esac
2012-09-17 09:35:38 -07:00
# Cryptography support
2012-10-10 12:26:56 -07:00
if test "$build_crypto" != "none" ; then
2012-09-17 09:35:38 -07:00
AC_DEFINE([HAVE_CIPHER], [1], [Have cipher support built in eet])
AC_DEFINE([HAVE_SIGNATURE], [1], [Have signature support for eet file])
fi
# libjpeg and zlib
2012-09-21 01:15:58 -07:00
EFL_CHECK_LIBS([EET], [libjpeg zlib])
2012-10-10 13:06:45 -07:00
# TODO: better way to force those instead of is secondary check
if test "x${efl_lib_zlib}" != "xyes" -o "x${efl_lib_libjpeg}" != "xyes" ; then
AC_MSG_ERROR([Required EET libraries were not found.])
fi
2012-09-17 09:35:38 -07:00
2012-09-26 21:46:30 -07:00
# Eina library
2012-09-21 01:15:58 -07:00
requirements_pc_eet="eina >= 1.7.99 ${requirements_pc_eet}"
PKG_CHECK_MODULES([EET], [${requirements_pc_deps_eet}])
# Windows
2012-09-17 09:35:38 -07:00
case "$host_os" in
mingw32ce*)
2012-10-10 10:59:15 -07:00
# TODO: are these needed here? parts of this are replicated for EVERY LIB :-(
2012-09-17 09:35:38 -07:00
requirements_libs_eet="${requirements_libs_eet} -lws2"
2012-09-21 01:15:58 -07:00
requirements_libs_deps_eet="${requirements_libs_deps_eet} -lws2"
2012-09-17 09:35:38 -07:00
;;
mingw*)
2012-10-10 10:59:15 -07:00
# TODO: are these needed here? parts of this are replicated for EVERY LIB :-(
2012-09-17 09:35:38 -07:00
requirements_libs_eet="${requirements_libs_eet} -lws2_32"
2012-09-21 01:15:58 -07:00
requirements_libs_deps_eet="${requirements_libs_deps_eet} -lws2_32"
2012-09-17 09:35:38 -07:00
;;
esac
2012-09-21 01:15:58 -07:00
EET_LIBS="${EET_LIBS} ${requirements_libs_deps_eet}"
2012-09-17 09:35:38 -07:00
2012-09-16 03:57:48 -07:00
### Checks for header files
2012-09-17 09:35:38 -07:00
AC_CHECK_HEADERS(netinet/in.h unistd.h)
2012-09-16 03:57:48 -07:00
### Checks for types
2012-09-17 09:35:38 -07:00
2012-09-16 03:57:48 -07:00
### Checks for structures
2012-09-17 09:35:38 -07:00
2012-09-16 03:57:48 -07:00
### Checks for compiler characteristics
2012-09-17 09:35:38 -07:00
2012-09-21 01:15:58 -07:00
EFL_CHECK_COMPILER_FLAGS([EET], [-Wshadow -Wpointer-arith])
2012-09-16 03:57:48 -07:00
### Checks for linker characteristics
2012-09-17 09:35:38 -07:00
case "${host_os}" in
openbsd*)
;;
*)
2012-10-10 10:59:15 -07:00
# TODO: here? Why don't do everywhere or let user specify it?
2012-09-17 09:35:38 -07:00
EFL_CHECK_LINKER_FLAGS([EET], [-Wl,--as-needed])
;;
esac
2012-09-16 03:57:48 -07:00
### Checks for library functions
2012-09-23 12:56:44 -07:00
### Check availability
2012-09-16 03:57:48 -07:00
#### End of Eet
2012-09-11 09:04:21 -07:00
2012-09-26 21:46:30 -07:00
#### Eo
efl_have_eo="no"
AC_MSG_NOTICE([Eo checks])
### Default values
### Additional options to configure
### Checks for programs
### Checks for libraries
# Eina library
2012-10-10 10:59:15 -07:00
# TODO: really? do we need this? it's a local eina!
2012-09-26 21:46:30 -07:00
requirements_pc_eo="eina >= 1.7.99"
2012-10-05 13:09:47 -07:00
AC_ARG_VAR([EO_CFLAGS], [preprocessor flags for Eo])
AC_SUBST([EO_CFLAGS])
AC_ARG_VAR([EO_LIBS], [linker flags for Eo])
AC_SUBST([EO_LIBS])
2012-09-26 21:46:30 -07:00
# Example (evas one)
2012-10-10 10:40:35 -07:00
# TODO: add once elementary is merged
#PKG_CHECK_MODULES([ELM], [elementary >= 1.7.0], [have_elm="yes"], [have_elm="no"])
2012-09-26 21:46:30 -07:00
AM_CONDITIONAL([EO_BUILD_EXAMPLE_EVAS], [test "x${have_elm}" = "xyes"])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
EFL_EO_BUILD=""
case "$host_os" in
mingw*)
EFL_EO_BUILD="-DEFL_EO_BUILD"
;;
esac
AC_SUBST([EFL_EO_BUILD])
### Checks for linker characteristics
### Checks for library functions
### Check availability
efl_have_eo="yes"
#### End of Eo
2012-09-11 09:04:21 -07:00
AC_CONFIG_FILES([
Makefile
2012-09-18 23:57:03 -07:00
doc/Makefile
doc/Doxyfile
2012-09-11 09:04:21 -07:00
src/Makefile
2012-09-16 07:25:29 -07:00
src/benchmarks/Makefile
src/benchmarks/eina/Makefile
2012-09-25 23:56:52 -07:00
src/benchmarks/eo/Makefile
2012-09-11 09:04:21 -07:00
src/bin/Makefile
src/bin/evil/Makefile
2012-09-17 09:35:38 -07:00
src/bin/eet/Makefile
2012-09-16 14:15:43 -07:00
src/examples/Makefile
src/examples/eina/Makefile
2012-09-17 09:35:38 -07:00
src/examples/eet/Makefile
2012-09-25 23:56:52 -07:00
src/examples/eo/Makefile
2012-09-11 09:04:21 -07:00
src/lib/Makefile
src/lib/evil/Makefile
2012-09-16 03:57:48 -07:00
src/lib/eina/Makefile
2012-09-26 21:02:37 -07:00
src/lib/eina/eina_config.h
2012-09-17 09:35:38 -07:00
src/lib/eet/Makefile
2012-09-25 23:56:52 -07:00
src/lib/eo/Makefile
2012-09-16 03:57:48 -07:00
src/modules/Makefile
src/modules/eina/Makefile
src/modules/eina/mp/Makefile
src/modules/eina/mp/chained_pool/Makefile
src/modules/eina/mp/pass_through/Makefile
src/modules/eina/mp/one_big/Makefile
src/scripts/Makefile
src/scripts/eina/Makefile
2012-09-16 07:25:29 -07:00
src/tests/Makefile
src/tests/eina/Makefile
2012-09-17 09:35:38 -07:00
src/tests/eet/Makefile
2012-09-25 23:56:52 -07:00
src/tests/eo/Makefile
2012-09-26 20:10:06 -07:00
spec/efl.spec
2012-09-26 20:02:12 -07:00
pc/evil.pc
pc/eina.pc
pc/eet.pc
pc/eo.pc
2012-09-11 09:04:21 -07:00
])
AC_OUTPUT
#### Info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE_NAME $PACKAGE_VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
echo " OS...................: ${host_os}"
2012-10-10 11:43:15 -07:00
echo " Build Profile........: ${build_profile}"
2012-10-10 12:36:36 -07:00
echo " Cryptographic System.: ${build_crypto}"
2012-09-11 09:04:21 -07:00
if test "x${have_windows}" = "xyes" ; then
echo " Windows version......: ${_efl_windows_version}"
fi
echo " Documentation........: ${build_doc}"
echo
2012-09-16 03:57:48 -07:00
echo "Eina"
echo
echo " Thread Support.......: ${efl_have_threads}"
if test "${efl_have_threads}" = "POSIX" ; then
echo " spinlock...........: ${efl_have_posix_threads_spinlock}"
echo " debug usage........: ${efl_have_debug_threads}"
echo " on/off support.....: ${efl_have_on_off_threads}"
fi
echo
2012-09-11 09:04:21 -07:00
echo "Compilation............: make (or gmake)"
echo " CPPFLAGS.............: $CPPFLAGS"
echo " CFLAGS...............: $CFLAGS"
echo " CXXFLAGS.............: $CXXFLAGS"
echo " LDFLAGS..............: $LDFLAGS"
echo
2012-10-10 12:36:36 -07:00
echo "Tests..................: make check (Coverage: ${_efl_enable_coverage})"
echo "Examples...............: make examples (also install-examples)"
2012-09-11 09:04:21 -07:00
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo " prefix...............: $prefix"
echo