|
|
05e71a |
From fe81d4fa47b6b69e01de7f7d41002b8e12fec284 Mon Sep 17 00:00:00 2001
|
|
|
05e71a |
From: Jan Engelhardt <jengelh@inai.de>
|
|
|
05e71a |
Date: Wed, 27 Jun 2018 11:50:43 +0200
|
|
|
05e71a |
Subject: [PATCH] build: move to automake
|
|
|
05e71a |
|
|
|
05e71a |
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
|
05e71a |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
05e71a |
---
|
|
|
05e71a |
.gitignore | 23 +++++-
|
|
|
05e71a |
INSTALL | 99 +++++++++--------------
|
|
|
05e71a |
Makefile | 214 --------------------------------------------------
|
|
|
05e71a |
Makefile.am | 76 ++++++++++++++++++
|
|
|
05e71a |
autogen.sh | 4 +
|
|
|
05e71a |
configure.ac | 23 ++++++
|
|
|
05e71a |
m4/.gitignore | 2 +
|
|
|
05e71a |
7 files changed, 163 insertions(+), 278 deletions(-)
|
|
|
05e71a |
delete mode 100644 Makefile
|
|
|
05e71a |
create mode 100644 Makefile.am
|
|
|
05e71a |
create mode 100755 autogen.sh
|
|
|
05e71a |
create mode 100644 configure.ac
|
|
|
05e71a |
create mode 100644 m4/.gitignore
|
|
|
05e71a |
|
|
|
05e71a |
diff --git a/.gitignore b/.gitignore
|
|
|
05e71a |
index d2fc36e763a45..1fff83c78ba13 100644
|
|
|
05e71a |
--- a/.gitignore
|
|
|
05e71a |
+++ b/.gitignore
|
|
|
05e71a |
@@ -1,7 +1,28 @@
|
|
|
05e71a |
-*.o
|
|
|
05e71a |
+*.a
|
|
|
05e71a |
+*.la
|
|
|
05e71a |
+*.lo
|
|
|
05e71a |
*.so
|
|
|
05e71a |
+*.o
|
|
|
05e71a |
+.deps/
|
|
|
05e71a |
+.dirstamp
|
|
|
05e71a |
+.libs/
|
|
|
05e71a |
+Makefile
|
|
|
05e71a |
+Makefile.in
|
|
|
05e71a |
+
|
|
|
05e71a |
+/aclocal.m4
|
|
|
05e71a |
+/autom4te.cache/
|
|
|
05e71a |
+/build-aux/
|
|
|
05e71a |
+/config.*
|
|
|
05e71a |
+/configure
|
|
|
05e71a |
+/libtool
|
|
|
05e71a |
+/stamp-h1
|
|
|
05e71a |
+
|
|
|
05e71a |
/ebtables
|
|
|
05e71a |
+/ebtables-config
|
|
|
05e71a |
/ebtables-restore
|
|
|
05e71a |
+/ebtables-save
|
|
|
05e71a |
+/ebtables.8
|
|
|
05e71a |
+/ebtables.sysv
|
|
|
05e71a |
/ebtablesd
|
|
|
05e71a |
/ebtablesu
|
|
|
05e71a |
/static
|
|
|
05e71a |
diff --git a/INSTALL b/INSTALL
|
|
|
05e71a |
index e90d5c103bdc4..c43d95c3ed256 100644
|
|
|
05e71a |
--- a/INSTALL
|
|
|
05e71a |
+++ b/INSTALL
|
|
|
05e71a |
@@ -1,63 +1,36 @@
|
|
|
05e71a |
-FOLLOW THESE SIMPLE GUIDELINES:
|
|
|
05e71a |
--------------------------------
|
|
|
05e71a |
-
|
|
|
05e71a |
-Compiling the source code:
|
|
|
05e71a |
-%make
|
|
|
05e71a |
-Put the files in the right directories:
|
|
|
05e71a |
-%make install
|
|
|
05e71a |
-
|
|
|
05e71a |
-If you are using the CVS code or need your own kernel includes, do this
|
|
|
05e71a |
-instead (change the include directory to the appropriate one):
|
|
|
05e71a |
-%make install KERNEL_INCLUDES=/usr/src/linux/include
|
|
|
05e71a |
-
|
|
|
05e71a |
-If you want to make a static binary for ebtables, containing all the
|
|
|
05e71a |
-extensions, without shared libraries, do this (this will make a
|
|
|
05e71a |
-binary called 'static', which you can rename):
|
|
|
05e71a |
-%make static
|
|
|
05e71a |
-
|
|
|
05e71a |
-WHAT GETS INSTALLED AND WHAT OPTIONS ARE AVAILABLE?
|
|
|
05e71a |
----------------------------------------------------
|
|
|
05e71a |
-
|
|
|
05e71a |
-- The ebtables manual gets installed in /usr/local/man/man8
|
|
|
05e71a |
- To put the manual somewhere else, include MANDIR=<<man-path/man>> as
|
|
|
05e71a |
- option on the command line.
|
|
|
05e71a |
- The Makefile will append /man8/ebtables.8.
|
|
|
05e71a |
-- ethertypes is by default placed in /etc/, if you
|
|
|
05e71a |
- want to change this, include ETHERTYPESPATH=<<path>>.
|
|
|
05e71a |
-- The userspace programs ebtables ebtables-save and ebtables-restore are
|
|
|
05e71a |
- are copied by default to /usr/local/sbin/ebtables. If you want to put
|
|
|
05e71a |
- the executables somewhere else, include BINPATH=<<path>>.
|
|
|
05e71a |
-- The ebtables initialisation file (enabling use of 'service ebtables') is
|
|
|
05e71a |
- copied to /etc/rc.d/init.d (change with option INITDIR)
|
|
|
05e71a |
-- The ebtables configuration file (ebtables-config) is copied to /etc/sysconfig
|
|
|
05e71a |
-- ebtables can use a lock file to enable concurrent execution of the ebtables
|
|
|
05e71a |
- tool. The standard location of the lock file is /var/lib/ebtables/lock.
|
|
|
05e71a |
- Include LOCKFILE=<<path-to-file>> if you want to use another file.
|
|
|
05e71a |
-
|
|
|
05e71a |
-That's all
|
|
|
05e71a |
-
|
|
|
05e71a |
-You can also use a base directory different from the root directory (/),
|
|
|
05e71a |
-using the DESTDIR option. See the Makefile for more details.
|
|
|
05e71a |
-
|
|
|
05e71a |
-You might need to set LDFLAGS=-Wl,-no-as-needed to build ebtables correctly
|
|
|
05e71a |
-on your system.
|
|
|
05e71a |
-
|
|
|
05e71a |
-ADDITIONAL PROGRAMS:
|
|
|
05e71a |
-----------------------
|
|
|
05e71a |
--- examples/ulog/test_ulog.c --
|
|
|
05e71a |
-
|
|
|
05e71a |
-Contains an example to receive and parse netlink messages containing
|
|
|
05e71a |
-packets seen by the ebtables ulog watcher.
|
|
|
05e71a |
-
|
|
|
05e71a |
-Compile with:
|
|
|
05e71a |
-%make test_ulog KERNEL_INCLUDES=/usr/src/linux/include
|
|
|
05e71a |
-
|
|
|
05e71a |
-Usage:
|
|
|
05e71a |
-%examples/ulog/test_ulog NETLINK_GROUP
|
|
|
05e71a |
-%ebtables -A chain --ulog-nlgroup NETLINK_GROUP
|
|
|
05e71a |
-
|
|
|
05e71a |
--- examples/perf_test/perf_test --
|
|
|
05e71a |
-
|
|
|
05e71a |
-A test script to compare the performance for the different ways to
|
|
|
05e71a |
-construct an ebtables table. This is deprecated and should probably
|
|
|
05e71a |
-be ignored.
|
|
|
05e71a |
+Installation instructions for iptables
|
|
|
05e71a |
+======================================
|
|
|
05e71a |
+
|
|
|
05e71a |
+ebtables uses the well-known configure(autotools) infrastructure.
|
|
|
05e71a |
+
|
|
|
05e71a |
+ $ ./configure
|
|
|
05e71a |
+ $ make
|
|
|
05e71a |
+ # make install
|
|
|
05e71a |
+
|
|
|
05e71a |
+
|
|
|
05e71a |
+Prerequisites
|
|
|
05e71a |
+=============
|
|
|
05e71a |
+
|
|
|
05e71a |
+ * no kernel-source required
|
|
|
05e71a |
+
|
|
|
05e71a |
+ * but obviously a compiler, glibc-devel and linux-kernel-headers
|
|
|
05e71a |
+ (/usr/include/linux)
|
|
|
05e71a |
+
|
|
|
05e71a |
+
|
|
|
05e71a |
+Configuring and compiling
|
|
|
05e71a |
+=========================
|
|
|
05e71a |
+
|
|
|
05e71a |
+./configure [options]
|
|
|
05e71a |
+
|
|
|
05e71a |
+--prefix=
|
|
|
05e71a |
+
|
|
|
05e71a |
+ The prefix to put all installed files under. It defaults to
|
|
|
05e71a |
+ /usr/local, so the binaries will go into /usr/local/bin, sbin,
|
|
|
05e71a |
+ manpages into /usr/local/share/man, etc.
|
|
|
05e71a |
+
|
|
|
05e71a |
+If you want to enable debugging, use
|
|
|
05e71a |
+
|
|
|
05e71a |
+ ./configure CFLAGS="-ggdb3 -O0" CPPFLAGS="-DEBT_DEBUG"
|
|
|
05e71a |
+
|
|
|
05e71a |
+(-O0 is used to turn off instruction reordering, which makes debugging
|
|
|
05e71a |
+much easier.)
|
|
|
05e71a |
diff --git a/Makefile b/Makefile
|
|
|
05e71a |
deleted file mode 100644
|
|
|
05e71a |
index 4d7b10f4916d6..0000000000000
|
|
|
05e71a |
--- a/Makefile
|
|
|
05e71a |
+++ /dev/null
|
|
|
05e71a |
@@ -1,214 +0,0 @@
|
|
|
05e71a |
-# ebtables Makefile
|
|
|
05e71a |
-
|
|
|
05e71a |
-PROGNAME:=ebtables
|
|
|
05e71a |
-PROGRELEASE:=4
|
|
|
05e71a |
-PROGVERSION_:=2.0.10
|
|
|
05e71a |
-PROGVERSION:=$(PROGVERSION_)-$(PROGRELEASE)
|
|
|
05e71a |
-PROGDATE:=December\ 2011
|
|
|
05e71a |
-LOCKFILE?=/var/lib/ebtables/lock
|
|
|
05e71a |
-LOCKDIR:=$(shell echo $(LOCKFILE) | sed 's/\(.*\)\/.*/\1/')/
|
|
|
05e71a |
-
|
|
|
05e71a |
-# default paths
|
|
|
05e71a |
-LIBDIR:=/usr/lib
|
|
|
05e71a |
-MANDIR:=/usr/local/man
|
|
|
05e71a |
-BINDIR:=/usr/local/sbin
|
|
|
05e71a |
-ETCDIR:=/etc
|
|
|
05e71a |
-INITDIR:=/etc/rc.d/init.d
|
|
|
05e71a |
-SYSCONFIGDIR:=/etc/sysconfig
|
|
|
05e71a |
-DESTDIR:=
|
|
|
05e71a |
-
|
|
|
05e71a |
-CFLAGS:=-Wall -Wunused -Werror
|
|
|
05e71a |
-CFLAGS_SH_LIB:=-fPIC -O3
|
|
|
05e71a |
-CC:=gcc
|
|
|
05e71a |
-
|
|
|
05e71a |
-ifeq ($(shell uname -m),sparc64)
|
|
|
05e71a |
-CFLAGS+=-DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
|
|
|
05e71a |
-endif
|
|
|
05e71a |
-
|
|
|
05e71a |
-include extensions/Makefile
|
|
|
05e71a |
-
|
|
|
05e71a |
-OBJECTS2:=getethertype.o communication.o libebtc.o \
|
|
|
05e71a |
-useful_functions.o ebtables.o
|
|
|
05e71a |
-
|
|
|
05e71a |
-OBJECTS:=$(OBJECTS2) $(EXT_OBJS) $(EXT_LIBS)
|
|
|
05e71a |
-
|
|
|
05e71a |
-KERNEL_INCLUDES?=include/
|
|
|
05e71a |
-
|
|
|
05e71a |
-ETHERTYPESPATH?=$(ETCDIR)
|
|
|
05e71a |
-ETHERTYPESFILE:=$(ETHERTYPESPATH)/ethertypes
|
|
|
05e71a |
-
|
|
|
05e71a |
-PIPE_DIR?=/tmp/$(PROGNAME)-v$(PROGVERSION)
|
|
|
05e71a |
-PIPE=$(PIPE_DIR)/ebtablesd_pipe
|
|
|
05e71a |
-EBTD_CMDLINE_MAXLN?=2048
|
|
|
05e71a |
-EBTD_ARGC_MAX?=50
|
|
|
05e71a |
-
|
|
|
05e71a |
-PROGSPECS:=-DPROGVERSION=\"$(PROGVERSION)\" \
|
|
|
05e71a |
- -DPROGNAME=\"$(PROGNAME)\" \
|
|
|
05e71a |
- -DPROGDATE=\"$(PROGDATE)\" \
|
|
|
05e71a |
- -D_PATH_ETHERTYPES=\"$(ETHERTYPESFILE)\" \
|
|
|
05e71a |
- -DEBTD_ARGC_MAX=$(EBTD_ARGC_MAX) \
|
|
|
05e71a |
- -DEBTD_CMDLINE_MAXLN=$(EBTD_CMDLINE_MAXLN) \
|
|
|
05e71a |
- -DLOCKFILE=\"$(LOCKFILE)\" \
|
|
|
05e71a |
- -DLOCKDIR=\"$(LOCKDIR)\"
|
|
|
05e71a |
-
|
|
|
05e71a |
-# You can probably ignore this, ebtables{u,d} are normally not used
|
|
|
05e71a |
-PROGSPECSD:=-DPROGVERSION=\"$(PROGVERSION)\" \
|
|
|
05e71a |
- -DPROGNAME=\"$(PROGNAME)\" \
|
|
|
05e71a |
- -DPROGDATE=\"$(PROGDATE)\" \
|
|
|
05e71a |
- -D_PATH_ETHERTYPES=\"$(ETHERTYPESFILE)\" \
|
|
|
05e71a |
- -DEBTD_CMDLINE_MAXLN=$(EBTD_CMDLINE_MAXLN) \
|
|
|
05e71a |
- -DEBTD_ARGC_MAX=$(EBTD_ARGC_MAX) \
|
|
|
05e71a |
- -DEBTD_PIPE=\"$(PIPE)\" \
|
|
|
05e71a |
- -DEBTD_PIPE_DIR=\"$(PIPE_DIR)\"
|
|
|
05e71a |
-
|
|
|
05e71a |
-# Uncomment for debugging (slower)
|
|
|
05e71a |
-#PROGSPECS+=-DEBT_DEBUG
|
|
|
05e71a |
-#PROGSPECSD+=-DEBT_DEBUG
|
|
|
05e71a |
-#CFLAGS+=-ggdb
|
|
|
05e71a |
-
|
|
|
05e71a |
-all: ebtables ebtables-restore
|
|
|
05e71a |
-
|
|
|
05e71a |
-communication.o: communication.c include/ebtables_u.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES)
|
|
|
05e71a |
-
|
|
|
05e71a |
-libebtc.o: libebtc.c include/ebtables_u.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES)
|
|
|
05e71a |
-
|
|
|
05e71a |
-useful_functions.o: useful_functions.c include/ebtables_u.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES)
|
|
|
05e71a |
-
|
|
|
05e71a |
-getethertype.o: getethertype.c include/ethernetdb.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(PROGSPECS) -c -o $@ $< -Iinclude/
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtables.o: ebtables.c include/ebtables_u.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES)
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtables-standalone.o: ebtables-standalone.c include/ebtables_u.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(PROGSPECS) -c $< -o $@ -I$(KERNEL_INCLUDES)
|
|
|
05e71a |
-
|
|
|
05e71a |
-libebtc.so: $(OBJECTS2)
|
|
|
05e71a |
- $(CC) -shared $(LDFLAGS) -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2)
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtables: $(OBJECTS) ebtables-standalone.o libebtc.so
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \
|
|
|
05e71a |
- -Wl,-rpath,$(LIBDIR)
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtablesu: ebtablesu.c
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(PROGSPECSD) $< -o $@
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtablesd.o: ebtablesd.c include/ebtables_u.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(PROGSPECSD) -c $< -o $@ -I$(KERNEL_INCLUDES)
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtablesd: $(OBJECTS) ebtablesd.o libebtc.so
|
|
|
05e71a |
- $(CC) $(CFLAGS) -o $@ ebtablesd.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \
|
|
|
05e71a |
- -Wl,-rpath,$(LIBDIR)
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtables-restore.o: ebtables-restore.c include/ebtables_u.h
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(PROGSPECS) -c $< -o $@ -I$(KERNEL_INCLUDES)
|
|
|
05e71a |
-
|
|
|
05e71a |
-ebtables-restore: $(OBJECTS) ebtables-restore.o libebtc.so
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ ebtables-restore.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \
|
|
|
05e71a |
- -Wl,-rpath,$(LIBDIR)
|
|
|
05e71a |
-
|
|
|
05e71a |
-.PHONY: daemon
|
|
|
05e71a |
-daemon: ebtablesd ebtablesu
|
|
|
05e71a |
-
|
|
|
05e71a |
-# a little scripting for a static binary, making one for ebtables-restore
|
|
|
05e71a |
-# should be completely analogous
|
|
|
05e71a |
-static: extensions/ebt_*.c extensions/ebtable_*.c ebtables.c communication.c ebtables-standalone.c getethertype.c libebtc.c useful_functions.c
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(LDFLAGS) $(PROGSPECS) -o $@ $^ -I$(KERNEL_INCLUDES) -Iinclude
|
|
|
05e71a |
-
|
|
|
05e71a |
-tmp1:=$(shell printf $(BINDIR) | sed 's/\//\\\//g')
|
|
|
05e71a |
-tmp2:=$(shell printf $(SYSCONFIGDIR) | sed 's/\//\\\//g')
|
|
|
05e71a |
-tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g')
|
|
|
05e71a |
-.PHONY: scripts
|
|
|
05e71a |
-scripts: ebtables-save.in ebtables.sysv.in ebtables-config.in
|
|
|
05e71a |
- sed -e 's/[@]sbindir@/$(tmp1)/g' <ebtables-save.in >ebtables-save_
|
|
|
05e71a |
- mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
05e71a |
- install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
|
|
|
05e71a |
- sed -e 's/[@]sbindir@/$(tmp1)/g' -e 's/[@]sysconfigdir@/$(tmp2)/g' <ebtables.sysv.in >ebtables.sysv_
|
|
|
05e71a |
- if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
|
|
|
05e71a |
- if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
|
|
|
05e71a |
- sed -e 's/[@]sysconfigdir@/$(tmp2)/g' <ebtables-config >ebtables-config_
|
|
|
05e71a |
- if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi
|
|
|
05e71a |
- if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
|
|
|
05e71a |
- rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
|
|
|
05e71a |
-
|
|
|
05e71a |
-tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g')
|
|
|
05e71a |
-$(MANDIR)/man8/ebtables.8: ebtables.8.in
|
|
|
05e71a |
- mkdir -p $(DESTDIR)$(@D)
|
|
|
05e71a |
- sed -e 's/[@]PACKAGE_VERSION@/$(PROGVERSION)/' -e 's/[@]PACKAGE_DATE@/$(PROGDATE)/' -e 's/[@]LOCKFILE@/$(tmp4)/' <$< >ebtables.8_
|
|
|
05e71a |
- install -m 0644 ebtables.8_ $(DESTDIR)$@
|
|
|
05e71a |
- rm -f ebtables.8_
|
|
|
05e71a |
-
|
|
|
05e71a |
-$(DESTDIR)$(ETHERTYPESFILE): ethertypes
|
|
|
05e71a |
- mkdir -p $(@D)
|
|
|
05e71a |
- install -m 0644 $< $@
|
|
|
05e71a |
-
|
|
|
05e71a |
-.PHONY: exec
|
|
|
05e71a |
-exec: ebtables ebtables-restore
|
|
|
05e71a |
- mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
05e71a |
- install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
|
|
|
05e71a |
- install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
|
|
|
05e71a |
-
|
|
|
05e71a |
-.PHONY: install
|
|
|
05e71a |
-install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts
|
|
|
05e71a |
- mkdir -p $(DESTDIR)$(LIBDIR)
|
|
|
05e71a |
- install -m 0755 extensions/*.so $(DESTDIR)$(LIBDIR)
|
|
|
05e71a |
- install -m 0755 *.so $(DESTDIR)$(LIBDIR)
|
|
|
05e71a |
-
|
|
|
05e71a |
-.PHONY: clean
|
|
|
05e71a |
-clean:
|
|
|
05e71a |
- rm -f ebtables ebtables-restore ebtablesd ebtablesu static
|
|
|
05e71a |
- rm -f *.o *~ *.so
|
|
|
05e71a |
- rm -f extensions/*.o extensions/*.c~ extensions/*.so include/*~
|
|
|
05e71a |
-
|
|
|
05e71a |
-DIR:=$(PROGNAME)-v$(PROGVERSION)
|
|
|
05e71a |
-CVSDIRS:=CVS extensions/CVS examples/CVS examples/perf_test/CVS \
|
|
|
05e71a |
-examples/ulog/CVS include/CVS
|
|
|
05e71a |
-# This is used to make a new userspace release, some files are altered so
|
|
|
05e71a |
-# do this on a temporary version
|
|
|
05e71a |
-.PHONY: release
|
|
|
05e71a |
-release:
|
|
|
05e71a |
- rm -f extensions/ebt_inat.c
|
|
|
05e71a |
- rm -rf $(CVSDIRS)
|
|
|
05e71a |
- mkdir -p include/linux/netfilter_bridge
|
|
|
05e71a |
- install -m 0644 \
|
|
|
05e71a |
- $(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/
|
|
|
05e71a |
-# To keep possible compile error complaints about undefined ETH_P_8021Q
|
|
|
05e71a |
-# off my back
|
|
|
05e71a |
- install -m 0644 \
|
|
|
05e71a |
- $(KERNEL_INCLUDES)/linux/if_ether.h include/linux/
|
|
|
05e71a |
- install -m 0644 \
|
|
|
05e71a |
- $(KERNEL_INCLUDES)/linux/types.h include/linux/
|
|
|
05e71a |
- install -m 0644 \
|
|
|
05e71a |
- $(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \
|
|
|
05e71a |
- include/linux/netfilter_bridge/
|
|
|
05e71a |
- install -m 0644 \
|
|
|
05e71a |
- include/ebtables.h include/linux/netfilter_bridge/
|
|
|
05e71a |
- make clean
|
|
|
05e71a |
- touch *
|
|
|
05e71a |
- touch extensions/*
|
|
|
05e71a |
- touch include/*
|
|
|
05e71a |
- touch include/linux/*
|
|
|
05e71a |
- touch include/linux/netfilter_bridge/*
|
|
|
05e71a |
- sed -i -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' <ebtables.8.in >ebtables.8
|
|
|
05e71a |
- sed -i -e 's/$$(VERSION)/$(PROGVERSION_)/' -e 's/$$(RELEASE)/$(PROGRELEASE)/' ebtables.spec
|
|
|
05e71a |
- cd ..;tar -c $(DIR) | gzip >$(DIR).tar.gz; cd -
|
|
|
05e71a |
- rm -rf include/linux
|
|
|
05e71a |
-
|
|
|
05e71a |
-# This will make the rpm and put it in /usr/src/redhat/RPMS
|
|
|
05e71a |
-# (do this as root after make release)
|
|
|
05e71a |
-.PHONY: rpmbuild
|
|
|
05e71a |
-rpmbuild:
|
|
|
05e71a |
- cp ../$(DIR).tar.gz /usr/src/redhat/SOURCES/
|
|
|
05e71a |
- rpmbuild --buildroot $(shell mktemp -td $(DIR)-XXXXX) -bb ebtables.spec
|
|
|
05e71a |
-
|
|
|
05e71a |
-.PHONY: test_ulog
|
|
|
05e71a |
-test_ulog: examples/ulog/test_ulog.c getethertype.o
|
|
|
05e71a |
- $(CC) $(CFLAGS) $< -o test_ulog -I$(KERNEL_INCLUDES) -lc \
|
|
|
05e71a |
- getethertype.o
|
|
|
05e71a |
- mv test_ulog examples/ulog/
|
|
|
05e71a |
-
|
|
|
05e71a |
-.PHONY: examples
|
|
|
05e71a |
-examples: test_ulog
|
|
|
05e71a |
diff --git a/Makefile.am b/Makefile.am
|
|
|
05e71a |
new file mode 100644
|
|
|
05e71a |
index 0000000000000..14938fea4f252
|
|
|
05e71a |
--- /dev/null
|
|
|
05e71a |
+++ b/Makefile.am
|
|
|
05e71a |
@@ -0,0 +1,76 @@
|
|
|
05e71a |
+# -*- Makefile -*-
|
|
|
05e71a |
+
|
|
|
05e71a |
+# For debugging, use ./configure CPPFLAGS=-DEBT_DEBUG CFLAGS="-O0 -ggdb3"
|
|
|
05e71a |
+
|
|
|
05e71a |
+PROGNAME = ${PACKAGE_NAME}
|
|
|
05e71a |
+PROGVERSION = ${PACKAGE_VERSION}
|
|
|
05e71a |
+PROGDATE = December\ 2011
|
|
|
05e71a |
+LOCKDIR = /var/lib/ebtables
|
|
|
05e71a |
+LOCKFILE = ${LOCKDIR}/lock
|
|
|
05e71a |
+INITDIR = /etc/rc.d/init.d
|
|
|
05e71a |
+initddir = ${INITDIR}
|
|
|
05e71a |
+sysconfigdir = ${sysconfdir}/sysconfig
|
|
|
05e71a |
+EBTD_CMDLINE_MAXLN = 2048
|
|
|
05e71a |
+EBTD_ARGC_MAX = 50
|
|
|
05e71a |
+PIPE_DIR = /tmp/${PACKAGE_NAME}-v${PROGVERSION}
|
|
|
05e71a |
+PIPE = ${PIPE_DIR}/ebtablesd_pipe
|
|
|
05e71a |
+
|
|
|
05e71a |
+
|
|
|
05e71a |
+ACLOCAL_AMFLAGS = -I m4
|
|
|
05e71a |
+AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include \
|
|
|
05e71a |
+ -DPROGVERSION=\"${PACKAGE_VERSION}\" -DPROGNAME=\"${PACKAGE_NAME}\" \
|
|
|
05e71a |
+ -DPROGDATE=\"${PROGDATE}\" \
|
|
|
05e71a |
+ -D_PATH_ETHERTYPES=\"${sysconfdir}/ethertypes\" \
|
|
|
05e71a |
+ -DLOCKFILE=\"${LOCKFILE}\" -DLOCKDIR=\"${LOCKDIR}\" \
|
|
|
05e71a |
+ -DEBTD_ARGC_MAX=${EBTD_ARGC_MAX} -DEBTD_CMDLINE_MAXLN=${EBTD_CMDLINE_MAXLN} \
|
|
|
05e71a |
+ -DEBTD_PIPE=\"${PIPE}\" -DEBTD_PIPE_DIR=\"${PIPE_DIR}\"
|
|
|
05e71a |
+AM_CFLAGS = ${regular_CFLAGS}
|
|
|
05e71a |
+
|
|
|
05e71a |
+sbin_PROGRAMS = ebtables ebtablesd ebtablesu ebtables-restore
|
|
|
05e71a |
+EXTRA_PROGRAMS = static examples/ulog/test_ulog
|
|
|
05e71a |
+sysconf_DATA = ethertypes
|
|
|
05e71a |
+sbin_SCRIPTS = ebtables-save
|
|
|
05e71a |
+man8_MANS = ebtables.8
|
|
|
05e71a |
+lib_LTLIBRARIES = libebtc.la
|
|
|
05e71a |
+
|
|
|
05e71a |
+libebtc_la_SOURCES = \
|
|
|
05e71a |
+ communication.c ebtables.c getethertype.c \
|
|
|
05e71a |
+ libebtc.c useful_functions.c \
|
|
|
05e71a |
+ extensions/ebt_802_3.c extensions/ebt_among.c extensions/ebt_arp.c \
|
|
|
05e71a |
+ extensions/ebt_arpreply.c extensions/ebt_ip.c extensions/ebt_ip6.c \
|
|
|
05e71a |
+ extensions/ebt_limit.c extensions/ebt_log.c extensions/ebt_mark.c \
|
|
|
05e71a |
+ extensions/ebt_mark_m.c extensions/ebt_nat.c extensions/ebt_nflog.c \
|
|
|
05e71a |
+ extensions/ebt_pkttype.c extensions/ebt_redirect.c \
|
|
|
05e71a |
+ extensions/ebt_standard.c extensions/ebt_stp.c extensions/ebt_string.c \
|
|
|
05e71a |
+ extensions/ebt_ulog.c extensions/ebt_vlan.c \
|
|
|
05e71a |
+ extensions/ebtable_broute.c extensions/ebtable_filter.c \
|
|
|
05e71a |
+ extensions/ebtable_nat.c
|
|
|
05e71a |
+# Make sure ebtables.c can be built twice
|
|
|
05e71a |
+libebtc_la_CPPFLAGS = ${AM_CPPFLAGS}
|
|
|
05e71a |
+ebtables_SOURCES = ebtables-standalone.c
|
|
|
05e71a |
+ebtables_LDADD = libebtc.la
|
|
|
05e71a |
+ebtablesd_LDADD = libebtc.la
|
|
|
05e71a |
+ebtables_restore_LDADD = libebtc.la
|
|
|
05e71a |
+static_SOURCES = ebtables.c
|
|
|
05e71a |
+static_LDFLAGS = -static
|
|
|
05e71a |
+static_LDADD = libebtc.la
|
|
|
05e71a |
+examples_ulog_test_ulog_SOURCES = examples/ulog/test_ulog.c getethertype.c
|
|
|
05e71a |
+
|
|
|
05e71a |
+daemon: ebtablesd ebtablesu
|
|
|
05e71a |
+exec: ebtables ebtables-restore
|
|
|
05e71a |
+
|
|
|
05e71a |
+CLEANFILES = ebtables-save ebtables.sysv ebtables-config ebtables.8
|
|
|
05e71a |
+
|
|
|
05e71a |
+ebtables-save: ebtables-save.in ${top_builddir}/config.status
|
|
|
05e71a |
+ ${AM_V_GEN}sed -e 's![@]sbindir@!${sbindir}!g' <$< >$@
|
|
|
05e71a |
+
|
|
|
05e71a |
+ebtables.sysv: ebtables.sysv.in ${top_builddir}/config.status
|
|
|
05e71a |
+ ${AM_V_GEN}sed -e 's![@]sbindir@!${sbindir}!g' -e 's![@]sysconfigdir@!${sysconfigdir}!g' <$< >$@
|
|
|
05e71a |
+
|
|
|
05e71a |
+ebtables-config: ebtables-config.in ${top_builddir}/config.status
|
|
|
05e71a |
+ ${AM_V_GEN}sed -e 's![@]sysconfigdir@!${sysconfigdir}!g' <$< >$@
|
|
|
05e71a |
+
|
|
|
05e71a |
+ebtables.8: ebtables.8.in ${top_builddir}/config.status
|
|
|
05e71a |
+ ${AM_V_GEN}sed -e 's![@]PACKAGE_VERSION!${PACKAGE_VERSION}!g' \
|
|
|
05e71a |
+ -e 's![@]PACKAGE_DATE@!${PROGDATE}!g' \
|
|
|
05e71a |
+ -e 's![@]LOCKFILE@!${LOCKFILE}!g' <$< >$@
|
|
|
05e71a |
diff --git a/autogen.sh b/autogen.sh
|
|
|
05e71a |
new file mode 100755
|
|
|
05e71a |
index 0000000000000..a0c4395f356fd
|
|
|
05e71a |
--- /dev/null
|
|
|
05e71a |
+++ b/autogen.sh
|
|
|
05e71a |
@@ -0,0 +1,4 @@
|
|
|
05e71a |
+#!/bin/sh -e
|
|
|
05e71a |
+
|
|
|
05e71a |
+autoreconf -fi;
|
|
|
05e71a |
+rm -Rf autom4te*.cache;
|
|
|
05e71a |
diff --git a/configure.ac b/configure.ac
|
|
|
05e71a |
new file mode 100644
|
|
|
05e71a |
index 0000000000000..a3bc3c93a279f
|
|
|
05e71a |
--- /dev/null
|
|
|
05e71a |
+++ b/configure.ac
|
|
|
05e71a |
@@ -0,0 +1,23 @@
|
|
|
05e71a |
+AC_INIT([ebtables], [2.0.10.4])
|
|
|
05e71a |
+AC_CONFIG_AUX_DIR([build-aux])
|
|
|
05e71a |
+AC_CONFIG_HEADERS([config.h])
|
|
|
05e71a |
+AC_CONFIG_MACRO_DIR([m4])
|
|
|
05e71a |
+AC_PROG_INSTALL
|
|
|
05e71a |
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax])
|
|
|
05e71a |
+AC_PROG_CC
|
|
|
05e71a |
+AM_PROG_CC_C_O
|
|
|
05e71a |
+AC_DISABLE_STATIC
|
|
|
05e71a |
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
|
|
05e71a |
+AM_PROG_LIBTOOL
|
|
|
05e71a |
+
|
|
|
05e71a |
+regular_CFLAGS="-Wall -Wunused"
|
|
|
05e71a |
+regular_CPPFLAGS=""
|
|
|
05e71a |
+case "$host" in
|
|
|
05e71a |
+ sparc64-*)
|
|
|
05e71a |
+ regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32";;
|
|
|
05e71a |
+esac
|
|
|
05e71a |
+
|
|
|
05e71a |
+AC_SUBST([regular_CFLAGS])
|
|
|
05e71a |
+AC_SUBST([regular_CPPFLAGS])
|
|
|
05e71a |
+AC_CONFIG_FILES([Makefile])
|
|
|
05e71a |
+AC_OUTPUT
|
|
|
05e71a |
diff --git a/m4/.gitignore b/m4/.gitignore
|
|
|
05e71a |
new file mode 100644
|
|
|
05e71a |
index 0000000000000..64d9bbcdd5ce9
|
|
|
05e71a |
--- /dev/null
|
|
|
05e71a |
+++ b/m4/.gitignore
|
|
|
05e71a |
@@ -0,0 +1,2 @@
|
|
|
05e71a |
+/libtool.m4
|
|
|
05e71a |
+/lt*.m4
|
|
|
05e71a |
--
|
|
|
05e71a |
2.21.0
|
|
|
05e71a |
|