Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Steven Johnson's build scripts.

  • Loading branch information...
commit f64da64bf29cfdf6b0543eb19041287a92835769 1 parent bc808bf
andyv authored
16 AUTHORS
View
@@ -0,0 +1,16 @@
+Authors:
+
+ Steven Bosscher
+
+ Katherine Holcomb
+
+ Niels Kristian Beck Jensen
+
+ Steven Johnson
+
+ Tobi Schleuter
+
+ Andy Vaught
+
+
+
12 MANIFEST
View
@@ -1,5 +1,7 @@
-arith.c error.c expr.c intrinsic.c match.c parse.c scanner.c st.c symbol.c
-array.c misc.c decl.c interface.c select.c io.c format.c matchexp.c module.c
-simplify.c primary.c date.c simplify.h g95.h
-configure.in configure config.guess config.sub Makefile.in
-CONTRIB COPYING MANIFEST BUGS Makefile
+arith.c error.c expr.c intrinsic.c match.c parse.c scanner.c st.c
+symbol.c array.c misc.c decl.c interface.c select.c io.c format.c
+matchexp.c module.c simplify.c primary.c date.c simplify.h g95.h
+
+autogen.sh configure.in Makefile.am
+
+AUTHORS CONTRIB COPYING MANIFEST BUGS NEWS ChangeLog
8 Makefile.am
View
@@ -0,0 +1,8 @@
+bin_PROGRAMS = g95
+
+EXTRA_DIST = MANIFEST CONTRIB BUGS autogen.sh
+
+g95_SOURCES = arith.c array.c date.c decl.c error.c expr.c format.c \
+g95.h interface.c intrinsic.c io.c match.c matchexp.c misc.c module.c \
+parse.c primary.c scanner.c select.c simplify.c simplify.h st.c \
+symbol.c
1  NEWS
View
@@ -0,0 +1 @@
+No Gnus is good Gnus
11 README
View
@@ -0,0 +1,11 @@
+The goal of the g95 project is to create a free, open source Fortran
+95 compiler. The code has been donated to the Free Software Foundation
+for inclusion in GCC, the Gnu Compiler Collection.
+
+WARNING:
+
+G95 is still in an embryonic state. Perusing the g77 source, we
+estimate that about 200,000 lines of code will be necessary to
+implement g95. G95 is currently about 32,000 lines long, making it
+about version 0.16. The current g95 does nothing except print the
+contents of internal data structures.
150 autogen.sh
View
@@ -0,0 +1,150 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+# Adapted from Gnome and Glade.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+PKG_NAME="g95"
+
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`autoconf' installed to compile ${PKG_NAME}."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
+ (libtool --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`libtool' installed to compile ${PKG_NAME}."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
+ grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+ (gettext --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`gettext' installed to compile ${PKG_NAME}."
+ echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
+ grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+ (gettext --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`gettext' installed to compile ${PKG_NAME}."
+ echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`automake' installed to compile ${PKG_NAME}."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ NO_AUTOMAKE=yes
+}
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: Missing \`aclocal'. The version of \`automake'"
+ echo "installed doesn't appear recent enough."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "**Warning**: I am going to run \`configure' with no arguments."
+ echo "If you wish to pass any to it, please specify them on the"
+ echo \`$0\'" command line."
+ echo
+fi
+
+case $CC in
+xlc )
+ am_opt=--include-deps;;
+esac
+
+for coin in `find $srcdir -name configure.in -print`
+do
+ dr=`dirname $coin`
+ if test -f $dr/NO-AUTO-GEN; then
+ echo skipping $dr -- flagged as no auto-gen
+ else
+ echo processing $dr
+ macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
+ ( cd $dr
+ aclocalinclude="$ACLOCAL_FLAGS"
+ for k in $macrodirs; do
+ if test -d $k; then
+ aclocalinclude="$aclocalinclude -I $k"
+ ##else
+ ## echo "**Warning**: No such directory \`$k'. Ignored."
+ fi
+ done
+ if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
+ if grep "sed.*POTFILES" configure.in >/dev/null; then
+ : do nothing -- we still have an old unmodified configure.in
+ else
+ echo "Creating $dr/aclocal.m4 ..."
+ test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+ echo "Running gettextize... Ignore non-fatal messages."
+ echo "no" | gettextize --force --copy
+ echo "Making $dr/aclocal.m4 writable ..."
+ test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+ fi
+ fi
+ if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
+ echo "Creating $dr/aclocal.m4 ..."
+ test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+ echo "Running gettextize... Ignore non-fatal messages."
+ echo "no" | gettextize --force --copy
+ echo "Making $dr/aclocal.m4 writable ..."
+ test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+ fi
+ if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
+ echo "Running libtoolize..."
+ libtoolize --force --copy
+ fi
+ echo "Running aclocal $aclocalinclude ..."
+ aclocal $aclocalinclude
+ if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+ echo "Running autoheader..."
+ autoheader
+ fi
+ echo "Running automake --gnu $am_opt ..."
+ automake --add-missing --gnu $am_opt
+ echo "Running autoconf ..."
+ autoconf
+ )
+ fi
+done
+
+conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+
+if test x$NOCONFIGURE = x; then
+ echo Running $srcdir/configure $conf_flags "$@" ...
+ $srcdir/configure $conf_flags "$@" \
+ && echo Now type \`make\' to compile $PKG_NAME || exit 1
+else
+ echo Skipping configure process.
+fi
14 config.h.in
View
@@ -0,0 +1,14 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to turn on debugging checks. */
+#undef G95_DEBUG
+
93 configure.in
View
@@ -1,58 +1,69 @@
-
AC_INIT(g95.h)
+AM_INIT_AUTOMAKE(g95, 0.16)
+AM_CONFIG_HEADER(config.h)
-AC_CANONICAL_HOST
+#############################################################################
AC_PROG_CC
+AC_CANONICAL_HOST
-CPPFLAGS=
-LDFLAGS=-g
-LIBS=-lgmp
-
-AC_ARG_WITH(gmp-dir, [--with-gmp-dir=PATH Specify directory for the GMP library])
-
-if test ! -z "$with_gmp_dir" ; then
- CPPFLAGS="-I$with_gmp_dir $CPPFLAGS"
-
- AC_MSG_CHECKING(for GMP library)
-
- if test -f $with_gmp_dir/.libs/libgmp.a ; then
- LDFLAGS="-L$with_gmp_dir/.libs $LDFLAGS"
- AC_MSG_RESULT([Ok, found in $with_gmp_dir/.libs])
+AC_C_CONST
-# Test suite stores the library relative to the host type
+#############################################################################
+# Find GMP (GNU Multi-Precision) library:
- elif test -f $with_gmp_dir/$host/libgmp.a ; then
- LDFLAGS="-L$with_gmp_dir/$host $LDFLAGS"
- AC_MSG_RESULT([Ok, found in $with_gmp_dir/$host])
+AC_ARG_WITH(gmp-dir, [--with-gmp-dir=PATH Specify directory for the GMP library])
- else
- AC_MSG_RESULT([Can't find in $with_gmp_dir])
- fi
+if test "x$with_gmp_dir" != x; then
+ if test -d $with_gmp_dir; then
+ CPPFLAGS="$CPPFLAGS -I$with_gmp_dir"
+ fi
+ if test -d $with_gmp_dir/.libs; then
+ LDFLAGS="$LDFLAGS -L$with_gmp_dir/.libs"
+ elif test -d $with_gmp_dir/$host; then
+ LDFLAGS="$LDFLAGS -L$with_gmp_dir/$host"
+ fi
fi
-AC_CHECK_HEADER(gmp.h,, AC_MSG_ERROR(gmp.h not found))
-
-# Try to link against libgmp
-
-AC_MSG_CHECKING(linking with gmp library)
-
-AC_TRY_RUN([
-#include "gmp.h"
-int main() { mpf_t n; mpf_init(n); return 0; }
-], [AC_MSG_RESULT(ok)], AC_ERROR(Can't link with libgmp),
- AC_ERROR(Can't Cross Compile))
+# Look for gmp header first:
+AC_CHECK_HEADER(gmp.h, [], [AC_MSG_ERROR([gmp.h not found])])
+
+AC_MSG_CHECKING([whether gmp version is ok])
+AC_TRY_COMPILE([#include <gmp.h>],[
+#if __GNU_MP_VERSION < 3
+ choke me
+#endif
+], [ok=yes], [ok=no])
+AC_MSG_RESULT($ok)
+if test $ok = no; then
+ AC_MSG_ERROR([gmp version 3.0 or later is needed])
+fi
-# Make sure we have version 3 or greater of GMP.
+AC_MSG_CHECKING([for mpf_init in -lgmp])
+g95_save_LIBS="$LIBS"; LIBS="-lgmp $LIBS"
+AC_TRY_LINK([#include <gmp.h>], [mpf_t n; mpf_init(n);], [ok=yes],
+ [LIBS="$g95_save_LIBS"; ok=no])
+AC_MSG_RESULT($ok)
+if test $ok = no; then
+ AC_MSG_ERROR([could not link with libgmp])
+fi
-AC_MSG_CHECKING(version of gmp library)
+#############################################################################
+# --enable-debug to turn on debugging (currently defaults to yes)
-AC_TRY_RUN([
-#include "gmp.h"
-int main() { return __GNU_MP_VERSION < 3; }
-], [ AC_MSG_RESULT(ok) ], AC_ERROR(Need version 3.0 or later of GMP), AC_ERROR())
+AC_ARG_ENABLE(debug, [ --enable-debug compile for debugging],
+ [ok=$enableval], [ok=yes])
+if test "$ok" = "yes"; then
+ 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 -Wwrite-strings"
+ fi
+ AC_DEFINE(G95_DEBUG,1,[Define to turn on debugging checks.])
+fi
-CFLAGS="-c -g -pedantic -Wall -Wwrite-strings"
+#############################################################################
AC_OUTPUT(Makefile)
Please sign in to comment.
Something went wrong with that request. Please try again.