dnl Process this file with autoconf to produce a configure script. ## Copyright (C) 2001, 2004, 2006 Rafael Laboissiere ## ## This file is part of Octave-GPC ## ## Octave-GPC 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, or (at your option) ## any later version. ## ## Octave-GPC 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 Octave-GPC; see the file COPYING. If not, write to the ## Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. dnl Initialize Autoconf and Automake AC_INIT(octave-gpc, 0.1.6, [Rafael Laboissiere ]) AC_CONFIG_SRCDIR(octave-gpc.h) AM_INIT_AUTOMAKE dnl --with-* Options, Octave related AC_ARG_WITH(octave, AC_HELP_STRING([--with-octave], [Specify the octave path (version 2.1.57 or later)]), [OCTAVE=$withval]) AC_ARG_WITH(octdir, AC_HELP_STRING([--with-octdir], [Specify the path for installation of .oct files. If not given, try to determine it by running Octave. (localoctfiledir in octave_config_info)]), [OCTDIR=$withval]) AC_ARG_WITH(mdir, AC_HELP_STRING([--with-mdir], [Specify the path for installation of .m files. If not given, try to determine it by running Octave (localfcnfiledir in octave_config_info)]), [MDIR=$withval]) AC_ARG_WITH(mkoctfile, AC_HELP_STRING([--with-mkoctfile], [Specify the mkoctfile path (version 2.1.52 or later)]), [MKOCTFILE=$withval]) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP CHECK_PROG(PERL, perl) CHECK_PROG(OCTAVE, octave) CHECK_PROG(MKOCTFILE, mkoctfile) dnl Check minimum Octave version OCTAVE_CONFIG_INFO(OCTVER, version) AC_MSG_CHECKING(for Octave version) AC_MSG_RESULT($OCTVER) [if echo "$OCTVER" | \ perl -ne '/([0-9]+)\.([0-9]+)\.([0-9]+)/; \ exit 1 if ($1>=2 and $2>=1 and $3>=57); exit 0' ; then] AC_MSG_ERROR(version of octave must be 2.1.57 or later) fi dnl Installation directories for Octave-GPC files OCTAVE_CONFIG_INFO(OCTDIR, localoctfiledir) OCTAVE_CONFIG_INFO(MDIR, localfcnfiledir) dnl Check minimum mkoctfile version AC_MSG_CHECKING(for version of mkoctfile >= 2.1) AC_MSG_RESULT($MKOCTFILE) [if perl -ne \ 'if(/INCFLAGS/){/octave-([0-9]+)\.([0-9]+)/; \ exit 1 if ($1>=2 and $2>=1); exit 0}' \ < $MKOCTFILE ; then] AC_MSG_RESULT(no) AC_MSG_ERROR(version of mkoctfile must be 2.1 or later) fi dnl Checks for libraries. AC_CHECK_LIB(gpcl, gpc_polygon_clip, [], [AC_MSG_ERROR(the gpc library must be available in the system)]) dnl Substitution variables AC_SUBST(OCTDIR) AC_SUBST(MDIR) dnl Output files AC_CONFIG_FILES(Makefile) AC_OUTPUT