I don't remember what I changed, should be checked in yesterday?
[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/tr/Makefile testprograms/Makefile"
16
17 dnl generate the config header file
18 AC_CONFIG_HEADER(config.h)
19
20 dnl keep track of the environment set by the user
21 libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS'}"
22 AC_SUBST(libfirm_conf_env)
23
24
25 dnl Package options
26 dnl ===============
27
28 dnl set debugging
29 dnl -------------
30 AC_ARG_ENABLE(debug,
31 [  --enable-debug          enable assertions and additional debugging routines],
32 [if test "$enableval" = yes; then
33   AC_DEFINE(DEBUG_libfirm)
34 else
35   AC_DEFINE(NDEBUG)
36 fi])
37 AC_SUBST(enable_debug_libfirm)
38
39
40 dnl set profiling
41 dnl -------------
42 AC_ARG_ENABLE(profile,
43 [  --enable-profile        enable profiling],
44 [if test "$enableval"=yes; then
45   enable_profile_libfirm=yes
46 fi],
47 [enable_profile_libfirm=no])
48 AC_SUBST(enable_profile_libfirm)
49
50 dnl set auto documentation
51 dnl ----------------------
52 AC_ARG_ENABLE(autodoc,
53 [  --enable-autodoc        enable auto documentation],
54 [if test "$enableval"=yes; then
55   enable_auto_documentation=yes
56 fi],
57 [enable_auto_documentation=no])
58 AC_SUBST(enable_auto_documentation)
59
60
61 dnl Checks for programs.
62 dnl ====================
63
64 dnl check for a C compiler
65 dnl ----------------------
66 AC_PROG_CC
67
68 dnl check for prelinkable linker
69 dnl ----------------------------
70 LIBFIRM_PROG_LD_R
71 if test "$libfirm_cv_prog_ld_r" != "yes"; then
72   AC_MSG_ERROR(need a prelinkcapable linker)
73 fi
74
75 dnl check for ar
76 dnl ------------
77 AC_CHECK_PROG(AR, ar, "ar", "")
78 if test "$AR" != "ar"; then
79   AC_MSG_ERROR(need ar for creating archives)
80 fi
81
82 dnl check for tar
83 dnl -------------
84 AC_CHECK_PROG(TAR, tar, "tar", "")
85 if test "$TAR" != "tar"; then
86   AC_MSG_ERROR(need tar for creating archives in distribution)
87 fi
88
89 dnl check wether ar can handle option -s
90 dnl if not then ranlib is needed
91 dnl for simpliticity we use ranlib every time
92
93 AC_PROG_RANLIB
94
95 AC_PROG_INSTALL
96
97 AC_PROG_LN_S
98
99 dnl check for robodoc if enabled
100 dnl ----------------------------
101 if test "$enable_auto_documentation" = yes; then
102   AC_CHECK_PROG(ROBODOC, robodoc, "robodoc", "")
103   if test "$ROBODOC" != "robodoc"; then
104     AC_MSG_ERROR(need robodoc for auto documentation (IPD: module add robodoc))
105   fi
106 fi
107
108 dnl Checks for header files.
109 dnl ========================
110
111 AC_HEADER_STDC
112
113 dnl check for the math header file
114
115 AC_CHECK_HEADERS(math.h, ac_math_headers="yes", ac_math_headers="no")
116 if test "$ac_math_headers" != yes; then
117   dnl math header not found.
118   AC_MSG_ERROR("math header file not found")
119 fi
120
121
122 dnl check for the gnu multiprecission (gmp) header file
123
124 AC_CHECK_HEADERS(gmp.h, ac_gmp_headers="yes", ac_gmp_headers="no")
125 if test "$ac_gmp_headers" != yes; then
126   dnl gmp header not found.
127   AC_MSG_ERROR("GNU multiprecission gmp header file not found")
128 fi
129
130
131 dnl check for the obstack header file
132
133 AC_CHECK_HEADERS(obstack.h, ac_obstack_headers="yes", ac_obstack_headers="no")
134 if test "$ac_obstack_headers" != yes; then
135   dnl obstack header not found.
136   AC_MSG_ERROR("obstack header file not found")
137 fi
138
139
140 dnl Checks for libraries.
141 dnl =====================
142
143 dnl check for the gnu multiprecission (gmp) library
144
145 AC_CHECK_LIB(gmp, main, ac_gmp_library="yes", ac_gmp_library="no")
146 if test "$ac_gmp_library" != yes; then
147   dnl gmp library not found.
148   AC_MSG_ERROR("GNU multiprecission gmp library not found")
149 fi
150
151
152 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
153 if test "$ac_m_library" != yes; then
154   dnl std math library not found.
155   AC_MSG_ERROR("standard math library not found")
156 fi
157
158
159 dnl Checks for typedefs, structures, and compiler characteristics.
160 dnl ==============================================================
161
162
163 dnl Checks for library functions.
164 dnl =============================
165
166 dnl check for strerror
167
168 AC_CHECK_FUNC(strerror,,
169   AC_MSG_ERROR("need strerror function")
170 )
171
172
173 dnl Error messaging
174 dnl ===============
175
176
177 AC_OUTPUT($ac_output_file,[ touch stamp-h ])