]> mj.ucw.cz Git - libucw.git/commitdiff
A partial build system
authorMartin Mares <mj@ucw.cz>
Tue, 13 Jul 2010 12:43:06 +0000 (14:43 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 13 Jul 2010 12:43:06 +0000 (14:43 +0200)
Compiles everything except for libshxml.

Makefile [new file with mode: 0644]
README [new file with mode: 0644]
configure [new file with mode: 0755]
default.cfg [new file with mode: 0644]
shxml/Makefile

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..9fff0c4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,72 @@
+# Makefile for the UCW libraries
+# (c) 2007--2010 Martin Mares <mj@ucw.cz>
+
+# The default target
+all: runtree libs api programs extras configs
+
+# Include configuration
+s=.
+-include obj/config.mk
+obj/config.mk:
+       @echo "You need to run configure first." && false
+
+BUILDSYS=$(s)/build
+
+# We will use the libucw build system
+include $(BUILDSYS)/Maketop
+
+CONFIG_SRC_DIR=etc
+TESTING_DEPS=$(LIBUCW)
+
+# Install the build system
+include $(BUILDSYS)/Makefile
+
+# Set up names of common libraries (to avoid forward references in rules)
+ifdef CONFIG_CHARSET
+LIBCHARSET=$(o)/charset/libcharset.pc
+endif
+ifdef CONFIG_SHXML
+LIBSHXML=$(o)/shxml/libshxml.pc
+endif
+
+# The UCW library
+include $(s)/ucw/Makefile
+
+# Install config files
+ifdef CONFIG_SHERLOCK_LIB
+FREE_CONFIGS=sherlock local
+CONFIGS+=$(FREE_CONFIGS)
+
+INSTALL_TARGETS+=install-configs
+install-configs:
+       install -d -m 755 $(DESTDIR)$(INSTALL_CONFIG_DIR)
+       install -m 644 $(addprefix run/$(CONFIG_DIR)/,$(FREE_CONFIGS)) $(DESTDIR)$(INSTALL_CONFIG_DIR)
+endif
+
+# Include submakefiles of requested libraries
+ifdef CONFIG_CHARSET
+include $(s)/charset/Makefile
+endif
+
+ifdef CONFIG_IMAGES
+LIBIMAGES=$(o)/images/libimages.pc
+include $(s)/images/Makefile
+endif
+
+# Build documentation by default?
+ifdef CONFIG_DOC
+all: docs
+endif
+
+libs: $(LIBUCW) $(LIBSHXML) $(LIBIMAGES) $(LIBCHARSET)
+
+# And finally the default rules of the build system
+include $(BUILDSYS)/Makebottom
+
+ifndef CONFIG_LOCAL
+install: all $(INSTALL_TARGETS)
+else
+install:
+       @echo "Nothing to install, this is a local build." && false
+endif
+.PHONY: install
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..4bc91c8
--- /dev/null
+++ b/README
@@ -0,0 +1,19 @@
+Sherlock Holmes Libraries 4.0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+(c) 1997--2009 Martin Mares <mj@ucw.cz>
+(c) 2000--2009 Robert Spalek <robert@ucw.cz>
+(c) 2006--2009 Pavel Charvat <pchar@ucw.cz>
+(c) 2008--2009 Michal Vaner <vorner@ucw.cz>
+(c) 2008 Tomas Gavenciak <gavento@ucw.cz>
+
+This package contains all libraries from the freely distributable version
+of the Sherlock Holmes search engine (see http://www.ucw.cz/holmes/).
+
+See doc/using-libs for description of the libraries.
+
+See doc/install.html for build requirements and instructions.
+
+See doc/configure.html if you want to tweak build options.
+
+After you compile the library, you can issue `make docs' to build the API
+documentation. It will appear in run/doc. (It is not complete yet, though.)
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..79d6019
--- /dev/null
+++ b/configure
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+# Configure Script for UCW Libraries
+# (c) 2007--2010 Martin Mares <mj@ucw.cz>
+
+use warnings;
+use strict;
+
+our $srcdir;
+BEGIN {
+       my $pkgfile = "ucw/wildmatch.c";
+       if (!defined ($srcdir = $ENV{"SRCDIR"})) {
+               if (-f $pkgfile) {
+                       $srcdir=".";
+               } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
+                       $srcdir=$1;
+               } else {
+                       die "Don't know how to find myself. Please set SRCDIR manually.\n";
+               }
+       }
+}
+
+use lib "$srcdir/ucw/perl/";
+use UCW::Configure;
+
+Init($srcdir, "default.cfg");
+Include "ucw/default.cfg";
+Log "### Configuring UCW Libraries " . Get("UCW_VERSION") . " with configuration " . Get("CONFIG") . "\n";
+Include Get("CONFIG");
+require UCW::Configure::Paths;
+require UCW::Configure::C;
+require UCW::Configure::LibUCW;
+require UCW::Configure::Doc;
+Finish();
+
+Log "\nConfigured, run `make' to build everything.\n";
diff --git a/default.cfg b/default.cfg
new file mode 100644 (file)
index 0000000..0fd308d
--- /dev/null
@@ -0,0 +1,32 @@
+# Default configuration of UCW libraries
+# (see */default.cfg for the description of all options)
+
+# Do we want shared or static libraries?
+Set("CONFIG_SHARED");
+
+# We want the public API
+Set("CONFIG_INSTALL_API");
+
+# Libucw should support files >2GB and threading
+Set("CONFIG_LARGE_FILES");
+Set("CONFIG_UCW_THREADS" => 1);
+
+# Libucw extensions
+Set("CONFIG_UCW_PERL" => 1);
+Set("CONFIG_UCW_PERL_MODULES" => 1);
+Set("CONFIG_UCW_SHELL_UTILS" => 1);
+Set("CONFIG_UCW_UTILS" => 1);
+
+# 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");
+
+# Libcharset
+Set("CONFIG_CHARSET");
+
+# Return success
+1;
index 23e08b22b6e75b070ab47b2e961274d193502a1f..d974422edcf060417200fc89bf58da8c4877d6c4 100644 (file)
@@ -1,45 +1,45 @@
 # Makefile for the XML parser
 # (c) 2007 Pavel Charvat <pchar@ucw.cz>
 
-DIRS+=sherlock/xml
-PROGS+=$(o)/sherlock/xml/xml-test
+DIRS+=shxml
+PROGS+=$(o)/shxml/xml-test
 
 LIBSHXML_MODS=common source parse dtd
 LIBSHXML_INCLUDES=xml.h dtd.h
 
-LIBSHXML_MOD_PATHS=$(addprefix $(o)/sherlock/xml/,$(LIBSHXML_MODS))
-
-$(o)/sherlock/xml/libshxml.a: $(addsuffix .o,$(LIBSHXML_MOD_PATHS))
-$(o)/sherlock/xml/libshxml.so: $(addsuffix .oo,$(LIBSHXML_MOD_PATHS))
-$(o)/sherlock/xml/libshxml.pc: $(LIBSH) $(LIBCHARSET)
-
-$(o)/sherlock/xml/common.o: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/common.oo: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/source.o: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/source.oo: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/dtd.o: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/dtd.oo: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/parse.o: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/parse.oo: $(o)/sherlock/xml/unicat.h
-$(o)/sherlock/xml/unicat.h: $(s)/sherlock/xml/unicat.pl
-       $(M)GEN $(addprefix $(o)/sherlock/xml/unicat,.h .c)
-       $(Q)$< $(addprefix $(o)/sherlock/xml/unicat,.h .c)
+LIBSHXML_MOD_PATHS=$(addprefix $(o)/shxml/,$(LIBSHXML_MODS))
+
+$(o)/shxml/libshxml.a: $(addsuffix .o,$(LIBSHXML_MOD_PATHS))
+$(o)/shxml/libshxml.so: $(addsuffix .oo,$(LIBSHXML_MOD_PATHS))
+$(o)/shxml/libshxml.pc: $(LIBSH) $(LIBCHARSET)
+
+$(o)/shxml/common.o: $(o)/shxml/unicat.h
+$(o)/shxml/common.oo: $(o)/shxml/unicat.h
+$(o)/shxml/source.o: $(o)/shxml/unicat.h
+$(o)/shxml/source.oo: $(o)/shxml/unicat.h
+$(o)/shxml/dtd.o: $(o)/shxml/unicat.h
+$(o)/shxml/dtd.oo: $(o)/shxml/unicat.h
+$(o)/shxml/parse.o: $(o)/shxml/unicat.h
+$(o)/shxml/parse.oo: $(o)/shxml/unicat.h
+$(o)/shxml/unicat.h: $(s)/shxml/unicat.pl
+       $(M)GEN $(addprefix $(o)/shxml/unicat,.h .c)
+       $(Q)$< $(addprefix $(o)/shxml/unicat,.h .c)
        $(Q)touch $@
 
-TESTS+=$(o)/sherlock/xml/xml-test.test
-$(o)/sherlock/xml/xml-test: $(o)/sherlock/xml/xml-test.o $(LIBSHXML)
-$(o)/sherlock/xml/xml-test.test: $(o)/sherlock/xml/xml-test
+TESTS+=$(o)/shxml/xml-test.test
+$(o)/shxml/xml-test: $(o)/shxml/xml-test.o $(LIBSHXML)
+$(o)/shxml/xml-test.test: $(o)/shxml/xml-test
 
 API_LIBS+=libshxml
-API_INCLUDES+=$(o)/sherlock/xml/.include-stamp
-$(o)/sherlock/xml/.include-stamp: $(addprefix $(s)/sherlock/xml/,$(LIBSHXML_INCLUDES))
-$(o)/sherlock/xml/.include-stamp: IDST=sherlock/xml
-run/lib/pkgconfig/libshxml.pc: $(o)/sherlock/xml/libshxml.pc
+API_INCLUDES+=$(o)/shxml/.include-stamp
+$(o)/shxml/.include-stamp: $(addprefix $(s)/shxml/,$(LIBSHXML_INCLUDES))
+$(o)/shxml/.include-stamp: IDST=shxml
+run/lib/pkgconfig/libshxml.pc: $(o)/shxml/libshxml.pc
 
 INSTALL_TARGETS+=install-sh-xml
 install-sh-xml:
-       install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/sherlock/xml $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
-       install -m 644 $(addprefix run/include/sherlock/xml/,$(LIBSHXML_INCLUDES)) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/sherlock/xml
+       install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/shxml $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
+       install -m 644 $(addprefix run/include/shxml/,$(LIBSHXML_INCLUDES)) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/shxml
        install -m 644 run/lib/pkgconfig/libshxml.pc $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
        install -m 644 run/lib/libshxml.$(LS) $(DESTDIR)$(INSTALL_LIB_DIR)