Autoconf fix: wrong variables used for ICC/ICPC.
[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 AC_CANONICAL_HOST
75 echo $host_os
76
77 if test "`echo $host_os | cut -b-3`" = "aix" ; then
78    AC_MSG_NOTICE([AIX system, skipping libelf/libdwarf checks...])
79    
80 else
81    AC_ARG_WITH(libelf-incdir,
82                    [AS_HELP_STRING([--with-libelf-incdir],[LIBELF include directory])],
83                    [LIBELF_INC_DIR="${withval}";],)
84    AC_ARG_WITH(libelf-libdir,
85             [AS_HELP_STRING([--with-libelf-libdir],[LIBELF library directory])],
86             [LIBELF_LIB_DIR="${withval}";],)
87    PD_CHECK_INC_DIR($LIBELF_INC_DIR, [libelf.h])
88    PD_CHECK_LIB_DIR($LIBELF_LIB_DIR,[elf],[elf_memory])
89    PD_CHECK_LIB_TYPE($LIBELF_LIB_DIR, elf)
90    LIBELF_STATIC="$LIB_TYPE_STATIC"
91    LIBELF_DYNAMIC="$LIB_TYPE_DYNAMIC"
92    AC_SUBST(LIBELF_INC_DIR)
93    AC_SUBST(LIBELF_LIB_DIR)
94    AC_SUBST(LIBELF_STATIC)
95    AC_SUBST(LIBELF_DYNAMIC)
96 fi
97
98 if test "`echo $host_os | cut -b-3`" = "aix" ; then
99    AC_MSG_NOTICE([AIX system, skipping libelf/libdwarf checks...])
100    
101 else
102    AC_ARG_WITH(libdwarf-incdir,
103             [AS_HELP_STRING([--with-libdwarf-incdir],[LIBDWARF include directory])],
104             [LIBDWARF_INC_DIR="${withval}";],)
105    AC_ARG_WITH(libdwarf-libdir,
106             [AS_HELP_STRING([--with-libdwarf-libdir],[LIBDWARF library directory])],
107             [LIBDWARF_LIB_DIR="${withval}";],)
108    PD_CHECK_INC_DIR($LIBDWARF_INC_DIR,[libdwarf.h])
109    PD_CHECK_LIB_DIR($LIBDWARF_LIB_DIR,[dwarf],[dwarf_add_arange],$LIBDWARF_LIB_DIR,[-lelf])
110    PD_CHECK_LIB_TYPE($LIBDWARF_LIB_DIR, dwarf)
111    LIBDWARF_STATIC="$LIB_TYPE_STATIC"
112    LIBDWARF_DYNAMIC="$LIB_TYPE_DYNAMIC"
113    AC_SUBST(LIBDWARF_INC_DIR)
114    AC_SUBST(LIBDWARF_LIB_DIR)
115    AC_SUBST(LIBDWARF_STATIC)
116    AC_SUBST(LIBDWARF_DYNAMIC)
117 fi
118
119
120
121
122 AC_ARG_WITH(libxml2-incdir,
123             [AS_HELP_STRING([--with-libxml2-incdir],[LIBXML2 include directory])],
124             [LIBXML2_INC_DIR="${withval}";],)
125 AC_ARG_WITH(libxml2-libdir,
126             [AS_HELP_STRING([--with-libxml2-libdir],[LIBXML2 library directory])],
127             [LIBXML2_LIB_DIR="${withval}";],)
128 PD_SOFT_CHECK_INC_DIR($LIBXML2_INC_DIR, [libxml/xmlschemas.h], [libxml])
129 PD_SOFT_CHECK_LIB_DIR($LIBXML2_LIB_DIR,[xml2],[xmlAddID], [libxml])
130 AC_DEFINE
131 AC_SUBST(LIBXML2_INC_DIR)
132 AC_SUBST(LIBXML2_LIB_DIR)
133
134
135 AC_ARG_WITH(libiberty-incdir,
136             [AS_HELP_STRING([--with-libiberty-incdir],[LIBIBERTY include directory])],
137             [LIBIBERTY_INC_DIR="${withval}";],)
138 AC_ARG_WITH(libxml2-libdir,
139             [AS_HELP_STRING([--with-libiberty-libdir],[LIBIBERTY library directory])],
140             [LIBIBERTY_LIB_DIR="${withval}";],)
141 PD_SOFT_CHECK_INC_DIR($LIBIBERTY_INC_DIR,[libiberty.h])
142 PD_SOFT_CHECK_LIB_DIR($LIBIBERTY_LIB_DIR,[iberty],[cplus_demangle])
143 AC_SUBST(LIBIBERTY_INC_DIR)
144 AC_SUBST(LIBIBERTY_LIB_DIR)
145
146
147 AC_ARG_WITH(libunwind-incdir,
148             [AS_HELP_STRING([--with-libunwind-incdir],[LIBUNWIND include directory])],
149             [LIBUNWIND_INC_DIR="${withval}";],)
150 AC_ARG_WITH(libunwind-libdir,
151             [AS_HELP_STRING([--with-libunwind-libdir],[LIBUNWIND library directory])],
152             [LIBUNWIND_LIB_DIR="${withval}";],)
153
154 case $host in
155      ia64-*-*-*) PD_CHECK_INC_DIR(${LIBUNWIND_INC_DIR}, [libunwind.h]) ;;
156      *) ;;
157 esac
158 PD_SOFT_CHECK_INC_DIR($LIBUNWIND_INC_DIR,[unwind.h])
159 PD_SOFT_CHECK_LIB_DIR($LIBUNWIND_LIB_DIR,[unwind],[main])
160 AC_SUBST(LIBUNWIND_INC_DIR)
161 AC_SUBST(LIBUNWIND_LIB_DIR)
162
163
164 AC_ARG_WITH(libflex-libdir,
165             [AS_HELP_STRING([--with-libflex-libdir],[Absolute path to flex library])],
166             [LIBFLEX_LIB_DIR="${withval}";],)
167 # 3/15/09: We are not checking for libflex sources and they are not in cs.wisc.edu package-base.
168 #          What's the story here?  Not needed?
169 PD_SOFT_CHECK_LIB_DIR(${LIBFLEX_LIB_DIR}, [fl], [yywrap])
170 AC_SUBST(LIBFLEX_LIB_DIR)
171 AC_PATH_PROG(NASM, nasm, "", "${PACKAGE_BASE}/nasm/bin:$PATH")
172 AC_SUBST(NASM)
173
174
175 AC_MSG_CHECKING([whether to use MM timer])
176 case $host in
177      ia64-*-*-*) MMTIMER=true ;;
178      *)    MMTIMER=false ;;
179 esac
180 AC_MSG_RESULT(${MMTIMER})
181 AC_SUBST([MMTIMER])
182
183
184 AC_CONFIG_FILES([make.config.local:./autodyninst/make.config.local.in])
185 AC_OUTPUT