Rev 10042 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
dnl aclocal.m4 -- extra macros for configuring Rdnldnl Copyright (C) 1998, 1999, 2000 R Core Teamdnl### 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.dnldnldnl R_ARG_WITH_EXCLUSIVEdnlAC_DEFUN(R_ARG_WITH_EXCLUSIVE,[if test "${with_$1+set}" = set; thenif test "${with_$2+set}" = set; thenif test "$with_$2" = no; thentrueelse$3fififi])dnldnl R_ARG_USEdnlAC_DEFUN(R_ARG_USE,[if test "${withval}" = no; thenuse_$1=falseelseuse_$1=truefi])dnldnl R_PROG_ARdnlAC_DEFUN(R_PROG_AR,[AC_CHECK_PROGS(AR, [${AR} ar]): ${ARFLAGS="rc"}AC_SUBST(ARFLAGS)])dnldnl R_PROG_ECHO_NdnlAC_DEFUN(R_PROG_ECHO_N,[AC_MSG_CHECKING([whether echo can suppress newlines])if echo "testing\c" | grep c >/dev/null; thenif echo -n "testing" | sed s/-n/xn/ | grep xn >/dev/null; thenECHO_N= ECHO_C= ECHO_T=' 'elseECHO_N=-n ECHO_C= ECHO_T=fielseECHO_N= ECHO_C='\c' ECHO_T=fiif test -z "${ECHO_T}"; thenAC_MSG_RESULT(yes)elseAC_MSG_RESULT(no)fiAC_SUBST(ECHO_C)AC_SUBST(ECHO_N)AC_SUBST(ECHO_T)])dnldnl R_PROG_INSTALLdnlAC_DEFUN(R_PROG_INSTALL,[AC_REQUIRE([AC_PROG_INSTALL])warn_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}]);;esac])dnldnl R_PROG_PERLdnlchangequote(<<, >>)dnldefine(PERL5_CHECK,<<if ${PERL} -e 'exit 1 if $]<5'thenr_cv_prog_perl_v5=yeselser_cv_prog_perl_v5=nofi>>)changequote([, ]) dnlAC_DEFUN(R_PROG_PERL,[AC_PATH_PROGS(PERL, [${PERL} perl])if test -n "${PERL}"; thenAC_CACHE_CHECK([whether perl version is at least 5],r_cv_prog_perl_v5, [PERL5_CHECK()] )elsePERL=falsefiif test "${r_cv_prog_perl_v5}" = yes; thenNO_PERL5=falseelsewarn_perl5="you cannot build the object documentation system"AC_MSG_WARN(${warn_perl5})NO_PERL5=truefiAC_SUBST(NO_PERL5)])dnldnl R_PROG_TEXMFdnlAC_DEFUN(R_PROG_TEXMF,[AC_REQUIRE([R_PROG_PERL])AC_PATH_PROGS(DVIPS, [${DVIPS} dvips], false)AC_PATH_PROGS(TEX, [${TEX} tex], false)AC_PATH_PROGS(LATEX, [${LATEX} latex], false)if test -z "${ac_cv_path_LATEX}" ; thenwarn_dvi="you cannot build DVI versions of the R manuals"AC_MSG_WARN(${warn_dvi})fiAC_PATH_PROGS(MAKEINDEX, [${MAKEINDEX} makeindex], false)AC_PATH_PROGS(PDFTEX, [${PDFTEX} pdftex], false)AC_PATH_PROGS(PDFLATEX, [${PDFLATEX} pdflatex], false)if test -z "${ac_cv_path_PDFLATEX}" ; thenwarn_pdf="you cannot build PDF versions of the R manuals"AC_MSG_WARN(${warn_pdf})fiAC_PATH_PROGS(MAKEINFO, [${MAKEINFO} makeinfo])if test -n "${MAKEINFO}"; thenAC_CACHE_CHECK([whether makeinfo version is at least 4],r_cv_prog_makeinfo_v4,[ makeinfo_version=`${MAKEINFO} --version | grep "^makeinfo" | \sed 's/[[^)]]*) \(.\).*/\1/'`if test -z "${makeinfo_version}"; thenr_cv_prog_makeinfo_v4=noelif test ${makeinfo_version} -lt 4; thenr_cv_prog_makeinfo_v4=noelser_cv_prog_makeinfo_v4=yesfi])fiif test "${r_cv_prog_makeinfo_v4}" != yes; thenwarn_info="you cannot build info versions of the R manuals"AC_MSG_WARN(${warn_info})MAKEINFO=falsefiif test "${PERL}" != false; thenINSTALL_INFO="\$(top_builddir)/tools/install-info"AC_SUBST(INSTALL_INFO)elseAC_PATH_PROGS(INSTALL_INFO, [${INSTALL_INFO} install-info], false)fi: ${R_RD4DVI="ae"}AC_SUBST(R_RD4DVI): ${R_RD4PDF="ae,hyper"}AC_SUBST(R_RD4PDF)])dnldnl R_PROG_CC_Mdnldnl Test whether the C compiler accepts -M for generating dependenciesdnlAC_DEFUN(R_PROG_CC_M,[ depend_rules_frag=Makefrag.depAC_CACHE_CHECK([whether ${CC} accepts -M for generating dependencies],r_cv_prog_cc_m,[ echo "#include <math.h>" > conftest.${ac_ext}if test -n "`${CC} -M conftest.${ac_ext} 2>/dev/null \| grep conftest`"; thenr_cv_prog_cc_m=yeselser_cv_prog_cc_m=nofi])if test "${r_cv_prog_cc_m}" = yes; thencat << \EOF > ${depend_rules_frag}.c.d:@echo "making $[@] from $<"@$(CC) -M $(ALL_CPPFLAGS) $< > $[@]EOFelsecat << \EOF > ${depend_rules_frag}.c.d:@touch $[@]EOFfiAC_SUBST_FILE(depend_rules_frag)])dnldnl R_PROG_CC_FLAGdnldnl Test whether the C compiler handles a command line optiondnlAC_DEFUN(R_PROG_CC_FLAG,[ ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`AC_MSG_CHECKING([whether ${CC-cc} accepts $1])AC_CACHE_VAL(r_cv_prog_cc_flag_${ac_safe},[ AC_LANG_SAVEAC_LANG_CXCFLAGS="${CFLAGS}"CFLAGS="${CFLAGS} $1"AC_TRY_LINK([], [],eval "r_cv_prog_cc_flag_${ac_safe}=yes",eval "r_cv_prog_cc_flag_${ac_safe}=no")CFLAGS="${XCFLAGS}"AC_LANG_RESTORE])if eval "test \"`echo '$r_cv_prog_cc_flag_'$ac_safe`\" = yes"; thenAC_MSG_RESULT(yes)[$2]elseAC_MSG_RESULT(no)fi])dnldnl R_PROG_CXX_FLAGdnldnl Test whether the C++ compiler handles a command line optiondnlAC_DEFUN(R_PROG_CXX_FLAG,[ ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`AC_MSG_CHECKING([whether ${CXX-c++} accepts $1])AC_CACHE_VAL(r_cv_prog_cxx_flag_${ac_safe},[ AC_LANG_SAVEAC_LANG_CPLUSPLUSXCXXFLAGS="${CXXFLAGS}"CXXFLAGS="${CXXFLAGS} $1"AC_TRY_LINK([], [],eval "r_cv_prog_cxx_flag_${ac_safe}=yes",eval "r_cv_prog_cxx_flag_${ac_safe}=no")CXXFLAGS="${XCXXFLAGS}"AC_LANG_RESTORE])if eval "test \"`echo '$r_cv_prog_cxx_flag_'$ac_safe`\" = yes"; thenAC_MSG_RESULT(yes)[$2]elseAC_MSG_RESULT(no)fi])dnldnl R_PROG_F77_WORKSdnldnl Determine whether the Fortran 77 compiler works (in the sense thatdnl we can create executables, but not necessarily run them). Thisdnl tests in particular whether all Fortran libraries are available.dnlAC_DEFUN(R_PROG_F77_WORKS, [AC_CACHE_CHECK([whether the Fortran 77 compiler (${FC} ${FFLAGS} ${LDFLAGS}) works],r_cv_prog_f77_works, [cat > conftest.f <<EOFprogram conftestendEOF${FC} -o conftest ${FFLAGS} ${LDFLAGS} conftest.f ${LIBS} \1>&AC_FD_CC 2>&AC_FD_CCif test ${?} = 0; thenr_cv_prog_f77_works=yeselser_cv_prog_f77_works=nofi])rm -rf conftest conftest.* coreif test ${r_cv_prog_f77_works} = no; thenAC_MSG_WARN([Maybe your Fortran installation is incomplete])AC_MSG_ERROR([Fortran 77 compiler does not work])fi])dnldnl R_PROG_F77_GNUdnldnl See if ${F77-f77} is the GNU Fortran compilerdnlAC_DEFUN(R_PROG_F77_GNU,[ AC_CACHE_CHECK([whether ${F77-f77} is the GNU Fortran compiler],r_cv_prog_f77_is_g77,[ if ${use_g77}; thenr_cv_prog_f77_is_g77=yeselsefoutput=`${F77-f77} -v 2>&1 | egrep "GNU F77|egcs|g77"`if test -n "${foutput}"; thenr_cv_prog_f77_is_g77=yeselser_cv_prog_f77_is_g77=nofifi])if test "${r_cv_prog_f77_is_g77}" = yes; thenG77=yes: ${FFLAGS="-g -O2"}elseG77=fi])dnldnl See if the Fortran compiler appends underscoresdnlAC_DEFUN(R_PROG_F77_APPEND_UNDERSCORE,[AC_CACHE_CHECK([whether ${F77-f77} appends underscores],r_cv_prog_f77_append_underscore,[ cat > conftestf.f <<EOFsubroutine tryendEOF${FC} -c ${FFLAGS} conftestf.f 1>&AC_FD_CC 2>&AC_FD_CCcat > conftest.c <<EOFmain() { try_(); }EOF${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o conftest \conftest.c conftestf.o 1>&AC_FD_CC 2>&AC_FD_CCif test ${?} = 0; thenr_cv_prog_f77_append_underscore=yeselsecat > conftest.c <<EOFmain() { try(); }EOF${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o conftest \conftest.c conftestf.o 1>&AC_FD_CC 2>&AC_FD_CCif test ${?} = 0; thenr_cv_prog_f77_append_underscore=nofifirm -rf conftest conftest.* conftestf.*if test -z "${r_cv_prog_f77_append_underscore}"; thenAC_MSG_ERROR([Nothing worked - cannot use FORTRAN])fi])if test "${r_cv_prog_f77_append_underscore}" = yes; thenAC_DEFINE(HAVE_F77_UNDERSCORE, 1)fi])dnldnl See whether Fortran and C compilers agree on int and doublednlAC_DEFUN(R_PROG_F77_CC_COMPAT,[AC_MSG_CHECKING([whether ${F77-f77} and ${CC-cc} agree on int and double])AC_CACHE_VAL(r_cv_prog_f77_cc_compat,[ cat > conftestf.f <<EOFsubroutine cftest(a, b, x, y)integer a(3), b(2)double precision x(3), y(3)b(1) = a(3)/a(2)b(2) = a(3) - a(1)*a(2)y(1) = dble(a(3))/x(2)y(2) = x(3)*x(1)y(3) = (x(2)/x(1)) ** a(1)endEOF${FC} ${FFLAGS} -c conftestf.f 1>&AC_FD_CC 2>&AC_FD_CCchangequote(, )cat > conftest.c <<EOF#include <math.h>#include "confdefs.h"#ifdef HAVE_F77_UNDERSCORE# define F77_SYMBOL(x) x ## _#else# define F77_SYMBOL(x) x#endifextern void F77_SYMBOL(cftest)(int *a, int *b, double *x, double *y);int main () {int a[3] = {17, 237, 2000000000}, b[2], res = 0;double x[3] = {3.14159265, 123.456789, 2.3e34}, z[3];double eps = 1e-6;double zres[3];int i, bres[2];zres[0] = (double) a[2]/x[1];zres[1] = x[2]*x[0];zres[2] = pow(x[1]/x[0], 17.0);bres[0] = a[2]/a[1];bres[1] = a[2] - a[0]*a[1];F77_SYMBOL(cftest)(a, b, x, z);if(b[0] != bres[0]) res++;if(b[1] != bres[1]) res++;for(i = 0; i < 3; i++)if(fabs(z[i]/zres[i] - 1) > eps) res++;printf("number of errors %d\n", res);return(res);}EOFchangequote([, ])if ${CC-cc} ${CFLAGS} -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC; then## FIXME## This should really use MAIN_LD, and hence come after this is## determined. Or maybe we can always use ${CC} eventually?if ${CC-cc} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest conftest.o conftestf.o \${FLIBS} -lm 1>&AC_FD_CC 2>&AC_FD_CC; thenoutput=`./conftest 2>&1`if test ${?} = 0; thenr_cv_prog_f77_cc_compat=yesfififi])rm -rf conftest conftest.* conftestf.* coreif test -n "${r_cv_prog_f77_cc_compat}"; thenAC_MSG_RESULT([yes])elseAC_MSG_WARN([${F77-f77} and ${CC-cc} disagree on int and double])AC_MSG_ERROR([Maybe change CFLAGS or FFLAGS?])fi])dnldnl R_PROG_F2C_FLIBSdnlAC_DEFUN(R_PROG_F2C_FLIBS,[AC_CACHE_VAL(r_cv_f2c_flibs,[## This seems to be necessary on some Linux system. -- you bet! -pdcat > conftest.${ac_ext} << EOFint MAIN_ () { return 0; }int MAIN__ () { return 0; }EOFif AC_TRY_EVAL(ac_compile); then${AR} ${ARFLAGS} libconftest.a conftest.o 1>&AC_FD_CCif test -n "${RANLIB}"; then${RANLIB} libconftest.a 1>&AC_FD_CCfifiAC_DEFINE(HAVE_F77_UNDERSCORE)AC_CHECK_LIB(f2c, f_open, flibs=-lf2c, flibs=, -L. -lconftest -lm)rm -f libconftest*if test -z "${flibs}"; thenAC_CHECK_LIB(F77, d_sin, flibs=-lF77, flibs=, -lm)if test -n "${flibs}"; thenAC_CHECK_LIB(I77, f_rew, flibs="${flibs} -lI77", flibs=, -lF77)fifir_cv_f2c_flibs="${flibs}"])FLIBS="${r_cv_f2c_flibs}"if test -z "${FLIBS}"; thenwarn_f2c_flibs="I found f2c but not libf2c, or libF77 and libI77"AC_MSG_WARN(${warn_f2c_flibs})fi])dnldnl R_FUNC___SETFPUCWdnlAC_DEFUN(R_FUNC___SETFPUCW,[ AC_CHECK_FUNC(__setfpucw,[ AC_CACHE_CHECK([whether __setfpucw is needed],r_cv_func___setfpucw_needed,AC_TRY_RUN(changequote(<<, >>)dnl<<int main () {#include <fpu_control.h>#if defined(_FPU_DEFAULT) && defined(_FPU_IEEE)return(_FPU_DEFAULT != _FPU_IEEE);#endifreturn(0);}>>,changequote([, ])dnlr_cv_func___setfpucw_needed=no,r_cv_func___setfpucw_needed=yes,r_cv_func___setfpucw_needed=no))if test "${r_cv_func___setfpucw_needed}" = yes; thenAC_DEFINE(NEED___SETFPUCW)fi])])dnldnl R_FUNC_CALLOCdnlAC_DEFUN(R_FUNC_CALLOC,[ AC_CACHE_CHECK([whether calloc is broken],r_cv_func_calloc_broken,AC_TRY_RUN(changequote(<<, >>)dnl<<#include <stdlib.h>int main () {int *p = calloc(0, sizeof(int));return(p == 0);}>>,changequote([, ])dnlr_cv_func_calloc_broken=no,r_cv_func_calloc_broken=yes,r_cv_func_calloc_broken=yes))if test "${r_cv_func_calloc_broken}" = yes; thenAC_DEFINE(CALLOC_BROKEN)fi])dnldnl R_FUNC_FINITEdnlAC_DEFUN(R_FUNC_FINITE,[ AC_CACHE_CHECK([whether finite is broken],r_cv_func_finite_broken,AC_TRY_RUN(changequote(<<, >>)dnl<<#include <math.h>#include "confdefs.h"int main () {#ifdef HAVE_FINITEreturn(finite(1./0.) | finite(0./0.) | finite(-1./0.));#elsereturn(0);#endif}>>,changequote([, ])dnlr_cv_func_finite_broken=no,r_cv_func_finite_broken=yes,r_cv_func_finite_broken=yes))if test "${r_cv_func_finite_broken}" = yes; thenAC_DEFINE(FINITE_BROKEN)fi])dnldnl R_FUNC_LOGdnlAC_DEFUN(R_FUNC_LOG,[ AC_CACHE_CHECK([whether log is broken],r_cv_func_log_broken,AC_TRY_RUN(changequote(<<, >>)dnl<<#include <math.h>#include "confdefs.h"int main () {#ifdef HAVE_ISNANreturn(!(log(0.) == -1. / 0. && isnan(log(-1.))));#elsereturn(log(0.) != -1. / 0);#endif}>>,changequote([, ])dnlr_cv_func_log_broken=no,r_cv_func_log_broken=yes,r_cv_func_log_broken=yes))if test "${r_cv_func_log_broken}" = yes; thenAC_DEFINE(LOG_BROKEN)fi])dnldnl R_HEADER_SETJMPdnlAC_DEFUN(R_HEADER_SETJMP,[AC_CACHE_CHECK([whether setjmp.h is POSIX.1 compatible],r_cv_header_setjmp_posix,[AC_EGREP_HEADER(sigjmp_buf, setjmp.h,r_cv_header_setjmp_posix=yes,r_cv_header_setjmp_posix=no)if test "${r_cv_header_setjmp_posix}" = yes; thenAC_EGREP_HEADER(siglongjmp, setjmp.h, , r_cv_header_setjmp_posix=no)fiif test "${r_cv_header_setjmp_posix}" = yes; thenAC_EGREP_HEADER(sigsetjmp, setjmp.h, , r_cv_header_setjmp_posix=no)fi])if test "${r_cv_header_setjmp_posix}" = yes; thenAC_DEFINE(HAVE_POSIX_SETJMP)fi])dnldnl R_C_OPTIEEEdnlAC_DEFUN(R_C_OPTIEEE,[ AC_CACHE_CHECK([whether compilers need -OPT:IEEE_NaN_inf=ON],r_cv_c_optieee,AC_TRY_RUN(changequote(<<, >>)dnl<<#include <math.h>#include <ieeefp.h>int main () {double x = 0;fpsetmask(0); x = x / x; return (x != x);}>>,changequote([, ])dnlr_cv_c_optieee=yes,r_cv_c_optieee=no,r_cv_c_optieee=no))if test "${r_cv_c_optieee}" = yes; thenR_XTRA_CFLAGS="${R_XTRA_CFLAGS} -OPT:IEEE_NaN_inf=ON"R_XTRA_FFLAGS="${R_XTRA_FFLAGS} -OPT:IEEE_NaN_inf=ON"fi])dnldnl R_GNOMEdnlAC_DEFUN(R_GNOME, [if test ${want_gnome} = yes; thenGNOME_INIT_HOOK([], cont)if test "${GNOMEUI_LIBS}"; thenAM_PATH_LIBGLADE([use_gnome="yes"GNOME_IF_FILES="gnome-interface.glade"],[ warn_libglade="GNOME support requires libglade version >= 0.3"AC_MSG_WARN(${warn_libglade})],gnome)fifiif test "${use_gnome}" != yes; thenuse_gnome="no"GNOME_IF_FILES=elseAC_DEFINE(HAVE_GNOME, 1)fiAC_SUBST(HAVE_GNOME)AC_SUBST(GNOME_IF_FILES)])dnldnl GNOME_INIT_HOOK (script-if-gnome-enabled, failflag)dnldnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.shdnl is not found.dnlAC_DEFUN([GNOME_INIT_HOOK], [AC_SUBST(GNOME_LIBS)AC_SUBST(GNOMEUI_LIBS)AC_SUBST(GNOMEGNORBA_LIBS)AC_SUBST(GTKXMHTML_LIBS)AC_SUBST(GNOME_APPLET_LIBS)AC_SUBST(GNOME_LIBDIR)AC_SUBST(GNOME_INCLUDEDIR)AC_ARG_WITH(gnome-includes,[ --with-gnome-includes Specify location of GNOME headers], [CFLAGS="$CFLAGS -I$withval"])AC_ARG_WITH(gnome-libs,[ --with-gnome-libs Specify location of GNOME libs], [LDFLAGS="$LDFLAGS -L$withval"gnome_prefix=$withval])if test "${want_gnome}" = yes; thenAC_PATH_PROG(GNOME_CONFIG, gnome-config, no)if test "${GNOME_CONFIG}" = no; thenno_gnome_config="yes"elseAC_MSG_CHECKING(if ${GNOME_CONFIG} works)if ${GNOME_CONFIG} --libs-only-l gnome >/dev/null 2>&1; thenAC_MSG_RESULT(yes)GNOME_GNORBA_HOOK([], $2)GNOME_LIBS="`${GNOME_CONFIG} --libs-only-l gnome`"GNOMEUI_LIBS="`${GNOME_CONFIG} --libs-only-l gnomeui`"GNOMEGNORBA_LIBS="`${GNOME_CONFIG} --libs-only-l gnorba gnomeui`"GTKXMHTML_LIBS="`${GNOME_CONFIG} --libs-only-l gtkxmhtml`"GNOME_APPLET_LIBS="`${GNOME_CONFIG} --libs-only-l applets`"GNOME_LIBDIR="`${GNOME_CONFIG} --libs-only-L gnorba gnomeui`"GNOME_INCLUDEDIR="`${GNOME_CONFIG} --cflags gnorba gnomeui`"$1elseAC_MSG_RESULT(no)no_gnome_config="yes"fifiif test ${exec_prefix} = NONE; thenif test ${prefix} = NONE; thengnome_prefix=${ac_default_prefix}/libelsegnome_prefix=${prefix}/libfielsegnome_prefix=`eval echo \`echo ${libdir}\``fiif test "${no_gnome_config}" = "yes"; thenAC_MSG_CHECKING(for gnomeConf.sh file in ${gnome_prefix})if test -f $gnome_prefix/gnomeConf.sh; thenAC_MSG_RESULT(found)echo "loading gnome configuration from ${gnome_prefix}/gnomeConf.sh". ${gnome_prefix}/gnomeConf.sh$1elseAC_MSG_RESULT(not found)if test "$2" = fail; thenAC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)fifififi])AC_DEFUN([GNOME_INIT], [GNOME_INIT_HOOK([], fail)])dnldnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)dnldnl if failflag is "failure" it aborts if gnorba is not found.dnlAC_DEFUN([GNOME_GNORBA_HOOK], [GNOME_ORBIT_HOOK([], $2)AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[ gnome_cv_gnorba_found=noif test x$gnome_cv_orbit_found = xyes; thenGNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"if test -n "$GNORBA_LIBS"; thengnome_cv_gnorba_found=yesfifi])AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)if test x$gnome_cv_orbit_found = xyes; then$1GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"AC_SUBST(GNORBA_CFLAGS)AC_SUBST(GNORBA_LIBS)elseif test x$2 = xfailure; thenAC_MSG_ERROR(gnorba library not installed or installation problem)fifi])AC_DEFUN([GNOME_GNORBA_CHECK], [GNOME_GNORBA_HOOK([],failure)])dnldnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)dnldnl if failflag is "failure" it aborts if orbit is not found.dnlAC_DEFUN([GNOME_ORBIT_HOOK], [AC_PATH_PROG(ORBIT_CONFIG, orbit-config, no)AC_PATH_PROG(ORBIT_IDL, orbit-idl, no)AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[ if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; thengnome_cv_orbit_found=noelsegnome_cv_orbit_found=yesfi])AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)if test x$gnome_cv_orbit_found = xyes; then$1ORBIT_CFLAGS=`orbit-config --cflags client server`ORBIT_LIBS=`orbit-config --use-service=name --libs client server`AC_SUBST(ORBIT_CFLAGS)AC_SUBST(ORBIT_LIBS)elseif test x$2 = xfailure; thenAC_MSG_ERROR(ORBit not installed or installation problem)fifi])AC_DEFUN([GNOME_ORBIT_CHECK], [GNOME_ORBIT_HOOK([], failure)])AC_DEFUN(AM_CONDITIONAL, [AC_SUBST($1_TRUE)AC_SUBST($1_FALSE)if $2; then$1_TRUE=$1_FALSE='#'else$1_TRUE='#'$1_FALSE=fi])dnl AM_PATH_LIBGLADE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]])dnl Test to see if libglade is installed, and define LIBGLADE_CFLAGS, LIBSdnlAC_DEFUN(AM_PATH_LIBGLADE,[dnldnl Get the cflags and libraries from the libglade-config scriptdnlAC_ARG_WITH(libglade-config,[ --with-libglade-config=LIBGLADE_CONFIG Location of libglade-config],LIBGLADE_CONFIG="$withval")module_args=for module in . $3; docase "$module" ingnome)module_args="$module_args gnome";;esacdoneAC_PATH_PROG(LIBGLADE_CONFIG, libglade-config, no)AC_MSG_CHECKING(for libglade)if test "$LIBGLADE_CONFIG" = "no"; thenAC_MSG_RESULT(no)ifelse([$2], , :, [$2])elseif $LIBGLADE_CONFIG --check $module_args; thenLIBGLADE_CFLAGS=`$LIBGLADE_CONFIG --cflags $module_args`LIBGLADE_LIBS=`$LIBGLADE_CONFIG --libs $module_args`AC_MSG_RESULT(yes)ifelse([$1], , :, [$1])elseecho "*** libglade was not compiled with support for $module_args" 1>&2AC_MSG_RESULT(no)ifelse([$2], , :, [$2])fifiAC_SUBST(LIBGLADE_CFLAGS)AC_SUBST(LIBGLADE_LIBS)])AC_DEFUN(AM_CONDITIONAL, [AC_SUBST($1_TRUE)AC_SUBST($1_FALSE)if $2; then$1_TRUE=$1_FALSE='#'else$1_TRUE='#'$1_FALSE=fi])dnldnl R_BITMAPSdnlAC_DEFUN(R_BITMAPS, [BITMAP_LIBS=AC_EGREP_HEADER(jpeg_error_mgr, jpeglib.h, [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [BITMAP_LIBS=-ljpegAC_DEFINE(HAVE_JPEG)], , ${LIBS})])AC_CHECK_LIB(z, main, [AC_CHECK_HEADER(png.h, [AC_CHECK_LIB(png, png_create_write_struct, [BITMAP_LIBS="${BITMAP_LIBS} -lpng -lz"AC_DEFINE(HAVE_PNG)], , ${LIBS})])])AC_SUBST(BITMAP_LIBS)])dnldnl R_TCLTKdnlAC_DEFUN(R_TCLTK,[ AC_REQUIRE([AC_PATH_XTRA])have_tcltk=noTCLTK_CPPFLAGS=TCLTK_LIBS=if test "${want_tcltk}" = yes; thenAC_CHECK_LIB(tcl, Tcl_CreateInterp, [ TCLTK_LIBS="-ltcl"])if test -n "${TCLTK_LIBS}"; thenAC_CHECK_LIB(tk, Tk_Init,[ TCLTK_LIBS="-ltcl -ltk" have_tcltk=yes ], , ${TCLTK_LIBS})if test "${have_tcltk}" = no; then## Try X11 libsecho "checking with X11 libraries:"unset ac_cv_lib_tk_Tk_InitAC_CHECK_LIB(tk, Tk_Init,[ TCLTK_LIBS="-ltcl -ltk ${X_LIBS}"have_tcltk=yes ], , [-ltcl ${X_LIBS}])fifiif test "${have_tcltk}" = no; then## Try finding {tcl,tk}Config.shlibpath="${tcltk_prefix}:${LD_LIBRARY_PATH}"libpath="${libpath}:/opt/lib:/usr/local/lib:/usr/lib:/lib"TCL_CONFIG=AC_PATH_PROG(TCL_CONFIG, tclConfig.sh, , ${libpath})if test -n "${TCL_CONFIG}"; then. ${TCL_CONFIG} # get TCL_VERSIONAC_CHECK_LIB(tcl${TCL_VERSION}, Tcl_CreateInterp,[ TCLTK_LIBS="-ltcl${TCL_VERSION}" ],[ want_tcltk=no ])if test "${want_tcltk}" = yes; thenTK_CONFIG=AC_PATH_PROG(TK_CONFIG, tkConfig.sh, , ${libpath})if test -n "${TK_CONFIG}"; then. ${TK_CONFIG} # get TK_VERSIONAC_CHECK_LIB(tk${TK_VERSION}, Tk_Init,[ TCLTK_LIBS="${TCLTK_LIBS} -ltk${TK_VERSION} ${TK_LIBS}"have_tcltk=yes ], , [${TCLTK_LIBS} ${TK_LIBS}] )fififififiif test "${have_tcltk}" = yes; thenAC_DEFINE(HAVE_TCLTK)use_tcltk=yesif test -n "${TK_XINCLUDES}"; thenTCLTK_CPPFLAGS=${TK_XINCLUDES}elseTCLTK_CPPFLAGS=${X_CFLAGS}fielseuse_tcltk=nofiAC_SUBST(TCLTK_CPPFLAGS)AC_SUBST(TCLTK_LIBS)AC_SUBST(use_tcltk)])AC_DEFUN(R_BLAS_LIBS, [if test "${r_cv_prog_f77_append_underscore}" = yes; thendgemm_func=dgemm_elsedgemm_func=dgemmfiif test "$with_blas" = "no"; thenBLAS_LIBS=" "elif test "$with_blas" != "yes"; then# user specified a BLAS library to try on the command lineAC_CHECK_LIB($with_blas, $dgemm_func,BLAS_LIBS="-l$with_blas", , $FLIBS)fiif test "x$BLAS_LIBS" = x; then# Checks for ATLAS BLAS library:AC_CHECK_LIB(atlas, ATL_xerbla, BLAS_LIBS="-latlas")if test "x$BLAS_LIBS" != x; then# check for other atlas libs:AC_CHECK_LIB(cblas, cblas_dgemm,BLAS_LIBS="-lcblas $BLAS_LIBS",,$BLAS_LIBS)AC_CHECK_LIB(f77blas, $dgemm_func,BLAS_LIBS="-lf77blas $BLAS_LIBS", , $BLAS_LIBS $FLIBS)fifiif test "x$BLAS_LIBS" = x; then# BLAS in Alpha CXML library?AC_CHECK_LIB(cxml, $dgemm_func, BLAS_LIBS="-lcxml", , $FLIBS)fiif test "x$BLAS_LIBS" = x; then# BLAS in Alpha DXML library? (now called CXML, see above)AC_CHECK_LIB(dxml, $dgemm_func, BLAS_LIBS="-ldxml", , $FLIBS)fiif test "x$BLAS_LIBS" = x; thencase "${host}" in*solaris*)# Check for BLAS in Sun Performance library:if test $CC = "cc"; thenAC_CHECK_LIB(sunmath, acosp,AC_CHECK_LIB(sunperf, $dgemm_func,BLAS_LIBS="-xlic_lib=sunperf -lsunmath", ,[-lsunmath $FLIBS]))fi;;esacfiif test "x$BLAS_LIBS" = x; then# Check for BLAS in SCSL and SGIMATH libraries (prefer SCSL):AC_CHECK_LIB(scs, $dgemm_func,BLAS_LIBS="-lscs",AC_CHECK_LIB(complib.sgimath, $dgemm_func,BLAS_LIBS="-lcomplib.sgimath", , $FLIBS), $FLIBS)fiif test "x$BLAS_LIBS" = x; then# Checks for BLAS in IBM ESSL library. We must also link# with -lblas in this case (ESSL does not include the full BLAS):AC_CHECK_LIB(blas, zherk,AC_CHECK_LIB(essl, $dgemm_func,BLAS_LIBS="-lessl -lblas", , $FLIBS), , $FLIBS)fiif test "x$BLAS_LIBS" = x; then# Finally, check for the generic BLAS library:AC_CHECK_LIB(blas, $dgemm_func, BLAS_LIBS="-lblas", , $FLIBS)fiif test "$with_blas" = "no"; then# Unset BLAS_LIBS so that we know below that nothing was found.BLAS_LIBS=""fiAC_SUBST(BLAS_LIBS)])dnl Local Variables: ***dnl mode: sh ***dnl sh-indentation: 2 ***dnl End: ***