From: Alan T. DeKok Date: Sun, 14 Dec 2025 16:02:24 +0000 (-0500) Subject: clean up OSX and DSYMUTIL rules so that they work X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97f0961e7057a4248555d97cd7569980c03107bb;p=thirdparty%2Ffreeradius-server.git clean up OSX and DSYMUTIL rules so that they work for now, we just define "DSYMTUL=touch" on platforms which don't have it. There isn't enough time right now to fight with GNU make and inline "if" checks in evaluated rules --- diff --git a/scripts/boiler.mk b/scripts/boiler.mk index 9309386bf87..327b7c7aca3 100644 --- a/scripts/boiler.mk +++ b/scripts/boiler.mk @@ -250,7 +250,8 @@ define ADD_TARGET_RULE.exe $(Q)$(ECHO) LINK $${${1}_BUILD}/${1} $(Q)$${${1}_LINKER} -o $${${1}_BUILD}/${1} $${RPATH_FLAGS} $${LDFLAGS} \ $${${1}_LDFLAGS} $${${1}_OBJS} $${${1}_PRLIBS} \ - $${LDLIBS} $${${1}_LDLIBS} + $${LDLIBS} $${${1}_LDLIBS} ${OSX_LDFLAGS} + ${Q}$(DSYMUTIL) $${${1}_BUILD}/${1} $(Q)$${${1}_POSTMAKE} ifneq "${ANALYZE.c}" "" @@ -465,25 +466,6 @@ define INCLUDE_SUBMAKEFILE $${TGT}_CHECK_HEADERS := $${TGT_CHECK_HEADERS} $${TGT}_CHECK_LIBS := $${TGT_CHECK_LIBS} - # - # OSX does lazy linking by default. We want to over-ride that for binaries. - # That way we catch errors at compile time, and not at run time. - # - ifneq "$(findstring apple-darwin,$(TARGET_SYSTEM))" "" - ifeq "$${$${TGT}_SUFFIX}" ".${TARGET_EXE_EXT}" - $${TGT}_LDFLAGS += -Wl,-undefined -Wl,error - ifneq "$(DSYMUTL)" "" - $${TGT}_POSTMAKE := $(DSYMUTL) $${$${TGT}_BUILD}/$${TGT} - endif - endif - - ifeq "$${$${TGT}_SUFFIX}" ".la" - ifneq "$(DSYMUTL)" "" - $${TGT}_POSTMAKE := $(DSYMUTL) $${$${TGT}_BUILD}/$$(patsubst %.la,%.dylib,$${TGT}) - endif - endif - endif - else # The values defined by this makefile apply to the the "current" target # as determined by which target is at the top of the stack. @@ -716,10 +698,26 @@ CPP = cc -E LINK.c = ${CC} LINK.cxx = ${CXX} -ifneq "$(AC_HAVEBACKTRACE)" "" +ifneq "$(AC_HAVE_BACKTRACE)" "" DSYMUTIL = $(shell which dsymutil) endif +ifeq "$(DSYMUTIL)" "" + DSYMUTIL := echo +endif + +# +# OSX does lazy linking by default. We want to over-ride that for all binaries. +# That way we catch errors at compile time, and not at run time. +# +# We also add "-w" to suppress warnings. Because -undefined,error is supported, +# but deprecated. +# +ifneq "$(findstring apple-darwin,$(TARGET_SYSTEM))" "" + OSX_LDFLAGS += -w -Wl,-undefined -Wl,error +endif + + # Set ECHO to "true" for *very* quiet builds ECHO = echo diff --git a/scripts/libtool.mk b/scripts/libtool.mk index e2bec208f91..25a18c03553 100644 --- a/scripts/libtool.mk +++ b/scripts/libtool.mk @@ -152,6 +152,7 @@ define ADD_TARGET_RULE.la $(Q)$${${1}_LINKER} -o $${${1}_BUILD}/${1} $${RPATH_FLAGS} $${LDFLAGS} \ $${${1}_LDFLAGS} $${${1}_OBJS} $${LDLIBS} $${${1}_LDLIBS} \ $${${1}_PRLIBS} + ${Q}$(DSYMUTIL) $${${1}_BUILD}/.libs/$$(patsubst %.la,%.dylib,${1}) $(Q)$${${1}_POSTMAKE} ifneq "${ANALYZE.c}" "" @@ -243,7 +244,8 @@ define ADD_LOCAL_RULE.exe $(Q)$(strip mkdir -p $${${1}_BUILD}/${LOCAL}/) $(Q)$${${1}_LINKER} -o $${${1}_BUILD}/$${LOCAL}${1} $${LOCAL_FLAGS} $${LDFLAGS} \ $${${1}_LDFLAGS} $${${1}_OBJS} $${${1}_LOCAL_PRLIBS} \ - $${LDLIBS} $${${1}_LDLIBS} + $${LDLIBS} $${${1}_LDLIBS} ${OSX_LDFLAGS} + ${Q}$(DSYMUTIL) $${${1}_BUILD}/$${${1}_LOCAL} $(Q)$${${1}_POSTMAKE} .PHONY: $(DIR)