Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 May 95 00:10 MET DST
From:      nils@guru.ims.uni-stuttgart.de (Cornelis van der Laan)
To:        hsu@alumni.eecs.berkeley.edu%delos
Cc:        ports@freefall.cdrom.com%delos
Subject:   New g77 port
Message-ID:  <m0s63g1-0003VaC@guru.ims.uni-stuttgart.de>

next in thread | raw e-mail | index | archive | help
Hi Jeffrey

I read all the mails you sent me and had a serious look at my g77 port.

Yes, it did things wrong because the gcc frontend gets patched to
know about the new Fortran rules, to which g77 is just an interface -
it merely adds the -lf2c -lm libraries.

Here is a new g77 port. It overwrites /usr/bin/{cc,gcc} and installs
f771 in /usr/libexec. Be careful. It's old style although the pre-build 
and pre-install targets are gone now.

Please have a close look at it and tell me if it's OK now.

Nils

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	g77
#	g77/Makefile
#	g77/files
#	g77/files/Makefile.f771
#	g77/files/Makefile.g77
#	g77/files/Makefile.gcc
#	g77/scripts
#	g77/scripts/configure
#	g77/pkg
#	g77/pkg/DESCR
#	g77/pkg/COMMENT
#	g77/pkg/PLIST
#
echo c - g77
mkdir g77 > /dev/null 2>&1
echo x - g77/Makefile
sed 's/^X//' >g77/Makefile << 'END-of-g77/Makefile'
X# -*- Mode: Makefile -*-
X# Port of:              GNU Fortran
X# Version required:     0.5.13
X# Space required:       >= 10MB
X# Date created:         Wed Mar 22 18:51:05 MET 1995
X# Porter:               nils@guru.ims.uni-stuttgart.de
X#
X# WARNING:		THIS PORT WILL OVERWRITE /usr/bin/cc BECAUSE THE 
X#			FORTRAN COMPILATION RULES CHANGED.
X
XDISTNAME=       g77-0.5.13
XMASTER_SITES=   ftp://prep.ai.mit.edu/pub/gnu/
XEXTRACT_SUFX=	.tar.gz
X
X# You have to tell me where your gcc 2.6.3 source is located
XCOMPILERSOURCE = /usr/src/gnu/usr.bin/cc
X#COMPILERSOURCE = /cdrom/filesys/usr/src/gnu/usr.bin/cc
X
X# Which version of gcc do we have? Must be either 2.6.2 or 2.6.3.
XCCVERSION=2.6.3
X
X# I decided to install f771 as part of gcc in /usr/libexec, the g77
X# driver program and man page under ${PREFIX}/bin and ${PREFIX}/man
XPREFIX		= /usr/local
X
XWRKDIR          = ${.CURDIR}/work
XCONFIGURE_COOKIE= ${WRKDIR}/.configure_done
XBUILD_COOKIE    = ${WRKDIR}/.build_done
XINSTALL_COOKIE  = ${WRKDIR}/.install_done
X
Xconfigure: extract patch ${CONFIGURE_COOKIE}
X${CONFIGURE_COOKIE}:
X	@echo "===>  Configuring for ${DISTNAME}"
X	@env CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
X	     WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
X	     FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
X	     DEPENDS="${DEPENDS}" \
X	     COMPILERSOURCE="${COMPILERSOURCE}" CCVERSION="${CCVERSION}" \
X               ${SHELL} ${SCRIPTDIR}/configure; 
X	@${TOUCH} ${TOUCH_FLAGS} ${CONFIGURE_COOKIE}
X
Xbuild: configure ${BUILD_COOKIE}
X${BUILD_COOKIE}:
X	@echo "===>  Building for ${DISTNAME}"
X	@echo "===>  Building patched gcc library for ${DISTNAME}"
X	cd ${WRKSRC}/gcc && \
X	   ${MAKE} CC="${CC} -I. -I${COMPILERSOURCE}/include" \
X		   COMPILERSOURCE="${COMPILERSOURCE}" 
X	@echo "===>  Building patched gcc frontend for ${DISTNAME}"
X	cd ${WRKSRC}/gcc && \
X	   ${MAKE} CC="${CC}" COMPILERSOURCE="${COMPILERSOURCE}" \
X		-f Makefile.gcc cc
X	@echo "===>  Building compiler backend for ${DISTNAME}"
X	cd ${WRKSRC}/f && \
X	   ${MAKE} CC="${CC}" COMPILERSOURCE="${COMPILERSOURCE}" 
X	@echo "===>  Building compiler froentend for ${DISTNAME}"
X	cd ${WRKSRC}/f && \
X	   ${MAKE} CC="${CC}" COMPILERSOURCE="${COMPILERSOURCE}" \
X		-f Makefile.g77 g77
X	@${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
X
X# Three things to install: 1) new gcc frontend with fortran rules
X#                          2) f771 backend in /usr/libexec
X#			   3) new g77 frontend for -lf2c -lm handling
Xinstall: build ${INSTALL_COOKIE}
X${INSTALL_COOKIE}:
X	@echo "===>  Installing for ${DISTNAME}"
X	@(cd ${WRKSRC}/gcc && \
X	  ${MAKE} PREFIX=${PREFIX} ${MAKE_FLAGS} Makefile.gcc \
X		${INSTALL_TARGET})
X	@(cd ${WRKSRC}/f && \
X	  ${MAKE} PREFIX=${PREFIX} ${MAKE_FLAGS} Makefile \
X		${INSTALL_TARGET})
X	@(cd ${WRKSRC}/f && \
X	  ${MAKE} PREFIX=${PREFIX} ${MAKE_FLAGS} Makefile.g77 \
X		${INSTALL_TARGET})
X	@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
X
X.include <bsd.port.mk>
END-of-g77/Makefile
echo c - g77/files
mkdir g77/files > /dev/null 2>&1
echo x - g77/files/Makefile.f771
sed 's/^X//' >g77/files/Makefile.f771 << 'END-of-g77/files/Makefile.f771'
X# Makefile for GNU F77 compiler backend.
X# Created by Cornelis van der Laan (nils@ims.uni-stuttgart.de)
X
XPROG=		f771
XBINDIR=		/usr/libexec
XNOMAN=		noman
XCFLAGS+= 	-I. -I../gcc -I${COMPILERSOURCE}/include -DIN_GCC
X# Hack, since ../Makefile.inc overwrites this to ../cc_int/libcc_int.a
X_LIBCC_INT=	../gcc/libcc_int.a
XDPADD+=		${_LIBCC_INT} ${LIBGNUMALLOC}
XLDADD+=		${_LIBCC_INT} -lgnumalloc
X
X# Language-specific object files for g77
X
XSRCS = bad.c bit.c bld.c com.c data.c equiv.c expr.c global.c \
X implic.c info.c intrin.c lab.c lex.c malloc.c name.c parse.c \
X proj.c src.c st.c sta.c stb.c stc.c std.c ste.c storag.c stp.c \
X str.c sts.c stt.c stu.c stv.c stw.c symbol.c target.c top.c type.c \
X where.c zzz.c
X
Xbad.o: stamp-str 
Xfini.o proj.o: proj.h
X
Xconf-proj: conf-proj.in
X	autoconf conf-proj.in > conf-proj.out && \
X          mv conf-proj.out conf-proj && \
X          chmod a+x conf-proj
X
Xproj.h: proj.h.in conf-proj com.h
X	CONFIG_SITE=/dev/null $(SHELL) ./conf-proj --srcdir=. ; \
X	touch proj.h
X
Xstamp-str: fini str-1t.h str-1t.j str-2t.h str-2t.j \
X str-fo.h str-fo.j str-io.h str-io.j str-nq.h  str-nq.j \
X str-op.h str-op.j str-ot.h str-ot.j
X	touch stamp-str
X
Xfini: fini.o proj.o
X	$(CC) $(CFLAGS) -o fini fini.o proj.o
X
Xstr-1t.h str-1t.j: fini str-1t.fin
X	./fini str-1t.fin str-1t.j str-1t.h
X
Xstr-2t.h str-2t.j: fini str-2t.fin
X	./fini str-2t.fin str-2t.j str-2t.h
X
Xstr-fo.h str-fo.j: fini str-fo.fin
X	./fini str-fo.fin str-fo.j str-fo.h
X
Xstr-io.h str-io.j: fini str-io.fin
X	./fini str-io.fin str-io.j str-io.h
X
Xstr-nq.h str-nq.j: fini str-nq.fin
X	./fini str-nq.fin str-nq.j str-nq.h
X
Xstr-op.h str-op.j: fini str-op.fin
X	./fini str-op.fin str-op.j str-op.h
X
Xstr-ot.h str-ot.j: fini str-ot.fin
X	./fini str-ot.fin str-ot.j str-ot.h
X
X.include <bsd.prog.mk>
END-of-g77/files/Makefile.f771
echo x - g77/files/Makefile.g77
sed 's/^X//' >g77/files/Makefile.g77 << 'END-of-g77/files/Makefile.g77'
X# Makefile for g77 frontend
X# Created by Cornelis van der Laan (nils@ims.uni-stuttgart.de)
X
XPROG=           g77
XSRCS=           g77.c 
XMAN1=		g77.1
XBINDIR=		${PREFIX}/bin
XMANDIR=		${PREFIX}/man/man
XCFLAGS+=        -I${.CURDIR} -I${COMPILERSOURCE}/include
X.PATH:          ${COMPILERSOURCE}/cc
X
X.include <bsd.prog.mk>
END-of-g77/files/Makefile.g77
echo x - g77/files/Makefile.gcc
sed 's/^X//' >g77/files/Makefile.gcc << 'END-of-g77/files/Makefile.gcc'
X# Makefile for patched gcc frontend (new Fortran rules)
X# Created by Cornelis van der Laan (nils@ims.uni-stuttgart.de)
X
X# Sorry, I have to overwrite /usr/bin/gcc for the new rules
X# to work (at least until the rules are part of the regular
X# gcc distribution).
X
XPROG=           cc
XSRCS=           gcc.c version.c obstack.c
XNOMAN=		noman
XBINDIR=		/usr/bin
XCFLAGS+=        -I${.CURDIR} -I${COMPILERSOURCE}/include
XLINKS=		${BINDIR}/cc ${BINDIR}/gcc
X.PATH:          ${COMPILERSOURCE}/cc
X
X.include <bsd.prog.mk>
END-of-g77/files/Makefile.gcc
echo c - g77/scripts
mkdir g77/scripts > /dev/null 2>&1
echo x - g77/scripts/configure
sed 's/^X//' >g77/scripts/configure << 'END-of-g77/scripts/configure'
X#!/bin/sh
X
Xcd ${WRKSRC}
X
Xmkdir gcc >/dev/null 2>&1
X
Xecho "===>  Using compiler source in ${COMPILERSOURCE}"
X
Xcd gcc
X ln -s ${COMPILERSOURCE}/cc/* .
X rm -f Makefile 00_TRANS.TBL CVS
X ln -s ${COMPILERSOURCE}/cc_int/* .
X rm -f Makefile 00_TRANS.TBL CVS
X ln -s ${COMPILERSOURCE}/include/tree.h .
X
X echo "===>  Patching source using ${CCVERSION} diffs"
X patch -p1 -sf < ../f/gbe/${CCVERSION}.diff # >/dev/null 2>&1
X # if any .h file besides tree.h needs to be patched, just include
X # in the above list of files to be linked. v0.5.13 only needs tree.h.
Xcd ..
X
Xcp ${COMPILERSOURCE}/Makefile.inc Makefile.inc
Xcp ${COMPILERSOURCE}/cc_int/Makefile gcc/Makefile
Xcp ${FILESDIR}/Makefile.f771 f/Makefile
Xcp ${FILESDIR}/Makefile.g77  f/Makefile.g77
Xcp ${FILESDIR}/Makefile.gcc  gcc/Makefile.gcc
X
Xexit 0
END-of-g77/scripts/configure
echo c - g77/pkg
mkdir g77/pkg > /dev/null 2>&1
echo x - g77/pkg/DESCR
sed 's/^X//' >g77/pkg/DESCR << 'END-of-g77/pkg/DESCR'
Xg77 - The GNU Fortran 77 compiler. Version 0.5.13.
X
XPorted by Cornelis van der Laan (nils@guru.ims.uni-stuttgart.de).
END-of-g77/pkg/DESCR
echo x - g77/pkg/COMMENT
sed 's/^X//' >g77/pkg/COMMENT << 'END-of-g77/pkg/COMMENT'
Xg77 - The GNU Fortran 77 compiler. Version 0.5.13.
END-of-g77/pkg/COMMENT
echo x - g77/pkg/PLIST
sed 's/^X//' >g77/pkg/PLIST << 'END-of-g77/pkg/PLIST'
X@mode 555
X@owner bin
X@group bin
Xbin/g77
X@cwd /usr
Xlibexec/f771
Xbin/cc
Xbin/gcc
END-of-g77/pkg/PLIST
exit

----------------------------------------------------------------
Cornelis van der Laan -- nils@ims.uni-stuttgart.de
                      -- nils@guru.stgt.sub.org
# echo echo Knusper Knusper Knaeuschen > /etc/nologin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0s63g1-0003VaC>