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