build: 'install' portability fixes

This commit is contained in:
mintsuki 2022-01-22 03:46:48 +01:00
parent e616f19347
commit a0a8b3c0d6
8 changed files with 35 additions and 25 deletions

View File

@ -73,6 +73,9 @@ jobs:
- name: Copy LICENSE to bin - name: Copy LICENSE to bin
run: cp LICENSE.md build/bin/ run: cp LICENSE.md build/bin/
- name: Copy install-sh to bin
run: cp install-sh build/bin/
- name: Push binaries to binary branch - name: Push binaries to binary branch
run: | run: |
git config user.name 'mintsuki' git config user.name 'mintsuki'

1
.gitignore vendored
View File

@ -22,6 +22,7 @@ stivale
test_image test_image
!stage23/font.bin !stage23/font.bin
configure configure
install-sh
*~ *~
config.status config.status
config.log config.log

View File

@ -30,6 +30,9 @@ CC := @CC@
endif endif
export CC export CC
INSTALL ?= @INSTALL@
export INSTALL
CFLAGS ?= @CFLAGS@ CFLAGS ?= @CFLAGS@
export CFLAGS export CFLAGS
@ -205,24 +208,24 @@ clean: limine-bios-clean limine-uefi32-clean limine-uefi64-clean
.PHONY: install-data .PHONY: install-data
install-data: install-data:
install -d '$(DESTDIR)$(PREFIX)/share' $(INSTALL) -d '$(DESTDIR)$(PREFIX)/share'
install -d '$(DESTDIR)$(PREFIX)/share/limine' $(INSTALL) -d '$(DESTDIR)$(PREFIX)/share/limine'
install -m 644 '$(call SHESCAPE,$(BINDIR))/limine.sys' '$(DESTDIR)$(PREFIX)/share/limine/' || true $(INSTALL) -m 644 '$(call SHESCAPE,$(BINDIR))/limine.sys' '$(DESTDIR)$(PREFIX)/share/limine/' || true
install -m 644 '$(call SHESCAPE,$(BINDIR))/limine-cd.bin' '$(DESTDIR)$(PREFIX)/share/limine/' || true $(INSTALL) -m 644 '$(call SHESCAPE,$(BINDIR))/limine-cd.bin' '$(DESTDIR)$(PREFIX)/share/limine/' || true
install -m 644 '$(call SHESCAPE,$(BINDIR))/limine-eltorito-efi.bin' '$(DESTDIR)$(PREFIX)/share/limine/' || true $(INSTALL) -m 644 '$(call SHESCAPE,$(BINDIR))/limine-eltorito-efi.bin' '$(DESTDIR)$(PREFIX)/share/limine/' || true
install -m 644 '$(call SHESCAPE,$(BINDIR))/limine-pxe.bin' '$(DESTDIR)$(PREFIX)/share/limine/' || true $(INSTALL) -m 644 '$(call SHESCAPE,$(BINDIR))/limine-pxe.bin' '$(DESTDIR)$(PREFIX)/share/limine/' || true
install -m 644 '$(call SHESCAPE,$(BINDIR))/BOOTX64.EFI' '$(DESTDIR)$(PREFIX)/share/limine/' || true $(INSTALL) -m 644 '$(call SHESCAPE,$(BINDIR))/BOOTX64.EFI' '$(DESTDIR)$(PREFIX)/share/limine/' || true
install -m 644 '$(call SHESCAPE,$(BINDIR))/BOOTIA32.EFI' '$(DESTDIR)$(PREFIX)/share/limine/' || true $(INSTALL) -m 644 '$(call SHESCAPE,$(BINDIR))/BOOTIA32.EFI' '$(DESTDIR)$(PREFIX)/share/limine/' || true
.PHONY: install-strip .PHONY: install-strip
install-strip: install-data install-strip: install-data
install -d '$(DESTDIR)$(PREFIX)/bin' $(INSTALL) -d '$(DESTDIR)$(PREFIX)/bin'
install -s '$(call SHESCAPE,$(BINDIR))/limine-install' '$(DESTDIR)$(PREFIX)/bin/' || true $(INSTALL) -s '$(call SHESCAPE,$(BINDIR))/limine-install' '$(DESTDIR)$(PREFIX)/bin/' || true
.PHONY: install .PHONY: install
install: install-data install: install-data
install -d '$(DESTDIR)$(PREFIX)/bin' $(INSTALL) -d '$(DESTDIR)$(PREFIX)/bin'
install '$(call SHESCAPE,$(BINDIR))/limine-install' '$(DESTDIR)$(PREFIX)/bin/' || true $(INSTALL) '$(call SHESCAPE,$(BINDIR))/limine-install' '$(DESTDIR)$(PREFIX)/bin/' || true
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:
@ -301,7 +304,7 @@ distclean: clean
.PHONY: maintainer-clean .PHONY: maintainer-clean
maintainer-clean: distclean maintainer-clean: distclean
cd '$(call SHESCAPE,$(SRCDIR))' && rm -rf stivale reduced-gnu-efi configure *'~' autom4te.cache *.tar.xz cd '$(call SHESCAPE,$(SRCDIR))' && rm -rf stivale reduced-gnu-efi configure install-sh *'~' autom4te.cache *.tar.xz
.PHONY: stage23-uefi64 .PHONY: stage23-uefi64
stage23-uefi64: $(call MKESCAPE,$(SRCDIR))/stivale stage23-uefi64: $(call MKESCAPE,$(SRCDIR))/stivale

View File

@ -91,7 +91,7 @@ paragraph, or `gcc` or `llvm/clang` must also be installed, alongside
### Configure ### Configure
If checking out from the repository, run `./autogen.sh` (GNU autoconf required), If checking out from the repository, run `./autogen.sh` (GNU automake and GNU autoconf required),
else, if using a release tarball, run `./configure` directly. else, if using a release tarball, run `./configure` directly.
Both `./autogen.sh` and `./configure` take arguments and environment variables; Both `./autogen.sh` and `./configure` take arguments and environment variables;

View File

@ -12,6 +12,7 @@ cd "$srcdir"
[ -d stivale ] || git clone https://github.com/stivale/stivale.git [ -d stivale ] || git clone https://github.com/stivale/stivale.git
[ -d reduced-gnu-efi ] || git clone https://github.com/limine-bootloader/reduced-gnu-efi.git [ -d reduced-gnu-efi ] || git clone https://github.com/limine-bootloader/reduced-gnu-efi.git
automake --add-missing || true
autoconf autoconf
cd "$origdir" cd "$origdir"

View File

@ -5,6 +5,7 @@ AC_PREREQ(2.69)
AC_SUBST(limine_version, m4_esyscmd([./version.sh])) AC_SUBST(limine_version, m4_esyscmd([./version.sh]))
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL
AC_ARG_VAR(TOOLCHAIN, [Alternative toolchain prefix [limine]]) AC_ARG_VAR(TOOLCHAIN, [Alternative toolchain prefix [limine]])
test "x$TOOLCHAIN" = "x" && TOOLCHAIN='limine' test "x$TOOLCHAIN" = "x" && TOOLCHAIN='limine'

View File

@ -1,4 +1,5 @@
CC ?= cc CC ?= cc
INSTALL ?= ./install-sh
PREFIX ?= /usr/local PREFIX ?= /usr/local
DESTDIR ?= DESTDIR ?=
@ -10,16 +11,16 @@ all: limine-install
.PHONY: install .PHONY: install
install: all install: all
install -d '$(DESTDIR)$(PREFIX)/bin' $(INSTALL) -d '$(DESTDIR)$(PREFIX)/bin'
install -s limine-install '$(DESTDIR)$(PREFIX)/bin/' $(INSTALL) -s limine-install '$(DESTDIR)$(PREFIX)/bin/'
install -d '$(DESTDIR)$(PREFIX)/share' $(INSTALL) -d '$(DESTDIR)$(PREFIX)/share'
install -d '$(DESTDIR)$(PREFIX)/share/limine' $(INSTALL) -d '$(DESTDIR)$(PREFIX)/share/limine'
install -m 644 limine.sys '$(DESTDIR)$(PREFIX)/share/limine/' $(INSTALL) -m 644 limine.sys '$(DESTDIR)$(PREFIX)/share/limine/'
install -m 644 limine-cd.bin '$(DESTDIR)$(PREFIX)/share/limine/' $(INSTALL) -m 644 limine-cd.bin '$(DESTDIR)$(PREFIX)/share/limine/'
install -m 644 limine-eltorito-efi.bin '$(DESTDIR)$(PREFIX)/share/limine/' $(INSTALL) -m 644 limine-eltorito-efi.bin '$(DESTDIR)$(PREFIX)/share/limine/'
install -m 644 limine-pxe.bin '$(DESTDIR)$(PREFIX)/share/limine/' $(INSTALL) -m 644 limine-pxe.bin '$(DESTDIR)$(PREFIX)/share/limine/'
install -m 644 BOOTX64.EFI '$(DESTDIR)$(PREFIX)/share/limine/' $(INSTALL) -m 644 BOOTX64.EFI '$(DESTDIR)$(PREFIX)/share/limine/'
install -m 644 BOOTIA32.EFI '$(DESTDIR)$(PREFIX)/share/limine/' $(INSTALL) -m 644 BOOTIA32.EFI '$(DESTDIR)$(PREFIX)/share/limine/'
.PHONY: clean .PHONY: clean
clean: clean:

View File

@ -67,7 +67,7 @@ cd gcc-$GCCVERSION
sed 's|http://gcc.gnu|https://gcc.gnu|g' < contrib/download_prerequisites > dp.sed sed 's|http://gcc.gnu|https://gcc.gnu|g' < contrib/download_prerequisites > dp.sed
mv dp.sed contrib/download_prerequisites mv dp.sed contrib/download_prerequisites
chmod +x contrib/download_prerequisites chmod +x contrib/download_prerequisites
contrib/download_prerequisites --no-verify ./contrib/download_prerequisites --no-verify
cd .. cd ..
mkdir build-gcc mkdir build-gcc
cd build-gcc cd build-gcc