autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is this perl checking code not working for me?


From: Dr. David Kirkby
Subject: Re: Why is this perl checking code not working for me?
Date: Tue, 11 Aug 2009 20:07:40 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090218)

Keith Marshall wrote:
On Tuesday 11 August 2009 17:57:47 Dr. David Kirkby wrote:
It STILL does not work for me, though at least it is not a syntax
error.

This is what I have in configure.ac

minimum_perl_version="5.6.0"

So, within configure you run

  perl -e 'require 5.6.0'

Try running that yourself, from the shell prompt; do you see what the problem is now? (Hint: you have a minor version of 8, but you require a much later minor version of 600 or more -- it's arcane, but it seems to be how perl interprets that version number).

No, it seems pretty logical to me.

putting a requirement of 5.6.0 does not generate any error.


address@hidden:[~] $ perl -e 'require 5.6.0'
address@hidden:[~] $ perl -e 'require 5.7.0'
address@hidden:[~] $ perl -e 'require 5.8.0'
address@hidden:[~] $ perl -e 'require 5.9.0'
Perl v5.9.0 required--this is only v5.8.4, stopped at -e line 1.

address@hidden:[~] $ perl -v

This is perl, v5.8.4 built for sun4-solaris-64int
(with 31 registered patches, see perl -V for more detail)


The code I'm trying to replace is below, which someone else wrote, but it does not look too clever to me. I'd like to do some more tests, and clear it up a bit.

Dave




address@hidden:[~/prereq-0.3] $ more configure.ac
AC_INIT()
AC_PREREQ(2.3)

AC_PROG_CXX()
AC_PROG_LEX()
AC_PROG_YACC()
AC_CHECK_PROG(GCC,gcc,yes,missing -- the GCC Gnu C compiler)
AC_CHECK_PROG(MAKE,make,yes,missing -- make build tool)
AC_CHECK_PROG(M4,m4,yes,missing -- m4 macro processor)
AC_CHECK_PROG(PERL,perl,yes,missing -- the perl scripting language)

dnl # Checking for Perl version
AC_CHECKING([Perl Version])
changequote(, )dnl
perlcmp=`perl -e 'printf("%d",$] < 5.0008 )'`
perlvers=`perl -e 'printf("%.3f",$])'`
changequote([, ])dnl
AC_MSG_RESULT([Perl Version: $perlvers])
case $perlcmp in
    0* )
        ;;
    * ) echo ""
        echo "Latest Perl found on your system is $perlvers,"
        echo "but at least Perl version 5.8 is required."
        echo ""
        AC_ERROR([Perl version too old])
        ;;
esac

AC_CHECK_PROG(RANLIB,ranlib,yes,missing -- build tool)
AC_CHECK_PROGS(BISON, bison)
AC_CHECK_PROGS(FLEX, flex)

AC_CACHE_CHECK([whether gcc is new enough],
   [tfs_cv_gcc_version],
   [AC_COMPILE_IFELSE(
     [AC_LANG_SOURCE(
       [
       @%:@if (__GNUC__ < 3)
       @%:@ error "doesn't work with gcc < 3.x."
       @%:@endif
      ])],
    [tfs_cv_gcc_version=yes],
    [tfs_cv_gcc_version=no])
    test x$tfs_cv_gcc_version != xyes && AC_MSG_ERROR(
    [please upgrade to gcc 3.x or 4.x])
])



AC_OUTPUT(Makefile)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]