freebsd-ports/textproc/sml-fxp/files/patch-Makefile
Thomas Abthorpe 5eaed6910a - Install fxlib.mlb
- Bump PORTREVISION

PR:		ports/117721
Submitted by:	Timothy Bourke <timbob bigpond.com> (maintainer)
2007-12-21 19:36:07 +00:00

174 lines
6.5 KiB
Text

--- Makefile.orig Sat Jun 26 02:43:06 2004
+++ Makefile Wed Oct 31 13:51:36 2007
@@ -6,25 +6,33 @@
##############################################################################
# These are the locations for executables, heap images and library files
##############################################################################
-PREFIX = /home/berlea/xmlsoft
FXP_BINDIR = ${PREFIX}/bin
-FXP_LIBDIR = ${PREFIX}/fxp
+FXP_LIBDIR = ${PREFIX}/lib/sml-fxp
+FXP_DOCDIR = ${PREFIX}/share/doc/fxp
##############################################################################
# The path where the SML-NJ binaries are located, and the name of the
# SML-NJ executable with the Compilation manager built-in. If sml is in
# your PATH at execution time, you fon't need the full path here.
##############################################################################
-SML_BINDIR = /usr/share/smlnj/bin
+SML_BINDIR = ${PREFIX}/bin
SML_EXEC = ${SML_BINDIR}/sml
##############################################################################
# No need to change this for SML-NJ 110.0.6. For earlier or working versions
# 110.19 you might have to use the second or third line. This is the
# compilation manager function for making with a named description file.
##############################################################################
-SML_MAKEDEF= val make = CM.make'
-#SML_MAKEDEF= val make = CM.make
-#SML_MAKEDEF= fun make x = CM.make'{force_relink=true, group=x}
+.if defined(SMLNJ_DEVEL) && ${SMLNJ_DEVEL} == "yes"
+SML_MAKEDEF = val make = CM.make
+SML_STABILIZEDEF = val stabilize = CM.stabilize true
+.else
+SML_MAKEDEF = val make = CM.make'
+SML_STABILIZEDEF = val stabilize = (fn n=> CM.stabilize' (n, true))
+.endif
+
+MLTON=${PREFIX}/bin/mlton
+HEAP2EXEC=${PREFIX}/bin/heap2exec
+HEAP_SUFFIX=x86-bsd
##############################################################################
# These should be fine on most unix machines
@@ -38,37 +46,48 @@
#buggy in cygwin
#MKDIRHIER = mkdirhier
MKDIRHIER = mkdir -p
+MV = mv
##############################################################################
# nothing to change below this line
##############################################################################
SRC = src
DOC = doc
-FXLIB_PRUNE = \( -name CM -o -name CVS -o -name Apps \)
+FXLIB_PRUNE = \( -name CM -o -name .cm -o -name CVS -o -name Apps \)
-all: fxp.sh images
+all: fxp.sh images stabilize
arch.os:
- if test -s ${SML_BINDIR}/.arch-n-opsys; then\
- ${SML_BINDIR}/.arch-n-opsys | \
- ${SED} -e 's/^.*HEAP_SUFFIX=\(.*\)$$/\1/' > .arch-opsys;\
- else \
- echo "ARCH=x86; OPSYS=win32; HEAP_SUFFIX=x86-win32" | \
- ${SED} -e 's/^.*HEAP_SUFFIX=\(.*\)$$/\1/' > .arch-opsys;\
- fi
+ echo ${HEAP_SUFFIX} > .arch-opsys
fxp.sh: Makefile arch.os
- ${RM} fxp.sh
- echo "#!/bin/sh -f" > fxp.sh
- echo >> fxp.sh
- echo "SML_BINDIR=${SML_BINDIR}" >> fxp.sh
- echo "FXP_LIBDIR=${FXP_LIBDIR}" >> fxp.sh
- cat fxp.sh.in >> fxp.sh
-
-image.prog:
+ @${RM} fxp.sh
+ @echo "#!/bin/sh -f" > fxp.sh
+ @echo >> fxp.sh
+ @echo "SML_BINDIR=${SML_BINDIR}" >> fxp.sh
+ @echo "FXP_LIBDIR=${FXP_LIBDIR}" >> fxp.sh
+ @cat fxp.sh.in >> fxp.sh
+
+stabilize:
+ #see inst.fxlib for old sml-nj
+.if defined(STABILIZE) && defined(SMLNJ_DEVEL) && ${SMLNJ_DEVEL} == "yes"
+ @echo "Stabilizing the library..."
+ echo "${SML_STABILIZEDEF}; stabilize \"src/fxlib.cm\"; \
+ OS.Process.exit OS.Process.success;" | ${SML_EXEC}
+.endif
+
+image.prog: fxp.sh
+.if defined(MLTON_BUILD)
+ @echo "Building the ${PROG_NAME} binary..."
+ ${MLTON} -output ${SRC}/${PROG_NAME} ${SRC}/${PROG_CM:S/cm$/mlb/}
+.else
@echo "Creating the ${PROG_NAME} heap image..."
echo "${SML_MAKEDEF}; make \"${SRC}/${PROG_CM}\"; \
SMLofNJ.exportFn(\"${SRC}/_${PROG_NAME}\",${PROG_FUN})" | ${SML_EXEC}
+.if defined(SMLNJ_DEVEL) && ${SMLNJ_DEVEL} == "yes"
+ ${HEAP2EXEC} ${SRC}/_${PROG_NAME}.${HEAP_SUFFIX} ${SRC}/${PROG_NAME}
+.endif
+.endif
image.fxlib:
image.fxp:
@@ -92,13 +111,15 @@
test -d ${FXP_LIBDIR} || ${MKDIRHIER} ${FXP_LIBDIR}
inst.prog: inst.dirs fxp.sh arch.os
+.if defined(NO_HEAP2EXEC)
${RM} ${FXP_BINDIR}/${PROG_NAME} ${FXP_BINDIR}/fxp.sh \
${FXP_LIBDIR}/_${PROG_NAME}.`cat .arch-opsys`
- ${COPY} fxp.sh ${FXP_BINDIR}
- ${CHMOD} 755 ${FXP_BINDIR}/fxp.sh
+ ${BSD_INSTALL_SCRIPT} fxp.sh ${FXP_BINDIR}/
ln -s fxp.sh ${FXP_BINDIR}/${PROG_NAME}
- ${COPY} ${SRC}/_${PROG_NAME}.`cat .arch-opsys` ${FXP_LIBDIR}
- ${CHMOD} 644 ${FXP_LIBDIR}/_${PROG_NAME}.`cat .arch-opsys`
+ ${BSD_INSTALL_DATA} ${SRC}/_${PROG_NAME}.${HEAP_SUFFIX} ${FXP_LIBDIR}/
+.else
+ ${BSD_INSTALL_PROGRAM} ${SRC}/${PROG_NAME} ${FXP_BINDIR}/
+.endif
inst.fxp:
@make inst.prog PROG_NAME=fxp PROG_CM=Apps/Null/null.cm PROG_FUN=Null.null
@@ -116,13 +137,39 @@
${MKDIRHIER} ${FXP_LIBDIR}/$${dir}; \
done
for file in `${FIND} ${SRC} ${FXLIB_PRUNE} -prune -o -name '*.sml' -print`; do \
- ${COPY} $${file} ${FXP_LIBDIR}/$${file}; \
+ ${BSD_INSTALL_DATA} $${file} ${FXP_LIBDIR}/$${file}; \
+ done
+ for file in `${FIND} ${SRC} ${FXLIB_PRUNE} -prune -o -type f -name '*.cm' -print`; do \
+ ${BSD_INSTALL_DATA} $${file} ${FXP_LIBDIR}/$${file}; \
+ done
+ ${BSD_INSTALL_DATA} ${SRC}/fxlib.cm ${FXP_LIBDIR}/${SRC}/
+ ${BSD_INSTALL_DATA} ${SRC}/fxlib.mlb ${FXP_LIBDIR}/${SRC}/
+.if defined(STABILIZE)
+.if defined(SMLNJ) && ${SMLNJ} == "yes"
+ # Stabilizing in place seems to be the only reliable way for old sml-nj
+ echo "${SML_STABILIZEDEF}; stabilize \"${FXP_LIBDIR}/src/fxlib.cm\"; \
+ OS.Process.exit OS.Process.success;" | ${SML_EXEC}
+.else
+ ${MKDIRHIER} ${FXP_LIBDIR}/src/.cm/x86-unix
+ ${BSD_INSTALL_DATA} ${SRC}/.cm/x86-unix/fxlib.cm ${FXP_LIBDIR}/src/.cm/x86-unix/
+.endif
+.endif
+
+install-doc:
+ for file in ball-shadow.jpg fxp-shadow.jpg shadow.jpg \
+ exa-vcg-1.gif exa-vcg-2.gif exa-vcg-3.gif \
+ exa-vcg-4.gif exa-vcg-5.gif exa-vcg-6.gif ; do \
+ rm ${DOC}/$${file} || true; \
+ done
+ rm ${DOC}/Images/index.html || true
+ for dir in `${FIND} ${DOC}/* -type d -print`; do \
+ d=`expr "$${dir}" : "[^/]*/\(.*\)"`; \
+ ${MKDIRHIER} ${FXP_DOCDIR}/$${d}; \
+ done
+ for file in `${FIND} ${DOC}/* -type f \! -regex '.*\.orig$$' -print`; do \
+ f=`expr "$${file}" : "[^/]*/\(.*\)"`; \
+ ${BSD_INSTALL_MAN} $${file} ${FXP_DOCDIR}/$${f}; \
done
- ${COPY} ${SRC}/fxlib.cm ${FXP_LIBDIR}/${SRC}/fxlib.cm
- rm -f ${FXP_LIBDIR}/fxlib.cm
- echo Group is > ${FXP_LIBDIR}/fxlib.cm
- echo " "${SRC}/fxlib.cm >> ${FXP_LIBDIR}/fxlib.cm
- ${COPY} -r ${DOC} ${FXP_LIBDIR}
install:
for prog in ${INSTALL_PROGS}; do \