From 35560d99100133f41e9e0c18d7eea3554b966d10 Mon Sep 17 00:00:00 2001 From: Blady Date: Thu, 31 Aug 2017 10:40:20 +0200 Subject: [PATCH] macOS / Darwin: Restore previous LDFLAGS value and prevent multiple -Wl expansion for last gcc version. --- configure | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 1a30876ec..fdd11a408 100755 --- a/configure +++ b/configure @@ -2127,7 +2127,7 @@ fi BUILD_SHARED=yes fi SO_OPTS="-Wl,-undefined,dynamic_lookup -dynamiclib -Wl,-dylib_install_name," - LDFLAGS="-Wl,-framework,Cocoa" + LDFLAGS="-Wl,-framework,Cocoa $LDFLAGS" TARGET_LFLAGS="-Wl,-framework,Cocoa" ;; # ??? The following case has been introduced because of an elaboration @@ -3615,14 +3615,17 @@ $as_echo "yes" >&6; } fi - + gcc_version=$($CC --version | head -1) value=$GTK_CFLAGS # Special handling on darwin for gcc 4.5 and 4.7 case "$build_os" in *darwin*) - value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + case $gcc_version in + *4.5* | *4.7*) + value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + esac esac output=GTK_CFLAGS_GPR @@ -3648,7 +3651,10 @@ $as_echo "yes" >&6; } # Special handling on darwin for gcc 4.5 and 4.7 case "$build_os" in *darwin*) - value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + case $gcc_version in + *4.5* | *4.7*) + value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + esac esac output=GTK_LIBS_GPR @@ -3864,7 +3870,10 @@ $as_echo "$have_MesaGL_pthread" >&6; } # Special handling on darwin for gcc 4.5 and 4.7 case "$build_os" in *darwin*) - value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + case $gcc_version in + *4.5* | *4.7*) + value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + esac esac output=GL_LIBS_GPR @@ -3884,7 +3893,10 @@ $as_echo "$have_MesaGL_pthread" >&6; } # Special handling on darwin for gcc 4.5 and 4.7 case "$build_os" in *darwin*) - value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + case $gcc_version in + *4.5* | *4.7*) + value=`echo $value | sed -e "s/-framework \([^ ]*\)/-Wl,-framework -Wl,\1/g"` + esac esac output=GL_CFLAGS_GPR