view configure.base @ 300:1bf179625135 octave-forge

add wpolyfit
author pkienzle
date Thu, 18 Apr 2002 02:13:08 +0000
parents cd358128ebe2
children 712c2baebd3e
line wrap: on
line source

dnl The configure script is generated by autogen.sh from configure.base 
dnl and the various configure.add files in the source tree.  Edit 
dnl configure.base and reprocess rather than modifying ./configure.

AC_INIT(configure.base)

PACKAGE=octave-forge
MAJOR_VERSION=0
MINOR_VERSION=1
PATCH_LEVEL=0

dnl Kill caching --- this ought to be the default
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl

dnl uncomment to put support files in another directory
dnl AC_CONFIG_AUX_DIR(admin)

VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

dnl if mkoctfile doesn't work, then we need the following:
dnl AC_PROG_CXX
dnl AC_PROG_F77

dnl Need C compiler regardless so define it in a way that
dnl makes autoconf happy and we can override whatever we
dnl need with mkoctfile -p.
AC_PROG_CC


dnl XXX FIXME XXX need tests for -p -c -s in mkoctfile.

dnl *******************************************************************
dnl Sort out mkoctfile version number and install paths

dnl XXX FIXME XXX latest octave has octave-config so we don't
dnl need to discover things here.  Doesn't have --exe-site-dir
dnl but defines --oct-site-dir and --m-site-dir

dnl Check for mkoctfile
AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile)
test -z "$MKOCTFILE" &&	AC_MSG_WARN([no mkoctfile found on path])

AC_SUBST(ver)
AC_SUBST(subver)
AC_SUBST(mpath)
AC_SUBST(opath)
AC_SUBST(xpath)

AC_ARG_WITH(path, 
	[  --with-path             install path prefix],
	[ path=$withval ])
AC_ARG_WITH(mpath,
	[  --with-mpath            override path for m-files],
	[mpath=$withval])
AC_ARG_WITH(opath,
	[  --with-opath            override path for oct-files],
	[opath=$withval])
AC_ARG_WITH(xpath,
	[  --with-xpath            override path for executables],
	[xpath=$withval])

if test -n "$path" ; then
   test -z $mpath && mpath=$path 
   test -z $opath && opath=$path/oct 
   test -z $xpath && xpath=$path/bin
fi

dnl Don't query if path/ver are given in the configure environment
if test -z "$mpath" || test -z "$opath" || test -z "$xpath" || test -z "$ver" ; then

   dnl Construct program to get mkoctfile version and local install paths
   cat > conftest.cc <<EOF
#include <octave/version.h>
#include <octave/defaults.h>

#define INFOV "\nINFOV=" OCTAVE_VERSION "\n"

#ifdef OCTAVE_LOCALVERFCNFILEDIR
# define INFOM "\nINFOM=" OCTAVE_LOCALVERFCNFILEDIR "\n"
#else
# define INFOM "\nINFOM=" OCTAVE_LOCALFCNFILEPATH "\n"
#endif

#ifdef OCTAVE_LOCALVEROCTFILEDIR
# define INFOO "\nINFOO=" OCTAVE_LOCALVEROCTFILEDIR "\n"
#else
# define INFOO "\nINFOO=" OCTAVE_LOCALOCTFILEPATH  "\n"
#endif

#ifdef OCTAVE_LOCALVERARCHLIBDIR
# define INFOX "\nINFOX=" OCTAVE_LOCALVERARCHLIBDIR  "\n"
#else
# define INFOX "\nINFOX=" OCTAVE_LOCALARCHLIBDIR  "\n"
#endif

const char *infom = INFOM;
const char *infoo = INFOO;
const char *infox = INFOX;
const char *infov = INFOV;
EOF

   dnl Compile program perhaps with a special version of mkoctfile
   $MKOCTFILE conftest.cc || AC_MSG_ERROR(Could not run $MKOCTFILE)

   dnl Strip the config info from the compiled file
   eval `strings conftest.o | grep "^INFO.=" | sed -e "s,//.*$,,"`
   rm -rf conftest*

   dnl set the appropriate variables if they are not already set
   ver=`echo $INFOV | sed -e "s/\.//" -e "s/\..*$//"`
   subver=`echo $INFOV | sed -e "s/^[^.]*[.][^.]*[.]//"`
   test -z $mpath && mpath=$INFOM/octave-forge
   test -z $opath && opath=$INFOO/octave-forge
   test -z $xpath && xpath=$INFOX
fi

dnl *******************************************************************

dnl XXX FIXME XXX should we allow the user to override these?
dnl C compiler and flags
AC_MSG_RESULT([retrieving compile and link flags from $MKOCTFILE])
CC=`$MKOCTFILE -p CC`
CFLAGS=`$MKOCTFILE -p CFLAGS`
CPPFLAGS=`$MKOCTFILE -p CPPFLAGS`
CPICFLAGS=`$MKOCTFILE -p CPICFLAGS`
AC_SUBST(CC)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CPICFLAGS)

dnl Fortran compiler and flags
F77=`$MKOCTFILE -p F77`
FFLAGS=`$MKOCTFILE -p FFLAGS`
FPICFLAGS=`$MKOCTFILE -p FPICFLAGS`
AC_SUBST(F77)
AC_SUBST(FFLAGS)
AC_SUBST(FPICFLAGS)

dnl C++ compiler and flags
CXX=`$MKOCTFILE -p CXX`
CXXFLAGS=`$MKOCTFILE -p CXXFLAGS`
CXXPICFLAGS=`$MKOCTFILE -p CXXPICFLAGS`
AC_SUBST(CXX)
AC_SUBST(CXXFLAGS)
AC_SUBST(CXXPICFLAGS)

dnl *******************************************************************

dnl Check if F77_FUNC works with MKOCTFILE
AC_MSG_CHECKING([for F77_FUNC])
cat > conftest.cc << EOF
#include <octave/config.h>

int F77_FUNC (hello, HELLO) (const int &n);

EOF
ac_try="$MKOCTFILE -c conftest.cc"
if AC_TRY_EVAL(ac_try) ; then
   AC_MSG_RESULT(yes)
else
   dnl "-DHAVE_OCTAVE_2x -s -v" is in Makeconf.base
   AC_MSG_RESULT(no)
   MKOCTFILE="$MKOCTFILE -DF77_FUNC=F77_FCN"
fi

dnl **********************************************************

AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB

dnl Use $(STRIP) in the makefile to strip executables.  If not found, 
dnl STRIP expands to ':', which in the makefile does nothing.
dnl Don't need this for .oct files since mkoctfile handles them directly
STRIP=${STRIP-strip}
AC_CHECK_PROG(STRIP,$STRIP,$STRIP,:)

dnl Things needed to link to X11 programs
dnl defines X_CFLAGS, X_LIBS
AC_SUBST(DEFHAVE_X)
AC_SUBST(X_LIBS)
AC_SUBST(X_CFLAGS)
AC_PATH_XTRA
if test "$no_x" = yes ; then
	DEFHAVE_X=
	XSTATUS="no (plot/g{input,text,zoom,rab} will not work)"
else
	DEFHAVE_X="HAVE_X=1"
	X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
	XSTATUS="yes"
fi

STATUS_MSG="

octave commands will install into the following directories:
   m-files:   $mpath
   oct-files: $opath
   binaries:  $xpath

shell commands will install into the following directories:
   binaries:  $bindir
   man pages: $mandir
   libraries: $libdir
   headers:   $includedir

octave-forge is configured with
   mkoctfile:	$MKOCTFILE for Octave $subver
   X11 support:	$XSTATUS"