Skip to content

Commit

Permalink
First try on fixing build on Mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
PatZim committed Mar 20, 2019
1 parent 9ac68c9 commit 2d32bf0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
4 changes: 4 additions & 0 deletions Configure.pl
Expand Up @@ -430,6 +430,10 @@ sub uniq {
push @ldflags, $ENV{LDFLAGS} if $ENV{LDFLAGS};
$config{ldflags} = join ' ', @ldflags;

# Switch shared lib compiler flags in relocatable case.
$config{moarshared} = $config{moarshared_relocatable} if not $args{'no-relocatable'};
$config{moarshared} = $config{moarshared_norelocatable} if $args{'no-relocatable'};

# setup library names
$config{moarlib} = sprintf $config{lib}, $NAME;
$config{moardll} = sprintf $config{dll}, $NAME;
Expand Down
47 changes: 26 additions & 21 deletions build/setup.pm
Expand Up @@ -132,11 +132,12 @@ our %TC_POSIX = (
ldsys => undef,
ldimp => undef,

ccshared => '-fPIC',
ldshared => '-shared @ccshared@',
moarshared => '',
ldrpath => '-Wl,-rpath,"/@libdir@"',
ldrpath_relocatable => '-Wl,-z,origin,-rpath,\'$$ORIGIN/../lib\'',
ccshared => '-fPIC',
ldshared => '-shared @ccshared@',
moarshared_norelocatable => '',
moarshared_relocatable => '',
ldrpath => '-Wl,-rpath,"/@libdir@"',
ldrpath_relocatable => '-Wl,-z,origin,-rpath,\'$$ORIGIN/../lib\'',

arflags => 'rcs',
arout => '',
Expand Down Expand Up @@ -215,11 +216,12 @@ our %TC_MSVC = (
ldsys => undef,
ldimp => '%s.dll.lib',

ccshared => '',
ldshared => '/dll',
moarshared => '/implib:@moardll@.lib',
ldrpath => '',
ldrpath_relocatable => '',
ccshared => '',
ldshared => '/dll',
moarshared_norelocatable => '/implib:@moardll@.lib',
moarshared_relocatable => '/implib:@moardll@.lib',
ldrpath => '',
ldrpath_relocatable => '',

arflags => '/nologo',
arout => '/out:',
Expand Down Expand Up @@ -448,13 +450,14 @@ our %OS_MINGW32 = (
dll => '%s.dll',
ldimp => '-l%s.dll',

libdir => '@bindir@',
ccshared => '',
ldshared => '-shared -Wl,--out-implib,lib$(notdir $@).a',
moarshared => '',
ldrpath => '',
ldrpath_relocatable => '',
sharedlib => 'lib@moardll@.a',
libdir => '@bindir@',
ccshared => '',
ldshared => '-shared -Wl,--out-implib,lib$(notdir $@).a',
moarshared_norelocatable => '',
moarshared_relocatable => '',
ldrpath => '',
ldrpath_relocatable => '',
sharedlib => 'lib@moardll@.a',

translate_newline_output => 1,

Expand Down Expand Up @@ -572,10 +575,12 @@ our %OS_DARWIN = (

dll => 'lib%s.dylib',

ccshared => '',
ldshared => '-dynamiclib',
moarshared => '-install_name "@prefix@/lib/libmoar.dylib"',
sharedlib => 'libmoar.dylib',
sharedlib => 'libmoar.dylib',
ccshared => '',
ldshared => '-dynamiclib',
moarshared_norelocatable => '-install_name "@prefix@/lib/libmoar.dylib"',
moarshared_relocatable => '-install_name @rpath/libmoar.dylib',
ldrpath_relocatable => '-Wl,-rpath,@executable_path/../lib',

-thirdparty => {
uv => { %TP_UVDUMMY, objects => '$(UV_DARWIN)' },
Expand Down

0 comments on commit 2d32bf0

Please sign in to comment.