]>
Commit | Line | Data |
---|---|---|
6a161fa9 | 1 | # Process this file with autoconf to produce a configure script. |
2 | ||
1e901a75 | 3 | # Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. |
6a161fa9 | 4 | # |
5 | # This configure.ac is free software; the author | |
6 | # gives unlimited permission to copy and/or distribute it, | |
7 | # with or without modifications, as long as this notice is preserved. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
12 | # PARTICULAR PURPOSE. | |
13 | ||
b977bf01 | 14 | dnl This configure script is complicated, because GRUB needs to deal |
15 | dnl with three potentially different types: | |
16 | dnl | |
17 | dnl build -- the environment for building GRUB | |
18 | dnl host -- the environment for running utilities | |
19 | dnl target -- the environment for running GRUB | |
20 | dnl | |
21 | dnl In addition, GRUB needs to deal with a platform specification | |
22 | dnl which specifies the system running GRUB, such as firmware. | |
23 | dnl This is necessary because the target type in autoconf does not | |
24 | dnl describe such a system very well. | |
25 | dnl | |
26 | dnl The current strategy is to use variables with no prefix (such as | |
27 | dnl CC, CFLAGS, etc.) for the host type as well as the build type, | |
28 | dnl because GRUB does not need to use those variables for the build | |
29 | dnl type, so there is no conflict. Variables with the prefix "TARGET_" | |
30 | dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target | |
31 | dnl type. | |
32 | ||
33 | ||
eb73121d | 34 | AC_INIT([GRUB],[1.96],[bug-grub@gnu.org]) |
46e04eb9 | 35 | AC_PREREQ(2.59) |
4b13b216 | 36 | AC_CONFIG_SRCDIR([include/grub/dl.h]) |
6a161fa9 | 37 | AC_CONFIG_HEADER([config.h]) |
38 | ||
b977bf01 | 39 | # Checks for host and target systems. |
6a161fa9 | 40 | AC_CANONICAL_HOST |
b977bf01 | 41 | AC_CANONICAL_TARGET |
6a161fa9 | 42 | |
1d543c3e | 43 | # Program name transformations |
44 | AC_ARG_PROGRAM | |
45 | ||
6a161fa9 | 46 | case "$host_cpu" in |
b977bf01 | 47 | powerpc64) host_m32=1 ;; |
48 | esac | |
49 | ||
50 | case "$target_cpu" in | |
51 | i[[3456]]86) target_cpu=i386 ;; | |
6a161fa9 | 52 | esac |
53 | ||
05568c2e | 54 | # Specify the platform (such as firmware). |
55 | AC_ARG_WITH([platform], | |
56 | AS_HELP_STRING([--with-platform=PLATFORM], | |
83b984de | 57 | [select the host platform [[guessed]]])) |
05568c2e | 58 | |
59 | # Guess the platform if not specified. | |
60 | if test "x$with_platform" = x; then | |
b977bf01 | 61 | case "$target_cpu"-"$target_vendor" in |
05568c2e | 62 | i386-apple) platform=efi ;; |
63 | i386-*) platform=pc ;; | |
58393a2d | 64 | x86_64-apple) platform=efi ;; |
737feb35 | 65 | x86_64-*) platform=pc ;; |
05568c2e | 66 | powerpc-*) platform=ieee1275 ;; |
58393a2d | 67 | powerpc64-*) platform=ieee1275 ;; |
05568c2e | 68 | sparc64-*) platform=ieee1275 ;; |
58393a2d | 69 | *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;; |
05568c2e | 70 | esac |
71 | else | |
72 | platform="$with_platform" | |
73 | fi | |
74 | ||
58393a2d | 75 | # Adjust CPU unless target was explicitly specified. |
76 | if test -z "$target_alias"; then | |
77 | case "$target_cpu"-"$platform" in | |
78 | x86_64-efi) ;; | |
3f4ce737 | 79 | x86_64-*) target_cpu=i386 ;; |
80 | powerpc64-ieee1275) target_cpu=powerpc ;; | |
20011694 | 81 | esac |
82 | fi | |
83 | ||
58393a2d | 84 | # Check if the platform is supported, make final adjustments. |
b977bf01 | 85 | case "$target_cpu"-"$platform" in |
05568c2e | 86 | i386-efi) ;; |
3f4ce737 | 87 | x86_64-efi) ;; |
05568c2e | 88 | i386-pc) ;; |
546f966a | 89 | i386-coreboot) ;; |
58393a2d | 90 | i386-linuxbios) platform=coreboot ;; |
3d04eab8 | 91 | i386-ieee1275) ;; |
05568c2e | 92 | powerpc-ieee1275) ;; |
93 | sparc64-ieee1275) ;; | |
58393a2d | 94 | *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; |
6a161fa9 | 95 | esac |
96 | ||
3f4ce737 | 97 | case "$target_cpu" in |
98 | i386 | powerpc) target_m32=1 ;; | |
99 | x86_64 | sparc64) target_m64=1 ;; | |
100 | esac | |
101 | ||
6e5a42fe | 102 | case "$host_os" in |
103 | mingw32) host_os=cygwin ;; | |
104 | esac | |
105 | ||
56978920 | 106 | AC_SUBST(host_cpu) |
107 | AC_SUBST(host_os) | |
6e5a42fe | 108 | |
b977bf01 | 109 | AC_SUBST(target_cpu) |
05568c2e | 110 | AC_SUBST(platform) |
6a161fa9 | 111 | |
b977bf01 | 112 | # |
113 | # Checks for build programs. | |
114 | # | |
144f1f98 | 115 | |
6c826348 | 116 | # Although cmp is listed in the GNU Coding Standards as a command which |
117 | # can used directly, OpenBSD lacks cmp in the default installation. | |
118 | AC_CHECK_PROGS([CMP], [cmp]) | |
119 | if test "x$CMP" = x; then | |
120 | AC_MSG_ERROR([cmp is not found]) | |
121 | fi | |
122 | ||
144f1f98 | 123 | AC_CHECK_PROGS([YACC], [bison]) |
1569ec51 | 124 | if test "x$YACC" = x; then |
6c826348 | 125 | AC_MSG_ERROR([bison is not found]) |
1569ec51 | 126 | fi |
127 | ||
1e901a75 | 128 | for file in /usr/src/unifont.bdf ; do |
4931827f | 129 | if test -e $file ; then |
1e901a75 | 130 | AC_SUBST([UNIFONT_BDF], [$file]) |
4931827f | 131 | break |
132 | fi | |
133 | done | |
134 | ||
b977bf01 | 135 | AC_PROG_INSTALL |
136 | AC_PROG_AWK | |
137 | AC_PROG_MAKE_SET | |
138 | ||
68807e5f | 139 | # These are not a "must". |
b977bf01 | 140 | AC_PATH_PROG(RUBY, ruby) |
68807e5f | 141 | AC_PATH_PROG(HELP2MAN, help2man) |
6a161fa9 | 142 | |
b977bf01 | 143 | # |
144 | # Checks for host programs. | |
145 | # | |
146 | ||
147 | AC_PROG_CC | |
6a161fa9 | 148 | # Must be GCC. |
149 | test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required]) | |
150 | ||
4889bdec | 151 | AC_GNU_SOURCE |
b977bf01 | 152 | AC_SYS_LARGEFILE |
153 | ||
154 | # Identify characteristics of the host architecture. | |
155 | AC_C_BIGENDIAN | |
156 | AC_CHECK_SIZEOF(void *) | |
157 | AC_CHECK_SIZEOF(long) | |
158 | ||
159 | if test "x$host_m32" = x1; then | |
160 | # Force 32-bit mode. | |
161 | CFLAGS="$CFLAGS -m32" | |
162 | LDFLAGS="$LDFLAGS -m32" | |
163 | fi | |
164 | ||
165 | # Check LZO when compiling for the i386-pc. | |
166 | if test "$target_cpu"-"$platform" = i386-pc; then | |
aa24b516 | 167 | AC_ARG_ENABLE([lzo], |
168 | [AS_HELP_STRING([--enable-lzo], | |
169 | [use lzo to compress kernel (default is lzma)])]) | |
170 | [if [ x"$enable_lzo" = xyes ]; then | |
171 | # There are three possibilities. LZO version 2 installed with the name | |
172 | # liblzo2, with the name liblzo, and LZO version 1.] | |
173 | AC_DEFINE([ENABLE_LZO], [1], [Use lzo compression]) | |
174 | AC_CHECK_LIB([lzo2], [__lzo_init_v2], [LIBLZO="-llzo2"], | |
175 | [AC_CHECK_LIB([lzo], [__lzo_init_v2], [LIBLZO="-llzo"], | |
176 | [AC_CHECK_LIB([lzo], [__lzo_init2], [LIBLZO="-llzo"], | |
177 | [AC_MSG_ERROR([LZO library version 1.02 or later is required])])])]) | |
178 | AC_SUBST([LIBLZO]) | |
179 | [LIBS="$LIBS $LIBLZO"] | |
180 | AC_CHECK_FUNC([lzo1x_999_compress], , | |
b977bf01 | 181 | [AC_MSG_ERROR([LZO1X-999 must be enabled])]) |
182 | ||
aa24b516 | 183 | [# LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.] |
184 | AC_CHECK_HEADERS([lzo/lzo1x.h lzo1x.h]) | |
185 | [else] | |
186 | AC_DEFINE([ENABLE_LZMA], [1], [Use lzma compression]) | |
187 | [fi] | |
188 | AC_SUBST([enable_lzo]) | |
b977bf01 | 189 | fi |
190 | ||
4889bdec | 191 | # Check for functions. |
6e5a42fe | 192 | AC_CHECK_FUNCS(posix_memalign memalign asprintf) |
4889bdec | 193 | |
b977bf01 | 194 | # |
195 | # Check for target programs. | |
196 | # | |
197 | ||
2a8a80e4 | 198 | |
199 | # Use linker script if present, otherwise use builtin -N script. | |
200 | AC_MSG_CHECKING([for option to link raw image]) | |
56978920 | 201 | if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then |
202 | TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" | |
2a8a80e4 | 203 | TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" |
56978920 | 204 | TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" |
2a8a80e4 | 205 | else |
206 | TARGET_IMG_LDSCRIPT= | |
207 | TARGET_IMG_LDFLAGS='-Wl,-N' | |
208 | TARGET_IMG_LDFLAGS_AC='-Wl,-N' | |
209 | fi | |
210 | AC_SUBST(TARGET_IMG_LDSCRIPT) | |
211 | AC_SUBST(TARGET_IMG_LDFLAGS) | |
212 | AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) | |
213 | ||
214 | # For platforms where ELF is not the default link format. | |
215 | AC_MSG_CHECKING([for command to convert module to ELF format]) | |
56978920 | 216 | case "${host_os}" in |
217 | cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; | |
2d05bc6a | 218 | *) ;; |
219 | esac | |
2a8a80e4 | 220 | AC_SUBST(TARGET_OBJ2ELF) |
221 | AC_MSG_RESULT([$TARGET_OBJ2ELF]) | |
222 | ||
b977bf01 | 223 | # For cross-compiling. |
580b2a0f | 224 | if test "x$build" != "x$host"; then |
b977bf01 | 225 | # XXX this depends on the implementation of autoconf! |
226 | tmp_ac_tool_prefix="$ac_tool_prefix" | |
227 | ac_tool_prefix=$target_alias- | |
228 | ||
229 | AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc], | |
230 | [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])]) | |
231 | AC_CHECK_TOOL(OBJCOPY, objcopy) | |
232 | AC_CHECK_TOOL(STRIP, strip) | |
233 | AC_CHECK_TOOL(NM, nm) | |
234 | ||
235 | ac_tool_prefix="$tmp_ac_tool_prefix" | |
236 | else | |
237 | if test "x$TARGET_CC" = x; then | |
238 | TARGET_CC=$CC | |
239 | fi | |
240 | AC_CHECK_TOOL(OBJCOPY, objcopy) | |
241 | AC_CHECK_TOOL(STRIP, strip) | |
242 | AC_CHECK_TOOL(NM, nm) | |
243 | fi | |
244 | AC_SUBST(TARGET_CC) | |
245 | ||
246 | ||
247 | # Test the C compiler for the target environment. | |
248 | tmp_CC="$CC" | |
249 | tmp_CFLAGS="$CFLAGS" | |
250 | tmp_LDFLAGS="$LDFLAGS" | |
251 | tmp_CPPFLAGS="$CPPFLAGS" | |
aa6d7826 | 252 | tmp_LIBS="$LIBS" |
b977bf01 | 253 | CC="$TARGET_CC" |
254 | CFLAGS="$TARGET_CFLAGS" | |
255 | CPPFLAGS="$TARGET_CPPFLAGS" | |
256 | LDFLAGS="$TARGET_LDFLAGS" | |
aa6d7826 | 257 | LIBS="" |
b977bf01 | 258 | |
259 | if test "x$TARGET_CFLAGS" = x; then | |
6a161fa9 | 260 | # debug flags. |
b977bf01 | 261 | TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \ |
262 | -Wundef -Wstrict-prototypes -g" | |
6a161fa9 | 263 | |
264 | # optimization flags. | |
322562ea | 265 | AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [ |
6a161fa9 | 266 | CFLAGS=-Os |
eb73121d | 267 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
268 | [grub_cv_cc_Os=yes], | |
269 | [grub_cv_cc_Os=no]) | |
6a161fa9 | 270 | ]) |
322562ea | 271 | if test "x$grub_cv_cc_Os" = xyes; then |
b977bf01 | 272 | TARGET_CFLAGS="$TARGET_CFLAGS -Os" |
6a161fa9 | 273 | else |
b977bf01 | 274 | TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops" |
6a161fa9 | 275 | fi |
276 | ||
277 | # Force no alignment to save space on i386. | |
b977bf01 | 278 | if test "x$target_cpu" = xi386; then |
322562ea | 279 | AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ |
6a161fa9 | 280 | CFLAGS="-falign-loops=1" |
eb73121d | 281 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
282 | [grub_cv_cc_falign_loop=yes], | |
283 | [grub_cv_cc_falign_loop=no]) | |
6a161fa9 | 284 | ]) |
285 | ||
322562ea | 286 | if test "x$grub_cv_cc_falign_loop" = xyes; then |
b977bf01 | 287 | TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" |
6a161fa9 | 288 | else |
b977bf01 | 289 | TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" |
6a161fa9 | 290 | fi |
291 | fi | |
b977bf01 | 292 | fi |
6a161fa9 | 293 | |
b977bf01 | 294 | if test "x$target_m32" = x1; then |
295 | # Force 32-bit mode. | |
296 | TARGET_CFLAGS="$TARGET_CFLAGS -m32" | |
297 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" | |
6a161fa9 | 298 | fi |
b977bf01 | 299 | |
20011694 | 300 | if test "x$target_m64" = x1; then |
301 | # Force 64-bit mode. | |
7e9ca17a | 302 | TARGET_CFLAGS="$TARGET_CFLAGS -m64" |
303 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" | |
304 | fi | |
305 | ||
306 | if test "$target_cpu"-"$platform" = x86_64-efi; then | |
307 | # Use large model to support 4G memory | |
6e09b8b7 | 308 | AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ |
309 | CFLAGS="-m64 -mcmodel=large" | |
310 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
311 | [grub_cv_cc_mcmodel=yes], | |
312 | [grub_cv_cc_mcmodel=no]) | |
313 | ]) | |
7e9ca17a | 314 | if test "x$grub_cv_cc_no_mcmodel" = xno; then |
6e09b8b7 | 315 | AC_MSG_ERROR([-mcmodel=large not supported, upgrade your gcc]) |
316 | fi | |
7e9ca17a | 317 | |
318 | # EFI writes to stack below %rsp, we must not use the red zone | |
319 | AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ | |
320 | CFLAGS="-m64 -mno-red-zone" | |
321 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
322 | [grub_cv_cc_no_red_zone=yes], | |
323 | [grub_cv_cc_no_red_zone=no]) | |
324 | ]) | |
325 | if test "x$grub_cv_cc_no_red_zone" = xno; then | |
326 | AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc]) | |
327 | fi | |
328 | ||
329 | TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large -mno-red-zone" | |
20011694 | 330 | fi |
331 | ||
baa2a121 | 332 | # |
333 | # Compiler features. | |
334 | # | |
335 | ||
9035dce4 | 336 | # Need __enable_execute_stack() for nested function trampolines? |
337 | grub_CHECK_ENABLE_EXECUTE_STACK | |
338 | ||
baa2a121 | 339 | # Smashing stack protector. |
340 | grub_CHECK_STACK_PROTECTOR | |
c3db8364 | 341 | # Need that, because some distributions ship compilers that include |
baa2a121 | 342 | # `-fstack-protector' in the default specs. |
c3db8364 | 343 | if test "x$ssp_possible" = xyes; then |
344 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" | |
345 | fi | |
2a8a80e4 | 346 | grub_CHECK_STACK_ARG_PROBE |
347 | # Cygwin's GCC uses alloca() to probe the stackframe on static | |
348 | # stack allocations above some threshold. | |
349 | if test x"$sap_possible" = xyes; then | |
350 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" | |
351 | fi | |
baa2a121 | 352 | |
b977bf01 | 353 | AC_SUBST(TARGET_CFLAGS) |
354 | AC_SUBST(TARGET_CPPFLAGS) | |
355 | AC_SUBST(TARGET_LDFLAGS) | |
cb71ba20 | 356 | AC_SUBST(MODULE_LDFLAGS) |
6a161fa9 | 357 | |
aa6d7826 | 358 | # Set them to their new values for the tests below. |
359 | CC="$TARGET_CC" | |
360 | CFLAGS="$TARGET_CFLAGS" | |
361 | CPPFLAGS="$TARGET_CPPFLAGS" | |
362 | LDFLAGS="$TARGET_LDFLAGS" | |
363 | ||
6a161fa9 | 364 | # Defined in aclocal.m4. |
f6130a12 | 365 | grub_PROG_TARGET_CC |
b977bf01 | 366 | grub_PROG_OBJCOPY_ABSOLUTE |
cb71ba20 | 367 | grub_PROG_LD_BUILD_ID_NONE |
4b13b216 | 368 | grub_ASM_USCORE |
b977bf01 | 369 | if test "x$target_cpu" = xi386; then |
2a8a80e4 | 370 | if test ! -z "$TARGET_IMG_LDSCRIPT"; then |
371 | # Check symbols provided by linker script. | |
372 | CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" | |
373 | fi | |
7810e747 | 374 | if test "x$platform" = xpc; then |
2a8a80e4 | 375 | grub_CHECK_START_SYMBOL |
376 | grub_CHECK_BSS_START_SYMBOL | |
377 | grub_CHECK_END_SYMBOL | |
378 | fi | |
379 | CFLAGS="$TARGET_CFLAGS" | |
4b13b216 | 380 | grub_I386_ASM_PREFIX_REQUIREMENT |
381 | grub_I386_ASM_ADDR32 | |
382 | grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK | |
383 | grub_I386_CHECK_REGPARM_BUG | |
5aded270 | 384 | else |
f4917dfd | 385 | AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug]) |
6a161fa9 | 386 | fi |
387 | ||
c9a86192 | 388 | # Restore the flags. |
9962ed99 | 389 | CC="$tmp_CC" |
390 | CFLAGS="$tmp_CFLAGS" | |
391 | CPPFLAGS="$tmp_CPPFLAGS" | |
c9a86192 | 392 | LDFLAGS="$tmp_LDFLAGS" |
aa6d7826 | 393 | LIBS="$tmp_LIBS" |
6a161fa9 | 394 | |
4fe9862e | 395 | # |
2965c7cc | 396 | # Check for options. |
4fe9862e | 397 | # |
398 | ||
399 | # Memory manager debugging. | |
2965c7cc | 400 | AC_ARG_ENABLE([mm-debug], |
401 | AS_HELP_STRING([--enable-mm-debug], | |
90ce5d56 | 402 | [include memory manager debugging]), |
2965c7cc | 403 | [AC_DEFINE([MM_DEBUG], [1], |
404 | [Define to 1 if you enable memory manager debugging.])]) | |
405 | ||
4fe9862e | 406 | AC_ARG_ENABLE([grub-emu], |
407 | [AS_HELP_STRING([--enable-grub-emu], | |
408 | [build and install the `grub-emu' debugging utility])]) | |
d64399b5 | 409 | AC_ARG_ENABLE([grub-emu-usb], |
410 | [AS_HELP_STRING([--enable-grub-emu-usb], | |
411 | [build and install the `grub-emu' debugging utility with USB support])]) | |
4fe9862e | 412 | [if [ x"$enable_grub_emu" = xyes ]; then |
413 | # Check for curses libraries.] | |
414 | AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"], | |
415 | [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"], | |
416 | [AC_MSG_ERROR([(n)curses libraries are required to build `grub-emu'])])]) | |
417 | AC_SUBST([LIBCURSES]) | |
418 | ||
419 | [# Check for headers.] | |
420 | AC_CHECK_HEADERS([ncurses/curses.h], [], | |
421 | [AC_CHECK_HEADERS([ncurses.h], [], | |
422 | [AC_CHECK_HEADERS([curses.h], [], | |
423 | [AC_MSG_ERROR([(n)curses header files are required to build `grub-emu'])])])]) | |
d64399b5 | 424 | |
425 | [if [ x"$enable_grub_emu_usb" = xyes ]; then | |
426 | # Check for libusb libraries.] | |
427 | AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], | |
428 | [AC_MSG_ERROR([libusb libraries are required to build `grub-emu' with USB support])]) | |
429 | AC_SUBST([LIBUSB]) | |
430 | ||
431 | [# Check for headers.] | |
432 | AC_CHECK_HEADERS([usb.h], [], | |
433 | [AC_MSG_ERROR([libusb header file is required to build `grub-emu' with USB support])]) | |
434 | [fi] | |
4fe9862e | 435 | [fi] |
436 | AC_SUBST([enable_grub_emu]) | |
d64399b5 | 437 | AC_SUBST([enable_grub_emu_usb]) |
4fe9862e | 438 | |
99fadbaa | 439 | AC_ARG_ENABLE([grub-fstest], |
440 | [AS_HELP_STRING([--enable-grub-fstest], | |
441 | [build and install the `grub-fstest' debugging utility])]) | |
442 | AC_SUBST([enable_grub_fstest]) | |
443 | ||
2d05bc6a | 444 | AC_ARG_ENABLE([grub-pe2elf], |
445 | [AS_HELP_STRING([--enable-grub-pe2elf], | |
446 | [build and install the `grub-pe2elf' conversion utility])]) | |
447 | AC_SUBST([enable_grub_pe2elf]) | |
448 | ||
e52db1f7 | 449 | AC_ARG_ENABLE([grub-mkfont], |
450 | [AS_HELP_STRING([--enable-grub-mkfont], | |
451 | [build and install the `grub-mkfont' utility])]) | |
452 | if test x"$enable_grub_mkfont" = xyes ; then | |
453 | # Check for freetype libraries. | |
454 | AC_CHECK_PROGS([FREETYPE], [freetype-config]) | |
455 | if test "x$FREETYPE" = x ; then | |
456 | AC_MSG_ERROR([freetype2 libraries are required to build `grub-mkfont']) | |
457 | fi | |
458 | freetype_cflags=`freetype-config --cflags` | |
459 | freetype_libs=`freetype-config --libs` | |
460 | fi | |
461 | AC_SUBST([enable_grub_mkfont]) | |
462 | AC_SUBST([freetype_cflags]) | |
463 | AC_SUBST([freetype_libs]) | |
464 | ||
6a161fa9 | 465 | # Output files. |
b977bf01 | 466 | AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu |
467 | include/grub/machine:include/grub/$target_cpu/$platform]) | |
7b455f4d | 468 | AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh]) |
6a161fa9 | 469 | AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) |
470 | AC_OUTPUT |