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

Contents of /trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 53 - (hide annotations) (download)
Thu Apr 28 22:21:10 2005 UTC (9 years, 7 months ago) by vapier
File MIME type: text/plain
File size: 2598 byte(s)
fix cross-compiling and uclibc and all that jazz

1 ferringb 2 AC_PREREQ(2.59)
2 azarah 48 AC_INIT(sandbox, 1.2.2, dev-portage@gentoo.org)
3 ferringb 2 AM_INIT_AUTOMAKE
4 ferringb 16 AC_CONFIG_HEADER([config.h])
5 ferringb 2
6     # Checks for programs.
7     AC_PROG_CC
8 azarah 29 AC_ISC_POSIX
9     AC_PROG_INSTALL
10     AC_PROG_MAKE_SET
11     AC_PROG_AWK
12    
13 vapier 21 AC_ENABLE_SHARED
14     AC_DISABLE_STATIC
15 ferringb 2 AC_PROG_LIBTOOL
16    
17     AC_PREFIX_DEFAULT([/usr])
18 azarah 29
19 ferringb 2 # Checks for libraries.
20     # Checks for header files.
21     AC_FUNC_ALLOCA
22     AC_HEADER_DIRENT
23     AC_HEADER_STDC
24     AC_HEADER_SYS_WAIT
25 vapier 21 AC_CHECK_HEADERS([ \
26     fcntl.h limits.h memory.h stddef.h \
27     stdlib.h string.h strings.h sys/file.h \
28     sys/param.h sys/time.h unistd.h utime.h \
29     ])
30 ferringb 2
31     # Checks for typedefs, structures, and compiler characteristics.
32     AC_C_CONST
33     AC_TYPE_UID_T
34     AC_TYPE_MODE_T
35     AC_TYPE_SIZE_T
36     AC_CHECK_TYPES([ptrdiff_t])
37    
38     # Checks for library functions.
39     AC_FUNC_CHOWN
40     AC_FUNC_FORK
41     AC_FUNC_LSTAT
42     AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
43     AC_FUNC_MALLOC
44     AC_FUNC_REALLOC
45     AC_TYPE_SIGNAL
46     AC_FUNC_STAT
47 vapier 21 AC_CHECK_FUNCS([ \
48     bzero ftruncate getcwd lchown memmove \
49     mempcpy memset mkdir pathconf realpath \
50     rmdir setenv strcasecmp strchr strdup \
51     strerror strndup strrchr strspn strstr \
52     ])
53 ferringb 2
54 vapier 23 dnl when using libc5, (f)trucate's offset argument type is size_t with
55     dnl libc5, but it's off_t with libc6 (glibc2).
56     AC_MSG_CHECKING(truncate argument type)
57 vapier 53 if echo '#include <unistd.h>' | $CC -E - | grep -q 'truncate.*size_t' ; then
58 vapier 23 AC_MSG_RESULT(size_t)
59     AC_DEFINE(TRUNCATE_T, size_t, [truncate arg type])
60     else
61     AC_MSG_RESULT(off_t)
62     AC_DEFINE(TRUNCATE_T, off_t, [truncate arg type])
63     fi
64    
65 vapier 53 dnl we need to handle symbols differently based upon their version,
66     dnl but we have to know which symbols the libc supports first
67     AC_MSG_CHECKING(libc path)
68 vapier 23 echo "int main(void) { return 0; }" > libctest.c
69 vapier 53 $CC -Wall -o libctest libctest.c
70     LIBC_PATH=`$CC $CFLAGS -Wl,-verbose -o libctest libctest.c 2>&1 | \
71     gawk '/attempt to open/ { if (($4 ~ /libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}'`
72     if test "$LIBC_PATH"x = x ; then
73     AC_MSG_ERROR(Unable to determine LIBC PATH)
74     fi
75     AC_MSG_RESULT($LIBC_PATH)
76 ferringb 33 AC_SUBST(LIBC_PATH)
77 vapier 23
78 vapier 53 dnl when intercepting libc calls, we have to know the name of the
79     dnl libc to load and search with dl*() calls
80     AC_MSG_CHECKING(libc version)
81     dnl the sed script at the end here looks funny but it's ok ...
82     dnl they're m4 escape sequences for left and right brackets
83     LIBC_VERSION=`readelf -d libctest | grep NEEDED.*libc\\.so | $AWK '{print $NF}' | sed -e 's:\@<:@::' -e 's:\@:>@::'`
84     if test "$LIBC_VERSION"x = x ; then
85     AC_MSG_ERROR(Unable to determine LIBC VERSION)
86     fi
87     AC_MSG_RESULT($LIBC_VERSION)
88     AC_DEFINE_UNQUOTED(LIBC_VERSION, "$LIBC_VERSION", [name of libc to hook into])
89     rm -f libctest
90    
91 vapier 21 AC_OUTPUT([Makefile])

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20