ossp-pkg/eperl/configure.in
dnl ##
dnl ## configure.in -- GNU autoconf configuration spec
dnl ## Copyright (c) 1996-1999 Ralf S. Engelschall, <rse@engelschall.com>
dnl ##
dnl ## Process this file with ``autoconf'' to produce a configure script.
dnl ##
dnl #
dnl # standard autoconf prolog
dnl #
AC_PREREQ(2.13)dnl
AC_REVISION($Revision: 2.0$)
SHTOOL="etc/shtool"
AC_SUBST(SHTOOL)
T_MD="`$SHTOOL echo -n -e %B`"
T_ME="`$SHTOOL echo -n -e %b`"
VERS="`$SHTOOL version -l c -d long eperl_version.c`"
echo "Configuring for ${T_MD}ePerl${T_ME}, Version ${T_MD}$VERS${T_ME}"
AC_INIT(README)
AC_CONFIG_HEADER(config_ac.h)dnl
AC_PREFIX_DEFAULT(/usr/local)
dnl #
dnl # libdir adjustment
dnl #
test "x$prefix" = xNONE && prefix=$ac_default_prefix
eval "dir=$prefix"
case $dir in
*eperl* ) libsubdir= ;;
* ) libsubdir="/eperl" ;;
esac
AC_SUBST(libsubdir)
dnl #
dnl # find reasonable temporary directory
dnl #
tmpdir="${TMPDIR}"
if test ".$tmpdir" = .; then
tmpdir="${TEMPDIR}"
fi
if test ".$tmpdir" = .; then
tmpdir="/tmp"
fi
AC_SUBST(tmpdir)
dnl #
dnl # latest find Perl interpreter
dnl #
AC_CONFIGURE_PART(CHECK: Configuration of Perl Language)
AC_MSG_CHECKING([for Perl language])
AC_ARG_WITH(perl,dnl
[ --with-perl=PATH force the usage of a specific installed Perl],
perlprog=$with_perl
,
perlprog=`$SHTOOL path -m perl`
)dnl
changequote(, )dnl
perlvers=`$perlprog -e 'printf("%.3f", $]);'`
changequote([, ])dnl
PATH_PERL=$perlprog
AC_MSG_RESULT([$perlprog v$perlvers])
case $perlvers in
5.00[[3-9]]* )
;;
* ) echo ""
echo "Latest Perl found on your system is $perlvers,"
echo "but at least Perl version 5.003 is required."
echo "In case the newer one is not in PATH, just use"
echo "the option --with-perl=/path/to/bin/perl to"
echo "provide the correct executable."
echo ""
AC_ERROR([Perl version too old])
;;
esac
case $perlvers in
5.00[[3-6]_[0-9][0-9]] )
perlvnum=`echo $perlvers | sed -e 's/\.//' -e 's/_//'` ;;
5.00[[3-9]] )
perlvnum=`echo $perlvers | sed -e 's/\.//' -e 's/$/00/'` ;;
* )
perlvnum=`echo $perlvers | sed -e 's/\.//' -e 's/_//'` ;;
esac
AC_SUBST(PATH_PERL)
AC_SUBST(perlprog)
AC_SUBST(perlvers)
AC_SUBST(perlvnum)
perl_prog=$perlprog
perl_vers=$perlvers
perl_vnum=$perlvnum
AC_SUBST(perl_prog)
AC_SUBST(perl_vers)
AC_SUBST(perl_vnum)
if test -f $PATH_PERL; then
:
else
AC_ERROR([required program ``perl'' not found])
fi
dnl #
dnl # determine Perl parameters
dnl #
AC_MSG_CHECKING([for Perl knowledge of system])
perl_osname="`$perl_prog -e 'use Config; print $Config{osname}'`";
perl_osvers="`$perl_prog -e 'use Config; print $Config{osvers}'`";
perl_os="$perl_osname-$perl_osvers"
AC_SUBST(perl_osname)
AC_SUBST(perl_osvers)
AC_SUBST(perl_os)
AC_MSG_RESULT([$perl_os])
AC_MSG_CHECKING([for Perl standard compiler])
perl_cc="`$perl_prog -e 'use Config; print $Config{cc}'`";
if test ".$CC" = .; then
CC=$perl_cc
export CC
AC_MSG_RESULT([$perl_cc])
else
perl_cc=$CC
AC_MSG_RESULT([$perl_cc (OVERWRITTEN)])
fi
AC_SUBST(perl_cc)
AC_MSG_CHECKING([for Perl standard optimization flags])
perl_optimize="`$perl_prog -e 'use Config; print $Config{optimize}'`";
AC_MSG_RESULT([$perl_optimize])
AC_SUBST(perl_optimize)
AC_MSG_CHECKING([for Perl standard compilation flags])
perl_ccflags="`$perl_prog -e 'use Config; print $Config{ccflags}'`";
case $perl_os in
*hpux* ) perl_ccflags="$perl_ccflags -Wp,-H32768" ;;
*irix-5.* ) perl_ccflags="`echo $perl_ccflags | sed -e 's/-D_POSIX_SOURCE//'`" ;;
esac
AC_MSG_RESULT([$perl_ccflags])
AC_SUBST(perl_ccflags)
AC_MSG_CHECKING([for Perl standard link flags])
perl_ldflags="`$perl_prog -e 'use Config; print $Config{ldflags}'`";
case $perl_os in
*irix-6.* ) perl_ldflags="$perl_ldflags '-Wl,-woff 85'" ;;
esac
AC_MSG_RESULT([$perl_ldflags])
AC_SUBST(perl_ldflags)
AC_MSG_CHECKING([for Perl library files])
perl_libs="`$perl_prog -e 'use Config; print $Config{libs}'`"
AC_MSG_RESULT([$perl_libs])
AC_SUBST(perl_libs)
AC_MSG_CHECKING([for Perl architecture directory])
perl_archlib="`$perlprog -e 'use Config; print $Config{archlib}'`";
AC_MSG_RESULT([$perl_archlib])
AC_SUBST(perl_archlib)
AC_MSG_CHECKING([for Perl dynamic loading support])
usedl="`$perlprog -e 'use Config; print $Config{usedl}'`";
case $usedl in
define )
rc=yes
AC_DEFINE(HAVE_PERL_DYNALOADER)
perl_dla=$perl_archlib/auto/DynaLoader/DynaLoader.a
;;
* )
rc=no
perl_dla=
;;
esac
AC_SUBST(perl_dla)
AC_MSG_RESULT([$rc])
AC_MSG_CHECKING([for Perl dynamic loading compilation flags])
perl_cccdlflags="`$perlprog -e 'use Config; print $Config{cccdlflags}'`";
case $perl_cccdlflags in
" " ) x="none" ;;
* ) x="$perl_cccdlflags" ;;
esac
AC_MSG_RESULT([$x])
AC_SUBST(perl_cccdlflags)
AC_MSG_CHECKING([for Perl dynamic loading link flags])
perl_ccdlflags="`$perlprog -e 'use Config; print $Config{ccdlflags}'`";
case $perl_os in
*aix* ) perl_ccdlflags="`echo $perl_ccdlflags | sed -e 's;-bE:perl.exp;-bE:${perl_archlib}/CORE/perl.exp;'`" ;;
esac
case $perl_ccdlflags in
" " ) x="none" ;;
* ) x="$perl_ccdlflags" ;;
esac
AC_MSG_RESULT([$x])
AC_SUBST(perl_ccdlflags)
dnl #
dnl # determine build tools and parameters
dnl #
AC_CONFIGURE_PART(CHECK: System Build Environment)
AC_BUILD_USER
AC_BUILD_TIME
AC_PROG_CC
AC_CHECK_DEBUGGING
AC_PROG_RANLIB
AC_PROGRAM_CHECK(AR, ar, ar,)
AC_PROGRAM_CHECK(SIZE, size, size,)
case $perl_os in
*irix* ) SIZE="$SIZE -B" ;;
esac
AC_SET_MAKE
dnl #
dnl # determine system parameters
dnl #
AC_CONFIGURE_PART(CHECK: Characteristic of System Headers and Libraries)
AC_CONST
AC_STDC_HEADERS
AC_HAVE_HEADERS(stdio.h stdarg.h stdlib.h string.h ctype.h dnl
unistd.h time.h signal.h pwd.h grp.h dnl
sys/types.h sys/stat.h sys/param.h dnl
sys/socket.h netinet/in.h netdb.h)
AC_CHECK_TYPE(bool, char)
AC_CHECK_FUNCS(memmove)
AC_CHECK_FUNCS(seteuid)
AC_CHECK_FUNCS(setegid)
AC_CHECK_FUNCS(strdup)
dnl #
dnl # finally: source file substitution...
dnl #
AC_CONFIGURE_PART(RESULT: Sourcefile Substitution)
AC_OUTPUT(dnl
Makefile dnl
t/Makefile dnl
config_sc.h dnl
,dnl
)dnl
echo ""
echo "Now please type '${T_MD}make${T_ME}' to compile. Good luck."
echo ""
dnl ##EOF##