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