Build system: don't fail if flex, bison or ctangle is missing; use the "missing" script from automake instead

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2941 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
sebastien 2009-09-17 15:05:25 +00:00
parent 582eeff437
commit 7beb1e52d8
4 changed files with 11 additions and 131 deletions

View File

@ -1,6 +1,5 @@
SUBDIRS = preprocessor doc tests mex/build
if HAVE_CTANGLE
if HAVE_BLAS
if HAVE_LAPACK
if HAVE_PTHREAD
@ -8,7 +7,6 @@ SUBDIRS += dynare++
endif
endif
endif
endif
ACLOCAL_AMFLAGS = -I m4

View File

@ -42,12 +42,14 @@ esac
AC_PROG_MKDIR_P
AM_PROG_LEX
AX_PROG_FLEX([], AC_MSG_ERROR([No suitable flex found.]))
AC_CHECK_HEADERS([FlexLexer.h], [], [AC_MSG_ERROR([Can't find FlexLexer.h])])
AC_PROG_YACC
AX_PROG_BISON([], AC_MSG_ERROR([No suitable bison found.]))
AC_CHECK_PROG([YACC], [bison], [bison])
if test "x$YACC" = "x"; then
unset YACC # AM_MISSING_PROG needs an unset variable: an empty variable won't do
AM_MISSING_PROG([YACC], [bison])
fi
AX_BOOST_BASE([1.34])
@ -86,6 +88,10 @@ AM_CONDITIONAL([HAVE_MKOCTFILE], [test "x$MKOCTFILE" != "x"])
AC_CHECK_PROG([CTANGLE], [ctangle], [ctangle])
AM_CONDITIONAL([HAVE_CTANGLE], [test "x$CTANGLE" != "x"])
if test "x$CTANGLE" = "x"; then
unset CTANGLE # AM_MISSING_PROG needs an unset variable: an empty variable won't do
AM_MISSING_PROG([CTANGLE], [ctangle])
fi
AC_CHECK_PROG([CWEAVE], [cweave], [cweave])
AM_CONDITIONAL([HAVE_CWEAVE], [test "x$CWEAVE" != "x"])
@ -162,10 +168,10 @@ AC_CONFIG_FILES([Makefile
BUILD_PREPROCESSOR="yes"
if test "x$CTANGLE" != "x" -a x"$ax_blas_ok" = "xyes" -a x"$ax_lapack_ok" = "xyes" -a x"$ax_pthread_ok" = "xyes"; then
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes" -a "x$ax_pthread_ok" = "xyes"; then
BUILD_DYNAREPLUSPLUS="yes"
else
BUILD_DYNAREPLUSPLUS="no (missing one of: ctangle, BLAS, LAPACK, POSIX Threads)"
BUILD_DYNAREPLUSPLUS="no (missing one of: BLAS, LAPACK, POSIX Threads)"
fi
if test "x$CWEAVE" != "x" -a x"$PDFTEX" != "x"; then

View File

@ -1,62 +0,0 @@
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_prog_bison.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_BISON(ACTION-IF-TRUE,ACTION-IF-FALSE)
#
# DESCRIPTION
#
# Check whether bison is the parser generator. Run ACTION-IF-TRUE if
# successful, ACTION-IF-FALSE otherwise
#
# LICENSE
#
# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
#
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_PROG_BISON], [
AC_REQUIRE([AC_PROG_YACC])
AC_REQUIRE([AC_PROG_SED])
AC_CACHE_CHECK([if bison is the parser generator],[ax_cv_prog_bison],[
AS_IF([test "`echo \"$YACC\" | $SED 's,^.*\(bison\).*$,\1,'`" = "bison" ],[
ax_cv_prog_bison=yes
],[
ax_cv_prog_bison=no
])
])
AS_IF([test "$ax_cv_prog_bison" = yes],[
:
$1
],[
:
$2
])
])

View File

@ -1,62 +0,0 @@
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_prog_flex.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_FLEX(ACTION-IF-TRUE,ACTION-IF-FALSE)
#
# DESCRIPTION
#
# Check whether flex is the scanner generator. Run ACTION-IF-TRUE if
# successful, ACTION-IF-FALSE otherwise
#
# LICENSE
#
# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
#
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_PROG_FLEX], [
AC_REQUIRE([AM_PROG_LEX])
AC_REQUIRE([AC_PROG_SED])
AC_CACHE_CHECK([if flex is the lexer generator],[ax_cv_prog_flex],[
AS_IF([test "`echo \"$LEX\" | $SED 's,^.*\(flex\).*$,\1,'`" = "flex"],[
ax_cv_prog_flex=yes
],[
ax_cv_prog_flex=no
])
])
AS_IF([test "$ax_cv_prog_flex" = yes],[
:
$1
],[
:
$2
])
])