SHA256
1
0
forked from pool/libseccomp
libseccomp/0001-build-use-autotools-as-build-system.patch

204 lines
5.9 KiB
Diff

From 239b65fde203011208ad63f9f63ef85ddec49ca9 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Wed, 14 Nov 2012 21:30:16 +0100
Subject: [PATCH] build: use autotools as build system
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
Makefile.am | 27
autogen.sh | 5
configure |14281 ++++++++++++++++++++++++++++++++++++++++++++++++-
Makefile.am | 27
autogen.sh | 5
configure |14281 ++++++++++++++++++++++++++++++++++++++++++++++++-
Makefile.am | 27
autogen.sh | 5
configure |14281 ++++++++++++++++++++++++++++++++++++++++++++++++-
Makefile | 1078 +++
Makefile.am | 23
autogen.sh | 5
configure |14281 ++++++++++++++++++++++++++++++++++++++++++++++++-
Makefile.am | 23 +++++++++++++++++++++++
autogen.sh | 5 +++++
configure.ac | 28 ++++++++++++++++++++++++++++
m4/.gitignore | 2 ++
src/Makefile.am | 9 +++++++++
src/system.h | 4 ++--
tests/Makefile.am | 29 +++++++++++++++++++++++++++++
tools/Makefile.am | 6 ++++++
8 files changed, 104 insertions(+), 2 deletions(-)
delete mode 100644 Makefile
create mode 100644 Makefile.am
create mode 100755 autogen.sh
delete mode 100755 configure
create mode 100644 configure.ac
delete mode 100644 doc/Makefile
delete mode 100644 include/Makefile
delete mode 100644 install.mk
create mode 100644 m4/.gitignore
delete mode 100644 macros.mk
delete mode 100644 src/.gitignore
delete mode 100644 src/Makefile
create mode 100644 src/Makefile.am
delete mode 100644 src/python/Makefile
create mode 100644 src/python/Makefile.am
delete mode 100644 tests/Makefile
create mode 100644 tests/Makefile.am
delete mode 100644 tools/Makefile
create mode 100644 tools/Makefile.am
delete mode 100644 version_info
Index: libseccomp-1.0.1/Makefile.am
===================================================================
--- /dev/null
+++ libseccomp-1.0.1/Makefile.am
@@ -0,0 +1,23 @@
+# -*- Makefile -*-
+
+SUBDIRS = src tools tests
+
+ACLOCAL_AMFLAGS = -I m4
+
+pkgconfdir = ${libdir}/pkgconfig
+pkgconf_DATA = libseccomp.pc
+
+include_HEADERS = include/seccomp.h
+
+man_MANS = \
+ doc/man/man3/seccomp_attr_get.3 \
+ doc/man/man3/seccomp_attr_set.3 \
+ doc/man/man3/seccomp_export_bpf.3 \
+ doc/man/man3/seccomp_export_pfc.3 \
+ doc/man/man3/seccomp_init.3 \
+ doc/man/man3/seccomp_load.3 \
+ doc/man/man3/seccomp_release.3 \
+ doc/man/man3/seccomp_reset.3 \
+ doc/man/man3/seccomp_rule_add.3 \
+ doc/man/man3/seccomp_rule_add_exact.3 \
+ doc/man/man3/seccomp_syscall_priority.3
Index: libseccomp-1.0.1/autogen.sh
===================================================================
--- /dev/null
+++ libseccomp-1.0.1/autogen.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+autoreconf -fi;
+rm -Rf autom4te.cache;
+# do not call configure - this is unexpected
Index: libseccomp-1.0.1/configure.ac
===================================================================
--- /dev/null
+++ libseccomp-1.0.1/configure.ac
@@ -0,0 +1,28 @@
+AC_INIT([libseccomp], [1.0.0])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_HEADERS([configure.h])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz])
+AC_PROG_CC
+AM_PROG_CC_C_O
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+AC_DISABLE_STATIC
+LT_INIT
+
+AC_CHECK_HEADER([linux/seccomp.h])
+
+AM_CPPFLAGS="-I\${top_srcdir}/include"
+AM_CFLAGS="-Wall"
+AM_LDFLAGS="-Wl,-z -Wl,relro"
+AC_SUBST([AM_CPPFLAGS])
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
+AC_ARG_ENABLE([python],
+ [AS_HELP_STRING([build the python bindings, requires cython])])
+AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
+
+AC_CONFIG_FILES([Makefile src/Makefile tools/Makefile
+ tests/Makefile libseccomp.pc])
+AC_OUTPUT
Index: libseccomp-1.0.1/m4/.gitignore
===================================================================
--- /dev/null
+++ libseccomp-1.0.1/m4/.gitignore
@@ -0,0 +1,2 @@
+/libtool.m4
+/lt*.m4
Index: libseccomp-1.0.1/src/Makefile.am
===================================================================
--- /dev/null
+++ libseccomp-1.0.1/src/Makefile.am
@@ -0,0 +1,9 @@
+# -*- Makefile -*-
+
+SUBDIRS = .
+
+lib_LTLIBRARIES = libseccomp.la
+
+libseccomp_la_SOURCES = api.c arch.c arch-i386.c arch-i386-syscalls.c \
+ arch-x86_64.c arch-x86_64-syscalls.c db.c hash.c gen_pfc.c gen_bpf.c
+libseccomp_la_LDFLAGS = -version-info 1:0:0
Index: libseccomp-1.0.1/src/system.h
===================================================================
--- libseccomp-1.0.1.orig/src/system.h
+++ libseccomp-1.0.1/src/system.h
@@ -25,9 +25,9 @@
#include <linux/filter.h>
#include <linux/prctl.h>
-#include <configure.h>
+#include "configure.h"
-#ifdef CONF_SYSINC_SECCOMP
+#ifdef HAVE_LINUX_SECCOMP_H
/* system header file */
#include <linux/seccomp.h>
Index: libseccomp-1.0.1/tests/Makefile.am
===================================================================
--- /dev/null
+++ libseccomp-1.0.1/tests/Makefile.am
@@ -0,0 +1,29 @@
+# -*- Makefile -*-
+
+AM_LDFLAGS = -static
+LDADD = util.la ../src/libseccomp.la
+
+check_LTLIBRARIES = util.la
+util_la_SOURCES = util.c
+util_la_LDFLAGS = -module
+
+TESTS = regression
+
+check_PROGRAMS = \
+ 01-allow \
+ 02-basic \
+ 03-basic-chains \
+ 04-multilevel-chains \
+ 05-long-jumps \
+ 06-actions \
+ 07-db-bug-looping \
+ 08-subtree-checks \
+ 09-syscall-priority-pre \
+ 10-syscall-priority-post \
+ 11-basic-errors \
+ 12-basic-masked-ops \
+ 13-attrs \
+ 14-reset \
+ 15-resolver \
+ 16-arch-basic \
+ 17-arch-merge
Index: libseccomp-1.0.1/tools/Makefile.am
===================================================================
--- /dev/null
+++ libseccomp-1.0.1/tools/Makefile.am
@@ -0,0 +1,6 @@
+# -*- Makefile -*-
+
+noinst_PROGRAMS = bpf_disasm bpf_sim
+
+bpf_disasm_SOURCES = bpf_disasm.c
+bpf_sim_SOURCES = bpf_sim.c