From: Mark Wooding Date: Sun, 3 May 2009 00:40:25 +0000 (+0100) Subject: Infrastructure: Split the files into subdirectories. X-Git-Tag: 2.2.0~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/commitdiff_plain/18c831dcd0ae4d660c70ccac69d27ed2a97851be Infrastructure: Split the files into subdirectories. This makes the file tree rather easier to work with. --- diff --git a/.links b/.links index 7277314..f660b62 100644 --- a/.links +++ b/.links @@ -1,7 +1,7 @@ config/maninst config/auto-version config/confsubst -mdwopt.c -mdwopt.h +ui/mdwopt.c +ui/mdwopt.h COPYING COPYING.LIB diff --git a/Makefile.am b/Makefile.am index 5e7f7fd..66185ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ -### -*-Makefile-*- +### -*-makefile-*- ### -### Building the distribution +### Top-level build for mLib ### -### (c) 1998 Straylight/Edgeware +### (c) 2009 Straylight/Edgeware ### ###----- Licensing notice --------------------------------------------------- @@ -24,38 +24,21 @@ ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ### MA 02111-1307, USA. -pkglibexecdir = $(libexecdir)/$(PACKAGE) +include $(top_srcdir)/vars.am SUBDIRS = -BUILT_SOURCES = -bin_PROGRAMS = -check_PROGRAMS = -lib_LTLIBRARIES = -noinst_LTLIBRARIES = -pkglibexec_PROGRAMS = -pkginclude_HEADERS = -EXTRA_DIST = -CLEANFILES = -DISTCLEANFILES = -PROGMANS = -LIBMANS = - -confsubst = $(top_srcdir)/config/confsubst - -SUBSTITUTIONS = \ - prefix=$(prefix) exec_prefix=$(exec_prefix) \ - libdir=$(libdir) includedir=$(includedir) \ - bindir=$(bindir) sbindir=$(sbindir) \ - PACKAGE=$(PACKAGE) VERSION=$(VERSION) ###-------------------------------------------------------------------------- -### Library. +### Top-level library. -lib_LTLIBRARIES += libmLib.la +lib_LTLIBRARIES = libmLib.la libmLib_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO) libmLib_la_SOURCES = libmLib_la_LIBADD = +###-------------------------------------------------------------------------- +### Package-configuration file. + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mLib.pc EXTRA_DIST += mLib.pc.in @@ -66,464 +49,54 @@ mLib.pc: mLib.pc.in Makefile mv $@.new $@ ###-------------------------------------------------------------------------- -### Testing. - -check: tests -.PHONY: check tests - -TEST_CPPFLAGS = -DTEST_RIG -DSRCDIR="\"(srcdir)\"" $(AM_CPPFLAGS) - -LDADD = libmLib.la - -###-------------------------------------------------------------------------- -### Utilities. - -noinst_LTLIBRARIES += libutils.la -libutils_la_SOURCES = -libutils_la_LIBADD = -libmLib_la_LIBADD += libutils.la - -## Utility macros. -pkginclude_HEADERS += macros.h -LIBMANS += macros.3 - -## Alignment. -pkginclude_HEADERS += align.h -LIBMANS += align.3 - -## Bit manipulation. -pkginclude_HEADERS += bits.h -LIBMANS += bits.3 - -EXTRA_DIST += bits.in bits-testgen.c -tests:: bits.t bits.in - ./bits.t -f $(srcdir)/bits.in - -check_PROGRAMS += bits.t -bits_t_SOURCES = bits.c -bits_t_CPPFLAGS = $(TEST_CPPFLAGS) -bits_t_LDFLAGS = -static - -## Exceptions. -pkginclude_HEADERS += exc.h -libmLib_la_SOURCES += exc.c -LIBMANS += exc.3 - -## String handling. -pkginclude_HEADERS += str.h -libutils_la_SOURCES += str.c -LIBMANS += str.3 - -## Version comparison. -pkginclude_HEADERS += versioncmp.h -libmLib_la_SOURCES += versioncmp.c -LIBMANS += versioncmp.3 - -EXTRA_DIST += versioncmp.in -tests:: versioncmp.t versioncmp.in - ./versioncmp.t -f $(srcdir)/versioncmp.in - -check_PROGRAMS += versioncmp.t -versioncmp_t_SOURCES = versioncmp-test.c -versioncmp_t_CPPFLAGS = $(TEST_CPPFLAGS) -versioncmp_t_LDFLAGS = -static +### Subdirectories. +### +### Note: There are implicit dependencies between the subdirectories. Be +### careful about reordering them. -###-------------------------------------------------------------------------- -### Memory allocation. +## Utilities. +SUBDIRS += utils +libmLib_la_LIBADD += utils/libutils.la ## Memory allocation. -pkginclude_HEADERS += alloc.h arena.h sub.h -libmLib_la_SOURCES += alloc.c arena.c sub.c -LIBMANS += alloc.3 arena.3 sub.3 - -## Pool allocator. -pkginclude_HEADERS += pool.h -libmLib_la_SOURCES += pool.c pool-file.c pool-sub.c -LIBMANS += pool.3 - -###-------------------------------------------------------------------------- -### Hashing. +SUBDIRS += mem +libmLib_la_LIBADD += mem/libmem.la -## CRC32. -pkginclude_HEADERS += crc32.h -libmLib_la_SOURCES += crc32.c crc32-tab.c -LIBMANS += crc32.3 +## User interface. +SUBDIRS += ui +libmLib_la_LIBADD += ui/libui.la -bin_PROGRAMS += crc-mktab -crc_mktab_SOURCES = crc-mktab.c $(UTIL_SOURCES) -crc_mktab_LDADD = libutils.la -PROGMANS += crc-mktab.1 +## Hashing. +SUBDIRS += hash +libmLib_la_LIBADD += hash/libhash.la -BUILT_SOURCES += crc32-tab.c -CLEANFILES += crc32-tab.c -crc32-tab.c: crc-mktab$(EXEEXT) - ./crc-mktab -o $@.new \ - -p0x04c11db7 -b32 -B8 -r -c \ - -scrc32_table -icrc32.h -tuint32 && \ - mv $@.new $@ +## Data structures. +SUBDIRS += struct +libmLib_la_LIBADD += struct/libstruct.la -## Universal hashing. -pkginclude_HEADERS += unihash.h -libutils_la_SOURCES += unihash.c -libmLib_la_SOURCES += unihash-global.c -BUILT_SOURCES += unihash-global.c -LIBMANS += unihash.3 +## Encoding and decoding. +SUBDIRS += codec +libmLib_la_LIBADD += codec/libcodec.la -bin_PROGRAMS += unihash-mkstatic -unihash_mkstatic_SOURCES = unihash-mkstatic.c -unihash_mkstatic_LDADD = libutils.la -PROGMANS += unihash-mkstatic.1 +## System utilities. +SUBDIRS += sys +libmLib_la_LIBADD += sys/libsys.la -BUILT_SOURCES += unihash-global.c -CLEANFILES += unihash-global.c -unihash-global.c: unihash-mkstatic$(EXEEXT) - ./unihash-mkstatic -c -sunihash_global -iunihash.h -o$@.new && \ - mv $@.new $@ - -check_PROGRAMS += unihash.t -unihash_t_SOURCES = unihash.c -unihash_t_CPPFLAGS = $(TEST_CPPFLAGS) -unihash_t_LDFLAGS = -static - -tests:: unihash.t unihash.in - ./unihash.t -f unihash.in - -EXTRA_DIST += unihash-check.pl -CLEANFILES += unihash.in -unihash.in: unihash-check.pl - perl $(srcdir)/unihash-check.pl >$@.new && mv $@.new $@ - -###-------------------------------------------------------------------------- -### Data structures. - -## Dynamic strings. -pkginclude_HEADERS += dstr.h dspool.h -libmLib_la_SOURCES += dstr.c dputf.c dspool.c -LIBMANS += dstr.3 dspool.3 - -## Buffers. -pkginclude_HEADERS += buf.h -libmLib_la_SOURCES += buf.c buf-dstr.c -LIBMANS += buf.3 - -## Dynamic arrays. -pkginclude_HEADERS += darray.h -libmLib_la_SOURCES += darray.c -LIBMANS += darray.3 - -CLEANFILES += da.out -tests:: darray.t da.in da.ref - ./darray.t da.out - cmp da.out da.ref - @echo "darray OK" - -check_PROGRAMS += darray.t -darray_t_SOURCES = da-test.c -darray_t_CPPFLAGS = $(TEST_CPPFLAGS) -darray_t_LDFLAGS = -static - -EXTRA_DIST += da-gtest -CLEANFILES += da.in -da.in: da-gtest - perl $(srcdir)/da-gtest 10000 >$@.new && mv $@.new $@ - -EXTRA_DIST += da-ref -CLEANFILES += da.ref -da.ref: da-ref da.in - perl $(srcdir)/da-ref $@.new && mv $@.new $@ - -## Hash tables. -pkginclude_HEADERS += hash.h -libmLib_la_SOURCES += hash.c -LIBMANS += hash.3 - -## Symbol tables. -pkginclude_HEADERS += sym.h -libmLib_la_SOURCES += sym.c -LIBMANS += sym.3 - -CLEANFILES += sym.out -tests:: sym.t sym.in sym.ref - ./sym.t sym.out - cmp sym.out sym.ref - @echo "sym OK" - -check_PROGRAMS += sym.t -sym_t_SOURCES = sym-test.c -sym_t_CPPFLAGS = $(TEST_CPPFLAGS) -sym_t_LDFLAGS = -static - -EXTRA_DIST += sym-gtest -CLEANFILES += sym.in -sym.in: sym-gtest - perl $(srcdir)/sym-gtest 10000 >$@.new && mv $@.new $@ - -EXTRA_DIST += sym-ref -CLEANFILES += sym.ref -sym.ref: sym-ref sym.in - perl $(srcdir)/sym-ref $@.new && mv $@.new $@ - -## Atoms. -pkginclude_HEADERS += atom.h -libmLib_la_SOURCES += atom.c -LIBMANS += atom.3 - -## Association tables. -pkginclude_HEADERS += assoc.h -libmLib_la_SOURCES += assoc.c -LIBMANS += assoc.3 - -CLEANFILES += assoc.out -tests:: assoc.t sym.in sym.ref - ./assoc.t assoc.out - cmp assoc.out sym.ref - @echo "sym OK" - -check_PROGRAMS += assoc.t -assoc_t_SOURCES = assoc-test.c -assoc_t_CPPFLAGS = $(TEST_CPPFLAGS) -assoc_t_LDFLAGS = -static - -###-------------------------------------------------------------------------- -### User interface. +## Buffering. +SUBDIRS += buf +libmLib_la_LIBADD += buf/libbuf.la -## Option parsing. -noinst_LTLIBRARIES += libmdwopt.la -pkginclude_HEADERS += mdwopt.h -libmdwopt_la_SOURCES = mdwopt.c -libmdwopt_la_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_MLIB -libutils_la_LIBADD += libmdwopt.la -LIBMANS += mdwopt.3 - -## Program naming. -pkginclude_HEADERS += quis.h -libutils_la_SOURCES += quis.c pquis.c -LIBMANS += quis.3 - -## Error reporting. -pkginclude_HEADERS += report.h -libutils_la_SOURCES += report.c -LIBMANS += report.3 - -###-------------------------------------------------------------------------- -### Encoding and decoding. - -## form-urlencoded -pkginclude_HEADERS += url.h -libmLib_la_SOURCES += url.c -LIBMANS += url.3 - -## base64 -pkginclude_HEADERS += base64.h -libmLib_la_SOURCES += base64.c -LIBMANS += base64.3 - -EXTRA_DIST += base64.in base64.ref -CLEANFILES += base64.out -tests:: base64.t base64.in base64.ref - ./base64.t <$(srcdir)/base64.in >base64.out - cmp base64.out $(srcdir)/base64.ref - ./base64.t -d <$(srcdir)/base64.ref >base64.out - cmp base64.out $(srcdir)/base64.in - @echo "base64 OK" - -check_PROGRAMS += base64.t -base64_t_SOURCES = base64.c -base64_t_CPPFLAGS = $(TEST_CPPFLAGS) -base64_t_LDFLAGS = -static - -## base32 -pkginclude_HEADERS += base32.h -libmLib_la_SOURCES += base32.c -LIBMANS += base32.3 - -EXTRA_DIST += base32.in base32.ref -CLEANFILES += base32.out -tests:: base32.t base32.in base32.ref - ./base32.t <$(srcdir)/base32.in >base32.out - cmp base32.out $(srcdir)/base32.ref - ./base32.t -d <$(srcdir)/base32.ref >base32.out - cmp base32.out $(srcdir)/base32.in - @echo "base32 OK" - -check_PROGRAMS += base32.t -base32_t_SOURCES = base32.c -base32_t_CPPFLAGS = $(TEST_CPPFLAGS) -base32_t_LDFLAGS = -static - -## hex -pkginclude_HEADERS += hex.h -libmLib_la_SOURCES += hex.c -LIBMANS += hex.3 - -EXTRA_DIST += hex.in hex.ref -CLEANFILES += hex.out -tests:: hex.t hex.in hex.ref - ./hex.t <$(srcdir)/hex.in >hex.out - cmp hex.out $(srcdir)/hex.ref - ./hex.t -d <$(srcdir)/hex.ref >hex.out - cmp hex.out $(srcdir)/hex.in - @echo "hex OK" - -check_PROGRAMS += hex.t -hex_t_SOURCES = hex.c -hex_t_CPPFLAGS = $(TEST_CPPFLAGS) -hex_t_LDFLAGS = -static - -###-------------------------------------------------------------------------- -### System utilities. - -## Daemons. -pkginclude_HEADERS += daemonize.h -libmLib_la_SOURCES += daemonize.c -LIBMANS += daemonize.3 - -## Environment variables. -pkginclude_HEADERS += env.h -libmLib_la_SOURCES += env.c -LIBMANS += env.3 - -## File and descriptor flags. -pkginclude_HEADERS += fdflags.h -libmLib_la_SOURCES += fdflags.c -LIBMANS += fdflags.3 - -## File descriptor passing. -pkginclude_HEADERS += fdpass.h -libmLib_la_SOURCES += fdpass.c -LIBMANS += fdpass.3 - -## Watching files for modification. -pkginclude_HEADERS += fwatch.h -libmLib_la_SOURCES += fwatch.c -LIBMANS += fwatch.3 - -## File locking. -pkginclude_HEADERS += lock.h -libmLib_la_SOURCES += lock.c -LIBMANS += lock.3 - -## File descriptor juggling. -pkginclude_HEADERS += mdup.h -libmLib_la_SOURCES += mdup.c -LIBMANS += mdup.3 - -check_PROGRAMS += mdup.t -mdup_t_SOURCES = mdup-test.c -mdup_t_CPPFLAGS = $(TEST_CPPFLAGS) -mdup_t_LDFLAGS = -static - -EXTRA_DIST += mdup-test.sh -CLEANFILES += mdup.[0-9]*.out mdup.[0-9]*.err -tests:: mdup.t mdup-test.sh - $(srcdir)/mdup-test.sh - -## Time arithmetic. -pkginclude_HEADERS += tv.h -libmLib_la_SOURCES += tv.c -LIBMANS += tv.3 - -###-------------------------------------------------------------------------- -### Buffering. - -## Line buffering. -pkginclude_HEADERS += lbuf.h -libmLib_la_SOURCES += lbuf.c -LIBMANS += lbuf.3 - -## Packet buffering. -pkginclude_HEADERS += pkbuf.h -libmLib_la_SOURCES += pkbuf.c -LIBMANS += pkbuf.3 - -###-------------------------------------------------------------------------- -### Network utilities. - -## Core event selection. -pkginclude_HEADERS += sel.h -libmLib_la_SOURCES += sel.c -LIBMANS += sel.3 - -## Waiting for buffers to fill. -pkginclude_HEADERS += selbuf.h selpk.h -libmLib_la_SOURCES += selbuf.c selpk.c -LIBMANS += selbuf.3 selpk.3 - -## RFC931 identification. -pkginclude_HEADERS += ident.h -libmLib_la_SOURCES += ident.c -LIBMANS += ident.3 - -## Nonblocking connections. -pkginclude_HEADERS += conn.h -libmLib_la_SOURCES += conn.c -LIBMANS += conn.3 - -## Signal handling -pkginclude_HEADERS += sig.h -libmLib_la_SOURCES += sig.c -LIBMANS += sig.3 - -## Name resolution. -pkginclude_HEADERS += bres.h -LIBMANS += bres.3 - -if WITH_ADNS -libmLib_la_SOURCES += bres-adns.c -else -libmLib_la_SOURCES += bres.c -pkglibexec_PROGRAMS += bres -bres_SOURCES = bres.c -bres_CPPFLAGS = -DBRES_STANDALONE $(AM_CPPFLAGS) -bres_LDADD = -endif - -###-------------------------------------------------------------------------- -### Testing and debugging. - -## Tracing. -pkginclude_HEADERS += trace.h -libmLib_la_SOURCES += trace.c traceopt.c -LIBMANS += trace.3 - -## Memory tracking. -pkginclude_HEADERS += track.h -libmLib_la_SOURCES += track.c +## Event-driven networking. +SUBDIRS += sel +libmLib_la_LIBADD += sel/libsel.la ## Testing. -pkginclude_HEADERS += testrig.h -libmLib_la_SOURCES += testrig.c -LIBMANS += testrig.3 - -###-------------------------------------------------------------------------- -### Manual. +SUBDIRS += test +libmLib_la_LIBADD += test/libtest.la -EXTRA_DIST += $(LIBMANS) $(PROGMANS) - -install-data-local: install-man -install-man: $(LIBMANS) $(PROGMANS) - @$(NORMAL_INSTALL) - $(mkdir_p) $(DESTDIR)$(mandir) - $(top_srcdir)/config/maninst \ - -d $(DESTDIR)$(mandir) -s $(srcdir) \ - -i "$(INSTALL)" \ - install $(PROGMANS) - $(top_srcdir)/config/maninst \ - -d $(DESTDIR)$(mandir) -s $(srcdir) \ - -i "$(INSTALL)" -e $(manext) \ - install $(LIBMANS) -.PHONY: install-man - -uninstall-local: uninstall-man -uninstall-man: - @$(NORMAL_UNINSTALL) - $(top_srcdir)/config/maninst \ - -d $(DESTDIR)$(mandir) -s $(srcdir) \ - uninstall $(PROGMANS) - $(top_srcdir)/config/maninst \ - -d $(DESTDIR)$(mandir) -s $(srcdir) -e $(manext) \ - uninstall $(LIBMANS) -.PHONY: uninstall-man +## Tracing. +SUBDIRS += trace +libmLib_la_LIBADD += trace/libtrace.la ###-------------------------------------------------------------------------- ### Distribution. @@ -548,4 +121,4 @@ EXTRA_DIST += debian/mlib2-adns.install EXTRA_DIST += debian/mlib-dev.install EXTRA_DIST += debian/mlib-bin.install -##----- That's all, folks --------------------------------------------------- +###----- That's all, folks -------------------------------------------------- diff --git a/buf/Makefile.am b/buf/Makefile.am new file mode 100644 index 0000000..5c722fb --- /dev/null +++ b/buf/Makefile.am @@ -0,0 +1,45 @@ +### -*-makefile-*- +### +### Build script for buffering +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libbuf.la +libbuf_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Line buffering. +pkginclude_HEADERS += lbuf.h +libbuf_la_SOURCES += lbuf.c +LIBMANS += lbuf.3 + +## Packet buffering. +pkginclude_HEADERS += pkbuf.h +libbuf_la_SOURCES += pkbuf.c +LIBMANS += pkbuf.3 + +###----- That's all, folks -------------------------------------------------- diff --git a/lbuf.3 b/buf/lbuf.3 similarity index 100% rename from lbuf.3 rename to buf/lbuf.3 diff --git a/lbuf.c b/buf/lbuf.c similarity index 100% rename from lbuf.c rename to buf/lbuf.c diff --git a/lbuf.h b/buf/lbuf.h similarity index 100% rename from lbuf.h rename to buf/lbuf.h diff --git a/pkbuf.3 b/buf/pkbuf.3 similarity index 100% rename from pkbuf.3 rename to buf/pkbuf.3 diff --git a/pkbuf.c b/buf/pkbuf.c similarity index 100% rename from pkbuf.c rename to buf/pkbuf.c diff --git a/pkbuf.h b/buf/pkbuf.h similarity index 100% rename from pkbuf.h rename to buf/pkbuf.h diff --git a/codec/Makefile.am b/codec/Makefile.am new file mode 100644 index 0000000..71a4e48 --- /dev/null +++ b/codec/Makefile.am @@ -0,0 +1,97 @@ +### -*-makefile-*- +### +### Build script for encoding and decoding +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libcodec.la +libcodec_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## form-urlencoded +pkginclude_HEADERS += url.h +libcodec_la_SOURCES += url.c +LIBMANS += url.3 + +## base64 +pkginclude_HEADERS += base64.h +libcodec_la_SOURCES += base64.c +LIBMANS += base64.3 + +EXTRA_DIST += base64.in base64.ref +CLEANFILES += base64.out +tests:: base64.t base64.in base64.ref + ./base64.t <$(srcdir)/base64.in >base64.out + cmp base64.out $(srcdir)/base64.ref + ./base64.t -d <$(srcdir)/base64.ref >base64.out + cmp base64.out $(srcdir)/base64.in + @echo "base64 OK" + +check_PROGRAMS += base64.t +base64_t_SOURCES = base64.c +base64_t_CPPFLAGS = $(TEST_CPPFLAGS) +base64_t_LDFLAGS = -static + +## base32 +pkginclude_HEADERS += base32.h +libcodec_la_SOURCES += base32.c +LIBMANS += base32.3 + +EXTRA_DIST += base32.in base32.ref +CLEANFILES += base32.out +tests:: base32.t base32.in base32.ref + ./base32.t <$(srcdir)/base32.in >base32.out + cmp base32.out $(srcdir)/base32.ref + ./base32.t -d <$(srcdir)/base32.ref >base32.out + cmp base32.out $(srcdir)/base32.in + @echo "base32 OK" + +check_PROGRAMS += base32.t +base32_t_SOURCES = base32.c +base32_t_CPPFLAGS = $(TEST_CPPFLAGS) +base32_t_LDFLAGS = -static + +## hex +pkginclude_HEADERS += hex.h +libcodec_la_SOURCES += hex.c +LIBMANS += hex.3 + +EXTRA_DIST += hex.in hex.ref +CLEANFILES += hex.out +tests:: hex.t hex.in hex.ref + ./hex.t <$(srcdir)/hex.in >hex.out + cmp hex.out $(srcdir)/hex.ref + ./hex.t -d <$(srcdir)/hex.ref >hex.out + cmp hex.out $(srcdir)/hex.in + @echo "hex OK" + +check_PROGRAMS += hex.t +hex_t_SOURCES = hex.c +hex_t_CPPFLAGS = $(TEST_CPPFLAGS) +hex_t_LDFLAGS = -static + +###----- That's all, folks -------------------------------------------------- diff --git a/base32.3 b/codec/base32.3 similarity index 100% rename from base32.3 rename to codec/base32.3 diff --git a/base32.c b/codec/base32.c similarity index 100% rename from base32.c rename to codec/base32.c diff --git a/base32.h b/codec/base32.h similarity index 100% rename from base32.h rename to codec/base32.h diff --git a/base32.in b/codec/base32.in similarity index 100% rename from base32.in rename to codec/base32.in diff --git a/base32.ref b/codec/base32.ref similarity index 100% rename from base32.ref rename to codec/base32.ref diff --git a/base64.3 b/codec/base64.3 similarity index 100% rename from base64.3 rename to codec/base64.3 diff --git a/base64.c b/codec/base64.c similarity index 100% rename from base64.c rename to codec/base64.c diff --git a/base64.h b/codec/base64.h similarity index 100% rename from base64.h rename to codec/base64.h diff --git a/base64.in b/codec/base64.in similarity index 100% rename from base64.in rename to codec/base64.in diff --git a/base64.ref b/codec/base64.ref similarity index 100% rename from base64.ref rename to codec/base64.ref diff --git a/hex.3 b/codec/hex.3 similarity index 100% rename from hex.3 rename to codec/hex.3 diff --git a/hex.c b/codec/hex.c similarity index 100% rename from hex.c rename to codec/hex.c diff --git a/hex.h b/codec/hex.h similarity index 100% rename from hex.h rename to codec/hex.h diff --git a/hex.in b/codec/hex.in similarity index 100% rename from hex.in rename to codec/hex.in diff --git a/hex.ref b/codec/hex.ref similarity index 100% rename from hex.ref rename to codec/hex.ref diff --git a/url.3 b/codec/url.3 similarity index 100% rename from url.3 rename to codec/url.3 diff --git a/url.c b/codec/url.c similarity index 100% rename from url.c rename to codec/url.c diff --git a/url.h b/codec/url.h similarity index 100% rename from url.h rename to codec/url.h diff --git a/configure.ac b/configure.ac index 6a2eb52..d2af6c7 100644 --- a/configure.ac +++ b/configure.ac @@ -99,7 +99,18 @@ dnl Output. AC_CONFIG_HEADER([config/config.h]) AC_CONFIG_FILES( - [Makefile]) + [Makefile] + [buf/Makefile] + [codec/Makefile] + [hash/Makefile] + [mem/Makefile] + [sel/Makefile] + [struct/Makefile] + [sys/Makefile] + [test/Makefile] + [trace/Makefile] + [ui/Makefile] + [utils/Makefile]) AC_OUTPUT dnl ----- That's all, folks ------------------------------------------------- diff --git a/hash/Makefile.am b/hash/Makefile.am new file mode 100644 index 0000000..26099d6 --- /dev/null +++ b/hash/Makefile.am @@ -0,0 +1,90 @@ +### -*-makefile-*- +### +### Build script for hashing +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libhash.la +libhash_la_SOURCES = +libhash_la_LIBADD = + +###-------------------------------------------------------------------------- +### Component files. + +## CRC32. +pkginclude_HEADERS += crc32.h +libhash_la_SOURCES += crc32.c +LIBMANS += crc32.3 + +bin_PROGRAMS += crc-mktab +crc_mktab_SOURCES = crc-mktab.c +crc_mktab_LDADD = $(UTIL_LIBS) +PROGMANS += crc-mktab.1 + +libhash_la_SOURCES += crc32-tab.c +CLEANFILES += crc32-tab.c +crc32-tab.c: + @$(build_util_libs) + @$(MAKE) crc-mktab$(EXEEXT) + ./crc-mktab -o $@.new \ + -p0x04c11db7 -b32 -B8 -r -c \ + -scrc32_table -icrc32.h -tuint32 && \ + mv $@.new $@ + +## Universal hashing. +pkginclude_HEADERS += unihash.h +noinst_LTLIBRARIES += libunihash.la +libunihash_la_SOURCES = unihash.c +libhash_la_LIBADD += libunihash.la +LIBMANS += unihash.3 + +bin_PROGRAMS += unihash-mkstatic +unihash_mkstatic_SOURCES = unihash-mkstatic.c +unihash_mkstatic_LDADD = libunihash.la $(UTIL_LIBS) +PROGMANS += unihash-mkstatic.1 + +libhash_la_SOURCES += unihash-global.c +CLEANFILES += unihash-global.c +unihash-global.c: + @$(build_util_libs) + @$(MAKE) unihash-mkstatic$(EXEEXT) + ./unihash-mkstatic -c -sunihash_global -iunihash.h -o$@.new && \ + mv $@.new $@ + +check_PROGRAMS += unihash.t +unihash_t_SOURCES = unihash.c +unihash_t_CPPFLAGS = $(TEST_CPPFLAGS) +unihash_t_LDFLAGS = -static + +tests:: unihash.t unihash.in + ./unihash.t -f unihash.in + +EXTRA_DIST += unihash-check.pl +CLEANFILES += unihash.in +unihash.in: unihash-check.pl + perl $(srcdir)/unihash-check.pl >$@.new && mv $@.new $@ + + +###----- That's all, folks -------------------------------------------------- diff --git a/crc-mktab.1 b/hash/crc-mktab.1 similarity index 100% rename from crc-mktab.1 rename to hash/crc-mktab.1 diff --git a/crc-mktab.c b/hash/crc-mktab.c similarity index 100% rename from crc-mktab.c rename to hash/crc-mktab.c diff --git a/crc32.3 b/hash/crc32.3 similarity index 100% rename from crc32.3 rename to hash/crc32.3 diff --git a/crc32.c b/hash/crc32.c similarity index 100% rename from crc32.c rename to hash/crc32.c diff --git a/crc32.h b/hash/crc32.h similarity index 100% rename from crc32.h rename to hash/crc32.h diff --git a/unihash-check.pl b/hash/unihash-check.pl similarity index 100% rename from unihash-check.pl rename to hash/unihash-check.pl diff --git a/unihash-mkstatic.1 b/hash/unihash-mkstatic.1 similarity index 100% rename from unihash-mkstatic.1 rename to hash/unihash-mkstatic.1 diff --git a/unihash-mkstatic.c b/hash/unihash-mkstatic.c similarity index 100% rename from unihash-mkstatic.c rename to hash/unihash-mkstatic.c diff --git a/unihash.3 b/hash/unihash.3 similarity index 100% rename from unihash.3 rename to hash/unihash.3 diff --git a/unihash.c b/hash/unihash.c similarity index 100% rename from unihash.c rename to hash/unihash.c diff --git a/unihash.h b/hash/unihash.h similarity index 100% rename from unihash.h rename to hash/unihash.h diff --git a/mem/Makefile.am b/mem/Makefile.am new file mode 100644 index 0000000..7beb771 --- /dev/null +++ b/mem/Makefile.am @@ -0,0 +1,55 @@ +### -*-makefile-*- +### +### Build script for memory allocation +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libmem.la +libmem_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Arena abstraction. +pkginclude_HEADERS += arena.h +libmem_la_SOURCES += arena.c +LIBMANS += arena.3 + +## Memory allocation with exceptions. +pkginclude_HEADERS += alloc.h +libmem_la_SOURCES += alloc.c +LIBMANS += alloc.3 + +## Slab allocator. +pkginclude_HEADERS += sub.h +libmem_la_SOURCES += sub.c +LIBMANS += sub.3 + +## Pool allocator. +pkginclude_HEADERS += pool.h +libmem_la_SOURCES += pool.c pool-file.c pool-sub.c +LIBMANS += pool.3 + +###----- That's all, folks -------------------------------------------------- diff --git a/alloc.3 b/mem/alloc.3 similarity index 100% rename from alloc.3 rename to mem/alloc.3 diff --git a/alloc.c b/mem/alloc.c similarity index 100% rename from alloc.c rename to mem/alloc.c diff --git a/alloc.h b/mem/alloc.h similarity index 100% rename from alloc.h rename to mem/alloc.h diff --git a/arena.3 b/mem/arena.3 similarity index 100% rename from arena.3 rename to mem/arena.3 diff --git a/arena.c b/mem/arena.c similarity index 100% rename from arena.c rename to mem/arena.c diff --git a/arena.h b/mem/arena.h similarity index 100% rename from arena.h rename to mem/arena.h diff --git a/pool-file.c b/mem/pool-file.c similarity index 100% rename from pool-file.c rename to mem/pool-file.c diff --git a/pool-sub.c b/mem/pool-sub.c similarity index 100% rename from pool-sub.c rename to mem/pool-sub.c diff --git a/pool.3 b/mem/pool.3 similarity index 100% rename from pool.3 rename to mem/pool.3 diff --git a/pool.c b/mem/pool.c similarity index 100% rename from pool.c rename to mem/pool.c diff --git a/pool.h b/mem/pool.h similarity index 100% rename from pool.h rename to mem/pool.h diff --git a/sub.3 b/mem/sub.3 similarity index 100% rename from sub.3 rename to mem/sub.3 diff --git a/sub.c b/mem/sub.c similarity index 100% rename from sub.c rename to mem/sub.c diff --git a/sub.h b/mem/sub.h similarity index 100% rename from sub.h rename to mem/sub.h diff --git a/track.c b/mem/track.c similarity index 100% rename from track.c rename to mem/track.c diff --git a/track.h b/mem/track.h similarity index 100% rename from track.h rename to mem/track.h diff --git a/sel/Makefile.am b/sel/Makefile.am new file mode 100644 index 0000000..2e87e7d --- /dev/null +++ b/sel/Makefile.am @@ -0,0 +1,74 @@ +### -*-makefile-*- +### +### Build script for event-driven networking +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libsel.la +libsel_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Core event selection. +pkginclude_HEADERS += sel.h +libsel_la_SOURCES += sel.c +LIBMANS += sel.3 + +## Waiting for buffers to fill. +pkginclude_HEADERS += selbuf.h selpk.h +libsel_la_SOURCES += selbuf.c selpk.c +LIBMANS += selbuf.3 selpk.3 + +## RFC931 identification. +pkginclude_HEADERS += ident.h +libsel_la_SOURCES += ident.c +LIBMANS += ident.3 + +## Nonblocking connections. +pkginclude_HEADERS += conn.h +libsel_la_SOURCES += conn.c +LIBMANS += conn.3 + +## Signal handling +pkginclude_HEADERS += sig.h +libsel_la_SOURCES += sig.c +LIBMANS += sig.3 + +## Name resolution. +pkginclude_HEADERS += bres.h +LIBMANS += bres.3 + +if WITH_ADNS +libsel_la_SOURCES += bres-adns.c +else +libsel_la_SOURCES += bres.c +pkglibexec_PROGRAMS = bres +bres_SOURCES = bres.c +bres_CPPFLAGS = -DBRES_STANDALONE $(AM_CPPFLAGS) +bres_LDADD = +endif + +###----- That's all, folks -------------------------------------------------- diff --git a/bres-adns.c b/sel/bres-adns.c similarity index 100% rename from bres-adns.c rename to sel/bres-adns.c diff --git a/bres.3 b/sel/bres.3 similarity index 100% rename from bres.3 rename to sel/bres.3 diff --git a/bres.c b/sel/bres.c similarity index 100% rename from bres.c rename to sel/bres.c diff --git a/bres.h b/sel/bres.h similarity index 100% rename from bres.h rename to sel/bres.h diff --git a/conn.3 b/sel/conn.3 similarity index 100% rename from conn.3 rename to sel/conn.3 diff --git a/conn.c b/sel/conn.c similarity index 100% rename from conn.c rename to sel/conn.c diff --git a/conn.h b/sel/conn.h similarity index 100% rename from conn.h rename to sel/conn.h diff --git a/ident.3 b/sel/ident.3 similarity index 100% rename from ident.3 rename to sel/ident.3 diff --git a/ident.c b/sel/ident.c similarity index 100% rename from ident.c rename to sel/ident.c diff --git a/ident.h b/sel/ident.h similarity index 100% rename from ident.h rename to sel/ident.h diff --git a/sel.3 b/sel/sel.3 similarity index 100% rename from sel.3 rename to sel/sel.3 diff --git a/sel.c b/sel/sel.c similarity index 100% rename from sel.c rename to sel/sel.c diff --git a/sel.h b/sel/sel.h similarity index 100% rename from sel.h rename to sel/sel.h diff --git a/selbuf.3 b/sel/selbuf.3 similarity index 100% rename from selbuf.3 rename to sel/selbuf.3 diff --git a/selbuf.c b/sel/selbuf.c similarity index 100% rename from selbuf.c rename to sel/selbuf.c diff --git a/selbuf.h b/sel/selbuf.h similarity index 100% rename from selbuf.h rename to sel/selbuf.h diff --git a/selpk.3 b/sel/selpk.3 similarity index 100% rename from selpk.3 rename to sel/selpk.3 diff --git a/selpk.c b/sel/selpk.c similarity index 100% rename from selpk.c rename to sel/selpk.c diff --git a/selpk.h b/sel/selpk.h similarity index 100% rename from selpk.h rename to sel/selpk.h diff --git a/sig.3 b/sel/sig.3 similarity index 100% rename from sig.3 rename to sel/sig.3 diff --git a/sig.c b/sel/sig.c similarity index 100% rename from sig.c rename to sel/sig.c diff --git a/sig.h b/sel/sig.h similarity index 100% rename from sig.h rename to sel/sig.h diff --git a/struct/Makefile.am b/struct/Makefile.am new file mode 100644 index 0000000..280e52d --- /dev/null +++ b/struct/Makefile.am @@ -0,0 +1,123 @@ +### -*-makefile-*- +### +### Build script for data structures +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libstruct.la +libstruct_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Dynamic strings. +pkginclude_HEADERS += dstr.h dspool.h +libstruct_la_SOURCES += dstr.c dstr-putf.c dspool.c +LIBMANS += dstr.3 dspool.3 + +## Buffers. +pkginclude_HEADERS += buf.h +libstruct_la_SOURCES += buf.c buf-dstr.c +LIBMANS += buf.3 + +## Dynamic arrays. +pkginclude_HEADERS += darray.h +libstruct_la_SOURCES += darray.c +LIBMANS += darray.3 + +CLEANFILES += da.out +tests:: darray.t da.in da.ref + ./darray.t da.out + cmp da.out da.ref + @echo "darray OK" + +check_PROGRAMS += darray.t +darray_t_SOURCES = da-test.c +darray_t_CPPFLAGS = $(TEST_CPPFLAGS) +darray_t_LDFLAGS = -static + +EXTRA_DIST += da-gtest +CLEANFILES += da.in +da.in: da-gtest + perl $(srcdir)/da-gtest 10000 >$@.new && mv $@.new $@ + +EXTRA_DIST += da-ref +CLEANFILES += da.ref +da.ref: da-ref da.in + perl $(srcdir)/da-ref $@.new && mv $@.new $@ + +## Hash tables. +pkginclude_HEADERS += hash.h +libstruct_la_SOURCES += hash.c +LIBMANS += hash.3 + +## Symbol tables. +pkginclude_HEADERS += sym.h +libstruct_la_SOURCES += sym.c +LIBMANS += sym.3 + +CLEANFILES += sym.out +tests:: sym.t sym.in sym.ref + ./sym.t sym.out + cmp sym.out sym.ref + @echo "sym OK" + +check_PROGRAMS += sym.t +sym_t_SOURCES = sym-test.c +sym_t_CPPFLAGS = $(TEST_CPPFLAGS) +sym_t_LDFLAGS = -static + +EXTRA_DIST += sym-gtest +CLEANFILES += sym.in +sym.in: sym-gtest + perl $(srcdir)/sym-gtest 10000 >$@.new && mv $@.new $@ + +EXTRA_DIST += sym-ref +CLEANFILES += sym.ref +sym.ref: sym-ref sym.in + perl $(srcdir)/sym-ref $@.new && mv $@.new $@ + +## Atoms. +pkginclude_HEADERS += atom.h +libstruct_la_SOURCES += atom.c +LIBMANS += atom.3 + +## Association tables. +pkginclude_HEADERS += assoc.h +libstruct_la_SOURCES += assoc.c +LIBMANS += assoc.3 + +CLEANFILES += assoc.out +tests:: assoc.t sym.in sym.ref + ./assoc.t assoc.out + cmp assoc.out sym.ref + @echo "sym OK" + +check_PROGRAMS += assoc.t +assoc_t_SOURCES = assoc-test.c +assoc_t_CPPFLAGS = $(TEST_CPPFLAGS) +assoc_t_LDFLAGS = -static + +###----- That's all, folks -------------------------------------------------- diff --git a/assoc-test.c b/struct/assoc-test.c similarity index 100% rename from assoc-test.c rename to struct/assoc-test.c diff --git a/assoc.3 b/struct/assoc.3 similarity index 100% rename from assoc.3 rename to struct/assoc.3 diff --git a/assoc.c b/struct/assoc.c similarity index 100% rename from assoc.c rename to struct/assoc.c diff --git a/assoc.h b/struct/assoc.h similarity index 100% rename from assoc.h rename to struct/assoc.h diff --git a/atom.3 b/struct/atom.3 similarity index 100% rename from atom.3 rename to struct/atom.3 diff --git a/atom.c b/struct/atom.c similarity index 100% rename from atom.c rename to struct/atom.c diff --git a/atom.h b/struct/atom.h similarity index 100% rename from atom.h rename to struct/atom.h diff --git a/buf-dstr.c b/struct/buf-dstr.c similarity index 100% rename from buf-dstr.c rename to struct/buf-dstr.c diff --git a/buf.3 b/struct/buf.3 similarity index 100% rename from buf.3 rename to struct/buf.3 diff --git a/buf.c b/struct/buf.c similarity index 100% rename from buf.c rename to struct/buf.c diff --git a/buf.h b/struct/buf.h similarity index 100% rename from buf.h rename to struct/buf.h diff --git a/da-gtest b/struct/da-gtest similarity index 100% rename from da-gtest rename to struct/da-gtest diff --git a/da-ref b/struct/da-ref similarity index 100% rename from da-ref rename to struct/da-ref diff --git a/da-test.c b/struct/da-test.c similarity index 100% rename from da-test.c rename to struct/da-test.c diff --git a/darray.3 b/struct/darray.3 similarity index 100% rename from darray.3 rename to struct/darray.3 diff --git a/darray.c b/struct/darray.c similarity index 100% rename from darray.c rename to struct/darray.c diff --git a/darray.h b/struct/darray.h similarity index 100% rename from darray.h rename to struct/darray.h diff --git a/dspool.3 b/struct/dspool.3 similarity index 100% rename from dspool.3 rename to struct/dspool.3 diff --git a/dspool.c b/struct/dspool.c similarity index 100% rename from dspool.c rename to struct/dspool.c diff --git a/dspool.h b/struct/dspool.h similarity index 100% rename from dspool.h rename to struct/dspool.h diff --git a/dputf.c b/struct/dstr-putf.c similarity index 100% rename from dputf.c rename to struct/dstr-putf.c diff --git a/dstr.3 b/struct/dstr.3 similarity index 100% rename from dstr.3 rename to struct/dstr.3 diff --git a/dstr.c b/struct/dstr.c similarity index 100% rename from dstr.c rename to struct/dstr.c diff --git a/dstr.h b/struct/dstr.h similarity index 100% rename from dstr.h rename to struct/dstr.h diff --git a/hash.3 b/struct/hash.3 similarity index 100% rename from hash.3 rename to struct/hash.3 diff --git a/hash.c b/struct/hash.c similarity index 100% rename from hash.c rename to struct/hash.c diff --git a/hash.h b/struct/hash.h similarity index 100% rename from hash.h rename to struct/hash.h diff --git a/sym-gtest b/struct/sym-gtest similarity index 100% rename from sym-gtest rename to struct/sym-gtest diff --git a/sym-ref b/struct/sym-ref similarity index 100% rename from sym-ref rename to struct/sym-ref diff --git a/sym-test.c b/struct/sym-test.c similarity index 100% rename from sym-test.c rename to struct/sym-test.c diff --git a/sym.3 b/struct/sym.3 similarity index 100% rename from sym.3 rename to struct/sym.3 diff --git a/sym.c b/struct/sym.c similarity index 100% rename from sym.c rename to struct/sym.c diff --git a/sym.h b/struct/sym.h similarity index 100% rename from sym.h rename to struct/sym.h diff --git a/sys/Makefile.am b/sys/Makefile.am new file mode 100644 index 0000000..5a0adb7 --- /dev/null +++ b/sys/Makefile.am @@ -0,0 +1,85 @@ +### -*-makefile-*- +### +### Build script for system utilities +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libsys.la +libsys_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Daemons. +pkginclude_HEADERS += daemonize.h +libsys_la_SOURCES += daemonize.c +LIBMANS += daemonize.3 + +## Environment variables. +pkginclude_HEADERS += env.h +libsys_la_SOURCES += env.c +LIBMANS += env.3 + +## File and descriptor flags. +pkginclude_HEADERS += fdflags.h +libsys_la_SOURCES += fdflags.c +LIBMANS += fdflags.3 + +## File descriptor passing. +pkginclude_HEADERS += fdpass.h +libsys_la_SOURCES += fdpass.c +LIBMANS += fdpass.3 + +## Watching files for modification. +pkginclude_HEADERS += fwatch.h +libsys_la_SOURCES += fwatch.c +LIBMANS += fwatch.3 + +## File locking. +pkginclude_HEADERS += lock.h +libsys_la_SOURCES += lock.c +LIBMANS += lock.3 + +## File descriptor juggling. +pkginclude_HEADERS += mdup.h +libsys_la_SOURCES += mdup.c +LIBMANS += mdup.3 + +check_PROGRAMS += mdup.t +mdup_t_SOURCES = mdup-test.c +mdup_t_CPPFLAGS = $(TEST_CPPFLAGS) +mdup_t_LDFLAGS = -static + +EXTRA_DIST += mdup-test.sh +CLEANFILES += mdup.[0-9]*.out mdup.[0-9]*.err +tests:: mdup.t mdup-test.sh + $(srcdir)/mdup-test.sh + +## Time arithmetic. +pkginclude_HEADERS += tv.h +libsys_la_SOURCES += tv.c +LIBMANS += tv.3 + +###----- That's all, folks -------------------------------------------------- diff --git a/daemonize.3 b/sys/daemonize.3 similarity index 100% rename from daemonize.3 rename to sys/daemonize.3 diff --git a/daemonize.c b/sys/daemonize.c similarity index 100% rename from daemonize.c rename to sys/daemonize.c diff --git a/daemonize.h b/sys/daemonize.h similarity index 100% rename from daemonize.h rename to sys/daemonize.h diff --git a/env.3 b/sys/env.3 similarity index 100% rename from env.3 rename to sys/env.3 diff --git a/env.c b/sys/env.c similarity index 100% rename from env.c rename to sys/env.c diff --git a/env.h b/sys/env.h similarity index 100% rename from env.h rename to sys/env.h diff --git a/fdflags.3 b/sys/fdflags.3 similarity index 100% rename from fdflags.3 rename to sys/fdflags.3 diff --git a/fdflags.c b/sys/fdflags.c similarity index 100% rename from fdflags.c rename to sys/fdflags.c diff --git a/fdflags.h b/sys/fdflags.h similarity index 100% rename from fdflags.h rename to sys/fdflags.h diff --git a/fdpass.3 b/sys/fdpass.3 similarity index 100% rename from fdpass.3 rename to sys/fdpass.3 diff --git a/fdpass.c b/sys/fdpass.c similarity index 100% rename from fdpass.c rename to sys/fdpass.c diff --git a/fdpass.h b/sys/fdpass.h similarity index 100% rename from fdpass.h rename to sys/fdpass.h diff --git a/fwatch.3 b/sys/fwatch.3 similarity index 100% rename from fwatch.3 rename to sys/fwatch.3 diff --git a/fwatch.c b/sys/fwatch.c similarity index 100% rename from fwatch.c rename to sys/fwatch.c diff --git a/fwatch.h b/sys/fwatch.h similarity index 100% rename from fwatch.h rename to sys/fwatch.h diff --git a/lock.3 b/sys/lock.3 similarity index 100% rename from lock.3 rename to sys/lock.3 diff --git a/lock.c b/sys/lock.c similarity index 100% rename from lock.c rename to sys/lock.c diff --git a/lock.h b/sys/lock.h similarity index 100% rename from lock.h rename to sys/lock.h diff --git a/mdup-test.c b/sys/mdup-test.c similarity index 100% rename from mdup-test.c rename to sys/mdup-test.c diff --git a/mdup-test.sh b/sys/mdup-test.sh similarity index 100% rename from mdup-test.sh rename to sys/mdup-test.sh diff --git a/mdup.3 b/sys/mdup.3 similarity index 100% rename from mdup.3 rename to sys/mdup.3 diff --git a/mdup.c b/sys/mdup.c similarity index 100% rename from mdup.c rename to sys/mdup.c diff --git a/mdup.h b/sys/mdup.h similarity index 100% rename from mdup.h rename to sys/mdup.h diff --git a/tv.3 b/sys/tv.3 similarity index 100% rename from tv.3 rename to sys/tv.3 diff --git a/tv.c b/sys/tv.c similarity index 100% rename from tv.c rename to sys/tv.c diff --git a/tv.h b/sys/tv.h similarity index 100% rename from tv.h rename to sys/tv.h diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..e81daed --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,40 @@ +### -*-makefile-*- +### +### Build script for testing +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libtest.la +libtest_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Testing. +pkginclude_HEADERS += testrig.h +libtest_la_SOURCES += testrig.c +LIBMANS += testrig.3 + +###----- That's all, folks -------------------------------------------------- diff --git a/testrig.3 b/test/testrig.3 similarity index 100% rename from testrig.3 rename to test/testrig.3 diff --git a/testrig.c b/test/testrig.c similarity index 100% rename from testrig.c rename to test/testrig.c diff --git a/testrig.h b/test/testrig.h similarity index 100% rename from testrig.h rename to test/testrig.h diff --git a/trace/Makefile.am b/trace/Makefile.am new file mode 100644 index 0000000..45d362f --- /dev/null +++ b/trace/Makefile.am @@ -0,0 +1,40 @@ +### -*-makefile-*- +### +### Build script for tracing +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libtrace.la +libtrace_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Tracing. +pkginclude_HEADERS += trace.h +libtrace_la_SOURCES += trace.c traceopt.c +LIBMANS += trace.3 + +###----- That's all, folks -------------------------------------------------- diff --git a/trace.3 b/trace/trace.3 similarity index 100% rename from trace.3 rename to trace/trace.3 diff --git a/trace.c b/trace/trace.c similarity index 100% rename from trace.c rename to trace/trace.c diff --git a/trace.h b/trace/trace.h similarity index 100% rename from trace.h rename to trace/trace.h diff --git a/traceopt.c b/trace/traceopt.c similarity index 100% rename from traceopt.c rename to trace/traceopt.c diff --git a/ui/Makefile.am b/ui/Makefile.am new file mode 100644 index 0000000..ab70a70 --- /dev/null +++ b/ui/Makefile.am @@ -0,0 +1,54 @@ +### -*-makefile-*- +### +### Build script for user interface +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libui.la +libui_la_SOURCES = +libui_la_LIBADD = + +###-------------------------------------------------------------------------- +### Component files. + +## Option parsing. +noinst_LTLIBRARIES += libmdwopt.la +pkginclude_HEADERS += mdwopt.h +libmdwopt_la_SOURCES = mdwopt.c +libmdwopt_la_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_MLIB +libui_la_LIBADD += libmdwopt.la +LIBMANS += mdwopt.3 + +## Program naming. +pkginclude_HEADERS += quis.h +libui_la_SOURCES += quis.c pquis.c +LIBMANS += quis.3 + +## Error reporting. +pkginclude_HEADERS += report.h +libui_la_SOURCES += report.c +LIBMANS += report.3 + +###----- That's all, folks -------------------------------------------------- diff --git a/mdwopt.3 b/ui/mdwopt.3 similarity index 100% rename from mdwopt.3 rename to ui/mdwopt.3 diff --git a/pquis.c b/ui/pquis.c similarity index 100% rename from pquis.c rename to ui/pquis.c diff --git a/quis.3 b/ui/quis.3 similarity index 100% rename from quis.3 rename to ui/quis.3 diff --git a/quis.c b/ui/quis.c similarity index 100% rename from quis.c rename to ui/quis.c diff --git a/quis.h b/ui/quis.h similarity index 100% rename from quis.h rename to ui/quis.h diff --git a/report.3 b/ui/report.3 similarity index 100% rename from report.3 rename to ui/report.3 diff --git a/report.c b/ui/report.c similarity index 100% rename from report.c rename to ui/report.c diff --git a/report.h b/ui/report.h similarity index 100% rename from report.h rename to ui/report.h diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 0000000..226e86a --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,80 @@ +### -*-makefile-*- +### +### Build script for utilities +### +### (c) 2009 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LTLIBRARIES = libutils.la +libutils_la_SOURCES = + +###-------------------------------------------------------------------------- +### Component files. + +## Utility macros. +pkginclude_HEADERS += macros.h +LIBMANS += macros.3 + +## Alignment. +pkginclude_HEADERS += align.h +LIBMANS += align.3 + +## Bit manipulation. +pkginclude_HEADERS += bits.h +LIBMANS += bits.3 + +EXTRA_DIST += bits.in bits-testgen.c +tests:: bits.t bits.in + ./bits.t -f $(srcdir)/bits.in + +check_PROGRAMS += bits.t +bits_t_SOURCES = bits.c +bits_t_CPPFLAGS = $(TEST_CPPFLAGS) +bits_t_LDFLAGS = -static + +## Exceptions. +pkginclude_HEADERS += exc.h +libutils_la_SOURCES += exc.c +LIBMANS += exc.3 + +## String handling. +pkginclude_HEADERS += str.h +libutils_la_SOURCES += str.c +LIBMANS += str.3 + +## Version comparison. +pkginclude_HEADERS += versioncmp.h +libutils_la_SOURCES += versioncmp.c +LIBMANS += versioncmp.3 + +EXTRA_DIST += versioncmp.in +tests:: versioncmp.t versioncmp.in + ./versioncmp.t -f $(srcdir)/versioncmp.in + +check_PROGRAMS += versioncmp.t +versioncmp_t_SOURCES = versioncmp-test.c +versioncmp_t_CPPFLAGS = $(TEST_CPPFLAGS) +versioncmp_t_LDFLAGS = -static + +###----- That's all, folks -------------------------------------------------- diff --git a/align.3 b/utils/align.3 similarity index 100% rename from align.3 rename to utils/align.3 diff --git a/align.h b/utils/align.h similarity index 100% rename from align.h rename to utils/align.h diff --git a/bits-testgen.c b/utils/bits-testgen.c similarity index 100% rename from bits-testgen.c rename to utils/bits-testgen.c diff --git a/bits.3 b/utils/bits.3 similarity index 100% rename from bits.3 rename to utils/bits.3 diff --git a/bits.c b/utils/bits.c similarity index 100% rename from bits.c rename to utils/bits.c diff --git a/bits.h b/utils/bits.h similarity index 100% rename from bits.h rename to utils/bits.h diff --git a/bits.in b/utils/bits.in similarity index 100% rename from bits.in rename to utils/bits.in diff --git a/exc.3 b/utils/exc.3 similarity index 100% rename from exc.3 rename to utils/exc.3 diff --git a/exc.c b/utils/exc.c similarity index 100% rename from exc.c rename to utils/exc.c diff --git a/exc.h b/utils/exc.h similarity index 100% rename from exc.h rename to utils/exc.h diff --git a/exctest.c b/utils/exctest.c similarity index 100% rename from exctest.c rename to utils/exctest.c diff --git a/macros.3 b/utils/macros.3 similarity index 100% rename from macros.3 rename to utils/macros.3 diff --git a/macros.h b/utils/macros.h similarity index 100% rename from macros.h rename to utils/macros.h diff --git a/str.3 b/utils/str.3 similarity index 100% rename from str.3 rename to utils/str.3 diff --git a/str.c b/utils/str.c similarity index 100% rename from str.c rename to utils/str.c diff --git a/str.h b/utils/str.h similarity index 100% rename from str.h rename to utils/str.h diff --git a/versioncmp-test.c b/utils/versioncmp-test.c similarity index 100% rename from versioncmp-test.c rename to utils/versioncmp-test.c diff --git a/versioncmp.3 b/utils/versioncmp.3 similarity index 100% rename from versioncmp.3 rename to utils/versioncmp.3 diff --git a/versioncmp.c b/utils/versioncmp.c similarity index 100% rename from versioncmp.c rename to utils/versioncmp.c diff --git a/versioncmp.h b/utils/versioncmp.h similarity index 100% rename from versioncmp.h rename to utils/versioncmp.h diff --git a/versioncmp.in b/utils/versioncmp.in similarity index 100% rename from versioncmp.in rename to utils/versioncmp.in diff --git a/vars.am b/vars.am new file mode 100644 index 0000000..c6f7884 --- /dev/null +++ b/vars.am @@ -0,0 +1,128 @@ +### -*-Makefile-*- +### +### Common build-system definition +### +### (c) 1998 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the mLib utilities library. +### +### mLib is free software; you can redistribute it and/or modify +### it under the terms of the GNU Library General Public License as +### published by the Free Software Foundation; either version 2 of the +### License, or (at your option) any later version. +### +### mLib is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU Library General Public License for more details. +### +### You should have received a copy of the GNU Library General Public +### License along with mLib; if not, write to the Free +### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +### MA 02111-1307, USA. + +###-------------------------------------------------------------------------- +### Installation directories. + +pkglibexecdir = $(libexecdir)/$(PACKAGE) + +###-------------------------------------------------------------------------- +### Initial values for common variables. + +bin_PROGRAMS = +check_PROGRAMS = +pkginclude_HEADERS = +PROGMANS = +LIBMANS = +EXTRA_DIST = $(LIBMANS) $(PROGMANS) +CLEANFILES = +MAINTAINERCLEANFILES = + +###-------------------------------------------------------------------------- +### Include path. + +MLIB_INCLUDES = \ + -I$(top_srcdir)/buf \ + -I$(top_srcdir)/codec \ + -I$(top_srcdir)/hash \ + -I$(top_srcdir)/mem \ + -I$(top_srcdir)/net \ + -I$(top_srcdir)/struct \ + -I$(top_srcdir)/sys \ + -I$(top_srcdir)/test \ + -I$(top_srcdir)/trace \ + -I$(top_srcdir)/ui \ + -I$(top_srcdir)/utils + +CPPFLAGS += $(MLIB_INCLUDES) + +###-------------------------------------------------------------------------- +### Miscellaneous useful definitions. + +## Substitute tags in files. +confsubst = $(top_srcdir)/config/confsubst + +SUBSTITUTIONS = \ + prefix=$(prefix) exec_prefix=$(exec_prefix) \ + libdir=$(libdir) includedir=$(includedir) \ + bindir=$(bindir) sbindir=$(sbindir) \ + PACKAGE=$(PACKAGE) VERSION=$(VERSION) + +###-------------------------------------------------------------------------- +### Building utilities. + +## Which libraries we need. +UTIL_LIBS = \ + $(top_builddir)/ui/libui.la \ + $(top_builddir)/utils/libutils.la + +## Making sure they're built properly. Without this, `make dist' on a bare +## source tree fails hopelessly. +build_util_libs = \ + for i in ui utils; do \ + (cd $(top_builddir)/$$i && $(MAKE) lib$$i.la) || exit 1; \ + done + +###-------------------------------------------------------------------------- +### Testing. + +TEST_CPPFLAGS = -DTEST_RIG -DSRCDIR="\"$(srcdir)\"" $(AM_CPPFLAGS) +LDADD = $(top_builddir)/libmLib.la + +check: tests +.PHONY: check tests + +###-------------------------------------------------------------------------- +### Manual. + +EXTRA_DIST += $(LIBMANS) $(PROGMANS) + +install-data-local: install-man +install-man: $(LIBMANS) $(PROGMANS) + @$(NORMAL_INSTALL) + $(mkdir_p) $(DESTDIR)$(mandir) + $(top_srcdir)/config/maninst \ + -d $(DESTDIR)$(mandir) -s $(srcdir) \ + -i "$(INSTALL)" \ + install $(PROGMANS) + $(top_srcdir)/config/maninst \ + -d $(DESTDIR)$(mandir) -s $(srcdir) \ + -i "$(INSTALL)" -e $(manext) \ + install $(LIBMANS) +.PHONY: install-man + +uninstall-local: uninstall-man +uninstall-man: + @$(NORMAL_UNINSTALL) + $(top_srcdir)/config/maninst \ + -d $(DESTDIR)$(mandir) -s $(srcdir) \ + uninstall $(PROGMANS) + $(top_srcdir)/config/maninst \ + -d $(DESTDIR)$(mandir) -s $(srcdir) -e $(manext) \ + uninstall $(LIBMANS) +.PHONY: uninstall-man + +###----- That's all, folks --------------------------------------------------