merge checkpoint
[dyninst.git] / autodyninst / configure.in
1 dnl == process this file with autoconf to produce a configure script ==
2
3
4 AC_PREREQ(2.59)
5 AC_INIT(./autodyninst/configure.in)
6 AC_CONFIG_AUX_DIR(./autodyninst)
7
8
9 AC_PROG_CXX(g++)
10 AC_PATH_PROG(_ICC_, icc, false)
11 AC_SUBST(_ICC_)
12 AC_PATH_PROGS(_PGCC_, pgcc pgCC, false)
13 AC_SUBST(_PGCC_)
14 AC_PATH_PROGS(_CC_, cc CC, false)
15 AC_SUBST(_CC_)
16 AC_LANG(C++)
17
18
19 dnl === configure options ==
20
21
22 PACKAGE_BASE=""
23 AC_ARG_WITH(package-base,
24            [AS_HELP_STRING([--with-package-base],[Base directory to look for packages])],
25            [PACKAGE_BASE="${withval}";
26             TCLTK_INC_DIR="${PACKAGE_BASE}/tcl8.4.5/include";
27             TCLTK_LIB_DIR="${PACKAGE_BASE}/tcl8.4.5/lib";
28             LIBELF_INC_DIR="${PACKAGE_BASE}/libelf/include";
29             LIBELF_LIB_DIR="${PACKAGE_BASE}/libelf/lib";
30             LIBDWARF_INC_DIR="${PACKAGE_BASE}/libdwarf/include";
31             LIBDWARF_LIB_DIR="${PACKAGE_BASE}/libdwarf/lib";
32             LIBXML2_INC_DIR="${PACKAGE_BASE}/libxml2/include/libxml2"
33             LIBXML2_LIB_DIR="${PACKAGE_BASE}/libxml2/lib";
34             LIBUNWIND_INC_DIR="${PACKAGE_BASE}/libunwind/include";
35             LIBUNWIND_LIB_DIR="${PACKAGE_BASE}/libunwind/lib";
36             LIBFLEX_LIB_DIR="${PACKAGE_BASE}/libflex/lib";
37            ],[
38             # We fall back on these defaults if both --with-package-base and
39             # specific --with-<package> arguments are not provided.
40             TCLTK_INC_DIR="/usr/include";
41             TCLTK_LIB_DIR="/usr/lib";
42             LIBELF_INC_DIR="/usr/include";
43             LIBELF_LIB_DIR="/usr/lib";
44             LIBDWARF_INC_DIR="/usr/include";
45             LIBDWARF_LIB_DIR="/usr/lib";
46             LIBXML2_INC_DIR="/usr/include/libxml2"
47             LIBXML2_LIB_DIR="/usr/lib";
48             LIBUNWIND_INC_DIR="/usr/include";
49             LIBUNWIND_LIB_DIR="/usr/lib";
50             LIBFLEX_LIB_DIR="/usr/lib";
51            ])
52 # 3/15/09: We don't include libiberty in the cs.wisc.edu package-base.
53 #          Why?  Putting these here for now...
54 LIBIBERTY_INC_DIR="/usr/include";
55 LIBIBERTY_LIB_DIR="/usr/lib";
56
57
58 AC_ARG_WITH(tcl83,
59             [AS_HELP_STRING([--with-tcl83],[Use Tcl/Tk 8.3])],
60             [TCL_VERSION="tcl8.3"; USE_TCL83="${withval}";],
61             [TCL_VERSION="tcl8.4"; USE_TCL83="false";])
62 AC_ARG_WITH(tcltk-incdir,
63             [AS_HELP_STRING([--with-tcltk-incdir],[TCL/TK include directory])],
64             [TCLTK_INC_DIR="${withval}";],)
65 AC_ARG_WITH(tcltk-libdir,
66             [AS_HELP_STRING([--with-tcltk-libdir],[TCL/TK library directory])],
67             [TCLTK_LIB_DIR="${withval}";],)
68 PD_SOFT_CHECK_INC_DIR($TCLTK_INC_DIR, [tcl.h])
69 PD_SOFT_CHECK_LIB_DIR($TCLTK_LIB_DIR, $TCL_VERSION, [Tcl_Eval])
70 AC_SUBST(USE_TCL83)
71 AC_SUBST(TCLTK_INC_DIR)
72 AC_SUBST(TCLTK_LIB_DIR)
73
74
75 AC_ARG_WITH(libelf-incdir,
76             [AS_HELP_STRING([--with-libelf-incdir],[LIBELF include directory])],
77             [LIBELF_INC_DIR="${withval}";],)
78 AC_ARG_WITH(libelf-libdir,
79             [AS_HELP_STRING([--with-libelf-libdir],[LIBELF library directory])],
80             [LIBELF_LIB_DIR="${withval}";],)
81 PD_CHECK_INC_DIR($LIBELF_INC_DIR, [libelf.h])
82 PD_CHECK_LIB_DIR($LIBELF_LIB_DIR,[elf],[elf_memory])
83 PD_CHECK_LIB_TYPE($LIBELF_LIB_DIR, elf)
84 LIBELF_STATIC="$LIB_TYPE_STATIC"
85 LIBELF_DYNAMIC="$LIB_TYPE_DYNAMIC"
86 AC_SUBST(LIBELF_INC_DIR)
87 AC_SUBST(LIBELF_LIB_DIR)
88 AC_SUBST(LIBELF_STATIC)
89 AC_SUBST(LIBELF_DYNAMIC)
90
91
92 AC_ARG_WITH(libdwarf-incdir,
93             [AS_HELP_STRING([--with-libdwarf-incdir],[LIBDWARF include directory])],
94             [LIBDWARF_INC_DIR="${withval}";],)
95 AC_ARG_WITH(libdwarf-libdir,
96             [AS_HELP_STRING([--with-libdwarf-libdir],[LIBDWARF library directory])],
97             [LIBDWARF_LIB_DIR="${withval}";],)
98 PD_CHECK_INC_DIR($LIBDWARF_INC_DIR,[libdwarf.h])
99 PD_CHECK_LIB_DIR($LIBDWARF_LIB_DIR,[dwarf],[dwarf_add_arange],$LIBDWARF_LIB_DIR,[-lelf])
100 PD_CHECK_LIB_TYPE($LIBDWARF_LIB_DIR, dwarf)
101 LIBDWARF_STATIC="$LIB_TYPE_STATIC"
102 LIBDWARF_DYNAMIC="$LIB_TYPE_DYNAMIC"
103 AC_SUBST(LIBDWARF_INC_DIR)
104 AC_SUBST(LIBDWARF_LIB_DIR)
105 AC_SUBST(LIBDWARF_STATIC)
106 AC_SUBST(LIBDWARF_DYNAMIC)
107
108
109 AC_ARG_WITH(libxml2-incdir,
110             [AS_HELP_STRING([--with-libxml2-incdir],[LIBXML2 include directory])],
111             [LIBXML2_INC_DIR="${withval}";],)
112 AC_ARG_WITH(libxml2-libdir,
113             [AS_HELP_STRING([--with-libxml2-libdir],[LIBXML2 library directory])],
114             [LIBXML2_LIB_DIR="${withval}";],)
115 PD_CHECK_INC_DIR($LIBXML2_INC_DIR, [libxml/xmlschemas.h])
116 PD_CHECK_LIB_DIR($LIBXML2_LIB_DIR,[xml2],[xmlAddID])
117 AC_SUBST(LIBXML2_INC_DIR)
118 AC_SUBST(LIBXML2_LIB_DIR)
119
120
121 AC_ARG_WITH(libiberty-incdir,
122             [AS_HELP_STRING([--with-libiberty-incdir],[LIBIBERTY include directory])],
123             [LIBIBERTY_INC_DIR="${withval}";],)
124 AC_ARG_WITH(libxml2-libdir,
125             [AS_HELP_STRING([--with-libiberty-libdir],[LIBIBERTY library directory])],
126             [LIBIBERTY_LIB_DIR="${withval}";],)
127 PD_SOFT_CHECK_INC_DIR($LIBIBERTY_INC_DIR,[libiberty.h])
128 PD_SOFT_CHECK_LIB_DIR($LIBIBERTY_LIB_DIR,[iberty],[cplus_demangle])
129 AC_SUBST(LIBIBERTY_INC_DIR)
130 AC_SUBST(LIBIBERTY_LIB_DIR)
131
132
133 AC_ARG_WITH(libunwind-incdir,
134             [AS_HELP_STRING([--with-libunwind-incdir],[LIBUNWIND include directory])],
135             [LIBUNWIND_INC_DIR="${withval}";],)
136 AC_ARG_WITH(libunwind-libdir,
137             [AS_HELP_STRING([--with-libunwind-libdir],[LIBUNWIND library directory])],
138             [LIBUNWIND_LIB_DIR="${withval}";],)
139 AC_CANONICAL_HOST
140 case $host in
141      ia64-*-*-*) PD_CHECK_INC_DIR(${LIBUNWIND_INC_DIR}, [libunwind.h]) ;;
142      *) ;;
143 esac
144 PD_SOFT_CHECK_INC_DIR($LIBUNWIND_INC_DIR,[unwind.h])
145 PD_SOFT_CHECK_LIB_DIR($LIBUNWIND_LIB_DIR,[unwind],[main])
146 AC_SUBST(LIBUNWIND_INC_DIR)
147 AC_SUBST(LIBUNWIND_LIB_DIR)
148
149
150 AC_ARG_WITH(libflex-libdir,
151             [AS_HELP_STRING([--with-libflex-libdir],[Absolute path to flex library])],
152             [LIBFLEX_LIB_DIR="${withval}";],)
153 # 3/15/09: We are not checking for libflex sources and they are not in cs.wisc.edu package-base.
154 #          What's the story here?  Not needed?
155 PD_CHECK_LIB_DIR(${LIBFLEX_LIB_DIR}, [fl], [yywrap])
156 AC_SUBST(LIBFLEX_LIB_DIR)
157 AC_PATH_PROG(NASM, nasm, "", "${PACKAGE_BASE}/nasm/bin:$PATH")
158 AC_SUBST(NASM)
159
160
161 AC_MSG_CHECKING([whether to use MM timer])
162 case $host in
163      ia64-*-*-*) MMTIMER=true ;;
164      *)    MMTIMER=false ;;
165 esac
166 AC_MSG_RESULT(${MMTIMER})
167 AC_SUBST([MMTIMER])
168
169
170 AC_CHECK_FILE("${PACKAGE_BASE}/papi-3.0.0-test/papi.c",
171         [PAPI_ROOT="${PACKAGE_BASE}/papi-3.0.0-test/"],
172         [PAPI_ROOT=""])
173 AC_SUBST([PAPI_ROOT])
174
175
176 AC_CONFIG_FILES([make.config.local:./autodyninst/make.config.local.in])
177 AC_OUTPUT