define HAVE_DLOPEN also on Windows
[framework/uifw/eina.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [0])
5 m4_define([v_mic], [999])
6 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']))
7 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']))])
8 ##--   When released, remove the dnl on the below line
9 dnl m4_undefine([v_rev])
10 ##--   When doing snapshots - change soname. remove dnl on below line
11 dnl m4_define([relname], [ver-pre-svn-07])
12 dnl m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 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])])
15 m4_define([lt_cur], m4_eval(v_maj + v_min))
16 m4_define([lt_rev], v_mic)
17 m4_define([lt_age], v_min)
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20
21 AC_INIT([eina], [v_ver], [enlightenment-devel@lists.sourceforge.net])
22 AC_PREREQ([2.59])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
25
26 AC_CONFIG_HEADERS([config.h])
27 AH_TOP([
28 #ifndef EFL_CONFIG_H__
29 #define EFL_CONFIG_H__
30 ])
31 AH_BOTTOM([
32 #endif /* EFL_CONFIG_H__ */
33 ])
34
35 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
37
38 AC_GNU_SOURCE
39 AC_SYS_LARGEFILE
40
41 AC_LIBTOOL_WIN32_DLL
42 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
43 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
44 AC_PROG_LIBTOOL
45
46 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
47 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
48 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
49 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
50 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
51 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
52 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
53 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
54 version_info="lt_cur:lt_rev:lt_age"
55 release_info="v_rel"
56 AC_SUBST(version_info)
57 AC_SUBST(release_info)
58 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
59 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
60 VMAJ=v_maj
61 AC_SUBST(VMAJ)
62
63
64 ### Needed information
65
66 AC_CANONICAL_BUILD
67 AC_CANONICAL_HOST
68
69 requirement_eina=""
70
71 case "$host_os" in
72    mingw32ce*)
73       MODULE_ARCH="$host_os-$host_cpu"
74       ;;
75    *)
76       MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
77       ;;
78 esac
79 AC_SUBST(MODULE_ARCH)
80 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
81
82 case "$host_os" in
83    mingw*)
84       MODULE_EXT=".dll"
85       ;;
86    *)
87       MODULE_EXT=".so"
88       ;;
89 esac
90
91 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "${MODULE_EXT}", [Suffix for shared objects])
92
93 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
94 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
95 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
96 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
97
98 EFL_CHECK_THREADS(
99    [
100     if test "x${_efl_have_posix_threads}" = "xyes" ; then
101        have_threads="POSIX"
102     else
103        if test "x${_efl_have_win32_threads}" = "xyes" ; then
104           have_threads="Win32"
105        else
106           have_threads="no"
107        fi
108     fi
109    ],
110    [have_threads="no"])
111 EFL_CHECK_SPINLOCK([have_posix_threads_spinlock="yes"], [have_posix_threads_spinlock="no"])
112
113 if ! test "x${have_threads}" = "xno" ; then
114    EINA_CONFIGURE_HAVE_THREADS="#define EINA_HAVE_THREADS"
115 fi
116 AC_SUBST(EINA_CONFIGURE_HAVE_THREADS)
117 AM_CONDITIONAL([EINA_HAVE_THREADS], [! test "x${have_threads}" = "xno"])
118
119 if ! test "x${have_debug_threads}" = "xno"; then
120    EINA_CONFIGURE_HAVE_DEBUG_THREADS="#define EINA_HAVE_DEBUG_THREADS"
121 fi
122 AC_SUBST(EINA_CONFIGURE_HAVE_DEBUG_THREADS)
123 AM_CONDITIONAL([EINA_DEBUG_THREADS], [! test "x${have_debug_threads}" = "xno"])
124
125 if ! test "x${have_on_off_threads}" = "xno"; then
126    EINA_CONFIGURE_HAVE_ON_OFF_THREADS="#define EINA_HAVE_ON_OFF_THREADS"
127 fi
128 AC_SUBST(EINA_CONFIGURE_HAVE_ON_OFF_THREADS)
129 AM_CONDITIONAL([EINA_ON_OFF_THREADS], [! test "x${have_on_off_threads}" = "xno"])
130
131 ### Additional options to configure
132
133 # Magic debug
134 AC_ARG_ENABLE([magic-debug],
135    [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
136    [
137     if test "x${enableval}" = "xyes" ; then
138        have_magic_debug="yes"
139     else
140        have_magic_debug="no"
141     fi
142    ],
143    [have_magic_debug="yes"])
144
145 AC_MSG_CHECKING([whether magic debug is enable])
146 AC_MSG_RESULT([${have_magic_debug}])
147
148 if test "x${have_magic_debug}" = "xyes" ; then
149    EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
150 fi
151 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
152
153 # Safety checks (avoid crashes on wrong api usage)
154 AC_ARG_ENABLE(safety-checks,
155    [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
156    [
157     if test "x${enableval}" = "xyes" ; then
158        have_safety_checks="yes"
159     else
160        have_safety_checks="no"
161     fi
162    ],
163    [have_safety_checks="yes"])
164
165 AC_MSG_CHECKING(whether to do safety checking on api parameters)
166 AC_MSG_RESULT($have_safety_checks)
167
168 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
169 if test "x$have_safety_checks" = "xyes"; then
170   AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
171   EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
172 fi
173 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
174
175 with_max_log_level="<unset>"
176 AC_ARG_WITH(internal-maximum-log-level,
177    [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
178                    [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.])],
179    [
180     if test "x${withval}" != "xno"; then
181        if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
182           AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
183           AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
184           with_max_log_level="${withval}"
185        else
186           AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
187        fi
188     fi
189     ], [:])
190
191 AC_ARG_ENABLE([amalgamation],
192    [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
193    [if test "x${enableval}" = "xyes"; then
194        do_amalgamation="yes"
195     else
196        do_amalgamation="no"
197     fi
198    ],
199    [do_amalgamation="no"]
200 )
201 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
202
203 # Choose best memory pool
204 AC_ARG_ENABLE([default-mempool],
205    [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
206    [
207     if test "x${enableval}" = "xyes"; then
208        have_default_mempool="yes"
209     else
210        have_default_mempool="no"
211     fi
212    ],
213    [have_default_mempool="no"]
214 )
215 AC_MSG_CHECKING([whether to use default mempool allocator])
216 AC_MSG_RESULT([${have_default_mempool}])
217
218 if test "x${have_default_mempool}" = "xyes" ; then
219    EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
220 fi
221 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
222
223 # Report stringshare usage
224 AC_ARG_ENABLE([stringshare-usage],
225    [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
226    [
227     if test "x${enableval}" = "xyes"; then
228        have_stringshare_usage="yes"
229     else
230        have_stringshare_usage="no"
231     fi
232    ],
233    [have_stringshare_usage="no"]
234 )
235 AC_MSG_CHECKING([whether to report stringshare usage])
236 AC_MSG_RESULT([${have_stringshare_usage}])
237
238 if test "x${have_stringshare_usage}" = "xyes"; then
239    AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
240 fi
241
242 # Check if we want to benchmark on real data
243 enable_benchmark_e17="no"
244 AC_ARG_ENABLE([e17],
245    [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
246    [
247     if test "x${enableval}" = "xyes" ; then
248        enable_benchmark_e17="yes"
249     else
250        enable_benchmark_e17="no"
251     fi
252    ],
253    [enable_benchmark_e17="no"])
254
255 AC_MSG_CHECKING([whether e17 real data benchmark are built])
256 AC_MSG_RESULT([${enable_benchmark_e17}])
257
258 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
259
260
261 ### Checks for programs
262 AC_PROG_CC
263 AC_PROG_CXX
264
265 # pkg-config
266 PKG_PROG_PKG_CONFIG
267
268 # Check whether pkg-config supports Requires.private
269 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
270    pkgconfig_requires_private="Requires.private"
271 else
272    pkgconfig_requires_private="Requires"
273 fi
274 AC_SUBST(pkgconfig_requires_private)
275
276 # doxygen program for documentation building
277
278 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
279
280
281 ### Checks for libraries
282
283 # Valgrind
284 want_valgrind="auto"
285 have_valgrind="no"
286
287 AC_MSG_CHECKING(whether to enable build with valgrind)
288 AC_ARG_ENABLE(valgrind,
289   AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks.]),
290   [want_valgrind=$enableval]
291 )
292 AC_MSG_RESULT($want_valgrind)
293
294 if test "x${want_valgrind}" = "xyes" -o "x${want_valgrind}" = "xauto"; then
295     PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
296         [
297          requirement_eina="valgrind ${requirement_eina}"
298          have_valgrind="yes"
299         ],
300         [
301          AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
302          if test "x$want_valgrind" = "xyes"; then
303             AC_MSG_ERROR([Valgrind >= 2.4.0 is required)])
304          fi
305         ]
306     )
307 else
308     AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
309 fi
310
311
312 # Evil library for compilation on Windows CE
313
314 EFL_EINA_BUILD=""
315 case "$host_os" in
316    mingw*)
317       PKG_CHECK_MODULES([EVIL], [evil])
318       AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
319       requirement_eina="evil"
320       EFL_EINA_BUILD="-DEFL_EINA_BUILD"
321    ;;
322 esac
323 AC_SUBST(EFL_EINA_BUILD)
324
325 # Check ememoa memory pool library
326
327 AC_ARG_ENABLE([ememoa],
328    [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
329    [
330     if test "x${enableval}" = "xyes" ; then
331        enable_ememoa="yes"
332     else
333        enable_ememoa="no"
334     fi
335    ],
336    [enable_ememoa="yes"]
337 )
338 AC_MSG_CHECKING([whether to use ememoa for memory pool])
339 AC_MSG_RESULT([$enable_ememoa])
340
341 if test "x${enable_ememoa}" = "xyes" ; then
342    PKG_CHECK_MODULES([EMEMOA],
343       [ememoa >= 0.0.26 ],
344       [enable_ememoa="yes"],
345       [enable_ememoa="no"]
346    )
347 fi
348
349 PKG_CHECK_MODULES([ECORE_EVAS], [ecore-evas ecore evas], [build_tiler_example="yes"], [build_tiler_example="no"])
350 AM_CONDITIONAL([BUILD_TILER_EXAMPLE], [test "x${build_tiler_example}" = "xyes"])
351
352 ### Checks for header files
353 AC_HEADER_ASSERT
354 AC_HEADER_DIRENT
355 AC_HEADER_TIME
356 AC_CHECK_HEADERS([unistd.h libgen.h])
357 EFL_CHECK_PATH_MAX
358
359 ### Checks for types
360 AC_CHECK_HEADER([inttypes.h],
361    [
362     EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"
363     AC_DEFINE(HAVE_INTTYPES_H, 1, [Define to 1 if you have the <inttypes.h> header file.])
364    ])
365 AC_SUBST(EINA_CONFIGURE_HAVE_INTTYPES_H)
366
367 AC_CHECK_HEADER([stdint.h],
368    [
369     EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"
370     AC_DEFINE(HAVE_STDINT_H, 1, [Define to 1 if you have the <stdint.h> header file.])
371    ])
372 AC_SUBST(EINA_CONFIGURE_HAVE_STDINT_H)
373
374 AC_CHECK_SIZEOF(wchar_t)
375 EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
376 AC_SUBST(EINA_SIZEOF_WCHAR_T)
377
378 ### Checks for structures
379
380
381 ### Checks for compiler characteristics
382 AC_C_CONST
383 AC_C_BIGENDIAN
384 AC_C_INLINE
385 AC_C___ATTRIBUTE__
386 AC_PROG_CC_STDC
387
388 have_wince="no"
389 have_win32="no"
390 EINA_CPPFLAGS=""
391 EINA_CFLAGS=""
392 case "$host_os" in
393    mingw32ce*)
394       EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
395       EINA_CFLAGS="${EVIL_CFLAGS}"
396       have_win32="yes"
397       have_wince="yes"
398       ;;
399    mingw*)
400       EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501"
401       EINA_CFLAGS="${EVIL_CFLAGS}"
402       have_win32="yes"
403       ;;
404 esac
405 AM_CONDITIONAL([EINA_HAVE_WINCE], [test "x$have_wince" = "xyes"])
406 AM_CONDITIONAL([EINA_HAVE_WIN32], [test "x$have_win32" = "xyes"])
407
408 m4_ifdef([v_mic],
409    [
410     EFL_COMPILER_FLAG([-Wall])
411     EFL_COMPILER_FLAG([-W])
412    ])
413
414 EFL_COMPILER_FLAG([-Wshadow])
415
416 AC_SUBST(EINA_CPPFLAGS)
417 AC_SUBST(EINA_CFLAGS)
418
419
420 ### Checks for linker characteristics
421 EINA_LIBS=
422 lt_enable_auto_import=""
423 case "${host_os}" in
424    mingw*)
425       EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
426       lt_enable_auto_import="-Wl,--enable-auto-import"
427    ;;
428    dragonfly*|openbsd*)
429       EINA_LIBS="-lm"
430    ;;
431    freebsd*|netbsd*)
432       EINA_LIBS="-lrt -lm"
433    ;;
434    darwin*)
435       EINA_LIBS="-lm"
436    ;;
437    cygwin*)
438       EINA_LIBS="-ldl -lm"
439    ;;
440    *)
441       EINA_LIBS="-ldl -lrt -lm"
442    ;;
443 esac
444 AC_SUBST(EINA_LIBS)
445 AC_SUBST(lt_enable_auto_import)
446
447 EFL_LINKER_FLAG([-fno-strict-aliasing])
448
449
450 ### Checks for library functions
451 AC_ISC_POSIX
452 AC_FUNC_ALLOCA
453 AC_CHECK_FUNCS(strlcpy)
454
455 #dlopen and dladdr
456 dlopen_libs=""
457 case "$host_os" in
458    mingw*)
459 # managed by evil
460       AC_DEFINE(HAVE_DLADDR)
461       AC_DEFINE(HAVE_DLOPEN)
462       ;;
463    *)
464       AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
465       if test "x${res}" = "xyes" ; then
466          AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
467          AC_DEFINE(HAVE_DLOPEN)
468       else
469          AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
470          if test "x${res}" = "xyes" ; then
471             AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
472             AC_DEFINE(HAVE_DLOPEN)
473             dlopen_libs="-ldl"
474          fi
475       fi
476       ;;
477 esac
478 AC_SUBST(dlopen_libs)
479
480 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
481
482 # iconv library
483 have_iconv="no"
484 AC_ARG_WITH([iconv-link],
485    AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
486    [
487     LIBS="$withval $LIBS"
488     have_iconv="yes"
489     iconv_libs=$withval
490    ])
491
492 AC_MSG_CHECKING(for explicit iconv link options)
493 if test "x${iconv_libs}" = "x" ; then
494    AC_MSG_RESULT([no explicit iconv link option])
495 else
496    AC_MSG_RESULT([$iconv_libs])
497 fi
498
499 if test "x${have_iconv}" = "xno" ; then
500    AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
501
502    if test "x${have_iconv}" = "xyes" ; then
503       AC_MSG_CHECKING([whether iconv() is in libc])
504
505       AC_LINK_IFELSE(
506          [AC_LANG_PROGRAM(
507              [[
508 #include <stdlib.h>
509 #include <iconv.h>
510              ]],
511              [[
512 iconv_t ic;
513 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
514              ]])],
515          [have_iconv="yes"],
516          [have_iconv="no"])
517
518       AC_MSG_RESULT([${have_iconv}])
519    fi
520
521    if test "x${have_iconv}" = "xno" ; then
522       AC_MSG_CHECKING([whether iconv() is in libiconv.a])
523
524       LIBS_save="${LIBS}"
525       LIBS="-liconv $LIBS"
526       AC_LINK_IFELSE(
527          [AC_LANG_PROGRAM(
528              [[
529 #include <stdlib.h>
530 #include <iconv.h>
531              ]],
532              [[
533 iconv_t ic;
534 size_t count;
535 count = iconv(ic, NULL, NULL, NULL, NULL);
536              ]])],
537          [
538           have_iconv="yes"
539           iconv_libs="-liconv"
540          ],
541          [
542           have_iconv="no"
543           LIBS=${LIBS_save}
544          ])
545
546       AC_MSG_RESULT([${have_iconv}])
547    fi
548
549    if test "x${have_iconv}" = "xno" ; then
550       AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])
551
552       LIBS_save="${LIBS}"
553       LIBS="-liconv_plug $LIBS"
554       AC_LINK_IFELSE(
555          [AC_LANG_PROGRAM(
556              [[
557 #include <stdlib.h>
558 #include <iconv.h>
559              ]],
560              [[
561 iconv_t ic;
562 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
563              ]])],
564          [
565           have_iconv="yes"
566           iconv_libs="-liconv_plug"
567          ],
568          [
569           have_iconv="no"
570           LIBS=${LIBS_save}
571          ])
572
573       AC_MSG_RESULT([${have_iconv}])
574    fi
575 fi
576
577 AC_SUBST([iconv_libs])
578
579 if test "x${have_iconv}" = "xyes" ; then
580    AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
581 fi
582
583 #check for dirfd API presence
584 have_dirfd="no"
585 AC_CHECK_FUNCS([dirfd], [have_dirfd="yes"], [])
586 if test "x${dirfd}" = "xyes"; then
587    AC_DEFINE(HAVE_DIRFD)
588 fi
589 AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
590 AC_CHECK_FUNCS([fstatat], [AC_DEFINE(HAVE_FSTATAT)], [])
591 AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], [])
592
593 have_shmopen=no
594 AC_MSG_CHECKING(for shm_open availability)
595
596 LIBS_save="${LIBS}"
597 LIBS="${LIBS} -lrt"
598 AC_LINK_IFELSE(
599    [AC_LANG_PROGRAM(
600        [[
601 #include <sys/mman.h>
602 #include <sys/stat.h>        /* For mode constants */
603 #include <fcntl.h>           /* For O_* constants */
604        ]],
605        [[
606 int fd;
607
608 fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
609        ]])],
610    [have_shmopen="yes"],
611    [have_shmopen="no"])
612
613 LIBS="${LIBS_save}"
614
615 AC_MSG_RESULT([${have_shmopen}])
616
617 if test "x${have_shmopen}" = "xyes"; then
618    AC_DEFINE(HAVE_SHMOPEN, 1, [Does your system provide shm_open])
619    rt_libs="-lrt"
620 fi
621
622 AC_SUBST([rt_libs])
623
624 ### Modules
625
626 if test "x${have_default_mempool}" = "xyes" ; then
627    enable_chained_pool="no"
628    enable_pass_through="static"
629 else
630    enable_chained_pool="static"
631    enable_pass_through="no"
632 fi
633
634 enable_one_big="static"
635
636 EINA_CHECK_MODULE([chained-pool],   [${enable_chained_pool}], [chained pool])
637 EINA_CHECK_MODULE([ememoa-fixed],   [${enable_ememoa}],       [ememoa fixed])
638 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}],       [ememoa unknown])
639 EINA_CHECK_MODULE([fixed-bitmap],   [no],                     [fixed bitmap])
640 EINA_CHECK_MODULE([pass-through],   [${enable_pass_through}], [pass through])
641 EINA_CHECK_MODULE([buddy],          [no],                     [buddy])
642 EINA_CHECK_MODULE([one-big],        [${enable_one_big}],      [one big])
643
644 ### Make the debug preprocessor configurable
645
646 ### Unit tests, coverage and benchmarking
647
648 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
649
650 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
651 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
652 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
653 if test "x$enable_coverage" = "xyes" ; then
654    EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
655 fi
656
657 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
658 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
659 if test -n "$CXX" && test "x$enable_benchmark" = "xyes" ; then
660    AC_DEFINE_UNQUOTED([CITYHASH_BENCH], [1], [enable bench tests for google hash method])
661 fi
662 AM_CONDITIONAL([CITYHASH_BENCH], [test -n "$CXX" && test "x$enable_benchmark" = "xyes"])
663
664 AC_SUBST(requirement_eina)
665
666 ### Build and install examples
667 EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
668 EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])
669
670 ### Create the .pc.in file according to the major version
671 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
672 #prefix=@prefix@
673 #exec_prefix=@exec_prefix@
674 #libdir=@libdir@
675 #includedir=@includedir@
676 #
677 #Name: Eina
678 #Description: A Library that implements fast data types and miscellaneous tools
679 #Requires:
680 #Version: @VERSION@
681 #Libs: -L${libdir} -leina
682 #Libs.private: -ldl
683 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
684 #EOF
685
686 AC_CONFIG_FILES([
687 Makefile
688 eina.pc
689 eina.spec
690 doc/Makefile
691 doc/Doxyfile
692 src/Makefile
693 src/include/Makefile
694 src/include/eina_config.h
695 src/lib/Makefile
696 src/modules/Makefile
697 src/modules/mp/Makefile
698 src/modules/mp/chained_pool/Makefile
699 src/modules/mp/ememoa_fixed/Makefile
700 src/modules/mp/ememoa_unknown/Makefile
701 src/modules/mp/pass_through/Makefile
702 src/modules/mp/fixed_bitmap/Makefile
703 src/modules/mp/buddy/Makefile
704 src/modules/mp/one_big/Makefile
705 src/tests/Makefile
706 src/examples/Makefile
707 ])
708
709 AC_OUTPUT
710
711 #####################################################################
712 ## Info
713
714 echo
715 echo
716 echo
717 echo "------------------------------------------------------------------------"
718 echo "$PACKAGE $VERSION"
719 echo "------------------------------------------------------------------------"
720 echo
721 echo
722 echo "Configuration Options Summary:"
723 echo
724 echo "  Magic debug..........: ${have_magic_debug}"
725 echo "  Safety checks........: ${have_safety_checks}"
726 echo "  Maximum log level....: ${with_max_log_level}"
727 echo "  Report string usage..: ${have_stringshare_usage}"
728 echo "  Valgrind support.....: ${have_valgrind}"
729 echo "  Default mempool......: ${have_default_mempool}"
730 echo "  Thread Support.......: ${have_threads}"
731 if test "${have_threads}" = "POSIX" ; then
732 echo "    spinlock...........: ${have_posix_threads_spinlock}"
733 echo "    debug usage........: ${have_debug_threads}"
734 echo "    on/off support.....: ${have_on_off_threads}"
735 fi
736 echo "  Amalgamation.........: ${do_amalgamation}"
737 echo "  Iconv support........: ${have_iconv}"
738 echo "  File dirfd...........: ${have_dirfd}"
739 echo
740 echo "  Documentation........: ${build_doc}"
741 echo "  Tests................: ${enable_tests}"
742 echo "  Coverage.............: ${enable_coverage}"
743 echo "  Examples.............: ${enable_build_examples}"
744 echo "  Tiler Example........: ${build_tiler_example}"
745 echo "  Examples installed...: ${enable_install_examples}"
746 echo "  Benchmark............: ${enable_benchmark}"
747 if test "x${enable_benchmark}" = "xyes" ; then
748 echo "    Glib...............: ${enable_benchmark_glib}"
749 echo "    E17 real data......: ${enable_benchmark_e17}"
750 fi
751 echo
752 echo "  CPU Specific Extensions:"
753 echo "    MMX................: ${have_mmx}"
754 echo "    SSE................: ${have_sse}"
755 echo "    SSE2...............: ${have_sse2}"
756 echo "    ALTIVEC............: ${have_altivec}"
757 echo
758 echo "  Memory pools:"
759 echo "    Buddy..............: ${enable_buddy}"
760 echo "    Chained pool.......: ${enable_chained_pool}"
761 echo "    Ememoa fixed.......: ${enable_ememoa_fixed}"
762 echo "    Ememoa unknown.....: ${enable_ememoa_unknown}"
763 echo "    Fixed bitmap.......: ${enable_fixed_bitmap}"
764 echo "    One big............: ${enable_one_big}"
765 echo "    Pass through.......: ${enable_pass_through}"
766 echo
767 echo "Compilation............: make (or gmake)"
768 echo "  CPPFLAGS.............: $CPPFLAGS"
769 echo "  CFLAGS...............: $CFLAGS"
770 echo "  LDFLAGS..............: $LDFLAGS"
771 echo
772 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
773 echo "  prefix...............: $prefix"
774 echo
775 EFL_FORM_VOLTRON