Hello, While I'm moving to CentOS8 environment, I got stuck at ./configure with the following error.
configure: error: libperl library is requred for Perl It complains that it needs -fPIC. Configure uses only $Config{ccflags}, but it seems that $Config{cccdlflags} is also required. The attached patch make ./configure success. (configure itself is excluded in the patch.) regards. -- Kyotaro Horiguchi NTT Open Source Software Center
diff --git a/config/perl.m4 b/config/perl.m4 index 059e31c476..8563ac7869 100644 --- a/config/perl.m4 +++ b/config/perl.m4 @@ -69,10 +69,10 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIGS], AC_DEFUN([PGAC_CHECK_PERL_EMBED_CCFLAGS], [AC_REQUIRE([PGAC_PATH_PERL]) AC_MSG_CHECKING([for CFLAGS recommended by Perl]) -perl_ccflags=`$PERL -MConfig -e ['print $Config{ccflags}']` +perl_ccflags=`$PERL -MConfig -e ['print "$Config{ccflags} $Config{cccdlflags}"']` AC_MSG_RESULT([$perl_ccflags]) AC_MSG_CHECKING([for CFLAGS to compile embedded Perl]) -perl_embed_ccflags=`$PERL -MConfig -e ['foreach $f (split(" ",$Config{ccflags})) {print $f, " " if ($f =~ /^-D[^_]/ || $f =~ /^-D_USE_32BIT_TIME_T/)}']` +perl_embed_ccflags=`$PERL -MConfig -e ['foreach $f (split(" ",$Config{ccflags})) {print $f, " " if ($f =~ /^-D[^_]/ || $f =~ /^-D_USE_32BIT_TIME_T/)} print "$Config{cccdlflags} "']` AC_SUBST(perl_embed_ccflags)dnl AC_MSG_RESULT([$perl_embed_ccflags]) ])# PGAC_CHECK_PERL_EMBED_CCFLAGS diff --git a/configure.in b/configure.in index 0d16c1a971..47770f54f0 100644 --- a/configure.in +++ b/configure.in @@ -2223,7 +2223,7 @@ fi # check for <perl.h> if test "$with_perl" = yes; then ac_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS $perl_includespec" + CPPFLAGS="$CPPFLAGS $perl_includespec $perl_embed_ccflags" AC_CHECK_HEADER(perl.h, [], [AC_MSG_ERROR([header file <perl.h> is required for Perl])], [#include <EXTERN.h>]) # While we're at it, check that we can link to libperl.