/[path-sandbox]/trunk/configure.in
Gentoo

Diff of /trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 179 Revision 180
1AC_PREREQ(2.59) 1AC_PREREQ([2.59])
2AC_INIT(sandbox, 1.2.14, dev-portage@gentoo.org) 2AC_INIT([sandbox], [1.2.14], [sandbox@gentoo.org])
3AM_INIT_AUTOMAKE 3AM_INIT_AUTOMAKE
4AC_CONFIG_HEADER([config.h]) 4AC_CONFIG_HEADER([config.h])
5 5
6dnl Checks for programs. 6dnl Checks for programs.
7AC_PROG_CC 7AC_PROG_CC
26AC_FUNC_ALLOCA 26AC_FUNC_ALLOCA
27AC_HEADER_DIRENT 27AC_HEADER_DIRENT
28AC_HEADER_STDC 28AC_HEADER_STDC
29AC_HEADER_SYS_WAIT 29AC_HEADER_SYS_WAIT
30AC_CHECK_HEADERS([ \ 30AC_CHECK_HEADERS([ \
31fcntl.h limits.h memory.h stddef.h \ 31 fcntl.h limits.h memory.h stddef.h \
32stdlib.h string.h strings.h sys/file.h \ 32 stdlib.h string.h strings.h sys/file.h \
33sys/param.h sys/time.h unistd.h utime.h \ 33 sys/param.h sys/time.h unistd.h utime.h \
34]) 34])
35 35
36dnl Checks for typedefs, structures, and compiler characteristics. 36dnl Checks for typedefs, structures, and compiler characteristics.
37AC_C_CONST 37AC_C_CONST
38AC_TYPE_UID_T 38AC_TYPE_UID_T
48AC_FUNC_MALLOC 48AC_FUNC_MALLOC
49AC_FUNC_REALLOC 49AC_FUNC_REALLOC
50AC_TYPE_SIGNAL 50AC_TYPE_SIGNAL
51AC_FUNC_STAT 51AC_FUNC_STAT
52AC_CHECK_FUNCS([ \ 52AC_CHECK_FUNCS([ \
53bzero ftruncate getcwd lchown memmove \ 53 bzero ftruncate getcwd lchown memmove \
54mempcpy memset mkdir pathconf realpath \ 54 mempcpy memset mkdir pathconf realpath \
55rmdir setenv strcasecmp strchr strdup \ 55 rmdir setenv strcasecmp strchr strdup \
56strerror strndup strrchr strspn strstr \ 56 strerror strndup strrchr strspn strstr \
57]) 57])
58 58
59dnl uClibc doesn't currently provide dlvsym() so lets 59dnl uClibc doesn't currently provide dlvsym() so lets
60dnl verify the toolchain supports it 60dnl verify the toolchain supports it
61AC_CHECK_LIB(dl, dlvsym, 61AC_CHECK_LIB(dl, dlvsym,
62 [AC_DEFINE(HAVE_DLVSYM, 1, [libdl supports dlvsym])], 62 [AC_DEFINE([HAVE_DLVSYM], [1], [libdl supports dlvsym])],
63 [AC_DEFINE(HAVE_DLVSYM, 0, [libdl does not support dlvsym])] 63 [AC_DEFINE([HAVE_DLVSYM], [0], [libdl does not support dlvsym])]
64) 64)
65 65
66dnl when using libc5, (f)trucate's offset argument type is size_t with 66dnl when using libc5, (f)trucate's offset argument type is size_t with
67dnl libc5, but it's off_t with libc6 (glibc2). 67dnl libc5, but it's off_t with libc6 (glibc2).
68AC_MSG_CHECKING(truncate argument type) 68AC_MSG_CHECKING([truncate argument type])
69if echo '#include <unistd.h>' | $CC -E - | grep -q 'truncate.*size_t' ; then 69TRUNC_ARG_TYPE=`echo '#include <unistd.h>' | $CC -E - | grep -q 'truncate.*size_t'`
70if test "$TRUNC_ARG_TYPE"x != x ; then
70 AC_MSG_RESULT(size_t) 71 AC_MSG_RESULT([size_t])
71 AC_DEFINE(TRUNCATE_T, size_t, [truncate arg type]) 72 AC_DEFINE([TRUNCATE_T], [size_t], [truncate arg type])
72else 73else
73 AC_MSG_RESULT(off_t) 74 AC_MSG_RESULT([off_t])
74 AC_DEFINE(TRUNCATE_T, off_t, [truncate arg type]) 75 AC_DEFINE([TRUNCATE_T], [off_t], [truncate arg type])
75fi 76fi
76 77
77dnl we need to handle symbols differently based upon their version, 78dnl we need to handle symbols differently based upon their version,
78dnl but we have to know which symbols the libc supports first 79dnl but we have to know which symbols the libc supports first
79AC_MSG_CHECKING(libc path) 80AC_MSG_CHECKING([libc path])
80echo "int main(void) { return 0; }" > libctest.c 81echo "int main(void) { return 0; }" > libctest.c
81$CC -Wall -o libctest libctest.c 82$CC -Wall -o libctest libctest.c
82LIBC_PATH=`$CC $CFLAGS -Wl,-verbose -o libctest libctest.c 2>&1 | \ 83LIBC_PATH=`$CC $CFLAGS -Wl,-verbose -o libctest libctest.c 2>&1 | \
83 $AWK '/attempt to open/ { if (($4 ~ /libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}'` 84 $AWK '/attempt to open/ { if (($4 ~ /libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}'`
84rm -f libctest.c 85rm -f libctest.c
85if test "$LIBC_PATH"x = x ; then 86if test "$LIBC_PATH"x = x ; then
86 AC_MSG_ERROR(Unable to determine LIBC PATH) 87 AC_MSG_ERROR([Unable to determine LIBC PATH])
87fi 88fi
88AC_MSG_RESULT($LIBC_PATH) 89AC_MSG_RESULT([$LIBC_PATH])
89AC_SUBST(LIBC_PATH) 90AC_SUBST([LIBC_PATH])
90 91
91dnl when intercepting libc calls, we have to know the name of the 92dnl when intercepting libc calls, we have to know the name of the
92dnl libc to load and search with dl*() calls 93dnl libc to load and search with dl*() calls
93AC_MSG_CHECKING(libc version) 94AC_MSG_CHECKING([libc version])
94dnl the sed script at the end here looks funny but it's ok ... 95dnl the sed script at the end here looks funny but it's ok ...
95dnl they're m4 escape sequences for left and right brackets 96dnl they're m4 escape sequences for left and right brackets
96LIBC_VERSION=`readelf -d libctest | grep NEEDED.*libc\\.so | $AWK '{print $NF}' | sed -e 's:\@<:@::' -e 's:\@:>@::'` 97LIBC_VERSION=`readelf -d libctest | grep NEEDED.*libc\\.so | $AWK '{print $NF}' | sed -e 's:\@<:@::' -e 's:\@:>@::'`
97if test "$LIBC_VERSION"x = x ; then 98if test "$LIBC_VERSION"x = x ; then
98 AC_MSG_ERROR(Unable to determine LIBC VERSION) 99 AC_MSG_ERROR([Unable to determine LIBC VERSION])
99fi 100fi
100AC_MSG_RESULT($LIBC_VERSION) 101AC_MSG_RESULT([$LIBC_VERSION])
101AC_DEFINE_UNQUOTED(LIBC_VERSION, "$LIBC_VERSION", [name of libc to hook into]) 102AC_DEFINE_UNQUOTED([LIBC_VERSION], ["$LIBC_VERSION"], [name of libc to hook into])
102 103
103dnl check if we have 32bit or 64bit output 104dnl check if we have 32bit or 64bit output
104AC_MSG_CHECKING([output abi]) 105AC_MSG_CHECKING([output abi])
105OUTPUT_ABI=`file libctest | grep 'ELF 64-bit LSB'` 106OUTPUT_ABI=`file libctest | grep 'ELF 64-bit LSB'`
106if test "$OUTPUT_ABI"x = x ; then 107if test "$OUTPUT_ABI"x = x ; then
107 OUTPUT_ABI="ELF 32-bit LSB" 108 OUTPUT_ABI="ELF 32-bit LSB"
108else 109else
109 OUTPUT_ABI="ELF 64-bit LSB" 110 OUTPUT_ABI="ELF 64-bit LSB"
110 AC_DEFINE_UNQUOTED([SB_HAVE_64BIT_ARCH], "1", [have 64-bit abi]) 111 AC_DEFINE_UNQUOTED([SB_HAVE_64BIT_ARCH], ["1"], [have 64-bit abi])
111fi 112fi
112AC_MSG_RESULT([$OUTPUT_ABI]) 113AC_MSG_RESULT([$OUTPUT_ABI])
113rm -f libctest 114rm -f libctest
114 115
115AC_OUTPUT([Makefile data/Makefile src/Makefile]) 116AC_OUTPUT([Makefile data/Makefile src/Makefile])

Legend:
Removed from v.179  
changed lines
  Added in v.180

  ViewVC Help
Powered by ViewVC 1.1.20