sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script. |
jseward | dc0b4e8 | 2004-08-31 16:26:27 +0000 | [diff] [blame] | 2 | AC_INIT(Valgrind, 2.3.0.CVS, valgrind-users@lists.sourceforge.net) |
thughes | 6dbad73 | 2004-08-29 09:46:38 +0000 | [diff] [blame] | 3 | AC_CONFIG_SRCDIR(coregrind/vg_main.c) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 4 | AM_CONFIG_HEADER(config.h) |
thughes | 6dbad73 | 2004-08-29 09:46:38 +0000 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 6 | |
gobry | b0ed467 | 2002-03-27 20:58:58 +0000 | [diff] [blame] | 7 | AM_MAINTAINER_MODE |
| 8 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 9 | # Checks for programs. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 10 | CFLAGS="" |
| 11 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 12 | AC_PROG_LN_S |
| 13 | AC_PROG_CC |
| 14 | AC_PROG_CPP |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 15 | AC_PROG_CXX |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 16 | AC_PROG_RANLIB |
| 17 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 18 | # Check for the compiler support |
| 19 | if test "${GCC}" != "yes" ; then |
| 20 | AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) |
| 21 | fi |
| 22 | |
sewardj | 2f68595 | 2002-12-22 19:32:23 +0000 | [diff] [blame] | 23 | # figure out where perl lives |
| 24 | AC_PATH_PROG(PERL, perl) |
| 25 | |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 26 | # figure out where gdb lives |
| 27 | AC_PATH_PROG(GDB, gdb) |
njn | 17b8535 | 2003-04-18 12:54:24 +0000 | [diff] [blame] | 28 | # autoheader tries to execute the 3rd string or something; I get warnings when |
| 29 | # it's defined. So just leave it undefined. --njn 2002-Apr-18 |
| 30 | AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", "") |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 31 | |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 32 | # some older automake's don't have it so try something on our own |
| 33 | ifdef([AM_PROG_AS],[AM_PROG_AS], |
| 34 | [ |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 35 | AS="${CC}" |
| 36 | AC_SUBST(AS) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 37 | |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 38 | ASFLAGS="" |
| 39 | AC_SUBST(ASFLAGS) |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 40 | ]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 41 | |
| 42 | # This variable will collect the individual suppression files |
| 43 | # depending on the results of autoconf |
| 44 | |
| 45 | DEFAULT_SUPP="" |
| 46 | |
| 47 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 48 | # We don't want gcc 2.7 |
| 49 | AC_MSG_CHECKING([for a supported version of gcc]) |
| 50 | |
daywalker | 870ac4c | 2002-05-21 00:09:48 +0000 | [diff] [blame] | 51 | gcc_version=`${CC} --version | head -n 1` |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 52 | |
| 53 | case "${gcc_version}" in |
| 54 | gcc-2.7.*) |
| 55 | AC_MSG_RESULT([no (${gcc_version})]) |
| 56 | AC_MSG_ERROR([please use a recent (>= gcc-2.95) version of gcc]) |
| 57 | ;; |
| 58 | |
| 59 | *) |
| 60 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 61 | ;; |
| 62 | esac |
| 63 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 64 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 65 | # Checks for the platform |
| 66 | AC_CANONICAL_HOST |
| 67 | |
| 68 | AC_MSG_CHECKING([for a supported CPU]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 69 | AC_SUBST(VG_ARCH) |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 70 | AC_SUBST(KICKSTART_BASE) |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 71 | AC_SUBST(ARCH_CORE_AM_CFLAGS) |
| 72 | AC_SUBST(ARCH_TOOL_AM_CFLAGS) |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame^] | 73 | AC_SUBST(ARCH_CORE_AM_CCASFLAGS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 74 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 75 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 76 | i?86) |
| 77 | AC_MSG_RESULT([ok (${host_cpu})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 78 | VG_ARCH="x86" |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 79 | KICKSTART_BASE="0xb0000000" |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 80 | ARCH_CORE_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -DELFSZ=32" |
| 81 | ARCH_TOOL_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@" |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame^] | 82 | ARCH_CORE_AM_CCASFLAGS="" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 83 | ;; |
| 84 | |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 85 | powerpc*) |
| 86 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | da8735a | 2004-10-19 14:24:42 +0000 | [diff] [blame] | 87 | VG_ARCH="ppc" |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 88 | KICKSTART_BASE="0x70000000" |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 89 | ARCH_CORE_AM_CFLAGS="-DELFSZ=32" |
| 90 | ARCH_TOOL_AM_CFLAGS="-fpic" |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame^] | 91 | ARCH_CORE_AM_CCASFLAGS="-Wa,-maltivec" |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 92 | AC_MSG_ERROR([PowerPC not supported. Sorry]) |
| 93 | ;; |
| 94 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 95 | *) |
| 96 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 97 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 98 | ;; |
| 99 | esac |
| 100 | |
| 101 | AC_MSG_CHECKING([for a supported OS]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 102 | AC_SUBST(VG_OS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 103 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 104 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 105 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 106 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 107 | VG_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 108 | |
| 109 | # Ok, this is linux. Check the kernel version |
| 110 | AC_MSG_CHECKING([for the kernel version]) |
| 111 | |
| 112 | kernel=`uname -r` |
| 113 | |
| 114 | case "${kernel}" in |
| 115 | 2.6.*) |
| 116 | AC_MSG_RESULT([2.6 family (${kernel})]) |
| 117 | AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x]) |
| 118 | ;; |
| 119 | |
| 120 | 2.4.*) |
| 121 | AC_MSG_RESULT([2.4 family (${kernel})]) |
| 122 | AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) |
| 123 | ;; |
| 124 | |
| 125 | 2.2.*) |
| 126 | AC_MSG_RESULT([2.2 family (${kernel})]) |
| 127 | AC_DEFINE([KERNEL_2_2], 1, [Define to 1 if you're using Linux 2.2.x]) |
| 128 | ;; |
| 129 | |
| 130 | *) |
| 131 | AC_MSG_RESULT([unsupported (${kernel})]) |
| 132 | AC_MSG_ERROR([Valgrind works on kernels 2.2, 2.4, 2.6]) |
| 133 | ;; |
| 134 | esac |
| 135 | |
| 136 | ;; |
| 137 | |
| 138 | *freebsd*) |
| 139 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 140 | VG_OS="freebsd" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 141 | ;; |
| 142 | |
| 143 | *) |
| 144 | AC_MSG_RESULT([no (${host_os})]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 145 | AC_MSG_ERROR([Valgrind is operating system specific. Sorry. Please consider doing a port.]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 146 | ;; |
| 147 | esac |
| 148 | |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 149 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
| 150 | AC_SUBST(VG_PLATFORM) |
| 151 | |
| 152 | VG_PLATFORM="$VG_ARCH-$VG_OS" |
| 153 | |
| 154 | case $VG_PLATFORM in |
| 155 | x86-linux) |
| 156 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 157 | ;; |
| 158 | |
| 159 | *) |
| 160 | AC_MSG_RESULT([no (${host_cpu}-${host_os})]) |
| 161 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doin |
| 162 | g a port.]) |
| 163 | ;; |
| 164 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 165 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 166 | AC_SUBST(DEFAULT_SUPP) |
| 167 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 168 | glibc="" |
| 169 | |
| 170 | AC_EGREP_CPP([GLIBC_21], [ |
| 171 | #include <features.h> |
| 172 | #ifdef __GNU_LIBRARY__ |
| 173 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 1) |
| 174 | GLIBC_21 |
| 175 | #endif |
| 176 | #endif |
| 177 | ], |
| 178 | glibc="2.1") |
| 179 | |
| 180 | AC_EGREP_CPP([GLIBC_22], [ |
| 181 | #include <features.h> |
| 182 | #ifdef __GNU_LIBRARY__ |
| 183 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2) |
| 184 | GLIBC_22 |
| 185 | #endif |
| 186 | #endif |
| 187 | ], |
| 188 | glibc="2.2") |
| 189 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 190 | AC_EGREP_CPP([GLIBC_23], [ |
| 191 | #include <features.h> |
| 192 | #ifdef __GNU_LIBRARY__ |
| 193 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 3) |
| 194 | GLIBC_23 |
| 195 | #endif |
| 196 | #endif |
| 197 | ], |
| 198 | glibc="2.3") |
| 199 | |
daywalker | e9212b3 | 2003-06-15 22:39:15 +0000 | [diff] [blame] | 200 | # Ok, this is linux. Check the kernel version |
| 201 | AC_MSG_CHECKING([the glibc version]) |
| 202 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 203 | case "${glibc}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 204 | 2.1) |
| 205 | AC_MSG_RESULT(2.1 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 206 | AC_DEFINE([GLIBC_2_1], 1, [Define to 1 if you're using glibc 2.1.x]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 207 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.1.supp" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 208 | ;; |
| 209 | |
| 210 | 2.2) |
| 211 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 212 | AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 213 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.2.supp" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 214 | ;; |
| 215 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 216 | 2.3) |
| 217 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 218 | AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x]) |
daywalker | 63f6f78 | 2003-05-27 00:19:52 +0000 | [diff] [blame] | 219 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.3.supp" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 220 | ;; |
| 221 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 222 | *) |
| 223 | AC_MSG_RESULT(unsupported version) |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 224 | AC_MSG_ERROR([Valgrind requires the glibc version 2.1, 2.2 or 2.3]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 225 | ;; |
| 226 | esac |
| 227 | |
sewardj | 3e909ce | 2002-06-03 13:27:15 +0000 | [diff] [blame] | 228 | # APIs introduced in recent glibc versions |
| 229 | |
| 230 | AC_MSG_CHECKING([whether sched_param has a sched_priority member]) |
| 231 | AC_CACHE_VAL(vg_have_sched_priority, |
| 232 | [ |
| 233 | AC_TRY_COMPILE([#include <pthread.h>],[ |
| 234 | struct sched_param p; p.sched_priority=1;], |
| 235 | vg_have_sched_priority=yes, |
| 236 | vg_have_sched_priority=no) |
| 237 | ]) |
| 238 | AC_MSG_RESULT($vg_have_sched_priority) |
| 239 | if test "$vg_have_sched_priority" = yes; then |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 240 | AC_DEFINE([HAVE_SCHED_PRIORITY], 1, [pthread / sched_priority exists]) |
sewardj | 3e909ce | 2002-06-03 13:27:15 +0000 | [diff] [blame] | 241 | fi |
| 242 | |
| 243 | AC_MSG_CHECKING([whether nfds_t is defined]) |
| 244 | AC_CACHE_VAL(vg_have_nfds_t, |
| 245 | [ |
| 246 | AC_TRY_COMPILE([#include <sys/poll.h>],[ |
| 247 | nfds_t i=0;], |
| 248 | vg_have_nfds_t=yes, |
| 249 | vg_have_nfds_t=no) |
| 250 | ]) |
| 251 | AC_MSG_RESULT($vg_have_nfds_t) |
| 252 | if test "$vg_have_nfds_t" = yes; then |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 253 | AC_DEFINE([HAVE_NFDS_T], 1, [nfds_t exists]) |
sewardj | 3e909ce | 2002-06-03 13:27:15 +0000 | [diff] [blame] | 254 | fi |
| 255 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 256 | # try to detect the XFree version |
sewardj | 8ce25cd | 2002-06-18 01:05:58 +0000 | [diff] [blame] | 257 | # JRS 2002-06-17: this is completely bogus because it |
| 258 | # detects the server version, whereas we need to know the |
| 259 | # client library version. So what follows is hacked to |
| 260 | # use all the X supp files regardless of what is detected. |
| 261 | # This is really stoooopid and should be fixed properly. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 262 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 263 | AC_PATH_X |
| 264 | |
| 265 | if test "${no_x}" != 'yes' ; then |
| 266 | |
thughes | fd8a380 | 2004-08-30 10:31:21 +0000 | [diff] [blame] | 267 | AC_MSG_CHECKING([X version]) |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 268 | |
| 269 | cat<<EOF > conftest.c |
| 270 | #include <X11/Xlib.h> |
| 271 | |
| 272 | int main (int argc, char * argv []) |
| 273 | { |
| 274 | Display * display = XOpenDisplay (NULL); |
| 275 | |
| 276 | if (display) { |
| 277 | printf ("%s version=%d\n", ServerVendor (display), VendorRelease (display)); |
| 278 | } |
| 279 | |
| 280 | return 0; |
| 281 | } |
| 282 | EOF |
| 283 | |
| 284 | ${CC} -o conftest conftest.c -I${x_includes} -L${x_libraries} -lX11 >&5 2>&1 |
| 285 | |
| 286 | if test "$?" != 0 ; then |
| 287 | AC_MSG_RESULT([cannot compile test program]) |
| 288 | else |
| 289 | xfree=`./conftest` |
| 290 | |
| 291 | case "${xfree}" in |
| 292 | *XFree86*) |
thughes | fd8a380 | 2004-08-30 10:31:21 +0000 | [diff] [blame] | 293 | case "${xfree}" in |
| 294 | *version=4*) |
| 295 | AC_MSG_RESULT([XFree 4.x family]) |
| 296 | AC_DEFINE([XFREE_4], 1, [Define to 1 if you're using XFree 4.x]) |
| 297 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-4.supp" |
| 298 | # haaaaaaack! |
| 299 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-3.supp" |
| 300 | ;; |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 301 | |
thughes | fd8a380 | 2004-08-30 10:31:21 +0000 | [diff] [blame] | 302 | *version=3*) |
| 303 | AC_MSG_RESULT([XFree 3.x family]) |
| 304 | AC_DEFINE([XFREE_3], 1, [Define to 1 if you're using XFree86 3.x]) |
| 305 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-3.supp" |
| 306 | # haaaaaaack! |
| 307 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-4.supp" |
| 308 | ;; |
| 309 | |
| 310 | *) AC_MSG_RESULT([unknown XFree86 server (${xfree})]) |
| 311 | # haaaaaaack! |
| 312 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-3.supp" |
| 313 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-4.supp" |
| 314 | ;; |
| 315 | esac |
| 316 | ;; |
| 317 | *X.Org*) |
| 318 | case "${xfree}" in |
| 319 | *version=6*) |
| 320 | AC_MSG_RESULT([X.Org 6.x family]) |
| 321 | AC_DEFINE([XFREE_4], 1, [Define to 1 if you're using XFree 4.x]) |
| 322 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-4.supp" |
| 323 | # haaaaaaack! |
| 324 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-3.supp" |
| 325 | ;; |
| 326 | esac |
| 327 | ;; |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 328 | *) AC_MSG_RESULT([not a XFree86 server]) |
| 329 | ;; |
| 330 | esac |
| 331 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 332 | fi |
| 333 | |
| 334 | rm -f conftest conftest.c |
| 335 | fi |
| 336 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 337 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 338 | # check if the GNU as supports CFI directives |
| 339 | AC_MSG_CHECKING([if gas accepts .cfi]) |
mueller | ece14bd | 2003-10-31 03:43:48 +0000 | [diff] [blame] | 340 | AC_TRY_LINK(, [ |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 341 | |
| 342 | __asm__ __volatile__ (".cfi_startproc\n" |
| 343 | ".cfi_adjust_cfa_offset 0x0\n" |
| 344 | ".cfi_endproc\n"); |
| 345 | ], |
| 346 | [ |
| 347 | AC_DEFINE_UNQUOTED([HAVE_GAS_CFI], 1, [Define if your GNU as supports .cfi]) |
| 348 | AC_MSG_RESULT(yes) |
| 349 | ], |
| 350 | AC_MSG_RESULT(no) |
| 351 | ) |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 352 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 353 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 354 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 355 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 356 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 357 | CFLAGS="-mpreferred-stack-boundary=2" |
| 358 | |
| 359 | AC_TRY_COMPILE(, [ |
| 360 | |
| 361 | int main () { return 0 ; } |
| 362 | |
| 363 | ], |
| 364 | [ |
| 365 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 366 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 367 | ], [ |
| 368 | PREFERRED_STACK_BOUNDARY="" |
| 369 | AC_MSG_RESULT([no]) |
| 370 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 371 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 372 | |
| 373 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 374 | |
| 375 | |
nethercote | 7f39002 | 2004-10-25 17:18:24 +0000 | [diff] [blame] | 376 | # Check for PIE support in the compiler and linker |
| 377 | AC_CACHE_CHECK([for PIE support], vg_cv_pie, |
| 378 | [safe_CFLAGS=$CFLAGS |
| 379 | CFLAGS="$CFLAGS -fpie" |
| 380 | safe_LDFLAGS=$LDFLAGS |
| 381 | LDFLAGS="$LDFLAGS -pie" |
| 382 | AC_TRY_LINK([int foo;], |
| 383 | [], |
| 384 | [vg_cv_pie=yes], |
| 385 | [vg_cv_pie=no]) |
| 386 | CFLAGS=$safe_CFLAGS |
| 387 | LDFLAGS=$safe_LDFLAGS]) |
| 388 | if test "$vg_cv_pie" = yes; then |
| 389 | AC_DEFINE([HAVE_PIE], 1, [can create position-independent executables]) |
| 390 | fi |
| 391 | AM_CONDITIONAL(USE_PIE, test "$vg_cv_pie" = "yes") |
| 392 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 393 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 394 | # Checks for header files. |
| 395 | AC_HEADER_STDC |
nethercote | 2baf9aa | 2004-08-24 14:38:53 +0000 | [diff] [blame] | 396 | AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h sys/endian.h endian.h termios.h unistd.h utime.h linux/fb.h mqueue.h linux/compiler.h]) |
| 397 | |
thughes | 33448cc | 2004-08-24 23:09:07 +0000 | [diff] [blame] | 398 | AH_TEMPLATE([HAVE_LINUX_MII_H], []) |
| 399 | AC_MSG_CHECKING([for linux/mii.h]) |
| 400 | AC_PREPROC_IFELSE([#include <linux/mii.h>], |
| 401 | [AC_DEFINE([HAVE_LINUX_MII_H]) |
| 402 | AC_MSG_RESULT([yes])], |
| 403 | [AC_MSG_RESULT([no])]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 404 | |
| 405 | # Checks for typedefs, structures, and compiler characteristics. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 406 | AC_TYPE_UID_T |
| 407 | AC_TYPE_OFF_T |
| 408 | AC_TYPE_SIZE_T |
| 409 | AC_HEADER_TIME |
thughes | ebed998 | 2004-06-12 17:25:25 +0000 | [diff] [blame] | 410 | AC_CHECK_TYPES(__pthread_unwind_buf_t,,,[#include <pthread.h>]) |
thughes | be81171 | 2004-06-17 23:04:58 +0000 | [diff] [blame] | 411 | AC_CHECK_TYPES(u16,,,[#include <linux/mii.h>]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 412 | |
| 413 | # Checks for library functions. |
| 414 | AC_FUNC_MEMCMP |
| 415 | AC_FUNC_MMAP |
| 416 | AC_TYPE_SIGNAL |
| 417 | |
thughes | beb6eb9 | 2004-06-14 12:33:43 +0000 | [diff] [blame] | 418 | AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr semtimedop]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 419 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 420 | AC_OUTPUT( |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 421 | Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 422 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 423 | valgrind.pc |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 424 | docs/Makefile |
| 425 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 426 | tests/vg_regtest |
njn25 | 1ffab94 | 2002-09-23 16:42:19 +0000 | [diff] [blame] | 427 | tests/unused/Makefile |
nethercote | e90c683 | 2004-10-18 18:07:49 +0000 | [diff] [blame] | 428 | include/valgrind.h |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 429 | include/Makefile |
nethercote | c06e213 | 2004-09-03 13:45:29 +0000 | [diff] [blame] | 430 | include/x86/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 431 | auxprogs/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 432 | coregrind/Makefile |
| 433 | coregrind/demangle/Makefile |
| 434 | coregrind/docs/Makefile |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 435 | coregrind/x86/Makefile |
nethercote | f94fe2f | 2004-09-10 14:23:59 +0000 | [diff] [blame] | 436 | coregrind/x86-linux/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 437 | addrcheck/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 438 | addrcheck/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 439 | addrcheck/tests/x86/Makefile |
njn | 7da8fa7 | 2002-10-03 10:38:40 +0000 | [diff] [blame] | 440 | addrcheck/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 441 | memcheck/Makefile |
| 442 | memcheck/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 443 | memcheck/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 444 | memcheck/docs/Makefile |
| 445 | cachegrind/Makefile |
nethercote | b35a8b9 | 2004-09-11 16:45:27 +0000 | [diff] [blame] | 446 | cachegrind/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 447 | cachegrind/tests/Makefile |
nethercote | a255d80 | 2004-10-19 17:00:59 +0000 | [diff] [blame] | 448 | cachegrind/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 449 | cachegrind/docs/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 450 | cachegrind/cg_annotate |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 451 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 452 | helgrind/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 453 | helgrind/tests/x86/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 454 | helgrind/docs/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 455 | massif/Makefile |
| 456 | massif/hp2ps/Makefile |
| 457 | massif/tests/Makefile |
| 458 | massif/docs/Makefile |
| 459 | corecheck/Makefile |
| 460 | corecheck/tests/Makefile |
| 461 | corecheck/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 462 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 463 | lackey/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 464 | lackey/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 465 | none/Makefile |
| 466 | none/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 467 | none/tests/x86/Makefile |
njn | 9bc8c00 | 2002-10-02 13:49:13 +0000 | [diff] [blame] | 468 | none/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 469 | ) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 470 | |
| 471 | cat<<EOF |
| 472 | |
| 473 | Using the following suppressions by default: |
| 474 | |
| 475 | ${DEFAULT_SUPP} |
| 476 | EOF |
| 477 | |
| 478 | cat<<EOF > default.supp |
| 479 | # This is a generated file, composed of the following suppression rules: |
| 480 | # |
| 481 | # ${DEFAULT_SUPP} |
| 482 | # |
| 483 | |
| 484 | EOF |
| 485 | |
| 486 | for file in ${DEFAULT_SUPP} ; do |
| 487 | cat ${srcdir}/$file >> default.supp |
| 488 | done |