]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
run dsymutil if we have it and libbacktrace
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Jul 2025 13:29:04 +0000 (09:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Jul 2025 14:35:22 +0000 (10:35 -0400)
scripts/boiler.mk

index e0315f346bd43f6120ffa83f093a71e7c9fc9761..4a8604a14f64ec4c70c2d187ab5b5480e7cd5b5c 100644 (file)
@@ -458,20 +458,32 @@ define INCLUDE_SUBMAKEFILE
             # needs to be made smarter to filter out the duplicates, or we need to find a way of
             # doing it here.
 #           $${TGT}_LDLIBS += $$(filter-out %.a %.la %.${TARGET_LIB_EXT},$${$${TGT_PREREQS}_LDLIBS})
-
-            #
-            #  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))" ""
-                $${TGT}_LDFLAGS += -Wl,-undefined -Wl,error
-            endif
         endif
 
         $${TGT}_BUILD := $$(if $$(suffix $${TGT}),$${BUILD_DIR}/lib,$${BUILD_DIR}/bin)
         $${TGT}_MAKEFILES += ${1}
         $${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 := dsymutil $${$${TGT}_BUILD}/$${TGT}
+            endif
+          endif
+
+          ifeq "$${$${TGT}_SUFFIX}" ".la"
+            ifneq "$(DSYMUTL)" ""
+              $${TGT}_POSTMAKE := dsymutil $${$${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.
@@ -704,6 +716,10 @@ CPP = cc -E
 LINK.c = ${CC}
 LINK.cxx = ${CXX}
 
+ifneq "$(AC_HAVEBACKTRACE)" ""
+  DSYMUTIL = $(shell which dsymutil)
+endif
+
 # Set ECHO to "true" for *very* quiet builds
 ECHO = echo