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