Added support for jni generation
[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
41 AC_ARG_ENABLE(gcc_inline,
42 [  --enable-gcc_inline     enable gcc inline C-extension],
43 [if test "$enableval" = yes; then
44   AC_DEFINE(USE_GCC_INLINE)
45 fi])
46 AC_SUBST(enable_gcc_inline)
47
48
49 dnl set profiling
50 dnl -------------
51 AC_ARG_ENABLE(profile,
52 [  --enable-profile        enable profiling],
53 [if test "$enableval"=yes; then
54   enable_profile_libfirm=yes
55 fi],
56 [enable_profile_libfirm=no])
57 AC_SUBST(enable_profile_libfirm)
58
59 dnl set auto documentation
60 dnl ----------------------
61 AC_ARG_ENABLE(autodoc,
62 [  --enable-autodoc        enable auto documentation],
63 [if test "$enableval"=yes; then
64   enable_auto_documentation=yes
65 fi],
66 [enable_auto_documentation=no])
67 AC_SUBST(enable_auto_documentation)
68
69
70 dnl Checks for programs.
71 dnl ====================
72
73 dnl check for a C compiler
74 dnl ----------------------
75 AC_PROG_CC
76
77 dnl check for prelinkable linker
78 dnl ----------------------------
79 LIBFIRM_PROG_LD_R
80 if test "$libfirm_cv_prog_ld_r" != "yes"; then
81   AC_MSG_ERROR(need a prelinkcapable linker)
82 fi
83
84 dnl check for ar
85 dnl ------------
86 AC_CHECK_PROG(AR, ar, "ar", "")
87 if test "$AR" != "ar"; then
88   AC_MSG_ERROR(need ar for creating archives)
89 fi
90
91 dnl check for tar
92 dnl -------------
93 AC_CHECK_PROG(TAR, tar, "tar", "")
94 if test "$TAR" != "tar"; then
95   AC_MSG_ERROR(need tar for creating archives in distribution)
96 fi
97
98 dnl check wether ar can handle option -s
99 dnl if not then ranlib is needed
100 dnl for simpliticity we use ranlib every time
101
102 AC_PROG_RANLIB
103
104 AC_PROG_INSTALL
105
106 AC_PROG_LN_S
107
108 dnl check for robodoc if enabled
109 dnl ----------------------------
110 if test "$enable_auto_documentation" = yes; then
111   AC_CHECK_PROG(ROBODOC, robodoc, "robodoc", "")
112   if test "$ROBODOC" != "robodoc"; then
113     AC_MSG_ERROR(need robodoc for auto documentation (IPD: module add robodoc))
114   fi
115 fi
116
117 dnl Checks for header files.
118 dnl ========================
119
120 AC_HEADER_STDC
121
122 dnl check for the math header file
123
124 AC_CHECK_HEADERS(math.h, ac_math_headers="yes", ac_math_headers="no")
125 if test "$ac_math_headers" != yes; then
126   dnl math header not found.
127   AC_MSG_ERROR("math header file not found")
128 fi
129
130
131 dnl check for the gnu multiprecission (gmp) header file
132
133 AC_CHECK_HEADERS(gmp.h, ac_gmp_headers="yes", ac_gmp_headers="no")
134 if test "$ac_gmp_headers" != yes; then
135   dnl gmp header not found.
136   AC_MSG_ERROR("GNU multiprecission gmp header file not found")
137 fi
138
139
140 dnl check for the obstack header file
141
142 AC_CHECK_HEADERS(obstack.h, ac_obstack_headers="yes", ac_obstack_headers="no")
143 if test "$ac_obstack_headers" != yes; then
144   dnl obstack header not found.
145   AC_MSG_ERROR("obstack header file not found")
146 fi
147
148
149 dnl Checks for libraries.
150 dnl =====================
151
152 dnl check for the gnu multiprecission (gmp) library
153
154 AC_CHECK_LIB(gmp, main, ac_gmp_library="yes", ac_gmp_library="no")
155 if test "$ac_gmp_library" != yes; then
156   dnl gmp library not found.
157   AC_MSG_ERROR("GNU multiprecission gmp library not found")
158 fi
159
160
161 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
162 if test "$ac_m_library" != yes; then
163   dnl std math library not found.
164   AC_MSG_ERROR("standard math library not found")
165 fi
166
167
168 dnl Checks for typedefs, structures, and compiler characteristics.
169 dnl ==============================================================
170
171
172 dnl Checks for library functions.
173 dnl =============================
174
175 dnl check for strerror
176
177 AC_CHECK_FUNC(strerror,,
178   AC_MSG_ERROR("need strerror function")
179 )
180
181
182 dnl Error messaging
183 dnl ===============
184
185
186 AC_OUTPUT($ac_output_file,[ touch stamp-h ])