Modi umbenannt
[libfirm] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Copyright (c) 2001 IPD, Universität Karlsruhe (TH)
3
4 dnl libFIRM Project
5 dnl $Id$
6
7 AC_REVISION($Id$)
8
9
10 AC_INIT(ir/ir/ircons.c)
11
12 dnl if other files should be generated just add them to ac_output_files
13 ac_output_file="Makefile MakeRules ir/Makefile ir/adt/Makefile ir/debug/Makefile \
14                 ir/tv/Makefile ir/common/Makefile ir/ident/Makefile ir/ir/Makefile \
15                 ir/ana/Makefile ir/tr/Makefile ir/st/Makefile testprograms/Makefile \
16                 firmjni/Makefile firmjni/build_firm_jni firmjni/testprograms/Makefile"
17
18 dnl generate the config header file
19 AC_CONFIG_HEADER(config.h)
20
21 dnl keep track of the environment set by the user
22 libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS'}"
23 AC_SUBST(libfirm_conf_env)
24
25
26 dnl Package options
27 dnl ===============
28
29 dnl set debugging
30 dnl -------------
31 AC_ARG_ENABLE(debug,
32 [  --enable-debug          enable assertions and additional debugging routines],
33 [if test "$enableval" = yes; then
34   AC_DEFINE(DEBUG_libfirm)
35 else
36   AC_DEFINE(NDEBUG)
37 fi])
38 AC_SUBST(enable_debug_libfirm)
39
40 AC_ARG_ENABLE(gcc_inline,
41 [  --enable-gcc_inline     enable gcc inline C-extension],
42 [if test "$enableval" = yes; then
43   AC_DEFINE(USE_GCC_INLINE)
44 fi])
45 AC_SUBST(enable_gcc_inline)
46
47
48 dnl set profiling
49 dnl -------------
50 AC_ARG_ENABLE(profile,
51 [  --enable-profile        enable profiling],
52 [if test "$enableval"=yes; then
53   enable_profile_libfirm=yes
54 fi],
55 [enable_profile_libfirm=no])
56 AC_SUBST(enable_profile_libfirm)
57
58 dnl set auto documentation
59 dnl ----------------------
60 AC_ARG_ENABLE(autodoc,
61 [  --enable-autodoc        enable auto documentation],
62 [if test "$enableval"=yes; then
63   enable_auto_documentation=yes
64 fi],
65 [enable_auto_documentation=no])
66 AC_SUBST(enable_auto_documentation)
67
68
69 dnl set firm jni
70 dnl ------------
71 AC_ARG_ENABLE(firmjni,
72 [  --enable-firmjni        check for tools necesarry to construct a java native interface for Firm],
73 [if test "$enableval"=yes; then
74   enable_firm_jni=yes
75 fi],
76 [enable_firm_jni=no])
77 AC_SUBST(enable_firm_jni)
78
79
80 dnl Checks for programs.
81 dnl ====================
82
83 dnl check for a C compiler
84 dnl ----------------------
85 AC_PROG_CC
86
87 dnl check for prelinkable linker
88 dnl ----------------------------
89 LIBFIRM_PROG_LD_R
90 if test "$libfirm_cv_prog_ld_r" != "yes"; then
91   AC_MSG_ERROR(need a prelinkcapable linker)
92 fi
93
94 dnl check for ar
95 dnl ------------
96 AC_CHECK_PROG(AR, ar, "ar", "")
97 if test "$AR" != "ar"; then
98   AC_MSG_ERROR(need ar for creating archives)
99 fi
100
101 dnl check for tar
102 dnl -------------
103 AC_CHECK_PROG(TAR, tar, "tar", "")
104 if test "$TAR" != "tar"; then
105   AC_MSG_ERROR(need tar for creating archives in distribution)
106 fi
107
108 dnl check whether ar can handle option -s
109 dnl if not then ranlib is needed
110 dnl for simpliticity we use ranlib every time
111
112 AC_PROG_RANLIB
113
114 AC_PROG_INSTALL
115
116 AC_PROG_LN_S
117
118 dnl check for robodoc if enabled
119 dnl ----------------------------
120 if test "$enable_auto_documentation" = yes; then
121   AC_CHECK_PROG(ROBODOC, robodoc, "robodoc", "")
122   if test "$ROBODOC" != "robodoc"; then
123     AC_MSG_ERROR(need robodoc for auto documentation (IPD: module add robodoc))
124   fi
125 fi
126
127
128 dnl check for availability of a jdk
129 dnl -------------------------------
130 if test "$enable_firm_jni" = yes; then
131   AC_CHECK_PROG(JAVAC, javac, "javac", "")
132   if test "$JAVAC" != "javac"; then
133     AC_MSG_ERROR(need java compiler javac to generate jni (IPD: module add jdk-1.3.1-sun))
134   fi
135   AC_CHECK_PROG(JAVAH, javah, "javah", "")
136   if test "$JAVAH" != "javah"; then
137     AC_MSG_ERROR(need javah to generate jni headers (IPD: module add jdk-1.3.1-sun))
138   fi
139 fi
140
141
142 dnl Checks for header files.
143 dnl ========================
144
145 AC_HEADER_STDC
146
147 dnl check for the math header file
148
149 AC_CHECK_HEADERS(math.h, ac_math_headers="yes", ac_math_headers="no")
150 if test "$ac_math_headers" != yes; then
151   dnl math header not found.
152   AC_MSG_ERROR("math header file not found")
153 fi
154
155
156 dnl check for the gnu multiprecission (gmp) header file
157
158 AC_CHECK_HEADERS(gmp.h, ac_gmp_headers="yes", ac_gmp_headers="no")
159 if test "$ac_gmp_headers" != yes; then
160   dnl gmp header not found.
161   AC_MSG_ERROR("GNU multiprecission gmp header file not found")
162 fi
163
164
165 dnl check for the obstack header file
166
167 AC_CHECK_HEADERS(obstack.h, ac_obstack_headers="yes", ac_obstack_headers="no")
168 if test "$ac_obstack_headers" != yes; then
169   dnl obstack header not found.
170   AC_MSG_ERROR("obstack header file not found")
171 fi
172
173
174 dnl check for jni header files
175
176 if test "$enable_firm_jni" = yes; then
177   AC_CHECK_HEADERS(jni.h, ac_jni_headers="yes", ac_jni_headers="no")
178   if test "$ac_jni_headers" != yes; then
179     AC_MSG_ERROR(jni header file not found. (IPD: add -I/usr/public2/java/jdk1.3.1-sun/include/ -I/usr/public2/java/jdk1.3.1-sun/include/linux/ to CPPFLAGS))
180   fi
181 fi
182
183
184 dnl Checks for libraries.
185 dnl =====================
186
187 dnl check for the gnu multiprecission (gmp) library
188
189 AC_CHECK_LIB(gmp, main, ac_gmp_library="yes", ac_gmp_library="no")
190 if test "$ac_gmp_library" != yes; then
191   dnl gmp library not found.
192   AC_MSG_ERROR("GNU multiprecission gmp library not found")
193 fi
194
195
196 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
197 if test "$ac_m_library" != yes; then
198   dnl std math library not found.
199   AC_MSG_ERROR("standard math library not found")
200 fi
201
202
203 dnl Checks for typedefs, structures, and compiler characteristics.
204 dnl ==============================================================
205
206
207 dnl Checks for library functions.
208 dnl =============================
209
210 dnl check for strerror
211
212 AC_CHECK_FUNC(strerror,,
213   AC_MSG_ERROR("need strerror function")
214 )
215
216
217 dnl Error messaging
218 dnl ===============
219
220
221 AC_OUTPUT($ac_output_file,[ touch stamp-h ])