]>
Commit | Line | Data |
---|---|---|
76ed06b9 BC |
1 | # -*- autoconf -*- |
2 | ||
6a161fa9 | 3 | # Process this file with autoconf to produce a configure script. |
4 | ||
76ed06b9 | 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 | ||
34980574 BC |
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 | ||
5519963b | 35 | AC_INIT([GRUB],[1.98],[bug-grub@gnu.org]) |
6a161fa9 | 36 | |
76ed06b9 BC |
37 | # We don't want -g -O2 by default in CFLAGS |
38 | : ${CFLAGS=""} | |
6304d292 | 39 | |
b977bf01 | 40 | # Checks for host and target systems. |
6a161fa9 | 41 | AC_CANONICAL_HOST |
b977bf01 | 42 | AC_CANONICAL_TARGET |
6a161fa9 | 43 | |
8c411768 BC |
44 | AM_INIT_AUTOMAKE() |
45 | AC_PREREQ(2.60) | |
6304d292 | 46 | AC_CONFIG_SRCDIR([include/grub/dl.h]) |
8c411768 | 47 | AC_CONFIG_HEADER([config.h]) |
e52db1f7 | 48 | |
76ed06b9 BC |
49 | # Program name transformations |
50 | AC_ARG_PROGRAM | |
51 | ||
52 | # Optimization flag. Allow user to override. | |
53 | if test "x$TARGET_CFLAGS" = x; then | |
54 | TARGET_CFLAGS="$TARGET_CFLAGS -Os" | |
55 | fi | |
56 | ||
57 | # Default HOST_CPPFLAGS | |
58 | HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" | |
76ed06b9 | 59 | HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" |
76ed06b9 BC |
60 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" |
61 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_LIBDIR=\\\"\$(pkglibdir)\\\"" | |
62 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\"" | |
63 | ||
64 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W" | |
65 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" | |
66 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" | |
67 | ||
68 | case "$target_cpu" in | |
69 | i[[3456]]86) target_cpu=i386 ;; | |
70 | amd64) target_cpu=x86_64 ;; | |
71 | sparc) target_cpu=sparc64 ;; | |
72 | mipsel|mips64el) | |
73 | target_cpu=mips; | |
c721825b | 74 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1"; |
76ed06b9 BC |
75 | ;; |
76 | mips|mips64) | |
77 | target_cpu=mips; | |
c721825b | 78 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1"; |
76ed06b9 BC |
79 | ;; |
80 | esac | |
81 | ||
82 | # Specify the platform (such as firmware). | |
83 | AC_ARG_WITH([platform], | |
84 | AS_HELP_STRING([--with-platform=PLATFORM], | |
85 | [select the host platform [[guessed]]])) | |
86 | ||
87 | # Guess the platform if not specified. | |
88 | if test "x$with_platform" = x; then | |
89 | case "$target_cpu"-"$target_vendor" in | |
90 | i386-apple) platform=efi ;; | |
91 | i386-*) platform=pc ;; | |
92 | x86_64-apple) platform=efi ;; | |
93 | x86_64-*) platform=pc ;; | |
94 | powerpc-*) platform=ieee1275 ;; | |
95 | powerpc64-*) platform=ieee1275 ;; | |
96 | sparc64-*) platform=ieee1275 ;; | |
97 | mips-*) platform=yeeloong ;; | |
98 | *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;; | |
99 | esac | |
100 | else | |
101 | platform="$with_platform" | |
102 | fi | |
103 | ||
104 | # Adjust CPU unless target was explicitly specified. | |
105 | if test -z "$target_alias"; then | |
106 | case "$target_cpu"-"$platform" in | |
107 | x86_64-efi) ;; | |
108 | x86_64-emu) ;; | |
109 | x86_64-*) target_cpu=i386 ;; | |
110 | powerpc64-ieee1275) target_cpu=powerpc ;; | |
111 | esac | |
112 | fi | |
113 | ||
114 | # Check if the platform is supported, make final adjustments. | |
115 | case "$target_cpu"-"$platform" in | |
116 | i386-efi) ;; | |
117 | x86_64-efi) ;; | |
118 | i386-pc) ;; | |
119 | i386-multiboot) ;; | |
120 | i386-coreboot) ;; | |
121 | i386-linuxbios) platform=coreboot ;; | |
122 | i386-ieee1275) ;; | |
123 | i386-qemu) ;; | |
124 | powerpc-ieee1275) ;; | |
125 | sparc64-ieee1275) ;; | |
126 | mips-qemu-mips) ;; | |
127 | mips-yeeloong) ;; | |
128 | *-emu) ;; | |
129 | *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; | |
130 | esac | |
131 | ||
132 | case "$target_cpu" in | |
133 | i386 | powerpc) target_m32=1 ;; | |
134 | x86_64 | sparc64) target_m64=1 ;; | |
135 | esac | |
136 | ||
137 | case "$host_os" in | |
138 | mingw32*) host_os=cygwin ;; | |
139 | esac | |
140 | ||
141 | # This normalizes the names, and creates a new variable ("host_kernel") | |
142 | # while at it, since the mapping is not always 1:1 (e.g. different OSes | |
143 | # using the same kernel type). | |
144 | case "$host_os" in | |
145 | gnu*) host_kernel=hurd ;; | |
146 | linux*) host_kernel=linux ;; | |
147 | freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;; | |
148 | netbsd*) host_kernel=netbsd ;; | |
149 | cygwin) host_kernel=windows ;; | |
150 | esac | |
151 | ||
152 | case "$platform" in | |
c721825b BC |
153 | coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;; |
154 | multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;; | |
155 | efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;; | |
156 | ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;; | |
157 | qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;; | |
158 | pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;; | |
159 | emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;; | |
160 | yeeloong) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;; | |
161 | qemu-mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;; | |
76ed06b9 BC |
162 | esac |
163 | case "$target_cpu" in | |
c721825b BC |
164 | mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;; |
165 | sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;; | |
76ed06b9 | 166 | esac |
c721825b | 167 | machine_CPPFLAGS="$machine_CPPFLAGS -DMACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" |
76ed06b9 | 168 | |
c721825b BC |
169 | HOST_CPPFLAGS="$HOST_CPPFLAGS $machine_CPPFLAGS" |
170 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS" | |
76ed06b9 BC |
171 | |
172 | AC_SUBST(host_cpu) | |
173 | AC_SUBST(host_os) | |
174 | AC_SUBST(host_kernel) | |
175 | ||
176 | AC_SUBST(target_cpu) | |
177 | AC_SUBST(platform) | |
178 | ||
179 | # | |
180 | # Checks for build programs. | |
181 | # | |
182 | ||
183 | # Although cmp is listed in the GNU Coding Standards as a command which | |
184 | # can used directly, OpenBSD lacks cmp in the default installation. | |
185 | AC_CHECK_PROGS([CMP], [cmp]) | |
186 | if test "x$CMP" = x; then | |
187 | AC_MSG_ERROR([cmp is not found]) | |
188 | fi | |
189 | ||
190 | AC_CHECK_PROGS([YACC], [bison]) | |
191 | if test "x$YACC" = x; then | |
192 | AC_MSG_ERROR([bison is not found]) | |
193 | fi | |
194 | ||
195 | FONT_SOURCE= | |
196 | ||
197 | for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do | |
198 | for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont; do | |
199 | if test -f "$dir/unifont.$ext"; then | |
200 | FONT_SOURCE="$dir/unifont.$ext" | |
201 | break 2 | |
202 | fi | |
203 | done | |
204 | done | |
205 | ||
206 | if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xyeeloong ); then | |
207 | AC_MSG_ERROR([qemu and yeeloong ports need unifont]) | |
208 | fi | |
209 | ||
210 | AC_SUBST([FONT_SOURCE]) | |
211 | ||
212 | AC_PROG_RANLIB | |
213 | AC_PROG_INSTALL | |
214 | AC_PROG_AWK | |
215 | AC_PROG_LEX | |
216 | AC_PROG_YACC | |
217 | AC_PROG_MAKE_SET | |
218 | AC_PROG_MKDIR_P | |
219 | ||
220 | if test "x$LEX" = "x:"; then | |
221 | AC_MSG_ERROR([flex is not found]) | |
222 | else | |
223 | version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'` | |
224 | if test -n "$version" -a "$version" -ge 20535; then | |
225 | : | |
226 | else | |
227 | AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above]) | |
228 | fi | |
229 | fi | |
230 | ||
231 | # These are not a "must". | |
232 | AC_PATH_PROG(MAKEINFO, makeinfo) | |
233 | ||
234 | # | |
235 | # Checks for host programs. | |
236 | # | |
237 | ||
238 | AC_PROG_CC | |
239 | AM_PROG_CC_C_O | |
240 | AM_PROG_AS | |
241 | ||
242 | # Must be GCC. | |
243 | test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required]) | |
244 | ||
245 | AC_GNU_SOURCE | |
246 | AM_GNU_GETTEXT([external]) | |
247 | AC_SYS_LARGEFILE | |
248 | ||
249 | # Identify characteristics of the host architecture. | |
250 | AC_C_BIGENDIAN | |
251 | AC_CHECK_SIZEOF(void *) | |
252 | AC_CHECK_SIZEOF(long) | |
253 | ||
254 | grub_apple_cc | |
255 | if test x$grub_cv_apple_cc = xyes ; then | |
256 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DAPPLE_CC=1" | |
257 | HOST_CFLAGS="$HOST_CFLAGS -fnested-functions" | |
258 | fi | |
259 | ||
260 | if test "x$cross_compiling" = xyes; then | |
261 | AC_MSG_WARN([cannot generate manual pages while cross compiling]) | |
262 | else | |
263 | AC_PATH_PROG(HELP2MAN, help2man) | |
264 | fi | |
265 | ||
3169f4c7 | 266 | # Check for functions and headers. |
76ed06b9 | 267 | AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf) |
d3dd9e80 | 268 | AC_CHECK_HEADERS(libzfs.h libnvpair.h sys/param.h sys/mount.h) |
76ed06b9 BC |
269 | |
270 | # For opendisk() and getrawpartition() on NetBSD. | |
271 | # Used in util/deviceiter.c and in util/hostdisk.c. | |
272 | AC_CHECK_HEADER([util.h], [ | |
273 | AC_CHECK_LIB([util], [opendisk], [ | |
274 | LIBUTIL="-lutil" | |
275 | AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used]) | |
276 | ]) | |
277 | AC_CHECK_LIB([util], [getrawpartition], [ | |
278 | LIBUTIL="-lutil" | |
279 | AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used]) | |
280 | ]) | |
281 | ]) | |
282 | AC_SUBST([LIBUTIL]) | |
283 | ||
284 | # | |
285 | # Check for host and build compilers. | |
286 | # | |
287 | HOST_CC=$CC | |
288 | AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc], | |
289 | [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])]) | |
290 | ||
291 | # | |
292 | # Check for target programs. | |
293 | # | |
294 | ||
295 | # Find tools for the target. | |
296 | if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then | |
297 | tmp_ac_tool_prefix="$ac_tool_prefix" | |
298 | ac_tool_prefix=$target_alias- | |
299 | ||
300 | AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc], | |
301 | [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])]) | |
302 | AC_CHECK_TOOL(OBJCOPY, objcopy) | |
303 | AC_CHECK_TOOL(STRIP, strip) | |
304 | AC_CHECK_TOOL(NM, nm) | |
305 | ||
306 | ac_tool_prefix="$tmp_ac_tool_prefix" | |
307 | else | |
308 | if test "x$TARGET_CC" = x; then | |
309 | TARGET_CC=$CC | |
310 | fi | |
311 | AC_CHECK_TOOL(OBJCOPY, objcopy) | |
312 | AC_CHECK_TOOL(STRIP, strip) | |
313 | AC_CHECK_TOOL(NM, nm) | |
314 | fi | |
315 | AC_SUBST(HOST_CC) | |
316 | AC_SUBST(BUILD_CC) | |
317 | AC_SUBST(TARGET_CC) | |
318 | ||
319 | # Test the C compiler for the target environment. | |
320 | tmp_CC="$CC" | |
321 | tmp_CFLAGS="$CFLAGS" | |
322 | tmp_LDFLAGS="$LDFLAGS" | |
323 | tmp_CPPFLAGS="$CPPFLAGS" | |
324 | tmp_LIBS="$LIBS" | |
325 | CC="$TARGET_CC" | |
326 | CFLAGS="$TARGET_CFLAGS" | |
327 | CPPFLAGS="$TARGET_CPPFLAGS" | |
328 | LDFLAGS="$TARGET_LDFLAGS" | |
329 | LIBS="" | |
330 | ||
331 | # debug flags. | |
332 | TARGET_CFLAGS="$TARGET_CFLAGS -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g" | |
333 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g" | |
334 | ||
335 | # Force no alignment to save space on i386. | |
336 | if test "x$target_cpu" = xi386; then | |
337 | AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ | |
338 | CFLAGS="$CFLAGS -falign-loops=1" | |
339 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
340 | [grub_cv_cc_falign_loop=yes], | |
341 | [grub_cv_cc_falign_loop=no]) | |
342 | ]) | |
343 | ||
344 | if test "x$grub_cv_cc_falign_loop" = xyes; then | |
345 | TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" | |
346 | else | |
347 | TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" | |
348 | fi | |
349 | ||
350 | # Some toolchains enable these features by default, but they need | |
351 | # registers that aren't set up properly in GRUB. | |
352 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow" | |
353 | fi | |
354 | ||
355 | # By default, GCC 4.4 generates .eh_frame sections containing unwind | |
356 | # information in some cases where it previously did not. GRUB doesn't need | |
357 | # these and they just use up vital space. Restore the old compiler | |
358 | # behaviour. | |
359 | AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [ | |
360 | SAVE_CFLAGS="$CFLAGS" | |
361 | CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm" | |
362 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
363 | [grub_cv_cc_fno_dwarf2_cfi_asm=yes], | |
364 | [grub_cv_cc_fno_dwarf2_cfi_asm=no]) | |
365 | CFLAGS="$SAVE_CFLAGS" | |
366 | ]) | |
367 | ||
368 | if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then | |
369 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" | |
370 | fi | |
371 | ||
372 | grub_apple_target_cc | |
373 | if test x$grub_cv_apple_target_cc = xyes ; then | |
374 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -DAPPLE_CC=1" | |
375 | TARGET_CFLAGS="$TARGET_CFLAGS -fnested-functions" | |
376 | ||
377 | CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions" | |
378 | TARGET_APPLE_CC=1 | |
379 | AC_CHECK_PROG([OBJCONV], [objconv], [objconv], []) | |
380 | if test "x$OBJCONV" = x ; then | |
381 | AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.]) | |
382 | fi | |
383 | if test "x$OBJCONV" = x ; then | |
384 | AC_MSG_ERROR([objconv not found which is required when building with apple compiler]) | |
385 | fi | |
386 | TARGET_IMG_LDSCRIPT= | |
387 | TARGET_IMG_CFLAGS="-static" | |
388 | TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20' | |
389 | TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20' | |
390 | TARGET_IMG_BASE_LDOPT="-Wl,-image_base" | |
391 | else | |
392 | TARGET_APPLE_CC=0 | |
393 | # Use linker script if present, otherwise use builtin -N script. | |
394 | if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then | |
395 | TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" | |
396 | TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" | |
397 | TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" | |
398 | TARGET_IMG_BASE_LDOPT="-Wl,-Ttext" | |
399 | else | |
400 | TARGET_IMG_LDSCRIPT= | |
401 | TARGET_IMG_LDFLAGS='-Wl,-N' | |
402 | TARGET_IMG_LDFLAGS_AC='-Wl,-N' | |
403 | TARGET_IMG_BASE_LDOPT="-Wl,-Ttext" | |
404 | fi | |
405 | TARGET_IMG_CFLAGS= | |
406 | fi | |
407 | ||
408 | # For platforms where ELF is not the default link format. | |
409 | AC_MSG_CHECKING([for command to convert module to ELF format]) | |
410 | case "${host_os}" in | |
411 | cygwin) TARGET_OBJ2ELF='$(grub_utildir)/grub-pe2elf'; | |
412 | # FIXME: put proper test here | |
413 | AC_DEFINE([NEED_REGISTER_FRAME_INFO], 1, | |
414 | [Define to 1 if GCC generates calls to __register_frame_info()]) | |
415 | ;; | |
416 | *) ;; | |
417 | esac | |
418 | AC_MSG_RESULT([$TARGET_OBJ2ELF]) | |
419 | ||
420 | if test "x$target_m32" = x1; then | |
421 | # Force 32-bit mode. | |
422 | TARGET_CFLAGS="$TARGET_CFLAGS -m32" | |
423 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32" | |
424 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" | |
425 | TARGET_MODULE_FORMAT="elf32" | |
426 | fi | |
427 | ||
428 | if test "x$target_m64" = x1; then | |
429 | # Force 64-bit mode. | |
430 | TARGET_CFLAGS="$TARGET_CFLAGS -m64" | |
431 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64" | |
432 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" | |
433 | TARGET_MODULE_FORMAT="elf64" | |
434 | fi | |
435 | ||
436 | if test "$target_cpu"-"$platform" = x86_64-efi; then | |
437 | # Use large model to support 4G memory | |
438 | AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ | |
439 | SAVED_CFLAGS=$CFLAGS | |
440 | CFLAGS="$CFLAGS -m64 -mcmodel=large" | |
441 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
442 | [grub_cv_cc_mcmodel=yes], | |
443 | [grub_cv_cc_mcmodel=no]) | |
444 | ]) | |
445 | if test "x$grub_cv_cc_mcmodel" = xno; then | |
446 | AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.]) | |
447 | else | |
448 | TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" | |
449 | fi | |
450 | ||
451 | # EFI writes to stack below %rsp, we must not use the red zone | |
452 | AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ | |
453 | CFLAGS="$CFLAGS -m64 -mno-red-zone" | |
454 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
455 | [grub_cv_cc_no_red_zone=yes], | |
456 | [grub_cv_cc_no_red_zone=no]) | |
457 | ]) | |
458 | if test "x$grub_cv_cc_no_red_zone" = xno; then | |
459 | AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc]) | |
460 | fi | |
461 | ||
462 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone" | |
463 | fi | |
464 | ||
465 | # | |
466 | # Compiler features. | |
467 | # | |
468 | ||
469 | # Need __enable_execute_stack() for nested function trampolines? | |
470 | grub_CHECK_ENABLE_EXECUTE_STACK | |
471 | ||
472 | # Position independent executable. | |
473 | grub_CHECK_PIE | |
474 | [# Need that, because some distributions ship compilers that include | |
475 | # `-fPIE' in the default specs. | |
476 | if [ x"$pie_possible" = xyes ]; then | |
477 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE" | |
478 | fi] | |
479 | ||
480 | # Smashing stack protector. | |
481 | grub_CHECK_STACK_PROTECTOR | |
482 | # Need that, because some distributions ship compilers that include | |
483 | # `-fstack-protector' in the default specs. | |
484 | if test "x$ssp_possible" = xyes; then | |
485 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" | |
486 | fi | |
487 | grub_CHECK_STACK_ARG_PROBE | |
488 | # Cygwin's GCC uses alloca() to probe the stackframe on static | |
489 | # stack allocations above some threshold. | |
490 | if test x"$sap_possible" = xyes; then | |
491 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" | |
492 | fi | |
493 | ||
494 | AC_ARG_ENABLE([werror], | |
495 | [AS_HELP_STRING([--disable-werror], | |
496 | [do not use -Werror when building GRUB])]) | |
497 | if test x"$enable_werror" != xno ; then | |
498 | TARGET_CFLAGS="$TARGET_CFLAGS -Werror" | |
499 | fi | |
500 | ||
501 | TARGET_CPP="$TARGET_CC -E" | |
502 | TARGET_CCAS=$TARGET_CC | |
503 | ||
504 | AC_SUBST(OBJCONV) | |
505 | AC_SUBST(TARGET_CPP) | |
506 | AC_SUBST(TARGET_CCAS) | |
507 | AC_SUBST(TARGET_OBJ2ELF) | |
508 | AC_SUBST(TARGET_APPLE_CC) | |
509 | AC_SUBST(TARGET_MODULE_FORMAT) | |
510 | ||
511 | AC_SUBST(TARGET_CFLAGS) | |
512 | AC_SUBST(TARGET_LDFLAGS) | |
513 | AC_SUBST(TARGET_CPPFLAGS) | |
514 | AC_SUBST(TARGET_CCASFLAGS) | |
515 | ||
516 | AC_SUBST(TARGET_IMG_LDSCRIPT) | |
517 | AC_SUBST(TARGET_IMG_LDFLAGS) | |
518 | AC_SUBST(TARGET_IMG_CFLAGS) | |
519 | AC_SUBST(TARGET_IMG_BASE_LDOPT) | |
520 | ||
521 | AC_SUBST(HOST_CFLAGS) | |
522 | AC_SUBST(HOST_LDFLAGS) | |
523 | AC_SUBST(HOST_CPPFLAGS) | |
524 | AC_SUBST(HOST_CCASFLAGS) | |
525 | ||
526 | # Set them to their new values for the tests below. | |
527 | CC="$TARGET_CC" | |
528 | if test "x$TARGET_APPLE_CC" = x1 ; then | |
529 | CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error" | |
530 | else | |
531 | CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error" | |
532 | fi | |
533 | CPPFLAGS="$TARGET_CPPFLAGS" | |
534 | LDFLAGS="$TARGET_LDFLAGS" | |
535 | LIBS=-lgcc | |
536 | ||
537 | grub_ASM_USCORE | |
538 | if test x$grub_cv_asm_uscore = xyes; then | |
539 | CFLAGS="$CFLAGS -Wl,--defsym,_abort=_main" | |
540 | else | |
541 | CFLAGS="$CFLAGS -Wl,--defsym,abort=main" | |
542 | fi | |
543 | ||
544 | # Check for libgcc symbols | |
545 | AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x) | |
546 | ||
547 | if test "x$TARGET_APPLE_CC" = x1 ; then | |
548 | CFLAGS="$TARGET_CFLAGS -nostdlib" | |
549 | else | |
550 | CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100" | |
551 | fi | |
552 | LIBS="" | |
553 | ||
554 | # Defined in aclocal.m4. | |
555 | grub_PROG_TARGET_CC | |
556 | if test "x$TARGET_APPLE_CC" != x1 ; then | |
557 | grub_PROG_OBJCOPY_ABSOLUTE | |
558 | fi | |
559 | grub_PROG_LD_BUILD_ID_NONE | |
560 | if test "x$target_cpu" = xi386; then | |
561 | if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then | |
562 | if test ! -z "$TARGET_IMG_LDSCRIPT"; then | |
563 | # Check symbols provided by linker script. | |
564 | CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100" | |
565 | fi | |
566 | grub_CHECK_BSS_START_SYMBOL | |
567 | grub_CHECK_END_SYMBOL | |
568 | fi | |
569 | CFLAGS="$TARGET_CFLAGS" | |
570 | grub_I386_ASM_PREFIX_REQUIREMENT | |
571 | grub_I386_ASM_ADDR32 | |
572 | grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK | |
573 | else | |
574 | AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug]) | |
575 | fi | |
576 | ||
577 | AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL) | |
578 | #define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1))) | |
579 | #else | |
580 | #define NESTED_FUNC_ATTR | |
581 | #endif]) | |
582 | ||
583 | AC_ARG_ENABLE([efiemu], | |
584 | [AS_HELP_STRING([--enable-efiemu], | |
585 | [build and install the efiemu runtimes (default=guessed)])]) | |
586 | if test x"$enable_efiemu" = xno ; then | |
587 | efiemu_excuse="explicitly disabled" | |
588 | fi | |
589 | if test x"$efiemu_excuse" = x ; then | |
590 | AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ | |
591 | CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib" | |
592 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
593 | [grub_cv_cc_efiemu=yes], | |
594 | [grub_cv_cc_efiemu=no]) | |
595 | ]) | |
596 | if test x$grub_cv_cc_efiemu = xno; then | |
597 | efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" | |
598 | fi | |
599 | fi | |
600 | if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then | |
601 | AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled]) | |
602 | fi | |
603 | if test x"$efiemu_excuse" = x ; then | |
604 | enable_efiemu=yes | |
605 | else | |
606 | enable_efiemu=no | |
607 | fi | |
608 | AC_SUBST([enable_efiemu]) | |
609 | ||
610 | if test "$platform" != emu; then | |
611 | AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [ | |
612 | SAVED_CPPFLAGS="$CPPFLAGS" | |
613 | CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" | |
614 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> | |
615 | int va_arg_func (int fixed, va_list args);]], [[]])], | |
616 | [grub_cv_cc_isystem=yes], | |
617 | [grub_cv_cc_isystem=no]) | |
618 | CPPFLAGS="$SAVED_CPPFLAGS" | |
619 | ]) | |
620 | ||
621 | if test x"$grub_cv_cc_isystem" = xyes ; then | |
622 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" | |
623 | fi | |
624 | fi | |
625 | ||
626 | # Restore the flags. | |
627 | CC="$tmp_CC" | |
628 | CFLAGS="$tmp_CFLAGS" | |
629 | CPPFLAGS="$tmp_CPPFLAGS" | |
630 | LDFLAGS="$tmp_LDFLAGS" | |
631 | LIBS="$tmp_LIBS" | |
632 | ||
633 | # | |
634 | # Check for options. | |
635 | # | |
636 | ||
637 | # Memory manager debugging. | |
638 | AC_ARG_ENABLE([mm-debug], | |
639 | AS_HELP_STRING([--enable-mm-debug], | |
640 | [include memory manager debugging]), | |
641 | [AC_DEFINE([MM_DEBUG], [1], | |
642 | [Define to 1 if you enable memory manager debugging.])]) | |
643 | ||
644 | AC_ARG_ENABLE([grub-emu-usb], | |
645 | [AS_HELP_STRING([--enable-grub-emu-usb], | |
646 | [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) | |
647 | ||
648 | AC_ARG_ENABLE([grub-emu-sdl], | |
649 | [AS_HELP_STRING([--enable-grub-emu-sdl], | |
650 | [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])]) | |
651 | ||
652 | AC_ARG_ENABLE([grub-emu-pci], | |
653 | [AS_HELP_STRING([--enable-grub-emu-pci], | |
654 | [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])]) | |
655 | ||
656 | if test "$platform" = emu; then | |
657 | missing_ncurses= | |
658 | [# Check for curses libraries.] | |
659 | AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"], | |
660 | [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"], | |
661 | [missing_ncurses=[true]])]) | |
662 | AC_SUBST([LIBCURSES]) | |
663 | [if [ x"$missing_ncurses" = x ]; then ] | |
664 | [# Check for headers.] | |
665 | AC_CHECK_HEADERS([ncurses/curses.h], [], | |
666 | [AC_CHECK_HEADERS([ncurses.h], [], | |
667 | [AC_CHECK_HEADERS([curses.h], [], | |
668 | [missing_ncurses=[true]])])]) | |
669 | [fi] | |
670 | if test x"$missing_ncurses" = xtrue ; then | |
671 | AC_MSG_ERROR([grub-emu can't be compiled without ncurses]) | |
672 | fi | |
673 | ||
674 | if test x"$enable_grub_emu_usb" = xno ; then | |
675 | grub_emu_usb_excuse="explicitly disabled" | |
676 | fi | |
677 | ||
678 | if test x"$enable_grub_emu_pci" = xyes ; then | |
679 | grub_emu_usb_excuse="conflicts with PCI support" | |
680 | fi | |
681 | ||
682 | [if [ x"$grub_emu_usb_excuse" = x ]; then | |
683 | # Check for libusb libraries.] | |
684 | AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], | |
685 | [grub_emu_usb_excuse=["need libusb library"]]) | |
686 | AC_SUBST([LIBUSB]) | |
687 | [fi] | |
688 | [if [ x"$grub_emu_usb_excuse" = x ]; then | |
689 | # Check for headers.] | |
690 | AC_CHECK_HEADERS([usb.h], [], | |
691 | [grub_emu_usb_excuse=["need libusb headers"]]) | |
692 | [fi] | |
693 | if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then | |
694 | AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled]) | |
695 | fi | |
696 | if test x"$grub_emu_usb_excuse" = x ; then | |
697 | enable_grub_emu_usb=yes | |
698 | else | |
699 | enable_grub_emu_usb=no | |
700 | fi | |
701 | ||
702 | if test x"$enable_grub_emu_sdl" = xno ; then | |
703 | grub_emu_sdl_excuse="explicitely disabled" | |
704 | fi | |
705 | [if [ x"$grub_emu_sdl_excuse" = x ]; then | |
706 | # Check for libSDL libraries.] | |
707 | AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"], | |
708 | [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]]) | |
709 | AC_SUBST([LIBSDL]) | |
710 | [fi] | |
711 | ||
712 | [if [ x"$grub_emu_sdl_excuse" = x ]; then | |
713 | # Check for headers.] | |
714 | AC_CHECK_HEADERS([SDL/SDL.h], [], | |
715 | [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]]) | |
716 | [fi] | |
717 | ||
718 | if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then | |
719 | AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled]) | |
720 | fi | |
721 | if test x"$grub_emu_sdl_excuse" = x ; then | |
722 | enable_grub_emu_sdl=yes | |
723 | else | |
724 | enable_grub_emu_sdl=no | |
725 | fi | |
726 | ||
727 | if test x"$enable_grub_emu_pci" != xyes ; then | |
728 | grub_emu_pci_excuse="not enabled" | |
729 | fi | |
730 | ||
731 | if test x"$enable_grub_emu_usb" = xyes ; then | |
732 | grub_emu_pci_excuse="conflicts with USB support" | |
733 | fi | |
734 | ||
735 | [if [ x"$grub_emu_pci_excuse" = x ]; then | |
736 | # Check for libpci libraries.] | |
737 | AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"], | |
738 | [grub_emu_pci_excuse=["need libpciaccess library"]]) | |
739 | AC_SUBST([LIBPCIACCESS]) | |
740 | [fi] | |
741 | [if [ x"$grub_emu_pci_excuse" = x ]; then | |
742 | # Check for headers.] | |
743 | AC_CHECK_HEADERS([pci/pci.h], [], | |
744 | [grub_emu_pci_excuse=["need libpciaccess headers"]]) | |
745 | [fi] | |
746 | ||
747 | if test x"$grub_emu_pci_excuse" = x ; then | |
748 | enable_grub_emu_pci=yes | |
749 | else | |
750 | ||
751 | enable_grub_emu_pci=no | |
752 | fi | |
753 | ||
754 | AC_SUBST([enable_grub_emu_sdl]) | |
755 | AC_SUBST([enable_grub_emu_usb]) | |
756 | AC_SUBST([enable_grub_emu_pci]) | |
757 | fi | |
758 | ||
759 | AC_ARG_ENABLE([grub-fstest], | |
760 | [AS_HELP_STRING([--enable-grub-fstest], | |
761 | [build and install the `grub-fstest' debugging utility (default=guessed)])]) | |
762 | if test x"$enable_grub_fstest" = xno ; then | |
763 | grub_fstest_excuse="explicitly disabled" | |
764 | fi | |
765 | if test x"$grub_fstest_excuse" = x ; then | |
766 | enable_grub_fstest=yes | |
767 | else | |
768 | enable_grub_fstest=no | |
769 | fi | |
770 | AC_SUBST([enable_grub_fstest]) | |
771 | ||
772 | AC_ARG_ENABLE([grub-mkfont], | |
773 | [AS_HELP_STRING([--enable-grub-mkfont], | |
774 | [build and install the `grub-mkfont' utility (default=guessed)])]) | |
775 | if test x"$enable_grub_mkfont" = xno ; then | |
776 | grub_mkfont_excuse="explicitly disabled" | |
777 | fi | |
778 | ||
779 | if test x"$grub_mkfont_excuse" = x ; then | |
780 | # Check for freetype libraries. | |
781 | AC_CHECK_PROGS([FREETYPE], [freetype-config]) | |
782 | if test "x$FREETYPE" = x ; then | |
783 | grub_mkfont_excuse=["need freetype2 library"] | |
784 | fi | |
785 | freetype_cflags=`freetype-config --cflags` | |
786 | freetype_libs=`freetype-config --libs` | |
787 | fi | |
788 | ||
789 | if test x"$grub_mkfont_excuse" = x ; then | |
790 | # Check for freetype libraries. | |
791 | SAVED_CPPFLAGS="$CPPFLAGS" | |
792 | CPPFLAGS="$CPPFLAGS $freetype_cflags" | |
793 | AC_CHECK_HEADERS([ft2build.h], [], | |
794 | [grub_mkfont_excuse=["need freetype2 headers"]]) | |
795 | CPPFLAGS="$SAVED_CPPFLAGS" | |
796 | fi | |
797 | ||
798 | if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then | |
799 | AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled]) | |
800 | fi | |
801 | if test x"$grub_mkfont_excuse" = x ; then | |
802 | enable_grub_mkfont=yes | |
803 | else | |
804 | enable_grub_mkfont=no | |
805 | fi | |
806 | AC_SUBST([enable_grub_mkfont]) | |
807 | AC_SUBST([freetype_cflags]) | |
808 | AC_SUBST([freetype_libs]) | |
809 | ||
810 | AC_ARG_ENABLE([device-mapper], | |
811 | [AS_HELP_STRING([--enable-device-mapper], | |
812 | [enable Linux device-mapper support (default=guessed)])]) | |
813 | if test x"$enable_device_mapper" = xno ; then | |
814 | device_mapper_excuse="explicitly disabled" | |
815 | fi | |
816 | ||
817 | if test x"$device_mapper_excuse" = x ; then | |
818 | # Check for device-mapper library. | |
819 | AC_CHECK_LIB([devmapper], [dm_task_create], | |
62f7d208 | 820 | [LIBDEVMAPPER="-ldevmapper" |
76ed06b9 BC |
821 | AC_DEFINE([HAVE_DEVICE_MAPPER], [1], |
822 | [Define to 1 if you have the devmapper library.])], | |
823 | [device_mapper_excuse="need devmapper library"]) | |
824 | fi | |
62f7d208 | 825 | AC_SUBST([LIBDEVMAPPER]) |
76ed06b9 | 826 | |
a184f9c8 | 827 | AC_CHECK_LIB([zfs], [libzfs_init], |
16c7cb32 | 828 | [LIBZFS="-lzfs" |
a184f9c8 RM |
829 | AC_DEFINE([HAVE_LIBZFS], [1], |
830 | [Define to 1 if you have the ZFS library.])],) | |
16c7cb32 BC |
831 | AC_SUBST([LIBZFS]) |
832 | ||
a184f9c8 | 833 | AC_CHECK_LIB([nvpair], [nvlist_print], |
16c7cb32 | 834 | [LIBNVPAIR="-lnvpair" |
a184f9c8 RM |
835 | AC_DEFINE([HAVE_LIBNVPAIR], [1], |
836 | [Define to 1 if you have the NVPAIR library.])],) | |
16c7cb32 BC |
837 | AC_SUBST([LIBNVPAIR]) |
838 | ||
76ed06b9 BC |
839 | pkglibrootdir='$(libdir)'/`echo $PACKAGE | sed "$program_transform_name"` |
840 | AC_SUBST(pkglibrootdir) | |
841 | ||
842 | AC_SUBST([FONT_SOURCE]) | |
843 | AS_IF([test x$target_cpu = xi386 -a x$platform = xpc], | |
844 | [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)]) | |
845 | AS_IF([test x$target_cpu = xi386 -a x$platform = xcoreboot], | |
846 | [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)]) | |
847 | AS_IF([test x$target_cpu = xi386 -a x$platform = xmultiboot], | |
848 | [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)]) | |
849 | AS_IF([test x$target_cpu = xmips -a x$platform = xyeeloong], | |
850 | [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x80200000)]) | |
851 | AS_IF([test x$target_cpu = xpowerpc -a x$platform = xieee1275], | |
852 | [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x200000)]) | |
853 | AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu], | |
854 | [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)]) | |
855 | AS_IF([test x$target_cpu = xi386 -a x$platform = xieee1275], | |
856 | [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x10000)]) | |
857 | AS_IF([test x$TARGET_APPLE_CC = x1], | |
858 | [AC_SUBST([USE_APPLE_CC_FIXES], yes)]) | |
859 | ||
860 | # | |
861 | # Automake conditionals | |
862 | # | |
8c411768 | 863 | |
76ed06b9 BC |
864 | AM_CONDITIONAL([COND_emu], [test x$platform = xemu]) |
865 | AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc]) | |
866 | AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi]) | |
867 | AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu]) | |
868 | AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275]) | |
869 | AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot]) | |
870 | AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot]) | |
871 | AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi]) | |
872 | AM_CONDITIONAL([COND_mips_yeeloong], [test x$target_cpu = xmips -a x$platform = xyeeloong]) | |
873 | AM_CONDITIONAL([COND_mips_qemu_mips], [test x$target_cpu = xmips -a x$platform = xqemu_mips]) | |
874 | AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275]) | |
875 | AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275]) | |
f7711f5e BC |
876 | |
877 | AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd]) | |
878 | AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux]) | |
879 | AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd]) | |
880 | AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows]) | |
881 | AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd]) | |
2d465fb0 | 882 | |
76ed06b9 BC |
883 | AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x]) |
884 | AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes]) | |
885 | AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes]) | |
886 | AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes]) | |
887 | AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes]) | |
888 | AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x]) | |
889 | AM_CONDITIONAL([COND_GRUB_FSTEST], [test x$enable_grub_fstest = xyes]) | |
890 | AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x]) | |
771111e5 | 891 | AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1]) |
76ed06b9 | 892 | AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes]) |
d3ff5a05 | 893 | |
a60f6ee1 | 894 | # Output files. |
6304d292 BC |
895 | grub_CHECK_LINK_DIR |
896 | if test x"$link_dir" = xyes ; then | |
897 | AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu]) | |
6304d292 BC |
898 | if test "$platform" != emu ; then |
899 | AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform]) | |
900 | fi | |
901 | else | |
902 | mkdir -p include/grub 2>/dev/null | |
903 | rm -rf include/grub/cpu | |
904 | cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null | |
6304d292 BC |
905 | if test "$platform" != emu ; then |
906 | rm -rf include/grub/machine | |
34980574 | 907 | cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null |
6304d292 BC |
908 | fi |
909 | fi | |
910 | ||
8c411768 | 911 | AC_CONFIG_FILES([Makefile]) |
6304d292 | 912 | AC_CONFIG_FILES([grub-core/Makefile]) |
8c411768 BC |
913 | AC_CONFIG_FILES([po/Makefile]) |
914 | AC_CONFIG_FILES([docs/Makefile]) | |
6a161fa9 | 915 | AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) |
8c411768 | 916 | |
6a161fa9 | 917 | AC_OUTPUT |
5ce5507f | 918 | [ |
919 | echo "*******************************************************" | |
920 | echo GRUB2 will be compiled with following components: | |
921 | echo Platform: "$target_cpu"-"$platform" | |
f84b481b | 922 | if [ x"$platform" = xemu ]; then |
5ce5507f | 923 | if [ x"$grub_emu_usb_excuse" = x ]; then |
924 | echo USB support for grub-emu: Yes | |
925 | else | |
926 | echo USB support for grub-emu: No "($grub_emu_usb_excuse)" | |
927 | fi | |
927d0134 VS |
928 | if [ x"$grub_emu_sdl_excuse" = x ]; then |
929 | echo SDL support for grub-emu: Yes | |
930 | else | |
931 | echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)" | |
932 | fi | |
325c8258 | 933 | if [ x"$grub_emu_pci_excuse" = x ]; then |
934 | echo PCI support for grub-emu: Yes | |
935 | else | |
936 | echo PCI support for grub-emu: No "($grub_emu_pci_excuse)" | |
937 | fi | |
f84b481b | 938 | fi |
5ce5507f | 939 | if [ x"$enable_mm_debug" = xyes ]; then |
940 | echo With memory debugging: Yes | |
941 | else | |
942 | echo With memory debugging: No | |
943 | fi | |
5ce5507f | 944 | if [ x"$efiemu_excuse" = x ]; then |
945 | echo efiemu runtime: Yes | |
946 | else | |
947 | echo efiemu runtime: No "($efiemu_excuse)" | |
948 | fi | |
949 | if [ x"$grub_fstest_excuse" = x ]; then | |
950 | echo grub-fstest: Yes | |
951 | else | |
952 | echo grub-fstest: No "($grub_fstest_excuse)" | |
953 | fi | |
954 | if [ x"$grub_mkfont_excuse" = x ]; then | |
955 | echo grub-mkfont: Yes | |
956 | else | |
957 | echo grub-mkfont: No "($grub_mkfont_excuse)" | |
958 | fi | |
959 | echo "*******************************************************" | |
960 | ] |