_*
*.swp
.make.log
+debian-tmp
ifndef CONFIG_LOCAL
install: all $(INSTALL_TARGETS)
+ /sbin/ldconfig -n $(DESTDIR)$(INSTALL_LIB_DIR)
else
install:
@echo "Nothing to install, this is a local build." && false
rm -rf tests run/{bin,lib,include,.tree-stamp,doc}
distclean:: clean
- rm -rf obj run
+ rm -rf obj run debian-tmp
testclean::
rm -f `find obj -name "*.test"`
DIRS+=charset
+LIBCHARSET_PROGS=
LIBCHARSET_MODS=toupper tolower tocat toligatures unaccent charconv setnames fb-charconv stk-charconv mp-charconv
LIBCHARSET_INCLUDES=charconv.h unicat.h fb-charconv.h stk-charconv.h mp-charconv.h
$(o)/charset/libucw-charset.a: $(addsuffix .o,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS)))
$(o)/charset/libucw-charset-pic.a: $(addsuffix .oo,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS)))
$(o)/charset/libucw-charset.so: $(addsuffix .oo,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS)))
-$(o)/charset/libucw-charset.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION)
+$(o)/charset/libucw-charset.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR)
$(o)/charset/libucw-charset.pc: $(LIBUCW)
ifdef CONFIG_STATIC_PIC
$(o)/charset/libucw-charset.pc: $(o)/charset/libucw-charset-pic.a
endif
ifdef CONFIG_INSTALL_API
-$(o)/charset/libucw-charset.pc: $(o)/charset/libucw-charset.a $(o)/charset/libucw-charset-pic.a $(o)/charset/libucw-charset.so
+$(o)/charset/libucw-charset.pc: $(addprefix $(o)/charset/libucw-charset,.a -pic.a .so)
endif
API_LIBS+=libucw-charset
run/lib/pkgconfig/libucw-charset.pc: $(o)/charset/libucw-charset.pc
ifdef CONFIG_CHARSET_UTILS
-PROGS+=$(o)/charset/cs2cs
+LIBCHARSET_PROGS+=$(o)/charset/ucw-cs2cs
endif
-$(o)/charset/cs2cs: $(o)/charset/cs2cs.o $(LIBUCW) $(o)/charset/libucw-charset.pc
+$(o)/charset/ucw-cs2cs: $(o)/charset/ucw-cs2cs.o $(LIBCHARSET)
+
+PROGS+=$(LIBCHARSET_PROGS)
build_charsets:
cd $(s)/charset && sh misc/generate
clean::
rm -f $(s)/charset/misc/u-*
-INSTALL_TARGETS+=install-libucw-charset install-libucw-charset-api
+INSTALL_TARGETS+=install-libucw-charset install-libucw-charset-api install-libucw-charset-utils
install-libucw-charset:
install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR)
- install -m 644 run/lib/libucw-charset.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)
+ install -m 644 run/lib/libucw-charset.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-charset.so.$(UCW_ABI_VERSION)
install-libucw-charset-api:
install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/charset $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
install -m 644 run/lib/libucw-charset.a $(DESTDIR)$(INSTALL_LIB_DIR)
install -m 644 run/lib/libucw-charset-pic.a $(DESTDIR)$(INSTALL_LIB_DIR)
-.PHONY: install-libucw-charset install-libucw-charset-api
+install-libucw-charset-utils:
+ install -d -m 755 $(DESTDIR)$(INSTALL_BIN_DIR)
+ install -m 755 $(LIBCHARSET_PROGS) $(DESTDIR)$(INSTALL_BIN_DIR)
+
+.PHONY: install-libucw-charset install-libucw-charset-api install-libucw-charset-utils
+++ /dev/null
-/*
- * Simple character set convertor
- *
- * (c) 1998 Pavel Machek <pavel@ucw.cz>
- * (c) 2003 Martin Mares <mj@ucw.cz>
- *
- * This software may be freely distributed and used according to the terms
- * of the GNU General Public License.
- */
-
-#include <ucw/lib.h>
-#include <charset/charconv.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#ifdef TEST
-#define BUFSIZE 13
-#else
-#define BUFSIZE 4096
-#endif
-
-int
-main(int argc, char **argv)
-{
- struct conv_context ctxt;
- int ch_from, ch_to, n, flags;
- char inbuf[BUFSIZE], outbuf[BUFSIZE];
-
- if (argc != 3)
- die("cs2cs in-charset out-charset");
- conv_init(&ctxt);
- ch_from = find_charset_by_name(argv[1]);
- if (ch_from < 0)
- die("Unknown charset %s", argv[1]);
- ch_to = find_charset_by_name(argv[2]);
- if (ch_to < 0)
- die("Unknown charset %s", argv[2]);
-
- conv_set_charset(&ctxt, ch_from, ch_to);
- while ((n = read(0, inbuf, sizeof(inbuf))) > 0)
- {
- ctxt.source = inbuf;
- ctxt.source_end = inbuf + n;
- ctxt.dest = ctxt.dest_start = outbuf;
- ctxt.dest_end = outbuf + sizeof(outbuf);
- do
- {
- flags = conv_run(&ctxt);
- if (flags & (CONV_SOURCE_END | CONV_DEST_END))
- {
- int w = write(1, ctxt.dest_start, ctxt.dest - ctxt.dest_start);
- if (w < 0)
- die("write error: %m");
- ctxt.dest = outbuf;
- }
- }
- while (! (flags & CONV_SOURCE_END));
- }
- if (n < 0)
- die("read error: %m");
- return 0;
-}
--- /dev/null
+/*
+ * Simple character set convertor
+ *
+ * (c) 1998 Pavel Machek <pavel@ucw.cz>
+ * (c) 2003 Martin Mares <mj@ucw.cz>
+ *
+ * This software may be freely distributed and used according to the terms
+ * of the GNU General Public License.
+ */
+
+#include <ucw/lib.h>
+#include <charset/charconv.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#ifdef TEST
+#define BUFSIZE 13
+#else
+#define BUFSIZE 4096
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct conv_context ctxt;
+ int ch_from, ch_to, n, flags;
+ char inbuf[BUFSIZE], outbuf[BUFSIZE];
+
+ if (argc != 3)
+ die("ucw-cs2cs in-charset out-charset");
+ conv_init(&ctxt);
+ ch_from = find_charset_by_name(argv[1]);
+ if (ch_from < 0)
+ die("Unknown charset %s", argv[1]);
+ ch_to = find_charset_by_name(argv[2]);
+ if (ch_to < 0)
+ die("Unknown charset %s", argv[2]);
+
+ conv_set_charset(&ctxt, ch_from, ch_to);
+ while ((n = read(0, inbuf, sizeof(inbuf))) > 0)
+ {
+ ctxt.source = inbuf;
+ ctxt.source_end = inbuf + n;
+ ctxt.dest = ctxt.dest_start = outbuf;
+ ctxt.dest_end = outbuf + sizeof(outbuf);
+ do
+ {
+ flags = conv_run(&ctxt);
+ if (flags & (CONV_SOURCE_END | CONV_DEST_END))
+ {
+ int w = write(1, ctxt.dest_start, ctxt.dest - ctxt.dest_start);
+ if (w < 0)
+ die("write error: %m");
+ ctxt.dest = outbuf;
+ }
+ }
+ while (! (flags & CONV_SOURCE_END));
+ }
+ if (n < 0)
+ die("read error: %m");
+ return 0;
+}
Set("CONFIG_DOC");
Set("CONFIG_CHARSET");
+Set("CONFIG_CHARSET_UTILS");
Set("CONFIG_XML");
Set("CONFIG_IMAGES");
UnSet("CONFIG_IMAGES_LIBUNGIF");
Build-Depends: debhelper (>= 7), devscripts, bash, pkg-config, libjpeg-dev, libpng-dev, libgif-dev, asciidoc
Standards-Version: 3.8.0
-Package: libucw-@UCW_ABI_VERSION@
+Package: libucw-@UCW_ABI_MAJOR@
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Package: libucw-dev
Section: libdevel
Architecture: any
-Depends: libucw-@UCW_ABI_VERSION@ (= @VER@), ${shlibs:Depends}, ${misc:Depends}
+Depends: libucw-@UCW_ABI_MAJOR@ (= @VER@), ${shlibs:Depends}, ${misc:Depends}
Description: LibUCW development files
Package: libucw-utils
dh_testroot
dh_clean -k
dh_installdirs
- $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-$(UCW_ABI_VERSION) $(addprefix install-,libucw libucw-charset libucw-xml libucw-images)
+ $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-$(UCW_ABI_MAJOR) $(addprefix install-,libucw libucw-charset libucw-xml libucw-images)
$(MAKE) DESTDIR=$(CURDIR)/debian/libucw-dev $(addprefix install-,$(addsuffix -api,libucw libucw-charset libucw-xml libucw-images))
- $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-utils install-ucw-utils install-ucw-shell install-libucw-images-utils
+ $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-utils install-ucw-utils install-ucw-shell install-libucw-charset-utils install-libucw-images-utils
$(MAKE) DESTDIR=$(CURDIR)/debian/libucw-doc install-libucw-docs
binary-indep: build install
LIBIMAGES_DEPS=$(LIBUCW)
endif
-ifdef CONFIG_INSTALL_API
-$(o)/images/libucw-images.pc: $(o)/images/libucw-images.a $(o)/images/libucw-images-pic.a $(o)/images/libucw-images.so
-endif
ifdef CONFIG_STATIC_PIC
LIBIMAGES_DEPS+=$(o)/images/libucw-images-pic.a
endif
+ifdef CONFIG_INSTALL_API
+$(o)/images/libucw-images.pc: $(addprefix $(o)/images/libucw-images,.a -pic.a .so)
+endif
ifdef CONFIG_IMAGES_DUP
LIBIMAGES_PROGS+=$(o)/images/ucw-image-dup-test
$(o)/images/libucw-images.a: $(addsuffix .o,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
$(o)/images/libucw-images-pic.a: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
$(o)/images/libucw-images.so: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
-$(o)/images/libucw-images.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION)
+$(o)/images/libucw-images.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR)
$(o)/images/libucw-images.pc: $(LIBIMAGES_DEPS)
$(o)/images/ucw-image-tool: $(o)/images/ucw-image-tool.o $(LIBIMAGES)
install-libucw-images:
install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR)
- install -m 644 run/lib/libucw-images.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)
+ install -m 644 run/lib/libucw-images.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-images.so.$(UCW_ABI_VERSION)
install-libucw-images-api:
- install -d -m 755 $(addprefix $(DESTDIR),$(INSTALL_BIN_DIR) $(INSTALL_INCLUDE_DIR)/images $(INSTALL_LIB_DIR) $(INSTALL_PKGCONFIG_DIR))
+ install -d -m 755 $(addprefix $(DESTDIR),$(INSTALL_INCLUDE_DIR)/images $(INSTALL_LIB_DIR) $(INSTALL_PKGCONFIG_DIR))
install -m 644 $(addprefix run/include/images/,$(LIBIMAGES_INCLUDES)) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/images
install -m 644 run/lib/pkgconfig/libucw-images.pc $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
ln -sf libucw-images.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-images.so
$(o)/ucw/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
$(o)/ucw/libucw-pic.a: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
$(o)/ucw/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
-$(o)/ucw/libucw.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION)
+$(o)/ucw/libucw.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR)
ifdef CONFIG_STATIC_PIC
$(o)/ucw/libucw.pc: $(o)/ucw/libucw-pic.a
endif
ifdef CONFIG_INSTALL_API
-$(o)/ucw/libucw.pc: $(o)/ucw/libucw.a $(o)/ucw/libucw-pic.a $(o)/ucw/libucw.so
+$(o)/ucw/libucw.pc: $(addprefix $(o)/ucw/libucw,.a -pic.a .so)
endif
$(o)/ucw/hashfunc.o $(o)/ucw/hashfunc.oo: CFLAGS += -funroll-loops
install-libucw:
install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR)
- install -m 644 run/lib/libucw.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)/
+ install -m 644 run/lib/libucw.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw.so.$(UCW_ABI_VERSION)
install-libucw-api:
install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw/ $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
# Version of the whole package
Set("UCW_VERSION" => "5.0-dev");
Set("UCW_VERSION_CODE" => 5000000);
-Set("UCW_ABI_VERSION" => "5.0");
+Set("UCW_ABI_VERSION" => Get("UCW_VERSION_CODE") . ".0");
# Compile everything with debug information and ASSERT's
UnSet("CONFIG_DEBUG");
}
}
+if (Get("UCW_ABI_VERSION") =~ /^(\d+)\.\d+(\.\d+)?$/) {
+ Set("UCW_ABI_MAJOR", $1);
+}
+else {
+ Fail("Invalid syntax of UCW_ABI_VERSION");
+}
+
PostConfig {
AtWrite {
UCW::Configure::C::ConfigHeader("ucw/autoconf.h", [
$(o)/xml/libucw-xml.a: $(addsuffix .o,$(LIBXML_MOD_PATHS))
$(o)/xml/libucw-xml-pic.a: $(addsuffix .oo,$(LIBXML_MOD_PATHS))
$(o)/xml/libucw-xml.so: $(addsuffix .oo,$(LIBXML_MOD_PATHS))
-$(o)/xml/libucw-xml.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION)
+$(o)/xml/libucw-xml.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR)
$(o)/xml/libucw-xml.pc: $(LIBCHARSET)
ifdef CONFIG_STATIC_PIC
$(o)/xml/libucw-xml.pc: $(o)/xml/libucw-xml-pic.a
endif
ifdef CONFIG_INSTALL_API
-$(o)/xml/libucw-xml.pc: $(o)/xml/libucw-xml.a $(o)/xml/libucw-xml-pic.a $(o)/xml/libucw-xml.so
+$(o)/xml/libucw-xml.pc: $(addprefix $(o)/xml/libucw-xml,.a -pic.a .so)
endif
$(o)/xml/common.o: $(o)/xml/unicat.h
install-libucw-xml:
install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR)
- install -m 644 run/lib/libucw-xml.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)
+ install -m 644 run/lib/libucw-xml.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-xml.so.$(UCW_ABI_VERSION)
install-libucw-xml-api:
install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/xml $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)