]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libobjc/configure.ac
Update copyright years.
[thirdparty/gcc.git] / libobjc / configure.ac
index 9c8aa829cd7bb66a67cceeb5c15608008f03f1f3..a0441908189be53748e8f11db01fb5326c1ed2e1 100644 (file)
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1994-2020 Free Software Foundation, Inc.
+#   Copyright (C) 1994-2024 Free Software Foundation, Inc.
 #   Originally contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GCC.
@@ -20,6 +20,7 @@
 
 AC_INIT(package-unused, version-unused,, libobjc)
 AC_CONFIG_SRCDIR([objc/objc.h])
+AC_CONFIG_MACRO_DIRS([../config] [..])
 GCC_TOPLEV_SUBDIRS
 
 # We need the following definitions because AC_PROG_LIBTOOL relies on them
@@ -147,17 +148,6 @@ m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
 
 # extra LD Flags which are required for targets
 ACX_LT_HOST_FLAGS
-case "${host}" in
-  *-darwin*)
-    # Darwin needs -single_module when linking libobjc
-    extra_ldflags_libobjc='$(lt_host_flags) -Wl,-single_module'
-    ;;
-  *-cygwin*|*-mingw*)
-    # Tell libtool to build DLLs on Windows
-    extra_ldflags_libobjc='$(lt_host_flags)'
-    ;;
-esac
-AC_SUBST(extra_ldflags_libobjc)
 
 # Add CET specific flags if CET is enabled
 GCC_CET_FLAGS(CET_FLAGS)
@@ -182,6 +172,31 @@ AM_PROG_CC_C_O
 
 AC_PROG_MAKE_SET
 
+AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes])
+
+# Must come after libtool is initialized.
+case "${host}" in
+  *-darwin[[4567]]*)
+    # Earlier Darwin versions need -single_module when linking libobjc; they
+    # do not support @rpath.
+    extra_ldflags_libobjc='$(lt_host_flags) -Wl,-single_module'
+    ;;
+  *-darwin*)
+    # Otherwise, single_module is the default and multi-module is ignored and
+    # obsolete.
+    extra_ldflags_libobjc='$(lt_host_flags)'
+    if test "x$enable_darwin_at_rpath" = "xyes"; then
+      extra_ldflags_libobjc="${extra_ldflags_libobjc} -Wc,-nodefaultrpaths"
+      extra_ldflags_libobjc="${extra_ldflags_libobjc} -Wl,-rpath,@loader_path"
+    fi
+    ;;
+  *-cygwin*|*-mingw*)
+    # Tell libtool to build DLLs on Windows
+    extra_ldflags_libobjc='$(lt_host_flags)'
+    ;;
+esac
+AC_SUBST(extra_ldflags_libobjc)
+
 # -------
 # Headers
 # -------