Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

automake: First attempt at using automake/configure.

Starting to adapt the make system to the automake/configure system.

Most of the files are copied from the xtables-addons project.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
  • Loading branch information...
commit dc8d6b8dce74d1be550790ad97d46bb156674b0e 1 parent 73c4c98
Jesper Dangaard Brouer authored
Showing with 112 additions and 0 deletions.
  1. +30 −0 Makefile.am
  2. +4 −0 autogen.sh
  3. +78 −0 configure.ac
View
30 Makefile.am
@@ -0,0 +1,30 @@
+# -*- Makefile -*-
+
+ACLOCAL_AMFLAGS = -I m4
+#SUBDIRS = extensions geoip
+
+#man_MANS := xtables-addons.8
+
+.PHONY: FORCE
+FORCE:
+
+#xtables-addons.8: FORCE
+# ${MAKE} -f Makefile.mans all;
+
+#install-exec-hook:
+# depmod -a || :;
+
+#config.status: Makefile.iptrules.in
+
+tmpdir := $(shell mktemp -dtu)
+packer = gzip
+packext = .tar.gz
+
+.PHONY: tarball
+tarball:
+# do not use mkdir_p here.
+ mkdir ${tmpdir}
+ pushd ${top_srcdir} && git archive --prefix=${PACKAGE_NAME}-${PACKAGE_VERSION}/ HEAD | tar -C ${tmpdir} -x && popd;
+ pushd ${tmpdir}/${PACKAGE_NAME}-${PACKAGE_VERSION} && ./autogen.sh && popd;
+ tar --use=${packer} -C ${tmpdir} -cf ${PACKAGE_NAME}-${PACKAGE_VERSION}${packext} --owner=root --group=root ${PACKAGE_NAME}-${PACKAGE_VERSION}/;
+ rm -Rf ${tmpdir};
View
4 autogen.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+autoreconf -fi;
+rm -Rf autom4te*.cache;
View
78 configure.ac
@@ -0,0 +1,78 @@
+
+AC_INIT([iptv-analyzer], [0.7.1])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+AC_PROG_INSTALL
+AM_INIT_AUTOMAKE([1.10.2 -Wall foreign subdir-objects])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+AC_ARG_WITH([kbuild],
+ AS_HELP_STRING([--with-kbuild=PATH],
+ [Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
+ [kbuilddir="$withval"],
+ [kbuilddir="/lib/modules/$(uname -r)/build"])
+#
+# check for --without-kbuild
+#
+if [[ "$kbuilddir" == no ]]; then
+ kbuilddir="";
+fi
+
+AC_ARG_WITH([xtlibdir],
+ AS_HELP_STRING([--with-xtlibdir=PATH],
+ [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]),
+ [xtlibdir="$withval"],
+ [xtlibdir='${libexecdir}/xtables'])
+
+PKG_CHECK_MODULES([libxtables], [xtables >= 1.4.3])
+AC_CHECK_HEADERS([linux/netfilter/x_tables.h], [],
+ [AC_MSG_ERROR([You need to have linux/netfilter/x_tables.h, see INSTALL file for details])])
+
+regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
+ -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
+ -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
+ -Winline -pipe -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" \
+ -I\${XA_TOPSRCDIR}/include";
+
+#
+# check kernel version
+#
+if grep -q "CentOS release 5\." /etc/redhat-release 2>/dev/null ||
+ grep -q "Red Hat Enterprise Linux Server release 5" /etc/redhat-release 2>/dev/null; then
+ #
+ # Well, just a warning. Maybe the admin updated the kernel.
+ echo "WARNING: This distribution's shipped kernel is not supported.";
+fi;
+krel="$(make -sC ${kbuilddir} kernelrelease)";
+krel="${krel%%-*}";
+kmajor="${krel%%.*}";
+krel="${krel#*.}";
+kminor="${krel%%.*}";
+krel="${krel#*.}";
+kmicro="${krel%%.*}";
+if test "$kmicro" = "$krel"; then
+ kstable=0;
+else
+ kstable="${krel#*.}";
+ if test -z "$kstable"; then
+ kstable=0;
+ fi;
+fi;
+echo "Found kernel version $kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
+if test "$kmajor" -gt 2 -o "$kminor" -gt 6 -o "$kmicro" -gt 36; then
+ echo "WARNING: You are trying a newer kernel. Results may vary. :-)";
+elif test \( "$kmajor" -lt 2 -o "$kminor" -lt 6 -o "$kmicro" -lt 17 \) -o \
+ \( "$kmajor" -eq 2 -a "$kminor" -eq 6 -a "$kmicro" -eq 18 -a \
+ "$kstable" -lt 5 \); then
+ echo "ERROR: That kernel version is not supported. Please see INSTALL for minimum configuration.";
+ exit 1;
+fi;
+
+AC_SUBST([regular_CFLAGS])
+AC_SUBST([kbuilddir])
+AC_SUBST([xtlibdir])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
Please sign in to comment.
Something went wrong with that request. Please try again.