3378d20e2cb649446e01db07ea748e8ae2866bf9
[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/.dummy 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
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
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
51 dnl Checks for programs.
52 dnl ====================
53
54 dnl check for a compiler
55
56 AC_PROG_CC
57
58 dnl check for prelinkable linker
59
60 LIBFIRM_PROG_LD_R
61 if test "$libfirm_cv_prog_ld_r" != "yes"; then
62   AC_MSG_ERROR(need a prelinkcapable linker)
63 fi
64
65 dnl check for ar
66
67 AC_CHECK_PROG(AR, ar, "ar", "")
68 if test "$AR" != "ar"; then
69   AC_MSG_ERROR(need ar for creating archives)
70 fi
71
72 dnl check wether ar can handle option -s
73 dnl if not then ranlib is needed
74 dnl for simpliticity we use ranlib every time
75
76 AC_PROG_RANLIB
77
78 AC_PROG_INSTALL
79
80 dnl Checks for header files.
81 dnl ========================
82
83 AC_HEADER_STDC
84
85 dnl check for the gnu multiprecission (gmp) header file
86
87 AC_CHECK_HEADERS(gmp.h, ac_gmp_headers="yes", ac_gmp_headers="no")
88 if test "$ac_gmp_headers" != yes; then
89   dnl gmp header not found.
90   AC_MSG_ERROR("GNU multiprecission gmp header file not found")
91 fi
92
93
94 dnl Checks for libraries.
95 dnl =====================
96
97 dnl check for the gnu multiprecission (gmp) library
98
99 AC_CHECK_LIB(gmp, main, ac_gmp_library="yes", ac_gmp_library="no")
100 if test "$ac_gmp_library" != yes; then
101   dnl gmp library not found.
102   echo $ac_gmp_library
103   AC_MSG_ERROR("GNU multiprecission gmp library not found")
104 fi
105
106
107 dnl Checks for typedefs, structures, and compiler characteristics.
108 dnl ==============================================================
109
110
111 dnl Checks for library functions.
112 dnl =============================
113
114
115 dnl Error messaging
116 dnl ===============
117
118
119 AC_OUTPUT($ac_output_file,[ touch stamp-h ])