Have configure to start auto-detecting PLATFORM, which was required as of the per...
[dyninst.git] / configure.in
1 dnl == process this file with autoconf to produce a configure script ==
2
3
4 AC_PREREQ(2.59)
5 AC_INIT([Dyninst], [8.0], [bugs@dyninst.org], [dyninst])
6
7 AC_PREFIX_DEFAULT(/usr)
8
9 AC_CONFIG_AUX_DIR([autodyninst])
10 AC_CONFIG_MACRO_DIR([autodyninst])
11
12 AC_PROG_INSTALL
13
14 AC_PROG_CXX(g++)
15 AC_PATH_PROG(_ICC_, icc)
16 AC_PATH_PROG(_ICPC_, icpc)
17 AC_PATH_PROG(_PGC_, pgcc)
18 AC_PATH_PROG(_PGCXX_, pgCC)
19 AC_PATH_PROG(_CC_, cc)
20 AC_PATH_PROG(_CXX_, CC)
21 AC_LANG(C++)
22
23
24 dnl === configure options ==
25
26 AC_SUBST(INSTALL)
27
28 AC_ARG_WITH(traditional,
29             [AS_HELP_STRING([--with-traditional],[Install to traditional (deprecated) locations])],
30             [LIBRARY_DEST_VAR="LIBRARY_DEST=\${TO_CORE}/../\${PLATFORM}/lib";
31              PROGRAM_DEST_VAR="PROGRAM_DEST=\${TO_CORE}/../\${PLATFORM}/bin";
32              INCLUDE_DEST_VAR="INCLUDE_DEST=\${TO_CORE}/../include";],
33             [LIBRARY_DEST_VAR="";
34              PROGRAM_DEST_VAR="";
35              INCLUDE_DEST_VAR="";])
36 AC_SUBST(LIBRARY_DEST_VAR)
37 AC_SUBST(PROGRAM_DEST_VAR)
38 AC_SUBST(INCLUDE_DEST_VAR)
39
40 AC_ARG_WITH(boost,
41         [AS_HELP_STRING([--with-boost],[Boost include directory])],
42         [BOOST_DIR="-I${withval}"],
43         [BOOST_DIR=""])
44
45 CPP_FLAGS_SAVED=$CPP_FLAGS
46 CPP_FLAGS=$BOOST_DIR
47 AC_CHECK_HEADER([boost/shared_ptr.hpp],
48         [],
49         [AC_ERROR([Missing shared_ptr.hpp in boost directory])],
50         [])
51 CPP_FLAGS=$CPP_FLAGS_SAVED
52
53 AC_SUBST(BOOST_DIR)
54
55 PACKAGE_BASE=""
56 AC_ARG_WITH(package-base,
57            [AS_HELP_STRING([--with-package-base],[Base directory to look for packages])],
58            [PACKAGE_BASE="${withval}";
59             TCLTK_INC_DIR="${PACKAGE_BASE}/tcl8.4.5/include";
60             TCLTK_LIB_DIR="${PACKAGE_BASE}/tcl8.4.5/lib";
61             LIBELF_INC_DIR="${PACKAGE_BASE}/libelf/include";
62             LIBELF_LIB_DIR="${PACKAGE_BASE}/libelf/lib";
63             LIBDWARF_INC_DIR="${PACKAGE_BASE}/libdwarf/include";
64             LIBDWARF_LIB_DIR="${PACKAGE_BASE}/libdwarf/lib";
65             ARG_WRAPPER_LIBS="";
66             LIBXML2_INC_DIR="${PACKAGE_BASE}/libxml2/include/libxml2"
67             LIBXML2_LIB_DIR="${PACKAGE_BASE}/libxml2/lib";
68             LIBFLEX_LIB_DIR="${PACKAGE_BASE}/libflex/lib";
69            ],[
70             # We fall back on these defaults if both --with-package-base and
71             # specific --with-<package> arguments are not provided.
72             #TCLTK_INC_DIR="/usr/include";
73             #TCLTK_LIB_DIR="/usr/lib";
74             #LIBELF_INC_DIR="/usr/include";
75             #LIBELF_LIB_DIR="/usr/lib";
76             ARG_WRAPPER_LIBS="";
77             #LIBDWARF_INC_DIR="/usr/include";
78             #LIBDWARF_LIB_DIR="/usr/lib";
79             LIBXML2_INC_DIR="/usr/include/libxml2"
80             #LIBXML2_LIB_DIR="/usr/lib";
81             #LIBFLEX_LIB_DIR="/usr/lib";
82            ])
83 # 3/15/09: We don't include libiberty in the cs.wisc.edu package-base.
84 #          Why?  Putting these here for now...
85 #LIBIBERTY_LIB_DIR="/usr/lib";
86
87 AC_ARG_WITH(default-component,
88             [AS_HELP_STRING([--with-default-component],[Valid values: DyninstAPI, SymtabAPI, InstructionAPI, ProcControlAPI, ParseAPI, default])],
89             [DEFAULT_COMPONENT="${withval}";],
90             [DEFAULT_COMPONENT=`cat autodyninst/default_component`;])                                                            
91 AC_ARG_WITH(tcl83,
92             [AS_HELP_STRING([--with-tcl83],[Use Tcl/Tk 8.3])],
93             [TCL_VERSION="tcl8.3"; USE_TCL83="${withval}";],
94             [TCL_VERSION="tcl8.4"; USE_TCL83="false";])
95 AC_ARG_WITH(tcltk-incdir,
96             [AS_HELP_STRING([--with-tcltk-incdir],[TCL/TK include directory])],
97             [TCLTK_INC_DIR="${withval}";],)
98 AC_ARG_WITH(tcltk-libdir,
99             [AS_HELP_STRING([--with-tcltk-libdir],[TCL/TK library directory])],
100             [TCLTK_LIB_DIR="${withval}";],)
101 PD_SOFT_CHECK_INC_DIR($TCLTK_INC_DIR, [tcl.h], [tcl])
102 PD_SOFT_CHECK_LIB_DIR($TCLTK_LIB_DIR, $TCL_VERSION, [Tcl_Eval])
103 AC_SUBST(USE_TCL83)
104 AC_SUBST(TCLTK_INC_DIR)
105 AC_SUBST(TCLTK_LIB_DIR)
106 AC_SUBST(DEFAULT_COMPONENT)
107
108 AC_CANONICAL_HOST
109
110 AC_ARG_WITH(wrapper-libs, 
111             [AS_HELP_STRING([--with-wrapper-libs],[Comma seperated list of archive to wrap])],
112             [ARG_WRAPPER_LIBS="${withval}";],)
113 AC_SUBST(ARG_WRAPPER_LIBS)
114
115 AC_ARG_ENABLE(gnu-demangler,
116               [AS_HELP_STRING([--enable-gnu-demangler],[Use g++'s built in demangler])],
117               [GNU_DEMANGLER="true"],)
118
119 if test "x$DEFAULT_COMPONENT" = "xInstructionAPI"; then
120    AC_MSG_NOTICE([InstructionAPI, not requiring libelf...])   
121    SUPPRESS_LIBELF_REQ="true"
122    AC_MSG_NOTICE([InstructionAPI, not requiring thread_db...])   
123    SUPPRESS_THREADDB_REQ="true"
124    AC_MSG_NOTICE([InstructionAPI, not requiring libdwarf...])   
125    SUPPRESS_LIBDWARF_REQ="true"
126 fi
127 if test "x$DEFAULT_COMPONENT" = "xSymtabAPI"; then
128    AC_MSG_NOTICE([SymtabAPI, not requiring thread_db...])
129    SUPPRESS_THREADDB_REQ="true"
130 fi
131 if test "x$DEFAULT_COMPONENT" = "xParseAPI"; then
132    AC_MSG_NOTICE([ParseAPI, not requiring thread_db...])
133    SUPPRESS_THREADDB_REQ="true"
134 fi
135 if test "x$DEFAULT_COMPONENT" = "xProcControlAPI"; then
136    AC_MSG_NOTICE([ProcControlAPI, not requiring libdwarf...])   
137    SUPPRESS_LIBDWARF_REQ="true"
138 fi 
139 if test "`echo $host_os | cut -b-5`" = "linux" ; then
140   if test "x$PLATFORM" = "xppc32_bgp_ion"; then
141    AC_MSG_NOTICE([BG/P, thread_db required...])   
142   elif test "x$PLATFORM" = "xppc32_bgl_ion"; then
143    AC_MSG_NOTICE([BG/L, thread_db required...])
144   elif test "x$PLATFORM" = "xppc64_bgq_ion"; then
145    AC_MSG_NOTICE([BG/Q, thread_db required...])
146   else 
147    AC_MSG_NOTICE([Linux, not requiring thread_db...])
148    SUPPRESS_THREADDB_REQ="true"
149   fi
150 fi
151
152 if test "`echo $host_os | cut -b-3`" = "aix" ; then
153    AC_MSG_NOTICE([AIX, not requiring thread_db...])
154    SUPPRESS_THREADDB_REQ="true"
155 fi
156
157 if test "`echo $host_os | cut -b-3`" = "aix" ; then
158    AC_MSG_NOTICE([AIX system, skipping libelf...])
159 else
160    AC_ARG_WITH(libelf-incdir,
161                    [AS_HELP_STRING([--with-libelf-incdir],[LIBELF include directory])],
162                    [LIBELF_INC_DIR="${withval}";],)
163    AC_ARG_WITH(libelf-libdir,
164             [AS_HELP_STRING([--with-libelf-libdir],[LIBELF library directory])],
165             [LIBELF_LIB_DIR="${withval}";],)
166   
167    if test "x$SUPPRESS_LIBELF_REQ" = "x"; then
168       if test "x$LIBELF_INC_DIR" = "x"; then
169          LIBELF_INCFLAGS=""
170          LIBELF_ALT_INC_DIR=/usr/include/libelf
171       else
172          LIBELF_INCFLAGS=-I$LIBELF_INC_DIR
173          LIBELF_ALT_INC_DIR=$LIBELF_INC_DIR/libelf
174       fi
175       LIBELF_ALT_INCFLAGS=-I$LIBELF_ALT_INC_DIR
176
177       CXXFLAGS_HOLD=$CXXFLAGS
178       CPPFLAGS_HOLD=$CPPFLAGS
179       CXXFLAGS="$CXXFLAGS $LIBELF_INCFLAGS";
180       CPPFLAGS="$CPPFLAGS $LIBELF_INCFLAGS";
181
182       AC_CHECK_HEADER([libelf.h], [AC_MSG_NOTICE(ELF include directory: $LIBELF_INC_DIR)],
183            [CXXFLAGS="$CXXFLAGS $LIBELF_ALT_INCFLAGS"
184             CPPFLAGS="$CPPFLAGS $LIBELF_ALT_INCFLAGS"
185             $as_unset ac_cv_header_libelf_h
186             AC_CHECK_HEADER([libelf.h],
187                             [LIBELF_INC_DIR=$LIBELF_ALT_INC_DIR;AC_MSG_NOTICE(ELF include directory: $LIBELF_INC_DIR)],
188                             [AC_ERROR(couldn't find libelf.h: $CPPFLAGS)])])
189
190       CXXFLAGS=$CXXFLAGS_HOLD
191       CPPFLAGS=$CPPFLAGS_HOLD
192       PD_CHECK_LIB_DIR($LIBELF_LIB_DIR,[elf],[elf_memory])
193       PD_CHECK_LIB_TYPE($LIBELF_LIB_DIR, elf)
194       AC_ARG_WITH(libelf-static,
195                         [AS_HELP_STRING([--with-libelf-static],[Use static LIBELF only])],
196                         [LIB_TYPE_DYNAMIC=false],)
197    fi
198    LIBELF_STATIC="$LIB_TYPE_STATIC"
199    LIBELF_DYNAMIC="$LIB_TYPE_DYNAMIC"
200    AC_SUBST(LIBELF_INC_DIR)
201    AC_SUBST(LIBELF_LIB_DIR)
202    AC_SUBST(LIBELF_STATIC)
203    AC_SUBST(LIBELF_DYNAMIC)
204 fi
205
206 if test "$host_cpu" != "x86_64" -a "$host_cpu" != "i686"; then
207    AC_MSG_NOTICE([Not x86/x86_64, skipping icc on $host_cpu...])
208 else
209    AC_ARG_WITH(icc,
210                [AS_HELP_STRING([--with-icc],[Path to Intel's ICC compiler])],
211                [_ICC_="${withval}"; _ICPC_=`dirname ${withval}`/icpc;],)
212 fi
213 AC_SUBST(_ICC_)
214 AC_SUBST(_ICPC_)
215
216 if test "$host_cpu" != "x86_64" -a "$host_cpu" != "i686"; then
217    AC_MSG_NOTICE([Not x86/x86_64, skipping pgcc on $host_cpu...])
218 else
219    AC_ARG_WITH(pgcc,
220                [AS_HELP_STRING([--with-pgcc],[Path to Pathscale's PGCC compiler])],
221                [_PGC_="${withval}"; _PGCXX_=`dirname ${withval}`/pgCC;],)
222 fi
223 AC_SUBST(_PGC_)
224 AC_SUBST(_PGCXX_)
225
226 if test "`echo $host_os | cut -b-3`" = "aix" ; then
227    if test "`basename $CXX`" = "xlC" ; then
228       BUILD_XLC="true";
229    elif test "`basename $CC`" = "xlc" ; then
230       BUILD_XLC="true";
231    else
232       BUILD_XLC="";
233    fi
234    AC_SUBST(BUILD_XLC)
235 fi
236
237 if test "x$BUILD_XLC" = "x" ; then
238    AC_ARG_WITH(libiberty-libdir,
239             [AS_HELP_STRING([--with-libiberty-libdir],[LIBIBERTY library directory])],
240             [LIBIBERTY_LIB_DIR="${withval}";],)
241    LIBS_HOLD=$LIBS
242    if test "x$LIBIBERTY_LIB_DIR" != "x" ; then
243       LIBS="-L$LIBIBERTY_LIB_DIR"
244    fi
245    AC_CHECK_LIB([iberty], [cplus_demangle], [HAVE_LIBIBERTY="true";],[HAVE_LIBIBERTY="false"])
246
247    LIBS_BAK=$LIBS
248    LDFLAGS_BAK=$LDFLAGS
249    CXXFLAGS_BAK=$CXXFLAGS
250    LIBS="$LIBS -liberty"
251    LDFLAGS="$LDFLAGS -shared"
252    CXXFLAGS="-fPIC"
253    AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { char *cplus_demangle(char *s, int opts); }]],
254                                    [[cplus_demangle("", 0);]])],
255                                    [LIBIBERTY_LINK="true"],
256                                    [LIBIBERTY_LINK="false"])
257    LDFLAGS=$LDFLAGS_BAK
258    LIBS=$LIBS_BAK
259    CXXFLAGS=$CXXFLAGS_BAK
260
261    if test "x$HAVE_LIBIBERTY" = "xtrue" ; then
262       if test "x$LIBIBERTY_LINK" = "xtrue" ; then
263          USE_LIBERTY=true
264          LINK_LIBERTY=true
265       elif test "x$_PGC_" != "x" ; then 
266          USE_LIBERTY=true
267          echo "WARNING: libiberty does not link with shared objects.  Mutatees will have to be linked with -liberty."
268       else
269          GNU_DEMANGLER=true
270       fi
271    else
272       GNU_DEMANGLER=true
273    fi
274
275    if test "x$GNU_DEMANGLER" = "xtrue" ; then
276       USE_LIBIBERTY=""
277       LINK_LIBIBERTY=""
278    fi
279 fi
280
281 AC_SUBST(GNU_DEMANGLER)
282 AC_SUBST(USE_LIBERTY)
283 AC_SUBST(LINK_LIBERTY)
284 AC_SUBST(LIBIBERTY_LIB_DIR)
285
286 AC_ARG_WITH(parseAPI,
287         [AS_HELP_STRING([--without-parseAPI],[Disable ParseAPI for stack walking])],
288         [WITHOUT_PARSEAPI="true";],[WITHOUT_PARSEAPI="";])
289 AC_ARG_WITH(symtabAPI,
290         [AS_HELP_STRING([--without-symtabAPI],[Disable SymtabAPI for stack walking])],
291         [WITHOUT_SYMTABAPI="true";],[WITHOUT_SYMTABAPI="";])
292 AC_SUBST(WITHOUT_PARSEAPI)
293 AC_SUBST(WITHOUT_SYMTABAPI)
294
295 if test "`echo $host_os | cut -b-3`" = "aix" ; then
296    AC_MSG_NOTICE([AIX system, skipping libdwarf...])
297 else
298    AC_ARG_WITH(libdwarf-incdir,
299             [AS_HELP_STRING([--with-libdwarf-incdir],[LIBDWARF include directory])],
300             [LIBDWARF_INC_DIR="${withval}";],)
301    AC_ARG_WITH(libdwarf-libdir,
302             [AS_HELP_STRING([--with-libdwarf-libdir],[LIBDWARF library directory])],
303             [LIBDWARF_LIB_DIR="${withval}";],)
304    
305    if test "x$SUPPRESS_LIBDWARF_REQ" = "x"; then
306        if test "x$LIBDWARF_INC_DIR" = "x"; then
307           LIBDWARF_INCFLAGS="";
308           LIBDWARF_ALT_INC_DIR="/usr/include/libdwarf";
309        else
310           LIBDWARF_INCFLAGS="-I$LIBDWARF_INC_DIR";
311           LIBDWARF_ALT_INC_DIR="$LIBDWARF_INC_DIR/libdwarf";
312        fi
313        LIBDWARF_ALT_INCFLAGS="-I$LIBDWARF_ALT_INC_DIR";
314
315        CXXFLAGS_HOLD=$CXXFLAGS;
316        CPPFLAGS_HOLD=$CPPFLAGS;
317        CXXFLAGS="$CXXFLAGS $LIBDWARF_INCFLAGS";
318        CPPFLAGS="$CPPFLAGS $LIBDWARF_INCFLAGS";
319
320        AC_CHECK_HEADER([libdwarf.h], [AC_MSG_NOTICE(DWARF include directory: $LIBDWARF_INC_DIR)],
321                         [CXXFLAGS="$CXXFLAGS_HOLD $LIBDWARF_ALT_INCFLAGS"
322                          CPPFLAGS="$CPPFLAGS_HOLD $LIBDWARF_ALT_INCFLAGS"
323                          $as_unset ac_cv_header_libdwarf_h
324                          AC_CHECK_HEADER([libdwarf.h],
325                               [LIBDWARF_INC_DIR=$LIBDWARF_ALT_INC_DIR;AC_MSG_NOTICE(DWARF include directory: $LIBDWARF_INC_DIR)],
326                               [AC_ERROR(couldn't find libdwarf.h)])])
327        CXXFLAGS=$CXXFLAGS_HOLD;
328        CPPFLAGS=$CPPFLAGS_HOLD;
329
330        PD_CHECK_LIB_DIR($LIBDWARF_LIB_DIR,[dwarf],[dwarf_add_arange],$LIBELF_LIB_DIR,[-lelf])
331        PD_CHECK_LIB_TYPE($LIBDWARF_LIB_DIR, dwarf)
332        AC_ARG_WITH(libdwarf-static,
333                         [AS_HELP_STRING([--with-libdwarf-static],[Use static LIBDWARF only])],
334                         [LIB_TYPE_DYNAMIC=false],)
335    fi
336
337    LIBDWARF_STATIC="$LIB_TYPE_STATIC"
338    LIBDWARF_DYNAMIC="$LIB_TYPE_DYNAMIC"
339    AC_SUBST(LIBDWARF_INC_DIR)
340    AC_SUBST(LIBDWARF_LIB_DIR)
341    AC_SUBST(LIBDWARF_STATIC)
342    AC_SUBST(LIBDWARF_DYNAMIC)
343
344    PD_CHECK_LIB_FEATURE($LIBDWARF_LIB_DIR,[dwarf],[dwarf_set_frame_cfa_value],$LIBELF_LIB_DIR,[-lelf])
345    LIBDWARF_HAS_SET_FRAME="$HAS_FEATURE"
346    AC_SUBST(LIBDWARF_HAS_SET_FRAME)
347 fi
348
349
350 AC_ARG_WITH(threaddb-incdir,
351          [AS_HELP_STRING([--with-threaddb-incdir],[THREADDB include directory])],
352          [THREADDB_INC_DIR="${withval}";],)
353 AC_ARG_WITH(threaddb-libdir,
354          [AS_HELP_STRING([--with-threaddb-libdir],[THREADDB library directory])],
355          [THREADDB_LIB_DIR="${withval}";],)
356 CXXFLAGS_HOLD=$CXXFLAGS;
357 CPPFLAGS_HOLD=$CPPFLAGS;
358 LDFLAGS_HOLD=$LDFLAGS
359 if test "x$THREADDB_INC_DIR" != "x"; then
360   CXXFLAGS="$CXXFLAGS -I$THREADDB_INC_DIR"
361   CPPFLAGS="$CPPFLAGS -I$THREADDB_INC_DIR"
362 fi
363 LDFLAGS="-shared -fPIC"
364 HAVE_THREADDB="true"
365 if test "x$SUPPRESS_THREADDB_REQ" = "x"; then
366     AC_CHECK_HEADER([thread_db.h], [AC_MSG_NOTICE(thread_db include directory: $THREADDB_INC_DIR)],
367                      [AC_ERROR(couldn't find thread_db.h)], )
368     PD_CHECK_LIB_DIR($THREADDB_LIB_DIR,[thread_db],[td_ta_new], , )
369 else
370     AC_CHECK_HEADER([thread_db.h], [AC_MSG_NOTICE(thread_db include directory: $THREADDB_INC_DIR)],
371                      [HAVE_THREADDB=""], )
372     PD_CHECK_LIB_DIR_WERR($THREADDB_LIB_DIR,[thread_db],[td_ta_new], , , [HAVE_THREADDB=""])
373 fi
374 if test "x$HAVE_THREADDB" = "xtrue"; then
375     PD_CHECK_LIB_TYPE($THREADDB_LIB_DIR, thread_db)
376 fi
377 CXXFLAGS=$CXXFLAGS_HOLD
378 CPPFLAGS=$CPPFLAGS_HOLD
379 LDFLAGS=$LDFLAGS_HOLD
380 THREADDB_STATIC="$LIB_TYPE_STATIC"
381 THREADDB_DYNAMIC="$LIB_TYPE_DYNAMIC"
382 AC_SUBST(THREADDB_INC_DIR)
383 AC_SUBST(THREADDB_LIB_DIR)
384 AC_SUBST(THREADDB_STATIC)
385 AC_SUBST(THREADDB_DYNAMIC)
386 AC_SUBST(HAVE_THREADDB)
387
388 AC_ARG_WITH(libxml2-incdir,
389             [AS_HELP_STRING([--with-libxml2-incdir],[LIBXML2 include directory])],
390             [LIBXML2_INC_DIR="${withval}";],)
391 AC_ARG_WITH(libxml2-libdir,
392             [AS_HELP_STRING([--with-libxml2-libdir],[LIBXML2 library directory])],
393             [LIBXML2_LIB_DIR="${withval}";],)
394 PD_SOFT_CHECK_INC_DIR($LIBXML2_INC_DIR, [libxml/xmlschemas.h], [libxml])
395 PD_SOFT_CHECK_LIB_DIR($LIBXML2_LIB_DIR,[xml2],[xmlAddID])
396 AC_SUBST(LIBXML2_INC_DIR)
397 AC_SUBST(LIBXML2_LIB_DIR)
398
399 AC_ARG_WITH(launchmon-incdir,
400             [AS_HELP_STRING([--with-launchmon-incdir],[Launchmon include directory])],
401             [LAUNCHMON_INC_DIR="${withval}";],)
402 AC_ARG_WITH(launchmon-libdir,
403             [AS_HELP_STRING([--with-launchmon-libdir],[Launchmon library directory])],
404             [LAUNCHMON_LIB_DIR="${withval}";],)
405 AC_SUBST(LAUNCHMON_INC_DIR)
406 AC_SUBST(LAUNCHMON_LIB_DIR)
407
408 AC_ARG_WITH(libflex-libdir,
409             [AS_HELP_STRING([--with-libflex-libdir],[Absolute path to flex library])],
410             [LIBFLEX_LIB_DIR="${withval}";],)
411 # 3/15/09: We are not checking for libflex sources and they are not in cs.wisc.edu package-base.
412 #          What's the story here?  Not needed?
413 PD_SOFT_CHECK_LIB_DIR(${LIBFLEX_LIB_DIR}, [fl], [yywrap])
414 AC_SUBST(LIBFLEX_LIB_DIR)
415 AC_PATH_PROG(NASM, nasm, "", "${PACKAGE_BASE}/nasm/bin:$PATH")
416 AC_SUBST(NASM)
417
418 AC_MSG_CHECKING([for -fno-stack-protector])
419 SAVED_CXXFLAGS=$CXXFLAGS
420 CXXFLAGS="-fno-stack-protector"
421 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], 
422                                 [AC_MSG_RESULT([yes]); STACKPROT="DISABLE_STACK_PROT=1"], 
423                                 [AC_MSG_RESULT([no]); STACKPROT=""])
424 AC_SUBST(STACKPROT)
425 CXXFLAGS=$SAVED_CXXFLAGS
426
427 if test "`echo $host_os | cut -b-3`" = "aix" ; then
428     M32FLAG="-maix32"
429 else
430     M32FLAG="-m32"
431 fi
432 AC_MSG_CHECKING([for 32-bit build environment])
433 SAVED_CXXFLAGS=$CXXFLAGS
434 CXXFLAGS=$M32FLAG
435 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[]])], 
436                                 [AC_MSG_RESULT([yes]); BUILD32=""],
437                                 [AC_MSG_RESULT([no]); BUILD32="SKIP_BUILD_RTLIB_32=1"])
438 AC_SUBST(BUILD32)
439 CXXFLAGS=$SAVED_CXXFLAGS
440
441 AC_MSG_CHECKING([whether to use MM timer])
442 case $host in
443      ia64-*-*-*) MMTIMER=true ;;
444      *)    MMTIMER=false ;;
445 esac
446 AC_MSG_RESULT(${MMTIMER})
447 AC_SUBST([MMTIMER])
448
449 AC_SUBST([DEFS])
450
451 AC_ARG_ENABLE(testsuite, AS_HELP_STRING([--disable-testsuite], [Disable the Dyninst test suite (default is no)]),
452                          [], [enable_testsuite=yes])
453
454 AS_IF([test "x$enable_testsuite" != xyes], [TESTSUITE="DONT_BUILD_NEWTESTSUITE=1"], [TESTSUITE=""])
455 AC_SUBST([TESTSUITE])
456
457
458 SAVED_CXXFLAGS=$CXXFLAGS
459 CXXFLAGS="$M32FLAG -static"
460 AC_CHECK_LIB([stdc++], [main],
461                        [],
462                        [MISSING_STATIC_32_LIBSTDCPP="true"])
463 CXXFLAGS=$SAVED_CXXFLAGS
464
465 AC_SUBST([MISSING_STATIC_32_LIBSTDCPP])
466
467 if test "x$build" != "x"; then
468   PLATFORM=`./scripts/dynsysname ${build}`
469 fi
470 if test "x$PLATFORM" = "x"; then
471   SYSPLAT=`./scripts/sysname`
472   PLATFORM=`./scripts/dynsysname ${SYSPLAT}`
473 fi
474
475 AC_CONFIG_FILES([${PLATFORM}/make.config.local:autodyninst/make.config.local.in])
476 AC_OUTPUT