Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (66 sloc) 2.73 KB
AC_INIT(g95.h)
AM_INIT_AUTOMAKE(g95, 0.25)
AM_CONFIG_HEADER(g95-config.h)
#############################################################################
AC_PROG_CC
AC_PROG_CPP
AC_CANONICAL_HOST
AC_C_CONST
case "$host" in
hppa*) CFLAGS="-Ae $CFLAGS";;
esac
#####################################################################
AC_ARG_WITH(gcc-dir, [ --with-gcc-dir=PATH Specify directory for GCC ])
## This option almost works. The last difficulty is creating the gty
## include files, particularly the master language file.
if test "x$with_gcc_dir" != x -a -d "$with_gcc_dir"; then
CFLAGS="$CFLAGS -DBACKEND -DIN_GCC -DNO_GTY"
CPPFLAGS="-I- -I$with_gcc_dir/gcc -I$with_gcc_dir/include -I$with_gcc_dir/gcc/config $CPPFLAGS"
LDFLAGS="$LDFLAGS -L$with_gcc_dir/gcc -L$with_gcc_dir/libiberty"
LIBS="$LIBS -lbackend -liberty"
DEFAULT_INCLUDES=" "
AC_CHECK_HEADER(ansidecl.h, [], [AC_MSG_ERROR([ansidecl.h not found])])
AC_MSG_CHECKING([for libbackend.a])
if test -f $with_gcc_dir/gcc/libbackend.a; then
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([could not find libbackend.a])
fi
GCC_DIR=$with_gcc_dir
AC_SUBST([GCC_DIR])
fi
AM_CONDITIONAL(GCC, test "x$with_gcc_dir" != "x")
#############################################################################
# Find GMP (GNU Multi-Precision) library:
AC_ARG_WITH(gmp-dir, [ --with-gmp-dir=PATH Specify directory for the GMP library])
if test "x$with_gmp_dir" != x -a -d "$with_gmp_dir"; then
CPPFLAGS="$CPPFLAGS -I$with_gmp_dir"
LIBS="$with_gmp_dir/.libs/libgmp.a $LIBS"
fi
AC_FUNC_ALLOCA([AC_MSG_ERROR([alloca not found])])
AC_CHECK_HEADER(gmp.h, [], [AC_MSG_ERROR([gmp.h not found])])
AC_MSG_CHECKING([for correct version of gmp.h])
AC_TRY_COMPILE([#include "gmp.h"],[
#if __GNU_MP_VERSION < 3
choke me
#endif
], [AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([gmp version 3.0 or later is required])])
AC_MSG_CHECKING([for mpf_init in -lgmp])
AC_TRY_LINK([#include <gmp.h>], [mpf_t n; mpf_init(n);],
[AC_MSG_RESULT([yes])], [AC_MSG_ERROR([could not link with libgmp])])
#############################################################################
# --enable-debug to turn on debugging (currently defaults to yes)
AC_ARG_ENABLE(debug, [ --enable-debug compile for debugging],
[ok=$enableval], [ok=yes])
if test "$ok" = "yes"; then
CFLAGS="$CFLAGS -g"
# Add more compiler warnings if we are using gcc:
# ($GCC is set to "yes" by AC_PROG_CC if we are using gcc.)
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -pedantic -Wall -Wmissing-prototypes"
fi
AC_DEFINE(G95_DEBUG,1,[Define to turn on debugging checks.])
fi
#############################################################################
AC_OUTPUT(Makefile)
Jump to Line
Something went wrong with that request. Please try again.