libsepol build system comments

Josh asked me to look through the autotools work.  Here are the issues I have found with the libsepol package:

1. In configure.ac, the AC_INIT macro is not filled out;

2. Within libsepol/src/Makefile.am, the internal header files are not assigned to COMMONSRC;

3. Within utils/Makefile.am, the builddir for utils is not necessarily sibling to src;

4. libsepol is being installed to $(LIBDIR).  In this case, it should default to the system library.

5. Most importantly, the unit tests are not built nor run.

I resolved the first three issues with the patch below.  After applying the changes, 'make distcheck' succeeded for me.  For the fourth issue, consider adding to configure.ac an AC_ARG_WITH, "--with-libsepol-dir", that sets the location to install libsepol.so.  This would default to /lib or /lib64, depending upon the target architecture.  For the fifth issue, the enable_tests variable ought to default to yes, and then conditional compiliation be used to actually compile and run those tests.

--
Jason Tang / jtang@tresys.com
This commit is contained in:
Jason Tang 2008-09-26 15:41:37 -04:00 committed by Joshua Brindle
parent a271c06983
commit 770905024b
3 changed files with 19 additions and 4 deletions

View File

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([libsepol], [1] BUG-REPORT-ADDRESS)
AC_INIT([libsepol], 2.0.32, selinux@tycho.nsa.gov)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([utils/chkcon.c])
AC_CONFIG_HEADER([config.h])

View File

@ -6,7 +6,22 @@ COMMONSRC = assertion.c conditional.c ebitmap.c hashtab.c \
node_record.c policydb_public.c sidtab.c write.c \
boolean_record.c context_record.c genusers.c interfaces.c \
nodes.c port_record.c symtab.c booleans.c \
debug.c handle.c link.c polcaps.c ports.c user_record.c
debug.c handle.c link.c polcaps.c ports.c user_record.c \
av_permissions.h \
boolean_internal.h \
context.h \
context_internal.h \
debug.h \
dso.h \
handle.h \
iface_internal.h \
mls.h \
module_internal.h \
node_internal.h \
policydb_internal.h \
port_internal.h \
private.h \
user_internal.h
lib_LTLIBRARIES = libsepol.la
libsepol_la_SOURCES = $(COMMONSRC)
libsepol_la_CPPFLAGS = \

View File

@ -2,5 +2,5 @@ bin_PROGRAMS = chkcon
AM_LDFLAGS = -Wl,--as-needed
AM_CPPFLAGS = -I$(abs_top_srcdir)/include
chkcon_SOURCES = chkcon.c
chkcon_DEPENDENCIES = $(builddir)/../src/libsepol.la
chkcon_LDFLAGS = -lsepol -L$(builddir)/../src
chkcon_DEPENDENCIES = $(top_builddir)/src/libsepol.la
chkcon_LDFLAGS = -lsepol -L$(top_builddir)/src