From db1ad72261259f636dc03a92f8048fa9c3c453d7 Mon Sep 17 00:00:00 2001 From: pi-rho Date: Tue, 5 Feb 2013 13:03:02 -0600 Subject: [PATCH] update autotools build stuff --- Makefile.am | 103 +++++++++++++++++++++++++++++++-------------------- configure.ac | 4 +- 2 files changed, 65 insertions(+), 42 deletions(-) diff --git a/Makefile.am b/Makefile.am index 58ca203..5e64971 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,13 @@ ACLOCAL_AMFLAGS = -I m4 -bin_PROGRAMS = hdng unhex xor repr puniq pmerge p4split -dist_man1_MANS = man/hdng.mdoc man/unhex.mdoc man/xor.mdoc man/repr.mdoc \ - man/puniq.mdoc man/pmerge.mdoc man/p4split.mdoc -dist_man7_MANS = man/netre-tools.mdoc +bin_PROGRAMS = hdng unhex xor repr puniq pmerge p4split pcat +dist_bin_SCRIPTS = scripts/dumbdecode +dist_man1_MANS = docs/hdng.mdoc docs/unhex.mdoc docs/xor.mdoc docs/repr.mdoc \ + docs/puniq.mdoc docs/pmerge.mdoc docs/p4split.mdoc \ + docs/pcat.mdoc docs/dumbdecode.mdoc +dist_man7_MANS = docs/netre-tools.mdoc MANPAGES = $(dist_man1_MANS) $(dist_man7_MANS) -PDFPAGES = $(MANPAGES:man/%.mdoc=docs/%.pdf) +PDFPAGES = $(MANPAGES:%.mdoc=%.pdf) AM_CFLAGS = AM_CPPFLAGS = @@ -25,66 +27,87 @@ if IS_DEBUG AM_CPPFLAGS += -DDEBUGSTMTS endif -noinst_LTLIBRARIES = libpcap.la -libpcap_la_SOURCES = src/pcap.c src/pcap.h +noinst_LTLIBRARIES = libpcap.la libstream.la +libpcap_la_SOURCES = src/pcap.c src/pcap.h +libstream_la_SOURCES = src/stream.c src/stream.h -noinst_HEADERS = src/netre.h +noinst_HEADERS = src/netre.h -hdng_SOURCES = src/hdng.c -unhex_SOURCES = src/unhex.c -xor_SOURCES = src/xor.c -repr_SOURCES = src/repr.c -puniq_SOURCES = src/puniq.c -puniq_LDADD = libpcap.la -pmerge_SOURCES = src/pmerge.c -pmerge_LDADD = libpcap.la -p4split_SOURCES = src/p4split.c -p4split_LDADD = libpcap.la +hdng_SOURCES = src/hdng.c +unhex_SOURCES = src/unhex.c +xor_SOURCES = src/xor.c +repr_SOURCES = src/repr.c +puniq_SOURCES = src/puniq.c +puniq_LDADD = libpcap.la +pmerge_SOURCES = src/pmerge.c +pmerge_LDADD = libpcap.la +p4split_SOURCES = src/p4split.c +p4split_LDADD = libpcap.la +pcat_SOURCES = src/pcat.c +pcat_LDADD = libpcap.la libstream.la -EXTRA_DIST = man docs - -MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile \ - build-aux/config.guess build-aux/config.sub \ +MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile \ + build-aux/config.guess build-aux/config.sub \ build-aux/depcomp build-aux/install-sh build-aux/missing \ - config.h.in config.h.in~ configure build-aux/ltmain.sh \ - m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \ + config.h.in config.h.in~ configure build-aux/ltmain.sh \ + m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \ m4/ltsugar.m4 m4/ltversion.m4 $(PDFPAGES) +CLEANFILES = $(MANPAGES) $(PDFPAGES) scripts/dumbdecode +EXTRA_DIST = $(MANPAGES) $(PDFPAGES) + + docdir = $(datadir)/doc/@PACKAGE@ doc_DATA = README AUTHORS TODO $(PDFPAGES) MDOC2PS = groff -mdoc -t -Tps -PS2PDF = ps2pdf - +PS2PDF = ps2pdf - - +RELEASED = May 23, 2012 +EDIT = sed -e 's!@RELEASE_DATE\@!$(RELEASED)!g' \ + -e 's!@VERSION\@!@VERSION@!g' -docs: - mkdir -p man - mkdir -p docs - for i in $(MANPAGES:man/%.mdoc=%); do \ - $(MDOC2PS) $(srcdir)/man/$$i.mdoc | $(PS2PDF) $(srcdir)/docs/$$i.pdf; \ - done +docs: Makefile $(MANPAGES) $(PDFPAGES) -$(PDFPAGES): docs +SUFFIXES = .mdoc.in .mdoc .pdf .in + +scripts/dumbdecode: scripts/dumbdecode.in + $(AM_V_GEN) + $(AM_V_at)rm -f $@ $@.tmp; \ + cat $(srcdir)/$< | $(EDIT) > $@.tmp; \ + mv $@.tmp $@; \ + chmod 0755 $@ + +.mdoc.pdf: + $(AM_V_GEN) + $(AM_V_at)rm -rf $@ $@.tmp; \ + cat $(srcdir)/$< | $(MDOC2PS) | $(PS2PDF) > $@.tmp; \ + mv $@.tmp $@ + +.mdoc.in.mdoc: + $(AM_V_GEN) + $(AM_V_at)rm -f $@ $@.tmp; \ + cat $(srcdir)/$< | $(EDIT) > $@.tmp; \ + mv $@.tmp $@ maintainer-clean-local: rmdir build-aux rmdir m4 - -rmdir docs dist-hook: docs install-exec-hook: (cd $(DESTDIR)$(bindir); \ - $(LN_S) xor rot; \ - $(LN_S) xor rol; \ - $(LN_S) xor caesar; ) + $(LN_S) xor rot; \ + $(LN_S) xor rol; \ + $(LN_S) xor caesar; ) install-data-hook: (cd $(DESTDIR)$(man1dir); \ - $(LN_S) xor.1 rot.1; \ - $(LN_S) xor.1 rol.1; \ - $(LN_S) xor.1 caesar.1; ) + $(LN_S) xor.1 rot.1; \ + $(LN_S) xor.1 rol.1; \ + $(LN_S) xor.1 caesar.1; ) mv -f $(DESTDIR)$(docdir)/xor.pdf \ - $(DESTDIR)$(docdir)/transformer.pdf + $(DESTDIR)$(docdir)/transformer.pdf uninstall-hook: rm $(DESTDIR)$(bindir)/{rot,rol,caesar} diff --git a/configure.ac b/configure.ac index 214bf5a..e822cd3 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.65]) -AC_INIT([netre-tools], [0.1337], [pi-rho@tyr.cx]) +AC_INIT([netre-tools], [1.1337], [pi-rho@tyr.cx]) AC_CONFIG_SRCDIR([src/hdng.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([build-aux]) @@ -22,7 +22,7 @@ AC_PROG_INSTALL LT_INIT # Check for headers -AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/socket.h]) +AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/socket.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL