summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-10 18:43:15 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-10 18:43:15 +0000
commit0b19ba7bc23ce175537a29c2816b3ef12e95ed2d (patch)
tree0efdfaa8435a14f63a2070eb0ec75b25faed49d7 /configure.ac
parentb82e878656f76195be22574eae06b59d92b3c24c (diff)
efl: introduce build profile, simplify options.
Introduced --with-profile={dev,release} that will simplify how to set build options of EFL. NOTE-1: specific e17 benchmark is now gone, it will always be built and is the default benchmark for eina. If we want to have a faster benchmark in the future, just add a command line option for eina_suite. NOTE-2: valgrind build is broken as it needs -fPIC. Will get to it later. Likely someone needs to revisit the eina mempools for valgrind and other basic tools (eo? likely evas). SVN revision: 77771
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac176
1 files changed, 36 insertions, 140 deletions
diff --git a/configure.ac b/configure.ac
index 69f3c1d..f0edd7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,6 +85,13 @@ AC_SUBST([requirements_pc_eet])
85 85
86AC_CANONICAL_HOST 86AC_CANONICAL_HOST
87 87
88AC_ARG_WITH([profile],
89 [AC_HELP_STRING([--with-profile=PROFILE],
90 [use the predefined build profile, one of: dev, release.
91 @<:@default=dev@:>@])],
92 [build_profile=${withval}],
93 [build_profile=dev])
94
88# TODO: move me to m4 file that setups module/so related variables 95# TODO: move me to m4 file that setups module/so related variables
89have_wince="no" 96have_wince="no"
90have_win32="no" 97have_win32="no"
@@ -123,21 +130,6 @@ AM_CONDITIONAL([HAVE_WINDOWS], [test "x${have_windows}" = "xyes"])
123#### Additional options to configure 130#### Additional options to configure
124 131
125 132
126
127# Assert or fail.
128
129AC_ARG_ENABLE([assert],
130 [AC_HELP_STRING([--enable-assert], [enable assert, @<:@default=no@:>@])],
131 [
132 if test "x${enableval}" = "xyes" ; then
133 prefer_assert="yes"
134 else
135 prefer_assert="no"
136 fi
137 ],
138 [prefer_assert="no"])
139
140
141#### Checks for programs 133#### Checks for programs
142 134
143### libtool 135### libtool
@@ -300,41 +292,30 @@ AC_MSG_NOTICE([Eina checks])
300 292
301### Additional options to configure 293### Additional options to configure
302 294
303# Magic debug 295have_magic_debug="yes"
304AC_ARG_ENABLE([magic-debug], 296have_safety_checks="yes"
305 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])], 297want_log="yes"
306 [ 298case "$build_profile" in
307 if test "x${enableval}" = "xyes" ; then 299 dev)
308 have_magic_debug="yes" 300 with_max_log_level=""
309 else 301 have_stringshare_usage="yes"
310 have_magic_debug="no" 302 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
311 fi 303 want_debug_malloc="yes"
312 ], 304 ;;
313 [have_magic_debug="yes"]) 305
314 306 release)
315AC_MSG_CHECKING([whether magic debug is enable]) 307 with_max_log_level="3"
316AC_MSG_RESULT([${have_magic_debug}]) 308 have_stringshare_usage="no"
309 want_valgrind="no"
310 want_debug_malloc="no"
311 ;;
312esac
317 313
318if test "x${have_magic_debug}" = "xyes" ; then 314if test "x${have_magic_debug}" = "xyes" ; then
319 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG" 315 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
320fi 316fi
321AC_SUBST([EINA_CONFIGURE_MAGIC_DEBUG]) 317AC_SUBST([EINA_CONFIGURE_MAGIC_DEBUG])
322 318
323# Safety checks (avoid crashes on wrong api usage)
324AC_ARG_ENABLE([safety-checks],
325 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
326 [
327 if test "x${enableval}" = "xyes" ; then
328 have_safety_checks="yes"
329 else
330 have_safety_checks="no"
331 fi
332 ],
333 [have_safety_checks="yes"])
334
335AC_MSG_CHECKING([whether to do safety checking on api parameters])
336AC_MSG_RESULT([${have_safety_checks}])
337
338if test "x${have_safety_checks}" = "xyes" ; then 319if test "x${have_safety_checks}" = "xyes" ; then
339 AC_DEFINE([EINA_SAFETY_CHECKS], [1], [disable safety checks for NULL pointers and like.]) 320 AC_DEFINE([EINA_SAFETY_CHECKS], [1], [disable safety checks for NULL pointers and like.])
340 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS" 321 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
@@ -343,23 +324,14 @@ AC_SUBST([EINA_CONFIGURE_SAFETY_CHECKS])
343 324
344AM_CONDITIONAL([SAFETY_CHECKS], [test "x$have_safety_checks" = "xyes"]) 325AM_CONDITIONAL([SAFETY_CHECKS], [test "x$have_safety_checks" = "xyes"])
345 326
346# Miximum log level 327if test -n "$with_max_log_level"; then
347with_max_log_level="<unset>" 328 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${with_max_log_level}])
348AC_ARG_WITH([internal-maximum-log-level], 329 AC_DEFINE_UNQUOTED([EINA_LOG_LEVEL_MAXIMUM], [${with_max_log_level}], [if set, logging is limited to this amount.])
349 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER], 330fi
350 [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.])], 331
351 [ 332if test "x${have_stringshare_usage}" = "xyes"; then
352 if test "x${withval}" != "xno" ; then 333 AC_DEFINE([EINA_STRINGSHARE_USAGE], [1], [Report Eina stringshare usage pattern])
353 if echo "${withval}" | grep -E '^[[0-9]]+$' >/dev/null 2>/dev/null; then 334fi
354 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
355 AC_DEFINE_UNQUOTED([EINA_LOG_LEVEL_MAXIMUM], [${withval}], [if set, logging is limited to this amount.])
356 with_max_log_level="${withval}"
357 else
358 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
359 fi
360 fi
361 ],
362 [:])
363 335
364# Choose best memory pool 336# Choose best memory pool
365AC_ARG_ENABLE([default-mempool], 337AC_ARG_ENABLE([default-mempool],
@@ -381,58 +353,6 @@ if test "x${have_default_mempool}" = "xyes" ; then
381fi 353fi
382AC_SUBST([EINA_CONFIGURE_DEFAULT_MEMPOOL]) 354AC_SUBST([EINA_CONFIGURE_DEFAULT_MEMPOOL])
383 355
384# Report stringshare usage
385AC_ARG_ENABLE([stringshare-usage],
386 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
387 [
388 if test "x${enableval}" = "xyes"; then
389 have_stringshare_usage="yes"
390 else
391 have_stringshare_usage="no"
392 fi
393 ],
394 [have_stringshare_usage="no"]
395)
396AC_MSG_CHECKING([whether to report stringshare usage])
397AC_MSG_RESULT([${have_stringshare_usage}])
398
399if test "x${have_stringshare_usage}" = "xyes"; then
400 AC_DEFINE([EINA_STRINGSHARE_USAGE], [1], [Report Eina stringshare usage pattern])
401fi
402
403# Check if we want to benchmark on real data
404AC_ARG_ENABLE([e17],
405 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
406 [
407 if test "x${enableval}" = "xyes" ; then
408 enable_benchmark_e17="yes"
409 else
410 enable_benchmark_e17="no"
411 fi
412 ],
413 [enable_benchmark_e17="no"])
414
415AC_MSG_CHECKING([whether e17 real data benchmark are built])
416AC_MSG_RESULT([${enable_benchmark_e17}])
417
418AM_CONDITIONAL([EINA_ENABLE_BENCHMARK_E17], [test "x${enable_benchmark_e17}" = "xyes"])
419
420# Valgrind
421
422AC_ARG_ENABLE([valgrind],
423 [AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks. @<:@default=no@:>@])],
424 [
425 if test "x${enableval}" = "xyes" ; then
426 want_valgrind="yes"
427 else
428 want_valgrind="no"
429 fi
430 ],
431 [want_valgrind="no"])
432
433AC_MSG_CHECKING([whether to enable build with valgrind])
434AC_MSG_RESULT([${want_valgrind}])
435
436### Checks for programs 356### Checks for programs
437 357
438### Checks for libraries 358### Checks for libraries
@@ -482,7 +402,7 @@ AC_SUBST([EINA_CONFIGURE_HAVE_EXOTIC])
482 402
483# Valgrind 403# Valgrind
484 404
485if test "x${want_valgrind}" = "xyes" || test "x${want_valgrind}" = "xauto"; then 405if test "x${want_valgrind}" = "xyes"; then
486 PKG_CHECK_MODULES([VALGRIND], [valgrind >= 2.4.0], 406 PKG_CHECK_MODULES([VALGRIND], [valgrind >= 2.4.0],
487 [ 407 [
488 have_valgrind="yes" 408 have_valgrind="yes"
@@ -491,41 +411,16 @@ if test "x${want_valgrind}" = "xyes" || test "x${want_valgrind}" = "xauto"; then
491 ], 411 ],
492 [ 412 [
493 have_valgrind="no" 413 have_valgrind="no"
494 AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled]) 414 AC_MSG_ERROR([Valgrind >= 2.4.0 is required])
495 if test "x${want_valgrind}" = "xyes"; then
496 AC_MSG_ERROR([Valgrind >= 2.4.0 is required])
497 fi
498 ]) 415 ])
499else 416else
500 AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled]) 417 AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
501fi 418fi
502 419
503AC_ARG_ENABLE([debug-malloc],
504 [AC_HELP_STRING([--enable-debug-malloc], [enable debugging of malloc usage overhead in our allocator @<:@default=enabled@:>@])],
505 [
506 if test "x${enableval}" = "xyes" ; then
507 want_debug_malloc="yes"
508 else
509 want_debug_malloc="no"
510 fi
511 ],
512 [want_debug_malloc="no"])
513
514if test "x${ac_cv_func_malloc_usable_size}" = "xyes" && test "x${want_debug_malloc}" = "xyes"; then 420if test "x${ac_cv_func_malloc_usable_size}" = "xyes" && test "x${want_debug_malloc}" = "xyes"; then
515 AC_DEFINE([EINA_DEBUG_MALLOC], [1], [Turn on debugging overhead in mempool]) 421 AC_DEFINE([EINA_DEBUG_MALLOC], [1], [Turn on debugging overhead in mempool])
516fi 422fi
517 423
518AC_ARG_ENABLE([log],
519 [AC_HELP_STRING([--disable-log], [disable Eina_Log infrastructure completly @<:@default=enabled@:>@])],
520 [
521 if test "x${enableval}" = "xyes" ; then
522 want_log="yes"
523 else
524 want_log="no"
525 fi
526 ],
527 [want_log="yes"])
528
529## Modules 424## Modules
530 425
531# Check ememoa memory pool library 426# Check ememoa memory pool library
@@ -1190,6 +1085,7 @@ echo
1190echo "Configuration Options Summary:" 1085echo "Configuration Options Summary:"
1191echo 1086echo
1192echo " OS...................: ${host_os}" 1087echo " OS...................: ${host_os}"
1088echo " Build Profile........: ${build_profile}"
1193if test "x${have_windows}" = "xyes" ; then 1089if test "x${have_windows}" = "xyes" ; then
1194 echo " Windows version......: ${_efl_windows_version}" 1090 echo " Windows version......: ${_efl_windows_version}"
1195fi 1091fi