Skip to content

Commit

Permalink
Switch to simplified python compile config
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaiid committed Aug 1, 2016
1 parent 5931521 commit 19d2b3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -6,7 +6,7 @@ clean:
rm %DESTDIR%/resources/libraries/%pyhelper%

%DESTDIR%/resources/libraries/%pyhelper%: pyhelper.c
%CC% pyhelper.c -Wall -I"%INCLUDEPY%" -L"%LIBPLPY%" -l%LIBRARYPY% -shared -o %DESTDIR%/resources/libraries/%pyhelper% %CCSHARED% -g
%CC% pyhelper.c %cflags% %ldflags% -shared -fPIC -o %DESTDIR%/resources/libraries/%pyhelper%

test: all
prove -e 'perl6 -Ilib' t
15 changes: 5 additions & 10 deletions configure.pl6
Expand Up @@ -2,20 +2,15 @@
use v6;
use LibraryMake;

sub get_config_var(Str $name) {
return chomp(qqx/python -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('$name'));"/);
}

my %vars = get-vars('.');
%vars<INCLUDEPY> = get_config_var('INCLUDEPY');
my $library = get_config_var('LIBRARY');
$library ~~ s/\.a$//;
$library ~~ s/^lib//;
%vars<LIBRARYPY> = $library;
%vars<LIBPLPY> = get_config_var('LIBPL');

%vars<pyhelper> = $*VM.platform-library-name('pyhelper'.IO);
%vars<cflags> = chomp qx/python-config --cflags/;
%vars<ldflags> = chomp qx/python-config --ldflags/;

mkdir 'resources' unless 'resources'.IO.e;
mkdir 'resources/libraries' unless 'resources/libraries'.IO.e;

process-makefile('.', %vars);
shell(%vars<MAKE>);

Expand Down

0 comments on commit 19d2b3b

Please sign in to comment.