--enable-amalgamation
This will concatenate all source files in the hope compiler will do a better job. On my test with static/built in mempools it saves me 4k, I guess some intra module calls can be saved. SVN revision: 42315
This commit is contained in:
parent
b84e3424fe
commit
9b3e482ad2
|
@ -110,6 +110,17 @@ AC_ARG_WITH(internal-maximum-log-level,
|
|||
fi
|
||||
], [:])
|
||||
|
||||
AC_ARG_ENABLE([amalgamation],
|
||||
[AC_HELP_STRING([--enable-amalgamation], [generate one single file with all source code in it, helps compiler optimizations.])],
|
||||
[if test "x${enableval}" = "xyes"; then
|
||||
do_amalgamation="yes"
|
||||
else
|
||||
do_amalgamation="no"
|
||||
fi
|
||||
],
|
||||
[do_amalgamation="no"]
|
||||
)
|
||||
AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
|
||||
|
||||
# Choose best memory pool
|
||||
AC_ARG_ENABLE([default-mempool],
|
||||
|
|
|
@ -8,9 +8,7 @@ AM_CPPFLAGS = \
|
|||
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
|
||||
@EINA_CPPFLAGS@
|
||||
|
||||
lib_LTLIBRARIES = libeina.la
|
||||
|
||||
libeina_la_SOURCES = \
|
||||
base_sources = \
|
||||
eina_error.c \
|
||||
eina_log.c \
|
||||
eina_hash.c \
|
||||
|
@ -38,36 +36,70 @@ eina_tiler.c \
|
|||
eina_hamster.c \
|
||||
eina_safety_checks.c
|
||||
|
||||
DIST_SOURCES = $(base_sources)
|
||||
sources_used = $(base_sources)
|
||||
|
||||
if EINA_STATIC_BUILD_CHAINED_POOL
|
||||
|
||||
libeina_la_SOURCES += $(top_srcdir)/src/modules/mp/chained_pool/eina_chained_mempool.c
|
||||
|
||||
sources_used += $(top_srcdir)/src/modules/mp/chained_pool/eina_chained_mempool.c
|
||||
endif
|
||||
|
||||
if EINA_STATIC_BUILD_EMEMOA_FIXED
|
||||
|
||||
libeina_la_SOURCES += $(top_srcdir)/src/modules/mp/ememoa_fixed/eina_ememoa_fixed.c
|
||||
|
||||
sources_used += $(top_srcdir)/src/modules/mp/ememoa_fixed/eina_ememoa_fixed.c
|
||||
endif
|
||||
|
||||
if EINA_STATIC_BUILD_EMEMOA_UNKNOWN
|
||||
|
||||
libeina_la_SOURCES += $(top_srcdir)/src/modules/mp/ememoa_unknown/eina_ememoa_unknown.c
|
||||
|
||||
sources_used += $(top_srcdir)/src/modules/mp/ememoa_unknown/eina_ememoa_unknown.c
|
||||
endif
|
||||
|
||||
if EINA_STATIC_BUILD_FIXED_BITMAP
|
||||
|
||||
libeina_la_SOURCES += $(top_srcdir)/src/modules/mp/fixed_bitmap/eina_fixed_bitmap.c
|
||||
|
||||
sources_used += $(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/eina_pass_through.c
|
||||
|
||||
sources_used += $(top_srcdir)/src/modules/mp/pass_through/eina_pass_through.c
|
||||
endif
|
||||
|
||||
lib_LTLIBRARIES = libeina.la
|
||||
|
||||
if EINA_AMALGAMATION
|
||||
eina_sources_used = eina_amalgamation.c
|
||||
BUILT_SOURCES = eina_amalgamation.c
|
||||
|
||||
$(builddir)/ eina_amalgamation.c: $(sources_used) Makefile
|
||||
-rm $(builddir)/eina_amalgamation.c
|
||||
|
||||
@echo "#ifdef HAVE_CONFIG_H" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#include \"config.h\"" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#endif" >> $(builddir)/eina_amalgamation.c
|
||||
|
||||
@echo "#ifndef _WIN32" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#define _GNU_SOURCE" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#else" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#ifdef HAVE_EVIL" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "# include <Evil.h>" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#endif" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#endif" >> $(builddir)/eina_amalgamation.c
|
||||
|
||||
@echo "#include \"eina_config.h\"" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#include \"eina_private.h\"" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#include \"eina_safety_checks.h\"" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#include \"Eina.h\"" >> $(builddir)/eina_amalgamation.c
|
||||
|
||||
@echo "#include <stdio.h>" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#include <stdlib.h>" >> $(builddir)/eina_amalgamation.c
|
||||
@echo "#include <string.h>" >> $(builddir)/eina_amalgamation.c
|
||||
|
||||
@for f in $(sources_used); do \
|
||||
echo "/* file: $$f */" >> $(builddir)/eina_amalgamation.c; \
|
||||
grep -v -e '^# *include \+.\(config\|eina_[a-z_]\+\|Evil\|stdio\|stdlib\|string\)[.]h.*' $$f >> $(builddir)/eina_amalgamation.c; \
|
||||
done
|
||||
@echo "eina_amalgamation.c generated"
|
||||
|
||||
else
|
||||
eina_sources_used = $(sources_used)
|
||||
endif
|
||||
|
||||
libeina_la_SOURCES = $(eina_sources_used)
|
||||
libeina_la_LIBADD = @EINA_LIBS@ @dlopen_libs@
|
||||
libeina_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ @EFL_PTHREAD_LIBS@
|
||||
libeina_la_CFLAGS = @EINA_CFLAGS@ @EFL_PTHREAD_CFLAGS@
|
||||
|
|
|
@ -241,7 +241,7 @@ eina_chained_mempool_shutdown(void *data)
|
|||
free(mp);
|
||||
}
|
||||
|
||||
static Eina_Mempool_Backend mp_backend = {
|
||||
static Eina_Mempool_Backend _eina_chained_mp_backend = {
|
||||
.name ="chained_mempool",
|
||||
.init = &eina_chained_mempool_init,
|
||||
.shutdown = &eina_chained_mempool_shutdown,
|
||||
|
@ -252,12 +252,12 @@ static Eina_Mempool_Backend mp_backend = {
|
|||
|
||||
Eina_Bool chained_init(void)
|
||||
{
|
||||
return eina_mempool_register(&mp_backend);
|
||||
return eina_mempool_register(&_eina_chained_mp_backend);
|
||||
}
|
||||
|
||||
void chained_shutdown(void)
|
||||
{
|
||||
eina_mempool_unregister(&mp_backend);
|
||||
eina_mempool_unregister(&_eina_chained_mp_backend);
|
||||
}
|
||||
|
||||
#ifndef EINA_STATIC_BUILD_CHAINED_POOL
|
||||
|
|
|
@ -133,7 +133,7 @@ eina_ememoa_fixed_shutdown(void *data)
|
|||
free(efm);
|
||||
}
|
||||
|
||||
static Eina_Mempool_Backend mp_backend = {
|
||||
static Eina_Mempool_Backend _eina_ememoa_mp_backend = {
|
||||
.name = "ememoa_fixed",
|
||||
.init = &eina_ememoa_fixed_init,
|
||||
.shutdown = &eina_ememoa_fixed_shutdown,
|
||||
|
@ -146,12 +146,12 @@ static Eina_Mempool_Backend mp_backend = {
|
|||
|
||||
Eina_Bool ememoa_fixed_init(void)
|
||||
{
|
||||
return eina_mempool_register(&mp_backend);
|
||||
return eina_mempool_register(&_eina_ememoa_mp_backend);
|
||||
}
|
||||
|
||||
void ememoa_fixed_shutdown(void)
|
||||
{
|
||||
eina_mempool_unregister(&mp_backend);
|
||||
eina_mempool_unregister(&_eina_ememoa_mp_backend);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ eina_ememoa_unknown_size_shutdown(void *data)
|
|||
free(efm);
|
||||
}
|
||||
|
||||
static Eina_Mempool_Backend mp_backend = {
|
||||
static Eina_Mempool_Backend _eina_ememoa_unknown_mp_backend = {
|
||||
.name = "ememoa_unknown",
|
||||
.init = &eina_ememoa_unknown_size_init,
|
||||
.shutdown = &eina_ememoa_unknown_size_shutdown,
|
||||
|
@ -151,12 +151,12 @@ static Eina_Mempool_Backend mp_backend = {
|
|||
|
||||
Eina_Bool ememoa_unknown_init(void)
|
||||
{
|
||||
return eina_mempool_register(&mp_backend);
|
||||
return eina_mempool_register(&_eina_ememoa_unknown_mp_backend);
|
||||
}
|
||||
|
||||
void ememoa_unknown_shutdown(void)
|
||||
{
|
||||
eina_mempool_unregister(&mp_backend);
|
||||
eina_mempool_unregister(&_eina_ememoa_unknown_mp_backend);
|
||||
}
|
||||
|
||||
#ifndef EINA_STATIC_BUILD_EMEMOA_UNKNOWN
|
||||
|
|
|
@ -203,7 +203,7 @@ eina_fixed_bitmap_shutdown(void *data)
|
|||
free(mp);
|
||||
}
|
||||
|
||||
static Eina_Mempool_Backend mp_backend = {
|
||||
static Eina_Mempool_Backend _eina_fixed_bitmap_mp_backend = {
|
||||
.name ="fixed_bitmap",
|
||||
.init = &eina_fixed_bitmap_init,
|
||||
.shutdown = &eina_fixed_bitmap_shutdown,
|
||||
|
@ -214,12 +214,12 @@ static Eina_Mempool_Backend mp_backend = {
|
|||
|
||||
Eina_Bool fixed_bitmap_init(void)
|
||||
{
|
||||
return eina_mempool_register(&mp_backend);
|
||||
return eina_mempool_register(&_eina_fixed_bitmap_mp_backend);
|
||||
}
|
||||
|
||||
void fixed_bitmap_shutdown(void)
|
||||
{
|
||||
eina_mempool_unregister(&mp_backend);
|
||||
eina_mempool_unregister(&_eina_fixed_bitmap_mp_backend);
|
||||
}
|
||||
|
||||
#ifndef EINA_STATIC_BUILD_FIXED_BITMAP
|
||||
|
|
|
@ -60,7 +60,7 @@ eina_pass_through_shutdown(__UNUSED__ void *data)
|
|||
}
|
||||
|
||||
|
||||
static Eina_Mempool_Backend mp_backend = {
|
||||
static Eina_Mempool_Backend _eina_pass_through_mp_backend = {
|
||||
.name = "pass_through",
|
||||
.init = &eina_pass_through_init,
|
||||
.shutdown = &eina_pass_through_shutdown,
|
||||
|
@ -73,12 +73,12 @@ static Eina_Mempool_Backend mp_backend = {
|
|||
|
||||
Eina_Bool pass_through_init(void)
|
||||
{
|
||||
return eina_mempool_register(&mp_backend);
|
||||
return eina_mempool_register(&_eina_pass_through_mp_backend);
|
||||
}
|
||||
|
||||
void pass_through_shutdown(void)
|
||||
{
|
||||
eina_mempool_unregister(&mp_backend);
|
||||
eina_mempool_unregister(&_eina_pass_through_mp_backend);
|
||||
}
|
||||
|
||||
#ifndef EINA_STATIC_BUILD_PASS_THROUGH
|
||||
|
|
Loading…
Reference in New Issue