From 958ac86183c0b85071dc76eff373193e3122cc2a Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 12 Feb 2023 20:14:51 +0100 Subject: [PATCH] build: Misc configure.ac improvements, install-strip fix ups --- GNUmakefile.in | 24 ++++++++++-------------- configure.ac | 12 ++++++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index 7a624261..f30a1456 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -126,8 +126,8 @@ limine-enroll-config: clean: limine-bios-clean limine-uefi-ia32-clean limine-uefi-x86-64-clean limine-uefi-aarch64-clean rm -rf '$(call SHESCAPE,$(BINDIR))' '$(call SHESCAPE,$(BUILDDIR))/stage1.stamp' -.PHONY: install-data -install-data: all +.PHONY: install +install: all $(INSTALL) -d '$(call SHESCAPE,$(DESTDIR)$(ACDATAROOTDIR))' $(INSTALL) -d '$(call SHESCAPE,$(DESTDIR)$(ACDATAROOTDIR))/limine' ifeq ($(BUILD_BIOS),limine-bios) @@ -153,18 +153,6 @@ ifeq ($(BUILD_UEFI_IA32),limine-uefi-ia32) endif $(INSTALL) -d '$(call SHESCAPE,$(DESTDIR)$(ACINCLUDEDIR))' $(INSTALL_DATA) '$(call SHESCAPE,$(SRCDIR))/limine.h' '$(call SHESCAPE,$(DESTDIR)$(ACINCLUDEDIR))/' - -.PHONY: install-strip -install-strip: install-data - $(INSTALL) -d '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))' - $(INSTALL_PROGRAM) -s '$(call SHESCAPE,$(BINDIR))/limine-version' '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/' - $(INSTALL_PROGRAM) -s '$(call SHESCAPE,$(BINDIR))/limine-enroll-config' '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/' -ifneq ($(BUILD_LIMINE_DEPLOY),no) - $(INSTALL_PROGRAM) -s '$(call SHESCAPE,$(BINDIR))/limine-deploy' '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/' -endif - -.PHONY: install -install: install-data $(INSTALL) -d '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))' $(INSTALL_PROGRAM) '$(call SHESCAPE,$(BINDIR))/limine-version' '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/' $(INSTALL_PROGRAM) '$(call SHESCAPE,$(BINDIR))/limine-enroll-config' '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/' @@ -172,6 +160,14 @@ ifneq ($(BUILD_LIMINE_DEPLOY),no) $(INSTALL_PROGRAM) '$(call SHESCAPE,$(BINDIR))/limine-deploy' '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/' endif +.PHONY: install-strip +install-strip: install + @NATIVE_STRIP@ '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/limine-version' + @NATIVE_STRIP@ '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/limine-enroll-config' +ifneq ($(BUILD_LIMINE_DEPLOY),no) + @NATIVE_STRIP@ '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/limine-deploy' +endif + .PHONY: uninstall uninstall: rm -f '$(call SHESCAPE,$(DESTDIR)$(ACBINDIR))/limine-version' diff --git a/configure.ac b/configure.ac index 648a3434..279403a5 100644 --- a/configure.ac +++ b/configure.ac @@ -12,8 +12,12 @@ AC_SUBST(SRCDIR) AC_SUBST(BUILDDIR) test "x$CFLAGS" = "x" && CFLAGS='-g -O2 -pipe -Wall -Wextra' + +AC_LANG(C) AC_PROG_CC +AC_CHECK_HEADERS([stdint.h stddef.h stdbool.h limits.h inttypes.h stdio.h stdlib.h string.h]) + werror_state="no" AC_ARG_ENABLE([werror], AS_HELP_STRING([--enable-werror], [treat warnings as errors]), @@ -41,6 +45,14 @@ if ! test "x$FIND_FOUND" = "xyes"; then AC_MSG_ERROR([find not found, please install find before configuring]) fi +NATIVE_STRIP="$($CC -dumpmachine)"-strip +AC_CHECK_PROG([NATIVE_STRIP_FOUND], $NATIVE_STRIP, [yes]) +if ! test "x$NATIVE_STRIP_FOUND" = "xyes"; then + NATIVE_STRIP=strip +fi + +AC_SUBST(NATIVE_STRIP) + rm -rf "$BUILDDIR/cross-files" BUILD_ALL="no"