2020-01-09 17:33:38 +00:00
|
|
|
AC_INIT([sbsigntool], [0.9.3], [James.Bottomley@HansenPartnership.com])
|
2012-05-24 07:14:28 +00:00
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE()
|
|
|
|
|
|
|
|
AC_PREREQ(2.60)
|
|
|
|
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2012-08-13 06:54:12 +00:00
|
|
|
AC_CONFIG_SRCDIR(src/sbsign.c)
|
2012-05-24 07:14:28 +00:00
|
|
|
|
2012-06-13 06:23:26 +00:00
|
|
|
AM_PROG_AS
|
2012-05-24 07:14:28 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_RANLIB
|
2012-06-11 06:37:33 +00:00
|
|
|
AC_PROG_MKDIR_P
|
2012-05-24 07:14:28 +00:00
|
|
|
|
2012-06-13 06:23:26 +00:00
|
|
|
AC_CHECK_TOOL(OBJCOPY, [objcopy])
|
|
|
|
AC_CHECK_TOOL(STRIP, [strip])
|
|
|
|
|
2012-06-20 03:59:32 +00:00
|
|
|
AC_CHECK_HEADER([bfd.h], [],
|
|
|
|
AC_MSG_ERROR([bfd.h not found.]
|
|
|
|
[bfd.h is usually distributed in a binutils development package.]))
|
|
|
|
|
2012-05-24 07:14:28 +00:00
|
|
|
if test $cross_compiling = no; then
|
|
|
|
AM_MISSING_PROG(HELP2MAN, help2man)
|
|
|
|
else
|
|
|
|
HELP2MAN=:
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([build system endianness])
|
|
|
|
AC_PREPROC_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <endian.h>]],
|
|
|
|
[[#if __BYTE_ORDER != __LITTLE_ENDIAN]]
|
|
|
|
[[#error]]
|
|
|
|
[[#endif]])],
|
|
|
|
endian=little
|
|
|
|
little_endian=1
|
|
|
|
big_endian=0)
|
|
|
|
|
|
|
|
AC_PREPROC_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <endian.h>]],
|
|
|
|
[[#if __BYTE_ORDER != __BIG_ENDIAN]]
|
|
|
|
[[#error]]
|
|
|
|
[[#endif]])],
|
|
|
|
endian=big
|
|
|
|
little_endian=0
|
|
|
|
big_endian=1)
|
|
|
|
|
|
|
|
|
|
|
|
if test x"$endian" != "xbig" -a x"$endian" != "xlittle"; then
|
|
|
|
AC_MSG_ERROR([Can't determine endianness; is endian.h present?])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($endian)
|
|
|
|
AC_DEFINE_UNQUOTED(HAVE_LITTLE_ENDIAN, $little_endian, [Little-endian system])
|
|
|
|
AC_DEFINE_UNQUOTED(HAVE_BIG_ENDIAN, $big_endian, [Big-endian system])
|
|
|
|
|
|
|
|
PKG_PROG_PKG_CONFIG()
|
|
|
|
PKG_CHECK_MODULES(libcrypto, libcrypto,
|
|
|
|
[],
|
|
|
|
AC_MSG_ERROR([libcrypto (from the OpenSSL package) is required]))
|
|
|
|
|
2012-07-31 01:34:37 +00:00
|
|
|
PKG_CHECK_MODULES(uuid, uuid,
|
|
|
|
[],
|
|
|
|
AC_MSG_ERROR([libuuid (from the uuid package) is required]))
|
|
|
|
|
|
|
|
dnl gnu-efi headers require extra include dirs
|
2016-02-12 23:46:44 +00:00
|
|
|
EFI_ARCH=$(uname -m | sed 's/i.86/ia32/;s/arm.*/arm/')
|
2017-10-19 16:20:42 +00:00
|
|
|
AM_CONDITIONAL(TEST_BINARY_FORMAT, [ test "$EFI_ARCH" = "arm" -o "$EFI_ARCH" = "aarch64" ])
|
|
|
|
|
|
|
|
##
|
|
|
|
# no consistent view of where gnu-efi should dump the efi stuff, so find it
|
|
|
|
##
|
2018-02-20 19:42:15 +00:00
|
|
|
for path in /lib /lib64 /usr/lib /usr/lib64 /usr/lib32 /lib/efi /lib64/efi /usr/lib/efi /usr/lib64/efi /usr/lib/gnuefi /usr/lib64/gnuefi ; do
|
2017-10-19 16:20:42 +00:00
|
|
|
if test -e $path/crt0-efi-$EFI_ARCH.o; then
|
|
|
|
CRTPATH=$path
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test -z "$CRTPATH"; then
|
|
|
|
AC_MSG_ERROR([cannot find the gnu-efi crt path])
|
|
|
|
fi
|
|
|
|
|
2012-07-31 01:34:37 +00:00
|
|
|
EFI_CPPFLAGS="-I/usr/include/efi -I/usr/include/efi/$EFI_ARCH \
|
|
|
|
-DEFI_FUNCTION_WRAPPER"
|
|
|
|
CPPFLAGS_save="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $EFI_CPPFLAGS"
|
|
|
|
AC_CHECK_HEADERS([efi.h], [], [], $EFI_INCLUDES)
|
|
|
|
CPPFLAGS="$CPPFLAGS_save"
|
|
|
|
AC_SUBST(EFI_CPPFLAGS, $EFI_CPPFLAGS)
|
2017-10-19 16:20:42 +00:00
|
|
|
AC_SUBST(EFI_ARCH, $EFI_ARCH)
|
|
|
|
AC_SUBST(CRTPATH, $CRTPATH)
|
2012-07-31 01:34:37 +00:00
|
|
|
|
2012-08-13 06:54:12 +00:00
|
|
|
AC_CONFIG_FILES([Makefile src/Makefile lib/ccan/Makefile]
|
|
|
|
[docs/Makefile tests/Makefile])
|
2012-05-24 07:14:28 +00:00
|
|
|
AC_OUTPUT
|