+ case "$osvers" in
+ [01].*|2.[0-7]|2.[0-7].*)
+ lddlflags="-Bshareable $lddlflags"
+ ;;
+ 2.[8-9]|3.0)
+ ld=${cc:-cc}
+ lddlflags="-shared -fPIC $lddlflags"
+ ;;
+ *) # from 3.1 onwards
+ ld=${cc:-cc}
+ lddlflags="-shared -fPIC $lddlflags"
+ libswanted=`echo $libswanted | sed 's/ dl / /'`
+ ;;
+ esac
+
+ # We need to force ld to export symbols on ELF platforms.
+ # Without this, dlopen() is crippled.
+ ELF=`${cc:-cc} -dM -E - </dev/null | grep __ELF__`
+ test -n "$ELF" && ldflags="-Wl,-E $ldflags"