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
194
195
196
197
198
|
dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$Id: configure.in,v 1.24 2001/12/31 23:39:18 roland Exp $])
AC_PREREQ(2.12) dnl Minimum Autoconf version required.
AC_INIT(hurd/hurd_types.h) dnl A distinctive file to look for in srcdir.
AC_PREFIX_DEFAULT() dnl Default to empty prefix, not /usr/local.
AC_CANONICAL_HOST
case "$host_os" in
gnu*) ;;
none) AC_MSG_ERROR([
*** You must specify a host of $host_cpu-gnu or $host_cpu-$host_vendor-gnu
*** to configure; you will need to use the same host specification
*** to configure other packages for the GNU/Hurd system.]) ;;
*) AC_MSG_ERROR([this is the gnu os, host cannot be $host_os
*** Host configuration must be \`MACHINE-gnu' or \`MACHINE-VENDOR-gnu'.
*** To cross-compile, you must specify both --host and --build;
*** for example \`--build=$host --host=$host_cpu-gnu'.
*** Run $0 --help for more information.]) ;;
esac
case "$host_cpu" in
i?86)
asm_syntax=i386
;;
powerpc)
asm_syntax=ppc
;;
*)
asm_syntax="$host_cpu"
;;
esac
AC_SUBST(asm_syntax)
test -r "$srcdir/libthreads/$asm_syntax/cthreads.h" || {
AC_MSG_WARN([unsupported CPU type $host_cpu])
}
AC_ARG_ENABLE(profile,
[ --disable-profile do not build profiled libraries and programs])
AC_SUBST(enable_profile)
define([default_static],['ext2fs,ufs'])dnl
AC_ARG_ENABLE(static-progs,
[ --enable-static-progs=PROGRAMS...
build statically-linked PROGRAM.static versions
of (only) the listed programs ]dnl
changequote(',')[default_static]changequote([,]))
case "$enable_static_progs" in
'no') enable_static_progs= ;; # we got --disable-static
'') enable_static_progs=default_static ;;
esac
# Convert comma/space-separated list into space-separated list.
enable_static_progs=`echo "$enable_static_progs" | sed 's/[[, ]][[, ]]*/ /g'`
AC_SUBST(enable_static_progs)
AC_PROG_INSTALL
AC_PROG_AWK
AC_CHECK_TOOL(CC, gcc)
# That check handles cross-compilation well, but AC_PROG_CC tests for GCC
# and sets default CFLAGS nicely for us, so do that too.
hurd_PROG_CC
# Require GCC.
if test x$GCC != xyes; then
AC_MSG_ERROR([this code uses GNU C extensions, you must compile with GCC])
fi
AC_CHECK_TOOL(LD, ld)
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib)
AC_CHECK_TOOL(MIG, mig)
dnl Let these propagate from the environment.
AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS)
# See if there's a separate libcrypt (many systems put crypt there).
AC_CHECK_LIB(crypt, crypt, LIBCRYPT=-lcrypt)
AC_SUBST(LIBCRYPT)
# See if mig groks `retcode'.
AC_CACHE_CHECK(whether $MIG supports the retcode keyword, hurd_cv_mig_retcode,
[cat > conftest.defs <<\EOF
#include <mach/std_types.defs>
#include <mach/mach_types.defs>
subsystem foobar 1000;
type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE
ctype: mach_port_t;
simpleroutine foobar_reply (
reply_port: reply_port_t;
err: kern_return_t, RetCode);
EOF
if AC_TRY_COMMAND([CC="${CC}" ${MIG-false} -n conftest.defs 1>&AC_FD_CC]); then
hurd_cv_mig_retcode=yes
else
hurd_cv_mig_retcode=no
fi
rm -f conftest*])
if test $hurd_cv_mig_retcode = no; then
dnl NoLong is a harmless syntactically equivalent flag.
AC_DEFINE(RetCode, NoLong)
fi
# See if --version-script is available.
AC_CACHE_CHECK(for ld --version-script, hurd_cv_ld_version_script_option, [dnl
cat > conftest.c <<\EOF
void foobar() {}
EOF
cat > conftest.map <<\EOF
VERS_1 {
global: sym;
};
VERS_2 {
global: sym;
} VERS_1;
EOF
if AC_TRY_COMMAND([eval $ac_compile 1>&AC_FD_CC]) &&
AC_TRY_COMMAND([${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
-nostartfiles -nostdlib
-Wl,--version-script,conftest.map
1>&AC_FD_CC]); then
hurd_cv_ld_version_script_option=yes
else
hurd_cv_ld_version_script_option=no
fi
rm -f conftest*])
# See if libc was built with --enable-libio.
AC_CACHE_CHECK([for libio],
hurd_cv_libio,
AC_TRY_COMPILE([#include <stdio.h>
#ifndef _STDIO_USES_IOSTREAM
# error No libio found.
#endif],,
hurd_cv_libio=yes,
hurd_cv_libio=no))
# The versions of the symbols in libthreads have to match those in
# libc.so. Since the symbols in a libc that includes libio will be
# versioned differently from the ones in a libc that uses stdio, this
# isn't easy to accomplish. Instead we leave things unversioned if
# libio isn't found.
if test $hurd_cv_libio = yes; then
VERSIONING=$hurd_cv_ld_version_script_option
else
VERSIONING=no
fi
AC_SUBST(VERSIONING)
# Check if libc contains getgrouplist().
AC_CHECK_FUNCS(getgrouplist)
AC_ARG_WITH(parted, dnl
[ --without-parted don't try to use GNU Parted libraries],
, with_parted=yes)
# Check if we have the necessary stuff to build against GNU Parted libraries.
parted=$with_parted
save_LIBS=
LIBS=
test $parted = no || {
AC_CHECK_HEADER(parted/parted.h,
[AC_DEFINE(HAVE_PARTED_PARTED_H)],
parted=no)
}
test $parted = no || {
AC_CHECK_LIB(uuid, uuid_generate, , parted=no)
}
test $parted = no || {
AC_CHECK_LIB(parted, ped_device_read, , parted=no)
}
PARTED_LIBS=$LIBS
LIBS=$save_LIBS
AC_SUBST(PARTED_LIBS)
if test -f ./$ac_unique_file; then
# Configuring in source directory; don't create any Makefiles.
makefiles=
else
# We are configuring in a separate build tree.
# Create a Makefile in the top-level build directory and
# one for each subdirectory Makefile in the source.
makefiles="Makeconf:build.mkcf.in \
`cd $srcdir; for file in Makefile */Makefile; do \
echo ${file}:build.mk.in; done`"
fi
AC_OUTPUT(config.make ${makefiles})
dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl compile-command: "autoconf"
dnl End:
|