]> mj.ucw.cz Git - libucw.git/commitdiff
Options to include separate libraries in build
authorMichal Vaner <vorner@ucw.cz>
Sun, 23 Nov 2008 16:31:50 +0000 (17:31 +0100)
committerMichal Vaner <vorner@ucw.cz>
Sun, 23 Nov 2008 16:31:50 +0000 (17:31 +0100)
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
free/libs/default.cfg
ucw/kmp-test.c

index 5b69935473f6129c1ec796988981b9b87d64a19b..430977eb28ea4afdd2109101b052f37df227f1f6 100644 (file)
@@ -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
index eb60cd3e21a7adbf3e10af892443a1213be03713..51e973f84317ce52e0685087a4137ab4768acf74 100644 (file)
@@ -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;
index cb18d03229234f6db7ffe44f24cb491eeeaf0633..ec34ce7e1193ed094ad8d8f5843058c99b968992 100644 (file)
@@ -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();