2 # This file is part of gummiboot.
4 # Copyright (C) 2013 Karel Zak <kzak@redhat.com>
6 # gummiboot is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU Lesser General Public License as published by
8 # the Free Software Foundation; either version 2.1 of the License, or
9 # (at your option) any later version.
11 # gummiboot is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public License
17 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
21 [systemd-devel@lists.freedesktop.org],
23 [http://freedesktop.org/wiki/Software/gummiboot])
25 AC_CONFIG_SRCDIR([src/setup/setup.c])
26 AC_CONFIG_MACRO_DIR([m4])
27 AC_CONFIG_HEADERS([config.h])
28 AC_CONFIG_AUX_DIR([build-aux])
29 AC_PREFIX_DEFAULT([/usr])
31 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
32 AM_SILENT_RULES([yes])
39 dnl Don't try to use things like -std=c99 for efi compilation
45 AC_PROG_GCC_TRADITIONAL
48 AC_PATH_PROG([XSLTPROC], [xsltproc])
50 dnl Define ARCH_<NAME> conditionals
52 SET_ARCH(X86_64, x86_64*)
55 ARCH=`echo $host | sed "s/\(-\).*$//"`
57 AM_COND_IF(ARCH_IA32, [
59 MACHINE_TYPE_NAME=ia32])
61 AM_COND_IF(ARCH_X86_64, [
62 MACHINE_TYPE_NAME=x64])
65 AC_SUBST([MACHINE_TYPE_NAME])
67 # QEMU and OVMF UEFI firmware
68 AS_IF([test x"$cross_compiling" = "xyes"], [], [
69 AC_PATH_PROG([QEMU], [qemu-system-x86_64])
70 AC_CHECK_FILE([/usr/share/qemu/bios-ovmf.bin], [QEMU_BIOS=/usr/share/qemu/bios-ovmf.bin])
71 AC_CHECK_FILE([/usr/share/qemu-ovmf/bios.bin], [QEMU_BIOS=/usr/share/qemu-ovmf/bios.bin])
75 # ------------------------------------------------------------------------------
76 dnl GNU EFI doesn't use relative paths: efi.h includes efibind.h which is in
77 dnl ${ARCH} relative to efi.h. I can't find a way to get AC_CHECK_HEADERS to
78 dnl add -I/usr/include/efi/${ARCH} to the conftest.c build. So, just test for
79 dnl efibind.h as the chances of efi.h not existing if it does are very low.
80 AC_CHECK_HEADER(efi/${ARCH}/efibind.h, [],
81 [AC_MSG_ERROR([*** GNU EFI header efibind.h not found])])
83 efiroot=$(echo $(cd /usr/lib/$(gcc -print-multi-os-directory); pwd))
84 EFI_LIB_DIR="$efiroot"
85 AC_ARG_WITH(efi-libdir,
86 AS_HELP_STRING([--with-efi-libdir=PATH], [Path to efi lib directory]),
87 [EFI_LIB_DIR="$withval"], [EFI_LIB_DIR="$efiroot"]
89 AC_SUBST([EFI_LIB_DIR])
91 dnl extra objects and linker scripts
92 AC_ARG_WITH(efi-ldsdir,
93 AS_HELP_STRING([--with-efi-ldsdir=PATH], [Path to efi lds directory]),
94 [EFI_LDS_DIR="$withval"],
96 for EFI_LDS_DIR in "${efiroot}/gnuefi" "${efiroot}"; do
97 for lds in ${EFI_LDS_DIR}/elf_${ARCH}_efi.lds; do
98 test -f ${lds} && break 2
103 AC_SUBST([EFI_LDS_DIR])
105 AC_ARG_WITH(efi-includedir,
106 AS_HELP_STRING([--with-efi-includedir=PATH], [Path to efi include directory]),
107 [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
109 AC_SUBST([EFI_INC_DIR])
111 # ------------------------------------------------------------------------------
112 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
113 if test "x$enable_blkid" != "xno"; then
114 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
115 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
116 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
117 AC_MSG_ERROR([*** blkid support requested but libraries not found])
120 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
122 # ------------------------------------------------------------------------------
124 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
125 AS_IF([test "x$enable_manpages" != xno], [
126 AS_IF([test "x$enable_manpages" = xyes -a "x$XSLTPROC" = x], [
127 AC_MSG_ERROR([*** Manpages requested but xsltproc not found])
129 AS_IF([test "x$XSLTPROC" != x], [have_manpages=yes])
131 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
133 # ------------------------------------------------------------------------------
140 $PACKAGE_NAME $VERSION
144 EFI machine type: $MACHINE_TYPE_NAME
146 EFI libdir: ${EFI_LIB_DIR}
147 EFI ldsdir: ${EFI_LDS_DIR}
148 EFI includedir: ${EFI_INC_DIR}
151 man pages: ${have_manpages}
154 QEMU OVMF: ${QEMU_BIOS}