]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
clean up OSX and DSYMUTIL rules so that they work
authorAlan T. DeKok <aland@freeradius.org>
Sun, 14 Dec 2025 16:02:24 +0000 (11:02 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 14 Dec 2025 16:16:42 +0000 (11:16 -0500)
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

scripts/boiler.mk
scripts/libtool.mk

index 9309386bf876c887f004d29d245c73e4efceb17d..327b7c7aca32eb7fac6818d2d2f6b51968b4b5a1 100644 (file)
@@ -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
 
index e2bec208f91876dd360ac06dab650fbd83617b1d..25a18c035538f9fd1706d4d24d1f57909d5f06bd 100644 (file)
@@ -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)