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

Diff of /trunk/configure.ac

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

Revision 249 Revision 396
1AC_PREREQ([2.59]) 1AC_PREREQ([2.61])
2AC_INIT([sandbox], [1.2.18], [sandbox@gentoo.org]) 2AC_INIT([sandbox], [1.3.0], [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
26dnl Checks for header files. 26dnl Checks for header files.
27AC_FUNC_ALLOCA 27AC_FUNC_ALLOCA
28AC_HEADER_DIRENT 28AC_HEADER_DIRENT
29AC_HEADER_STDC 29AC_HEADER_STDC
30AC_HEADER_SYS_WAIT 30AC_HEADER_SYS_WAIT
31AC_CHECK_HEADERS([ \ 31AC_CHECK_HEADERS_ONCE([ \
32 fcntl.h limits.h memory.h stddef.h \ 32 dirent.h \
33 stdlib.h string.h strings.h sys/file.h \ 33 dlfcn.h \
34 sys/param.h sys/time.h unistd.h utime.h \ 34 elf.h \
35 errno.h \
36 execinfo.h \
37 fcntl.h \
38 libgen.h \
39 limits.h \
40 memory.h \
41 signal.h \
42 stdarg.h \
43 stdbool.h \
44 stddef.h \
45 stdio.h \
46 stdlib.h \
47 string.h \
48 strings.h \
49 unistd.h \
50 utime.h \
51 sys/file.h \
52 sys/mman.h \
53 sys/param.h \
54 sys/stat.h \
55 sys/time.h \
56 sys/types.h \
57 sys/wait.h \
35]) 58])
36 59
37dnl Checks for typedefs, structures, and compiler characteristics. 60dnl Checks for typedefs, structures, and compiler characteristics.
38AC_C_CONST 61AC_C_CONST
39AC_TYPE_UID_T 62AC_TYPE_UID_T
46AC_FUNC_FORK 69AC_FUNC_FORK
47AC_FUNC_LSTAT 70AC_FUNC_LSTAT
48AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK 71AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
49AC_TYPE_SIGNAL 72AC_TYPE_SIGNAL
50AC_FUNC_STAT 73AC_FUNC_STAT
51AC_CHECK_FUNCS([ \ 74AC_CHECK_FUNCS_ONCE([ \
52 bzero ftruncate getcwd lchown memmove \ 75 backtrace \
53 memcpy memset mkdir pathconf realpath \ 76 ftruncate \
54 rmdir setenv strcasecmp strchr strdup \ 77 getcwd \
55 strerror strndup strrchr strspn strstr \ 78 lchown \
79 memmove \
80 memcpy \
81 memset \
82 mkdir \
83 pathconf \
84 realpath \
85 rmdir \
86 setenv \
87 strcasecmp \
88 strchr \
89 strdup \
90 strerror \
91 strndup \
92 strrchr \
93 strspn \
94 strstr \
56 strtok_r \ 95 strtok_r \
57]) 96])
97dnl For librcutil
98AC_CHECK_FUNCS([remove])
99
100dnl Check if gcc provides va_copy or __va_copy (for librcutil)
101AC_MSG_CHECKING([for va_copy])
102AC_TRY_COMPILE([
103 #include <stdarg.h>
104 ], [
105 va_list ap, aq;
106 va_copy(ap, aq);
107 ],
108 [va_copy="va_copy"],
109 [AC_TRY_COMPILE([
110 #include <stdarg.h>
111 ], [
112 va_list ap, aq;
113 __va_copy(ap, aq);
114 ],
115 [va_copy="__va_copy"],
116 [AC_MSG_ERROR([Unable to determine name of va_copy macro])]
117 )]
118)
119AC_MSG_RESULT([$va_copy])
120if test x"$va_copy" != xva_copy ; then
121 AC_DEFINE_UNQUOTED([va_copy], [$va_copy],
122 [Define to name of va_copy macro proviced by gcc if its not `va_copy'.]
123 )
124fi
58 125
59dnl Verify people aren't doing stupid shit 126dnl Verify people aren't doing stupid shit
60if test x"$enable_static" != xno ; then 127if test x"$enable_static" != xno ; then
61 AC_MSG_ERROR([dont be a Kumba, building a libsandbox.a is stupid]) 128 AC_MSG_ERROR([dont be a Kumba, building a libsandbox.a is stupid])
62fi 129fi
119 [have_rtld_next="yes"], 186 [have_rtld_next="yes"],
120 [have_rtld_next="no"] 187 [have_rtld_next="no"]
121) 188)
122AC_MSG_RESULT([$have_rtld_next]) 189AC_MSG_RESULT([$have_rtld_next])
123if test x"$have_rtld_next" = xyes ; then 190if test x"$have_rtld_next" = xyes ; then
191 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
124 AC_DEFINE([HAVE_RTLD_NEXT], [1], [Have RTLD_NEXT enabled libc]) 192 AC_DEFINE([HAVE_RTLD_NEXT], [1], [Have RTLD_NEXT enabled libc])
125fi 193fi
126 194
127dnl we need to handle symbols differently based upon their version, 195dnl we need to handle symbols differently based upon their version,
128dnl but we have to know which symbols the libc supports first 196dnl but we have to know which symbols the libc supports first
129AC_MSG_CHECKING([libc path]) 197AC_MSG_CHECKING([libc path])
130echo "int main(void) { return 0; }" > libctest.c 198echo "int main(void) { return 0; }" > libctest.c
131$CC $CFLAGS -Wl,-verbose -o libctest libctest.c &> libctest.log 199$CC $CFLAGS $CPPFLAGS $LDFLAGS -Wl,-verbose -o libctest libctest.c > libctest.log 2>&1
132cat libctest.log 1>&AS_MESSAGE_LOG_FD 200cat libctest.log 1>&AS_MESSAGE_LOG_FD
201LIBC_PATH=$(
133LIBC_PATH=`$AWK '/attempt to open/ { if (($4 ~ /\/libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}' libctest.log` 202 $AWK '/attempt to open/ { if (($4 ~ /\/libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}' libctest.log
203)
134rm -f libctest* 204rm -f libctest*
135if test x"$LIBC_PATH" = x || ! test -r "$LIBC_PATH" ; then 205if test x"$LIBC_PATH" = x || ! test -r "$LIBC_PATH" ; then
136 AC_MSG_ERROR([Unable to determine LIBC PATH ($LIBC_PATH)]) 206 AC_MSG_ERROR([Unable to determine LIBC PATH ($LIBC_PATH)])
137fi 207fi
138AC_MSG_RESULT([$LIBC_PATH]) 208AC_MSG_RESULT([$LIBC_PATH])
140 210
141dnl when intercepting libc calls, we have to know the name of the 211dnl when intercepting libc calls, we have to know the name of the
142dnl libc to load and search with dl*() calls 212dnl libc to load and search with dl*() calls
143AC_MSG_CHECKING([libc version]) 213AC_MSG_CHECKING([libc version])
144dnl the sed script at the end here looks funny but it's ok ... 214dnl the sed script at the end here looks funny but it's ok ...
145dnl they're m4 escape sequences for left and right brackets
146echo "int main(void) { return 0; }" > libctest.c 215echo "int main(void) { return 0; }" > libctest.c
147$CC -Wall -o libctest libctest.c 216$CC $CFLAGS $CPPFLAGS $LDFLAGS -Wall -o libctest libctest.c
148LIBC_VERSION=`readelf -d libctest | grep NEEDED.*libc\\.so | $AWK '{print $NF}' | sed -e 's:\@<:@::' -e 's:\@:>@::'` 217LIBC_VERSION=$(
218 $READELF -d libctest | \
219 grep NEEDED.*libc\\.so | \
220 $AWK '{print $NF}' | sed -e ['s:\[::' -e 's:\]::']
221)
149rm -f libctest* 222rm -f libctest*
150if test "$LIBC_VERSION"x = x ; then 223if test "$LIBC_VERSION"x = x ; then
151 AC_MSG_ERROR([Unable to determine LIBC VERSION]) 224 AC_MSG_ERROR([Unable to determine LIBC VERSION])
152fi 225fi
153AC_MSG_RESULT([$LIBC_VERSION]) 226AC_MSG_RESULT([$LIBC_VERSION])
154AC_DEFINE_UNQUOTED([LIBC_VERSION], ["$LIBC_VERSION"], [Name of libc to hook into]) 227AC_DEFINE_UNQUOTED([LIBC_VERSION], ["$LIBC_VERSION"], [Name of libc to hook into])
155 228
156dnl check if we have 32bit or 64bit output 229dnl We add to CPPFLAGS rather than doing AC_DEFINE_UNQUOTED
157AC_ARG_ENABLE([multilib], 230dnl so we dont have to worry about fully expanding all of
158 AS_HELP_STRING([--enable-multilib], 231dnl the variables ($sysconfdir defaults to "$prefix/etc")
159 [enable building for multilib setups (default=disabled)]), 232SANDBOX_DEFINES='-DETCDIR="\"$(sysconfdir)\"" -DLIBSANDBOX_PATH="\"$(libdir)\"" -DSANDBOX_BASHRC_PATH="\"$(pkgdatadir)\""'
160 [enable_multilib="$enableval"], 233AC_SUBST([SANDBOX_DEFINES])
161 [enable_multilib="no"]
162)
163
164if test x"$enable_multilib" != xno ; then
165 AC_DEFINE([SB_HAVE_MULTILIB], [1], [Have multilib enabled system])
166fi
167 234
168AC_OUTPUT([ 235AC_OUTPUT([
169 Makefile 236 Makefile
170 scripts/Makefile 237 scripts/Makefile
238 etc/Makefile
171 data/Makefile 239 data/Makefile
240 libsbutil/Makefile
241 libsandbox/Makefile
172 src/Makefile 242 src/Makefile
173]) 243])

Legend:
Removed from v.249  
changed lines
  Added in v.396

  ViewVC Help
Powered by ViewVC 1.1.20