libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: darwin/Fortran: -single_module


From: Ralf Wildenhues
Subject: Re: darwin/Fortran: -single_module
Date: Wed, 7 Dec 2005 21:58:34 +0100
User-agent: Mutt/1.5.9i

Hi Peter,

* Peter O'Gorman wrote on Wed, Dec 07, 2005 at 02:25:23PM CET:
> 
> I just applied this patch to HEAD. Fixes the archive_expsym_cmds too.

Thanks!

> Note that I do not have any idea if xlc support still works, I added
> it a couple of years ago based on a trial version of the compiler,
> long since expired.

Oh well.

A couple of remarks below.

Cheers,
Ralf

>       * libltdl/config/ltmain.m4sh, libltdl/m4/libtool.m4 [darwin]:

Please mention the changed macros in the ChangeLog entry.  Thanks.


> Index: libltdl/m4/libtool.m4
> ===================================================================
> RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
> retrieving revision 1.49
> diff -u -3 -p -u -r1.49 libtool.m4
> --- libltdl/m4/libtool.m4 27 Nov 2005 15:18:09 -0000 1.49
> +++ libltdl/m4/libtool.m4 7 Dec 2005 13:20:15 -0000
> @@ -60,7 +60,7 @@ AC_BEFORE([$0], [LT_OUTPUT])dnl
>  
>  dnl Autoconf doesn't catch unexpanded LT_ macros by default:
>  m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
> -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW)$])dnl
> +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
>  dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
>  dnl unless we require an AC_DEFUNed macro:
>  AC_REQUIRE([LTOPTIONS_VERSION])dnl
> @@ -4393,12 +4393,32 @@ _LT_EOF
>        _LT_TAGVAR(whole_archive_flag_spec, $1)=''
>        _LT_TAGVAR(link_all_deplibs, $1)=yes
>        if test "$GCC" = yes ; then
> +     AC_CACHE_VAL([lt_cv_apple_cc_single_mod],
> +     [lt_cv_apple_cc_single_mod=no
> +     if test -z "${LT_MULTI_MODULE}"; then
> +       # By default we will add the -single_module flag. You can override
> +       # by either setting the environment variable LT_MULTI_MODULE
> +       # non-empty at configure time, or by adding -multi-module to the
> +       # link flags.
> +       echo "int foo(void){return 1;}" > conftest.$ac_ext
> +       $CC $CLFAGS $LDFLAGS -o libconftest.dylib \

There's a typo in CFLAGS.

At this point in the configure script, CC may be one of user-provided
  $CC, $F77, $FC, $GCJ,

$ac_ext will be adjusted to the current language, as will $ac_compile,
so I don't think this makes too much sense.
I think you wanted $LTCC $LTCFLAGS instead.
(Or $ac_compile in conjunction with $lt_simple_compile_test_code?  But
then, the cache variable should be tagged.)

Surely you get away with this because, after the C case is tested,
AC_CACHE_VAL causes the test not to be executed again.  So you may
simply m4_if([$1], [], [
   AC_CACHE_VAL(...)])
to make clear that it is your intent to only run in the C case, and just
remove that code from the other tags.  Do you agree?

The real solution would've been to put this code into a section that
deals with the linker only.  Yes, I haven't yet done the cleanup you
there that you suggested.  Sorry.

> +           -dynamiclib ${wl}-single_module conftest.$ac_ext
> +       if test -f libconftest.dylib; then
> +           lt_cv_apple_cc_single_mod=yes
> +           rm libconftest.dylib
> +       fi
> +       rm conftest.$ac_ext
> +     fi])
>       output_verbose_link_cmd=echo
> -     _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o 
> $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname 
> $verstring'
> +     if test "X$lt_cv_apple_cc_single_mod" = Xyes ; then
> +       _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $single_module 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring'
> +       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $single_module -dynamiclib 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
> ${lib}'
> +     else
> +       _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag 
> -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname 
> $verstring'
> +       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
> ${lib}'
> +     fi
>       _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle 
> $libobjs $deplibs$compiler_flags'
> -     # Don't fix this by using the ld -exported_symbols_list flag, it 
> doesn't exist in older darwin lds
> -     _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," 
> -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
> ${lib}'
> -     _LT_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," 
> -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
> -bundle $libobjs $deplibs$compiler_flags~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> +     _LT_TAGVAR(module_expsym_cmds, $1)='sed -e "s,^,_," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
> -bundle $libobjs $deplibs$compiler_flags~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
>        else
>       case $cc_basename in
>       xlc*)
> @@ -4406,8 +4426,8 @@ _LT_EOF
>         _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o 
> $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`$ECHO 
> $rpath/$soname` $verstring'
>         _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib 
> -bundle $libobjs $deplibs$compiler_flags'
>         # Don't fix this by using the ld -exported_symbols_list flag, it 
> doesn't exist in older darwin lds
> -       _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
> ]*,," -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag 
> -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name 
> ${wl}$rpath/$soname $verstring~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> -       _LT_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
> ]*,," -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
> -bundle $libobjs $deplibs$compiler_flags~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> +       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag 
> -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name 
> ${wl}$rpath/$soname $verstring~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> +       _LT_TAGVAR(module_expsym_cmds, $1)='sed "s,^,_," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
> -bundle $libobjs $deplibs$compiler_flags~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
>         ;;
>       *)
>         _LT_TAGVAR(ld_shlibs, $1)=no
> @@ -4415,6 +4435,7 @@ _LT_EOF
>       esac
>        fi
>        ;;
> +
>      dgux*)
>        _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs 
> $deplibs $linker_flags'
>        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
> @@ -5344,75 +5365,72 @@ if test "$_lt_caught_CXX_error" != yes; 
>          fi
>          ;;
>        darwin* | rhapsody*)
> -        case $host_os in
> -          rhapsody* | darwin1.[[012]])
> -            _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined 
> ${wl}suppress'
> -            ;;
> -          *) # Darwin 1.3 on
> -            case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
> -              10.[[012]])
> -                _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace 
> ${wl}-undefined ${wl}suppress'
> -                ;;
> -              10.*)
> -                _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined 
> ${wl}dynamic_lookup'
> -                ;;
> -            esac
> -            ;;
> -        esac
> -        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
> -        _LT_TAGVAR(hardcode_direct, $1)=no
> -        _LT_TAGVAR(hardcode_automatic, $1)=yes
> -        _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
> -        _LT_TAGVAR(whole_archive_flag_spec, $1)=''
> -        _LT_TAGVAR(link_all_deplibs, $1)=yes
> -
> -        if test "$GXX" = yes ; then
> -          lt_int_apple_cc_single_mod=no
> -          output_verbose_link_cmd=echo
> -          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
> -          10.[[0123]])
> -            # only use -single_module on bona fide Apple compilers.
> -            if $CC -v 2>&1| grep Apple 2>&1 >/dev/null ; then
> -              if $CC -dumpspecs 2>&1 | $GREP 'single_module' >/dev/null ; 
> then
> -                lt_int_apple_cc_single_mod=yes
> -              fi
> -            fi
> -            if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
> -             _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring'
> -            else
> -              _LT_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs 
> -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag 
> -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname 
> $verstring'
> -            fi
> -            ;;
> -          *)
> -            _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring'
> -            ;;
> -          esac
> -          _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib 
> -bundle $libobjs $deplibs$compiler_flags'
> -          # Don't fix this by using the ld -exported_symbols_list flag,
> -       # it doesn't exist in older darwin lds
> -          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
> -            _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[   
>  ]*,," -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
> ${lib}'
> -          else
> -            _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[   
>  ]*,," -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs 
> -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag 
> -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname 
> $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
> -          fi
> -          _LT_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    
> ]*,," -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
> -bundle $libobjs $deplibs$compiler_flags~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> -        else
> -          case $cc_basename in
> -            xlc*)
> -              output_verbose_link_cmd=echo
> -              _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj 
> ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs 
> $compiler_flags ${wl}-install_name ${wl}`$ECHO "$rpath/$soname"` $verstring'
> -              _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib 
> -bundle $libobjs $deplibs$compiler_flags'
> -              # Don't fix this by using the ld -exported_symbols_list flag,
> +     case $host_os in
> +       rhapsody* | darwin1.[[012]])
> +         _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
> +         ;;
> +       *) # Darwin 1.3 on
> +         case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
> +           10.[[012]])
> +             _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace 
> ${wl}-undefined ${wl}suppress'
> +             ;;
> +           10.*)
> +             _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined 
> ${wl}dynamic_lookup'
> +             ;;
> +         esac
> +         ;;
> +     esac
> +     _LT_TAGVAR(archive_cmds_need_lc, $1)=no
> +     _LT_TAGVAR(hardcode_direct, $1)=no
> +     _LT_TAGVAR(hardcode_automatic, $1)=yes
> +     _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
> +     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
> +     _LT_TAGVAR(link_all_deplibs, $1)=yes
> +
> +     if test "$GXX" = yes ; then
> +       AC_CACHE_VAL([lt_cv_apple_cc_single_mod],
> +       [lt_cv_apple_cc_single_mod=no
> +       if test -z "${LT_MULTI_MODULE}"; then
> +         # By default we will add the -single_module flag. You can override
> +         # by either setting the environment variable LT_MULTI_MODULE
> +         # non-empty at configure time, or by adding -multi-module to the
> +         # link flags.
> +         echo "int foo(void){return 1;}" > conftest.$ac_ext
> +         $CC $CLFAGS $LDFLAGS -o libconftest.dylib \

Ditto. Except here you know it will be C++.

> +             -dynamiclib ${wl}-single_module conftest.$ac_ext
> +         if test -f libconftest.dylib; then
> +             lt_cv_apple_cc_single_mod=yes
> +             rm libconftest.dylib
> +         fi
> +         rm conftest.$ac_ext
> +       fi])
> +       output_verbose_link_cmd=echo
> +       if test "X$lt_cv_apple_cc_single_mod" = Xyes ; then
> +        _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $single_module 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring'
> +         _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," < $export_symbols 
> > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $single_module 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name 
> $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym 
> ${lib}'
> +       else
> +         _LT_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs 
> -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag 
> -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname 
> $verstring'
> +         _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," < $export_symbols 
> > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs 
> -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag 
> -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname 
> $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
> +       fi
> +       _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib 
> -bundle $libobjs $deplibs$compiler_flags'
> +       _LT_TAGVAR(module_expsym_cmds, $1)='sed "s,^,_," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
> -bundle $libobjs $deplibs$compiler_flags~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> +     else
> +       case $cc_basename in
> +         xlc*)
> +           output_verbose_link_cmd=echo
> +           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags 
> ${wl}-install_name ${wl}`$ECHO "$rpath/$soname"` $verstring'
> +           _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib 
> -bundle $libobjs $deplibs$compiler_flags'
> +           # Don't fix this by using the ld -exported_symbols_list flag,
>             # it doesn't exist in older darwin lds
> -              _LT_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ 
>    ]*,," -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module 
> $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags 
> ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> -              _LT_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[  
>   ]*,," -e "s,^\(..*\),_&," < $export_symbols > 
> $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib 
> -bundle $libobjs $deplibs$compiler_flags~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> -              ;;
> -            *)
> -              _LT_TAGVAR(ld_shlibs, $1)=no
> -              ;;
> -          esac
> -        fi
> -        ;;
> +           _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," < 
> $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj 
> ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs 
> $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s 
> $output_objdir/${libname}-symbols.expsym ${lib}'
> +           _LT_TAGVAR(module_expsym_cmds, $1)='sed "s,^,_," < 
> $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC 
> $allow_undefined_flag  -o $lib -bundle $libobjs 
> $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym 
> ${lib}'
> +           ;;
> +         *)
> +           _LT_TAGVAR(ld_shlibs, $1)=no
> +           ;;
> +       esac
> +     fi
> +     ;;
>  
>        dgux*)
>          case $cc_basename in




reply via email to

[Prev in Thread] Current Thread [Next in Thread]