efl/configure.ac

3493 lines
90 KiB
Plaintext
Raw Normal View History

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_USE_SYSTEM_EXTENSIONS
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])
#### Additional options to configure
AC_ARG_WITH([profile],
[AC_HELP_STRING([--with-profile=PROFILE],
[use the predefined build profile, one of: dev, debug and release.
@<:@default=dev@:>@])],
[build_profile=${withval}],
[build_profile=dev])
case "${build_profile}" in
dev|debug|release)
;;
*)
AC_MSG_ERROR([Unknown build profile --with-profile=${build_profile}])
;;
esac
prefer_assert="no"
case "${build_profile}" in
dev|debug)
prefer_assert="yes"
;;
esac
# TODO: add some build "profile" (server, full, etc...)
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 option: --with-crypto=${build_crypto}])
;;
esac
AC_ARG_ENABLE([coverage],
[AC_HELP_STRING([--enable-coverage], [enable unit testing coverage. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_coverage="yes"
else
want_coverage="no"
fi
],
[want_coverage="no"])
#### Default values
platform_pc=""
platform_pc_evil=""
platform_pc_escape=""
platform_pc_exotic=""
platform_libs=""
platform_libs_evil=""
platform_libs_escape=""
platform_libs_exotic=""
requirements_pc_crypto=""
requirements_pc_deps_crypto=""
requirements_libs_crypto=""
requirements_libs_evil=""
requirements_libs_eina=""
requirements_libs_eo=""
requirements_libs_eet=""
requirements_libs_evas=""
requirements_libs_ecore=""
requirements_libs_ecore_con=""
requirements_libs_ecore_ipc=""
requirements_libs_ecore_file=""
requirements_libs_ecore_input=""
requirements_libs_ecore_cocoa=""
requirements_libs_ecore_fb=""
requirements_libs_ecore_psl1ght=""
requirements_libs_ecore_sdl=""
requirements_libs_ecore_wayland=""
requirements_libs_ecore_win32=""
requirements_libs_ecore_wince=""
requirements_libs_ecore_x=""
requirements_libs_ecore_evas=""
requirements_libs_embryo=""
requirements_libs_eio=""
#requirements_libs_edje=""
#requirements_libs_efreet=""
#requirements_libs_e_dbus=""
#requirements_libs_eeze=""
#requirements_libs_emotion=""
#requirements_libs_ethumb=""
#requirements_libs_elementary=""
requirements_pc_eina=""
2012-09-25 23:56:52 -07:00
requirements_pc_eo=""
requirements_pc_eet=""
requirements_pc_evas=""
requirements_pc_ecore=""
requirements_pc_ecore_con=""
requirements_pc_ecore_ipc=""
requirements_pc_ecore_file=""
requirements_pc_ecore_input=""
requirements_pc_ecore_input_evas=""
requirements_pc_ecore_cocoa=""
requirements_pc_ecore_fb=""
requirements_pc_ecore_psl1ght=""
requirements_pc_ecore_sdl=""
requirements_pc_ecore_wayland=""
requirements_pc_ecore_win32=""
requirements_pc_ecore_wince=""
requirements_pc_ecore_x=""
requirements_pc_ecore_evas=""
requirements_pc_embryo=""
requirements_pc_eio=""
#requirements_pc_edje=""
#requirements_pc_efreet=""
#requirements_pc_e_dbus=""
#requirements_pc_eeze=""
#requirements_pc_emotion=""
#requirements_pc_ethumb=""
#requirements_pc_elementary=""
requirements_pc_deps_eina=""
requirements_pc_deps_eo=""
requirements_pc_deps_eet=""
requirements_pc_deps_evas=""
requirements_pc_deps_ecore=""
requirements_pc_deps_ecore_con=""
requirements_pc_deps_ecore_fb=""
requirements_pc_deps_ecore_sdl=""
requirements_pc_deps_ecore_wayland=""
requirements_pc_deps_ecore_evas=""
requirements_pc_deps_embryo=""
#requirements_pc_deps_edje=""
#requirements_pc_deps_efreet=""
#requirements_pc_deps_e_dbus=""
#requirements_pc_deps_eeze=""
#requirements_pc_deps_emotion=""
#requirements_pc_deps_ethumb=""
#requirements_pc_deps_elementary=""
AC_SUBST([requirements_libs_evil])
AC_SUBST([requirements_libs_eina])
AC_SUBST([requirements_libs_eo])
AC_SUBST([requirements_libs_eet])
AC_SUBST([requirements_libs_evas])
AC_SUBST([requirements_libs_ecore])
AC_SUBST([requirements_libs_ecore_con])
AC_SUBST([requirements_libs_ecore_ipc])
AC_SUBST([requirements_libs_ecore_file])
AC_SUBST([requirements_libs_ecore_input])
AC_SUBST([requirements_libs_ecore_cocoa])
AC_SUBST([requirements_libs_ecore_fb])
AC_SUBST([requirements_libs_ecore_psl1ght])
AC_SUBST([requirements_libs_ecore_sdl])
AC_SUBST([requirements_libs_ecore_wayland])
AC_SUBST([requirements_libs_ecore_win32])
AC_SUBST([requirements_libs_ecore_wince])
AC_SUBST([requirements_libs_ecore_x])
AC_SUBST([requirements_libs_ecore_evas])
AC_SUBST([requirements_libs_embryo])
AC_SUBST([requirements_libs_eio])
#AC_SUBST([requirements_libs_edje])
#AC_SUBST([requirements_libs_efreet])
#AC_SUBST([requirements_libs_e_dbus])
#AC_SUBST([requirements_libs_eeze])
#AC_SUBST([requirements_libs_emotion])
#AC_SUBST([requirements_libs_ethumb])
#AC_SUBST([requirements_libs_elementary])
AC_SUBST([requirements_pc_eina])
2012-09-25 23:56:52 -07:00
AC_SUBST([requirements_pc_eo])
AC_SUBST([requirements_pc_eet])
AC_SUBST([requirements_pc_evas])
AC_SUBST([requirements_pc_ecore])
AC_SUBST([requirements_pc_ecore_con])
AC_SUBST([requirements_pc_ecore_ipc])
AC_SUBST([requirements_pc_ecore_file])
AC_SUBST([requirements_pc_ecore_input])
AC_SUBST([requirements_pc_ecore_input_evas])
AC_SUBST([requirements_pc_ecore_cocoa])
AC_SUBST([requirements_pc_ecore_fb])
AC_SUBST([requirements_pc_ecore_psl1ght])
AC_SUBST([requirements_pc_ecore_sdl])
AC_SUBST([requirements_pc_ecore_wayland])
AC_SUBST([requirements_pc_ecore_win32])
AC_SUBST([requirements_pc_ecore_wince])
AC_SUBST([requirements_pc_ecore_x])
AC_SUBST([requirements_pc_ecore_evas])
AC_SUBST([requirements_pc_embryo])
AC_SUBST([requirements_pc_eio])
#AC_SUBST([requirements_pc_edje])
#AC_SUBST([requirements_pc_efreet])
#AC_SUBST([requirements_pc_e_dbus])
#AC_SUBST([requirements_pc_eeze])
#AC_SUBST([requirements_pc_emotion])
#AC_SUBST([requirements_pc_ethumb])
#AC_SUBST([requirements_pc_elementary])
AC_CANONICAL_HOST
# TODO: move me to m4 file that setups module/so related variables
have_wince="no"
have_win32="no"
have_windows="no"
have_ps3="no"
case "$host_os" in
cegcc*)
AC_MSG_ERROR([ceGCC compiler is not supported anymore. Exiting...])
;;
mingw32ce*)
have_wince="yes"
have_windows="yes"
want_efreet="no"
want_e_dbus="no"
want_eeze="no"
want_emotion="no"
want_ethumb="no"
MODULE_ARCH="$host_os-$host_cpu"
MODULE_EXT=".dll"
;;
mingw*)
have_win32="yes"
have_windows="yes"
want_eeze="no"
MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
MODULE_EXT=".dll"
;;
cygwin*)
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"
;;
esac
case "$host_vendor" in
ps3*)
have_ps3="yes"
;;
esac
AC_SUBST([MODULE_ARCH])
AC_DEFINE_UNQUOTED([MODULE_ARCH], ["${MODULE_ARCH}"], ["Module architecture"])
AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects])
# TODO: move me to m4 file that setups the windows related variables
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"])
AM_CONDITIONAL([HAVE_PS3], [test "x${have_ps3}" = "xyes"])
#### Checks for programs
### libtool
if test "x${have_windows}" = "xyes" ; then
lt_cv_deplibs_check_method='pass_all'
fi
LT_INIT([win32-dll])
version_info="lt_cur:lt_rev:lt_age"
AC_SUBST([version_info])
release_info="v_rel"
AC_SUBST([release_info])
### gettext
AM_GNU_GETTEXT_VERSION([0.17])
m4_ifdef([AM_GNU_GETTEXT], [
AM_GNU_GETTEXT([external])
po_makefile_in=po/Makefile.in
have_po="yes"
],
[
have_po="no"
])
AC_SUBST([LTLIBINTL])
if test "x${POSUB}" = "x" ; then
have_po="no"
fi
AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])
### compilers
# rw_PROG_OBJC_WORKS
# Check whether the Objective C compiler works.
AC_DEFUN([rw_PROG_OBJC_WORKS],
[m4_ifdef([AC_PROG_OBJC], [AC_REQUIRE([AC_PROG_OBJC])dnl
AC_CACHE_CHECK([whether the Objective C compiler works],
[rw_cv_prog_objc_works],
[AC_LANG_PUSH([Objective C])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[rw_cv_prog_objc_works=yes],
[rw_cv_prog_objc_works=no])
AC_LANG_POP([Objective C])])], [rw_cv_prog_objc_works=no])
])
m4_ifdef([AC_PROG_OBJC],
[
AC_PROG_OBJC
_AM_DEPENDENCIES(OBJC)
],
[
dnl#AC_CHECK_TOOL([OBJC], [gcc])
dnl#AC_SUBST([OBJC])
dnl#AC_SUBST([OBJCFLAGS])
])
rw_PROG_OBJC_WORKS
2012-09-11 10:11:37 -07:00
AM_PROG_AS
AC_PROG_CXX
AC_LANG(C)
AC_PROG_CC_C99
AM_PROG_CC_C_O
if test "x${ac_cv_prog_cc_c99}" = "xno" ; then
AC_MSG_ERROR([ecore requires a c99-capable compiler])
fi
have_gnu_objc=${ac_cv_objc_compiler_gnu}
#echo $ac_cv_prog_CXX
#if test "x${ac_cv_prog_CXX}" = "x" ; then
# AC_MSG_ERROR([C++ compiler needed. Exiting...])
#fi
AC_SYS_LARGEFILE
# 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...])
fi
# doxygen program for documentation building
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
# lcov
_efl_enable_coverage="no"
if test "x${want_coverage}" = "xyes" ; then
AC_CHECK_PROG([have_lcov], [lcov], [yes], [no])
if test "x${have_lcov}" = "xyes" ; then
EFL_COV_CFLAGS="${EFL_COV_CFLAGS} -fprofile-arcs -ftest-coverage"
EFL_COV_LIBS="${EFL_COV_LIBS} -lgcov"
if test "x${prefer_assert}" = "xno"; then
EFL_COV_CFLAGS="${EFL_COV_CFLAGS} -DNDEBUG"
else
EFL_COV_CFLAGS="${EFL_COV_CFLAGS} -g -O0 -DDEBUG"
fi
_efl_enable_coverage="yes"
else
AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
fi
fi
AM_CONDITIONAL([EFL_ENABLE_COVERAGE], [test "x${_efl_enable_coverage}" = "xyes"])
AC_SUBST([EFL_COV_CFLAGS])
AC_SUBST([EFL_COV_LIBS])
#### Checks for libraries
# check unit testing library
PKG_CHECK_MODULES([CHECK],
[check >= 0.9.5],
[_efl_enable_tests="yes"],
[_efl_enable_tests="no"])
AM_CONDITIONAL([EFL_ENABLE_TESTS], [test "x${_efl_enable_tests}" = "xyes"])
# check for crypto/tls library to use
case "$build_crypto" in
gnutls)
EFL_DEPEND_PKG([crypto], [GNUTLS], [gnutls >= 2.11])
# libgcrypt
AC_PATH_GENERIC([libgcrypt], [], [:],
[AC_MSG_ERROR([libgcrypt required but not found])])
requirements_libs_crypto="${LIBGCRYPT_LIBS} ${requirements_libs_crypto}"
;;
openssl)
EFL_DEPEND_PKG([crypto], [OPENSSL], [openssl])
;;
esac
#### Checks for header files
2012-10-22 23:12:37 -07:00
# Common Checks (keep names sorted for ease of use):
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_CHECK_HEADERS([ \
execinfo.h \
errno.h \
2012-10-22 23:12:37 -07:00
inttypes.h \
libgen.h \
mcheck.h \
netinet/in.h \
siginfo.h \
stdint.h \
strings.h \
sys/epoll.h \
sys/inotify.h \
sys/signalfd.h \
2012-10-22 23:12:37 -07:00
sys/types.h \
sys/param.h \
sys/mman.h \
2012-10-22 23:12:37 -07:00
unistd.h \
])
have_inotify="${ac_cv_header_sys_inotify_h}"
AM_CONDITIONAL([HAVE_INOTIFY], [test "x${have_inotify}" = "xyes"])
have_notify_win32="${have_win32}"
AC_DEFINE_IF([HAVE_NOTIFY_WIN32],
[test "x${have_notify_win32}" = "xyes"], [1],
[File monitoring with Windows notification])
AM_CONDITIONAL([HAVE_NOTIFY_WIN32], [test "x${have_notify_win32}" = "xyes"])
2012-09-17 09:35:38 -07:00
EFL_CHECK_PATH_MAX
#### Checks for types
2012-10-22 23:12:37 -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_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
2012-10-22 23:12:37 -07:00
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>
]])
#### Checks for structures
#### Checks for compiler characteristics
2012-09-17 09:35:38 -07:00
AC_C_BIGENDIAN
AC_C_INLINE
EFL_CHECK_COMPILER_FLAGS([EFL], [-Wall -Wextra -Wpointer-arith])
case "${build_profile}" in
dev)
EFL_CHECK_COMPILER_FLAGS([EFL], [-Wshadow])
;;
debug)
;;
release)
;;
esac
EFL_ATTRIBUTE_VECTOR
EFL_ATTRIBUTE_ALWAYS_INLINE
EFL_LIBS=
AC_SUBST([EFL_LIBS])
## CPU architecture specific assembly
build_cpu_mmx="no"
build_cpu_sse3="no"
build_cpu_altivec="no"
build_cpu_neon="no"
SSE3_CFLAGS=""
ALTIVEC_CFLAGS=""
case $host_cpu in
i*86|x86_64|amd64)
AC_DEFINE([BUILD_MMX], [1], [Build MMX Code])
build_cpu_mmx="yes"
AC_CHECK_HEADER([immintrin.h],
[
AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
build_cpu_sse3="yes"
],
[build_cpu_sse3="no"])
AC_MSG_CHECKING([whether to build SSE3 code])
AC_MSG_RESULT([${build_cpu_sse3}])
if test "x$build_cpu_sse3" = "xyes" ; then
SSE3_CFLAGS="-msse3"
fi
;;
*power* | *ppc*)
build_cpu_altivec="yes"
AC_CHECK_HEADER([altivec.h],
[
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
AC_DEFINE([HAVE_ALTIVEC_H], [1], [Have altivec.h header file])
build_cpu_altivec="yes"
],
[
save_CFLAGS=$CFLAGS
save_CPPFLAGS=$CPPFLAGS
CFLAGS=$CFLAGS" -maltivec"
CPPFLAGS=$CPPFLAGS" -maltivec"
unset ac_cv_header_altivec_h
AC_CHECK_HEADER([altivec.h],
[
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
AC_DEFINE([HAVE_ALTIVEC_H], [1], [Have altivec.h header file])
build_cpu_altivec="yes"
],
[build_cpu_altivec="no"]
)
CFLAGS=$save_CFLAGS
CPPFLAGS=$save_CPPFLAGS
]
)
if test "x${build_cpu_altivec}" = "xyes"; then
AC_MSG_CHECKING([whether to use altivec compiler flag])
if test "x$GCC" = "xyes"; then
if echo "int main(){return 0;}" | ${CPP} -faltivec - > /dev/null 2>&1; then
altivec_cflags="-faltivec"
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
elif echo "int main(){return 0;}" | ${CPP} -maltivec - > /dev/null 2>&1; then
altivec_cflags="-maltivec"
AC_DEFINE([BUILD_ALTIVEC], [1], [Build Altivec Code])
fi
fi
AC_MSG_RESULT([${altivec_cflags}])
CFLAGS="$CFLAGS ${altivec_cflags}"
ALTIVEC_CFLAGS="-maltivec"
fi
;;
arm*)
build_cpu_neon="yes"
AC_MSG_CHECKING([whether to use NEON instructions])
AC_TRY_COMPILE([#include <arm_neon.h>],
[asm volatile ("vqadd.u8 d0, d1, d0\n")],
[
AC_MSG_RESULT([yes])
AC_DEFINE([BUILD_NEON], [1], [Build NEON Code])
build_cpu_neon="yes"
],
[
AC_MSG_RESULT([no])
build_cpu_neon="no"
])
;;
esac
AC_SUBST([ALTIVEC_CFLAGS])
AC_SUBST([SSE3_CFLAGS])
#### Checks for linker characteristics
#### Checks for library functions
AC_CHECK_FUNCS([\
backtrace \
backtrace_symbols \
execvp \
dirfd \
fpathconf \
fstatat \
malloc_usable_size \
mkdirat \
mtrace \
openat \
strlcpy \
])
2012-10-22 23:12:37 -07:00
AC_FUNC_ALLOCA
EFL_CHECK_FUNCS([EFL], [fnmatch gettimeofday])
have_atfile_source="${ac_cv_func_fstatat}"
AC_DEFINE_IF([HAVE_ATFILE_SOURCE],
[test "x${have_atfile_source}" = "xyes"],
[1], [Use fstatat and other -at file functions])
2012-10-22 23:12:37 -07:00
###################### EFL ######################
#### Evil
if test "x${have_windows}" = "xyes" ; then
AC_MSG_NOTICE([Evil checks])
### Default values
### Additional options to configure
EFL_SELECT_WINDOWS_VERSION
### Checks for programs
### Checks for libraries
# TODO: are these needed here? parts of this are replicated for EVERY LIB :-(
EVIL_LIBS=""
EVIL_DLFCN_LIBS=""
case "$host_os" in
mingw32ce*)
EVIL_LIBS="-lws2"
EVIL_DLFCN_LIBS="-ltoolhelp"
;;
*)
EVIL_LIBS="-lole32 -lws2_32 -lsecur32 -luuid"
EVIL_DLFCN_LIBS="-lpsapi"
;;
esac
requirements_libs_evil="${EVIL_LIBS}"
AC_SUBST([EVIL_LIBS])
AC_SUBST([EVIL_DLFCN_LIBS])
AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
EVIL_CPPFLAGS="-DEFL_EVIL_BUILD"
EVIL_DLFCN_CPPFLAGS="-DEFL_EVIL_DLFCN_BUILD -DPSAPI_VERSION=1"
EVIL_CFLAGS="-Wall -Wextra -Wshadow -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wpointer-arith"
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])
AC_SUBST([EVIL_DLFCN_CPPFLAGS])
AC_SUBST([EVIL_CFLAGS])
AC_SUBST([EVIL_CXXFLAGS])
### Checks for linker characteristics
### Checks for library functions
platform_pc_evil="evil >= ${PACKAGE_VERSION}"
platform_pc="${platform_pc} ${platform_pc_evil}"
if test "x${have_wince}" = "xyes"; then
platform_libs_evil="-lws2"
else
platform_libs_evil="-lws2_32"
fi
platform_libs="${platform_libs} ${platform_libs_evil}"
fi
#### End of Evil
#### Escape
if test "x${have_ps3}" = "xyes" ; then
AC_MSG_NOTICE([Escape checks])
### Additional options to configure
### Default values
### Checks for programs
### Checks for libraries
ESCAPE_LIBS="-llv2"
requirements_libs_escape="${ESCAPE_LIBS}"
AC_SUBST([ESCAPE_LIBS])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
### Checks for linker characteristics
### Checks for library functions
platform_pc_escape="escape >= ${PACKAGE_VERSION}"
platform_pc="${platform_pc} ${platform_pc_escape}"
fi
#### End of Escape
#### Eina
AC_MSG_NOTICE([Eina checks])
### Default values
have_magic_debug="yes"
have_safety_checks="yes"
want_log="yes"
case "${build_profile}" in
dev)
with_max_log_level=""
have_stringshare_usage="no"
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="no"
want_debug_threads="no"
;;
debug)
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"
want_debug_threads="yes"
;;
release)
with_max_log_level="3"
have_stringshare_usage="no"
want_valgrind="no"
want_debug_malloc="no"
want_debug_threads="no"
;;
esac
EINA_CONFIG([MAGIC_DEBUG], [test "x${have_magic_debug}" = "xyes"])
EINA_CONFIG([SAFETY_CHECKS], [test "x${have_safety_checks}" = "xyes"])
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
AC_DEFINE_IF([EINA_STRINGSHARE_USAGE],
[test "x${have_stringshare_usage}" = "xyes"],
[1], [Report Eina stringshare usage pattern])
### Additional options to configure
### Checks for programs
### Checks for libraries
## Compatibility layers
requirements_pc_eina="${requirements_pc_eina} ${platform_pc}"
## Options
# Valgrind
EFL_OPTIONAL_DEPEND_PKG([eina], [${want_valgrind}],
[VALGRIND], [valgrind >= 2.4.0])
if test "x${have_valgrind}" = "xno"; then
AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
fi
AC_DEFINE_IF([EINA_DEBUG_MALLOC],
[test "x${ac_cv_func_malloc_usable_size}" = "xyes" && test "x${want_debug_malloc}" = "xyes"],
[1], [Turn on debugging overhead in mempool])
if ! test "x${requirements_pc_deps_eina}" = "x" ; then
PKG_CHECK_MODULES([EINA], [${requirements_pc_deps_eina}])
fi
## Examples
# TODO: add once ecore-evas is merged:
#PKG_CHECK_MODULES([ECORE_EVAS],
# [ecore-evas ecore evas],
# [build_tiler_example="yes"],
# [build_tiler_example="no"])
AM_CONDITIONAL([BUILD_TILER_EXAMPLE], [test "x${build_tiler_example}" = "xyes"])
## 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
### Checks for header files
# 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}"
EINA_CONFIG([HAVE_INTTYPES_H], [test "x${ac_cv_header_inttypes_h}" = "xyes"])
EINA_CONFIG([HAVE_STDINT_H], [test "x${ac_cv_header_stdint_h}" = "xyes"])
### Checks for types
2012-10-22 23:30:48 -07:00
EINA_CONFIG([HAVE_DIRENT_H], [test "x${have_dirent}" = "xyes"])
AC_DEFINE_IF([HAVE_DIRENT_H], [test "x${have_dirent}" = "xyes"],
[1], [Define to 1 if you have a valid <dirent.h> header file.])
### Checks for structures
### Checks for compiler characteristics
m4_ifdef([v_ver],
[
EFL_CHECK_COMPILER_FLAGS([EINA], [-Wall -Wextra])
])
EFL_CHECK_COMPILER_FLAGS([EINA], [-Wshadow -Wpointer-arith])
### Checks for linker characteristics
EFL_CHECK_LINKER_FLAGS([EINA], [-fno-strict-aliasing])
### Checks for library functions
EFL_CHECK_FUNCS([EINA], [dlopen dladdr 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}])
EINA_CONFIG([ENABLE_LOG], [test "x${enable_log}" = "xyes"])
EFL_CHECK_THREADS
EINA_CONFIG([HAVE_PTHREAD_BARRIER], [test "x${efl_have_pthread_barrier}" = "xyes"])
EINA_CONFIG([HAVE_PTHREAD_AFFINITY], [test "x${efl_have_setaffinity}" = "xyes"])
EINA_CONFIG([HAVE_DEBUG_THREADS], [test "$want_debug_threads" = "yes"])
### Modules
EINA_CHECK_MODULE([chained-pool], [static], [chained pool])
EINA_CHECK_MODULE([pass-through], [static], [pass through])
EINA_CHECK_MODULE([one-big], [static], [one big])
#### End of Eina
#### Eet
2012-09-17 09:35:38 -07:00
AC_MSG_NOTICE([Eet checks])
### Default values
2012-09-17 09:35:38 -07:00
### Additional options to configure
2012-09-17 09:35:38 -07:00
### Checks for programs
2012-09-17 09:35:38 -07:00
### Checks for libraries
2012-09-17 09:35:38 -07:00
## Compatibility layers
requirements_pc_eet="${requirements_pc_eet} ${platform_pc_evil}"
2012-09-17 09:35:38 -07:00
## Secure layer
requirements_pc_eet="${requirements_pc_crypto} ${requirements_pc_eet}"
requirements_pc_deps_eet="${requirements_pc_deps_crypto} ${requirements_pc_deps_eet}"
requirements_libs_eet="${requirements_libs_crypto} ${requirements_libs_eet}"
2012-09-17 09:35:38 -07:00
# Cryptography support
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
EFL_CHECK_LIBS([EET], [libjpeg zlib])
# TODO: better way to force those instead of is secondary check
if test "x${efl_lib_zlib}" != "xyes" || test "x${efl_lib_libjpeg}" != "xyes" ; then
AC_MSG_ERROR([Required EET libraries were not found.])
fi
2012-09-17 09:35:38 -07:00
# Eina library
requirements_pc_eet="eina >= ${PACKAGE_VERSION} ${requirements_pc_eet}"
PKG_CHECK_MODULES([EET], [${requirements_pc_deps_eet}])
# Windows
requirements_libs_eet="${requirements_libs_eet} ${platform_libs}"
2012-09-17 09:35:38 -07:00
EET_LIBS="${EET_LIBS} ${requirements_libs_eet}"
2012-09-17 09:35:38 -07:00
### Checks for header files
2012-09-17 09:35:38 -07:00
### Checks for types
2012-09-17 09:35:38 -07:00
### Checks for structures
2012-09-17 09:35:38 -07:00
### Checks for compiler characteristics
2012-09-17 09:35:38 -07:00
### Checks for linker characteristics
2012-09-17 09:35:38 -07:00
case "${host_os}" in
openbsd*)
;;
*)
EFL_CHECK_LINKER_FLAGS([EET], [-Wl,--as-needed])
;;
esac
### Checks for library functions
### Check availability
#### End of Eet
#### Eo
AC_MSG_NOTICE([Eo checks])
### Default values
### Additional options to configure
### Checks for programs
### Checks for libraries
# Eina library
requirements_pc_eo="eina >= ${PACKAGE_VERSION}"
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])
# Example (evas one)
# TODO: add once elementary is merged
#PKG_CHECK_MODULES([ELM], [elementary >= 1.7.0], [have_elm="yes"], [have_elm="no"])
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
### Checks for linker characteristics
### Checks for library functions
### Check availability
#### End of Eo