summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2014-08-12 09:37:33 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2014-08-19 16:53:11 +0200
commit2863baab63ca4999c819ebe0eb6a7f885b5809b2 (patch)
tree2a562cea71f7ba68ccdb365176083280bde7104e
parentd408408283dd4ece9023d792753fd63422b80cb1 (diff)
downloadefl-2863baab63ca4999c819ebe0eb6a7f885b5809b2.tar.gz
WIP: build: Allow to use external liblz4 instead of embedded copy
Not workign yet. Need to wait until I have a system which ships liblz4 r121 which finally ships a pc file.
-rw-r--r--configure.ac20
-rw-r--r--src/Makefile_Eet.am6
-rw-r--r--src/Makefile_Evas.am46
-rw-r--r--src/lib/eet/eet_image.c9
-rw-r--r--src/lib/eet/eet_lib.c9
-rw-r--r--src/modules/evas/loaders/tgv/evas_image_load_tgv.c7
-rw-r--r--src/modules/evas/savers/tgv/evas_image_save_tgv.c10
7 files changed, 85 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index aac5cd895f..676fea2adf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -374,6 +374,26 @@ AC_DEFINE_IF([ENABLE_LUA_OLD], [test "${want_lua_old}" = "yes"],
[1], [Use interpreted Lua (5.1 or 5.2)])
AC_SUBST([want_lua_old])
+
+want_liblz4="no"
+AC_ARG_ENABLE([liblz4],
+ [AS_HELP_STRING([--enable-liblz4],[Enable usage of liblz4 instead of our embedded copy. @<:@default=disabled@:>@])],
+ [
+ if test "x${enableval}" = "xyes" ; then
+# Only ships pc file since r121q
+#PKG_CHECK_MODULES([LIBLZ4], [liblz4])
+ want_liblz4="yes"
+ else
+ want_liblz4="no"
+ fi
+ ],
+ [want_liblz4="no"])
+
+AM_CONDITIONAL([ENABLE_LIBLZ4], [test "${want_liblz4}" = "yes"])
+AC_DEFINE_IF([ENABLE_LIBLZ4], [test "${want_liblz4}" = "yes"], [1], [Use liblz4 external library instead of embedded copy])
+AC_SUBST([want_liblz4])
+AC_SUBST([ENABLE_LIBLZ4])
+
#### Checks for header files
# Common Checks (keep names sorted for ease of use):
diff --git a/src/Makefile_Eet.am b/src/Makefile_Eet.am
index d5a308b10c..44836ea21e 100644
--- a/src/Makefile_Eet.am
+++ b/src/Makefile_Eet.am
@@ -17,17 +17,21 @@ lib/eet/eet_image.c \
lib/eet/eet_lib.c \
lib/eet/eet_node.c \
lib/eet/eet_utils.c \
+#ifndef ENABLE_LIBLZ4
static_libs/lz4/lz4.c \
static_libs/lz4/lz4.h \
static_libs/lz4/lz4hc.c \
static_libs/lz4/lz4hc.h \
+#endif
static_libs/rg_etc/rg_etc1.c \
static_libs/rg_etc/rg_etc2.c \
static_libs/rg_etc/etc2_encoder.c \
static_libs/rg_etc/rg_etc1.h
lib_eet_libeet_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
+#ifndef ENABLE_LIBLZ4
-I$(top_srcdir)/src/static_libs/lz4 \
+#endif
-I$(top_srcdir)/src/static_libs/rg_etc \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
@@ -37,7 +41,9 @@ lib_eet_libeet_la_LIBADD = @EET_LIBS@ @EVIL_LIBS@
lib_eet_libeet_la_DEPENDENCIES = @EET_INTERNAL_LIBS@
lib_eet_libeet_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
+#ifndef ENABLE_LIBLZ4
EXTRA_DIST += static_libs/lz4/README
+#endif
### Binary
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index ceb5f6c9d2..ae3edc57b5 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -1865,30 +1865,38 @@ if EVAS_STATIC_BUILD_TGV
lib_evas_libevas_la_SOURCES += \
modules/evas/loaders/tgv/evas_image_load_tgv.c \
modules/evas/savers/tgv/evas_image_save_tgv.c \
-static_libs/rg_etc/rg_etc1.c \
-static_libs/rg_etc/rg_etc2.c \
-static_libs/rg_etc/rg_etc1.h \
-static_libs/rg_etc/etc2_encoder.c \
+#ifndef ENABLE_LIBLZ4
static_libs/lz4/lz4.c \
static_libs/lz4/lz4.h \
static_libs/lz4/lz4hc.c \
-static_libs/lz4/lz4hc.h
+static_libs/lz4/lz4hc.h \
+#endif
+static_libs/rg_etc/rg_etc1.c \
+static_libs/rg_etc/rg_etc2.c \
+static_libs/rg_etc/rg_etc1.h \
+static_libs/rg_etc/etc2_encoder.c
lib_evas_libevas_la_CPPFLAGS += \
+#ifndef ENABLE_LIBLZ4
-I$(top_srcdir)/src/static_libs/lz4 \
+#endif
-I$(top_srcdir)/src/static_libs/rg_etc \
@evas_image_loader_tgv_cflags@
lib_evas_libevas_la_LIBADD += @evas_image_loader_tgv_libs@
if EVAS_CSERVE2
bin_evas_evas_cserve2_slave_SOURCES += \
modules/evas/loaders/tgv/evas_image_load_tgv.c \
+#ifndef ENABLE_LIBLZ4
+static_libs/lz4/lz4.c \
+static_libs/lz4/lz4.h \
+#endif
static_libs/rg_etc/rg_etc1.c \
static_libs/rg_etc/rg_etc2.c \
-static_libs/rg_etc/rg_etc1.h \
-static_libs/lz4/lz4.c \
-static_libs/lz4/lz4.h
+static_libs/rg_etc/rg_etc1.h
bin_evas_evas_cserve2_slave_CPPFLAGS += \
-I$(top_builddir)/src/lib/efl \
+#ifndef ENABLE_LIBLZ4
-I$(top_srcdir)/src/static_libs/lz4 \
+#endif
-I$(top_srcdir)/src/static_libs/rg_etc \
-I$(top_srcdir)/src/lib/evas/ \
@evas_image_loader_tgv_cflags@
@@ -1899,14 +1907,18 @@ loadertgvpkgdir = $(libdir)/evas/modules/loaders/tgv/$(MODULE_ARCH)
loadertgvpkg_LTLIBRARIES = modules/evas/loaders/tgv/module.la
modules_evas_loaders_tgv_module_la_SOURCES = \
modules/evas/loaders/tgv/evas_image_load_tgv.c \
+#ifndef ENABLE_LIBLZ4
+static_libs/lz4/lz4.c \
+static_libs/lz4/lz4.h \
+#endif
static_libs/rg_etc/rg_etc1.c \
static_libs/rg_etc/rg_etc2.c \
-static_libs/rg_etc/rg_etc1.h \
-static_libs/lz4/lz4.c \
-static_libs/lz4/lz4.h
+static_libs/rg_etc/rg_etc1.h
modules_evas_loaders_tgv_module_la_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
+#ifndef ENABLE_LIBLZ4
-I$(top_srcdir)/src/static_libs/lz4 \
+#endif
-I$(top_srcdir)/src/static_libs/rg_etc \
-I$(top_srcdir)/src/lib/evas/ \
@EVAS_CFLAGS@ \
@@ -1922,16 +1934,20 @@ savertgvpkgdir = $(libdir)/evas/modules/savers/tgv/$(MODULE_ARCH)
savertgvpkg_LTLIBRARIES = modules/evas/savers/tgv/module.la
modules_evas_savers_tgv_module_la_SOURCES = \
modules/evas/savers/tgv/evas_image_save_tgv.c \
-static_libs/rg_etc/rg_etc1.c \
-static_libs/rg_etc/rg_etc1.h \
-static_libs/rg_etc/etc2_encoder.c \
+#ifndef ENABLE_LIBLZ4
static_libs/lz4/lz4.c \
static_libs/lz4/lz4.h \
static_libs/lz4/lz4hc.c \
-static_libs/lz4/lz4hc.h
+static_libs/lz4/lz4hc.h \
+#endif
+static_libs/rg_etc/rg_etc1.c \
+static_libs/rg_etc/rg_etc1.h \
+static_libs/rg_etc/etc2_encoder.c
modules_evas_savers_tgv_module_la_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
+#ifndef ENABLE_LIBLZ4
-I$(top_srcdir)/src/static_libs/lz4 \
+#endif
-I$(top_srcdir)/src/static_libs/rg_etc \
-I$(top_srcdir)/src/lib/evas/ \
@EVAS_CFLAGS@ \
diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c
index effe990666..1530f62284 100644
--- a/src/lib/eet/eet_image.c
+++ b/src/lib/eet/eet_image.c
@@ -25,8 +25,13 @@
#include "Eet.h"
#include "Eet_private.h"
-#include "lz4.h"
-#include "lz4hc.h"
+#ifdef ENABLE_LIBLZ4
+# include <lz4.h>
+# include <lz4hc.h>
+#else
+# include "lz4.h"
+# include "lz4hc.h"
+#endif
#include "rg_etc1.h"
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index 40fc366459..6135b3541b 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -44,8 +44,13 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
#include "Eet.h"
#include "Eet_private.h"
-#include "lz4.h"
-#include "lz4hc.h"
+#ifdef ENABLE_LIBLZ4
+# include <lz4.h>
+# include <lz4hc.h>
+#else
+# include "lz4.h"
+# include "lz4hc.h"
+#endif
#ifndef O_BINARY
# define O_BINARY 0
diff --git a/src/modules/evas/loaders/tgv/evas_image_load_tgv.c b/src/modules/evas/loaders/tgv/evas_image_load_tgv.c
index 20517ad610..878b758a2d 100644
--- a/src/modules/evas/loaders/tgv/evas_image_load_tgv.c
+++ b/src/modules/evas/loaders/tgv/evas_image_load_tgv.c
@@ -10,7 +10,12 @@
# include <winsock2.h>
#endif /* ifdef _WIN32 */
-#include "lz4.h"
+#ifdef ENABLE_LIBLZ4
+# include <lz4.h>
+#else
+# include "lz4.h"
+#endif
+
#include "rg_etc1.h"
#include "Evas_Loader.h"
diff --git a/src/modules/evas/savers/tgv/evas_image_save_tgv.c b/src/modules/evas/savers/tgv/evas_image_save_tgv.c
index b1ed42629f..6319d79380 100644
--- a/src/modules/evas/savers/tgv/evas_image_save_tgv.c
+++ b/src/modules/evas/savers/tgv/evas_image_save_tgv.c
@@ -9,8 +9,14 @@
# include <winsock2.h>
#endif /* ifdef _WIN32 */
-#include "lz4.h"
-#include "lz4hc.h"
+#ifdef ENABLE_LIBLZ4
+# include <lz4.h>
+# include <lz4hc.h>
+#else
+# include "lz4.h"
+# include "lz4hc.h"
+#endif
+
#include "rg_etc1.h"
// FIXME: Remove DEBUG