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