2010-05-28 20:05:04 -07:00
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2010-08-15 22:40:50 -07:00
m4_define([v_maj], [1])
m4_define([v_min], [0])
2011-01-28 19:34:44 -08:00
m4_define([v_mic], [999])
2010-06-18 07:45:42 -07:00
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
2010-06-03 18:04:24 -07:00
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']))])
2010-05-28 20:05:04 -07:00
##-- When released, remove the dnl on the below line
2011-01-28 19:34:44 -08:00
dnl m4_undefine([v_rev])
2010-05-28 20:05:04 -07:00
##-- When doing snapshots - change soname. remove dnl on below line
2010-08-15 22:40:50 -07:00
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
2010-05-28 20:05:04 -07:00
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2010-08-15 22:40:50 -07:00
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
2010-05-28 20:05:04 -07:00
m4_define([lt_rev], m4_eval(v_maj + v_min))
m4_define([lt_cur], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2010-11-22 23:38:46 -08:00
2011-01-28 19:05:22 -08:00
AC_INIT([eina], [v_ver], [enlightenment-devel@lists.sourceforge.net])
2010-02-07 23:07:20 -08:00
AC_PREREQ([2.59])
2009-02-01 12:21:56 -08:00
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
2011-01-06 10:19:42 -08:00
AC_CONFIG_HEADERS([config.h])
2011-01-06 10:13:54 -08:00
AH_TOP([
#ifndef EFL_CONFIG_H__
#define EFL_CONFIG_H__
])
AH_BOTTOM([
#endif /* EFL_CONFIG_H__ */
])
2008-07-30 05:46:55 -07:00
2009-10-06 09:54:08 -07:00
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
2008-07-30 05:46:55 -07:00
2011-01-06 10:19:42 -08:00
AC_GNU_SOURCE
2008-07-30 05:46:55 -07:00
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL
2010-05-28 20:05:04 -07:00
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
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])
version_info="lt_rev:lt_cur:lt_age"
release_info="v_rel"
2008-07-30 05:46:55 -07:00
AC_SUBST(version_info)
2010-05-28 20:05:04 -07:00
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)
2008-07-30 05:46:55 -07:00
2011-01-06 10:13:54 -08:00
2008-08-18 01:18:16 -07:00
### Needed information
2011-01-06 10:13:54 -08:00
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
2009-09-25 08:39:53 -07:00
requirement_eina=""
2009-05-13 11:42:40 -07:00
case "$host_os" in
2010-04-03 14:23:28 -07:00
mingw32ce*)
2009-05-13 11:42:40 -07:00
MODULE_ARCH="$host_os-$host_cpu"
;;
*)
2010-08-15 23:46:03 -07:00
MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
2009-05-13 11:42:40 -07:00
;;
esac
2008-08-18 01:18:16 -07:00
AC_SUBST(MODULE_ARCH)
AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
2010-06-05 23:26:12 -07:00
case "$host_os" in
mingw*)
MODULE_EXT=".dll"
;;
*)
MODULE_EXT=".so"
;;
esac
AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "${MODULE_EXT}", [Suffix for shared objects])
2010-01-16 08:46:39 -08:00
2008-10-03 08:28:13 -07:00
EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
2010-08-08 12:20:07 -07:00
EFL_CHECK_THREADS(
2010-07-13 06:51:00 -07:00
[
if test "x${_efl_have_posix_threads}" = "xyes" ; then
have_threads="POSIX"
else
if test "x${_efl_have_win32_threads}" = "xyes" ; then
have_threads="Win32"
else
have_threads="no"
fi
fi
],
2010-08-08 12:20:07 -07:00
[have_threads="no"])
EFL_CHECK_SPINLOCK([have_posix_threads_spinlock="yes"], [have_posix_threads_spinlock="no"])
2008-08-28 00:46:42 -07:00
2008-07-30 06:58:26 -07:00
### Additional options to configure
2008-09-26 04:41:55 -07:00
# Magic debug
AC_ARG_ENABLE([magic-debug],
2009-06-19 23:42:32 -07:00
[AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
2008-09-26 04:41:55 -07:00
[
if test "x${enableval}" = "xyes" ; then
2009-06-08 01:27:33 -07:00
have_magic_debug="yes"
2008-09-26 04:41:55 -07:00
else
2009-06-08 01:27:33 -07:00
have_magic_debug="no"
2008-09-26 04:41:55 -07:00
fi
],
2009-06-08 01:27:33 -07:00
[have_magic_debug="yes"])
2008-09-26 04:41:55 -07:00
AC_MSG_CHECKING([whether magic debug is enable])
2009-06-08 01:27:33 -07:00
AC_MSG_RESULT([${have_magic_debug}])
2008-09-26 04:41:55 -07:00
2009-06-08 01:27:33 -07:00
if test "x${have_magic_debug}" = "xyes" ; then
EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
2008-09-26 04:41:55 -07:00
fi
2009-06-08 01:27:33 -07:00
AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
2008-09-26 04:41:55 -07:00
Make valgrind know about eina mempools.
Because mempools generally allocate a big memory area and distribute chunks of
that area to the users, valgrind can not know about logical invalid access. By
using some valgrind macros we can tell valgrind about mempools and which area
can be accessed or not.
To start with I have just done valgrind integration on chained mempool but soon
it will be done for one_big too.
The code below is an example on which valgrind wouldn't complain without this
patch:
@code
#include <Eina.h>
int
main(int argc, char *argv[])
{
int i, *pool[4];
Eina_Mempool *mp;
eina_init();
mp = eina_mempool_add("chained_mempool", "test", NULL, sizeof(int), 4);
for (i = 0; i < 4; i++) {
pool[i] = eina_mempool_malloc(mp, sizeof(int));
*pool[i] = i;
}
printf("Valid mp pointer: pool[0] = %d\n", *pool[0]);
eina_mempool_free(mp, pool[0]);
printf("Freed mp pointer: pool[0] = %d\n", *pool[0]);
for (i = 1; i < 4; i++)
eina_mempool_free(mp, pool[i]);
eina_mempool_del(mp);
eina_shutdown();
return 0;
}
@endcode
SVN revision: 53405
2010-10-14 08:18:15 -07:00
# Valgrind
2010-10-23 14:03:11 -07:00
want_valgrind="auto"
have_valgrind="no"
Make valgrind know about eina mempools.
Because mempools generally allocate a big memory area and distribute chunks of
that area to the users, valgrind can not know about logical invalid access. By
using some valgrind macros we can tell valgrind about mempools and which area
can be accessed or not.
To start with I have just done valgrind integration on chained mempool but soon
it will be done for one_big too.
The code below is an example on which valgrind wouldn't complain without this
patch:
@code
#include <Eina.h>
int
main(int argc, char *argv[])
{
int i, *pool[4];
Eina_Mempool *mp;
eina_init();
mp = eina_mempool_add("chained_mempool", "test", NULL, sizeof(int), 4);
for (i = 0; i < 4; i++) {
pool[i] = eina_mempool_malloc(mp, sizeof(int));
*pool[i] = i;
}
printf("Valid mp pointer: pool[0] = %d\n", *pool[0]);
eina_mempool_free(mp, pool[0]);
printf("Freed mp pointer: pool[0] = %d\n", *pool[0]);
for (i = 1; i < 4; i++)
eina_mempool_free(mp, pool[i]);
eina_mempool_del(mp);
eina_shutdown();
return 0;
}
@endcode
SVN revision: 53405
2010-10-14 08:18:15 -07:00
AC_MSG_CHECKING(whether to enable build with valgrind)
AC_ARG_ENABLE(valgrind,
2010-10-23 14:03:11 -07:00
AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks.]),
Make valgrind know about eina mempools.
Because mempools generally allocate a big memory area and distribute chunks of
that area to the users, valgrind can not know about logical invalid access. By
using some valgrind macros we can tell valgrind about mempools and which area
can be accessed or not.
To start with I have just done valgrind integration on chained mempool but soon
it will be done for one_big too.
The code below is an example on which valgrind wouldn't complain without this
patch:
@code
#include <Eina.h>
int
main(int argc, char *argv[])
{
int i, *pool[4];
Eina_Mempool *mp;
eina_init();
mp = eina_mempool_add("chained_mempool", "test", NULL, sizeof(int), 4);
for (i = 0; i < 4; i++) {
pool[i] = eina_mempool_malloc(mp, sizeof(int));
*pool[i] = i;
}
printf("Valid mp pointer: pool[0] = %d\n", *pool[0]);
eina_mempool_free(mp, pool[0]);
printf("Freed mp pointer: pool[0] = %d\n", *pool[0]);
for (i = 1; i < 4; i++)
eina_mempool_free(mp, pool[i]);
eina_mempool_del(mp);
eina_shutdown();
return 0;
}
@endcode
SVN revision: 53405
2010-10-14 08:18:15 -07:00
[want_valgrind=$enableval]
)
AC_MSG_RESULT($want_valgrind)
2010-10-23 14:03:11 -07:00
if test "x${want_valgrind}" = "xyes" -o "x${want_valgrind}" = "xauto"; then
Make valgrind know about eina mempools.
Because mempools generally allocate a big memory area and distribute chunks of
that area to the users, valgrind can not know about logical invalid access. By
using some valgrind macros we can tell valgrind about mempools and which area
can be accessed or not.
To start with I have just done valgrind integration on chained mempool but soon
it will be done for one_big too.
The code below is an example on which valgrind wouldn't complain without this
patch:
@code
#include <Eina.h>
int
main(int argc, char *argv[])
{
int i, *pool[4];
Eina_Mempool *mp;
eina_init();
mp = eina_mempool_add("chained_mempool", "test", NULL, sizeof(int), 4);
for (i = 0; i < 4; i++) {
pool[i] = eina_mempool_malloc(mp, sizeof(int));
*pool[i] = i;
}
printf("Valid mp pointer: pool[0] = %d\n", *pool[0]);
eina_mempool_free(mp, pool[0]);
printf("Freed mp pointer: pool[0] = %d\n", *pool[0]);
for (i = 1; i < 4; i++)
eina_mempool_free(mp, pool[i]);
eina_mempool_del(mp);
eina_shutdown();
return 0;
}
@endcode
SVN revision: 53405
2010-10-14 08:18:15 -07:00
PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
[
requirement_eina="valgrind ${requirement_eina}"
2010-10-23 14:03:11 -07:00
have_valgrind="yes"
Make valgrind know about eina mempools.
Because mempools generally allocate a big memory area and distribute chunks of
that area to the users, valgrind can not know about logical invalid access. By
using some valgrind macros we can tell valgrind about mempools and which area
can be accessed or not.
To start with I have just done valgrind integration on chained mempool but soon
it will be done for one_big too.
The code below is an example on which valgrind wouldn't complain without this
patch:
@code
#include <Eina.h>
int
main(int argc, char *argv[])
{
int i, *pool[4];
Eina_Mempool *mp;
eina_init();
mp = eina_mempool_add("chained_mempool", "test", NULL, sizeof(int), 4);
for (i = 0; i < 4; i++) {
pool[i] = eina_mempool_malloc(mp, sizeof(int));
*pool[i] = i;
}
printf("Valid mp pointer: pool[0] = %d\n", *pool[0]);
eina_mempool_free(mp, pool[0]);
printf("Freed mp pointer: pool[0] = %d\n", *pool[0]);
for (i = 1; i < 4; i++)
eina_mempool_free(mp, pool[i]);
eina_mempool_del(mp);
eina_shutdown();
return 0;
}
@endcode
SVN revision: 53405
2010-10-14 08:18:15 -07:00
],
[
AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
if test "x$want_valgrind" = "xyes"; then
AC_MSG_ERROR([Valgrind >= 2.4.0 is required)])
fi
]
)
else
AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
fi
2008-12-26 10:31:14 -08:00
# Safety checks (avoid crashes on wrong api usage)
AC_ARG_ENABLE(safety-checks,
2009-06-19 23:42:32 -07:00
[AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
2009-06-08 01:27:33 -07:00
[
if test "x${enableval}" = "xyes" ; then
have_safety_checks="yes"
else
have_safety_checks="no"
fi
],
[have_safety_checks="yes"])
AC_MSG_CHECKING(whether to do safety checking on api parameters)
AC_MSG_RESULT($have_safety_checks)
2008-12-26 10:31:14 -08:00
2009-06-08 01:27:33 -07:00
AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
if test "x$have_safety_checks" = "xyes"; then
2008-12-26 11:14:57 -08:00
AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
2009-06-08 01:27:33 -07:00
EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
2008-12-26 10:31:14 -08:00
fi
2009-06-08 01:27:33 -07:00
AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
2008-12-26 10:31:14 -08:00
2009-09-04 14:28:50 -07:00
with_max_log_level="<unset>"
AC_ARG_WITH(internal-maximum-log-level,
[AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
[limit eina internal log level to the given number, any call to EINA_LOG() with values greater than this will be compiled out, ignoring runtime settings, but saving function calls.])],
[
if test "x${withval}" != "xno"; then
if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
with_max_log_level="${withval}"
else
AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
fi
fi
], [:])
2009-09-06 22:54:42 -07:00
AC_ARG_ENABLE([amalgamation],
2009-11-03 08:52:45 -08:00
[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
2009-09-08 17:38:26 -07:00
do_amalgamation="yes"
2009-11-03 08:52:45 -08:00
else
do_amalgamation="no"
2009-09-06 22:54:42 -07:00
fi
],
2009-11-03 08:52:45 -08:00
[do_amalgamation="no"]
2009-09-06 22:54:42 -07:00
)
AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
2009-09-04 14:28:50 -07:00
2008-10-06 07:47:09 -07:00
# Choose best memory pool
AC_ARG_ENABLE([default-mempool],
2009-06-19 23:42:32 -07:00
[AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
2008-10-06 07:47:09 -07:00
[
if test "x${enableval}" = "xyes"; then
2009-06-08 01:27:33 -07:00
have_default_mempool="yes"
2008-10-06 07:47:09 -07:00
else
2009-06-08 01:27:33 -07:00
have_default_mempool="no"
2008-10-06 07:47:09 -07:00
fi
],
2009-06-08 01:27:33 -07:00
[have_default_mempool="no"]
2008-10-06 07:47:09 -07:00
)
AC_MSG_CHECKING([whether to use default mempool allocator])
2009-06-08 01:27:33 -07:00
AC_MSG_RESULT([${have_default_mempool}])
2008-10-06 07:47:09 -07:00
2009-06-08 01:27:33 -07:00
if test "x${have_default_mempool}" = "xyes" ; then
EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
2008-10-06 07:47:09 -07:00
fi
2009-06-08 01:27:33 -07:00
AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
2008-10-06 07:47:09 -07:00
2008-10-14 08:32:57 -07:00
# Report stringshare usage
AC_ARG_ENABLE([stringshare-usage],
2009-06-19 23:42:32 -07:00
[AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
2008-10-14 08:32:57 -07:00
[
if test "x${enableval}" = "xyes"; then
2009-06-08 01:27:33 -07:00
have_stringshare_usage="yes"
2008-10-14 08:32:57 -07:00
else
2009-06-08 01:27:33 -07:00
have_stringshare_usage="no"
2008-10-14 08:32:57 -07:00
fi
],
2009-06-08 01:27:33 -07:00
[have_stringshare_usage="no"]
2008-10-14 08:32:57 -07:00
)
AC_MSG_CHECKING([whether to report stringshare usage])
2009-06-08 01:27:33 -07:00
AC_MSG_RESULT([${have_stringshare_usage}])
2008-10-14 08:32:57 -07:00
2009-06-08 01:27:33 -07:00
if test "x${have_stringshare_usage}" = "xyes"; then
2008-10-14 08:32:57 -07:00
AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
fi
2009-06-26 00:52:56 -07:00
# Check if we want to benchmark on real data
enable_benchmark_e17="no"
AC_ARG_ENABLE([e17],
[AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_benchmark_e17="yes"
else
enable_benchmark_e17="no"
fi
],
[enable_benchmark_e17="no"])
AC_MSG_CHECKING([whether e17 real data benchmark are built])
AC_MSG_RESULT([${enable_benchmark_e17}])
AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
2008-09-29 07:35:28 -07:00
2008-10-31 09:59:45 -07:00
### Checks for programs
AC_PROG_CC
2009-06-08 01:27:33 -07:00
# pkg-config
PKG_PROG_PKG_CONFIG
2009-09-25 08:39:53 -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)
2008-10-31 09:59:45 -07:00
# doxygen program for documentation building
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
2008-07-30 06:58:26 -07:00
### Checks for libraries
2008-08-31 07:05:17 -07:00
# Evil library for compilation on Windows CE
2009-09-25 08:39:53 -07:00
EFL_EINA_BUILD=""
2008-08-31 07:05:17 -07:00
case "$host_os" in
2010-04-03 14:23:28 -07:00
mingw*)
2009-09-25 08:39:53 -07:00
PKG_CHECK_MODULES([EVIL], [evil])
AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
requirement_eina="evil"
EFL_EINA_BUILD="-DEFL_EINA_BUILD"
2008-08-31 07:05:17 -07:00
;;
esac
2009-09-25 08:39:53 -07:00
AC_SUBST(EFL_EINA_BUILD)
2008-08-31 07:05:17 -07:00
2008-07-31 10:00:56 -07:00
# Check ememoa memory pool library
2008-08-01 06:03:01 -07:00
2009-06-19 23:42:32 -07:00
AC_ARG_ENABLE([ememoa],
[AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_ememoa="yes"
else
enable_ememoa="no"
fi
],
[enable_ememoa="yes"]
)
AC_MSG_CHECKING([whether to use ememoa for memory pool])
AC_MSG_RESULT([$enable_ememoa])
2008-08-27 06:34:04 -07:00
if test "x${enable_ememoa}" = "xyes" ; then
PKG_CHECK_MODULES([EMEMOA],
2008-07-31 10:00:56 -07:00
[ememoa >= 0.0.26 ],
[enable_ememoa="yes"],
[enable_ememoa="no"]
2008-08-27 06:34:04 -07:00
)
fi
2008-08-01 06:03:01 -07:00
2010-07-13 12:17:35 -07:00
2008-07-30 06:58:26 -07:00
### Checks for header files
2008-07-30 05:46:55 -07:00
AC_HEADER_ASSERT
AC_HEADER_DIRENT
AC_HEADER_TIME
2011-02-17 00:34:42 -08:00
AC_CHECK_HEADERS([unistd.h libgen.h])
2010-12-03 15:04:26 -08:00
EFL_CHECK_PATH_MAX
2010-07-13 12:17:35 -07:00
2008-07-30 06:58:26 -07:00
### Checks for types
2010-07-27 01:22:20 -07:00
AC_CHECK_HEADER([inttypes.h],
2011-02-17 00:34:42 -08:00
[
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.])
])
2010-07-27 01:22:20 -07:00
AC_SUBST(EINA_CONFIGURE_HAVE_INTTYPES_H)
2008-07-30 06:58:26 -07:00
2010-07-27 01:22:20 -07:00
AC_CHECK_HEADER([stdint.h],
2011-02-17 00:34:42 -08:00
[
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.])
])
2010-07-27 01:22:20 -07:00
AC_SUBST(EINA_CONFIGURE_HAVE_STDINT_H)
AC_CHECK_SIZEOF(wchar_t)
EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
AC_SUBST(EINA_SIZEOF_WCHAR_T)
2008-07-30 06:58:26 -07:00
### Checks for structures
### Checks for compiler characteristics
2008-07-30 05:46:55 -07:00
AC_C_CONST
AC_C_BIGENDIAN
2008-10-03 08:28:13 -07:00
AC_C_INLINE
2008-08-01 06:03:01 -07:00
AC_C___ATTRIBUTE__
2008-10-03 08:28:13 -07:00
AC_PROG_CC_STDC
2008-07-30 05:46:55 -07:00
2010-11-06 14:00:58 -07:00
have_win32="no"
2009-06-25 12:55:06 -07:00
EINA_CPPFLAGS=""
2010-04-03 14:23:28 -07:00
EINA_CFLAGS=""
2009-06-25 12:55:06 -07:00
case "$host_os" in
2010-04-03 14:23:28 -07:00
mingw32ce*)
2009-06-26 00:52:56 -07:00
EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
2010-04-03 14:23:28 -07:00
EINA_CFLAGS="${EVIL_CFLAGS}"
2010-11-06 14:00:58 -07:00
have_win32="yes"
2009-06-25 12:55:06 -07:00
;;
mingw*)
2010-04-03 14:23:28 -07:00
EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501"
2009-09-04 09:55:51 -07:00
EINA_CFLAGS="${EVIL_CFLAGS}"
2010-11-06 14:00:58 -07:00
have_win32="yes"
2010-04-03 14:23:28 -07:00
;;
2008-08-31 07:05:17 -07:00
esac
2010-11-06 14:00:58 -07:00
AM_CONDITIONAL([EINA_HAVE_WIN32], [test "x$have_win32" = "xyes"])
2008-08-31 07:05:17 -07:00
2010-06-05 23:26:12 -07:00
m4_ifdef([v_mic],
[
EFL_COMPILER_FLAG([-Wall])
EFL_COMPILER_FLAG([-W])
])
2008-07-30 05:46:55 -07:00
2010-01-24 03:13:23 -08:00
EFL_COMPILER_FLAG([-Wshadow])
2009-03-13 03:24:45 -07:00
2009-06-25 12:55:06 -07:00
AC_SUBST(EINA_CPPFLAGS)
2008-09-28 05:43:21 -07:00
AC_SUBST(EINA_CFLAGS)
2008-07-30 06:58:26 -07:00
### Checks for linker characteristics
2009-09-04 09:55:51 -07:00
EINA_LIBS=
2008-07-30 05:46:55 -07:00
lt_enable_auto_import=""
2008-08-31 07:05:17 -07:00
case "${host_os}" in
2010-04-03 14:23:28 -07:00
mingw*)
2009-09-04 09:55:51 -07:00
EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
2008-07-30 05:46:55 -07:00
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
2009-06-12 10:48:10 -07:00
dragonfly*|openbsd*)
2009-09-04 09:55:51 -07:00
EINA_LIBS="-lm"
2009-03-22 06:40:28 -07:00
;;
2009-06-12 10:48:10 -07:00
freebsd*|netbsd*)
2009-09-04 09:55:51 -07:00
EINA_LIBS="-lrt -lm"
2008-10-25 11:17:22 -07:00
;;
2009-06-12 10:48:10 -07:00
darwin*)
2009-09-04 09:55:51 -07:00
EINA_LIBS="-lm"
2008-12-31 03:51:37 -08:00
;;
2009-06-12 10:48:10 -07:00
cygwin*)
2009-09-04 09:55:51 -07:00
EINA_LIBS="-ldl -lm"
2009-03-13 03:53:07 -07:00
;;
2008-08-31 07:05:17 -07:00
*)
2009-09-04 09:55:51 -07:00
EINA_LIBS="-ldl -lrt -lm"
2008-08-31 07:05:17 -07:00
;;
2008-07-30 05:46:55 -07:00
esac
2008-08-31 07:05:17 -07:00
AC_SUBST(EINA_LIBS)
2008-07-30 05:46:55 -07:00
AC_SUBST(lt_enable_auto_import)
2010-02-13 04:32:22 -08:00
EFL_LINKER_FLAG([-fno-strict-aliasing])
2008-07-30 05:46:55 -07:00
2008-07-30 06:58:26 -07:00
### Checks for library functions
2011-01-06 10:13:54 -08:00
AC_ISC_POSIX
2008-08-28 00:46:42 -07:00
AC_FUNC_ALLOCA
2010-01-27 12:47:47 -08:00
AC_CHECK_FUNCS(strlcpy)
2008-07-30 06:58:26 -07:00
2008-11-01 08:39:53 -07:00
#dlopen and dladdr
dlopen_libs=""
case "$host_os" in
2010-04-03 14:23:28 -07:00
mingw*)
2008-11-01 08:39:53 -07:00
# managed by evil
AC_DEFINE(HAVE_DLADDR)
;;
*)
AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
if test "x${res}" = "xyes" ; then
AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
else
AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
if test "x${res}" = "xyes" ; then
AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
dlopen_libs="-ldl"
else
AC_MSG_ERROR([Cannot find dlopen])
fi
fi
;;
esac
AC_SUBST(dlopen_libs)
2010-02-03 12:13:56 -08:00
EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
2009-10-28 06:04:09 -07:00
2010-02-01 20:49:38 -08:00
# iconv library
have_iconv="no"
AC_ARG_WITH([iconv-link],
AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
[
2010-02-08 05:14:30 -08:00
LIBS="$withval $LIBS"
2010-02-01 20:49:38 -08:00
have_iconv="yes"
])
AC_MSG_CHECKING(for explicit iconv link options)
if test "x${iconv_libs}" = "x" ; then
AC_MSG_RESULT([no explicit iconv link option])
else
AC_MSG_RESULT([$iconv_libs])
fi
2010-02-01 22:18:59 -08:00
if test "x${have_iconv}" = "xno" ; then
AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
2010-02-01 20:49:38 -08:00
2010-02-01 22:18:59 -08:00
if test "x${have_iconv}" = "xyes" ; then
2010-02-08 05:14:30 -08:00
AC_MSG_CHECKING([whether iconv() is in libc])
2010-11-22 23:38:46 -08:00
2010-02-08 05:14:30 -08:00
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
2010-02-08 07:25:46 -08:00
#include <stdlib.h>
2010-02-08 05:14:30 -08:00
#include <iconv.h>
]],
[[
iconv_t ic;
size_t count = iconv(ic, NULL, NULL, NULL, NULL);
]])],
[have_iconv="yes"],
[have_iconv="no"])
AC_MSG_RESULT([${have_iconv}])
fi
if test "x${have_iconv}" = "xno" ; then
AC_MSG_CHECKING([whether iconv() is in libiconv.a])
LIBS_save="${LIBS}"
LIBS="-liconv $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
2010-02-08 07:25:46 -08:00
#include <stdlib.h>
2010-02-08 05:14:30 -08:00
#include <iconv.h>
]],
[[
iconv_t ic;
size_t count;
count = iconv(ic, NULL, NULL, NULL, NULL);
]])],
[have_iconv="yes"],
2010-02-08 07:25:46 -08:00
[
have_iconv="no"
LIBS=${LIBS_save}
])
2010-02-08 05:14:30 -08:00
AC_MSG_RESULT([${have_iconv}])
2010-02-01 22:18:59 -08:00
fi
2010-02-01 20:49:38 -08:00
2010-02-08 05:14:30 -08:00
if test "x${have_iconv}" = "xno" ; then
AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])
LIBS_save="${LIBS}"
LIBS="-liconv_plug $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
2010-02-08 07:25:46 -08:00
#include <stdlib.h>
2010-02-08 05:14:30 -08:00
#include <iconv.h>
]],
[[
iconv_t ic;
size_t count = iconv(ic, NULL, NULL, NULL, NULL);
]])],
[have_iconv="yes"],
2010-02-08 07:25:46 -08:00
[
have_iconv="no"
LIBS=${LIBS_save}
])
2010-02-08 05:14:30 -08:00
AC_MSG_RESULT([${have_iconv}])
fi
fi
2010-02-01 20:49:38 -08:00
2010-02-07 12:46:39 -08:00
if test "x${have_iconv}" = "xyes" ; then
AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
fi
2010-11-02 10:47:19 -07:00
#check for dirfd API presence
have_dirfd="no"
AC_CHECK_FUNCS([dirfd], [have_dirfd="yes"], [])
if test "x${dirfd}" = "xyes"; then
AC_DEFINE(HAVE_DIRFD)
fi
AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], [])
2010-11-03 03:19:55 -07:00
AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], [])
2010-02-01 20:49:38 -08:00
2009-06-19 23:42:32 -07:00
### Modules
2010-01-31 06:52:16 -08:00
if test "x${have_default_mempool}" = "xyes" ; then
enable_chained_pool="no"
enable_pass_through="static"
else
enable_chained_pool="static"
enable_pass_through="no"
fi
2010-07-26 08:52:43 -07:00
enable_one_big="static"
2010-01-31 06:52:16 -08:00
EINA_CHECK_MODULE([chained-pool], [${enable_chained_pool}], [chained pool])
EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
EINA_CHECK_MODULE([fixed-bitmap], [no], [fixed bitmap])
EINA_CHECK_MODULE([pass-through], [${enable_pass_through}], [pass through])
EINA_CHECK_MODULE([buddy], [no], [buddy])
2010-07-26 08:52:43 -07:00
EINA_CHECK_MODULE([one-big], [${enable_one_big}], [one big])
2009-06-19 23:42:32 -07:00
### Make the debug preprocessor configurable
2011-01-16 09:55:41 -08:00
### 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"])
EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
if test "x$enable_coverage" = "xyes" ; then
EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
fi
EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
2009-09-25 08:43:41 -07:00
AC_SUBST(requirement_eina)
2008-09-28 05:43:21 -07:00
### Create the .pc.in file according to the major version
2008-10-19 21:30:21 -07:00
#cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
#prefix=@prefix@
#exec_prefix=@exec_prefix@
#libdir=@libdir@
#includedir=@includedir@
#
#Name: Eina
#Description: A Library that implements fast data types and miscellaneous tools
#Requires:
#Version: @VERSION@
#Libs: -L${libdir} -leina
#Libs.private: -ldl
#Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
#EOF
2008-09-28 05:43:21 -07:00
2008-07-30 05:46:55 -07:00
AC_CONFIG_FILES([
Makefile
2010-08-16 01:03:21 -07:00
eina.pc
2008-10-25 11:46:18 -07:00
eina.spec
2008-08-27 06:34:04 -07:00
doc/Makefile
2008-07-30 05:46:55 -07:00
src/Makefile
src/include/Makefile
2008-09-26 04:41:55 -07:00
src/include/eina_config.h
2008-07-30 05:46:55 -07:00
src/lib/Makefile
src/modules/Makefile
2008-07-31 10:00:56 -07:00
src/modules/mp/Makefile
src/modules/mp/chained_pool/Makefile
src/modules/mp/ememoa_fixed/Makefile
2008-08-08 10:17:52 -07:00
src/modules/mp/ememoa_unknown/Makefile
2008-08-08 07:26:59 -07:00
src/modules/mp/pass_through/Makefile
2008-09-26 08:27:46 -07:00
src/modules/mp/fixed_bitmap/Makefile
2010-01-08 04:10:14 -08:00
src/modules/mp/buddy/Makefile
2010-07-26 08:52:43 -07:00
src/modules/mp/one_big/Makefile
2011-01-16 09:55:41 -08:00
src/tests/Makefile
2008-07-30 05:46:55 -07:00
])
AC_OUTPUT
#####################################################################
## Info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo
echo "Configuration Options Summary:"
echo
2009-06-08 01:27:33 -07:00
echo " Magic debug..........: ${have_magic_debug}"
echo " Safety checks........: ${have_safety_checks}"
2009-09-04 14:28:50 -07:00
echo " Maximum log level....: ${with_max_log_level}"
2009-06-08 01:27:33 -07:00
echo " Report string usage..: ${have_stringshare_usage}"
2010-10-23 14:03:11 -07:00
echo " Valgrind support.....: ${have_valgrind}"
2009-06-08 01:27:33 -07:00
echo " Default mempool......: ${have_default_mempool}"
2010-08-08 12:20:07 -07:00
echo " Thread Support.......: ${have_threads}"
2010-07-13 06:51:00 -07:00
if test "${have_threads}" = "POSIX" ; then
2010-08-08 12:20:07 -07:00
echo " spinlock...........: ${have_posix_threads_spinlock}"
2010-10-13 08:35:56 -07:00
echo " debug usage........: ${have_debug_threads}"
2010-07-13 06:51:00 -07:00
fi
2009-09-09 00:42:08 -07:00
echo " Amalgamation.........: ${do_amalgamation}"
2010-02-01 20:49:38 -08:00
echo " Iconv support........: ${have_iconv}"
2010-11-02 10:47:19 -07:00
echo " File dirfd...........: ${have_dirfd}"
2009-06-08 01:27:33 -07:00
echo
2008-08-27 06:34:04 -07:00
echo " Documentation........: ${build_doc}"
2011-01-16 09:55:41 -08:00
echo " Tests................: ${enable_tests}"
echo " Coverage.............: ${enable_coverage}"
echo " Benchmark............: ${enable_benchmark}"
if test "x${enable_benchmark}" = "xyes" ; then
echo " Glib...............: ${enable_benchmark_glib}"
echo " E17 real data......: ${enable_benchmark_e17}"
fi
2008-10-03 08:28:13 -07:00
echo
2009-11-14 00:40:11 -08:00
echo " CPU Specific Extensions:"
2009-11-14 00:43:18 -08:00
echo " MMX................: ${have_mmx}"
echo " SSE................: ${have_sse}"
echo " SSE2...............: ${have_sse2}"
echo " ALTIVEC............: ${have_altivec}"
2008-10-03 08:28:13 -07:00
echo
2009-06-19 23:42:32 -07:00
echo " Memory pools:"
echo " Chained pool.......: ${enable_chained_pool}"
echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
echo " Pass through.......: ${enable_pass_through}"
2010-01-08 04:10:14 -08:00
echo " Buddy..............: ${enable_buddy}"
2010-08-05 02:40:50 -07:00
echo " One big............: ${enable_one_big}"
2008-09-19 07:10:05 -07:00
echo
2009-11-14 00:43:18 -08:00
echo "Compilation............: make (or gmake)"
echo " CPPFLAGS.............: $CPPFLAGS"
echo " CFLAGS...............: $CFLAGS"
echo " LDFLAGS..............: $LDFLAGS"
2008-07-30 05:46:55 -07:00
echo
2009-11-14 00:43:18 -08:00
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo " prefix...............: $prefix"
2008-07-30 05:46:55 -07:00
echo
2010-07-27 13:17:25 -07:00
EFL_FORM_VOLTRON