diff options
Diffstat (limited to 'libgfortran/configure.ac')
-rw-r--r-- | libgfortran/configure.ac | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index e7e34a6fec2..5f78a8b2d2c 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -138,17 +138,30 @@ AC_SUBST(CFLAGS) # Check for symbol versioning (copied from libssp). AC_MSG_CHECKING([whether symbol versioning is supported]) +save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" cat > conftest.map <<EOF FOO_1.0 { global: *foo*; bar; local: *; }; EOF -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" -AC_TRY_LINK([int foo;],[],[gfortran_use_symver=yes],[gfortran_use_symver=no]) +AC_TRY_LINK([int foo;],[],[gfortran_use_symver=gnu],[gfortran_use_symver=no]) +if test x$gfortran_use_symver = xno; then + LDFLAGS="$save_LDFLAGS" + LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map" + # Sun ld cannot handle wildcards and treats all entries as undefined. + cat > conftest.map <<EOF +FOO_1.0 { + global: foo; local: *; +}; +EOF + AC_TRY_LINK([int foo;],[],[gfortran_use_symver=sun],[gfortran_use_symver=no]) +fi LDFLAGS="$save_LDFLAGS" AC_MSG_RESULT($gfortran_use_symver) -AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" = xyes]) +AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno]) +AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu]) +AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun]) # Figure out whether the compiler supports "-ffunction-sections -fdata-sections", # similarly to how libstdc++ does it |