update configure so its more robust in checking for Perl
This commit is contained in:
parent
7b959d3fcb
commit
1493b68802
4 changed files with 138 additions and 52 deletions
|
@ -5,6 +5,7 @@ Fish (F), Mark (M), DeadNotBuried (D)
|
|||
===============================================================================
|
||||
* NeoStats * Version 3.0.1 (F)
|
||||
- Bump Version (F)
|
||||
- A much more robust checking if Perl is available in configure (F)
|
||||
|
||||
* NeoStats * Version 3.0.0
|
||||
- Finish the Update Module (F)
|
||||
|
|
|
@ -89,7 +89,7 @@ if test "x$CCDV" != x ; then
|
|||
wi_cv_path_ccdv="$CCDV"
|
||||
CC="$CCDV $CC" # trailing space needed
|
||||
USECCDV="#"
|
||||
AC_MSG_RESULT($ccdv)
|
||||
AC_MSG_RESULT($CCDV)
|
||||
else
|
||||
wi_cv_path_ccdv=""
|
||||
USECCDV=""
|
||||
|
|
128
configure
vendored
128
configure
vendored
|
@ -24901,6 +24901,14 @@ echo $ECHO_N "checking for Perl compile flags... $ECHO_C" >&6; }
|
|||
echo "${ECHO_T}not found, building without perl." >&6; }
|
||||
perl=no
|
||||
else
|
||||
{ echo "$as_me:$LINENO: result: ok" >&5
|
||||
echo "${ECHO_T}ok" >&6; }
|
||||
{ echo "$as_me:$LINENO: checking Checking for perl includes directory" >&5
|
||||
echo $ECHO_N "checking Checking for perl includes directory... $ECHO_C" >&6; }
|
||||
PERL_INCLUDES=`$perlpath -MExtUtils::Embed -e perl_inc 2>/dev/null`
|
||||
{ echo "$as_me:$LINENO: result: $PERL_INCLUDES" >&5
|
||||
echo "${ECHO_T}$PERL_INCLUDES" >&6; }
|
||||
CFLAGS="$CFLAGS "$PERL_INCLUDES
|
||||
PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
|
||||
|
@ -24909,8 +24917,6 @@ echo "${ECHO_T}not found, building without perl." >&6; }
|
|||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
|
||||
fi
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
|
||||
{ echo "$as_me:$LINENO: result: ok" >&5
|
||||
echo "${ECHO_T}ok" >&6; }
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for $perlpath >= 5.8.0" >&5
|
||||
echo $ECHO_N "checking for $perlpath >= 5.8.0... $ECHO_C" >&6; }
|
||||
|
@ -24919,37 +24925,105 @@ echo $ECHO_N "checking for $perlpath >= 5.8.0... $ECHO_C" >&6; }
|
|||
if test "$PERL_VER" = "yes"; then
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }
|
||||
{ echo "$as_me:$LINENO: checking Checking for perl compiler, linker, libraries and headers" >&5
|
||||
echo $ECHO_N "checking Checking for perl compiler, linker, libraries and headers... $ECHO_C" >&6; }
|
||||
PERL_CC=`$perlpath -MConfig -e 'print $Config{cc},"\n";'`
|
||||
PERL_LD=`$perlpath -MConfig -e 'print $Config{ld},"\n";'`
|
||||
perl=no
|
||||
|
||||
rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
|
||||
cat > testperl.c <<EOF
|
||||
#include "EXTERN.h"
|
||||
#include "perl.h"
|
||||
#include "XSUB.h"
|
||||
int main () { (void)&perl_construct; return 0; }
|
||||
EOF
|
||||
$PERL_CC $PERL_CFLAGS -c testperl.c 2>&5 &&
|
||||
$PERL_LD -o testperl testperl.o $PERL_LDFLAGS 2>&5 &&
|
||||
test -x testperl &&
|
||||
have_perl=yes
|
||||
if test "$have_perl" = "yes"; then
|
||||
{ echo "$as_me:$LINENO: result: ok" >&5
|
||||
echo "${ECHO_T}ok" >&6; }
|
||||
|
||||
|
||||
for ac_header in EXTERN.h perl.h XSUB.h
|
||||
do
|
||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
|
||||
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifdef HAVE_EXTERN_H
|
||||
#include <EXTERN.h>
|
||||
#endif
|
||||
#ifdef HAVE_PERL_H
|
||||
#include <perl.h>
|
||||
#endif
|
||||
#ifdef HAVE_XSUB_H
|
||||
#include <XSUB.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include <$ac_header>
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||
{ (case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_try") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest.$ac_objext'
|
||||
{ (case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_try") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
eval "$as_ac_Header=yes"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
eval "$as_ac_Header=no"
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
ac_res=`eval echo '${'$as_ac_Header'}'`
|
||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||
echo "${ECHO_T}$ac_res" >&6; }
|
||||
if test `eval echo '${'$as_ac_Header'}'` = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define USE_PERL 1
|
||||
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
perl=yes
|
||||
|
||||
else
|
||||
|
||||
perl=no
|
||||
PERL_LDFLAGS=""
|
||||
PERL_CFLAGS=""
|
||||
{ echo "$as_me:$LINENO: result: Failed. Perl Support Disabled. See the RELNOTES file" >&5
|
||||
echo "${ECHO_T}Failed. Perl Support Disabled. See the RELNOTES file" >&6; }
|
||||
break
|
||||
|
||||
fi
|
||||
rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
|
||||
|
||||
done
|
||||
|
||||
else
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
|
@ -24974,7 +25048,13 @@ else
|
|||
DO_PERL_FALSE=
|
||||
fi
|
||||
|
||||
if test "x$perl" = "xyes"; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define USE_PERL 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
@ -25133,8 +25213,8 @@ unset wi_resolved_path wi_path
|
|||
wi_cv_path_ccdv="$CCDV"
|
||||
CC="$CCDV $CC" # trailing space needed
|
||||
USECCDV="#"
|
||||
{ echo "$as_me:$LINENO: result: $ccdv" >&5
|
||||
echo "${ECHO_T}$ccdv" >&6; }
|
||||
{ echo "$as_me:$LINENO: result: $CCDV" >&5
|
||||
echo "${ECHO_T}$CCDV" >&6; }
|
||||
else
|
||||
wi_cv_path_ccdv=""
|
||||
USECCDV=""
|
||||
|
|
53
configure.in
53
configure.in
|
@ -307,6 +307,11 @@ dnl PERL_CFLAGS=`echo $PERL_CFLAGS |$sedpath 's/-Wdeclaration-after-statement /
|
|||
AC_MSG_RESULT([not found, building without perl.])
|
||||
perl=no
|
||||
else
|
||||
AC_MSG_RESULT(ok)
|
||||
AC_MSG_CHECKING([Checking for perl includes directory])
|
||||
PERL_INCLUDES=`$perlpath -MExtUtils::Embed -e perl_inc 2>/dev/null`
|
||||
AC_MSG_RESULT($PERL_INCLUDES)
|
||||
CFLAGS="$CFLAGS "$PERL_INCLUDES
|
||||
PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
|
||||
|
@ -315,38 +320,36 @@ dnl PERL_CFLAGS=`echo $PERL_CFLAGS |$sedpath 's/-Wdeclaration-after-statement /
|
|||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
|
||||
fi
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
AC_MSG_CHECKING(for $perlpath >= 5.8.0)
|
||||
PERL_VER=`$perlpath -e 'print $]>= 5.008?"yes":"no"'`
|
||||
|
||||
if test "$PERL_VER" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING([Checking for perl compiler, linker, libraries and headers])
|
||||
PERL_CC=`$perlpath -MConfig -e 'print $Config{cc},"\n";'`
|
||||
PERL_LD=`$perlpath -MConfig -e 'print $Config{ld},"\n";'`
|
||||
|
||||
rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
|
||||
cat > testperl.c <<EOF
|
||||
#include "EXTERN.h"
|
||||
#include "perl.h"
|
||||
#include "XSUB.h"
|
||||
int main () { (void)&perl_construct; return 0; }
|
||||
EOF
|
||||
$PERL_CC $PERL_CFLAGS -c testperl.c 2>&5 &&
|
||||
$PERL_LD -o testperl testperl.o $PERL_LDFLAGS 2>&5 &&
|
||||
test -x testperl &&
|
||||
have_perl=yes
|
||||
if test "$have_perl" = "yes"; then
|
||||
AC_MSG_RESULT(ok)
|
||||
AC_DEFINE_UNQUOTED(USE_PERL, 1, 'Enable Perl Support')
|
||||
else
|
||||
perl=no
|
||||
dnl AC_MSG_CHECKING([Checking for perl compiler, linker, libraries and headers])
|
||||
AC_CHECK_HEADERS([EXTERN.h perl.h XSUB.h], [
|
||||
perl=yes
|
||||
],
|
||||
[
|
||||
perl=no
|
||||
PERL_LDFLAGS=""
|
||||
PERL_CFLAGS=""
|
||||
AC_MSG_RESULT([Failed. Perl Support Disabled. See the RELNOTES file])
|
||||
fi
|
||||
rm -f testperl$ac_exeext testperl.$ac_objext testperl.c testperl.err
|
||||
|
||||
break
|
||||
],
|
||||
[
|
||||
#ifdef HAVE_EXTERN_H
|
||||
#include <EXTERN.h>
|
||||
#endif
|
||||
#ifdef HAVE_PERL_H
|
||||
#include <perl.h>
|
||||
#endif
|
||||
#ifdef HAVE_XSUB_H
|
||||
#include <XSUB.h>
|
||||
#endif
|
||||
]
|
||||
)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
PERL_LDFLAGS=""
|
||||
|
@ -360,7 +363,9 @@ EOF
|
|||
AC_SUBST(PERL_CFLAGS)
|
||||
AC_SUBST(PERL_LDFLAGS)
|
||||
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
|
||||
|
||||
if test "x$perl" = "xyes"; then
|
||||
AC_DEFINE_UNQUOTED(USE_PERL, 1, 'Enable Perl Support')
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
|
Reference in a new issue