Permalink
Browse files

Wrap some %Config constants so they work on OS X

  • Loading branch information...
1 parent 47551ff commit c159bcc88e93a76d3e18e00a212e73fb73c6f1ef @mnunberg committed Apr 11, 2013
Showing with 16 additions and 3 deletions.
  1. +8 −1 inc/Devel/CheckLib.pm
  2. +8 −2 src/Makefile.PL
View
@@ -359,8 +359,15 @@ sub _cleanup_exe {
# where $ld is an array ref of linker flags
sub _findcc {
# Need to use $keep=1 to work with MSWin32 backslashes and quotes
+
my $Config_ccflags = $Config{ccflags}; # use copy so ASPerl will compile
- my @Config_ldflags = @Config{qw(ldflags perllibs)};
+ $Config_ccflags =~ s/-arch\s+[^\s]+//g;
+
+
+ my $tmp_ldflags = $Config{ldflags};
+ $tmp_ldflags =~ s/-arch\s+[^\s]+//g;
+
+ my @Config_ldflags = ($tmp_ldflags, $Config{perllibs});
my @ccflags = grep { length } quotewords('\s+', 1, $Config_ccflags);
my @ldflags = grep { length } quotewords('\s+', 1, @Config_ldflags);
my @paths = split(/$Config{path_sep}/, $ENV{PATH});
View
@@ -16,6 +16,12 @@ use Cwd qw(abs_path);
use lib (__DIR__ . '/..');
+sub chomp_arch {
+ my $s = shift;
+ $s =~ s/-arch\s+[^\s]+//g;
+ return $s;
+}
+
my $Sharepath = File::Spec->catfile(
'auto', 'share', 'dist', 'Couchbase-Client', 'Library');
@@ -134,7 +140,7 @@ sub create_buildscript_invocation {
# used to determine an available dependency:
my $script_cppflags = $mm->{INC};
- my $config_ccflags = $Config{ccflags};
+ my $config_ccflags = chomp_arch($Config{ccflags});
# Strip any -D's, -f's, -g, and -O from the flags. and remove -pthread
@@ -149,7 +155,7 @@ sub create_buildscript_invocation {
$PLCBTopLevel::U_LibPath ||= "";
my $script_ldflags = $mm->{LDLOADLIBS} . ' ' . $PLCBTopLevel::U_LibPath .
- ' ' . $Config{ldflags};
+ ' ' . chomp_arch($Config{ldflags});
my $java_arg = $PLCBTopLevel::HaveJava ? "--have-java" : "";

0 comments on commit c159bcc

Please sign in to comment.