Index: head/lang/smlnj/Makefile =================================================================== --- head/lang/smlnj/Makefile (revision 475002) +++ head/lang/smlnj/Makefile (revision 475003) @@ -1,393 +1,393 @@ # $FreeBSD$ PORTNAME= smlnj PORTVERSION= 110.77 CATEGORIES= lang MASTER_SITES= http://smlnj.cs.uchicago.edu/dist/working/${PORTVERSION}/ \ ftp://mirror.free.de/http/smlnj.cs.uchicago.edu/dist/working/${PORTVERSION}/ DISTFILES= config.tgz runtime.tgz DIST_SUBDIR= smlnj/${PORTVERSION} EXTRACT_ONLY= config.tgz MAINTAINER= joemann@beefree.free.de COMMENT= Compiler and tools for Standard ML (SML '97) LICENSE= SMLNJ LICENSE_NAME= Standard ML of New Jersey License LICENSE_TEXT= The text of the license can be obtained from the following URL:\ http://www.smlnj.org/license.html LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept ONLY_FOR_ARCHS= i386 amd64 LLD_UNSAFE= yes NO_WRKSUBDIR= yes SUB_FILES= pkg-install SUB_LIST= EXEBINDIR=${MLBINRELATIVE} EXENAMES="${MLEXE}" PKGDEINSTALL= ${PKGINSTALL} # Calm portlint CALM= OPTIONS_RADIO= RG1 OPTIONS_RADIO_RG1= EVERYTHING RECOMPILE POSITION64 OPTIONS_EXCLUDE_amd64= RECOMPILE POSITION64 EVERYTHING_DESC= install${CALM} everything from the SML/NJ distribution RECOMPILE_DESC= recompile the SML compiler - implies EVERYTHING POSITION64_DESC= use 64bit file${CALM} positions - implies RECOMPILE .include # Recompiling the compiler currently fails on amd64 .if ${ARCH} == "i386" ML_RECOMPILE_OPTIONS= RECOMPILE POSITION64 .endif .if (${ARCH} == "amd64") CFLAGS+= -m32 AS?= as AS+= --32 .endif .if (${ARCH} == "i386" || ${ARCH} == "amd64") MLARCH= x86 DISTFILES+= boot.x86-unix.tgz .endif DISTFILES+= MLRISC.tgz ckit.tgz cml.tgz doc.tgz heap2asm.tgz \ ml-burg.tgz ml-lpt.tgz ml-lex.tgz ml-yacc.tgz nlffi.tgz \ smlnj-lib.tgz trace-debug-profile.tgz PLIST_SUB= MLARCH=${MLARCH} .if ${PORT_OPTIONS:MPOSITION64} || defined(ML_POSITION64) ML_POSITION64?= ${PORT_OPTIONS:MPOSITION64} ML_RECOMPILE?= ${ML_POSITION64} ML_EVERYTHING?= ${ML_POSITION64} CMB_COMMAND= '(\#set o CMB.symval) "USE_64_BIT_POSITIONS" (SOME 1);' .else CMB_COMMAND= .endif .if ${PORT_OPTIONS:MRECOMPILE} || defined(ML_RECOMPILE) ML_RECOMPILE?= ${PORT_OPTIONS:MRECOMPILE} ML_EVERYTHING?= ${ML_RECOMPILE} .endif .if ${PORT_OPTIONS:MEVERYTHING} || defined(ML_EVERYTHING) ML_EVERYTHING?= ${PORT_OPTIONS:MEVERYTHING} DISTFILES+= cm.tgz compiler.tgz eXene.tgz \ pgraph.tgz smlnj-c.tgz system.tgz PLIST_SUB+= EVERYTHING="" .else PLIST_SUB+= EVERYTHING="@comment " .endif MLROOTRELATIVE= smlnj MLROOT= ${PREFIX}/${MLROOTRELATIVE} MLBINRELATIVE= ${MLROOTRELATIVE}/bin MLBIN= ${MLROOT}/bin MLLIB= ${MLROOT}/lib MLSTDSRCDIRS= cml doc heap2asm ml-burg ml-lex ml-lpt ml-yacc nlffi smlnj-lib MLSRCDIRS= base ${MLSTDSRCDIRS} \ ckit eXene pgraph smlnj-c MLSRCS= .for srcdir in ${MLSRCDIRS} MLSRCS+= ${MLROOT}/${srcdir} .endfor MLTARGETS= heap2asm MLEXE= heap2exec ml-antlr ml-build ml-burg ml-lex ml-makedepend \ ml-nlffigen ml-ulex ml-yacc sml .if defined(ML_EVERYTHING) MLTARGETS+= eXene mlrisc-tools nowhere pgraph-util src-smlnj MLEXE+= nowhere PLIST= ${WRKDIR}/.PLIST MLRUNTIMEPLIST= ${WRKDIR}/.PLIST-runtime MLSRCPLIST= ${WRKDIR}/.PLIST-src MLPLISTFILES= ${.CURDIR}/pkg-plist ${MLRUNTIMEPLIST} ${MLSRCPLIST} .endif pre-fetch: @${ECHO} .if ! defined(ML_EVERYTHING) @${ECHO} 'Use make ML_EVERYTHING=yes to also build/install' @${ECHO} ' eXene (X Windows toolkit),' @${ECHO} ' nowhere (preprocessor for conditional patterns),' @${ECHO} ' various libraries, and all the sources.' .endif .if !empty(ML_RECOMPILE_OPTIONS:MRECOMPILE) && !defined(ML_RECOMPILE) @${ECHO} 'Use make ML_RECOMPILE=yes to recompile the compiler.' @${ECHO} ' This implies ML_EVERYTHING.' .endif .if !empty(ML_RECOMPILE_OPTIONS:MPOSITION64) && !defined(ML_POSITION64) @${ECHO} 'Use make ML_POSITION64=yes to use 64bit file positions.' @${ECHO} ' This implies ML_RECOMPILE.' .endif @${ECHO} # make symlinks to the dist files post-extract: cd ${WRKSRC} && ${LN} -sf ${_DISTDIR}/* . # Configuring is done by uncommenting the appropriate #request # lines of config/targets. Dependency details are handled by # base/system/smlnj/installer using config/dependencies and # config/actions. do-configure: .if defined(MLTARGETS) ${ECHO_CMD} -n > "${WRKDIR}/.tmp.sed" .for t in ${MLTARGETS} ${ECHO_CMD} '/^#request[ ]+${t}$$/s/^#//' >> "${WRKDIR}/.tmp.sed" .endfor ${SED} -i .default -E -f "${WRKDIR}/.tmp.sed" "${WRKSRC}/config/targets" .endif # Recompilation requires ml-lex and ml-yacc. All requested targets # will be built later using the recompiled core system after # removing targets.customized. See "do-build" below. .if defined(ML_RECOMPILE) ( ${ECHO_CMD} "request ml-yacc" && \ ${ECHO_CMD} "request ml-lex" && \ ${ECHO_CMD} "request ml-lex-mllex-tool" && \ ${ECHO_CMD} "request src-smlnj" ) \ > "${WRKSRC}/config/targets.customized" .endif # The build target patches, builds, and installs the system within WRKDIR. # base/runtime is not cleaned afterwards to avoid its recompilation during # a subsequent make install. # See base/system/README for information on recompiling the compiler. .if defined(ML_RECOMPILE) RECOMPILEDIR= base/system .else RECOMPILEDIR= .endif MLRUNTIMEPATCHES_CMD= cd ${FILESDIR} && \ ( ${LS} do-patch-base_runtime_* 2>&- || \ ${TRUE} ) MLSTANDARDPATCHES_CMD= cd ${FILESDIR} && \ ( for srcdir in ${MLSTDSRCDIRS} ; \ do ${LS} do-patch-$${srcdir}_* 2>&- ; \ done ) || ${TRUE} MLSTANDARDPATCHDIRS_CMD= cd ${FILESDIR} && \ ( for srcdir in ${MLSTDSRCDIRS} ; \ do if ${LS} do-patch-$${srcdir}_* 1>&- 2>&- ; \ then ${ECHO_CMD} -n $${srcdir} " " ; break ; fi ; \ done ) || ${TRUE} .if defined(ML_EVERYTHING) MLSOURCEPATCHES_CMD= cd ${FILESDIR} && \ ( ${LS} do-patch-* 2>&- || \ ${TRUE} ) .else MLSOURCEPATCHES_CMD= ${TRUE} .endif do-build: cd ${WRKSRC} && unset PWD && \ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \ MLNORUNTIMECLEAN=yes \ MLRUNTIMEPATCHES=`${MLRUNTIMEPATCHES_CMD}` \ MLSTANDARDPATCHES=`${MLSTANDARDPATCHES_CMD}` \ MLSTANDARDPATCHDIRS=`${MLSTANDARDPATCHDIRS_CMD}` \ MLSOURCEPATCHES=`${MLSOURCEPATCHES_CMD}` \ - CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ + CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ ./config/install.sh .if defined(ML_RECOMPILE) -${RM} ${WRKSRC}/config/targets.customized @${ECHO} '(* Recompiling the core system: *)' cd ${WRKSRC}/${RECOMPILEDIR} && ( \ ${ECHO_CMD} 'CM.autoload "$$smlnj/cmb.cm";' ; \ ${ECHO_CMD} ${CMB_COMMAND} ; \ ${ECHO_CMD} 'CMB.make ();' ) | \ ../../bin/sml @${ECHO} '(* Building the recompiled heap: *)' cd ${WRKSRC}/${RECOMPILEDIR} && \ ./makeml @${ECHO} '(* Removing old libs and heaps: *)' cd ${WRKSRC}/${RECOMPILEDIR} && \ ${RM} -r ../../lib && ${MKDIR} ../../lib && \ ${FIND} ../../bin/.heap -name '*.${MLARCH}-bsd' \ \! -name 'sml.${MLARCH}-bsd' -delete -print @${ECHO} '(* Installing the recompiled libs and heap: *)' cd ${WRKSRC}/${RECOMPILEDIR} && \ ./installml @${ECHO} '(* Building requested targets: *)' cd ${WRKSRC} && unset PWD && \ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \ MLNORUNTIMECLEAN=yes RECOMPILEDIR="${RECOMPILEDIR}" \ - CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ + CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ ./config/install.sh .endif # If Mac OS X resource files make it into the distribution tarballs, # then we have to remove them at several points during the # installation process. This is no longer necessary with FreeBSD 10 # as it uses libarchive 3.x (via bsdtar), but earlier versions # don't ignore such resource files and hence WRKSRC and STAGEDIR # are full of them. Once FreeBSD 9 will be out of service, all # lines in this Makefile can be removed which contain a pattern # for the prefix "._" of the resource files. Background information: # post-build: ${FIND} ${WRKSRC} -type f -name '\._*' -delete # Nowadays PLIST has to be computed before installation. We do it in # "pre-install" because source extraction happens during "build". .if defined(ML_EVERYTHING) MLNOINSTALL= .cm .if defined(ML_RECOMPILE) MLNOINSTALL+= sml.bin.${MLARCH}-unix sml.boot.${MLARCH}-unix \ sml.lib sml.${MLARCH}-bsd .endif .for excl in ${MLNOINSTALL} MLSRCEXCLUDEREGEX+= -e '/${excl}$$' -e '/${excl}/' .endfor MLPATCHPATHREGEX= -E -e 's%(^|[^_])_([^_]|$$)%\1/\2%g' \ -e 's%(^|[^_])__([^_]|$$)%\1_\2%g' \ -e 's%(^|[^_])___([^_]|$$)%\1/_\2%g' .endif pre-install: .if defined(ML_EVERYTHING) @${ECHO} -n '(* Computing package list ...' @${TAR} -tzf ${WRKSRC}/runtime.tgz | \ ${GREP} -E -v '(^|/)\._.*' | \ ${SED} -E -n -e 's%^(.*[^/])$$%${MLROOTRELATIVE}/base/\1%p' \ > ${MLRUNTIMEPLIST} @${MLRUNTIMEPATCHES_CMD} | \ ${SED} ${MLPATCHPATHREGEX} | \ ${SED} -E -e 's%^(do|extra)-patch-(base/.*)%${MLROOTRELATIVE}/\2%' \ > ${MLRUNTIMEPLIST}.patched -@${GREP} -F -v -f ${MLRUNTIMEPLIST} ${MLRUNTIMEPLIST}.patched \ > ${MLRUNTIMEPLIST}.patchednew @${CAT} ${MLRUNTIMEPLIST}.patchednew >> ${MLRUNTIMEPLIST} @${MLRUNTIMEPATCHES_CMD} | \ ${SED} ${MLPATCHPATHREGEX} | \ ${SED} -E -e 's%^(do|extra)-patch-(base/.*)%${MLROOTRELATIVE}/\2.orig%' \ >> ${MLRUNTIMEPLIST} @cd "${WRKSRC}" && ( \ ( ${FIND} -s -d ${MLSRCDIRS} \! -type d | \ ${AWK} '{ print "${MLROOTRELATIVE}/" $$0 }' ) ; \ ( ${FIND} -s -d ${MLSRCDIRS} -type d -empty | \ ${AWK} '{ print "@dir ${MLROOTRELATIVE}/" $$0 }' ) ) | \ ${EGREP} -v ${MLSRCEXCLUDEREGEX} > ${MLSRCPLIST} @${SED} -e 's/^%%EVERYTHING%%//' ${MLPLISTFILES} | \ ${GREP} -h -v "^@dir" | ${SORT} -u > ${PLIST} @${SED} -e 's/^%%EVERYTHING%%//' ${MLPLISTFILES} | \ ${GREP} -h "^@dir" | ${SORT} -r -u >> ${PLIST} @${ECHO} ' done. *)' .endif # ${PKGINSTALL} contains multiexec-wrapper, which is used to select # between executables of the same name that have been installed by # different packages (like smlnj and smlnj-devel). The source of # multiexec-wrapper is extracted from ${PKGINSTALL}, and inserted # into ${PKGINSTALL} in compressed and encoded form. So it is still # available when being installed from a binary package, even if # ${PKGINSTALL} is no file at that time (but only input to a shell). @${SED} -e '/^#%%PKG-INSTALL-START%%$$/,/^#%%PKG-INSTALL-END%%$$/d' \ ${PKGINSTALL} > ${PKGINSTALL}.script @${GZIP_CMD} ${PKGINSTALL}.script @b64encode ${PKGINSTALL}.script.gz script.gz > ${PKGINSTALL}.script.gz.b64 @${SED} -n -e '1,/~EOF~.$$/p' ${PKGINSTALL} > ${PKGINSTALL}.pre @${SED} -n -e '/^~EOF~$$/,$$p' ${PKGINSTALL} > ${PKGINSTALL}.post @${CAT} ${PKGINSTALL}.pre ${PKGINSTALL}.script.gz.b64 ${PKGINSTALL}.post > ${PKGINSTALL}.full @${DIFF} -q ${PKGINSTALL} ${PKGINSTALL}.full >/dev/null || ${CP} ${PKGINSTALL}.full ${PKGINSTALL} # The install target installs the heaps and libraries to their final # location in ${MLBIN} and ${MLLIB}. # In case of recompilation, installml installs the sml heap and the # libraries built during compiler bootstrap to ${MLBIN} and ${MLLIB}. # When staging CM_PATHCONFIG has to point to the final # ${MLLIB}/pathconfig (in ${PREFIX}) while building the compiler. .if defined(ML_EVERYTHING) MLSRCEXCLUDES= .for excl in ${MLNOINSTALL} MLSRCEXCLUDES+= --exclude "${excl}" .endfor .endif do-install: ${MKDIR} "${STAGEDIR}${MLROOT}" .if ! defined(ML_RECOMPILE) cd ${WRKSRC} && unset PWD && \ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \ STAGEDIR="${STAGEDIR}" MLLIB="${MLLIB}" \ INSTALLDIR="${STAGEDIR}${MLROOT}" \ - CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ + CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ ./config/install.sh .else @${ECHO} '(* Rebuilding the recompiled libs: *)' cd ${WRKSRC}/${RECOMPILEDIR} && ( \ ${ECHO_CMD} 'CM.autoload "$$smlnj/cmb.cm";' ; \ ${ECHO_CMD} ${CMB_COMMAND} ; \ ${ECHO_CMD} 'CMB.make ();' ) | \ ../../bin/sml @${ECHO} '(* Rebuilding the recompiled heap: *)' cd ${WRKSRC}/${RECOMPILEDIR} && \ ./makeml @${ECHO} '(* Installing into ${MLROOT}: *)' cd ${WRKSRC} && unset PWD && \ FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \ STAGEDIR="${STAGEDIR}" MLLIB="${MLLIB}" \ INSTALLDIR="${STAGEDIR}${MLROOT}" RECOMPILEDIR="${RECOMPILEDIR}" \ - CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ + CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \ ./config/install.sh .endif [ ! -d ${STAGEDIR} ] || \ ${FIND} ${STAGEDIR} -type f -name '\._*' -delete @${ECHO} '(* Installing man pages. *)' .for mansect in 1 2 3 4 5 6 7 8 9 @[ ! -d ${WRKSRC}/doc/man/man${mansect} ] || \ { cd ${WRKSRC}/doc/man/man${mansect} && ls *.${mansect} | \ ${XARGS} -J % \ ${INSTALL_MAN} % ${STAGEDIR}${MANPREFIX}/man/man${mansect} ; } .endfor @${ECHO} '(* Stripping runtime executable: *)' MLARCHOPSYS=`${STAGEDIR}${MLBIN}/.arch-n-opsys` && \ ( eval $${MLARCHOPSYS} ; \ ${STRIP_CMD} "${STAGEDIR}${MLBIN}/.run/run.$${ARCH}-$${OPSYS}" \ "${STAGEDIR}${MLBIN}/.run/run.$${ARCH}-$${OPSYS}.so" ) .if defined(ML_EVERYTHING) @${ECHO} '(* Cleaning base/runtime: *)' cd ${WRKSRC}/base/runtime/objs && ${MAKE_CMD} clean @${ECHO} -n '(* Installing sources into ${STAGEDIR}${MLROOT} ...' @cd ${WRKSRC} && ${TAR} -cf - ${MLSRCEXCLUDES} ${MLSRCDIRS} | \ ${TAR} -xf - -C "${STAGEDIR}${MLROOT}" @${ECHO} ' done. *)' .endif # Only execute ${PKGINSTALL} when installing to ${PREFIX}, # but not when staging. .ifmake install${CALM} PKG_PREFIX=${PREFIX} MULTIEXEC_WRAPPER_VERBOSE=yes \ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif ${FIND} ${STAGEDIR} -type f -name '\._*' -delete MLARCHOPSYS=`${STAGEDIR}${MLBIN}/.arch-n-opsys` && \ ( eval $${MLARCHOPSYS} ; \ ${STRIP_CMD} "${STAGEDIR}${MLBIN}/.run/run.$${ARCH}-$${OPSYS}" \ "${STAGEDIR}${MLBIN}/.run/run.$${ARCH}-$${OPSYS}.so" ) .ifndef MULTIEXEC_WRAPPER_VERBOSE deinstall: export MULTIEXEC_WRAPPER_VERBOSE=yes && \ cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} deinstall .endif # This target may be used by dependent ports to set SMLNJ_VERSION # either to the currently installed smlnj package's version # or else to this port's version. SMLNJ_VERSION is an environment # variable used by multiexec-wrapper to select the executable # from that smlnj-* package matching SMLNJ_VERSION. smlnj-version: @{ ${PKG_INFO} -e smlnj && \ ${EXPR} `${PKG_INFO} -E smlnj` : '.*-\(.*\)' 2>/dev/null ; } || \ ${ECHO_CMD} ${PKGVERSION} .include Index: head/lang/smlnj/files/do-patch-base_runtime_objs_mk.x86-freebsd =================================================================== --- head/lang/smlnj/files/do-patch-base_runtime_objs_mk.x86-freebsd (revision 475002) +++ head/lang/smlnj/files/do-patch-base_runtime_objs_mk.x86-freebsd (revision 475003) @@ -1,37 +1,37 @@ ---- base/runtime/objs/mk.x86-freebsd.orig 2006-04-20 17:28:53.000000000 +0200 -+++ base/runtime/objs/mk.x86-freebsd 2014-07-04 13:12:45.000000000 +0200 +--- base/runtime/objs/mk.x86-freebsd.orig 2006-04-20 15:28:53 UTC ++++ base/runtime/objs/mk.x86-freebsd @@ -5,19 +5,19 @@ SHELL = /bin/sh -MAKE = gmake +MAKE = make ARFLAGS = Trcv -CC = gcc -ansi -CFLAGS = -O2 -CPP = gcc -x assembler-with-cpp -E -P +CC ?= gcc -ansi +CFLAGS ?= -O2 +CPP = ${CC} -x assembler-with-cpp -E -P #CPP = /usr/bin/cpp -P XOBJS = XLIBS = ../c-libs/dl/libunix-dynload.a LD_LIBS = BASE_DEFS = -DEFS = $(BASE_DEFS) -DHOST_X86 -DTARGET_X86 -DOPSYS_UNIX -DOPSYS_FREEBSD -DDLOPEN +DEFS = $(BASE_DEFS) -DHOST_X86 -DTARGET_X86 -DOPSYS_UNIX -DOPSYS_FREEBSD -DDLOPEN $(EXTRA_DEFS) TARGET = X86 VERSION = v-x86-freebsd RUNTIME = run.x86-freebsd -@@ -25,6 +25,6 @@ +@@ -25,6 +25,6 @@ RUNTIME_SO = run.x86-freebsd.so RUNTIME_A = run.x86-freebsd.a all: - ($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME)) - ($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared" $(RUNTIME_SO)) - ($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="" $(RUNTIME_A)) -+ ($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME)) -+ ($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared" $(RUNTIME_SO)) -+ ($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="" $(RUNTIME_A)) ++ ($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="$(LDFLAGS)" $(RUNTIME)) ++ ($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared $(LDFLAGS)" $(RUNTIME_SO)) ++ ($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="$(LDFLAGS)" $(RUNTIME_A)) Index: head/lang/smlnj/files/patch-config_install.sh =================================================================== --- head/lang/smlnj/files/patch-config_install.sh (revision 475002) +++ head/lang/smlnj/files/patch-config_install.sh (revision 475003) @@ -1,180 +1,181 @@ ---- config/install.sh.orig 2014-08-22 15:20:03.000000000 +0200 -+++ config/install.sh 2014-08-23 14:19:47.061124086 +0200 -@@ -17,6 +17,8 @@ +--- config/install.sh.orig 2014-08-22 13:20:03 UTC ++++ config/install.sh +@@ -17,6 +17,8 @@ else nolib=false fi +[ -n "$RECOMPILEDIR" ] && echo "RECOMPILEDIR=$RECOMPILEDIR" + if [ x${INSTALL_QUIETLY} = xtrue ] ; then export CM_VERBOSE CM_VERBOSE=false -@@ -37,6 +39,28 @@ +@@ -37,6 +39,28 @@ complain() { exit 1 } +# +# do_patch patch-file +# apply a patch file +do_patch() { + patchfile=$FILESDIR/$1 + + if [ ! -r $patchfile ]; then + echo "$this: !!! patch file $patchfile not found." + exit 1; + fi + + if [ ! -f $CONFIGDIR/.patch_$1 ]; then + $PATCH $PATCH_ARGS < $patchfile || {\ + echo "$this: !!! patch file $patchfile failed to patch." + exit 1; + } + echo > $CONFIGDIR/.patch_$1 + else + echo "$this: patch $patchfile already installed." + fi +} + this=$0 -@@ -96,7 +120,28 @@ +@@ -96,7 +120,28 @@ trap 'cd "$ROOT"; rm -f $tmpfiles' 0 1 2 3 15 # Especially important is CM_PATHCONFIG. # export CM_PATHCONFIG -CM_PATHCONFIG=$LIBDIR/pathconfig +if [ -n "$STAGEDIR" -a -n "$MLLIB" ] +then + # The final CM_PATHCONFIG file should not yet exist during + # staging, but still it has to be set in the environment when + # creating the (final) compiler heap. This way it becomes the + # the default pathconfig for the (final) heap. + # Therefore we will use the secondary pathconfig environment + # variable CM_LOCAL_PATHCONFIG to point to the (existing;) + # pathconfig in ROOT. This enables $smlnj/installer.cm + # to operate within STAGEDIR (using the final heap) below. + CM_PATHCONFIG=$MLLIB/pathconfig + if [ -r $CM_PATHCONFIG ] + then + vsay "$this: !!! Staging conflicts with an existing installation!" + complain "$this: !!! Make $CM_PATHCONFIG unreadable and try again!" + fi + CM_PATHCONFIG_STAGE=$STAGEDIR$CM_PATHCONFIG + CM_LOCAL_PATHCONFIG=$CM_PATHCONFIG_STAGE +else + CM_PATHCONFIG=$LIBDIR/pathconfig + CM_PATHCONFIG_STAGE=$CM_PATHCONFIG +fi # # the release version that we are installing # -@@ -326,7 +371,12 @@ +@@ -326,7 +371,12 @@ fi # the name of the bin files directory # BOOT_ARCHIVE=boot.$ARCH-unix -BOOT_FILES=sml.$BOOT_ARCHIVE +if [ -z "$RECOMPILEDIR" ] +then + BOOT_FILES=sml.$BOOT_ARCHIVE +else + BOOT_FILES=$RECOMPILEDIR/sml.$BOOT_ARCHIVE +fi # # build the run-time system -@@ -335,9 +385,15 @@ +@@ -335,9 +385,15 @@ if [ -x "$RUNDIR"/run.$ARCH-$OPSYS ]; then vsay $this: Run-time system already exists. else "$CONFIGDIR"/unpack "$ROOT" runtime + [ -n "$MLRUNTIMEPATCHES" ] && \ + for p in $MLRUNTIMEPATCHES + do + do_patch $p + done cd "$BASEDIR"/runtime/objs echo $this: Compiling the run-time system. - $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS -+ echo "$MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS=\""$AS\"" CFLAGS=\"$CFLAGS\"" -+ $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS="$AS" CFLAGS="$CFLAGS" ++ echo "$MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS=\""$AS\"" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\"" ++ $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS="$AS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" if [ -x run.$ARCH-$OPSYS ]; then mv run.$ARCH-$OPSYS "$RUNDIR" if [ -f runx.$ARCH-$OPSYS ]; then -@@ -349,7 +405,7 @@ +@@ -349,7 +405,7 @@ else if [ -f run.$ARCH-$OPSYS.a ]; then mv run.$ARCH-$OPSYS.a "$RUNDIR" fi - $MAKE MAKE=$MAKE clean + [ "$MLNORUNTIMECLEAN" ] || $MAKE MAKE=$MAKE clean else complain "$this: !!! Run-time system build failed for some reason." fi -@@ -375,7 +431,7 @@ +@@ -375,7 +431,7 @@ if [ -r "$HEAPDIR"/sml.$HEAP_SUFFIX ]; then complain "$this !!! Unable to re-create heap image (sml.$HEAP_SUFFIX)." fi else - "$CONFIGDIR"/unpack "$ROOT" "$BOOT_ARCHIVE" + [ -n "$RECOMPILEDIR" ] || "$CONFIGDIR"/unpack "$ROOT" "$BOOT_ARCHIVE" fish "$ROOT"/"$BOOT_FILES"/smlnj/basis -@@ -410,7 +466,7 @@ +@@ -410,7 +466,7 @@ else cd "$ROOT"/"$BOOT_FILES" for anchor in * ; do if [ -d $anchor ] ; then - echo $anchor $anchor >>$CM_PATHCONFIG + echo $anchor $anchor >>$CM_PATHCONFIG_STAGE move $anchor "$LIBDIR"/$anchor fi done -@@ -433,6 +489,18 @@ +@@ -433,6 +489,18 @@ installdriver _ml-build ml-build cd "$ROOT" +# apply source patches for standard targets +[ -n "$MLSTANDARDPATCHDIRS" ] && \ +for d in $MLSTANDARDPATCHDIRS +do + "$CONFIGDIR"/unpack "$ROOT" "$d" +done +[ -n "$MLSTANDARDPATCHES" ] && \ +for p in $MLSTANDARDPATCHES +do + do_patch $p +done + # # Now do all the rest using the precompiled installer # (see base/system/smlnj/installer for details) -@@ -442,6 +510,12 @@ +@@ -442,6 +510,12 @@ if [ $nolib = false ] ; then export ROOT INSTALLDIR CONFIGDIR BINDIR CM_TOLERATE_TOOL_FAILURES=true export CM_TOLERATE_TOOL_FAILURES + # smlnj/installer/nix-install.sml (re)sets CM_LOCAL_PATHCONFIG + # to /dev/null in the buildcmd that it uses to invoke the builds. + # So the build process needs a working CM_PATHCONFIG. This is NOT + # propagated to the resulting heaps because the heaps generated + # in this stage don't contain the compiler. + [ -z "$STAGEDIR" ] || CM_PATHCONFIG=$CM_LOCAL_PATHCONFIG if "$BINDIR"/sml -m \$smlnj/installer.cm then vsay $this: Installation complete. -@@ -450,4 +524,19 @@ +@@ -449,5 +523,20 @@ if [ $nolib = false ] ; then + complain "$this: !!! Installation of libraries and programs failed." fi fi - ++ +# Finish staging by removing the $STAGEDIR prefix from the driver scripts. +if [ -n "$STAGEDIR" ] +then + find $BINDIR -type f -perm -1 | \ + xargs fgrep -l "$STAGEDIR" | \ + xargs sed -i "" -e 's%'"$STAGEDIR"'%%g' +fi + +# apply all source patches +[ -n "$MLSOURCEPATCHES" ] && \ +for p in $MLSOURCEPATCHES +do + do_patch $p +done -+ + exit 0