Recycling a stab at automagically generating make.config.local.
[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
10 dnl === CONFIGURE OPTIONS
11
12 AC_ARG_WITH(package-base,
13            [AS_HELP_STRING([--with-package-base],[Base directory to look for packages])],
14            [PACKAGE_BASE="${withval}";],
15            [PACKAGE_BASE="";])
16
17 AC_ARG_WITH(tcl83,
18             [AS_HELP_STRING([--with-tcl83],[Use Tcl/Tk 8.3])],
19             [TCL_VERSION="tcl8.3"; USE_TCL83="${withval}";],
20             [TCL_VERSION="tcl8.4"; USE_TCL83="false";])
21 AC_ARG_WITH(tcltk-incdir,
22             [AS_HELP_STRING([--with-tcltk-incdir],[TCL/TK include directory])],
23             [TCLTK_INC_DIR="${withval}";],
24            [AC_ARG_WITH(package-base,[],[TCLTK_INC_DIR="${PACKAGE_BASE}/tcl8.4.5/include"], [TCLTK_INC_DIR=""])])
25 AC_ARG_WITH(tcltk-libdir,
26             [AS_HELP_STRING([--with-tcltk-libdir],[TCL/TK library directory])],
27             [TCLTK_LIB_DIR="${withval}";],
28            [AC_ARG_WITH(package-base,[],[TCLTK_LIB_DIR="${PACKAGE_BASE}/tcl8.4.5/lib"], [TCLTK_LIB_DIR=""])])
29
30 PD_SOFT_CHECK_INC_DIR($TCLTK_INC_DIR, [tcl.h])
31 PD_SOFT_CHECK_LIB_DIR($TCLTK_LIB_DIR,$TCL_VERSION,[Tcl_Eval])
32
33 AC_SUBST(USE_TCL83)
34 AC_SUBST(TCLTK_INC_DIR)
35 AC_SUBST(TCLTK_LIB_DIR)
36
37 AC_ARG_WITH(libelf-incdir,
38             [AS_HELP_STRING([--with-libelf-incdir],[LIBELF include directory])],
39             [LIBELF_INC_DIR="${withval}";],
40            [AC_ARG_WITH(package-base,[],[LIBELF_INC_DIR="${PACKAGE_BASE}/libelf/include"], [LIBELF_INC_DIR=""])])
41 AC_ARG_WITH(libelf-libdir,
42             [AS_HELP_STRING([--with-libelf-libdir],[LIBELF library directory])],
43             [LIBELF_LIB_DIR="${withval}";],
44            [AC_ARG_WITH(package-base,[],[LIBELF_LIB_DIR="${PACKAGE_BASE}/libelf/lib"], [LIBELF_LIB_DIR=""])])
45
46 PD_CHECK_INC_DIR($LIBELF_INC_DIR, [libelf.h])
47 PD_CHECK_LIB_DIR($LIBELF_LIB_DIR,[elf],[elf_memory])
48
49 AC_SUBST(LIBELF_INC_DIR)
50 AC_SUBST(LIBELF_LIB_DIR)
51
52 AC_ARG_WITH(libdwarf-incdir,
53             [AS_HELP_STRING([--with-libdwarf-incdir],[LIBDWARF include directory])],
54             [LIBDWARF_INC_DIR="${withval}";],
55            [AC_ARG_WITH(package-base,[],[LIBDWARF_INC_DIR="${PACKAGE_BASE}/libdwarf/include"], [LIBDWARF_INC_DIR=""])])
56
57 AC_ARG_WITH(libdwarf-libdir,
58             [AS_HELP_STRING([--with-libdwarf-libdir],[LIBDWARF library directory])],
59             [LIBDWARF_LIB_DIR="${withval}";],
60            [AC_ARG_WITH(package-base,[],[LIBDWARF_LIB_DIR="${PACKAGE_BASE}/libdwarf/lib"], [LIBDWARF_LIB_DIR=""])])
61
62 PD_CHECK_INC_DIR($LIBDWARF_INC_DIR,[libdwarf.h])
63 PD_CHECK_LIB_DIR($LIBDWARF_LIB_DIR,[dwarf],[dwarf_add_arange],$LIBELF_LIB_DIR,[-lelf])
64
65 AC_SUBST(LIBDWARF_INC_DIR)
66 AC_SUBST(LIBDWARF_LIB_DIR)
67
68 AC_ARG_WITH(libxml2-incdir,
69             [AS_HELP_STRING([--with-libxml2-incdir],[LIBXML2 include directory])],
70             [LIBXML2_INC_DIR="${withval}";],
71            [AC_ARG_WITH(package-base,[],[LIBXML2_INC_DIR="${PACKAGE_BASE}/libxml2/include/libxml2"], [LIBXML2_INC_DIR=""])])
72
73 AC_ARG_WITH(libxml2-libdir,
74             [AS_HELP_STRING([--with-libxml2-libdir],[LIBXML2 library directory])],
75             [LIBXML2_LIB_DIR="${withval}";],
76            [AC_ARG_WITH(package-base,[],[LIBXML2_LIB_DIR="${PACKAGE_BASE}/libxml2/lib"], [LIBXML2_LIB_DIR=""])])
77
78 PD_CHECK_INC_DIR($LIBXML2_INC_DIR, [libxml/xmlschemas.h])
79 PD_CHECK_LIB_DIR($LIBXML2_LIB_DIR,[xml2],[xmlAddID])
80
81 AC_SUBST(LIBXML2_INC_DIR)
82 AC_SUBST(LIBXML2_LIB_DIR)
83
84 AC_ARG_WITH(libunwind-incdir,
85             [AS_HELP_STRING([--with-libunwind-incdir],[LIBUNWIND include directory])],
86             [LIBUNWIND_INC_DIR="${withval}";],
87            [AC_ARG_WITH(package-base,[],[LIBUNWIND_INC_DIR="${PACKAGE_BASE}/libunwind/include"], [LIBUNWIND_INC_DIR=""])])
88
89 AC_ARG_WITH(libunwind-libdir,
90             [AS_HELP_STRING([--with-libunwind-libdir],[LIBUNWIND library directory])],
91             [LIBUNWIND_LIB_DIR="${withval}";],
92            [AC_ARG_WITH(package-base,[],[LIBUNWIND_LIB_DIR="${PACKAGE_BASE}/libunwind/lib"], [LIBUNWIND_LIB_DIR=""])])
93
94 AC_CANONICAL_HOST
95 case $host in
96 #     ia64-*-*-*) PD_CHECK_LIB_DIR(${LIBUNWIND_LIB_DIR}, [unwind], [ia64_read_only_reg]) ;;
97      ia64-*-*-*) PD_CHECK_INC_DIR(${LIBUNWIND_INC_DIR}, [libunwind.h]) ;;
98 #     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]) ;;
99      *) ;;
100 esac
101
102 AC_SUBST(LIBUNWIND_INC_DIR)
103 AC_SUBST(LIBUNWIND_LIB_DIR)
104
105 AC_ARG_WITH(libflex-libdir,
106             [AS_HELP_STRING([--with-libflex-libdir],[Absolute path to flex library])],
107             [LIBFLEX_LIB_DIR="${withval}";],
108            [AC_ARG_WITH(package-base,[],[LIBFLEX_LIB_DIR="${PACKAGE_BASE}/libflex/lib"],[LIBFLEX_LIB_DIR=""])])
109
110 PD_CHECK_LIB_DIR(${LIBFLEX_LIB_DIR}, [fl], [yywrap])
111 AC_SUBST(LIBFLEX_LIB_DIR)
112
113 AC_PATH_PROG(NASM, nasm, "", "${PACKAGE_BASE}/nasm/bin:$PATH")
114 AC_SUBST(NASM)
115
116
117 AC_MSG_CHECKING([whether to use MM timer])
118 case $host in
119      ia64-*-*-*) MMTIMER=true ;;
120      *)    MMTIMER=false ;;
121 esac
122 AC_MSG_RESULT(${MMTIMER})
123 AC_SUBST([MMTIMER])
124
125 AC_CHECK_FILE("${PACKAGE_BASE}/papi-3.0.0-test/papi.c",
126         [PAPI_ROOT="${PACKAGE_BASE}/papi-3.0.0-test/"],
127         [PAPI_ROOT=""])
128
129 AC_SUBST([PAPI_ROOT])
130 AC_CONFIG_FILES([make.config.local:make.config.local.in ])
131 AC_OUTPUT