From a8062ed32936330edd8d562cdbf20ee77c0c062d Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 23 Nov 2008 17:31:50 +0100 Subject: [PATCH] Options to include separate libraries in build Added new options CONFIG_CHARSET and CONFIG_SHERLOCK_LIB to makefiles & configure. CONFIG_UCW_ONLY now works only as a shortcut for excluding all other libraries. Updated libs-only distribution and libsonly custom to use these switches. --- free/libs/Makefile | 25 ++++++++++++------------- free/libs/default.cfg | 37 ++++++++++++++++++++++--------------- ucw/kmp-test.c | 4 ++-- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/free/libs/Makefile b/free/libs/Makefile index 5b699354..430977eb 100644 --- a/free/libs/Makefile +++ b/free/libs/Makefile @@ -18,22 +18,23 @@ include $(BUILDSYS)/Maketop # Install the build system include $(BUILDSYS)/Makefile -ifndef CONFIG_UCW_ONLY # Set up names of common libraries (to avoid forward references in rules) +ifdef CONFIG_CHARSET LIBCHARSET=$(o)/charset/libcharset.pc +endif +ifdef CONFIG_SHERLOCK_LIB LIBSH=$(o)/sherlock/libsh.pc LIBSHXML=$(o)/sherlock/xml/libshxml.pc +TESTING_DEPS=$(LIBSH) +else +TESTING_DEPS=$(LIBUCW) endif # The UCW library include $(s)/ucw/Makefile -# Stripped down version -ifndef CONFIG_UCW_ONLY - -TESTING_DEPS=$(LIBSH) - # Install config files +ifdef CONFIG_SHERLOCK_LIB FREE_CONFIGS=sherlock local CONFIGS+=$(FREE_CONFIGS) @@ -42,9 +43,13 @@ install-configs: install -d -m 755 $(DESTDIR)$(INSTALL_CONFIG_DIR) install -m 644 $(addprefix run/$(CONFIG_DIR)/,$(FREE_CONFIGS)) $(DESTDIR)$(INSTALL_CONFIG_DIR) +include $(s)/sherlock/Makefile +endif + +ifdef CONFIG_CHARSET # Include makefiles of libraries we wish to use include $(s)/charset/Makefile -include $(s)/sherlock/Makefile +endif ifdef CONFIG_LANG LIBLANG=$(o)/lang/liblang.pc @@ -56,12 +61,6 @@ LIBIMAGES=$(o)/images/libimages.pc include $(s)/images/Makefile endif -else - -TESTING_DEPS=$(LIBUCW) - -endif - # Build documentation by default? ifdef CONFIG_DOC all: docs diff --git a/free/libs/default.cfg b/free/libs/default.cfg index eb60cd3e..51e973f8 100644 --- a/free/libs/default.cfg +++ b/free/libs/default.cfg @@ -16,21 +16,28 @@ Set("CONFIG_UCW_PERL_MODULES" => 1); Set("CONFIG_UCW_SHELL_UTILS" => 1); Set("CONFIG_UCW_UTILS" => 1); -# Libsh settings -Set("CONFIG_BUCKET_SHIFT" => 6); - -# Liblang settings -Set("CONFIG_LANG"); -Set("MAX_WORD_CHARS" => 64); -Set("MAX_WORD_BYTES" => 192); - -# Libimages settings -Set("CONFIG_IMAGES"); -Set("CONFIG_IMAGES_LIBJPEG"); -Set("CONFIG_IMAGES_LIBPNG"); -Set("CONFIG_IMAGES_LIBUNGIF"); -UnSet("CONFIG_IMAGES_LIBGIF"); -UnSet("CONFIG_IMAGES_LIBMAGICK"); +if(!IsSet("CONFIG_UCW_ONLY")) { + # Libsh settings + Set("CONFIG_BUCKET_SHIFT" => 6); + Set("CONFIG_SHERLOCK_LIB"); + + if(!IsGiven("CONFIG_CHARSET") || IsSet("CONFIG_CHARSET")) { + # Liblang settings + Set("CONFIG_LANG"); + Set("MAX_WORD_CHARS" => 64); + Set("MAX_WORD_BYTES" => 192); + } + + # Libimages settings + Set("CONFIG_IMAGES"); + Set("CONFIG_IMAGES_LIBJPEG"); + Set("CONFIG_IMAGES_LIBPNG"); + Set("CONFIG_IMAGES_LIBUNGIF"); + UnSet("CONFIG_IMAGES_LIBGIF"); + UnSet("CONFIG_IMAGES_LIBMAGICK"); + + Set("CONFIG_CHARSET"); +} # Return success 1; diff --git a/ucw/kmp-test.c b/ucw/kmp-test.c index cb18d032..ec34ce7e 100644 --- a/ucw/kmp-test.c +++ b/ucw/kmp-test.c @@ -50,7 +50,7 @@ test1(void) kmp1_cleanup(&kmp); } -#ifndef CONFIG_UCW_ONLY /* This one depends on LIBCHARSET */ +#ifdef CONFIG_CHARSET /* This one depends on LIBCHARSET */ /* TEST2 - various tracing */ @@ -203,7 +203,7 @@ int main(void) { test1(); -#ifndef CONFIG_UCW_ONLY +#ifdef CONFIG_CHARSET test2(); #endif test3(); -- 2.39.5