1 dnl Process this file with autoconf to produce a configure script.
2 dnl Copyright (c) 2001 IPD, Universität Karlsruhe (TH)
10 AC_INIT(ir/ir/ircons.c)
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"
18 dnl generate the config header file
19 AC_CONFIG_HEADER(config.h)
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)
32 [ --enable-debug enable assertions and additional debugging routines],
33 [if test "$enableval" = yes; then
34 AC_DEFINE(DEBUG_libfirm)
38 AC_SUBST(enable_debug_libfirm)
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)
46 AC_SUBST(enable_gcc_inline)
51 AC_ARG_ENABLE(profile,
52 [ --enable-profile enable profiling],
53 [if test "$enableval"=yes; then
54 enable_profile_libfirm=yes
56 [enable_profile_libfirm=no])
57 AC_SUBST(enable_profile_libfirm)
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
66 [enable_auto_documentation=no])
67 AC_SUBST(enable_auto_documentation)
70 dnl Checks for programs.
71 dnl ====================
73 dnl check for a C compiler
74 dnl ----------------------
77 dnl check for prelinkable linker
78 dnl ----------------------------
80 if test "$libfirm_cv_prog_ld_r" != "yes"; then
81 AC_MSG_ERROR(need a prelinkcapable linker)
86 AC_CHECK_PROG(AR, ar, "ar", "")
87 if test "$AR" != "ar"; then
88 AC_MSG_ERROR(need ar for creating archives)
93 AC_CHECK_PROG(TAR, tar, "tar", "")
94 if test "$TAR" != "tar"; then
95 AC_MSG_ERROR(need tar for creating archives in distribution)
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
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))
117 dnl Checks for header files.
118 dnl ========================
122 dnl check for the math header file
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")
131 dnl check for the gnu multiprecission (gmp) header file
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")
140 dnl check for the obstack header file
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")
149 dnl Checks for libraries.
150 dnl =====================
152 dnl check for the gnu multiprecission (gmp) library
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")
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")
168 dnl Checks for typedefs, structures, and compiler characteristics.
169 dnl ==============================================================
172 dnl Checks for library functions.
173 dnl =============================
175 dnl check for strerror
177 AC_CHECK_FUNC(strerror,,
178 AC_MSG_ERROR("need strerror function")
186 AC_OUTPUT($ac_output_file,[ touch stamp-h ])