linux.370 hints: validate sysconf GDBPATH

With sys/unix/hints/linux.370, if GDBPATH doesn't exist, comment out
the GDBPATH line in sysconf during 'make install' or 'make update'.

[ macOS apparently uses sys/unix/hints/macosx.sh to do its sysconf manipulation,
so there is no corresponding change for sys/unix/hints/macOS.370 ]

Closes #1477
This commit is contained in:
nhmall
2026-01-15 17:02:38 -05:00
parent eed952a095
commit 8b6ba69fd8
2 changed files with 10 additions and 6 deletions

View File

@@ -440,6 +440,8 @@ update: $(PRECHECK) $(GAME) recover $(VARDAT) spec_levs sys/unix/sysconf
touch $(VARDIR)/perm $(VARDIR)/record
# sysconf, but only if it does not exist
true; $(SYSCONFENSURE)
# other steps from hints file
true; $(POSTUPDATE)
# and a reminder
@echo You may also want to install the man pages via the doc Makefile.

View File

@@ -390,13 +390,15 @@ endif #?WANT_SOURCE_INSTALL
INSTDIR=$(HACKDIR)
VARDIR = $(HACKDIR)
ifneq "$(CCISCLANG)" ""
# gdb may not be installed if clang is chosen compiler so the game
# won't start in that case due to a sysconf error. Comment out
# relevant lines in sysconf.
POSTINSTALL+= sed -i -e 's;^GDBPATH=/usr/bin/gdb;\#GDBPATH=/usr/bin/gdb;' \
ifdef MAKEFILE_TOP
TESTGDBPATH=/usr/bin/gdb
POSTINSTALL+= test -f $(TESTGDBPATH) || \
sed -i -e 's;^GDBPATH=/usr/bin/gdb;\#GDBPATH=/usr/bin/gdb;' \
-e 's;PANICTRACE_GDB=1;PANICTRACE_GDB=0;' $(INSTDIR)/sysconf;
endif
POSTUPDATE+= test -f $(TESTGDBPATH) || \
sed -i -e 's;^GDBPATH=/usr/bin/gdb;\#GDBPATH=/usr/bin/gdb;' \
-e 's;PANICTRACE_GDB=1;PANICTRACE_GDB=0;' $(INSTDIR)/sysconf;
endif #MAKEFILE_TOP
ifeq '$(USE_NONOSTATICFN)' '1'
CFLAGS += -DNONOSTATICFN