From: Martin Mares Date: Tue, 13 Jul 2010 12:43:06 +0000 (+0200) Subject: A partial build system X-Git-Tag: v5.0~161 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=784514e732274230794bb5145fddc8e17155948c;p=libucw.git A partial build system Compiles everything except for libshxml. --- diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..9fff0c45 --- /dev/null +++ b/Makefile @@ -0,0 +1,72 @@ +# Makefile for the UCW libraries +# (c) 2007--2010 Martin Mares + +# 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 index 00000000..4bc91c89 --- /dev/null +++ b/README @@ -0,0 +1,19 @@ +Sherlock Holmes Libraries 4.0 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +(c) 1997--2009 Martin Mares +(c) 2000--2009 Robert Spalek +(c) 2006--2009 Pavel Charvat +(c) 2008--2009 Michal Vaner +(c) 2008 Tomas Gavenciak + +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 index 00000000..79d60190 --- /dev/null +++ b/configure @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# Configure Script for UCW Libraries +# (c) 2007--2010 Martin Mares + +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 index 00000000..0fd308d2 --- /dev/null +++ b/default.cfg @@ -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; diff --git a/shxml/Makefile b/shxml/Makefile index 23e08b22..d974422e 100644 --- a/shxml/Makefile +++ b/shxml/Makefile @@ -1,45 +1,45 @@ # Makefile for the XML parser # (c) 2007 Pavel Charvat -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)