diff --git a/Makefile.in b/Makefile.in index 0a704db..526fa9c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/configure.pl6 b/configure.pl6 index c52c5ec..05cac6f 100755 --- a/configure.pl6 +++ b/configure.pl6 @@ -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 = get_config_var('INCLUDEPY'); -my $library = get_config_var('LIBRARY'); -$library ~~ s/\.a$//; -$library ~~ s/^lib//; -%vars = $library; -%vars = get_config_var('LIBPL'); + %vars = $*VM.platform-library-name('pyhelper'.IO); +%vars = chomp qx/python-config --cflags/; +%vars = chomp qx/python-config --ldflags/; + mkdir 'resources' unless 'resources'.IO.e; mkdir 'resources/libraries' unless 'resources/libraries'.IO.e; + process-makefile('.', %vars); shell(%vars);