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

Diff of /trunk/configure.ac

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

Revision 48 Revision 53
49mempcpy memset mkdir pathconf realpath \ 49mempcpy memset mkdir pathconf realpath \
50rmdir setenv strcasecmp strchr strdup \ 50rmdir setenv strcasecmp strchr strdup \
51strerror strndup strrchr strspn strstr \ 51strerror strndup strrchr strspn strstr \
52]) 52])
53 53
54dnl
55dnl FIXME: the following needs to be made portable
56dnl
57
58dnl when using libc5, (f)trucate's offset argument type is size_t with 54dnl when using libc5, (f)trucate's offset argument type is size_t with
59dnl libc5, but it's off_t with libc6 (glibc2). 55dnl libc5, but it's off_t with libc6 (glibc2).
60AC_MSG_CHECKING(truncate argument type) 56AC_MSG_CHECKING(truncate argument type)
61if grep -q 'truncate.*size_t' /usr/include/unistd.h ; then 57if echo '#include <unistd.h>' | $CC -E - | grep -q 'truncate.*size_t' ; then
62 AC_MSG_RESULT(size_t) 58 AC_MSG_RESULT(size_t)
63 AC_DEFINE(TRUNCATE_T, size_t, [truncate arg type]) 59 AC_DEFINE(TRUNCATE_T, size_t, [truncate arg type])
64else 60else
65 AC_MSG_RESULT(off_t) 61 AC_MSG_RESULT(off_t)
66 AC_DEFINE(TRUNCATE_T, off_t, [truncate arg type]) 62 AC_DEFINE(TRUNCATE_T, off_t, [truncate arg type])
67fi 63fi
68 64
69AC_MSG_CHECKING(Checking libc version) 65dnl we need to handle symbols differently based upon their version,
66dnl but we have to know which symbols the libc supports first
67AC_MSG_CHECKING(libc path)
70echo "int main(void) { return 0; }" > libctest.c 68echo "int main(void) { return 0; }" > libctest.c
71gcc -Wall -o libctest libctest.c 69$CC -Wall -o libctest libctest.c
72LIBC_VERSION=`ldd libctest | grep libc\\.so | grep -v 'ld-uClibc' | ${AWK} '{print $1}'` 70LIBC_PATH=`$CC $CFLAGS -Wl,-verbose -o libctest libctest.c 2>&1 | \
73LIBC_PATH=`ldd libctest | grep libc\\.so | grep -v 'ld-uClibc' | ${AWK} '{print $3}'` 71 gawk '/attempt to open/ { if (($4 ~ /libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}'`
72if test "$LIBC_PATH"x = x ; then
73 AC_MSG_ERROR(Unable to determine LIBC PATH)
74fi
75AC_MSG_RESULT($LIBC_PATH)
76AC_SUBST(LIBC_PATH)
77
78dnl when intercepting libc calls, we have to know the name of the
79dnl libc to load and search with dl*() calls
80AC_MSG_CHECKING(libc version)
81dnl the sed script at the end here looks funny but it's ok ...
82dnl they're m4 escape sequences for left and right brackets
83LIBC_VERSION=`readelf -d libctest | grep NEEDED.*libc\\.so | $AWK '{print $NF}' | sed -e 's:\@<:@::' -e 's:\@:>@::'`
84if test "$LIBC_VERSION"x = x ; then
85 AC_MSG_ERROR(Unable to determine LIBC VERSION)
86fi
87AC_MSG_RESULT($LIBC_VERSION)
88AC_DEFINE_UNQUOTED(LIBC_VERSION, "$LIBC_VERSION", [name of libc to hook into])
74rm -f libctest 89rm -f libctest
75AC_SUBST(LIBC_VERSION)
76AC_SUBST(LIBC_PATH)
77AC_MSG_RESULT(${LIBC_VERSION})
78 90
79AC_OUTPUT([Makefile]) 91AC_OUTPUT([Makefile])

Legend:
Removed from v.48  
changed lines
  Added in v.53

  ViewVC Help
Powered by ViewVC 1.1.20