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