Ralf Wildenhues wrote:
Also, I wonder why you leave out CFLAGS and such, so why not check
against $compile_command?

To check against any in-between white space, you'd probably need expr,
as this (SPACE and TAB)

   case " $compile_command " in
   *" $framework_arg[      ]$arg "*) ;;
   *)..

may not be enough?


Okay?


Dunno either.

Hi Ralf,
You are right, of course. The original patch, by checking for CC and then removing the flag broke building of executables. When we build shared libraries we use CC, not compile_command. compile_command is okay and never gets duplicates, but if a flag is in CC and we recognise it and put it in compiler_flags, there is the possibility of it being duplicated on the link line.

Is this version okay & forward port? A space and a tab check is quite satisfactory for me, I don't see the need to go overboard here.

Oops looks like I need to fix indentation too. Please pretend that that is okay for now :)

Peter
Index: ChangeLog
2005-12-01  Peter O'Gorman  <[EMAIL PROTECTED]>

        * ltmain.in [darwin]: Don't add -framework. -arch, -isysroot
        to $compiler_flags if already in $CC with same arguments.

from  Ralf Wildenhues <[EMAIL PROTECTED]>
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 1 Dec 2005 15:54:17 -0000
@@ -1425,12 +1425,15 @@ EOF
        ;;
 
       -framework|-arch|-isysroot)
-        prev=darwin_framework
-        compiler_flags="$compiler_flags $arg"
-       compile_command="$compile_command $arg"
-       finalize_command="$finalize_command $arg"
+       case " $CC " in
+       *" ${arg} ${1} "* | *" ${arg}   ${1} "*)  ;;
+       *) compiler_flags="$compiler_flags $arg ${1}";;
+       esac
+        compile_command="$compile_command $arg ${1}"
+        finalize_command="$finalize_command $arg ${1}"
+       shift
         continue
-        ;;
+          ;;
 
       -inst-prefix-dir)
        prev=inst_prefix

Reply via email to