update autotools build stuff

This commit is contained in:
pi-rho 2013-02-05 13:03:02 -06:00
parent 3b5b71a165
commit db1ad72261
2 changed files with 65 additions and 42 deletions

View File

@ -1,11 +1,13 @@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
bin_PROGRAMS = hdng unhex xor repr puniq pmerge p4split bin_PROGRAMS = hdng unhex xor repr puniq pmerge p4split pcat
dist_man1_MANS = man/hdng.mdoc man/unhex.mdoc man/xor.mdoc man/repr.mdoc \ dist_bin_SCRIPTS = scripts/dumbdecode
man/puniq.mdoc man/pmerge.mdoc man/p4split.mdoc dist_man1_MANS = docs/hdng.mdoc docs/unhex.mdoc docs/xor.mdoc docs/repr.mdoc \
dist_man7_MANS = man/netre-tools.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) MANPAGES = $(dist_man1_MANS) $(dist_man7_MANS)
PDFPAGES = $(MANPAGES:man/%.mdoc=docs/%.pdf) PDFPAGES = $(MANPAGES:%.mdoc=%.pdf)
AM_CFLAGS = AM_CFLAGS =
AM_CPPFLAGS = AM_CPPFLAGS =
@ -25,66 +27,87 @@ if IS_DEBUG
AM_CPPFLAGS += -DDEBUGSTMTS AM_CPPFLAGS += -DDEBUGSTMTS
endif endif
noinst_LTLIBRARIES = libpcap.la noinst_LTLIBRARIES = libpcap.la libstream.la
libpcap_la_SOURCES = src/pcap.c src/pcap.h 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 hdng_SOURCES = src/hdng.c
unhex_SOURCES = src/unhex.c unhex_SOURCES = src/unhex.c
xor_SOURCES = src/xor.c xor_SOURCES = src/xor.c
repr_SOURCES = src/repr.c repr_SOURCES = src/repr.c
puniq_SOURCES = src/puniq.c puniq_SOURCES = src/puniq.c
puniq_LDADD = libpcap.la puniq_LDADD = libpcap.la
pmerge_SOURCES = src/pmerge.c pmerge_SOURCES = src/pmerge.c
pmerge_LDADD = libpcap.la pmerge_LDADD = libpcap.la
p4split_SOURCES = src/p4split.c p4split_SOURCES = src/p4split.c
p4split_LDADD = libpcap.la 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 \ build-aux/depcomp build-aux/install-sh build-aux/missing \
config.h.in config.h.in~ configure build-aux/ltmain.sh \ config.h.in config.h.in~ configure build-aux/ltmain.sh \
m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \ m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \
m4/ltsugar.m4 m4/ltversion.m4 $(PDFPAGES) m4/ltsugar.m4 m4/ltversion.m4 $(PDFPAGES)
CLEANFILES = $(MANPAGES) $(PDFPAGES) scripts/dumbdecode
EXTRA_DIST = $(MANPAGES) $(PDFPAGES)
docdir = $(datadir)/doc/@PACKAGE@ docdir = $(datadir)/doc/@PACKAGE@
doc_DATA = README AUTHORS TODO $(PDFPAGES) doc_DATA = README AUTHORS TODO $(PDFPAGES)
MDOC2PS = groff -mdoc -t -Tps 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: docs: Makefile $(MANPAGES) $(PDFPAGES)
mkdir -p man
mkdir -p docs
for i in $(MANPAGES:man/%.mdoc=%); do \
$(MDOC2PS) $(srcdir)/man/$$i.mdoc | $(PS2PDF) $(srcdir)/docs/$$i.pdf; \
done
$(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: maintainer-clean-local:
rmdir build-aux rmdir build-aux
rmdir m4 rmdir m4
-rmdir docs
dist-hook: docs dist-hook: docs
install-exec-hook: install-exec-hook:
(cd $(DESTDIR)$(bindir); \ (cd $(DESTDIR)$(bindir); \
$(LN_S) xor rot; \ $(LN_S) xor rot; \
$(LN_S) xor rol; \ $(LN_S) xor rol; \
$(LN_S) xor caesar; ) $(LN_S) xor caesar; )
install-data-hook: install-data-hook:
(cd $(DESTDIR)$(man1dir); \ (cd $(DESTDIR)$(man1dir); \
$(LN_S) xor.1 rot.1; \ $(LN_S) xor.1 rot.1; \
$(LN_S) xor.1 rol.1; \ $(LN_S) xor.1 rol.1; \
$(LN_S) xor.1 caesar.1; ) $(LN_S) xor.1 caesar.1; )
mv -f $(DESTDIR)$(docdir)/xor.pdf \ mv -f $(DESTDIR)$(docdir)/xor.pdf \
$(DESTDIR)$(docdir)/transformer.pdf $(DESTDIR)$(docdir)/transformer.pdf
uninstall-hook: uninstall-hook:
rm $(DESTDIR)$(bindir)/{rot,rol,caesar} rm $(DESTDIR)$(bindir)/{rot,rol,caesar}

View File

@ -2,7 +2,7 @@
AC_PREREQ([2.65]) 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_SRCDIR([src/hdng.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
@ -22,7 +22,7 @@ AC_PROG_INSTALL
LT_INIT LT_INIT
# Check for headers # 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. # Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL AC_HEADER_STDBOOL