From 8909bb6b69867ec685ca023eb0ef83a07db3ca10 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sat, 20 Jun 2009 06:42:32 +0000 Subject: [PATCH] * All memory pools can be enabled / disabled * Allow to pass 'static' to configure memory pools * Add fixed_bitmap in the possible statically linked memory pools For example: ./configure --enable-chained-pool=static --disable-fixed-bitmap SVN revision: 41119 --- legacy/eina/configure.ac | 86 +++++++++---------- legacy/eina/m4/eina_check.m4 | 66 ++++++++++---- legacy/eina/src/lib/Makefile.am | 6 ++ .../src/modules/mp/chained_pool/Makefile.am | 2 + .../src/modules/mp/ememoa_fixed/Makefile.am | 4 +- .../src/modules/mp/ememoa_unknown/Makefile.am | 4 +- .../src/modules/mp/fixed_bitmap/Makefile.am | 2 + .../src/modules/mp/pass_through/Makefile.am | 14 +-- 8 files changed, 111 insertions(+), 73 deletions(-) diff --git a/legacy/eina/configure.ac b/legacy/eina/configure.ac index 62cecca965..261e7bf4b4 100644 --- a/legacy/eina/configure.ac +++ b/legacy/eina/configure.ac @@ -54,7 +54,7 @@ EFL_CHECK_PTHREAD([have_pthread="yes"], [have_pthread="no"]) # Magic debug AC_ARG_ENABLE([magic-debug], - [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure [default=enabled]])], + [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])], [ if test "x${enableval}" = "xyes" ; then have_magic_debug="yes" @@ -74,7 +74,7 @@ AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG) # Safety checks (avoid crashes on wrong api usage) AC_ARG_ENABLE(safety-checks, - [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. [default=enabled]])], + [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])], [ if test "x${enableval}" = "xyes" ; then have_safety_checks="yes" @@ -96,7 +96,7 @@ AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS) # Choose best memory pool AC_ARG_ENABLE([default-mempool], - [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. [default=disabled]])], + [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])], [ if test "x${enableval}" = "xyes"; then have_default_mempool="yes" @@ -116,7 +116,7 @@ AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL) # Report stringshare usage AC_ARG_ENABLE([stringshare-usage], - [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. [default=disabled]])], + [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])], [ if test "x${enableval}" = "xyes"; then have_stringshare_usage="yes" @@ -133,30 +133,6 @@ if test "x${have_stringshare_usage}" = "xyes"; then AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern]) fi -# Ememoa memory pool - -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]) - -# Static linking - -EINA_CHECK_STATIC([chained-pool], [chained pool]) -EINA_CHECK_STATIC([ememoa-fixed], [ememoa fixed]) -EINA_CHECK_STATIC([ememoa-unknown], [ememoa unknown]) -EINA_CHECK_STATIC([pass-through], [pass through]) -EINA_CHECK_STATIC([fixed-bitmap], [fixed bitmap]) - ### Checks for programs AC_PROG_CC @@ -238,6 +214,20 @@ AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xye # Check ememoa memory pool library +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]) + if test "x${enable_ememoa}" = "xyes" ; then PKG_CHECK_MODULES([EMEMOA], [ememoa >= 0.0.26 ], @@ -356,6 +346,23 @@ dnl nothing on mingw platform esac AC_SUBST(dlopen_libs) +### Modules + +EINA_CHECK_MODULE([chained-pool], [yes], [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], [yes], [fixed bitmap]) +EINA_CHECK_MODULE([pass-through], [yes], [pass through]) + + +### Make the debug preprocessor configurable + +### 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"]) +EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"]) + ### Create the .pc.in file according to the major version #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF @@ -373,15 +380,6 @@ AC_SUBST(dlopen_libs) #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina #EOF - -### Make the debug preprocessor configurable - -### 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"]) -EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"]) - AC_CONFIG_FILES([ Makefile eina-0.pc @@ -440,14 +438,12 @@ echo " SSE..................: ${have_sse}" echo " SSE2.................: ${have_sse2}" echo " ALTIVEC..............: ${have_altivec}" echo -echo " Memory pool:" -echo " Ememoa.............: ${enable_ememoa}" -echo -echo " Static build of memory pools:" -echo " Chained pool.......: ${enable_static_chained_pool}" -echo " Ememoa fixed.......: ${enable_static_ememoa_fixed}" -echo " Ememoa unknown.....: ${enable_static_ememoa_unknown}" -echo " Pass through.......: ${enable_static_pass_through}" +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}" echo echo " Installation.........: make install" echo diff --git a/legacy/eina/m4/eina_check.m4 b/legacy/eina/m4/eina_check.m4 index 38eb567413..00f24b7dd6 100644 --- a/legacy/eina/m4/eina_check.m4 +++ b/legacy/eina/m4/eina_check.m4 @@ -1,29 +1,63 @@ -dnl use: EINA_CHECK_STATIC(foo-bar, description) -AC_DEFUN([EINA_CHECK_STATIC], +dnl use: EINA_CHECK_MODULE(foo-bar, have_dependency, description) +AC_DEFUN([EINA_CHECK_MODULE], [ -pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl -pushdef([DOWN], translit([$1], [-A-Z], [_a-z]))dnl +m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl +m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl -AC_ARG_ENABLE([static-$1], - [AC_HELP_STRING([--enable-static-$1], [enable static build of $2 @<:@default=no@:>@])], +want_module="$2" + +AC_ARG_ENABLE([$1], + [AC_HELP_STRING([--enable-$1@<:@=yes|static|no@:>@], [enable build of $3 @<:@default=yes@:>@])], [ if test "x${enableval}" = "xyes" ; then - enable_static_[]DOWN="yes" + enable_module="yes" else - enable_static_[]DOWN="no" + if test "x${enableval}" = "xstatic" ; then + enable_module="static" + else + enable_module="no" + fi fi ], - [enable_static_[]DOWN="no"] + [enable_module="yes"] ) -AC_MSG_CHECKING([whether $2 is statically build]) -AC_MSG_RESULT([${enable_static_[]DOWN}]) -AM_CONDITIONAL(EINA_STATIC_BUILD_[]UP, test "x${enable_static_[]DOWN}" = "xyes") +have_module="no" +if test "x${enable_module}" = "xyes" -o "x${enable_module}" = "xstatic" ; then + have_module="yes" +fi -if test "x${enable_static_[]DOWN}" = "xyes" ; then +AC_MSG_CHECKING([whether to enable $3 built]) +AC_MSG_RESULT([${have_module}]) + +build_module="no" +if test "x${want_module}" = "xyes" -a "x${have_module}" = "xyes" ; then + build_module="yes" +fi + +AC_MSG_CHECKING([whether to build $3]) +AC_MSG_RESULT([${build_module}]) + +static_module="no" +if test "x${want_module}" = "xyes" -a "x${enable_module}" = "xstatic" ; then + static_module="yes" +fi + +AC_MSG_CHECKING([whether to statically link $3]) +AC_MSG_RESULT([${static_module}]) + +AM_CONDITIONAL(EINA_BUILD_[]UP, [test "x${build_module}" = "xyes"]) +AM_CONDITIONAL(EINA_STATIC_BUILD_[]UP, [test "x${static_module}" = "xyes"]) + +if test "x${static_module}" = "xyes" ; then AC_DEFINE(EINA_STATIC_BUILD_[]UP, 1, [Set to 1 if $2 is statically built]) fi -popdef([UP]) -popdef([DOWN]) -]) \ No newline at end of file +enable_[]DOWN="no" +if test "x${want_module}" = "xyes" ; then + enable_[]DOWN=${enable_module} +fi + +m4_popdef([UP]) +m4_popdef([DOWN]) +]) diff --git a/legacy/eina/src/lib/Makefile.am b/legacy/eina/src/lib/Makefile.am index 9935409c98..03307ec75e 100644 --- a/legacy/eina/src/lib/Makefile.am +++ b/legacy/eina/src/lib/Makefile.am @@ -51,6 +51,12 @@ libeina_la_SOURCES += $(top_srcdir)/src/modules/mp/ememoa_unknown/eina_ememoa_un endif +if EINA_STATIC_BUILD_FIXED_BITMAP + +libeina_la_SOURCES += $(top_srcdir)/src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c + +endif + if EINA_STATIC_BUILD_PASS_THROUGH libeina_la_SOURCES += $(top_srcdir)/src/modules/mp/pass_through/pass_through.c diff --git a/legacy/eina/src/modules/mp/chained_pool/Makefile.am b/legacy/eina/src/modules/mp/chained_pool/Makefile.am index b3b9aaa4dc..288deeee1a 100644 --- a/legacy/eina/src/modules/mp/chained_pool/Makefile.am +++ b/legacy/eina/src/modules/mp/chained_pool/Makefile.am @@ -6,6 +6,7 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ @EINA_CFLAGS@ @EFL_PTHREAD_CFLAGS@ +if EINA_BUILD_CHAINED_POOL if !EINA_STATIC_BUILD_CHAINED_POOL controllerdir = $(libdir)/eina/mp @@ -18,6 +19,7 @@ eina_chained_mempool_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@ eina_chained_mempool_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version eina_chained_mempool_la_LIBTOOLFLAGS = --tag=disable-static +endif endif clean-local: diff --git a/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am b/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am index 5c479a77f5..a6b7ad39d9 100644 --- a/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am +++ b/legacy/eina/src/modules/mp/ememoa_fixed/Makefile.am @@ -8,8 +8,7 @@ AM_CPPFLAGS = \ @EINA_CFLAGS@ \ @EMEMOA_CFLAGS@ -if EINA_ENABLE_EMEMOA - +if EINA_BUILD_EMEMOA_FIXED if !EINA_STATIC_BUILD_EMEMOA_FIXED controllerdir = $(libdir)/eina/mp @@ -23,7 +22,6 @@ eina_ememoa_fixed_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -modul eina_ememoa_fixed_la_LIBTOOLFLAGS = --tag=disable-static endif - endif clean-local: diff --git a/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am b/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am index 61a183efd9..ace033a77a 100644 --- a/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am +++ b/legacy/eina/src/modules/mp/ememoa_unknown/Makefile.am @@ -8,8 +8,7 @@ AM_CPPFLAGS = \ @EINA_CFLAGS@ \ @EMEMOA_CFLAGS@ -if EINA_ENABLE_EMEMOA - +if EINA_BUILD_EMEMOA_UNKNOWN if !EINA_STATIC_BUILD_EMEMOA_UNKNOWN controllerdir = $(libdir)/eina/mp @@ -23,7 +22,6 @@ eina_ememoa_unknown_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -mod eina_ememoa_unknown_la_LIBTOOLFLAGS = --tag=disable-static endif - endif clean-local: diff --git a/legacy/eina/src/modules/mp/fixed_bitmap/Makefile.am b/legacy/eina/src/modules/mp/fixed_bitmap/Makefile.am index e0dcb6b80b..89b606fa37 100644 --- a/legacy/eina/src/modules/mp/fixed_bitmap/Makefile.am +++ b/legacy/eina/src/modules/mp/fixed_bitmap/Makefile.am @@ -6,6 +6,7 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ @EINA_CFLAGS@ +if EINA_BUILD_FIXED_BITMAP if !EINA_STATIC_BUILD_FIXED_BITMAP controllerdir = $(libdir)/eina/mp @@ -18,6 +19,7 @@ eina_fixed_bitmap_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@ eina_fixed_bitmap_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version eina_fixed_bitmap_la_LIBTOOLFLAGS = --tag=disable-static +endif endif clean-local: diff --git a/legacy/eina/src/modules/mp/pass_through/Makefile.am b/legacy/eina/src/modules/mp/pass_through/Makefile.am index b811754526..d1f9be1363 100644 --- a/legacy/eina/src/modules/mp/pass_through/Makefile.am +++ b/legacy/eina/src/modules/mp/pass_through/Makefile.am @@ -7,18 +7,20 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ @EINA_CFLAGS@ +if EINA_BUILD_PASS_THROUGH if !EINA_STATIC_BUILD_PASS_THROUGH controllerdir = $(libdir)/eina/mp -controller_LTLIBRARIES = pass_through.la +controller_LTLIBRARIES = eina_pass_through.la -pass_through_la_SOURCES = \ -pass_through.c +eina_pass_through_la_SOURCES = \ +eina_pass_through.c -pass_through_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@ -pass_through_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version -pass_through_la_LIBTOOLFLAGS = --tag=disable-static +eina_pass_through_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@ +eina_pass_through_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version +eina_pass_through_la_LIBTOOLFLAGS = --tag=disable-static +endif endif clean-local: