Rev 6994 | Rev 7133 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
dnl configure.indnldnl Process this file with autoconf to produce a configure script.dnldnl Copyright (C) 1998, 1999 R Core Team###### This file is part of R.###### R is free software; you can redistribute it and/or modify it under### the terms of the GNU General Public License as published by the Free### Software Foundation; either version 2 of the License, or (at your### option) any later version.###### R is distributed in the hope that it will be useful, but WITHOUT ANY### WARRANTY; without even the implied warranty of MERCHANTABILITY or### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public### License for more details.###### You should have received a copy of the GNU General Public License### along with R; if not, you can obtain it via the World Wide Web at### `http://www.gnu.org/copyleft/gpl.html', or by writing to the Free### Software Foundation, 59 Temple Place -- Suite 330, Boston, MA### 02111-3307, USA.AC_INIT(src/include/Defn.h)AC_CONFIG_HEADER(src/include/Rconfig.h)AC_CONFIG_AUX_DIR(tools)### Platform & Version## In an ideal world we would use AC_CANONICAL_HOST here, but this fails## on platforms like the i686 (aka Pentium-Pro) because of some sort of## sanity check written into configure. We bypass the check by invoking## config.guess directly and parsing the results ourselves.AC_MSG_CHECKING(host system type)host=`${srcdir}/tools/config.guess`set `echo ${host} | tr '-' ' '`host_cpu=${1}host_vendor=${2}host_os=${3}AC_DEFINE_UNQUOTED(R_PLATFORM, "${host}")AC_DEFINE_UNQUOTED(R_CPU, "${host_cpu}")AC_DEFINE_UNQUOTED(R_VENDOR, "${host_vendor}")AC_DEFINE_UNQUOTED(R_OS, "${host_os}")AC_MSG_RESULT([${host}])PACKAGE="R"VERSION=`cat ${srcdir}/VERSION | cut -d' ' -f1`AC_SUBST(PACKAGE)AC_SUBST(VERSION)### Defaultsf="${srcdir}/config.site"if test -r ${f}; then echo "loading site script ${f}"; . ${f}; fif="${HOME}/.Rconf"if test -r ${f}; then echo "loading user script ${f}"; . ${f} ; fif="./config.site"if test -r ${f}; then echo "loading build specific script ${f}"; . ${f} ; fi### Handle arguments to configureconfig_opts=${ac_configure_args}AC_SUBST(config_opts)## Allow the user to force us to use f2c.AC_ARG_WITH(f2c,[ --with-f2c use f2c even if FORTRAN compiler is available],[ if test "${withval}" = no; thenuse_f2c=false;elseuse_f2c=true;fi],use_f2c=false)## Allow the user to force us to use g77.AC_ARG_WITH(g77,[ --with-g77 use g77 to compile FORTRAN subroutines],[ if test "${withval}" = no; thenuse_g77=false;elseuse_g77=true;fi],use_g77=false)## Allow the user to force us to use f77.AC_ARG_WITH(f77,[ --with-f77 use f77 to compile FORTRAN subroutines],[ if test "${withval}" = no; thenuse_f77=false;elseuse_f77=true;fi],use_f77=false)## Here we should maybe check that only one of the above options for## dealing with FORTRAN were specified.AC_ARG_WITH(libmoto,[ --with-libmoto use libmoto math library (if available)],[ if test "${withval}"=no; thenuse_libmoto=false;elseuse_libmoto=true;fi],use_libmoto=true)AC_ARG_WITH(blas,[ --with-blas use BLAS library (if available)],[ if test "${withval}" = no; thenuse_blas=false;elseuse_blas=true;fi],use_blas=true)AC_ARG_WITH(blas_risc,[ --with-blas_risc use RISC Optimized BLAS library (if available)],[ if test "${withval}" = no; thenuse_blas_risc=false;elseuse_blas_risc=true;fi],use_blas_risc=true)AC_ARG_WITH(dxml,[ --with-dxml use DXML library (if available)],[ if test "${withval}" = no; thenuse_dxml=false;elseuse_dxml=true;fi],use_dxml=true)AC_ARG_WITH(readline,[ --with-readline use readline library (if available)],[ if test "${withval}" = no; thenuse_readline=false;elseuse_readline=true;fi],use_readline=true)AC_ARG_WITH(gnome,[ --with-gnome use GNOME (if available)],[ if test "${withval}" = no; thenuse_gnome=false;elseuse_gnome=true;fi],use_gnome=false)### Programs.AC_PROG_AWKAC_PROG_INSTALLwarn_install="redefining INSTALL to be `pwd`/tools/install-sh -c"case "${INSTALL}" in[[!/]]*install-sh*)## Fix a bug in older versions of autoconf---the path of the install## shell script is not cached. Could also use an absolute path in## AC_CONFIG_AUX_DIR().INSTALL="\$\(top_srcdir\)/tools/install-sh -c"AC_MSG_WARN([${warn_install}]);;esaccase "${host}" in*aix*|*hpux*)## installbsd on AIX does not seem to work?INSTALL="\$\(top_srcdir\)/tools/install-sh -c"AC_MSG_WARN([${warn_install}]);;esacAC_PROG_LN_SAC_PROG_RANLIBAC_PROG_YACC## Ar.AC_CHECK_PROG(AR, [${AR} ar], ar): ${ARFLAGS="rc"}AC_SUBST(ARFLAGS)## Echo.R_PROG_ECHO_N## Make.: ${MAKE=make}AC_SUBST(MAKE)## Nroff && friendsAC_PATH_PROG(NROFF, [${NROFF} nroff], false)AC_PATH_PROG(TBL, [${TBL} tbl], false)## Perl.R_PROG_PERL## Tar.: ${TAR=tar}AC_SUBST(TAR)## TeXMF stuffR_PROG_TEXMF## Unzip && zipAC_PATH_PROG(R_UNZIPCMD, [${UNZIP} unzip], "")AC_PATH_PROG(R_ZIPCMD, [${ZIP} zip], "")## C compiler.AC_PROG_CCAC_PROG_CPPAC_PROG_GCC_TRADITIONALdnl Yes, we already need this at configure time ...case "${host}" in*aix*)AC_AIX;;*hpux*)LIBS="-L/lib/pa1.1 ${LIBS}"case "${CC}" incc)if test `echo ${CFLAGS} | grep -c -e "-A[ae] "` = 0; thenCFLAGS="${CFLAGS} -Aa"fiAC_DEFINE(_HPUX_SOURCE);;c89)AC_DEFINE(_HPUX_SOURCE);;esac;;esacR_PROG_CC_M## FORTRAN compiler## If we haven't been forced to use a particular FORTRAN compiler, try## to find one using one of the several common names.#### The configure options `--with-g77', `--with-f77', or `--with-f2c'## force g77, f77, or f2c to be used. It is also possible to use these## options to specify the full path name of the compiler.if test -n "${FC}"; thenF77=${FC}AC_MSG_RESULT([defining F77 to be ${F77}])elif ${use_f77}; thenif test "${with_f77}" = yes; thenF77=f77elseF77="${with_f77}"fiAC_MSG_RESULT([defining F77 to be ${F77}])elif ${use_g77}; thenif test "${with_g77}" = yes; thenF77=g77elseF77="${with_g77}"fiAC_MSG_RESULT([defining F77 to be ${F77}])elif ${use_f2c}; thenF77=if test "${with_f2c}" = yes; thenF2C=f2celseF2C="${with_f2c}"fiAC_MSG_RESULT([defining F2C to be ${F2C}])elseAC_PATH_PROGS(F77, g77 f77 fort77 f90 xlf cf77 fc)if test -n "${F77}"; thenif test -n "`file ${F77} | grep script`"; thendnl If F77 found above is a shell or perl script, don't use it.F77=elseF77=`basename ${F77}`fifiif test -z "${F77}"; thenAC_CHECK_PROGS(F2C, f2c)fifiif test -n "${F77}"; thenFC=${F77}OCTAVE_FLIBSR_PROG_F77_G77R_PROG_F77_APPEND_UNDERSCORER_PROG_F77_CC_COMPATf77_rules_frag=Makefrag.f77cat << \EOF > ${f77_rules_frag}.f.c:.f.o:$(FC) $(ALL_FFLAGS) -c $< -o $@EOFelif test -n "${F2C}"; thenR_PROG_F2C_FLIBSf77_rules_frag=Makefrag.f77cat << \EOF > ${f77_rules_frag}.f.o:$(F2C) $(F2CFLAGS) < $< > $*.c$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $*.c -o $@@rm -f $*.cEOFelseAC_MSG_ERROR([Neither an F77 compiler nor f2c found])fiAC_SUBST(FC)AC_SUBST(F2C)AC_SUBST_FILE(f77_rules_frag)### Libraries.## Make sure that non-standard directories specified via `-L' are really## searched in the testsfor arg in ${LIBS}; docase ${arg} in-L*)lib=`echo ${arg} | sed 's/^-L//'`if test -z "${LD_LIBRARY_PATH}"; thenLD_LIBRARY_PATH="${lib}"elseLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${lib}"fi;;esacdoneexport LD_LIBRARY_PATHAC_CHECK_LIB(m, sin)if ${use_libmoto}; thenAC_CHECK_LIB(moto, sin)fiAC_CHECK_LIB(ncurses, main,,AC_CHECK_LIB(termcap, main,,AC_CHECK_LIB(termlib, main)))AC_CHECK_LIB(dl, dlopen)AC_CHECK_LIB(z, main)R_LIB_HDF5BLAS="blas.o"if ${use_dxml}; thenAC_CHECK_LIB(dxml, main, FLIBS="-ldxml ${FLIBS}" BLAS="")fiif test -n "${BLAS}" && ${use_blas}; thenAC_CHECK_LIB(blas, main,[ FLIBS="-lblas ${FLIBS}" BLAS=""if ${use_blas_risc}; thenAC_CHECK_LIB(blas_risc, main,FLIBS="-lblas_risc ${FLIBS}", , ${FLIBS})fi], ,${FLIBS})fiAC_SUBST(BLAS)for arg in ${LIBS}; docase ${arg} in-L*)FLIBS="${arg} ${FLIBS}";;esacdoneAC_SUBST(FLIBS)if ${use_readline}; thenAC_CHECK_LIB(readline, rl_callback_read_char)fiR_GNOME### Library functions.AC_FUNC_ALLOCAAC_FUNC_VFORKAC_FUNC_VPRINTFAC_CHECK_FUNCS(acosh asinh atanh bcopy finite getcwd isnan matherr \memcpy memmove regcomp rint strcoll system times)R_FUNC___SETFPUCWR_FUNC_CALLOCR_FUNC_FINITER_FUNC_LOG### Header filesAC_HEADER_STDCAC_HEADER_TIMEAC_HEADER_DIRENTAC_HEADER_SYS_WAITAC_CHECK_HEADERS(dl.h dlfcn.h elf.h floatingpoint.h fpu_control.h \hdf5.h ieee754.h ieeefp.h readline/history.h readline/readline.h \rpc/rpc.h rpc/xdr.h sys/param.h sys/stat.h sys/time.h sys/times.h \sys/types.h unistd.h locale.h)case "${host}" in*sunos4*)AC_DEFINE(SunOS4) ;;esacR_HEADER_SETJMP### Typedefs.AC_TYPE_SIGNALAC_TYPE_PID_TAC_TYPE_SIZE_TAC_CHECK_TYPE(blkcnt_t, long)### Compiler characteristics.AC_C_CONSTAC_CHECK_SIZEOF(long, 4)if test "${GCC}" = yes; thencase "${host}" ini[[3456789]]86-*-*)R_PROG_CC_FLAG(-mieee-fp,R_XTRA_CFLAGS="${R_XTRA_CFLAGS} -mieee-fp");;esacficase "${host}" in*aix4.[[2-9]]*)AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)if test "${GCC}" = yes; thenR_PROG_CC_FLAG(-mno-fp-in-toc,R_XTRA_CFLAGS="${R_XTRA_CFLAGS} -mno-fp-in-toc")fiR_XTRA_LIBS="${R_XTRA_LIBS} /lib/crt0.o";;alpha*osf*)AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)R_PROG_CC_FLAG(-ieee_with_inexact,R_XTRA_CFLAGS="${R_XTRA_CFLAGS} -ieee_with_inexact");;alpha*linux)R_PROG_CC_FLAG(-mieee,R_XTRA_CFLAGS="${R_XTRA_CFLAGS} -mieee"R_XTRA_FFLAGS="${R_XTRA_FFLAGS} -mieee");;*hpux*)AC_DEFINE(USE_BUILTIN_RINT)case "${CC}" incc|c89)R_XTRA_CFLAGS="${R_XTRA_CFLAGS} -D_HPUX_SOURCE";;esacAC_CHECK_LIB(dld, shl_load, R_XTRA_LIBS="${R_XTRA_LIBS} -ldld");;*irix*)R_C_OPTIEEE;;esacAC_SUBST(CFLAGS)AC_SUBST(FFLAGS)AC_SUBST(F2CFLAGS)AC_SUBST(R_XTRA_CFLAGS)AC_SUBST(R_XTRA_FFLAGS)AC_SUBST(R_XTRA_LIBS)## DLL stuff## We need to determine the following:#### LDCMD, DLLFLAGS## command and flags for loading the main binary so that it will load## shared libraries (DLLs) at runtime## CPICFLAGS, FPICFLAGS## flags for compiling C and Fortran library code## SHLIBLD, SHLIBLDFLAGS## command and flags for creating DLLs#### The following procedure is as follows.## *) We think we know what to do if CC is gcc. Otherwise, try using## imake values in case its CC is ours.## *) Then, use platform specific overrides.## *) As a final safeguard, values from the environment (as specified in## one of the configuration files) override anything we figure out.ldcmd=${CC}shlibld=${CC}SHLIBEXT=soAC_PATH_PROG(XMKMF, xmkmf, ,${PATH}:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)AC_MSG_CHECKING([how to deal with shared libraries])if test -n "${XMKMF}"; thenecho > Imakefile${XMKMF} > /dev/nullcc=`${srcdir}/tools/GETMAKEVAL CC`if test "`which ${cc}`" = "`which ${CC}`"; thenshlibldflags=`${srcdir}/tools/GETMAKEVAL SHLIBLDFLAGS`cpicflags=`${srcdir}/tools/GETMAKEVAL PICFLAGS`fpicflags=${cpicflags}firm -f Imakefile Makefilefiif test "${GCC}" = yes; thencpicflags=-fPICshlibldflags=-sharedfiif test "${G77}" = yes; thenfpicflags=-fPICfiAC_MSG_RESULT(done)## Individual platform overrides.case "${host}" in*aix4.[[2-9]]*)EXPORTFILE="\$(top_builddir)/etc/R.exp"ldcmd=lddllflags="-bdynamic -bE:${EXPORTFILE} -bM:SRE -lc -lm"if test "${GCC}" = yes; thendllflags="${dllflags} `${CC} -print-libgcc-file-name`"fishlibld=ldshlibldflags="-bM:SRE -H512 -T512 -bnoentry -bexpall \-bI:\$(R_HOME)/etc/R.exp -lc -lm";;alpha*osf*)ldcmd="${FC} -g -nofor_main -fpe3 "cpicflags=shlibld=${FC}shlibldflags=-shared;;alpha*linux)dllflags=-export-dynamic;;*freebsd3.*)dllflags=-export-dynamicshlibldflags="-shared";;*hpux*)case "${CC}" incc|c89)cpicflags="+z" ;;esaccase "${FC}" inf77)fpicflags="+z" ;;esacdllflags="-Wl,-E"shlibld=ldshlibldflags="-b"SHLIBEXT=sl;;*linuxaout)sed '/HAVE_ELF_H/d' confdefs.h > tmp.h ; mv tmp.h confdefs.h;;*linux)dllflags=-export-dynamic;;*netbsd*)if ${CPP} - -dM < /dev/null | grep -q __ELF__; thendllflags="-export-dynamic"shlibldflags="-shared"elseshlibldflags="-Bshareable"fi;;*sgi*)if test "${GCC}" = yes; thencpicflags=-fPICelsecpicflags=-KPICfiif test "${G77}" = yes; thenfpicflags=-fPICelsefpicflags=-KPICfishlibldflags="-shared";;*solaris*)if test "${GCC}" = yes; thencpicflags=-fPICelsecpicflags=-KPICfiif test "${G77}" = yes; thenfpicflags=-fPICelsefpicflags=-PICfishlibldflags="-G";;esac: ${LDCMD=${ldcmd}}: ${DLLFLAGS=${dllflags}}: ${CPICFLAGS=${cpicflags}}if test -z "${CPICFLAGS}"; thencase "${host}" inalpha*osf*);;*)AC_MSG_WARN([Could not determine CPICFLAGS.])AC_MSG_ERROR([See the file INSTALL for more information.]);;esacfi: ${FPICFLAGS=${fpicflags}}: ${SHLIBLD=${shlibld}}: ${SHLIBLDFLAGS=${shlibldflags}}if test -z "${SHLIBLDFLAGS}"; thenAC_MSG_WARN([Could not determine SHLIBLDFLAGS.])AC_MSG_ERROR([See the file INSTALL for more information.])fiAC_SUBST(LDCMD)AC_SUBST(DLLFLAGS)AC_SUBST(CPICFLAGS)AC_SUBST(FPICFLAGS)AC_SUBST(SHLIBLDFLAGS)AC_SUBST(SHLIBEXT)AC_SUBST(SHLIBLD)AC_DEFINE_UNQUOTED(SHLIBEXT, "${SHLIBEXT}")AC_SUBST(EXPORTFILE)### System services.## X11 locations#### Here we use the standard X11 search macro.## We force the use of -lX11 (perhaps this is not necessary).AC_PATH_XTRAif test -z "${no_x}"; thenX_LIBS="${X_LIBS} -lX11"fi### Miscellaneous.## Printing#### We look to see whether we have "lpr" or "lp". Some platforms## provide both (SunOS and HPUX), and in those cases we choose lpr.if test -z "${R_PRINTCMD}"; thenAC_CHECK_PROGS(R_PRINTCMD, lpr lp)fiAC_DEFINE_UNQUOTED(R_PRINTCMD, "${R_PRINTCMD}"): ${R_PAPERSIZE=a4}AC_SUBST(R_PAPERSIZE)## Saving.AC_SUBST(R_BATCHSAVE)### Output.AC_OUTPUT(MakeconfMakefileafm/Makefiledemos/Makefiledoc/Makefiledoc/keyword-testdoc/manual/Makefiledoc/manual/lib2texdoc/manual/refman.topetc/Makefileetc/Makeconfsrc/Makefilesrc/appl/Makefilesrc/gnome/Makefilesrc/include/Makefilesrc/library/Makefilesrc/library/base/DESCRIPTIONsrc/library/base/Makefilesrc/library/profile/Makefilesrc/library/eda/DESCRIPTIONsrc/library/eda/Makefilesrc/library/eda/src/Makefilesrc/library/lqs/DESCRIPTIONsrc/library/lqs/Makefilesrc/library/lqs/src/Makefilesrc/library/modreg/DESCRIPTIONsrc/library/modreg/Makefilesrc/library/modreg/src/Makefilesrc/library/mva/DESCRIPTIONsrc/library/mva/Makefilesrc/library/mva/src/Makefilesrc/library/nls/DESCRIPTIONsrc/library/nls/Makefilesrc/library/nls/src/Makefilesrc/library/stepfun/DESCRIPTIONsrc/library/stepfun/Makefilesrc/library/splines/DESCRIPTIONsrc/library/splines/Makefilesrc/library/splines/src/Makefilesrc/library/ts/DESCRIPTIONsrc/library/ts/Makefilesrc/library/ts/src/Makefilesrc/main/Makefilesrc/nmath/Makefilesrc/scripts/Makefilesrc/scripts/COMPILEsrc/scripts/INSTALLsrc/scripts/REMOVEsrc/scripts/R.shsrc/scripts/Rd2contentssrc/scripts/Rd2txtsrc/scripts/Rdconvsrc/scripts/Rdindexsrc/scripts/Rman2Rdsrc/scripts/SHLIBsrc/scripts/Sd2Rdsrc/scripts/build-helpsrc/scripts/fwf2tablesrc/scripts/help.prettysrc/scripts/html2dossrc/unix/Makefiletests/Makefiletests/Examples/Makefiletools/Makefiletools/install-info)AC_OUTPUT_COMMANDS(chmod +x doc/keyword-test doc/manual/lib2tex tools/install-info)if test -z "${F77}"; thenFORT="${F2C} ${F2CFLAGS}"elseFORT="${F77} ${R_XTRA_FFLAGS} ${FFLAGS}"fiAC_MSG_RESULT([R is now configured for ${host}Source directory: ${srcdir}Installation directory: ${prefix}C compiler: ${CC} ${R_XTRA_CFLAGS} ${CFLAGS}FORTRAN compiler: ${FORT}Gnome support: ${use_gnome}])dnl Local Variables: ***dnl mode: sh ***dnl sh-indentation: 2 ***dnl End: ***