summaryrefslogtreecommitdiff
path: root/configure.ac
blob: df89a0cd54759094cae78f10c42a6bb3da20e549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# configure.ac - Configure script for the GNU Hurd.
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Marcus Brinkmann.
#
# This file is part of the GNU Hurd.
# 
# The GNU Hurd is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# The GNU Hurd is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.57)
AC_INIT(hurd, 0.0, marcus@gnu.org)
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([laden/laden.c])
AC_CONFIG_HEADER([config.h])
AC_GNU_SOURCE

maintainer_mode=${enable_maintainer_mode-no}

# Checks for programs.
AC_PROG_CC

# FIXME: We should support setting the CFLAGS by the user.  But
# -std=gnu99 and -O2 are required.
CFLAGS="-std=gnu99 -Wall -g -O3"
AM_PROG_AS
AC_PROG_RANLIB
AC_CHECK_TOOL([AR], [ar], :)
AC_CHECK_TOOL([NM], [nm], :)
AC_PATH_PROG([SED], [sed], :)
AC_PATH_PROG([SORT], [sort], :)

# Required for building the documentation
AC_PATH_PROG([LATEX], [latex], no)
if test "x$LATEX" = xno; then
  missing_progs="$missing_progs latex"
fi
AC_PATH_PROG([DVIPS], [dvips], no)
if test "x$DVIPS" = xno; then
  missing_progs="$missing_progs dvips"
fi
AC_PATH_PROG([PS2PDF], [ps2pdf], no)
if test "x$PS2PDF" = xno; then
  missing_progs="$missing_progs ps2pdf"
fi
AC_PATH_PROG([FIG2DEV], [fig2dev], no)
if test "x$FIG2DEV" = xno; then
  if test "x$maintainer_mode" = xyes; then
    missing_progs="missing_progs fig2dev"
  fi
fi

# Set up the host information.

AC_CANONICAL_HOST

# Checks for libraries.

AC_MSG_CHECKING([for static GNU C library])
static_libc=libc.a
case $host_os in
  gnu*)
    # On the GNU/Hurd, libc.a is a linker script, the real C library
    # can be found in libcrt.a instead.  But fall back on libc.a for
    # cheap cross-compilation.
    libcrta=`$CC -print-file-name=libcrt.a`
    if test "x$libcrta" != "xlibcrt.a"; then
      static_libc=libcrt.a
    fi
    ;;
esac
STATIC_GLIBC=`$CC -print-file-name=$static_libc`
if test "x$STATIC_GLIBC" = "x$static_libc"; then
  AC_MSG_RESULT([none])
  AC_MSG_ERROR([Could not find static version of the GNU C library])
else
  AC_MSG_RESULT([$STATIC_GLIBC])
fi
AC_SUBST(STATIC_GLIBC)


# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_VOLATILE

arch_ia32=false
arch_powerpc=false
case $host_cpu in
  alpha)
    arch=alpha
    arch_alpha=true
    ;;
  amd64)
    arch=amd64
    arch_alpha=true
    ;;
  i386 | i486 | i586 | i686)
    arch=ia32
    arch_ia32=true
    ;;
  ia64)
    arch=ia64
    arch_ia64=true
    ;;
  powerpc)
    arch=powerpc
    arch_powerpc=true
    ;;
  powerpc64)
    arch=powerpc64
    arch_powerpc64=true
    ;;
  *)
    AC_MSG_ERROR([unsupported architecture])
    ;;
esac
AM_CONDITIONAL([ARCH_ALPHA], $arch_alpha)
AM_CONDITIONAL([ARCH_AMD64], $arch_amd64)
AM_CONDITIONAL([ARCH_IA32], $arch_ia32)
AM_CONDITIONAL([ARCH_IA64], $arch_ia64)
AM_CONDITIONAL([ARCH_POWERPC], $arch_powerpc)
AM_CONDITIONAL([ARCH_POWERPC64], $arch_powerpc64)

# Configure components.
m4_include([laden/config.m4])
m4_include([wortel/config.m4])
m4_include([physmem/config.m4])

# Create links for header file.
m4_include([libl4/headers.m4])
m4_include([platform/headers.m4])
m4_include([hurd/headers.m4])
m4_include([libhurd-ihash/headers.m4])
m4_include([libhurd-btree/headers.m4])
m4_include([libhurd-slab/headers.m4])
m4_include([libhurd-cap/headers.m4])
m4_include([libhurd-cap-server/headers.m4])
m4_include([libhurd-mm/headers.m4])
m4_include([libpthread/headers.m4])
m4_include([wortel/headers.m4])

# Check for libc and components using it.

AC_ARG_WITH([libc],
[  --with-libc             compile with the GNU C library (see libc/README)])
AM_CONDITIONAL(WITH_LIBC, test x"${with_libc-no}" != xno)


if test "x$missing_progs" != "x"; then
  AC_MSG_ERROR([The following programs were not found:$missing_progs])
fi

# Checks for library functions.
AC_CONFIG_FILES([Makefile
		 libl4/ia32/Makefile libl4/powerpc/Makefile libl4/Makefile
		 platform/alpha/Makefile platform/amd64/Makefile
		 platform/ia32/Makefile platform/ia64/Makefile
		 platform/powerpc/Makefile platform/powerpc64/Makefile
		 platform/Makefile
		 libc-parts/Makefile
		 hurd/Makefile
		 libhurd-ihash/Makefile
		 libhurd-btree/Makefile
		 libhurd-slab/Makefile
		 libhurd-cap/Makefile
		 libhurd-cap-server/Makefile
		 libhurd-mm/Makefile
		 libpthread/Makefile
                 laden/Makefile
                 wortel/Makefile
                 physmem/Makefile
                 task/Makefile
                 deva/Makefile
		 libc/Makefile
                 ruth/Makefile
		 doc/Makefile])
AC_OUTPUT