Commit dedc4a53 by Juergen Pfeifer Committed by Toon Moene

Make libf2c a shared library (gcc/f directory).

2001-09-29  Juergen Pfeifer  <juergen.pfeifer@gmx.net>

	Make libf2c a shared library (gcc/f directory).

	* Make-lang.in: Pass define of frtbegin.o to compilation of g77spec.c.
	* g77spec.c (lang_specific_driver): Treat linking in of frtbegin.o.

2001-09-29  Juergen Pfeifer  <juergen.pfeifer@gmx.net>
            Toon Moene  <toon@moene.indiv.nluug.nl>

	Make libf2c a shared library (libf2c directory).

	* aclocal.m4: Get definition of libtool.
	* Makefile.in: Use libtool.
	* configure.in: Use libtool.
	* configure: Regenerated.
	* libF77/Makefile.in: Use libtool; treat main program contained in
	libF77/main.c specially.
	* libF77/configure.in: Use libtool.
	* libF77/configure: Regenerated.
	* libI77/Makefile.in: Use libtool.
	* libI77/configure.in: Use libtool.
	* libI77/configure: Regenerated.
	* libU77/Makefile.in: Use libtool.
	* libU77/configure.in: Use libtool.
	* libU77/configure: Regenerated.
	* libU77/date_.c: Adapt for -fPIC compiling.
	* libU77/vxtidate_.c: Ditto.

From-SVN: r45913
parent e9449401
2001-09-29 Juergen Pfeifer <juergen.pfeifer@gmx.net>
Make libf2c a shared library.
* Make-lang.in: Pass define of frtbegin.o to compilation of g77spec.c.
* g77spec.c (lang_specific_driver): Treat linking in of frtbegin.o.
2001-09-28 Robert Anderson <rwa@alumni.princeton.edu> 2001-09-28 Robert Anderson <rwa@alumni.princeton.edu>
* expr.c (ffeexpr_sym_rhs_dimlist_): Allow array elements * expr.c (ffeexpr_sym_rhs_dimlist_): Allow array elements
......
...@@ -73,6 +73,7 @@ g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h $(SYSTEM_H) $(GCC_H) \ ...@@ -73,6 +73,7 @@ g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h $(SYSTEM_H) $(GCC_H) \
esac esac
if [ -f lang-f77 ]; then \ if [ -f lang-f77 ]; then \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DFORTRAN_INIT=\"$(libsubdir)/frtbegin.o\" \
$(srcdir)/f/g77spec.c $(OUTPUT_OPTION); \ $(srcdir)/f/g77spec.c $(OUTPUT_OPTION); \
else true; fi else true; fi
......
...@@ -286,6 +286,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -286,6 +286,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
2 => last two args were -l<library> -lm. */ 2 => last two args were -l<library> -lm. */
int saw_library = 0; int saw_library = 0;
/* 0 => initial/reset state
1 => FORTRAN_INIT linked in */
int use_init = 0;
/* By default, we throw on the math library if we have one. */ /* By default, we throw on the math library if we have one. */
int need_math = (MATH_LIBRARY[0] != '\0'); int need_math = (MATH_LIBRARY[0] != '\0');
...@@ -518,8 +521,15 @@ For bug reporting instructions, please see:\n\ ...@@ -518,8 +521,15 @@ For bug reporting instructions, please see:\n\
if (saw_library == 1) if (saw_library == 1)
saw_library = 2; /* -l<library> -lm. */ saw_library = 2; /* -l<library> -lm. */
else else
{
if (0 == use_init)
{
append_arg (FORTRAN_INIT);
use_init = 1;
}
append_arg (FORTRAN_LIBRARY); append_arg (FORTRAN_LIBRARY);
} }
}
else if (strcmp (argv[i], FORTRAN_LIBRARY) == 0) else if (strcmp (argv[i], FORTRAN_LIBRARY) == 0)
saw_library = 1; /* -l<library>. */ saw_library = 1; /* -l<library>. */
else else
...@@ -542,6 +552,11 @@ For bug reporting instructions, please see:\n\ ...@@ -542,6 +552,11 @@ For bug reporting instructions, please see:\n\
switch (saw_library) switch (saw_library)
{ {
case 0: case 0:
if (0 == use_init)
{
append_arg (FORTRAN_INIT);
use_init = 1;
}
append_arg (library); append_arg (library);
case 1: case 1:
if (need_math) if (need_math)
......
...@@ -31,8 +31,16 @@ target_alias = @target_alias@ ...@@ -31,8 +31,16 @@ target_alias = @target_alias@
gcc_version = @gcc_version@ gcc_version = @gcc_version@
gcc_version_trigger = @gcc_version_trigger@ gcc_version_trigger = @gcc_version_trigger@
top_builddir = .
libdir = $(exec_prefix)/lib libdir = $(exec_prefix)/lib
libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
#
VERSION_MAJOR=0
VERSION_MINOR=5
# We'd rather had 27 here - to indicate the version at which
# a shared libf2c was created; however, libtool doesn't accept this.
VERSION_SUB=0
# Multilib support variables. # Multilib support variables.
MULTISRCTOP = MULTISRCTOP =
...@@ -49,11 +57,7 @@ INSTALL = @INSTALL@ ...@@ -49,11 +57,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
AR = @AR@ LIBTOOL = @LIBTOOL@
AR_FLAGS = rc
RANLIB = @RANLIB@
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
...@@ -61,9 +65,9 @@ CFLAGS = @CFLAGS@ ...@@ -61,9 +65,9 @@ CFLAGS = @CFLAGS@
# Quote this way so that it can be used to set shell variables too. # Quote this way so that it can be used to set shell variables too.
FLAGS_TO_PASS= \ FLAGS_TO_PASS= \
CC='$(CC)' \ CC='$(CC)' \
LIBTOOL='$(LIBTOOL)' \
CFLAGS='$(CFLAGS)' \ CFLAGS='$(CFLAGS)' \
CPPFLAGS='$(CPPFLAGS)' \ CPPFLAGS='$(CPPFLAGS)' \
AR='$(AR)' \
RANLIB='$(RANLIB)' \ RANLIB='$(RANLIB)' \
prefix='$(prefix)' \ prefix='$(prefix)' \
exec_prefix='$(exec_prefix)' \ exec_prefix='$(exec_prefix)' \
...@@ -71,7 +75,8 @@ FLAGS_TO_PASS= \ ...@@ -71,7 +75,8 @@ FLAGS_TO_PASS= \
libsubdir='$(libsubdir)' \ libsubdir='$(libsubdir)' \
tooldir='$(tooldir)' tooldir='$(tooldir)'
LIBG2C = libg2c.a LIBG2C_BASE = libg2c
LIBG2C = $(LIBG2C_BASE).la
SUBDIRS = libI77 libF77 libU77 SUBDIRS = libI77 libF77 libU77
...@@ -132,14 +137,20 @@ i77 f77 u77: g2c.h ...@@ -132,14 +137,20 @@ i77 f77 u77: g2c.h
# always have been created by a successful `all-unilib'. # always have been created by a successful `all-unilib'.
$(LIBG2C): s-libi77 s-libf77 s-libu77 s-libe77 $(LIBG2C): s-libi77 s-libf77 s-libu77 s-libe77
rm -f $(LIBG2C) rm -f $@ ;\
set -e; \ set -e; \
for i in $(SUBDIRS); \ rm -f objlist ;\
do (cd $$i && $(MAKE) $(FLAGS_TO_PASS) LIBG2C=../$(LIBG2C) archive); \ touch objlist ;\
done for i in $(SUBDIRS) ;\
objs=""; for i in $(F2CEXT); do objs="$$objs libE77/L$$i.o"; done; \ do \
$(AR) $(AR_FLAGS) $(LIBG2C) $$objs (cd $$i && $(MAKE) $(FLAGS_TO_PASS) objlist) ;\
$(RANLIB) $(LIBG2C) done ;\
objs="`cat objlist`" ;\
for i in $(F2CEXT); do objs="$$objs libE77/L$$i.lo"; done ;\
echo -n $$objs > objlist
$(LIBTOOL) --mode=link $(CC) -o $@ \
-version-info $(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_SUB) \
-rpath $(prefix)/lib `cat objlist` -lc -lm
i77: i77:
cd libI77; $(MAKE) $(FLAGS_TO_PASS) all cd libI77; $(MAKE) $(FLAGS_TO_PASS) all
...@@ -151,13 +162,13 @@ u77: ...@@ -151,13 +162,13 @@ u77:
cd libU77; $(MAKE) $(FLAGS_TO_PASS) all cd libU77; $(MAKE) $(FLAGS_TO_PASS) all
s-libe77: f2cext.c s-libe77: f2cext.c
if [ -d libE77 ]; then rm -f libE77/*.o; else mkdir libE77; fi if [ -d libE77 ]; then rm -f libE77/*.o libE77/*.lo; else mkdir libE77; fi
for name in $(F2CEXT); \ for name in $(F2CEXT); \
do \ do \
echo $${name}; \ echo $${name}; \
$(CC) -c -I. -I$(srcdir) -I../../include $(CPPFLAGS) $(CFLAGS) \ $(LIBTOOL) --mode=compile $(CC) -c -I. -I$(srcdir) -I../../include \
-DL$${name} $(srcdir)/f2cext.c \ $(CPPFLAGS) $(CFLAGS) -DL$${name} $(srcdir)/f2cext.c \
-o libE77/L$${name}.o; \ -o libE77/L$${name}.o ; \
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
done done
echo timestamp >s-libe77 echo timestamp >s-libe77
...@@ -194,9 +205,12 @@ check: ...@@ -194,9 +205,12 @@ check:
cd libU77; $(MAKE) G77DIR=../../../gcc/ check cd libU77; $(MAKE) G77DIR=../../../gcc/ check
install: all install: all
$(INSTALL_DATA) $(LIBG2C) $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C).n $(LIBTOOL) --mode=install $(INSTALL_DATA) $(LIBG2C) $(libsubdir)/$(MULTISUBDIR)
( cd $(libsubdir)/$(MULTISUBDIR) ; $(RANLIB) $(LIBG2C).n ) (cd $(libsubdir)/$(MULTISUBDIR) ; \
mv -f $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C).n $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C) if [ -f $(LIBG2C_BASE).so ]; then \
mv $(LIBG2C_BASE).so* $(prefix)/lib ;\
fi)
$(INSTALL_DATA) frtbegin.o $(libsubdir)
$(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h $(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h
@if [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ]; then \ @if [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ]; then \
echo ''; \ echo ''; \
...@@ -208,16 +222,18 @@ install: all ...@@ -208,16 +222,18 @@ install: all
echo ''; \ echo ''; \
else true; fi else true; fi
$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@" $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
@-$(LIBTOOL) --mode=finish $(prefix)/lib
install-strip: install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
uninstall: uninstall:
rm -f $(libsubdir)/$(MULTISUBDIR)/include/g2c.h $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C) rm -f $(libsubdir)/$(MULTISUBDIR)/include/g2c.h $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C_BASE).*
rm -f $(prefix)/lib/$(LIBG2C_BASE).so*
$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@" $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
mostlyclean: mostlyclean:
rm -f $(LIBG2C) rm -f $(LIBG2C) objlist
$(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \ $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
$(MULTICLEAN) multi-clean DO=$@ $(MULTICLEAN) multi-clean DO=$@
rm -fr libE77 s-libe77 rm -fr libE77 s-libe77
...@@ -226,6 +242,7 @@ clean: mostlyclean ...@@ -226,6 +242,7 @@ clean: mostlyclean
rm -f config.log rm -f config.log
$(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \ $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
$(MULTICLEAN) multi-clean DO=$@ $(MULTICLEAN) multi-clean DO=$@
rm -rf .libs
distclean: clean distclean: clean
rm -f g2c.h s-libe77 rm -f g2c.h s-libe77
......
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
dnl add a definition of LIBTOOL to Makefile.in.
ifelse(,,,[AC_SUBST(LIBTOOL)
AC_DEFUN([AM_PROG_LIBTOOL])
])
...@@ -73,6 +73,7 @@ define([AC_PROG_CC_WORKS],[]) ...@@ -73,6 +73,7 @@ define([AC_PROG_CC_WORKS],[])
# the makefiles # the makefiles
AC_PROG_CC AC_PROG_CC
AM_PROG_LIBTOOL
dnl These should be inherited in the recursive make, but ensure they are dnl These should be inherited in the recursive make, but ensure they are
dnl defined: dnl defined:
......
...@@ -31,15 +31,11 @@ VPATH = @srcdir@ ...@@ -31,15 +31,11 @@ VPATH = @srcdir@
# configuration. # configuration.
DEFS = @DEFS@ DEFS = @DEFS@
LIBG2C = ../libg2c.a
F2C_H_DIR = @srcdir@/.. F2C_H_DIR = @srcdir@/..
G2C_H_DIR = .. G2C_H_DIR = ..
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
AR = @AR@
ARFLAGS = rc
@SET_MAKE@ @SET_MAKE@
SHELL = /bin/sh SHELL = /bin/sh
...@@ -52,9 +48,9 @@ ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $ ...@@ -52,9 +48,9 @@ ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $
.SUFFIXES: .c .o .SUFFIXES: .c .o
.c.o: .c.o:
$(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $< @LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
MISC = F77_aloc.o VersionF.o main.o s_rnge.o abort_.o getarg_.o iargc_.o\ MISC = F77_aloc.o VersionF.o s_rnge.o abort_.o getarg_.o iargc_.o\
getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\ getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\
derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o setarg.o setsig.o derf_.o derfc_.o erf_.o erfc_.o sig_die.o exit_.o setarg.o setsig.o
POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o \ POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o \
...@@ -80,20 +76,24 @@ F90BIT = lbitbits.o lbitshft.o qbitbits.o qbitshft.o ...@@ -80,20 +76,24 @@ F90BIT = lbitbits.o lbitshft.o qbitbits.o qbitshft.o
OBJS = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ OBJS = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
$(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT) $(HALF) $(CMP) $(EFL) $(CHAR) $(F90BIT)
all: ../s-libf77 all: ../s-libf77 ../frtbegin.o
../s-libf77: $(OBJS) ../s-libf77: $(OBJS)
echo timestamp > ../s-libf77 echo timestamp > ../s-libf77
archive: objlist:
$(AR) $(ARFLAGS) $(LIBG2C) $(OBJS) objs="`cat ../objlist`" ; for i in $(OBJS) ; do \
x=`echo $$i | sed -e "s/\.o$$/.lo/g"` ;\
objs="$$objs libF77/$$x" ;\
done ; \
echo -n $$objs > ../objlist
Makefile: Makefile.in config.status Makefile: Makefile.in config.status
$(SHELL) config.status $(SHELL) config.status
config.status: configure config.status: configure
rm -f config.cache rm -f config.cache
CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ CONFIG_SITE=no-such-file CC='$(CC)' CFLAGS='$(CFLAGS)' \
CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
${srcdir}/configure: configure.in ${srcdir}/configure: configure.in
...@@ -101,10 +101,12 @@ ${srcdir}/configure: configure.in ...@@ -101,10 +101,12 @@ ${srcdir}/configure: configure.in
cd ${srcdir} && autoconf cd ${srcdir} && autoconf
VersionF.o: Version.c VersionF.o: Version.c
$(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c @LIBTOOL@ --mode=compile $(CC) -c $(ALL_CFLAGS) $(srcdir)/Version.c -o $@
../frtbegin.o : main.c
$(CC) -c $(ALL_CFLAGS) $(srcdir)/main.c -o $@
F77_aloc.o: F77_aloc.c F77_aloc.o: F77_aloc.c
main.o: main.c
s_rnge.o: s_rnge.c s_rnge.o: s_rnge.c
abort_.o: abort_.c abort_.o: abort_.c
getarg_.o: getarg_.c getarg_.o: getarg_.c
...@@ -232,7 +234,8 @@ $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) \ ...@@ -232,7 +234,8 @@ $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(EFL) \
check install uninstall install-strip dist installcheck installdirs: check install uninstall install-strip dist installcheck installdirs:
mostlyclean: mostlyclean:
rm -f *.o rm -f *.o *.lo ../frtbegin.o
rm -rf .libs
clean: mostlyclean clean: mostlyclean
rm -f config.log rm -f config.log
......
...@@ -32,6 +32,9 @@ define([AC_PROG_CC_WORKS],[]) ...@@ -32,6 +32,9 @@ define([AC_PROG_CC_WORKS],[])
# the makefiles # the makefiles
AC_PROG_CC AC_PROG_CC
LIBTOOL='$(SHELL) ../libtool'
AC_SUBST(LIBTOOL)
test "$AR" || AR=ar test "$AR" || AR=ar
AC_SUBST(AR) AC_SUBST(AR)
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
......
...@@ -31,15 +31,11 @@ VPATH = @srcdir@ ...@@ -31,15 +31,11 @@ VPATH = @srcdir@
# configuration. # configuration.
DEFS = @DEFS@ DEFS = @DEFS@
LIBG2C = ../libg2c.a
F2C_H_DIR = @srcdir@/.. F2C_H_DIR = @srcdir@/..
G2C_H_DIR = .. G2C_H_DIR = ..
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
AR = @AR@
ARFLAGS = rc
@SET_MAKE@ @SET_MAKE@
SHELL = /bin/sh SHELL = /bin/sh
...@@ -53,9 +49,9 @@ ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) \ ...@@ -53,9 +49,9 @@ ALL_CFLAGS = -I. -I$(srcdir) -I$(G2C_H_DIR) -I$(F2C_H_DIR) $(CPPFLAGS) \
.SUFFIXES: .c .o .SUFFIXES: .c .o
.c.o: .c.o:
$(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $< @LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs -DAllow_TYQUAD $(ALL_CFLAGS) $<
OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \ OBJS = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \
fmt.o fmtlib.o iio.o ilnw.o inquire.o lread.o lwrite.o open.o \ fmt.o fmtlib.o iio.o ilnw.o inquire.o lread.o lwrite.o open.o \
rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o uio.o \ rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o typesize.o uio.o \
util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o \ util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o \
...@@ -63,18 +59,22 @@ OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \ ...@@ -63,18 +59,22 @@ OBJ = VersionI.o backspace.o close.o dfe.o dolio.o due.o endfile.o err.o \
all: ../s-libi77 all: ../s-libi77
../s-libi77: $(OBJ) ../s-libi77: $(OBJS)
echo timestamp > ../s-libi77 echo timestamp > ../s-libi77
archive: objlist:
$(AR) $(ARFLAGS) $(LIBG2C) $(OBJ) objs="`cat ../objlist`" ; for i in $(OBJS) ; do \
x=`echo $$i | sed -e "s/\.o$$/.lo/g"` ;\
objs="$$objs libI77/$$x" ;\
done ; \
echo -n $$objs > ../objlist
Makefile: Makefile.in config.status Makefile: Makefile.in config.status
$(SHELL) config.status $(SHELL) config.status
config.status: configure config.status: configure
rm -f config.cache rm -f config.cache
CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ CONFIG_SITE=no-such-file CC='$(CC)' CFLAGS='$(CFLAGS)' \
CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
${srcdir}/configure: configure.in ${srcdir}/configure: configure.in
...@@ -94,7 +94,7 @@ stamp-h: config.h.in config.status ...@@ -94,7 +94,7 @@ stamp-h: config.h.in config.status
echo timestamp > stamp-h echo timestamp > stamp-h
VersionI.o: Version.c VersionI.o: Version.c
$(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c @LIBTOOL@ --mode=compile $(CC) -c $(ALL_CFLAGS) $(srcdir)/Version.c -o $@
backspace.o: backspace.c fio.h config.h backspace.o: backspace.c fio.h config.h
close.o: close.c fio.h config.h close.o: close.c fio.h config.h
...@@ -153,12 +153,13 @@ xwsne.o: lio.h ...@@ -153,12 +153,13 @@ xwsne.o: lio.h
xwsne.o: xwsne.c fmt.h xwsne.o: xwsne.c fmt.h
# May be pessimistic: # May be pessimistic:
$(OBJ): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h $(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h
check install uninstall install-strip dist installcheck installdirs: check install uninstall install-strip dist installcheck installdirs:
mostlyclean: mostlyclean:
rm -f *.o rm -f *.o *.lo
rm -rf .libs
clean: mostlyclean clean: mostlyclean
rm -f config.log ../s-libi77 rm -f config.log ../s-libi77
......
...@@ -42,6 +42,9 @@ define([AC_PROG_CC_WORKS],[]) ...@@ -42,6 +42,9 @@ define([AC_PROG_CC_WORKS],[])
# the makefiles # the makefiles
AC_PROG_CC AC_PROG_CC
LIBTOOL='$(SHELL) ../libtool'
AC_SUBST(LIBTOOL)
test "$AR" || AR=ar test "$AR" || AR=ar
AC_SUBST(AR) AC_SUBST(AR)
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
......
...@@ -30,15 +30,11 @@ VPATH = @srcdir@ ...@@ -30,15 +30,11 @@ VPATH = @srcdir@
DEFS = @DEFS@ DEFS = @DEFS@
LIBS = @LIBS@ LIBS = @LIBS@
LIBG2C = ../libg2c.a
F2C_H_DIR = @srcdir@/.. F2C_H_DIR = @srcdir@/..
G2C_H_DIR = .. G2C_H_DIR = ..
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
AR = @AR@
ARFLAGS = rc
@SET_MAKE@ @SET_MAKE@
SHELL = /bin/sh SHELL = /bin/sh
...@@ -57,7 +53,7 @@ G77DIR = ../../../gcc/ ...@@ -57,7 +53,7 @@ G77DIR = ../../../gcc/
.SUFFIXES: .c .o .SUFFIXES: .c .o
.c.o: .c.o:
$(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $< @LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $<
OBJS = VersionU.o gerror_.o perror_.o ierrno_.o itime_.o time_.o \ OBJS = VersionU.o gerror_.o perror_.o ierrno_.o itime_.o time_.o \
unlink_.o fnum_.o getpid_.o getuid_.o getgid_.o kill_.o rand_.o \ unlink_.o fnum_.o getpid_.o getuid_.o getgid_.o kill_.o rand_.o \
...@@ -85,15 +81,19 @@ all: ../s-libu77 ...@@ -85,15 +81,19 @@ all: ../s-libu77
../s-libu77: $(OBJS) ../s-libu77: $(OBJS)
echo timestamp > ../s-libu77 echo timestamp > ../s-libu77
archive: objlist:
$(AR) $(ARFLAGS) $(LIBG2C) $(OBJS) objs="`cat ../objlist`" ; for i in $(OBJS) ; do \
x=`echo $$i | sed -e "s/\.o$$/.lo/g"` ;\
objs="$$objs libU77/$$x" ;\
done ; \
echo -n $$objs > ../objlist
Makefile: Makefile.in config.status Makefile: Makefile.in config.status
$(SHELL) config.status $(SHELL) config.status
config.status: configure config.status: configure
rm -f config.cache rm -f config.cache
CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ CONFIG_SITE=no-such-file CC='$(CC)' CFLAGS='$(CFLAGS)' \
CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
${srcdir}/configure: configure.in ${srcdir}/configure: configure.in
...@@ -110,7 +110,7 @@ stamp-h: config.hin config.status ...@@ -110,7 +110,7 @@ stamp-h: config.hin config.status
echo timestamp > stamp-h echo timestamp > stamp-h
VersionU.o: Version.c VersionU.o: Version.c
$(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c @LIBTOOL@ --mode=compile $(CC) -c $(ALL_CFLAGS) $(srcdir)/Version.c -o $@
$(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h config.h $(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h config.h
access_.o: access_.c access_.o: access_.c
...@@ -179,7 +179,8 @@ check: ...@@ -179,7 +179,8 @@ check:
install uninstall install-strip dist installcheck installdirs: install uninstall install-strip dist installcheck installdirs:
mostlyclean: mostlyclean:
rm -f *.o a.out rm -f *.o *.lo a.out
rm -rf .libs
clean: mostlyclean clean: mostlyclean
rm -f config.log ../s-libu77 rm -f config.log ../s-libu77
......
...@@ -41,6 +41,10 @@ define([AC_PROG_CC_WORKS],[]) ...@@ -41,6 +41,10 @@ define([AC_PROG_CC_WORKS],[])
# For g77 we'll set CC to point at the built gcc, but this will get it into # For g77 we'll set CC to point at the built gcc, but this will get it into
# the makefiles # the makefiles
AC_PROG_CC AC_PROG_CC
LIBTOOL='$(SHELL) ../libtool'
AC_SUBST(LIBTOOL)
dnl AC_C_CROSS dnl AC_C_CROSS
dnl Gives misleading `(cached)' message from the check. dnl Gives misleading `(cached)' message from the check.
if test "$CROSS";then if test "$CROSS";then
......
...@@ -38,3 +38,18 @@ static integer c__5 = 5; ...@@ -38,3 +38,18 @@ static integer c__5 = 5;
return 0; return 0;
} /* date_ */ } /* date_ */
#ifdef PIC
# include <stdio.h>
const char *G77_Non_Y2K_Compliance_Message =
"Call to non Y2K compliant subroutine detected.";
int G77_date_y2kbuggy_0 (char *buf, ftnlen buf_len)
{
extern int G77_abort_0();
fprintf (stderr, "%s\n", G77_Non_Y2K_Compliance_Message);
G77_abort_0();
}
#endif
...@@ -54,3 +54,18 @@ int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y) ...@@ -54,3 +54,18 @@ int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y)
*d = lt->tm_mday; *d = lt->tm_mday;
return 0; return 0;
} }
#ifdef PIC
extern const char *G77_Non_Y2K_Compliance_Message;
# ifdef KR_headers
int G77_vxtidate_y2kbuggy_0 (m, d, y)
integer *y, *m, *d;
# else
int G77_vxtidate_y2kbuggy_0 (integer *m, integer *d, integer *y)
# endif
{
extern int G77_abort_0();
fprintf (stderr, "%s\n", G77_Non_Y2K_Compliance_Message);
G77_abort_0();
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment