diff options
author | Kay Sievers <kay@vrfy.org> | 2013-08-22 12:22:29 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-08-22 12:22:29 +0200 |
commit | 6feb7d971f79e88ed395637390d58404fba5f3c3 (patch) | |
tree | c8936bd79cc0587993016990b134a78cf9e20451 | |
parent | 27e720fbefc113a66cdfac79e03d89fd22517805 (diff) |
build-sys: move EFI_LIB_DIR, EFI_INC_DIR, EFI_LDS_DIR to AC_ARG_WITH()
-rw-r--r-- | Makefile.am | 13 | ||||
-rw-r--r-- | configure.ac | 36 |
2 files changed, 30 insertions, 19 deletions
diff --git a/Makefile.am b/Makefile.am index 46ba519..b32dc76 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,12 +75,11 @@ CLEANFILES += man/gummiboot.8 efi_loadername = gummiboot$(MACHINE_TYPE_NAME).efi efi_sources = src/efi/gummiboot.c -EFI_INCDIR = /usr/include efi_cppflags = \ $(EFI_CPPFLAGS) \ -I$(top_builddir) -include config.h \ - -I$(EFI_INCDIR)/efi \ - -I$(EFI_INCDIR)/efi/$(ARCH) \ + -I$(EFI_INC_DIR)/efi \ + -I$(EFI_INC_DIR)/efi/$(ARCH) \ -DMACHINE_TYPE_NAME=\"$(MACHINE_TYPE_NAME)\" efi_cflags = \ @@ -108,13 +107,13 @@ endif efi_ldflags = \ $(EFI_LDLAGS) \ - -T $(GNUEFI_LDS_DIR)/elf_$(ARCH)_efi.lds \ + -T $(EFI_LDS_DIR)/elf_$(ARCH)_efi.lds \ -shared \ -Bsymbolic \ -nostdlib \ -znocombreloc \ - $(GNUEFI_LIBS) \ - $(GNUEFI_LDS_DIR)/crt0-efi-$(ARCH).o + -L $(EFI_LIB_DIR) \ + $(EFI_LDS_DIR)/crt0-efi-$(ARCH).o efi_objects = $(addprefix $(top_builddir)/,$(efi_sources:.c=.o)) efi_solib = $(top_builddir)/src/efi/gummiboot.so @@ -126,7 +125,7 @@ EXTRA_DIST += $(efi_sources) $(top_builddir)/src/efi/%.o: $(top_srcdir)/src/efi/%.c @$(MKDIR_P) $(top_builddir)/src/efi/ - $(AM_V_CC)$(GNUEFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ + $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ $(efi_solib): $(efi_objects) $(AM_V_CCLD)$(LD) $(efi_ldflags) $(efi_objects) \ diff --git a/configure.ac b/configure.ac index a9c9e44..dc45add 100644 --- a/configure.ac +++ b/configure.ac @@ -37,8 +37,8 @@ AC_SYS_LARGEFILE AC_PROG_CC dnl Don't try to use things like -std=c99 for efi compilation -GNUEFI_CC=$CC -AC_SUBST([GNUEFI_CC]) +EFI_CC=$CC +AC_SUBST([EFI_CC]) AC_PROG_CC_C99 AM_PROG_CC_C_O @@ -81,15 +81,25 @@ AC_CHECK_HEADER(efi/${ARCH}/efibind.h, [], [AC_MSG_ERROR([*** GNU EFI header efibind.h not found])]) efiroot=$(echo $(cd /usr/lib/$(gcc -print-multi-os-directory); pwd)) -GNUEFI_LIBS="-L $efiroot" +EFI_LIB_DIR="$efiroot" +AC_ARG_WITH(efi-libdir, + AS_HELP_STRING([--with-efi-libdir=PATH], [Path to efi lib directory]), + [EFI_LIB_DIR="$withval"], [EFI_LIB_DIR="$efiroot"] +) +AC_SUBST([EFI_LIB_DIR]) dnl extra objects and linker scripts -GNUEFI_LDS_DIR="$efiroot" -if test -d "${efiroot}/gnuefi"; then - GNUEFI_LDS_DIR="${efiroot}/gnuefi" -fi -AC_SUBST([GNUEFI_LIBS]) -AC_SUBST([GNUEFI_LDS_DIR]) +AC_ARG_WITH(efi-ldsdir, + AS_HELP_STRING([--with-efi-ldsdir=PATH], [Path to efi lds directory]), + [EFI_LDS_DIR="$withval"], [EFI_LDS_DIR="${efiroot}/gnuefi"] +) +AC_SUBST([EFI_LDS_DIR]) + +AC_ARG_WITH(efi-includedir, + AS_HELP_STRING([--with-efi-includedir=PATH], [Path to efi include directory]), + [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"] +) +AC_SUBST([EFI_INC_DIR]) # ------------------------------------------------------------------------------ AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support])) @@ -122,12 +132,14 @@ AC_OUTPUT AC_MSG_RESULT([ $PACKAGE_NAME $VERSION + prefix: ${prefix} arch: $ARCH EFI machine type: $MACHINE_TYPE_NAME - prefix: ${prefix} - efi libs: ${GNUEFI_LIBS} - efi lds: ${GNUEFI_LDS_DIR} + EFI libdir: ${EFI_LIB_DIR} + EFI ldsdir: ${EFI_LDS_DIR} + EFI includedir: ${EFI_INC_DIR} + blkid: ${have_blkid} man pages: ${have_manpages} |