libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The patch for Fortran 77 support


From: Erik Lindahl
Subject: The patch for Fortran 77 support
Date: Wed, 23 Jan 2002 01:45:05 -0800

diff -u -N -P -r libtool.vanilla/Makefile.am libtool/Makefile.am
--- libtool.vanilla/Makefile.am Tue Jan 22 23:26:45 2002
+++ libtool/Makefile.am Tue Jan 22 23:00:28 2002
@@ -11,6 +11,8 @@
 CPPLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS= @LIBS@
+FFLAGS = @FFLAGS@
+FLIBS = @FLIBS@

 aclocal_macros = libtool.m4 ltdl.m4

diff -u -N -P -r libtool.vanilla/bootstrap libtool/bootstrap
--- libtool.vanilla/bootstrap Tue Jan 22 23:26:45 2002
+++ libtool/bootstrap Wed Jan 23 01:26:50 2002
@@ -14,7 +14,7 @@
 touch ltmain.sh
 touch libtoolize

-for sub in . libltdl cdemo demo depdemo mdemo pdemo tagdemo; do
+for sub in . libltdl cdemo demo depdemo mdemo pdemo tagdemo f77demo; do

   case $sub in
   .)
     top_srcdir=.
diff -u -N -P -r libtool.vanilla/configure.ac libtool/configure.ac
--- libtool.vanilla/configure.ac Tue Jan 22 23:26:45 2002
+++ libtool/configure.ac Tue Jan 22 23:00:28 2002
@@ -75,7 +75,7 @@

 # all subdirectories that are configured on demand, but that must be
 # included in the distribution
-CONF_SUBDIRS="cdemo pdemo demo depdemo mdemo tagdemo"
+CONF_SUBDIRS="cdemo pdemo demo depdemo mdemo tagdemo f77demo"
 AC_SUBST([CONF_SUBDIRS])

 ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4"
@@ -106,6 +106,11 @@
 popdef([AC_MSG_ERROR])
 AM_CONDITIONAL(HAVE_CXX, [test "x$CXX" != xno])

+pushdef([AC_MSG_ERROR], [F77=no])
+AC_PROG_F77
+popdef([AC_MSG_ERROR])
+AM_CONDITIONAL(HAVE_F77, [test "x$F77" != xno])
+
 LT_AC_PROG_GCJ
 AM_CONDITIONAL(HAVE_GCJ, [test "x$GCJ" != xno])

diff -u -N -P -r libtool.vanilla/f77demo/Makefile.am
libtool/f77demo/Makefile.am
--- libtool.vanilla/f77demo/Makefile.am Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/Makefile.am Tue Jan 22 23:00:29 2002
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+##
+## $Id$
+
+AUTOMAKE_OPTIONS = no-dependencies foreign
+
+EXTRA_DIST = acinclude.m4
+
+noinst_LTLIBRARIES = libfoo.la libmix.la
+
+libfoo_la_SOURCES = foof.f
+libmix_la_SOURCES = foof.f fooc.c
+
+noinst_HEADERS = foo.h
+
+bin_PROGRAMS = fprogram cprogram
+
+fprogram_SOURCES = fprogram.f
+fprogram_LDADD = libfoo.la
+
+cprogram_SOURCES = cprogram.c
+cprogram_LDADD = libmix.la
+
+$(OBJECTS): libtool
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
+
+
+
+
+
diff -u -N -P -r libtool.vanilla/f77demo/README libtool/f77demo/README
--- libtool.vanilla/f77demo/README Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/README Tue Jan 22 23:00:29 2002
@@ -0,0 +1,16 @@
+This is a short demo of the fortran support in libtool.
+
+fprogram is a pure-fortran program which is linked
+against the fortran-only library libfoo.la
+
+cprogram is a C program, which is linked against the
+mixed C and fortran library libmix.la. The program
+calls a C function, which in turn calls a fortran
+function.
+
+This demo requires GNU autoconf, automake,
+libtool with the F77 tag and quite obvious Fortran 77.
+
+
+
+
diff -u -N -P -r libtool.vanilla/f77demo/configure.ac
libtool/f77demo/configure.ac
--- libtool.vanilla/f77demo/configure.ac Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/configure.ac Tue Jan 22 23:00:29 2002
@@ -0,0 +1,69 @@
+## Process this file with autoconf to create configure. -*- autoconf
-*-
+# Copyright 2001  Free Software Foundation, Inc.
+#
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307  USA
+
+AC_PREREQ(2.50)
+
+## ------------------------ ##
+## Autoconf initialisation. ##
+## ------------------------ ##
+AC_INIT([f77demo], [0.1], address@hidden)
+AC_CONFIG_SRCDIR([foof.f])dnl
+
+## ------------------------ ##
+## Automake Initialisation. ##
+## ------------------------ ##
+AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
+
+
+## ------------------ ##
+## C compiler checks. ##
+## ------------------ ##
+AC_PROG_CC
+
+## ------------------------ ##
+## Fortran compiler checks. ##
+## ------------------------ ##
+AC_PROG_F77
+dnl Check the flags needed to link f77 programs with ld (i.e. cc)
+AC_F77_LIBRARY_LDFLAGS
+dnl Check for underscoring of external names
+AC_F77_WRAPPERS
+
+# As of the writing of this demo, GNU Autoconf's AC_OBJEXT and
+# AC_EXEEXT macros only works for C compilers!
+# Libtool's setup macro calls AC_OBJEXT and AC_EXEEXT without setting
+# the test language to C.  We do it before any libtool setup macros are

+# called so that the proper values are cached beforehand.  We also do
+# it before any linker flags (LDFLAGS) are set so that fortran specific

+# ones don't break the tests.
+AC_LANG_PUSH([C])
+AC_OBJEXT
+AC_EXEEXT
+AC_LANG_POP
+
+## ----------------------- ##
+## Libtool initialisation. ##
+## ----------------------- ##
+AM_PROG_LIBTOOL
+AC_SUBST([LIBTOOL_DEPS])
+
+## -------- ##
+## Outputs. ##
+## -------- ##
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff -u -N -P -r libtool.vanilla/f77demo/cprogram.c
libtool/f77demo/cprogram.c
--- libtool.vanilla/f77demo/cprogram.c Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/cprogram.c Tue Jan 22 23:00:29 2002
@@ -0,0 +1,46 @@
+/*
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+USA. */
+
+#include "foo.h"
+
+int
+main(int argc, char **argv)
+{
+  int arg,cres,fres;
+
+  printf ("Welcome to GNU libtool mixed C/Fortran demo!\n");
+
+  arg=2;
+
+  cres=csub(arg);
+
+  printf ("The C subroutine returned, claiming that 2*%d =
%d\n",arg,cres);
+
+  if(cres==2*arg)
+    printf ("The C subroutine is ok!\n");
+
+  printf("\nCalling the C wrapper routine...\n");
+  fres=fwrapper(arg);
+
+  printf ("The C wrapper to the fortran subroutine returned,\n"
+   "claiming that 2*%d = %d\n",arg,fres);
+
+  if(fres==2*arg)
+    printf ("The Fortran 77 subroutine is ok!\n");
+
+  return 0;
+}
+
diff -u -N -P -r libtool.vanilla/f77demo/foo.h libtool/f77demo/foo.h
--- libtool.vanilla/f77demo/foo.h Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/foo.h Tue Jan 22 23:00:29 2002
@@ -0,0 +1,47 @@
+/* foo.h -- interface to fortran and C libraries
+   Copyright (C) 1998-1999 Free Software Foundation, Inc.
+   This file is part of GNU Libtool.
+
+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, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+USA. */
+
+#ifndef _FOO_H_
+#define _FOO_H_ 1
+
+/* config.h is necessary for the fortran name mangling */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* csub is an extremely useful subroutine that
+ * returns the argument multiplied by two :-)
+ */
+extern int csub(int);
+
+/* This routine performs the same action, but
+ * calls the fortran subroutine fsub to do the
+ * real work.
+ */
+extern int fwrapper(int);
+
+/* fsub does the same thing as csub, i.e. res=arg*2.
+ * Use autoconf macro for fortran function names.
+ * Note that fortran passes args by reference, so
+ * you need to provide pointers to your ints.
+ */
+extern void F77_FUNC(fsub,FSUB)(int *arg, int *res);
+
+
+#endif
diff -u -N -P -r libtool.vanilla/f77demo/fooc.c libtool/f77demo/fooc.c
--- libtool.vanilla/f77demo/fooc.c Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/fooc.c Tue Jan 22 23:00:29 2002
@@ -0,0 +1,17 @@
+#include "foo.h"
+
+
+int csub(int arg)
+{
+  return (2*arg);
+}
+
+
+int fwrapper(int arg)
+{
+  int res;
+  printf("Calling the Fortran 77 subroutine from the C wrapper...\n");
+  F77_FUNC(fsub,FSUB)(&arg,&res);
+  printf("Returned from the Fortran 77 subroutine...\n");
+  return res;
+}
diff -u -N -P -r libtool.vanilla/f77demo/foof.f libtool/f77demo/foof.f
--- libtool.vanilla/f77demo/foof.f Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/foof.f Tue Jan 22 23:00:29 2002
@@ -0,0 +1,13 @@
+C
+C This program is free software; you can redistribute it and/or
+C modify it under the terms of the GNU General Public License
+C as published by the Free Software Foundation; either version 2
+C of the License, or (at your option) any later version.
+C
+
+      subroutine fsub(arg,res)
+      implicit none
+      integer*4 arg,res
+      res=arg*2
+      return
+      end
diff -u -N -P -r libtool.vanilla/f77demo/fprogram.f
libtool/f77demo/fprogram.f
--- libtool.vanilla/f77demo/fprogram.f Wed Dec 31 16:00:00 1969
+++ libtool/f77demo/fprogram.f Tue Jan 22 23:00:29 2002
@@ -0,0 +1,27 @@
+C
+C This program is free software; you can redistribute it and/or
+C modify it under the terms of the GNU General Public License
+C as published by the Free Software Foundation; either version 2
+C of the License, or (at your option) any later version.
+C
+
+      program fprogram
+      implicit none
+      integer*4 arg,res
+
+      write(*,*) 'Welcome to GNU libtool Fortran demo!'
+      write(*,*) 'Real programmers write in FORTRAN.'
+      arg=2
+
+      call fsub(arg,res)
+
+      write(*,*) 'fsub returned, saying that 2 *',arg,' =',res
+
+      if (res.eq.4) then
+         write(*,*) 'fsub is ok!'
+      endif
+
+      stop
+      end
+
+
diff -u -N -P -r libtool.vanilla/libtool.m4 libtool/libtool.m4
--- libtool.vanilla/libtool.m4 Tue Jan 22 23:26:45 2002
+++ libtool/libtool.m4 Tue Jan 22 23:00:28 2002
@@ -34,6 +34,11 @@
     [AC_LIBTOOL_CXX],
     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
   ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])

 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.

 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded,
run
@@ -59,6 +64,7 @@
 AC_DEFUN([_AC_PROG_LIBTOOL],
 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl

 # This can be used to rebuild libtool when needed
@@ -510,7 +516,7 @@
   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $3"
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
    if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then
      # The compiler can only warn and ignore the option if not
recognized
      # So say no if there are warnings
@@ -542,7 +548,7 @@
   [$2=no
    save_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext;
then
      # The compiler can only warn and ignore the option if not
recognized
      # So say no if there are warnings
@@ -829,9 +835,11 @@
      CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"],
    [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS"
      CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"],
+          [$1],[F77],[save_FFLAGS="$FFLAGS"
+                   FFLAGS="$FFLAGS -o out/conftest2.$ac_objext"],
    [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS"
      GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext

    # According to Tom Tromey, Ian Lance Taylor reported there are C
compilers
    # that will create temporary files in the current directory
regardless of
@@ -853,6 +861,7 @@
    fi
    ifelse([$1],[],[CFLAGS="$save_CFLAGS"],
    [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"],
+          [$1],[F77],[FFLAGS="$save_FFLAGS"],
    [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"])
    chmod u+w .
    $rm conftest* out/*
@@ -1419,9 +1428,9 @@
 AC_DEFUN([_LT_AC_TAGCONFIG],
 [AC_ARG_WITH([tags],
     [AC_HELP_STRING([--with-tags=TAGS],
- [include additional configurations @<:@CXX,GCJ@:>@])],
+ [include additional configurations @<:@CXX,F77,GCJ@:>@])],
     [tagnames="$withval"],
-    [tagnames="CXX,GCJ"
+    [tagnames="CXX,F77,GCJ"
     case $host_os in
       mingw*|cygwin*) tagnames="$tagnames,RC" ;;
     esac])
@@ -1468,6 +1477,10 @@
  AC_LIBTOOL_LANG_CXX_CONFIG
  ;;

+      F77)
+        AC_LIBTOOL_LANG_F77_CONFIG
+        ;;
+
       GCJ)
  AC_LIBTOOL_LANG_GCJ_CONFIG
  ;;
@@ -2170,6 +2183,21 @@
 ])# _LT_AC_LANG_CXX


+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+])# _LT_AC_LANG_F77
+
+
 # AC_LIBTOOL_GCJ
 # --------------
 # enable support for GCJ libraries
@@ -2216,10 +2244,10 @@
 _LT_AC_TAGVAR(objext, $1)=$objext

 # Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
+lt_simple_compile_test_code="int some_variable = 0;\n"

 # Code to be used in simple link tests
-lt_simple_link_test_code='main(){return(0);}'
+lt_simple_link_test_code='main(){return(0);}\n'

 _LT_AC_SYS_COMPILER

@@ -2346,10 +2374,10 @@
 _LT_AC_TAGVAR(objext, $1)=$objext

 # Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
+lt_simple_compile_test_code="int some_variable = 0;\n"

 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(int char *[]) { return(0); }'
+lt_simple_link_test_code='int main(int char *[]) { return(0); }\n'

 # ltmain only uses $CC for tagged configurations so make sure $CC is
set.
 _LT_AC_SYS_COMPILER
@@ -3136,6 +3164,101 @@
 ])# AC_LIBTOOL_LANG_CXX_CONFIG


+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n
end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is
set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+set dummy $CC
+compiler="[$]2"
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace,
and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
 # AC_LIBTOOL_LANG_GCJ_CONFIG
 # --------------------------
 # Ensure that the configuration vars for the C compiler are
@@ -3153,10 +3276,10 @@
 _LT_AC_TAGVAR(objext, $1)=$objext

 # Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
+lt_simple_compile_test_code="class foo {}\n"

 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void
main(String[] argv) {}; }'
+lt_simple_link_test_code='public class conftest { public static void
main(String[] argv) {}; }\n'

 # ltmain only uses $CC for tagged configurations so make sure $CC is
set.
 _LT_AC_SYS_COMPILER
@@ -3209,7 +3332,7 @@
 _LT_AC_TAGVAR(objext, $1)=$objext

 # Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100,
CHECKED }'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100,
CHECKED }\n'

 # Code to be used in simple link tests
 lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -4289,7 +4412,7 @@
 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag
$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)], [],
     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
      "" | " "*) ;;
      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="
$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
@@ -4303,7 +4426,11 @@
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
   *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic,
$1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC"
+    AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC define -DPIC works],
+    _LT_AC_TAGVAR(lt_prog_compiler_picdef_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic,
$1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC"],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic,
$1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"])
     ;;
 esac
 ])
diff -u -N -P -r libtool.vanilla/tests/Makefile.am
libtool/tests/Makefile.am
--- libtool.vanilla/tests/Makefile.am Tue Jan 22 23:26:45 2002
+++ libtool/tests/Makefile.am Tue Jan 22 23:00:29 2002
@@ -7,6 +7,11 @@
  tagdemo-conf.test tagdemo-make.test tagdemo-exec.test \
  tagdemo-shared.test tagdemo-make.test tagdemo-exec.test

+F77_TESTS = \
+ f77demo-static.test f77demo-make.test f77demo-exec.test \
+ f77demo-conf.test f77demo-make.test f77demo-exec.test \
+ f77demo-shared.test f77demo-make.test f77demo-exec.test
+
 COMMON_TESTS = \
  cdemo-static.test cdemo-make.test cdemo-exec.test \
  demo-static.test demo-make.test demo-exec.test \
@@ -41,10 +46,18 @@
  pdemo-make.test pdemo-exec.test pdemo-inst.test

 if HAVE_CXX
+if HAVE_F77
+TESTS = $(COMMON_TESTS) $(CXX_TESTS) $(F77_TESTS)
+else
 TESTS = $(COMMON_TESTS) $(CXX_TESTS)
+endif
+else
+if HAVE_F77
+TESTS = $(COMMON_TESTS) $(F77_TESTS)
 else
 TESTS = $(COMMON_TESTS)
 endif
+endif

 demo-conf.test: $(top_builddir)/libtool

@@ -56,14 +69,17 @@
 CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
+if HAVE_F77
+  FFLAGS = @FFLAGS@
+endif

 # Be sure to reexport important environment variables.
 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
  CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
  LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
- OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)"
+ OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" FFLAGS="$(FFLAGS)"

-EXTRA_DIST = defs $(COMMON_TESTS) $(CXX_TESTS)
+EXTRA_DIST = defs $(COMMON_TESTS) $(CXX_TESTS) $(F77_TESTS)

 # We need to remove any files that the above tests created.
 clean-local:
@@ -73,4 +89,5 @@
  -test -f ../depdemo/Makefile && cd ../depdemo && $(MAKE) distclean
  -test -f ../mdemo/Makefile && cd ../mdemo && $(MAKE) distclean
  -test -f ../tagdemo/Makefile && cd ../tagdemo && $(MAKE) distclean
+ -test -f ../f77demo/Makefile && cd ../f77demo && $(MAKE) distclean
  rm -rf _inst
diff -u -N -P -r libtool.vanilla/tests/f77demo-conf.test
libtool/tests/f77demo-conf.test
--- libtool.vanilla/tests/f77demo-conf.test Wed Dec 31 16:00:00 1969
+++ libtool/tests/f77demo-conf.test Tue Jan 22 23:00:29 2002
@@ -0,0 +1,35 @@
+#! /bin/sh
+# f77demo-conf.test - try configuring the ../f77demo subdirectory
+
+# Test script header.
+need_prefix=yes
+if test -z "$srcdir"; then
+  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+  test "$srcdir" = "$0" && srcdir=.
+  test "${VERBOSE+set}" != "set" && VERBOSE=yes
+fi
+. $srcdir/defs || exit 1
+
+# Maybe we have a VPATH build, in which case, create a new subdir.
+test -d ../f77demo || mkdir ../f77demo
+
+# Change to our build directory.
+cd ../f77demo || exit 1
+
+# Possibly clean up the distribution.
+if test -f Makefile; then
+  echo "= Running $make distclean in ../f77demo"
+  $make distclean
+fi
+rm -f config.cache
+
+# Configure the demonstration.
+echo "= Configuring in ../f77demo (prefix=$prefix)"
+CONFIG_SITE=/dev/null/config/site ${CONFIG_SHELL-/bin/sh}
$srcdir/../f77demo/configure --srcdir=$srcdir/../f77demo
--prefix=$prefix || exit 1
+
+if egrep '^build_old_libs=yes' libtool > /dev/null &&
+   egrep '^build_libtool_libs=yes' libtool > /dev/null; then :
+else rm -f Makefile && exit 77
+fi
+
+exit 0
diff -u -N -P -r libtool.vanilla/tests/f77demo-exec.test
libtool/tests/f77demo-exec.test
--- libtool.vanilla/tests/f77demo-exec.test Wed Dec 31 16:00:00 1969
+++ libtool/tests/f77demo-exec.test Tue Jan 22 23:00:29 2002
@@ -0,0 +1,34 @@
+#! /bin/sh
+# f77demo-exec.test - check that programs in the ../f77demo
subdirectory are viable
+
+# Test script header.
+need_prefix=no
+if test -z "$srcdir"; then
+  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+  test "$srcdir" = "$0" && srcdir=.
+  test "${VERBOSE+set}" != "set" && VERBOSE=yes
+fi
+. $srcdir/defs || exit 1
+
+if test -f ../f77demo/fprogram -a -f ../f77demo/cprogram; then :
+else
+  echo "You must run f77demo-make.test before running $0" 1>&2
+  exit 77
+fi
+
+# Check to see if the programs really run.
+echo "Executing uninstalled programs in ../f77demo"
+
+if ../f77demo/fprogram ; then :
+else
+  echo "$0: cannot execute ../f77demo/fprogram" 1>&2
+  status=1
+fi
+
+if ../f77demo/cprogram ; then :
+else
+  echo "$0: cannot execute ../f77demo/cprogram" 1>&2
+  status=1
+fi
+
+exit $status
diff -u -N -P -r libtool.vanilla/tests/f77demo-make.test
libtool/tests/f77demo-make.test
--- libtool.vanilla/tests/f77demo-make.test Wed Dec 31 16:00:00 1969
+++ libtool/tests/f77demo-make.test Tue Jan 22 23:00:29 2002
@@ -0,0 +1,25 @@
+#! /bin/sh
+# f77demo-make.test - try building in the ../f77demo subdirectory
+
+# Test script header.
+need_prefix=no
+if test -z "$srcdir"; then
+  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+  test "$srcdir" = "$0" && srcdir=.
+  test "${VERBOSE+set}" != "set" && VERBOSE=yes
+fi
+. $srcdir/defs || exit 1
+
+if test -f ../f77demo/Makefile; then :
+else
+  echo "You must run f77demo-conf.test before running $0" 1>&2
+  exit 77
+fi
+
+# Change to our build directory.
+cd ../f77demo || exit 1
+
+# Do the actual build.
+echo "Making in ../f77demo"
+$make || exit 1
+exit 0
diff -u -N -P -r libtool.vanilla/tests/f77demo-shared.test
libtool/tests/f77demo-shared.test
--- libtool.vanilla/tests/f77demo-shared.test Wed Dec 31 16:00:00 1969
+++ libtool/tests/f77demo-shared.test Tue Jan 22 23:00:29 2002
@@ -0,0 +1,35 @@
+#! /bin/sh
+# f77demo-conf.test - try configuring the ../f77demo subdirectory
+
+# Test script header.
+need_prefix=yes
+if test -z "$srcdir"; then
+  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+  test "$srcdir" = "$0" && srcdir=.
+  test "${VERBOSE+set}" != "set" && VERBOSE=yes
+fi
+. $srcdir/defs || exit 1
+
+# Maybe we have a VPATH build, in which case, create a new subdir.
+test -d ../f77demo || mkdir ../f77demo
+
+# Change to our build directory.
+cd ../f77demo || exit 1
+
+# Possibly clean up the distribution.
+if test -f Makefile; then
+  echo "= Running $make distclean in ../f77demo"
+  $make distclean
+fi
+rm -f config.cache
+
+# Configure the demonstration.
+echo "= Configuring in ../f77demo (prefix=$prefix) with
--disable-static"
+CONFIG_SITE=/dev/null/config/site ${CONFIG_SHELL-/bin/sh}
$srcdir/../f77demo/configure --srcdir=$srcdir/../f77demo
--prefix=$prefix --disable-static || exit 1
+
+if egrep '^build_old_libs=no' libtool > /dev/null &&
+   egrep '^build_libtool_libs=yes' libtool > /dev/null; then :
+else rm -f Makefile && exit 77
+fi
+
+exit 0
diff -u -N -P -r libtool.vanilla/tests/f77demo-static.test
libtool/tests/f77demo-static.test
--- libtool.vanilla/tests/f77demo-static.test Wed Dec 31 16:00:00 1969
+++ libtool/tests/f77demo-static.test Tue Jan 22 23:00:29 2002
@@ -0,0 +1,44 @@
+#! /bin/sh
+# f77demo-conf.test - try configuring the ../f77demo subdirectory
+
+# Test script header.
+need_prefix=yes
+if test -z "$srcdir"; then
+  srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
+  test "$srcdir" = "$0" && srcdir=.
+  test "${VERBOSE+set}" != "set" && VERBOSE=yes
+fi
+. $srcdir/defs || exit 1
+
+# Maybe we have a VPATH build, in which case, create a new subdir.
+test -d ../f77demo || mkdir ../f77demo
+
+# Change to our build directory.
+cd ../f77demo || exit 1
+
+# Possibly clean up the distribution.
+if test -f Makefile; then
+  echo "= Running $make distclean in ../f77demo"
+  $make distclean
+fi
+rm -f config.cache
+
+# Configure the demonstration.
+echo "= Configuring in ../f77demo (prefix=$prefix) with
--disable-shared"
+CONFIG_SITE=/dev/null/config/site ${CONFIG_SHELL-/bin/sh}
$srcdir/../f77demo/configure --srcdir=$srcdir/../f77demo
--prefix=$prefix --disable-shared || exit 1
+
+if egrep '^build_old_libs=yes' libtool > /dev/null &&
+   egrep '^build_libtool_libs=no' libtool > /dev/null; then :
+else rm -f Makefile && exit 77
+fi
+
+exit 0
+
+
+
+
+
+
+
+
+







reply via email to

[Prev in Thread] Current Thread [Next in Thread]