1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-04 22:33:27 +00:00
freebsd-ports/lang/schemetoc/files/patch-af
Thomas Gellekum 2b54222fb3 - Convert to ELF.
- Support CC/CFLAGS/PREFIX.

PR:		16677
Submitted by:	KATO Tsuguru <tkato@prontomail.ne.jp>
2000-03-01 09:57:06 +00:00

132 lines
3.9 KiB
Plaintext

--- scrt/makefile.orig Wed Feb 17 10:55:48 1993
+++ scrt/makefile Wed Feb 2 22:22:22 2000
@@ -5,7 +5,9 @@
#
.SUFFIXES:
-.SUFFIXES: .o .c .sc .s
+.SUFFIXES: .o .c .sc .s .so
+
+SOVER = 1
SCC = ../scsc/scc
SCCFLAGS =
@@ -14,6 +16,8 @@
Cruntime = scinit.o apply.o callcc.o cio.o heap.o objects.o mtraps.o
+SCruntime = scinit.so apply.so callcc.so cio.so heap.so objects.so mtraps.so
+
Cruntimec = scinit.c apply.c callcc.c cio.c heap.c objects.c mtraps.c
Chfiles = scinit.h apply.h callcc.h cio.h heap.h objects.h options.h
@@ -22,6 +26,11 @@
scqquote.o screp.o \
scrt1.o scrt2.o scrt3.o scrt4.o scrt5.o scrt6.o scrt7.o scrtuser.o
+SSruntime = scdebug.so sceval.so scexpand.so scexpnd1.so scexpnd2.so \
+ scqquote.so screp.so \
+ scrt1.so scrt2.so scrt3.so scrt4.so scrt5.so scrt6.so scrt7.so \
+ scrtuser.so
+
Sruntimec = scdebug.c sceval.c scexpand.c scexpnd1.c scexpnd2.c \
scqquote.c screp.c \
scrt1.c scrt2.c scrt3.c scrt4.c scrt5.c scrt6.c scrt7.c scrtuser.c
@@ -43,17 +52,27 @@
${SCC} -C ${SCCFLAGS} $*.sc
.c.o:
- ${CC} -c ${CFLAGS} -I. $*.c
+ ${CC} ${CFLAGS} -c ${.IMPSRC} -I. -o ${.TARGET}
+
+.c.so:
+ ${CC} ${PICFLAGS} ${CFLAGS} -c ${.IMPSRC} -I. -o ${.TARGET}
.s.o:
${CC} -c $*.s
+.s.so:
+ ${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${.IMPSRC} | \
+ ${AS} -k -o ${.TARGET}
+
sc-to-c: ${Sruntimec} sci.c
c-to-o: ${Sruntimec} ${Sruntime} ${Cruntime}
s-to-o: ${Aruntime}
+OBJS = ${Sruntime} ${Cruntime} ${Aruntime}
+SHAREDOBJS = ${OBJS:.o=.so}
+
Xlibsc.a: ${Sruntimec} ${Sruntime} ${Cruntime} ${Aruntime}
rm -f Xlibsc.a
ar q Xlibsc.a ${Cruntime} ${Sruntime} ${Aruntime}
@@ -75,36 +94,42 @@
Xmv: Xsci Xlibsc.a
mv Xsci sci
mv Xlibsc.a libsc.a
-
+
port:
- make "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = echo" \
- Xlibsc.a Xsci Xmv ${Plib}
+ ${MAKE} "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = echo" \
+ Xlibsc.a Xsci Xmv ${Plib} libsc.so.${SOVER}
libsc_p.a: libsc.a
mkdir saveobj
mv ${Sruntime} ${Cruntime} ${Aruntime} saveobj
rm -f libsc_p.a
- make "CC = ${CC}" "CFLAGS = ${CFLAGS} -pg" ${Sruntime} ${Cruntime} \
+ ${MAKE} "CC = ${CC}" "CFLAGS = ${CFLAGS} -pg" ${Sruntime} ${Cruntime} \
${Aruntime}
ar q libsc_p.a ${Cruntime} ${Sruntime} ${Aruntime}
${RANLIB} libsc_p.a
mv saveobj/* .
rmdir saveobj
+libsc.so.${SOVER}: ${SCruntime} ${SSruntime} ${SAruntime}
+ rm -f libsc.so.${SOVER}
+ ${CC} -shared -Wl,-x -Wl,-assert -Wl,pure-text -Wl,-soname,$@ -o $@ \
+ ${SCruntime} ${SSruntime} ${SAruntime}
+
install-private:
- make "LIBDIR = ${DESTDIR}" "BINDIR = ${DESTDIR}" \
+ ${MAKE} "LIBDIR = ${DESTDIR}" "BINDIR = ${DESTDIR}" \
"OWNER = -o `whoami`" install
install:
- -mkdir ${LIBDIR}/schemetoc
- cp libsc.a ${LIBDIR}/schemetoc/libsc.a
- ${RANLIB} ${LIBDIR}/schemetoc/libsc.a
- -cp libsc_p.a ${LIBDIR}/schemetoc/libsc_p.a
- -${RANLIB} ${LIBDIR}/schemetoc/libsc_p.a
- cp objects.h ${LIBDIR}/schemetoc
- cp options.h ${LIBDIR}/schemetoc
- cp predef.sc ${LIBDIR}/schemetoc
- cp sci ${BINDIR}/sci
+ ${BSD_INSTALL_DATA} libsc.a ${LIBDIR}
+ -${RANLIB} ${LIBDIR}/libsc.a
+ ${BSD_INSTALL_DATA} libsc_p.a ${LIBDIR}
+ -${RANLIB} ${LIBDIR}/libsc_p.a
+ ${BSD_INSTALL_DATA} objects.h ${LIBDIR}/schemetoc
+ ${BSD_INSTALL_DATA} options.h ${LIBDIR}/schemetoc
+ ${BSD_INSTALL_DATA} predef.sc ${LIBDIR}/schemetoc
+ ${BSD_INSTALL_PROGRAM} sci ${BINDIR}
+ ${BSD_INSTALL_DATA} libsc.so.${SOVER} ${LIBDIR}
+ ln -sf libsc.so.${SOVER} ${LIBDIR}/libsc.so
clean:
rm -f ${Sruntime} ${Cruntime} ${Aruntime} sci.o embedded.o \
@@ -124,8 +149,8 @@
libsc.a ${Plib} sci ${destdir}
all:
- make "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = ${SCC}" \
- "SCCFLAGS = ${SCCFLAGS}" Xlibsc.a Xsci Xmv ${Plib}
+ ${MAKE} "CC = ${CC}" "CFLAGS = ${CFLAGS}" "SCC = ${SCC}" \
+ "SCCFLAGS = ${SCCFLAGS}" Xlibsc.a Xsci Xmv ${Plib} libsc.so.${SOVER}
srclinks:
for x in ${Cruntimec} ${Chfiles} ${Sruntimec} ${Sruntimesc} ${Smisc}; \