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