Subject: nagfor needs linker indirection for --whole-archive and -soname.

From: Mat Cross <[email-masked]>
Date: Fri, 21 Feb 2014 11:51:20 +0000

Hi. I was just getting NetCDF 4.2 (with NAG Fortran) working by adding some updates to libtool.m4. I see that there have already been some fixes since the (old, 2.2.10) libtool that NetCDF is using. There still seem to be a few problems though, mainly because of the double indirection required in getting to ld from nagfor via gcc. I had to add

_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"`,-Wl,,--no-whole-archive'

before the nagfor setting of tmp_sharedflag, in order to correctly delimit with commas the doubly-Wl-indirected whole-archive list.

I also had to later override archive_cmds in a similar manner to get -soname passed correctly

nagfor*) # NAG Fortran 5.3
  _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag"' $libobjs $deplibs $compiler_flags ${wl}-soname,,$soname -o $lib'
  ;;

later on.

This my first time hacking libtool, and I'm afraid I don't know how to get you a proper patch that I can test. So I hope that the above code fragments are OK? I could just update the libtool.m4 (untested) for you, if you wish.
Thanks,
Mat Cross
Senior Technical Consultant (Software Quality), NAG Ltd