diff options
authorMartin Schlemmer <azarah@gentoo.org>2005-11-30 23:27:59 +0000
committerMartin Schlemmer <azarah@gentoo.org>2005-11-30 23:27:59 +0000
commit2b688ccf33de909e4b6d0f0b890e750335cee568 (patch)
treeed19a26917c5751803a368274982c9428fe2f29c /configure.ac
parentSmall syntax cleanup. (diff)
Rename configure.in to configure.ac.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
Diffstat (limited to 'configure.ac')
1 files changed, 123 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..4142349
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,123 @@
+AC_INIT([sandbox], [1.2.14], [sandbox@gentoo.org])
+dnl Checks for programs.
+AC_CHECK_PROGS([READELF], [readelf], [false])
+dnl Next four lines is a hack to prevent libtool checking for CXX/F77
+dnl Checks for libraries.
+dnl Checks for header files.
+ fcntl.h limits.h memory.h stddef.h \
+ stdlib.h string.h strings.h sys/file.h \
+ sys/param.h sys/time.h unistd.h utime.h \
+dnl Checks for typedefs, structures, and compiler characteristics.
+dnl Checks for library functions.
+ bzero ftruncate getcwd lchown memmove \
+ mempcpy memset mkdir pathconf realpath \
+ rmdir setenv strcasecmp strchr strdup \
+ strerror strndup strrchr strspn strstr \
+dnl uClibc doesn't currently provide dlvsym() so lets
+dnl verify the toolchain supports it
+AC_CHECK_LIB(dl, dlvsym,
+ [AC_DEFINE([HAVE_DLVSYM], [1], [libdl supports dlvsym])],
+ [AC_DEFINE([HAVE_DLVSYM], [0], [libdl does not support dlvsym])]
+dnl when using libc5, (f)trucate's offset argument type is size_t with
+dnl libc5, but it's off_t with libc6 (glibc2).
+AC_MSG_CHECKING([truncate argument type])
+TRUNC_ARG_TYPE=`echo '#include <unistd.h>' | $CC -E - | grep -q 'truncate.*size_t'`
+if test "$TRUNC_ARG_TYPE"x != x ; then
+ AC_MSG_RESULT([size_t])
+ AC_DEFINE([TRUNCATE_T], [size_t], [truncate arg type])
+ AC_MSG_RESULT([off_t])
+ AC_DEFINE([TRUNCATE_T], [off_t], [truncate arg type])
+dnl we need to handle symbols differently based upon their version,
+dnl but we have to know which symbols the libc supports first
+AC_MSG_CHECKING([libc path])
+echo "int main(void) { return 0; }" > libctest.c
+$CC -Wall -o libctest libctest.c
+LIBC_PATH=`$CC $CFLAGS -Wl,-verbose -o libctest libctest.c 2>&1 | \
+ $AWK '/attempt to open/ { if (($4 ~ /libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}'`
+rm -f libctest.c
+if test "$LIBC_PATH"x = x ; then
+ AC_MSG_ERROR([Unable to determine LIBC PATH])
+dnl when intercepting libc calls, we have to know the name of the
+dnl libc to load and search with dl*() calls
+AC_MSG_CHECKING([libc version])
+dnl the sed script at the end here looks funny but it's ok ...
+dnl they're m4 escape sequences for left and right brackets
+LIBC_VERSION=`readelf -d libctest | grep NEEDED.*libc\\.so | $AWK '{print $NF}' | sed -e 's:\@<:@::' -e 's:\@:>@::'`
+if test "$LIBC_VERSION"x = x ; then
+ AC_MSG_ERROR([Unable to determine LIBC VERSION])
+rm -f libctest
+AC_DEFINE_UNQUOTED([LIBC_VERSION], ["$LIBC_VERSION"], [name of libc to hook into])
+dnl check if we have 32bit or 64bit output
+ AS_HELP_STRING([--enable-multilib],
+ [enable building for multilib setups (default=disabled)]),
+ [enable_multilib="$enableval"],
+ [enable_multilib="no"]
+if test "$enable_multilib"x != xno ; then
+ AC_DEFINE_UNQUOTED([SB_HAVE_MULTILIB], [1], [have multilib enabled system])
+ Makefile
+ scripts/Makefile
+ data/Makefile
+ src/Makefile