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