[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
don't add -isysroot to compiler flags if already in $CC
From: |
Peter O'Gorman |
Subject: |
don't add -isysroot to compiler flags if already in $CC |
Date: |
Tue, 29 Nov 2005 00:43:44 +0900 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Macintosh/20050317) |
Hi,
I had been telling those who asked for years to put -arch flags etc in
CC/CXX env vars before calling configure. My recent -isysroot patch broke
the ability to do that, apple's linker rather stupidly dies on some
duplicate arguments. The only arg I really *need* to eliminate dups of is
-isysroot, but hey!
Okay?
Peter
Index: ChangeLog
2005-11-28 Peter O'Gorman <address@hidden>
* ltmain.in [darwin]: Don't add -framework. -arch, -isysroot
to $compiler_flags if already in $CC with same arguments.
from Ralf Wildenhues <address@hidden>
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.107
diff -u -3 -p -u -r1.334.2.107 ltmain.in
--- ltmain.in 28 Nov 2005 12:41:41 -0000 1.334.2.107
+++ ltmain.in 28 Nov 2005 15:39:44 -0000
@@ -1425,12 +1425,16 @@ EOF
;;
-framework|-arch|-isysroot)
- prev=darwin_framework
- compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
+ case "$CC" in
+ *"${arg} ${1}"*) shift; continue ;;
+ *)
+ prev=darwin_framework
+ compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ continue
+ ;;
+ esac ;;
-inst-prefix-dir)
prev=inst_prefix
Index: ChangeLog
2005-11-28 Peter O'Gorman <address@hidden>
* libltdl/config/ltmain.m4sh [osf1,darwin]: Don't add -model,
-arch, -isysroot to $compiler_flags if already in $CC with same
arguments.
Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.21
diff -u -3 -p -u -r1.21 ltmain.m4sh
--- libltdl/config/ltmain.m4sh 25 Nov 2005 18:13:53 -0000 1.21
+++ libltdl/config/ltmain.m4sh 28 Nov 2005 15:37:49 -0000
@@ -2644,12 +2644,18 @@ func_mode_link ()
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
-model|-arch|-isysroot)
- compile_command="$compile_command $arg"
- compiler_flags="$compiler_flags $arg"
- finalize_command="$finalize_command $arg"
- prev=xcompiler
- continue
- ;;
+ # if the flag is already in CC discard it and its argument
+ # and continue.
+ case "$CC" in
+ *"${arg} ${1}"*) shift; continue;;
+ *)
+ compile_command="$compile_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ finalize_command="$finalize_command $arg"
+ prev=xcompiler
+ continue
+ ;;
+ esac ;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
compiler_flags="$compiler_flags $arg"
- don't add -isysroot to compiler flags if already in $CC,
Peter O'Gorman <=