Skip to content
Snippets Groups Projects
Commit 4defe287 authored by Fred Wright's avatar Fred Wright Committed by Christopher Nielsen
Browse files

Makefile: Use C-based 'which' on Tiger.

Unlike the 10.5+ 'which' command, which is a C program, the
OS-supplied 10.4 version is a csh script, with some deficiencies.
Since 2019, legacy-support has been supplying a patched version
of the csh script correcting some, but not all, deficiencies.  In
particular, the replacement version doesn't implement the '-a'
option, without providing an informative error message.

This change replaces the patched csh script with a build of the
10.5 version.  For consistency, it has the same universality as
the Apple-supplied programs, regardless of whether legacy-support
is being built universal in general.  Specifically, it uses the
new binarchs tool to copy the architectures from /usr/bin/true,
since full universal builds don't work on 10.4 ppc.

TESTED:
Built and tested with all option combinations.
Tested the updated install target.
parent 3cb2d812
No related branches found
No related tags found
No related merge requests found
......@@ -177,8 +177,12 @@ MANTESTPRGS = $(MANTESTPRGS_C) $(MANTESTPRGS_CPP)
MANTESTRUNS := $(patsubst \
$(MANTESTPREFIX)%,$(MANRUNPREFIX)%,$(MANTESTPRGS))
TIGERBINDIR = tiger_only/bin
TIGERBINS := $(wildcard $(TIGERBINDIR)/*)
TIGERSRCDIR = tiger_only/src
TIGERSRCS := $(wildcard $(TIGERSRCDIR)/*.c)
TIGERPRGS := $(patsubst %.c,%,$(TIGERSRCS))
TOOLDIR = tools
ARCHTOOL = $(TOOLDIR)/binarchs.sh
define splitandfilterandmergemultiarch
output='$(1)' && \
......@@ -387,9 +391,10 @@ $(MANTESTOBJS_CPP): %.o: %.cpp $(ALLHEADERS)
$(MANTESTPRGS_CPP): %: %.o $(BUILDDLIBPATH)
$(CXX) $(TESTLDFLAGS) $< $(TESTLIBS) -o $@
# Dummy target for building Tiger-only binaries, so Portfile can
# reference it in case we need it in the future.
tiger-bins:
$(TIGERPRGS): %: %.c
$(CC) $$($(ARCHTOOL)) $< -o $@
tiger-bins: $(TIGERPRGS)
# Special clause for testing the cmath fix: Just need to verify that
# building succeeds or fails, not that the executable runs or what it
......@@ -491,8 +496,8 @@ install-syslib: $(BUILDSYSLIBPATH) | $(DESTDIR)$(LIBDIR)
install-slib: $(BUILDSLIBPATH) | $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) $(BUILDSLIBPATH) $(DESTDIR)$(LIBDIR)
install-tiger: $(TIGERBINS)
$(INSTALL_PROGRAM) $(TIGERBINS) $(DESTDIR)$(BINDIR)
install-tiger: $(TIGERPRGS)
$(INSTALL_PROGRAM) $(TIGERPRGS) $(DESTDIR)$(BINDIR)
test check: $(TESTRUNS) $(XTESTRUNS) test_cmath test_faccessat_setuid_msg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment