--- ax_perl_ext.m4.orig 2014-02-13 10:50:08.000000000 +0100 +++ ax_perl_ext.m4 2014-02-13 10:56:56.000000000 +0100 @@ -9,11 +9,12 @@ # DESCRIPTION # # Fetches the linker flags and C compiler flags for compiling and linking -# Perl binary extensions. The macro substitutes PERL_EXT_INC, +# Perl binary extensions. The macro substitutes PERL_EXT_PREFIX, PERL_EXT_INC, # PERL_EXT_LIB, PERL_EXT_CPPFLAGS, PERL_EXT_LDFLAGS and PERL_EXT_DLEXT # variables if Perl executable was found. It also checks the same # variables before trying to retrieve them from the Perl configuration. # +# PERL_EXT_PREFIX: top-level perl installation path (--prefix) # PERL_EXT_INC: XS include directory # PERL_EXT_LIB: Perl extensions destination directory # PERL_EXT_CPPFLAGS: C preprocessor flags to compile extensions @@ -30,17 +31,16 @@ # LICENSE # # Copyright (c) 2011 Stanislav Sedov +# Copyright (c) 2014 Thomas Klausner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright -# # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright -# # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # @@ -68,6 +68,17 @@ if test -n "$PERL" ; then # + # Check for Perl prefix. + # + AC_ARG_VAR(PERL_EXT_PREFIX, [Perl PREFIX]) + AC_MSG_CHECKING([for Perl prefix]) + if test -z "$PERL_EXT_PREFIX" ; then + [PERL_EXT_PREFIX=`$PERL -MConfig -e 'print $Config{prefix};'`]; + fi + AC_MSG_RESULT([$PERL_EXT_PREFIX]) + AC_SUBST(PERL_EXT_PREFIX) + + # # Check for Perl extensions include path. # AC_ARG_VAR(PERL_EXT_INC, [Directory to include XS headers from])