stupid encoding error on i44pc47
[libfirm] / configure.in
1 dnl
2 dnl Project:     libFIRM
3 dnl File name:   configure.in
4 dnl Purpose:
5 dnl Author:      Till Riedel (??)
6 dnl Modified by:
7 dnl Created:
8 dnl CVS-ID:      $Id$
9 dnl Copyright:   (c) 2002-2003 Universität Karlsruhe
10 dnl Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11 dnl
12
13
14 AC_REVISION($Id$)
15
16
17
18 AC_INIT(libfirm,0.3.0)
19 AC_PREREQ(2.50)
20 dnl if other files should be generated just add them to ac_output_files
21 ac_output_file="Makefile MakeRules ir/Makefile ir/adt/Makefile ir/debug/Makefile \
22                 ir/tv/Makefile ir/common/Makefile ir/ident/Makefile ir/ir/Makefile \
23                 ir/ana/Makefile ir/tr/Makefile ir/st/Makefile testprograms/Makefile \
24                 firmjni/Makefile firmjni/testprograms/Makefile libfirm.doxygen"
25
26 dnl generate the config header file
27 AC_CONFIG_HEADER(config.h)
28
29 dnl keep track of the environment set by the user
30 libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS'}"
31 AC_SUBST(libfirm_conf_env)
32
33 dnl check for additional include dirs
34 AC_ARG_WITH(includedir, [  --with-includedir=add colon seperated list of directories to include search path],
35     CPPFLAGS=$CPPFLAGS" -I"`echo $withval|sed 's;\:; -I;g'`, T_FLAG="")
36
37 AC_ARG_WITH(libdir, [  --with-libdir=add colon seperated list of directories to linker search path],
38     LDFLAGS=$LDFLAGS" -L"`echo $withval|sed 's;\:; -L;g'`, T_FLAG="")
39
40
41 dnl Package options
42 dnl ===============
43
44 dnl set debugging
45 dnl -------------
46 AC_ARG_ENABLE(debug,
47 [  --enable-debug          enable assertions and additional debugging routines],
48 [if test "$enableval" = yes; then
49   AC_DEFINE(DEBUG_libfirm)
50 else
51   AC_DEFINE(NDEBUG)
52 fi])
53 AC_SUBST(enable_debug_libfirm)
54
55 AC_ARG_ENABLE(gcc_inline,
56 [  --enable-gcc_inline     enable gcc inline C-extension],
57 [if test "$enableval" = yes; then
58   AC_DEFINE(USE_GCC_INLINE)
59 fi])
60 AC_SUBST(enable_gcc_inline)
61
62
63 dnl set profiling
64 dnl -------------
65 AC_ARG_ENABLE(profile,
66 [  --enable-profile        enable profiling],
67 [if test "$enableval"=yes; then
68   enable_profile_libfirm=yes
69 fi],
70 [enable_profile_libfirm=no])
71 AC_SUBST(enable_profile_libfirm)
72
73 dnl set auto documentation
74 dnl ----------------------
75 AC_ARG_ENABLE(autodoc,
76 [  --enable-autodoc        enable auto documentation],
77 [if test "$enableval"=yes; then
78   enable_auto_documentation=yes
79 fi],
80 [enable_auto_documentation=no])
81 AC_SUBST(enable_auto_documentation)
82
83
84 dnl set firm jni
85 dnl ------------
86 AC_ARG_ENABLE(firmjni,
87 [  --enable-firmjni        check for tools necesarry to construct a java native interface for Firm],
88 [if test "$enableval"=yes; then
89   enable_firm_jni=yes
90 fi],
91 [enable_firm_jni=no])
92 AC_SUBST(enable_firm_jni)
93
94 dnl disable linking of libiberty parts (xmalloc, xprintf, obstack, ...)
95 dnl ----------------------
96 AC_ARG_ENABLE(libiberty,
97 [  --disable-libiberty        disable own libiberty parts],
98 [if test "$enableval"=yes; then
99   disable_libiberty_=yes
100 fi],
101 [disable_libiberty=no])
102 AC_SUBST(disable_libiberty)
103
104
105 dnl Checks for programs.
106 dnl ====================
107
108 dnl check for a C compiler
109 dnl ----------------------
110 AC_PROG_CC
111
112 dnl check for prelinkable linker
113 dnl ----------------------------
114 LIBFIRM_PROG_LD_R
115 if test "$libfirm_cv_prog_ld_r" != "yes"; then
116   AC_MSG_ERROR(need a prelinkcapable linker)
117 fi
118
119 dnl check for ar
120 dnl ------------
121 AC_CHECK_PROG(AR, ar, "ar", "")
122 if test "$AR" != "ar"; then
123   AC_MSG_ERROR(need ar for creating archives)
124 fi
125
126 dnl check for tar
127 dnl -------------
128 AC_CHECK_PROG(TAR, tar, "tar", "")
129 if test "$TAR" != "tar"; then
130   AC_MSG_ERROR(need tar for creating archives in distribution)
131 fi
132
133 dnl check whether ar can handle option -s
134 dnl if not then ranlib is needed
135 dnl for simpliticity we use ranlib every time
136
137 AC_PROG_RANLIB
138
139 AC_PROG_INSTALL
140
141 touch tmp-install.a tmp-install.b
142 if eval "$INSTALL -C tmp-install.a tmp-install.b" ; then
143     INSTALL="$INSTALL -C"
144 fi
145 rm tmp-install.a tmp-install.b
146
147
148 AC_PROG_LN_S
149
150 dnl check for doxygen if enabled
151 dnl ----------------------------
152 if test "$enable_auto_documentation" = yes; then
153   AC_CHECK_PROG(DOXYGEN, doxygen, "doxygen", "")
154   if test "$DOXYGEN" != "doxygen"; then
155     AC_MSG_ERROR(need doxygen for auto documentation)
156   fi
157   AC_CHECK_PROG(DOT, dot, "dot", "")
158   if test "$DOT" != "dot"; then
159     AC_MSG_ERROR(need dot for doxygen documentation (for class graphs) (IPD: module add Graphviz))
160   fi
161 fi
162
163 dnl check for availability of a jdk
164 dnl -------------------------------
165 if test "$enable_firm_jni" = yes; then
166   AC_CHECK_PROG(JAVAC, javac, "javac", "")
167   if test "$JAVAC" != "javac"; then
168     AC_MSG_ERROR(need java compiler javac to generate jni (IPD: module add jdk-1.3.1-sun))
169   fi
170   AC_CHECK_PROG(JAVAH, javah, "javah", "")
171   if test "$JAVAH" != "javah"; then
172     AC_MSG_ERROR(need javah to generate jni headers (IPD: module add jdk-1.3.1-sun))
173   fi
174 fi
175
176
177 dnl Checks for header files.
178 dnl ========================
179
180 AC_HEADER_STDC
181
182 dnl check for the math header file
183
184 AC_CHECK_HEADERS(math.h, ac_math_headers="yes", ac_math_headers="no")
185 if test "$ac_math_headers" != yes; then
186   dnl math header not found.
187   AC_MSG_ERROR("math header file not found")
188 fi
189
190
191 #dnl check for the gnu multiprecission (gmp) header file
192
193 #AC_CHECK_HEADERS(gmp.h, ac_gmp_headers="yes", ac_gmp_headers="no")
194 #if test "$ac_gmp_headers" != yes; then
195 #  dnl gmp header not found.
196 #  AC_MSG_ERROR("GNU multiprecission gmp header file not found")
197 #fi
198
199
200 dnl check for the obstack header file
201 dnl does not work with:
202 dnl  - cygwin
203 dnl  - MacOSX
204 #AC_FUNC_OBSTACK
205
206 AC_CHECK_HEADERS(obstack.h, ac_obstack_headers="yes", ac_obstack_headers="no")
207 if test "$ac_obstack_headers" != yes; then
208   dnl obstack header not found.
209   AC_MSG_ERROR("obstack.h not found")
210 fi
211
212
213 AC_CHECK_HEADERS(alloca.h, ac_alloca_headers="yes", ac_alloca_headers="no")
214 if test "$ac_alloca_headers" != yes; then
215   if test "$ac_cv_header_stdc" == no; then
216     AC_MSG_ERROR("alloca.h and stdlib.h not found")
217   else
218     AC_DEFINE(HAVE_ALLOCA_H)
219   fi
220 fi
221
222
223 dnl check for jni header files
224
225 if test "$enable_firm_jni" = yes; then
226   AC_CHECK_HEADERS(jni.h, ac_jni_headers="yes", ac_jni_headers="no")
227   if test "$ac_jni_headers" != yes; then
228     AC_MSG_ERROR(jni header file not found. (IPD: add --with-includedir=/usr/public2/java/jdk1.3.1-sun/include/:/usr/public2/java/jdk1.3.1-sun/include/linux/ to configure flags))
229   fi
230 fi
231
232
233 dnl Checks for libraries.
234 dnl =====================
235
236 #dnl check for the gnu multiprecission (gmp) library
237
238 #AC_CHECK_LIB(gmp, main, ac_gmp_library="yes", ac_gmp_library="no")
239 #if test "$ac_gmp_library" != yes; then
240 #  dnl gmp library not found.
241 #  AC_MSG_ERROR("GNU multiprecission gmp library not found")
242 #fi
243
244
245 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
246 if test "$ac_m_library" != yes; then
247   dnl std math library not found.
248   AC_MSG_ERROR("standard math library not found")
249 fi
250
251
252 dnl Checks for typedefs, structures, and compiler characteristics.
253 dnl ==============================================================
254 AC_C_BIGENDIAN(,,,)
255 AC_C_LONG_DOUBLE
256
257 dnl Checks for library functions.
258 dnl =============================
259
260 dnl check for strerror
261
262 AC_CHECK_FUNC(strerror,,
263   AC_MSG_ERROR("need strerror function")
264 )
265
266
267 dnl Error messaging
268 dnl ===============
269
270
271 AC_OUTPUT($ac_output_file,[ touch stamp-h ])