Index: config/init/defaults.pm =================================================================== --- config/init/defaults.pm (revision 11315) +++ config/init/defaults.pm (working copy) @@ -30,6 +30,18 @@ { my ($self, $conf) = @_; + # Remove all -Lxxx entries from lddlflags + my $lddlflags = $Config{lddlflags}; + $lddlflags =~ s/-L\s*[^\s]+//g; + $lddlflags =~ s/^\s+//; + $lddlflags =~ s/\s+$//; + + # Remove all -Lxxx entries from ldflags + my $ldflags = $Config{ldflags}; + $ldflags =~ s/-L\s*[^\s]+//g; + $ldflags =~ s/^\s+//; + $ldflags =~ s/\s+$//; + # We need a Glossary somewhere! $conf->data->set( debugging => $conf->options->get('debugging') ? 1 : 0, @@ -62,7 +74,7 @@ # Perl5's Configure doesn't distinguish linking from loading, so # make a reasonable guess at defaults. link => $Config{cc}, - linkflags => $Config{ldflags}, + linkflags => $ldflags, # Linker Flags to have this binary work with the shared and dynamically # loadable libraries we're building. On HP-UX, for example, we need to @@ -73,16 +85,16 @@ # modules. Often $cc on Unix-ish systems, but apparently sometimes # it's ld. ld => $Config{ld}, - ldflags => $Config{ldflags}, + ldflags => $ldflags, # Some operating systems (e.g. Darwin) distinguish between shared # libraries and modules that can be dynamically loaded. Flags to tell # ld to build a shared library, e.g. -shared for GNU ld. - ld_share_flags => $Config{lddlflags}, + ld_share_flags => $lddlflags, # Flags to tell ld to build a dynamically loadable module, e.g. # -shared for GNU ld. - ld_load_flags => $Config{lddlflags}, + ld_load_flags => $lddlflags, libs => $Config{libs},