Merge branch 'master' of legendre@git.dyninst.org:/pub/dyninst
[dyninst.git] / autodyninst / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.59)
4 AC_INIT(configure.in)
5
6 AC_PROG_CXX(g++)
7 AC_LANG(C++)
8
9 dnl === CONFIGURE OPTIONS
10
11 AC_ARG_WITH(package-base,
12            [AS_HELP_STRING([--with-package-base],[Base directory to look for packages])],
13            [PACKAGE_BASE="${withval}";],
14            [PACKAGE_BASE="";])
15
16 AC_ARG_WITH(tcl83,
17             [AS_HELP_STRING([--with-tcl83],[Use Tcl/Tk 8.3])],
18             [TCL_VERSION="tcl8.3"; USE_TCL83="${withval}";],
19             [TCL_VERSION="tcl8.4"; USE_TCL83="false";])
20 AC_ARG_WITH(tcltk-incdir,
21             [AS_HELP_STRING([--with-tcltk-incdir],[TCL/TK include directory])],
22             [TCLTK_INC_DIR="${withval}";],
23            [AC_ARG_WITH(package-base,[],[TCLTK_INC_DIR="${PACKAGE_BASE}/tcl8.4.5/include"], [TCLTK_INC_DIR=""])])
24 AC_ARG_WITH(tcltk-libdir,
25             [AS_HELP_STRING([--with-tcltk-libdir],[TCL/TK library directory])],
26             [TCLTK_LIB_DIR="${withval}";],
27            [AC_ARG_WITH(package-base,[],[TCLTK_LIB_DIR="${PACKAGE_BASE}/tcl8.4.5/lib"], [TCLTK_LIB_DIR=""])])
28
29 PD_SOFT_CHECK_INC_DIR($TCLTK_INC_DIR, [tcl.h])
30 PD_SOFT_CHECK_LIB_DIR($TCLTK_LIB_DIR,$TCL_VERSION,[Tcl_Eval])
31
32 AC_SUBST(USE_TCL83)
33 AC_SUBST(TCLTK_INC_DIR)
34 AC_SUBST(TCLTK_LIB_DIR)
35
36 AC_ARG_WITH(libelf-incdir,
37             [AS_HELP_STRING([--with-libelf-incdir],[LIBELF include directory])],
38             [LIBELF_INC_DIR="${withval}";],
39            [AC_ARG_WITH(package-base,[],[LIBELF_INC_DIR="${PACKAGE_BASE}/libelf/include"], [LIBELF_INC_DIR="/usr/include"])])
40 AC_ARG_WITH(libelf-libdir,
41             [AS_HELP_STRING([--with-libelf-libdir],[LIBELF library directory])],
42             [LIBELF_LIB_DIR="${withval}";],
43            [AC_ARG_WITH(package-base,[],[LIBELF_LIB_DIR="${PACKAGE_BASE}/libelf/lib"], [LIBELF_LIB_DIR="/usr/lib"])])
44 AC_ARG_WITH(libelf-static,
45             [AS_HELP_STRING([--with-libelf-static],[Link against static libelf])],
46             [LIBELFSTATIC="LIBELFSTATIC=true";])
47
48 PD_CHECK_INC_DIR($LIBELF_INC_DIR, [libelf.h])
49 PD_CHECK_LIB_DIR($LIBELF_LIB_DIR,[elf],[elf_memory])
50
51 AC_SUBST(LIBELF_INC_DIR)
52 AC_SUBST(LIBELF_LIB_DIR)
53
54 AC_ARG_WITH(libdwarf-incdir,
55             [AS_HELP_STRING([--with-libdwarf-incdir],[LIBDWARF include directory])],
56             [LIBDWARF_INC_DIR="${withval}";],
57            [AC_ARG_WITH(package-base,[],[LIBDWARF_INC_DIR="${PACKAGE_BASE}/libdwarf/include"], [LIBDWARF_INC_DIR=""])])
58
59 AC_ARG_WITH(libdwarf-libdir,
60             [AS_HELP_STRING([--with-libdwarf-libdir],[LIBDWARF library directory])],
61             [LIBDWARF_LIB_DIR="${withval}";],
62            [AC_ARG_WITH(package-base,[],[LIBDWARF_LIB_DIR="${PACKAGE_BASE}/libdwarf/lib"], [LIBDWARF_LIB_DIR=""])])
63 PD_CHECK_INC_DIR($LIBDWARF_INC_DIR,[libdwarf.h])
64 PD_CHECK_LIB_DIR($LIBDWARF_LIB_DIR,[dwarf],[dwarf_add_arange],$LIBELF_LIB_DIR,[-lelf])
65
66 AC_ARG_WITH(libdwarf-static,
67             [AS_HELP_STRING([--with-libdwarf-static],[Link against static libdwarf])],
68             [LIBDWARFSTATIC="LIBDWARFSTATIC=true";])
69
70 AC_ARG_WITH(libiberty-static,
71             [AS_HELP_STRING([--with-libiberty-static],[Link against static libiberty])],
72             [LIBDWARFSTATIC="LIBIBERTYSTATIC=true";])
73
74
75 AC_SUBST(LIBDWARF_INC_DIR)
76 AC_SUBST(LIBDWARF_LIB_DIR)
77
78 AC_SUBST(LIBDWARFSTATIC)
79 AC_SUBST(LIBELFSTATIC)
80 AC_SUBST(LIBIBERTYSTATIC)
81
82 AC_ARG_WITH(libxml2-incdir,
83             [AS_HELP_STRING([--with-libxml2-incdir],[LIBXML2 include directory])],
84             [LIBXML2_INC_DIR="${withval}";],
85            [AC_ARG_WITH(package-base,[],[LIBXML2_INC_DIR="${PACKAGE_BASE}/libxml2/include/libxml2"], [LIBXML2_INC_DIR="/usr/include/libxml2"])])
86
87 AC_ARG_WITH(libxml2-libdir,
88             [AS_HELP_STRING([--with-libxml2-libdir],[LIBXML2 library directory])],
89             [LIBXML2_LIB_DIR="${withval}";],
90            [AC_ARG_WITH(package-base,[],[LIBXML2_LIB_DIR="${PACKAGE_BASE}/libxml2/lib"], [LIBXML2_LIB_DIR="/usr/lib"])])
91
92 PD_CHECK_INC_DIR($LIBXML2_INC_DIR, [libxml/xmlschemas.h])
93 PD_CHECK_LIB_DIR($LIBXML2_LIB_DIR,[xml2],[xmlAddID])
94
95 AC_SUBST(LIBXML2_INC_DIR)
96 AC_SUBST(LIBXML2_LIB_DIR)
97
98 AC_ARG_WITH(libunwind-incdir,
99             [AS_HELP_STRING([--with-libunwind-incdir],[LIBUNWIND include directory])],
100             [LIBUNWIND_INC_DIR="${withval}";],
101            [AC_ARG_WITH(package-base,[],[LIBUNWIND_INC_DIR="${PACKAGE_BASE}/libunwind/include"], [LIBUNWIND_INC_DIR=""])])
102
103 AC_ARG_WITH(libunwind-libdir,
104             [AS_HELP_STRING([--with-libunwind-libdir],[LIBUNWIND library directory])],
105             [LIBUNWIND_LIB_DIR="${withval}";],
106            [AC_ARG_WITH(package-base,[],[LIBUNWIND_LIB_DIR="${PACKAGE_BASE}/libunwind/lib"], [LIBUNWIND_LIB_DIR=""])])
107
108 AC_CANONICAL_HOST
109 case $host in
110 #     ia64-*-*-*) PD_CHECK_LIB_DIR(${LIBUNWIND_LIB_DIR}, [unwind], [ia64_read_only_reg]) ;;
111      ia64-*-*-*) PD_CHECK_INC_DIR(${LIBUNWIND_INC_DIR}, [libunwind.h]) ;;
112 #     ia64-*-*-*) AC_CHECK_TYPE([unw_dyn_region_info_t], [], [AC_MSG_ERROR([cannot find unw_dyn_region_info_t in libunwind.h])], [${LIBUNWIND_INC_DIR}/libunwind.h]) ;;
113      *) ;;
114 esac
115
116 AC_SUBST(LIBUNWIND_INC_DIR)
117 AC_SUBST(LIBUNWIND_LIB_DIR)
118
119 AC_ARG_WITH(libflex-libdir,
120             [AS_HELP_STRING([--with-libflex-libdir],[Absolute path to flex library])],
121             [LIBFLEX_LIB_DIR="${withval}";],
122            [AC_ARG_WITH(package-base,[],[LIBFLEX_LIB_DIR="${PACKAGE_BASE}/libflex/lib"],[LIBFLEX_LIB_DIR=""])])
123
124 PD_CHECK_LIB_DIR(${LIBFLEX_LIB_DIR}, [fl], [yywrap])
125 AC_SUBST(LIBFLEX_LIB_DIR)
126
127 AC_PATH_PROG(NASM, nasm, "", "${PACKAGE_BASE}/nasm/bin:$PATH")
128 AC_SUBST(NASM)
129
130
131 AC_MSG_CHECKING([whether to use MM timer])
132 case $host in
133      ia64-*-*-*) MMTIMER=true ;;
134      *)    MMTIMER=false ;;
135 esac
136 AC_MSG_RESULT(${MMTIMER})
137 AC_SUBST([MMTIMER])
138
139 AC_CHECK_FILE("${PACKAGE_BASE}/papi-3.0.0-test/papi.c",
140         [PAPI_ROOT="${PACKAGE_BASE}/papi-3.0.0-test/"],
141         [PAPI_ROOT=""])
142
143 AC_SUBST([PAPI_ROOT])
144 AC_CONFIG_FILES([make.config.local:make.config.local.in ])
145 AC_OUTPUT