]>
Commit | Line | Data |
---|---|---|
76ed06b9 BC |
1 | # -*- autoconf -*- |
2 | ||
6a161fa9 | 3 | # Process this file with autoconf to produce a configure script. |
4 | ||
2f1a3acf | 5 | # Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. |
6a161fa9 | 6 | # |
7 | # This configure.ac is free software; the author | |
8 | # gives unlimited permission to copy and/or distribute it, | |
9 | # with or without modifications, as long as this notice is preserved. | |
10 | # | |
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
14 | # PARTICULAR PURPOSE. | |
15 | ||
b977bf01 | 16 | dnl This configure script is complicated, because GRUB needs to deal |
17 | dnl with three potentially different types: | |
18 | dnl | |
19 | dnl build -- the environment for building GRUB | |
20 | dnl host -- the environment for running utilities | |
21 | dnl target -- the environment for running GRUB | |
22 | dnl | |
23 | dnl In addition, GRUB needs to deal with a platform specification | |
24 | dnl which specifies the system running GRUB, such as firmware. | |
25 | dnl This is necessary because the target type in autoconf does not | |
26 | dnl describe such a system very well. | |
27 | dnl | |
28 | dnl The current strategy is to use variables with no prefix (such as | |
29 | dnl CC, CFLAGS, etc.) for the host type as well as the build type, | |
30 | dnl because GRUB does not need to use those variables for the build | |
31 | dnl type, so there is no conflict. Variables with the prefix "TARGET_" | |
32 | dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target | |
33 | dnl type. | |
34 | ||
5f91f701 | 35 | AC_INIT([GRUB],[2.00],[bug-grub@gnu.org]) |
6a161fa9 | 36 | |
15c69261 YB |
37 | AC_CONFIG_AUX_DIR([build-aux]) |
38 | ||
76ed06b9 BC |
39 | # We don't want -g -O2 by default in CFLAGS |
40 | : ${CFLAGS=""} | |
6a161fa9 | 41 | |
b977bf01 | 42 | # Checks for host and target systems. |
6a161fa9 | 43 | AC_CANONICAL_HOST |
b977bf01 | 44 | AC_CANONICAL_TARGET |
6a161fa9 | 45 | |
8c411768 BC |
46 | AM_INIT_AUTOMAKE() |
47 | AC_PREREQ(2.60) | |
6304d292 | 48 | AC_CONFIG_SRCDIR([include/grub/dl.h]) |
742f9232 | 49 | AC_CONFIG_HEADER([config-util.h]) |
e52db1f7 | 50 | |
1d543c3e | 51 | # Program name transformations |
52 | AC_ARG_PROGRAM | |
fd49ceb3 CW |
53 | grub_TRANSFORM([grub-bios-setup]) |
54 | grub_TRANSFORM([grub-editenv]) | |
55 | grub_TRANSFORM([grub-install]) | |
56 | grub_TRANSFORM([grub-mkconfig]) | |
57 | grub_TRANSFORM([grub-mkfont]) | |
58 | grub_TRANSFORM([grub-mkimage]) | |
67ab8353 | 59 | grub_TRANSFORM([grub-glue-efi]) |
fd49ceb3 CW |
60 | grub_TRANSFORM([grub-mklayout]) |
61 | grub_TRANSFORM([grub-mkpasswd-pbkdf2]) | |
62 | grub_TRANSFORM([grub-mkrelpath]) | |
63 | grub_TRANSFORM([grub-mkrescue]) | |
64 | grub_TRANSFORM([grub-probe]) | |
65 | grub_TRANSFORM([grub-reboot]) | |
66 | grub_TRANSFORM([grub-script-check]) | |
67 | grub_TRANSFORM([grub-set-default]) | |
fd49ceb3 | 68 | grub_TRANSFORM([grub-sparc64-setup]) |
a79b8a15 | 69 | grub_TRANSFORM([grub-render-label]) |
1d543c3e | 70 | |
90d1e879 RM |
71 | # Optimization flag. Allow user to override. |
72 | if test "x$TARGET_CFLAGS" = x; then | |
73 | TARGET_CFLAGS="$TARGET_CFLAGS -Os" | |
74 | fi | |
75 | ||
76ed06b9 BC |
76 | # Default HOST_CPPFLAGS |
77 | HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" | |
76ed06b9 | 78 | HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" |
76ed06b9 BC |
79 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" |
80 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_LIBDIR=\\\"\$(pkglibdir)\\\"" | |
81 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\"" | |
82 | ||
83 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W" | |
84 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" | |
85 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" | |
86 | ||
b977bf01 | 87 | case "$target_cpu" in |
02164e1b | 88 | i[[3456]]86) target_cpu=i386 ;; |
c7ef54aa | 89 | amd64) target_cpu=x86_64 ;; |
02164e1b | 90 | sparc) target_cpu=sparc64 ;; |
ade85305 | 91 | mipsel|mips64el) |
4959e111 | 92 | target_cpu=mipsel; |
c721825b | 93 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1"; |
4a1eefb6 | 94 | ;; |
ade85305 | 95 | mips|mips64) |
76ed06b9 | 96 | target_cpu=mips; |
c721825b | 97 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1"; |
4a1eefb6 | 98 | ;; |
6a161fa9 | 99 | esac |
100 | ||
05568c2e | 101 | # Specify the platform (such as firmware). |
102 | AC_ARG_WITH([platform], | |
103 | AS_HELP_STRING([--with-platform=PLATFORM], | |
83b984de | 104 | [select the host platform [[guessed]]])) |
05568c2e | 105 | |
106 | # Guess the platform if not specified. | |
107 | if test "x$with_platform" = x; then | |
b977bf01 | 108 | case "$target_cpu"-"$target_vendor" in |
05568c2e | 109 | i386-apple) platform=efi ;; |
110 | i386-*) platform=pc ;; | |
58393a2d | 111 | x86_64-apple) platform=efi ;; |
737feb35 | 112 | x86_64-*) platform=pc ;; |
05568c2e | 113 | powerpc-*) platform=ieee1275 ;; |
58393a2d | 114 | powerpc64-*) platform=ieee1275 ;; |
05568c2e | 115 | sparc64-*) platform=ieee1275 ;; |
4959e111 VS |
116 | mipsel-*) platform=loongson ;; |
117 | mips-*) platform=arc ;; | |
e68d3b24 | 118 | ia64-*) platform=efi ;; |
58393a2d | 119 | *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;; |
05568c2e | 120 | esac |
121 | else | |
122 | platform="$with_platform" | |
123 | fi | |
124 | ||
ec1dfd63 VS |
125 | case "$target_cpu"-"$platform" in |
126 | x86_64-efi) ;; | |
127 | x86_64-emu) ;; | |
128 | x86_64-*) target_cpu=i386 ;; | |
129 | powerpc64-ieee1275) target_cpu=powerpc ;; | |
130 | esac | |
20011694 | 131 | |
58393a2d | 132 | # Check if the platform is supported, make final adjustments. |
b977bf01 | 133 | case "$target_cpu"-"$platform" in |
05568c2e | 134 | i386-efi) ;; |
3f4ce737 | 135 | x86_64-efi) ;; |
05568c2e | 136 | i386-pc) ;; |
7210dca9 | 137 | i386-multiboot) ;; |
546f966a | 138 | i386-coreboot) ;; |
58393a2d | 139 | i386-linuxbios) platform=coreboot ;; |
3d04eab8 | 140 | i386-ieee1275) ;; |
8231fb77 | 141 | i386-qemu) ;; |
05568c2e | 142 | powerpc-ieee1275) ;; |
143 | sparc64-ieee1275) ;; | |
2c40cc78 | 144 | ia64-efi) ;; |
f440c33f | 145 | mips-qemu_mips) ;; |
3666d5f6 | 146 | mips-qemu-mips) platform=qemu_mips;; |
8906c3dd | 147 | mips-arc) ;; |
7f63a64f | 148 | mipsel-arc) ;; |
4959e111 VS |
149 | mipsel-qemu_mips) ;; |
150 | mipsel-qemu-mips) platform=qemu_mips;; | |
151 | mipsel-yeeloong) platform=loongson ;; | |
152 | mipsel-fuloong) platform=loongson ;; | |
153 | mipsel-loongson) ;; | |
f84b481b | 154 | *-emu) ;; |
58393a2d | 155 | *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; |
6a161fa9 | 156 | esac |
157 | ||
3f4ce737 | 158 | case "$target_cpu" in |
159 | i386 | powerpc) target_m32=1 ;; | |
160 | x86_64 | sparc64) target_m64=1 ;; | |
161 | esac | |
162 | ||
6e5a42fe | 163 | case "$host_os" in |
4825d790 | 164 | mingw32*) host_os=cygwin ;; |
6e5a42fe | 165 | esac |
166 | ||
9304eef1 | 167 | # This normalizes the names, and creates a new variable ("host_kernel") |
168 | # while at it, since the mapping is not always 1:1 (e.g. different OSes | |
169 | # using the same kernel type). | |
170 | case "$host_os" in | |
171 | gnu*) host_kernel=hurd ;; | |
172 | linux*) host_kernel=linux ;; | |
67937d4d | 173 | freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;; |
2c7031b1 | 174 | netbsd*) host_kernel=netbsd ;; |
958ee221 | 175 | solaris*) host_kernel=illumos ;; |
b105df76 | 176 | darwin*) host_kernel=xnu ;; |
9304eef1 | 177 | cygwin) host_kernel=windows ;; |
178 | esac | |
179 | ||
f84b481b | 180 | case "$platform" in |
c721825b BC |
181 | coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;; |
182 | multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;; | |
183 | efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;; | |
184 | ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;; | |
185 | qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;; | |
186 | pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;; | |
187 | emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;; | |
54da1feb | 188 | loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;; |
3666d5f6 VS |
189 | qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;; |
190 | arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;; | |
f84b481b | 191 | esac |
6bea3f89 | 192 | case "$target_cpu" in |
4959e111 | 193 | mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;; |
c721825b | 194 | sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;; |
6bea3f89 | 195 | esac |
4959e111 VS |
196 | if test x${target_cpu} = xmipsel ; then |
197 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" | |
198 | else | |
3ec0fc1c | 199 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,` -DGRUB_TARGET_CPU_`echo ${target_cpu} | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`=1" |
4959e111 | 200 | fi |
6bea3f89 | 201 | |
7f63a64f VS |
202 | case "${target_cpu}-$platform" in |
203 | mips-arc) | |
204 | TARGET_LINK_ADDR=0x88200000 | |
205 | TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000 | |
206 | ;; | |
207 | mipsel-arc) | |
208 | TARGET_LINK_ADDR=0x80700000 | |
209 | TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000 | |
210 | ;; | |
5fe67f39 | 211 | mips*-qemu_mips | mips*-loongson) |
7f63a64f VS |
212 | TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000 |
213 | ;; | |
214 | esac | |
215 | ||
216 | AC_SUBST(TARGET_LINK_ADDR) | |
217 | AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR) | |
218 | ||
c721825b | 219 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS" |
f84b481b | 220 | |
56978920 | 221 | AC_SUBST(host_cpu) |
222 | AC_SUBST(host_os) | |
9304eef1 | 223 | AC_SUBST(host_kernel) |
6e5a42fe | 224 | |
071114bb VS |
225 | AC_SUBST(target_cpu) |
226 | AC_SUBST(platform) | |
227 | ||
d87aedff | 228 | # Define default variables |
7134247c VS |
229 | |
230 | have_with_bootdir=n | |
231 | AC_ARG_WITH([bootdir], | |
232 | AS_HELP_STRING([--with-bootdir=DIR], | |
233 | [set the name of /boot directory [[guessed]]]), | |
234 | [have_with_bootdir=y], | |
235 | [have_with_bootdir=n]) | |
236 | if test x$have_with_bootdir = xy; then | |
237 | bootdirname="$with_bootdir" | |
238 | else | |
239 | case "$host_os" in | |
240 | netbsd* | openbsd*) | |
d87aedff | 241 | # Because /boot is used for the boot block in NetBSD and OpenBSD, |
7134247c VS |
242 | bootdirname='' ;; |
243 | *) bootdirname='boot' ;; | |
244 | esac | |
245 | fi | |
246 | ||
d87aedff | 247 | AC_SUBST(bootdirname) |
a4c1d277 YB |
248 | AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname", |
249 | [Default boot directory name]") | |
d87aedff | 250 | |
7134247c VS |
251 | AC_ARG_WITH([grubdir], |
252 | AS_HELP_STRING([--with-grubdir=DIR], | |
253 | [set the name of grub directory [[guessed]]]), | |
254 | [grubdirname="$with_grubdir"], | |
255 | [grubdirname="$PACKAGE"]) | |
256 | ||
d87aedff | 257 | AC_SUBST(grubdirname) |
a4c1d277 YB |
258 | AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname", |
259 | [Default grub directory name]) | |
d87aedff | 260 | |
b977bf01 | 261 | # |
262 | # Checks for build programs. | |
263 | # | |
144f1f98 | 264 | |
6c826348 | 265 | # Although cmp is listed in the GNU Coding Standards as a command which |
266 | # can used directly, OpenBSD lacks cmp in the default installation. | |
267 | AC_CHECK_PROGS([CMP], [cmp]) | |
268 | if test "x$CMP" = x; then | |
269 | AC_MSG_ERROR([cmp is not found]) | |
270 | fi | |
271 | ||
144f1f98 | 272 | AC_CHECK_PROGS([YACC], [bison]) |
1569ec51 | 273 | if test "x$YACC" = x; then |
6c826348 | 274 | AC_MSG_ERROR([bison is not found]) |
1569ec51 | 275 | fi |
276 | ||
4d88b9ae VS |
277 | FONT_SOURCE= |
278 | ||
f4d095d7 | 279 | for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do |
8e832f71 | 280 | for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni; do |
f4d095d7 | 281 | if test -f "$dir/unifont.$ext"; then |
8e50ec9f | 282 | FONT_SOURCE="$dir/unifont.$ext" |
f4d095d7 GS |
283 | break 2 |
284 | fi | |
285 | done | |
4931827f | 286 | done |
287 | ||
64e3f8f6 | 288 | if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips); then |
54da1feb | 289 | AC_MSG_ERROR([qemu and loongson ports need unifont]) |
4d88b9ae VS |
290 | fi |
291 | ||
76ed06b9 | 292 | AC_SUBST([FONT_SOURCE]) |
8e50ec9f | 293 | |
76ed06b9 | 294 | AC_PROG_RANLIB |
b977bf01 | 295 | AC_PROG_INSTALL |
296 | AC_PROG_AWK | |
09220190 | 297 | AC_PROG_LEX |
76ed06b9 | 298 | AC_PROG_YACC |
b977bf01 | 299 | AC_PROG_MAKE_SET |
ff420223 | 300 | AC_PROG_MKDIR_P |
e1fd1939 | 301 | AC_PROG_LN_S |
b977bf01 | 302 | |
c7c75cf4 | 303 | if test "x$LEX" = "x:"; then |
09220190 BC |
304 | AC_MSG_ERROR([flex is not found]) |
305 | else | |
2663fb5f | 306 | version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'` |
b777c18e | 307 | if test -n "$version" -a "$version" -ge 20535; then |
09220190 BC |
308 | : |
309 | else | |
310 | AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above]) | |
311 | fi | |
312 | fi | |
313 | ||
68807e5f | 314 | # These are not a "must". |
51fa856c | 315 | AC_PATH_PROGS(MAKEINFO, makeinfo true) |
6a161fa9 | 316 | |
b977bf01 | 317 | # |
318 | # Checks for host programs. | |
319 | # | |
320 | ||
321 | AC_PROG_CC | |
15c69261 | 322 | gl_EARLY |
76ed06b9 BC |
323 | AM_PROG_CC_C_O |
324 | AM_PROG_AS | |
325 | ||
6a161fa9 | 326 | # Must be GCC. |
327 | test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required]) | |
328 | ||
4889bdec | 329 | AC_GNU_SOURCE |
2f1a3acf | 330 | AM_GNU_GETTEXT([external]) |
b977bf01 | 331 | AC_SYS_LARGEFILE |
332 | ||
333 | # Identify characteristics of the host architecture. | |
334 | AC_C_BIGENDIAN | |
335 | AC_CHECK_SIZEOF(void *) | |
336 | AC_CHECK_SIZEOF(long) | |
337 | ||
2b167a72 | 338 | grub_apple_cc |
c9da87d0 | 339 | if test x$grub_cv_apple_cc = xyes ; then |
6fd0b143 VS |
340 | HOST_CPPFLAGS="$HOST_CPPFLAGS -fnested-functions" |
341 | HOST_LDFLAGS="$HOST_LDFLAGS -Wl,-allow_stack_execute" | |
2b167a72 | 342 | fi |
b977bf01 | 343 | |
aad32b14 VS |
344 | if test x$USE_NLS = xno; then |
345 | HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext" | |
346 | fi | |
347 | ||
86695375 | 348 | if test "x$cross_compiling" = xyes; then |
349 | AC_MSG_WARN([cannot generate manual pages while cross compiling]) | |
350 | else | |
351 | AC_PATH_PROG(HELP2MAN, help2man) | |
352 | fi | |
353 | ||
3169f4c7 | 354 | # Check for functions and headers. |
c38fe9f4 | 355 | AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent) |
e4c498a1 | 356 | AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h) |
7c4e16ff | 357 | |
fb90b546 RM |
358 | AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default |
359 | #include <sys/param.h> | |
360 | #include <sys/mount.h>]) | |
361 | ||
362 | AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default | |
363 | #include <sys/param.h> | |
364 | #include <sys/mount.h>]) | |
365 | ||
2c7031b1 GS |
366 | # For opendisk() and getrawpartition() on NetBSD. |
367 | # Used in util/deviceiter.c and in util/hostdisk.c. | |
368 | AC_CHECK_HEADER([util.h], [ | |
369 | AC_CHECK_LIB([util], [opendisk], [ | |
370 | LIBUTIL="-lutil" | |
371 | AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used]) | |
372 | ]) | |
373 | AC_CHECK_LIB([util], [getrawpartition], [ | |
374 | LIBUTIL="-lutil" | |
375 | AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used]) | |
376 | ]) | |
377 | ]) | |
378 | AC_SUBST([LIBUTIL]) | |
379 | ||
19ce697d | 380 | AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [ |
00c05e22 | 381 | SAVED_CFLAGS="$CFLAGS" |
00c05e22 VS |
382 | CFLAGS="$HOST_CFLAGS -Wtrampolines" |
383 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> | |
384 | int va_arg_func (int fixed, va_list args);]], [[]])], | |
19ce697d VS |
385 | [grub_cv_host_cc_wtrampolines=yes], |
386 | [grub_cv_host_cc_wtrampolines=no]) | |
00c05e22 VS |
387 | CFLAGS="$SAVED_CFLAGS" |
388 | ]) | |
389 | ||
19ce697d VS |
390 | if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then |
391 | HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines" | |
00c05e22 VS |
392 | fi |
393 | ||
76ed06b9 BC |
394 | # |
395 | # Check for host and build compilers. | |
396 | # | |
397 | HOST_CC=$CC | |
398 | AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc], | |
399 | [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])]) | |
400 | ||
15c69261 YB |
401 | # For gnulib. |
402 | gl_INIT | |
403 | ||
b977bf01 | 404 | # |
405 | # Check for target programs. | |
406 | # | |
407 | ||
5b5d4aa5 | 408 | # Find tools for the target. |
409 | if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then | |
b977bf01 | 410 | tmp_ac_tool_prefix="$ac_tool_prefix" |
411 | ac_tool_prefix=$target_alias- | |
412 | ||
413 | AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc], | |
414 | [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])]) | |
415 | AC_CHECK_TOOL(OBJCOPY, objcopy) | |
416 | AC_CHECK_TOOL(STRIP, strip) | |
417 | AC_CHECK_TOOL(NM, nm) | |
418 | ||
419 | ac_tool_prefix="$tmp_ac_tool_prefix" | |
420 | else | |
421 | if test "x$TARGET_CC" = x; then | |
422 | TARGET_CC=$CC | |
423 | fi | |
424 | AC_CHECK_TOOL(OBJCOPY, objcopy) | |
425 | AC_CHECK_TOOL(STRIP, strip) | |
426 | AC_CHECK_TOOL(NM, nm) | |
427 | fi | |
76ed06b9 BC |
428 | AC_SUBST(HOST_CC) |
429 | AC_SUBST(BUILD_CC) | |
b977bf01 | 430 | AC_SUBST(TARGET_CC) |
431 | ||
b977bf01 | 432 | # Test the C compiler for the target environment. |
433 | tmp_CC="$CC" | |
434 | tmp_CFLAGS="$CFLAGS" | |
435 | tmp_LDFLAGS="$LDFLAGS" | |
436 | tmp_CPPFLAGS="$CPPFLAGS" | |
aa6d7826 | 437 | tmp_LIBS="$LIBS" |
b977bf01 | 438 | CC="$TARGET_CC" |
439 | CFLAGS="$TARGET_CFLAGS" | |
440 | CPPFLAGS="$TARGET_CPPFLAGS" | |
441 | LDFLAGS="$TARGET_LDFLAGS" | |
aa6d7826 | 442 | LIBS="" |
b977bf01 | 443 | |
90d1e879 | 444 | # debug flags. |
c2deb798 | 445 | WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign" |
ebcecdf1 | 446 | HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS" |
4e27343f | 447 | TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations" |
76ed06b9 | 448 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g" |
6a161fa9 | 449 | |
90d1e879 RM |
450 | # Force no alignment to save space on i386. |
451 | if test "x$target_cpu" = xi386; then | |
452 | AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ | |
453 | CFLAGS="$CFLAGS -falign-loops=1" | |
eb73121d | 454 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
90d1e879 RM |
455 | [grub_cv_cc_falign_loop=yes], |
456 | [grub_cv_cc_falign_loop=no]) | |
6a161fa9 | 457 | ]) |
6a161fa9 | 458 | |
90d1e879 RM |
459 | if test "x$grub_cv_cc_falign_loop" = xyes; then |
460 | TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" | |
6a161fa9 | 461 | else |
90d1e879 | 462 | TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" |
6a161fa9 | 463 | fi |
464 | ||
90d1e879 RM |
465 | # Some toolchains enable these features by default, but they need |
466 | # registers that aren't set up properly in GRUB. | |
467 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow" | |
468 | fi | |
77c55a87 | 469 | |
90d1e879 RM |
470 | # By default, GCC 4.4 generates .eh_frame sections containing unwind |
471 | # information in some cases where it previously did not. GRUB doesn't need | |
472 | # these and they just use up vital space. Restore the old compiler | |
473 | # behaviour. | |
474 | AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [ | |
475 | SAVE_CFLAGS="$CFLAGS" | |
476 | CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm" | |
477 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
478 | [grub_cv_cc_fno_dwarf2_cfi_asm=yes], | |
479 | [grub_cv_cc_fno_dwarf2_cfi_asm=no]) | |
480 | CFLAGS="$SAVE_CFLAGS" | |
481 | ]) | |
77c55a87 | 482 | |
90d1e879 RM |
483 | if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then |
484 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" | |
b977bf01 | 485 | fi |
6a161fa9 | 486 | |
e9d3421c VS |
487 | # By default, GCC 4.6 generates .eh_frame sections containing unwind |
488 | # information in some cases where it previously did not. GRUB doesn't need | |
489 | # these and they just use up vital space. Restore the old compiler | |
490 | # behaviour. | |
491 | AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [ | |
492 | SAVE_CFLAGS="$CFLAGS" | |
493 | CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm" | |
494 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
495 | [grub_cv_cc_fno_asynchronous_unwind_tables=yes], | |
496 | [grub_cv_cc_fno_asynchronous_unwind_tables=no]) | |
497 | CFLAGS="$SAVE_CFLAGS" | |
498 | ]) | |
499 | ||
500 | if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then | |
501 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" | |
502 | fi | |
503 | ||
2b167a72 | 504 | grub_apple_target_cc |
c9da87d0 | 505 | if test x$grub_cv_apple_target_cc = xyes ; then |
403e25a5 | 506 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -fnested-functions" |
76ed06b9 | 507 | |
6fd0b143 | 508 | CFLAGS="$CFLAGS -fnested-functions" |
2b167a72 | 509 | TARGET_APPLE_CC=1 |
cf00df31 | 510 | AC_CHECK_PROG([OBJCONV], [objconv], [objconv], []) |
511 | if test "x$OBJCONV" = x ; then | |
512 | AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.]) | |
513 | fi | |
514 | if test "x$OBJCONV" = x ; then | |
515 | AC_MSG_ERROR([objconv not found which is required when building with apple compiler]) | |
516 | fi | |
2b167a72 | 517 | TARGET_IMG_LDSCRIPT= |
518 | TARGET_IMG_CFLAGS="-static" | |
76ed06b9 BC |
519 | TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20' |
520 | TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20' | |
521 | TARGET_IMG_BASE_LDOPT="-Wl,-image_base" | |
46cf439c | 522 | TARGET_LDFLAGS_OLDMAGIC="" |
2b167a72 | 523 | else |
524 | TARGET_APPLE_CC=0 | |
f04a9a21 | 525 | TARGET_LDFLAGS_OLDMAGIC="-Wl,-N" |
2b167a72 | 526 | # Use linker script if present, otherwise use builtin -N script. |
76ed06b9 BC |
527 | if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then |
528 | TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" | |
529 | TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" | |
530 | TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" | |
531 | TARGET_IMG_BASE_LDOPT="-Wl,-Ttext" | |
2b167a72 | 532 | else |
533 | TARGET_IMG_LDSCRIPT= | |
76ed06b9 BC |
534 | TARGET_IMG_LDFLAGS='-Wl,-N' |
535 | TARGET_IMG_LDFLAGS_AC='-Wl,-N' | |
536 | TARGET_IMG_BASE_LDOPT="-Wl,-Ttext" | |
2b167a72 | 537 | fi |
538 | TARGET_IMG_CFLAGS= | |
539 | fi | |
540 | ||
46cf439c VS |
541 | AC_SUBST(TARGET_LDFLAGS_OLDMAGIC) |
542 | ||
2b167a72 | 543 | # For platforms where ELF is not the default link format. |
544 | AC_MSG_CHECKING([for command to convert module to ELF format]) | |
545 | case "${host_os}" in | |
f1632d4d | 546 | cygwin) TARGET_OBJ2ELF='$(top_builddir)/grub-pe2elf'; |
4b0cd8f8 | 547 | # FIXME: put proper test here |
742f9232 | 548 | NEED_REGISTER_FRAME_INFO=1 |
4b0cd8f8 | 549 | ;; |
742f9232 | 550 | *) NEED_REGISTER_FRAME_INFO=0 ;; |
2b167a72 | 551 | esac |
2b167a72 | 552 | AC_MSG_RESULT([$TARGET_OBJ2ELF]) |
553 | ||
30c7d3ce VS |
554 | |
555 | AC_ARG_ENABLE([efiemu], | |
556 | [AS_HELP_STRING([--enable-efiemu], | |
557 | [build and install the efiemu runtimes (default=guessed)])]) | |
558 | if test x"$enable_efiemu" = xno ; then | |
559 | efiemu_excuse="explicitly disabled" | |
560 | fi | |
561 | if test x"$target_cpu" != xi386 ; then | |
562 | efiemu_excuse="only available on i386" | |
563 | fi | |
564 | if test x"$platform" = xefi ; then | |
565 | efiemu_excuse="not available on efi" | |
566 | fi | |
567 | if test x"$efiemu_excuse" = x ; then | |
568 | AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ | |
dfc8aeb0 | 569 | SAVED_CFLAGS="$CFLAGS" |
30c7d3ce VS |
570 | CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib" |
571 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
572 | [grub_cv_cc_efiemu=yes], | |
573 | [grub_cv_cc_efiemu=no]) | |
dfc8aeb0 | 574 | CFLAGS="$SAVED_CFLAGS" |
30c7d3ce VS |
575 | ]) |
576 | if test x$grub_cv_cc_efiemu = xno; then | |
577 | efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" | |
578 | fi | |
579 | fi | |
580 | if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then | |
581 | AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled]) | |
582 | fi | |
583 | if test x"$efiemu_excuse" = x ; then | |
584 | enable_efiemu=yes | |
585 | else | |
586 | enable_efiemu=no | |
587 | fi | |
588 | AC_SUBST([enable_efiemu]) | |
589 | ||
b977bf01 | 590 | if test "x$target_m32" = x1; then |
591 | # Force 32-bit mode. | |
592 | TARGET_CFLAGS="$TARGET_CFLAGS -m32" | |
76ed06b9 | 593 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32" |
19e81ba7 | 594 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32" |
b977bf01 | 595 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" |
2b167a72 | 596 | TARGET_MODULE_FORMAT="elf32" |
6a161fa9 | 597 | fi |
b977bf01 | 598 | |
20011694 | 599 | if test "x$target_m64" = x1; then |
600 | # Force 64-bit mode. | |
7e9ca17a | 601 | TARGET_CFLAGS="$TARGET_CFLAGS -m64" |
76ed06b9 | 602 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64" |
19e81ba7 | 603 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64" |
7e9ca17a | 604 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" |
2b167a72 | 605 | TARGET_MODULE_FORMAT="elf64" |
7e9ca17a | 606 | fi |
607 | ||
46546fc5 | 608 | if test "$target_cpu" = x86_64; then |
7e9ca17a | 609 | # Use large model to support 4G memory |
6e09b8b7 | 610 | AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ |
c8600122 | 611 | SAVED_CFLAGS=$CFLAGS |
612 | CFLAGS="$CFLAGS -m64 -mcmodel=large" | |
6e09b8b7 | 613 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
614 | [grub_cv_cc_mcmodel=yes], | |
615 | [grub_cv_cc_mcmodel=no]) | |
616 | ]) | |
c8600122 | 617 | if test "x$grub_cv_cc_mcmodel" = xno; then |
4ba8d354 | 618 | AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.]) |
c8600122 | 619 | else |
620 | TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" | |
6e09b8b7 | 621 | fi |
46546fc5 | 622 | fi |
7e9ca17a | 623 | |
46546fc5 | 624 | if test "$target_cpu"-"$platform" = x86_64-efi; then |
7e9ca17a | 625 | # EFI writes to stack below %rsp, we must not use the red zone |
626 | AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ | |
c8600122 | 627 | CFLAGS="$CFLAGS -m64 -mno-red-zone" |
7e9ca17a | 628 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
629 | [grub_cv_cc_no_red_zone=yes], | |
630 | [grub_cv_cc_no_red_zone=no]) | |
631 | ]) | |
632 | if test "x$grub_cv_cc_no_red_zone" = xno; then | |
633 | AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc]) | |
634 | fi | |
635 | ||
c8600122 | 636 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone" |
20011694 | 637 | fi |
638 | ||
baa2a121 | 639 | # |
640 | # Compiler features. | |
641 | # | |
642 | ||
93a81088 | 643 | # Position independent executable. |
644 | grub_CHECK_PIE | |
645 | [# Need that, because some distributions ship compilers that include | |
646 | # `-fPIE' in the default specs. | |
647 | if [ x"$pie_possible" = xyes ]; then | |
648 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE" | |
649 | fi] | |
650 | ||
7bd8b0c7 VS |
651 | # Position independent executable. |
652 | grub_CHECK_PIC | |
653 | [# Need that, because some distributions ship compilers that include | |
654 | # `-fPIC' in the default specs. | |
655 | if [ x"$pic_possible" = xyes ]; then | |
656 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC" | |
657 | fi] | |
658 | ||
baa2a121 | 659 | # Smashing stack protector. |
660 | grub_CHECK_STACK_PROTECTOR | |
c3db8364 | 661 | # Need that, because some distributions ship compilers that include |
baa2a121 | 662 | # `-fstack-protector' in the default specs. |
c3db8364 | 663 | if test "x$ssp_possible" = xyes; then |
664 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" | |
665 | fi | |
2a8a80e4 | 666 | grub_CHECK_STACK_ARG_PROBE |
667 | # Cygwin's GCC uses alloca() to probe the stackframe on static | |
668 | # stack allocations above some threshold. | |
669 | if test x"$sap_possible" = xyes; then | |
670 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" | |
671 | fi | |
baa2a121 | 672 | |
63f745e8 | 673 | AC_ARG_ENABLE([werror], |
674 | [AS_HELP_STRING([--disable-werror], | |
675 | [do not use -Werror when building GRUB])]) | |
676 | if test x"$enable_werror" != xno ; then | |
677 | TARGET_CFLAGS="$TARGET_CFLAGS -Werror" | |
ebcecdf1 | 678 | HOST_CFLAGS="$HOST_CFLAGS -Werror" |
63f745e8 | 679 | fi |
680 | ||
76ed06b9 BC |
681 | TARGET_CPP="$TARGET_CC -E" |
682 | TARGET_CCAS=$TARGET_CC | |
683 | ||
92cd0f6e VS |
684 | GRUB_TARGET_CPU="${target_cpu}" |
685 | GRUB_PLATFORM="${platform}" | |
686 | ||
687 | AC_SUBST(GRUB_TARGET_CPU) | |
688 | AC_SUBST(GRUB_PLATFORM) | |
689 | ||
cf00df31 | 690 | AC_SUBST(OBJCONV) |
76ed06b9 BC |
691 | AC_SUBST(TARGET_CPP) |
692 | AC_SUBST(TARGET_CCAS) | |
693 | AC_SUBST(TARGET_OBJ2ELF) | |
2b167a72 | 694 | AC_SUBST(TARGET_APPLE_CC) |
76ed06b9 BC |
695 | AC_SUBST(TARGET_MODULE_FORMAT) |
696 | ||
697 | AC_SUBST(TARGET_CFLAGS) | |
b977bf01 | 698 | AC_SUBST(TARGET_LDFLAGS) |
76ed06b9 BC |
699 | AC_SUBST(TARGET_CPPFLAGS) |
700 | AC_SUBST(TARGET_CCASFLAGS) | |
701 | ||
702 | AC_SUBST(TARGET_IMG_LDSCRIPT) | |
703 | AC_SUBST(TARGET_IMG_LDFLAGS) | |
704 | AC_SUBST(TARGET_IMG_CFLAGS) | |
705 | AC_SUBST(TARGET_IMG_BASE_LDOPT) | |
706 | ||
707 | AC_SUBST(HOST_CFLAGS) | |
708 | AC_SUBST(HOST_LDFLAGS) | |
709 | AC_SUBST(HOST_CPPFLAGS) | |
710 | AC_SUBST(HOST_CCASFLAGS) | |
6a161fa9 | 711 | |
aa6d7826 | 712 | # Set them to their new values for the tests below. |
713 | CC="$TARGET_CC" | |
26de2bcd | 714 | if test "x$TARGET_APPLE_CC" = x1 ; then |
69be5b74 | 715 | CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error" |
26de2bcd | 716 | else |
01fcf061 | 717 | CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error" |
26de2bcd | 718 | fi |
aa6d7826 | 719 | CPPFLAGS="$TARGET_CPPFLAGS" |
03f80960 VS |
720 | if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 ; then |
721 | LIBS= | |
722 | else | |
69be5b74 | 723 | LIBS=-lgcc |
03f80960 | 724 | fi |
69be5b74 | 725 | |
01fcf061 VS |
726 | grub_ASM_USCORE |
727 | if test x$grub_cv_asm_uscore = xyes; then | |
728 | CFLAGS="$CFLAGS -Wl,--defsym,_abort=_main" | |
729 | else | |
730 | CFLAGS="$CFLAGS -Wl,--defsym,abort=main" | |
731 | fi | |
732 | ||
69be5b74 | 733 | # Check for libgcc symbols |
19ce697d | 734 | AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2) |
69be5b74 VS |
735 | |
736 | if test "x$TARGET_APPLE_CC" = x1 ; then | |
737 | CFLAGS="$TARGET_CFLAGS -nostdlib" | |
738 | else | |
739 | CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100" | |
740 | fi | |
42e0cba3 | 741 | LIBS="" |
aa6d7826 | 742 | |
6a161fa9 | 743 | # Defined in aclocal.m4. |
f6130a12 | 744 | grub_PROG_TARGET_CC |
2b167a72 | 745 | if test "x$TARGET_APPLE_CC" != x1 ; then |
b977bf01 | 746 | grub_PROG_OBJCOPY_ABSOLUTE |
2b167a72 | 747 | fi |
cb71ba20 | 748 | grub_PROG_LD_BUILD_ID_NONE |
b977bf01 | 749 | if test "x$target_cpu" = xi386; then |
2aec1692 CF |
750 | if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then |
751 | if test ! -z "$TARGET_IMG_LDSCRIPT"; then | |
752 | # Check symbols provided by linker script. | |
76ed06b9 | 753 | CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100" |
2aec1692 | 754 | fi |
2a8a80e4 | 755 | grub_CHECK_BSS_START_SYMBOL |
756 | grub_CHECK_END_SYMBOL | |
757 | fi | |
758 | CFLAGS="$TARGET_CFLAGS" | |
4b13b216 | 759 | grub_I386_ASM_PREFIX_REQUIREMENT |
760 | grub_I386_ASM_ADDR32 | |
6a161fa9 | 761 | fi |
762 | ||
016a671b | 763 | if test "$platform" != emu; then |
8f9a632b VS |
764 | AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [ |
765 | SAVED_CPPFLAGS="$CPPFLAGS" | |
766 | CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" | |
767 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> | |
ce938140 | 768 | #include <stddef.h> |
8f9a632b VS |
769 | int va_arg_func (int fixed, va_list args);]], [[]])], |
770 | [grub_cv_cc_isystem=yes], | |
771 | [grub_cv_cc_isystem=no]) | |
772 | CPPFLAGS="$SAVED_CPPFLAGS" | |
773 | ]) | |
774 | ||
775 | if test x"$grub_cv_cc_isystem" = xyes ; then | |
776 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" | |
777 | fi | |
dae79b6b | 778 | fi |
5ce5507f | 779 | |
19ce697d | 780 | AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [ |
779dc15b | 781 | SAVED_CFLAGS="$CFLAGS" |
72b7c7aa | 782 | CFLAGS="$TARGET_CFLAGS -Wtrampolines" |
779dc15b VS |
783 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> |
784 | int va_arg_func (int fixed, va_list args);]], [[]])], | |
19ce697d VS |
785 | [grub_cv_cc_wtrampolines=yes], |
786 | [grub_cv_cc_wtrampolines=no]) | |
779dc15b VS |
787 | CFLAGS="$SAVED_CFLAGS" |
788 | ]) | |
789 | ||
19ce697d VS |
790 | if test x"$grub_cv_cc_wtrampolines" = xyes ; then |
791 | TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines" | |
779dc15b VS |
792 | fi |
793 | ||
c9a86192 | 794 | # Restore the flags. |
9962ed99 | 795 | CC="$tmp_CC" |
796 | CFLAGS="$tmp_CFLAGS" | |
797 | CPPFLAGS="$tmp_CPPFLAGS" | |
c9a86192 | 798 | LDFLAGS="$tmp_LDFLAGS" |
aa6d7826 | 799 | LIBS="$tmp_LIBS" |
6a161fa9 | 800 | |
4fe9862e | 801 | # |
2965c7cc | 802 | # Check for options. |
4fe9862e | 803 | # |
804 | ||
805 | # Memory manager debugging. | |
b39f9d20 | 806 | AC_ARG_ENABLE([mm-debug], |
2965c7cc | 807 | AS_HELP_STRING([--enable-mm-debug], |
90ce5d56 | 808 | [include memory manager debugging]), |
2965c7cc | 809 | [AC_DEFINE([MM_DEBUG], [1], |
810 | [Define to 1 if you enable memory manager debugging.])]) | |
811 | ||
c5dc1690 SJ |
812 | AC_ARG_ENABLE([cache-stats], |
813 | AS_HELP_STRING([--enable-cache-stats], | |
055e2b8b | 814 | [enable disk cache statistics collection])) |
c5dc1690 SJ |
815 | |
816 | if test x$enable_cache_stats = xyes; then | |
817 | DISK_CACHE_STATS=1 | |
818 | else | |
819 | DISK_CACHE_STATS=0 | |
820 | fi | |
821 | AC_SUBST([DISK_CACHE_STATS]) | |
822 | ||
e744219b VS |
823 | AC_ARG_ENABLE([boot-time], |
824 | AS_HELP_STRING([--enable-boot-time], | |
825 | [enable boot time statistics collection])) | |
826 | ||
827 | if test x$enable_boot_time = xyes; then | |
828 | BOOT_TIME_STATS=1 | |
829 | else | |
830 | BOOT_TIME_STATS=0 | |
831 | fi | |
832 | AC_SUBST([BOOT_TIME_STATS]) | |
833 | ||
d64399b5 | 834 | AC_ARG_ENABLE([grub-emu-usb], |
835 | [AS_HELP_STRING([--enable-grub-emu-usb], | |
5ce5507f | 836 | [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) |
5ce5507f | 837 | |
927d0134 VS |
838 | AC_ARG_ENABLE([grub-emu-sdl], |
839 | [AS_HELP_STRING([--enable-grub-emu-sdl], | |
840 | [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])]) | |
841 | ||
3affd0ec | 842 | AC_ARG_ENABLE([grub-emu-pci], |
843 | [AS_HELP_STRING([--enable-grub-emu-pci], | |
844 | [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])]) | |
845 | ||
f84b481b | 846 | if test "$platform" = emu; then |
f84b481b | 847 | |
62a747cb VS |
848 | if test x"$enable_grub_emu_usb" != xyes ; then |
849 | grub_emu_usb_excuse="not enabled" | |
5ce5507f | 850 | fi |
325c8258 | 851 | |
0e848909 VS |
852 | if test x"$enable_grub_emu_pci" = xyes ; then |
853 | grub_emu_usb_excuse="conflicts with PCI support" | |
854 | fi | |
855 | ||
5ce5507f | 856 | [if [ x"$grub_emu_usb_excuse" = x ]; then |
d64399b5 | 857 | # Check for libusb libraries.] |
5ce5507f | 858 | AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], |
e98cd0c2 | 859 | [grub_emu_usb_excuse=["need libusb library"]]) |
d64399b5 | 860 | AC_SUBST([LIBUSB]) |
5ce5507f | 861 | [fi] |
862 | [if [ x"$grub_emu_usb_excuse" = x ]; then | |
863 | # Check for headers.] | |
d64399b5 | 864 | AC_CHECK_HEADERS([usb.h], [], |
e98cd0c2 | 865 | [grub_emu_usb_excuse=["need libusb headers"]]) |
4fe9862e | 866 | [fi] |
c6f3b249 | 867 | if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then |
ce7a733d | 868 | AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled]) |
5ce5507f | 869 | fi |
870 | if test x"$grub_emu_usb_excuse" = x ; then | |
871 | enable_grub_emu_usb=yes | |
872 | else | |
873 | enable_grub_emu_usb=no | |
874 | fi | |
875 | ||
927d0134 VS |
876 | if test x"$enable_grub_emu_sdl" = xno ; then |
877 | grub_emu_sdl_excuse="explicitely disabled" | |
878 | fi | |
879 | [if [ x"$grub_emu_sdl_excuse" = x ]; then | |
880 | # Check for libSDL libraries.] | |
881 | AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"], | |
882 | [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]]) | |
883 | AC_SUBST([LIBSDL]) | |
884 | [fi] | |
9f293ab0 | 885 | |
927d0134 VS |
886 | [if [ x"$grub_emu_sdl_excuse" = x ]; then |
887 | # Check for headers.] | |
888 | AC_CHECK_HEADERS([SDL/SDL.h], [], | |
889 | [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]]) | |
890 | [fi] | |
9f293ab0 | 891 | |
927d0134 VS |
892 | if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then |
893 | AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled]) | |
894 | fi | |
895 | if test x"$grub_emu_sdl_excuse" = x ; then | |
896 | enable_grub_emu_sdl=yes | |
897 | else | |
898 | enable_grub_emu_sdl=no | |
899 | fi | |
900 | ||
3affd0ec | 901 | if test x"$enable_grub_emu_pci" != xyes ; then |
325c8258 | 902 | grub_emu_pci_excuse="not enabled" |
903 | fi | |
904 | ||
905 | if test x"$enable_grub_emu_usb" = xyes ; then | |
906 | grub_emu_pci_excuse="conflicts with USB support" | |
907 | fi | |
908 | ||
909 | [if [ x"$grub_emu_pci_excuse" = x ]; then | |
910 | # Check for libpci libraries.] | |
459fed4b | 911 | AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"], |
912 | [grub_emu_pci_excuse=["need libpciaccess library"]]) | |
913 | AC_SUBST([LIBPCIACCESS]) | |
325c8258 | 914 | [fi] |
915 | [if [ x"$grub_emu_pci_excuse" = x ]; then | |
916 | # Check for headers.] | |
917 | AC_CHECK_HEADERS([pci/pci.h], [], | |
459fed4b | 918 | [grub_emu_pci_excuse=["need libpciaccess headers"]]) |
325c8258 | 919 | [fi] |
920 | ||
921 | if test x"$grub_emu_pci_excuse" = x ; then | |
922 | enable_grub_emu_pci=yes | |
923 | else | |
9f293ab0 | 924 | |
325c8258 | 925 | enable_grub_emu_pci=no |
3affd0ec | 926 | fi |
927 | ||
927d0134 | 928 | AC_SUBST([enable_grub_emu_sdl]) |
d64399b5 | 929 | AC_SUBST([enable_grub_emu_usb]) |
3affd0ec | 930 | AC_SUBST([enable_grub_emu_pci]) |
f84b481b | 931 | fi |
4fe9862e | 932 | |
e52db1f7 | 933 | AC_ARG_ENABLE([grub-mkfont], |
934 | [AS_HELP_STRING([--enable-grub-mkfont], | |
5ce5507f | 935 | [build and install the `grub-mkfont' utility (default=guessed)])]) |
936 | if test x"$enable_grub_mkfont" = xno ; then | |
ce7a733d | 937 | grub_mkfont_excuse="explicitly disabled" |
5ce5507f | 938 | fi |
939 | ||
940 | if test x"$grub_mkfont_excuse" = x ; then | |
e52db1f7 | 941 | # Check for freetype libraries. |
942 | AC_CHECK_PROGS([FREETYPE], [freetype-config]) | |
943 | if test "x$FREETYPE" = x ; then | |
e98cd0c2 | 944 | grub_mkfont_excuse=["need freetype2 library"] |
e52db1f7 | 945 | fi |
e52db1f7 | 946 | fi |
660960d6 VS |
947 | |
948 | if test x"$grub_mkfont_excuse" = x ; then | |
949 | # Check for freetype libraries. | |
10854d0d YB |
950 | freetype_cflags=`freetype-config --cflags` |
951 | freetype_libs=`freetype-config --libs` | |
d1e8a02f VS |
952 | SAVED_CPPFLAGS="$CPPFLAGS" |
953 | CPPFLAGS="$CPPFLAGS $freetype_cflags" | |
660960d6 VS |
954 | AC_CHECK_HEADERS([ft2build.h], [], |
955 | [grub_mkfont_excuse=["need freetype2 headers"]]) | |
d1e8a02f | 956 | CPPFLAGS="$SAVED_CPPFLAGS" |
660960d6 VS |
957 | fi |
958 | ||
5ce5507f | 959 | if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then |
ce7a733d | 960 | AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled]) |
5ce5507f | 961 | fi |
962 | if test x"$grub_mkfont_excuse" = x ; then | |
963 | enable_grub_mkfont=yes | |
964 | else | |
965 | enable_grub_mkfont=no | |
966 | fi | |
20168fca CW |
967 | if test x"$enable_grub_mkfont" = xno && test "x$platform" = xloongson; then |
968 | AC_MSG_ERROR([loongson port needs grub-mkfont]) | |
969 | fi | |
e52db1f7 | 970 | AC_SUBST([enable_grub_mkfont]) |
971 | AC_SUBST([freetype_cflags]) | |
972 | AC_SUBST([freetype_libs]) | |
973 | ||
c5884973 DO |
974 | DJVU_FONT_SOURCE= |
975 | ||
976 | starfield_excuse= | |
977 | ||
978 | if test x$enable_grub_mkfont = xno; then | |
979 | starfield_excuse="No grub-mkfont" | |
980 | fi | |
981 | ||
501b9e4b | 982 | if test x"$starfield_excuse" = x; then |
c5884973 | 983 | for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do |
32745f51 | 984 | for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do |
c5884973 DO |
985 | if test -f "$dir/DejaVuSans.$ext"; then |
986 | DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext" | |
987 | break 2 | |
988 | fi | |
989 | done | |
990 | done | |
991 | ||
992 | if test "x$DJVU_FONT_SOURCE" = x; then | |
993 | starfield_excuse="No DejaVu found" | |
994 | fi | |
995 | fi | |
996 | ||
997 | AC_SUBST([DJVU_FONT_SOURCE]) | |
998 | ||
897e6207 CW |
999 | AC_ARG_ENABLE([grub-mount], |
1000 | [AS_HELP_STRING([--enable-grub-mount], | |
1001 | [build and install the `grub-mount' utility (default=guessed)])]) | |
1002 | if test x"$enable_grub_mount" = xno ; then | |
1003 | grub_mount_excuse="explicitly disabled" | |
92bb0786 VS |
1004 | fi |
1005 | ||
897e6207 | 1006 | if test x"$grub_mount_excuse" = x ; then |
92bb0786 | 1007 | AC_CHECK_LIB([fuse], [fuse_main_real], [], |
897e6207 | 1008 | [grub_mount_excuse="need FUSE library"]) |
92bb0786 VS |
1009 | fi |
1010 | ||
897e6207 | 1011 | if test x"$grub_mount_excuse" = x ; then |
92bb0786 VS |
1012 | # Check for fuse headers. |
1013 | SAVED_CPPFLAGS="$CPPFLAGS" | |
338c7fab | 1014 | CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26" |
92bb0786 | 1015 | AC_CHECK_HEADERS([fuse/fuse.h], [], |
897e6207 | 1016 | [grub_mount_excuse=["need FUSE headers"]]) |
92bb0786 VS |
1017 | CPPFLAGS="$SAVED_CPPFLAGS" |
1018 | fi | |
1019 | ||
897e6207 | 1020 | if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then |
89644ef1 | 1021 | AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled]) |
92bb0786 | 1022 | fi |
897e6207 CW |
1023 | if test x"$grub_mount_excuse" = x ; then |
1024 | enable_grub_mount=yes | |
92bb0786 | 1025 | else |
897e6207 | 1026 | enable_grub_mount=no |
92bb0786 | 1027 | fi |
897e6207 | 1028 | AC_SUBST([enable_grub_mount]) |
92bb0786 | 1029 | |
7181e228 CW |
1030 | AC_ARG_ENABLE([device-mapper], |
1031 | [AS_HELP_STRING([--enable-device-mapper], | |
1032 | [enable Linux device-mapper support (default=guessed)])]) | |
1033 | if test x"$enable_device_mapper" = xno ; then | |
1034 | device_mapper_excuse="explicitly disabled" | |
1035 | fi | |
1036 | ||
53798c4b GS |
1037 | if test x"$device_mapper_excuse" = x ; then |
1038 | # Check for device-mapper header. | |
1039 | AC_CHECK_HEADER([libdevmapper.h], [], | |
1040 | [device_mapper_excuse="need libdevmapper header"]) | |
1041 | fi | |
1042 | ||
7181e228 CW |
1043 | if test x"$device_mapper_excuse" = x ; then |
1044 | # Check for device-mapper library. | |
61d720e5 | 1045 | AC_CHECK_LIB([devmapper], [dm_task_create], [], |
7181e228 | 1046 | [device_mapper_excuse="need devmapper library"]) |
7181e228 | 1047 | fi |
61d720e5 VS |
1048 | |
1049 | if test x"$device_mapper_excuse" = x ; then | |
1050 | # Check for device-mapper library. | |
1051 | AC_CHECK_LIB([devmapper], [dm_log_with_errno_init], | |
1052 | [], | |
1053 | [device_mapper_excuse="need devmapper library"]) | |
1054 | fi | |
1055 | ||
1056 | if test x"$device_mapper_excuse" = x ; then | |
1057 | LIBDEVMAPPER="-ldevmapper"; | |
1058 | AC_DEFINE([HAVE_DEVICE_MAPPER], [1], | |
1059 | [Define to 1 if you have the devmapper library.]) | |
1060 | fi | |
1061 | ||
62f7d208 | 1062 | AC_SUBST([LIBDEVMAPPER]) |
76ed06b9 | 1063 | |
f4727da9 VS |
1064 | LIBGEOM= |
1065 | if test x$host_kernel = xkfreebsd; then | |
1066 | AC_CHECK_LIB([geom], [geom_gettree], [], | |
1067 | [AC_MSG_ERROR([Your platform requires libgeom])]) | |
1068 | LIBGEOM="-lgeom" | |
1069 | fi | |
1070 | ||
1071 | AC_SUBST([LIBGEOM]) | |
1072 | ||
2c44e493 VS |
1073 | AC_CHECK_LIB([lzma], [lzma_code], |
1074 | [LIBLZMA="-llzma" | |
1075 | AC_DEFINE([HAVE_LIBLZMA], [1], | |
1076 | [Define to 1 if you have the LZMA library.])],) | |
1077 | AC_SUBST([LIBLZMA]) | |
1078 | ||
e4c498a1 MG |
1079 | AC_ARG_ENABLE([libzfs], |
1080 | [AS_HELP_STRING([--enable-libzfs], | |
1081 | [enable libzfs integration (default=guessed)])]) | |
1082 | if test x"$enable_libzfs" = xno ; then | |
1083 | libzfs_excuse="explicitly disabled" | |
1084 | fi | |
16c7cb32 | 1085 | |
e4c498a1 MG |
1086 | if test x"$libzfs_excuse" = x ; then |
1087 | # Only check for system headers if libzfs support has not been disabled. | |
1088 | AC_CHECK_HEADERS(libzfs.h libnvpair.h) | |
1089 | fi | |
1090 | ||
1091 | if test x"$libzfs_excuse" = x ; then | |
1092 | AC_CHECK_LIB([zfs], [libzfs_init], | |
1093 | [], | |
1094 | [libzfs_excuse="need zfs library"]) | |
1095 | fi | |
1096 | ||
1097 | if test x"$libzfs_excuse" = x ; then | |
1098 | AC_CHECK_LIB([nvpair], [nvlist_print], | |
1099 | [], | |
1100 | [libzfs_excuse="need nvpair library"]) | |
1101 | fi | |
1102 | ||
1103 | if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then | |
1104 | AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied]) | |
1105 | fi | |
1106 | ||
1107 | if test x"$libzfs_excuse" = x ; then | |
1108 | # We need both libzfs and libnvpair for a successful build. | |
1109 | LIBZFS="-lzfs" | |
1110 | AC_DEFINE([HAVE_LIBZFS], [1], | |
1111 | [Define to 1 if you have the ZFS library.]) | |
1112 | LIBNVPAIR="-lnvpair" | |
1113 | AC_DEFINE([HAVE_LIBNVPAIR], [1], | |
1114 | [Define to 1 if you have the NVPAIR library.]) | |
1115 | fi | |
1116 | ||
1117 | AC_SUBST([LIBZFS]) | |
16c7cb32 BC |
1118 | AC_SUBST([LIBNVPAIR]) |
1119 | ||
9f915872 VS |
1120 | LIBS="" |
1121 | ||
76ed06b9 | 1122 | AC_SUBST([FONT_SOURCE]) |
76ed06b9 BC |
1123 | AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu], |
1124 | [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)]) | |
76ed06b9 BC |
1125 | AS_IF([test x$TARGET_APPLE_CC = x1], |
1126 | [AC_SUBST([USE_APPLE_CC_FIXES], yes)]) | |
7181e228 | 1127 | |
742f9232 VS |
1128 | AC_SUBST(HAVE_ASM_USCORE) |
1129 | AC_SUBST(ADDR32) | |
1130 | AC_SUBST(DATA32) | |
1131 | AC_SUBST(BSS_START_SYMBOL) | |
1132 | AC_SUBST(END_SYMBOL) | |
1133 | AC_SUBST(PACKAGE) | |
1134 | AC_SUBST(VERSION) | |
1135 | AC_SUBST(NEED_ENABLE_EXECUTE_STACK) | |
1136 | AC_SUBST(NEED_REGISTER_FRAME_INFO) | |
1137 | ||
76ed06b9 BC |
1138 | # |
1139 | # Automake conditionals | |
1140 | # | |
8c411768 | 1141 | |
76ed06b9 BC |
1142 | AM_CONDITIONAL([COND_emu], [test x$platform = xemu]) |
1143 | AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc]) | |
1144 | AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi]) | |
6585de4c | 1145 | AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi]) |
76ed06b9 BC |
1146 | AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu]) |
1147 | AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275]) | |
1148 | AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot]) | |
1149 | AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot]) | |
1150 | AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi]) | |
4959e111 VS |
1151 | AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson]) |
1152 | AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips]) | |
7f63a64f | 1153 | AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc]) |
76ed06b9 BC |
1154 | AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275]) |
1155 | AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275]) | |
4959e111 | 1156 | AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel]) |
37ba07eb VS |
1157 | AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel]) |
1158 | AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips]) | |
f7711f5e BC |
1159 | |
1160 | AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd]) | |
1161 | AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux]) | |
1162 | AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd]) | |
1163 | AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows]) | |
1164 | AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd]) | |
b105df76 | 1165 | AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu]) |
958ee221 | 1166 | AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos]) |
2d465fb0 | 1167 | |
76ed06b9 BC |
1168 | AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x]) |
1169 | AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes]) | |
1170 | AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes]) | |
1171 | AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes]) | |
1172 | AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes]) | |
897e6207 | 1173 | AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes]) |
76ed06b9 | 1174 | AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x]) |
76ed06b9 | 1175 | AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x]) |
771111e5 | 1176 | AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1]) |
76ed06b9 | 1177 | AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes]) |
c5dc1690 | 1178 | AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1]) |
e744219b | 1179 | AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1]) |
fc45fb58 | 1180 | |
742f9232 | 1181 | AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1]) |
f1632d4d | 1182 | AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin]) |
c5884973 | 1183 | AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x]) |
742f9232 | 1184 | |
6a161fa9 | 1185 | # Output files. |
4959e111 VS |
1186 | cpudir="${target_cpu}" |
1187 | if test x${cpudir} = xmipsel; then | |
1188 | cpudir=mips; | |
1189 | fi | |
1f4147aa | 1190 | grub_CHECK_LINK_DIR |
1191 | if test x"$link_dir" = xyes ; then | |
4959e111 | 1192 | AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir]) |
f84b481b | 1193 | if test "$platform" != emu ; then |
4959e111 | 1194 | AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform]) |
f84b481b | 1195 | fi |
1f4147aa | 1196 | else |
1197 | mkdir -p include/grub 2>/dev/null | |
1198 | rm -rf include/grub/cpu | |
4959e111 | 1199 | cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null |
f84b481b RM |
1200 | if test "$platform" != emu ; then |
1201 | rm -rf include/grub/machine | |
4959e111 | 1202 | cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null |
f84b481b | 1203 | fi |
1f4147aa | 1204 | fi |
6304d292 | 1205 | |
8c411768 | 1206 | AC_CONFIG_FILES([Makefile]) |
6304d292 | 1207 | AC_CONFIG_FILES([grub-core/Makefile]) |
15c69261 | 1208 | AC_CONFIG_FILES([grub-core/gnulib/Makefile]) |
269004c1 | 1209 | AC_CONFIG_FILES([po/Makefile.in]) |
8c411768 | 1210 | AC_CONFIG_FILES([docs/Makefile]) |
b23ffd70 | 1211 | AC_CONFIG_FILES([util/bash-completion.d/Makefile]) |
6a161fa9 | 1212 | AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) |
742f9232 | 1213 | AC_CONFIG_FILES([config.h]) |
8c411768 | 1214 | |
6a161fa9 | 1215 | AC_OUTPUT |
5ce5507f | 1216 | [ |
1217 | echo "*******************************************************" | |
1218 | echo GRUB2 will be compiled with following components: | |
1219 | echo Platform: "$target_cpu"-"$platform" | |
f84b481b | 1220 | if [ x"$platform" = xemu ]; then |
5ce5507f | 1221 | if [ x"$grub_emu_usb_excuse" = x ]; then |
1222 | echo USB support for grub-emu: Yes | |
1223 | else | |
1224 | echo USB support for grub-emu: No "($grub_emu_usb_excuse)" | |
1225 | fi | |
927d0134 VS |
1226 | if [ x"$grub_emu_sdl_excuse" = x ]; then |
1227 | echo SDL support for grub-emu: Yes | |
1228 | else | |
1229 | echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)" | |
1230 | fi | |
325c8258 | 1231 | if [ x"$grub_emu_pci_excuse" = x ]; then |
1232 | echo PCI support for grub-emu: Yes | |
1233 | else | |
1234 | echo PCI support for grub-emu: No "($grub_emu_pci_excuse)" | |
1235 | fi | |
f84b481b | 1236 | fi |
61d720e5 VS |
1237 | if test x"$device_mapper_excuse" = x ; then |
1238 | echo With devmapper support: Yes | |
1239 | else | |
1240 | echo With devmapper support: No "($device_mapper_excuse)" | |
1241 | fi | |
5ce5507f | 1242 | if [ x"$enable_mm_debug" = xyes ]; then |
1243 | echo With memory debugging: Yes | |
1244 | else | |
1245 | echo With memory debugging: No | |
1246 | fi | |
c5dc1690 SJ |
1247 | if [ x"$enable_cache_stats" = xyes ]; then |
1248 | echo With disk cache statistics: Yes | |
1249 | else | |
1250 | echo With disk cache statistics: No | |
1251 | fi | |
e744219b VS |
1252 | |
1253 | if [ x"$enable_boot_time" = xyes ]; then | |
1254 | echo With boot time statistics: Yes | |
1255 | else | |
1256 | echo With boot time statistics: No | |
1257 | fi | |
1258 | ||
5ce5507f | 1259 | if [ x"$efiemu_excuse" = x ]; then |
1260 | echo efiemu runtime: Yes | |
1261 | else | |
1262 | echo efiemu runtime: No "($efiemu_excuse)" | |
1263 | fi | |
5ce5507f | 1264 | if [ x"$grub_mkfont_excuse" = x ]; then |
1265 | echo grub-mkfont: Yes | |
1266 | else | |
1267 | echo grub-mkfont: No "($grub_mkfont_excuse)" | |
1268 | fi | |
897e6207 | 1269 | if [ x"$grub_mount_excuse" = x ]; then |
89644ef1 | 1270 | echo grub-mount: Yes |
92bb0786 | 1271 | else |
897e6207 | 1272 | echo grub-mount: No "($grub_mount_excuse)" |
92bb0786 | 1273 | fi |
c5884973 DO |
1274 | if [ x"$starfield_excuse" = x ]; then |
1275 | echo starfield theme: Yes | |
1276 | else | |
1277 | echo starfield theme: No "($starfield_excuse)" | |
1278 | fi | |
e4c498a1 MG |
1279 | if [ x"$libzfs_excuse" = x ]; then |
1280 | echo With libzfs support: Yes | |
1281 | else | |
1282 | echo With libzfs support: No "($libzfs_excuse)" | |
1283 | fi | |
5ce5507f | 1284 | echo "*******************************************************" |
1285 | ] |