summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-10-21 16:14:10 -0400
committerPaul Moore <pmoore@redhat.com>2014-10-21 16:14:10 -0400
commit7aa14c4190d33dbd081f89b912ffc59f2d8cf0d0 (patch)
tree982181ebad6d2661fbe5d696c5b760e257a5b098
parent7521c01d5dc9ca44d34e79688bbee0834ec5648a (diff)
downloadlibseccomp-7aa14c4190d33dbd081f89b912ffc59f2d8cf0d0.tar.gz
build: allow the creation of a static library
Signed-off-by: Paul Moore <pmoore@redhat.com>
-rw-r--r--configure.ac2
-rw-r--r--src/Makefile.am15
-rw-r--r--src/arch-syscall-dump.c14
-rw-r--r--src/python/Makefile.am2
-rw-r--r--src/python/setup.py2
-rw-r--r--tests/Makefile.am2
-rw-r--r--tools/Makefile.am6
7 files changed, 18 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac
index cdd8905..357cf87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
dnl ####
dnl libtool configuration
dnl ####
-LT_INIT([shared disable-static pic-only])
+LT_INIT([shared pic-only])
dnl ####
dnl enable silent builds by default
diff --git a/src/Makefile.am b/src/Makefile.am
index f3cce7b..9b2bc13 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,20 +42,15 @@ TESTS = arch-syscall-check
check_PROGRAMS = arch-syscall-check arch-syscall-dump
-noinst_LTLIBRARIES = libseccomp-internal.la
lib_LTLIBRARIES = libseccomp.la
-arch_syscall_dump_SOURCES = arch-syscall-dump.c
-arch_syscall_dump_LDADD = libseccomp-internal.la
+arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ARCH}
-arch_syscall_check_SOURCES = arch-syscall-check.c
-arch_syscall_check_LDADD = libseccomp-internal.la
+arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ARCH}
-libseccomp_internal_la_SOURCES = ${SOURCES_GEN} ${SOURCES_ARCH}
-
-libseccomp_la_SOURCES = libseccomp-internal.la
-libseccomp_la_CFLAGS = -fvisibility=hidden
-libseccomp_la_LDFLAGS = \
+libseccomp_la_SOURCES = ${SOURCES_GEN} ${SOURCES_ARCH}
+libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden
+libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \
-version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO}
check-build:
diff --git a/src/arch-syscall-dump.c b/src/arch-syscall-dump.c
index 4a4d22e..4f53070 100644
--- a/src/arch-syscall-dump.c
+++ b/src/arch-syscall-dump.c
@@ -58,20 +58,17 @@ static void exit_usage(const char *program)
int main(int argc, char *argv[])
{
int opt;
- uint32_t arch;
- int offset;
+ const struct arch_def *arch = arch_def_native;
+ int offset = 0;
int iter;
int sys_num;
const char *sys_name;
- arch = seccomp_arch_native();
- offset = 0;
-
/* parse the command line */
while ((opt = getopt(argc, argv, "a:o:h")) > 0) {
switch (opt) {
case 'a':
- arch = seccomp_arch_resolve_name(optarg);
+ arch = arch_def_lookup_name(optarg);
if (arch == 0)
exit_usage(argv[0]);
break;
@@ -87,7 +84,7 @@ int main(int argc, char *argv[])
iter = 0;
do {
- switch (arch) {
+ switch (arch->token) {
case SCMP_ARCH_X86:
sys_name = x86_syscall_iterate_name(iter);
break;
@@ -120,8 +117,7 @@ int main(int argc, char *argv[])
exit_usage(argv[0]);
}
if (sys_name != NULL) {
- sys_num = seccomp_syscall_resolve_name_arch(arch,
- sys_name);
+ sys_num = arch_syscall_resolve_name(arch, sys_name);
if (offset > 0 && sys_num > 0)
sys_num -= offset;
diff --git a/src/python/Makefile.am b/src/python/Makefile.am
index 8ecd7d9..2a57b99 100644
--- a/src/python/Makefile.am
+++ b/src/python/Makefile.am
@@ -35,7 +35,7 @@ PY_INSTALL = ${PY_DISTUTILS} install
all-local: build
-build: ../libseccomp-internal.la libseccomp.pxd seccomp.pyx setup.py
+build: ../libseccomp.la libseccomp.pxd seccomp.pyx setup.py
${PY_BUILD} && touch build
install-exec-local: build
diff --git a/src/python/setup.py b/src/python/setup.py
index 4275ce5..9c02df0 100644
--- a/src/python/setup.py
+++ b/src/python/setup.py
@@ -41,7 +41,7 @@ setup(
ext_modules = [
Extension("seccomp", ["seccomp.pyx"],
# unable to handle libtool libraries directly
- extra_objects=["../.libs/libseccomp-internal.a"],
+ extra_objects=["../.libs/libseccomp.a"],
# fix build warnings, see PEP 3123
extra_compile_args=["-fno-strict-aliasing"])
]
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d50e29b..4cda5d6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,7 +17,7 @@
#
AM_LDFLAGS = -static
-LDADD = util.la ../src/libseccomp-internal.la
+LDADD = util.la ../src/libseccomp.la
check_LTLIBRARIES = util.la
util_la_SOURCES = util.c util.h
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 9e868b4..3401110 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -30,7 +30,9 @@ noinst_PROGRAMS = \
scmp_bpf_disasm_SOURCES = scmp_bpf_disasm.c bpf.h util.h
scmp_bpf_sim_SOURCES = scmp_bpf_sim.c bpf.h util.h
-scmp_sys_resolver_LDADD = ../src/libseccomp-internal.la
-scmp_arch_detect_LDADD = ../src/libseccomp-internal.la
+scmp_sys_resolver_LDADD = ../src/libseccomp.la
+scmp_sys_resolver_LDFLAGS = -static
+scmp_arch_detect_LDADD = ../src/libseccomp.la
+scmp_arch_detect_LDFLAGS = -static
scmp_bpf_disasm_LDADD = util.la
scmp_bpf_sim_LDADD = util.la