| @@ -1,158 +1,144 @@ | | | @@ -1,158 +1,144 @@ |
1 | # $NetBSD: Makefile,v 1.12 2020/01/26 17:31:32 rillig Exp $ | | 1 | # $NetBSD: Makefile,v 1.13 2022/09/16 19:53:44 he Exp $ |
2 | # | | 2 | # |
3 | | | 3 | |
4 | DISTNAME= boot.${BOX}-unix | | 4 | DISTNAME= boot.${BOX}-unix |
5 | PKGNAME= smlnj-${SML_VERSION} | | 5 | PKGNAME= smlnj-${SML_VERSION} |
6 | PKGREVISION= 1 | | 6 | PKGREVISION= 1 |
7 | CATEGORIES= lang | | 7 | CATEGORIES= lang |
8 | MASTER_SITES= http://smlnj.cs.uchicago.edu/dist/working/${SML_VERSION}/ | | 8 | MASTER_SITES= http://smlnj.cs.uchicago.edu/dist/working/${SML_VERSION}/ |
9 | DISTFILES= MLRISC.tgz \ | | 9 | DISTFILES= MLRISC.tgz \ |
10 | boot.${BOX}-unix.tgz \ | | 10 | boot.${BOX}-unix.tgz \ |
11 | ckit.tgz \ | | 11 | ckit.tgz \ |
12 | cm.tgz \ | | 12 | cm.tgz \ |
13 | cml.tgz \ | | 13 | cml.tgz \ |
14 | compiler.tgz \ | | 14 | compiler.tgz \ |
15 | config.tgz \ | | 15 | config.tgz \ |
16 | eXene.tgz \ | | 16 | eXene.tgz \ |
17 | ml-burg.tgz \ | | 17 | ml-burg.tgz \ |
18 | ml-lex.tgz \ | | 18 | ml-lex.tgz \ |
19 | nlffi.tgz \ | | 19 | nlffi.tgz \ |
20 | ml-yacc.tgz \ | | 20 | ml-yacc.tgz \ |
21 | runtime.tgz \ | | 21 | runtime.tgz \ |
22 | smlnj-lib.tgz \ | | 22 | smlnj-lib.tgz \ |
23 | system.tgz \ | | 23 | system.tgz \ |
24 | ml-lpt.tgz \ | | 24 | ml-lpt.tgz \ |
25 | pgraph.tgz \ | | 25 | pgraph.tgz \ |
26 | trace-debug-profile.tgz \ | | 26 | trace-debug-profile.tgz \ |
27 | heap2asm.tgz \ | | 27 | heap2asm.tgz \ |
28 | smlnj-c.tgz | | 28 | smlnj-c.tgz |
29 | | | 29 | |
30 | MAINTAINER= richards+netbsd@CS.Princeton.EDU | | 30 | MAINTAINER= richards+netbsd@CS.Princeton.EDU |
31 | HOMEPAGE= https://www.smlnj.org/index.html | | 31 | HOMEPAGE= https://www.smlnj.org/index.html |
32 | COMMENT= Popular functional language from Bell Labs | | 32 | COMMENT= Popular functional language from Bell Labs |
33 | | | 33 | |
34 | SML_VERSION= 110.72 | | 34 | SML_VERSION= 110.72 |
35 | | | 35 | |
36 | WRKSRC= ${WRKDIR} | | 36 | WRKSRC= ${WRKDIR} |
37 | DIST_SUBDIR= smlnj-${SML_VERSION} | | 37 | DIST_SUBDIR= smlnj-${SML_VERSION} |
38 | USE_TOOLS+= gmake pax | | 38 | USE_TOOLS+= gmake pax |
39 | | | 39 | |
40 | # previous versions of the package had an additional '-' | | 40 | # previous versions of the package had an additional '-' |
41 | CONFLICTS= sml-nj-[0-9]* | | 41 | CONFLICTS= sml-nj-[0-9]* |
42 | | | 42 | |
43 | SML_BASE= ${PREFIX}/lib/smlnj | | 43 | SML_BASE= ${PREFIX}/lib/smlnj |
44 | SML_LIBDIR= ${SML_BASE}/lib | | 44 | SML_LIBDIR= ${SML_BASE}/lib |
45 | SML_BINDIR= ${SML_BASE}/bin | | 45 | SML_BINDIR= ${SML_BASE}/bin |
46 | SML_SCRIPTS= _link-sml _run-sml _ml-build _ml-makedepend | | 46 | SML_SCRIPTS= _link-sml _run-sml _ml-build _ml-makedepend |
47 | | | 47 | |
48 | # while building, the work directory is the "installation" | | 48 | # while building, the work directory is the "installation" |
49 | BUILD_ENV+= SMLNJ_HOME="${WRKDIR}" | | 49 | BUILD_ENV+= SMLNJ_HOME="${WRKDIR}" |
50 | | | 50 | |
51 | # the build uses patch directly (yuk) | | 51 | # the build uses patch directly (yuk) |
52 | BUILD_ENV+= PATCH=${PATCH:Q} PATCH_ARGS=${PATCH_ARGS:Q} | | 52 | BUILD_ENV+= PATCH=${PATCH:Q} PATCH_ARGS=${PATCH_ARGS:Q} |
53 | | | 53 | |
54 | # useful for debugging | | 54 | # useful for debugging |
55 | #CFLAGS+= -Wall | | 55 | #CFLAGS+= -Wall |
56 | | | 56 | |
57 | # note that this includes bsd.prefs.mk | | 57 | # note that this includes bsd.prefs.mk |
58 | .include "../../lang/smlnj/Makefile.common" | | 58 | .include "../../lang/smlnj/Makefile.common" |
59 | | | 59 | |
60 | BOXES= x86 ppc sparc | | 60 | BOXES= x86 ppc sparc |
61 | | | 61 | |
62 | .if make(distinfo) || make(makesum) || make(mdi) | | 62 | .if make(distinfo) || make(makesum) || make(mdi) |
63 | . for B in ${BOXES} | | 63 | . for B in ${BOXES} |
64 | DISTFILES+= boot.${B}-unix.tgz | | 64 | DISTFILES+= boot.${B}-unix.tgz |
65 | . endfor | | 65 | . endfor |
66 | .endif | | 66 | .endif |
67 | | | 67 | |
68 | # | | 68 | # |
69 | # For smlnj reasons the runtime system needs to be unpacked twice, once | | 69 | # For smlnj reasons the runtime system needs to be unpacked twice, once |
70 | # in work/src and once in work/base. | | 70 | # in work/src and once in work/base. |
71 | # | | 71 | # |
72 | # As of 20160624, instead of inconsistently patching one copy or the | | 72 | # As of 20160624, instead of inconsistently patching one copy or the |
73 | # other and hoping, or patching both and duplicating all the patches, | | 73 | # other and hoping, or patching both and duplicating all the patches, |
74 | # we'll patch only work/src, and then *after* patching clone work/src | | 74 | # we'll patch only work/src, and then *after* patching clone work/src |
75 | # into work/base. | | 75 | # into work/base. |
76 | # | | 76 | # |
77 | | | 77 | |
78 | # create parent directories for the runtime system | | 78 | # create parent directories for the runtime system |
79 | pre-extract: | | 79 | pre-extract: |
80 | ${MKDIR} ${WRKDIR}/src || ${TRUE} | | 80 | ${MKDIR} ${WRKDIR}/src || ${TRUE} |
81 | ${MKDIR} ${WRKDIR}/base || ${TRUE} | | 81 | ${MKDIR} ${WRKDIR}/base || ${TRUE} |
82 | | | 82 | |
83 | # make it easier to patch the runtime system | | 83 | # make it easier to patch the runtime system |
84 | do-extract: | | 84 | do-extract: |
85 | ${RUN} extract_file="${_DISTDIR}/config.tgz"; \ | | 85 | ${RUN} extract_file="${_DISTDIR}/config.tgz"; \ |
86 | export extract_file; \ | | 86 | export extract_file; \ |
87 | cd ${WRKDIR}; ${EXTRACT_CMD} | | 87 | cd ${WRKDIR}; ${EXTRACT_CMD} |
88 | ${RUN} extract_file="${_DISTDIR}/runtime.tgz"; \ | | 88 | ${RUN} extract_file="${_DISTDIR}/runtime.tgz"; \ |
89 | export extract_file; \ | | 89 | export extract_file; \ |
90 | cd ${WRKDIR}/src; ${EXTRACT_CMD} | | 90 | cd ${WRKDIR}/src; ${EXTRACT_CMD} |
91 | | | 91 | |
92 | # symlink the rest of the distfiles | | 92 | # symlink the rest of the distfiles |
93 | # also copy in new configs | | 93 | # also copy in new configs |
94 | post-extract: | | 94 | post-extract: |
95 | cd ${WRKDIR} && ${LN} -sf ${_DISTDIR}/* . | | 95 | cd ${WRKDIR} && ${LN} -sf ${_DISTDIR}/* . |
96 | cp ${FILESDIR}/mk.* ${WRKDIR}/src/runtime/objs/ | | 96 | cp ${FILESDIR}/mk.* ${WRKDIR}/src/runtime/objs/ |
97 | | | 97 | |
98 | # make the necessary copy of the runtime, _after_ patching src | | 98 | # make the necessary copy of the runtime, _after_ patching src |
99 | post-patch: | | 99 | post-patch: |
100 | cd ${WRKDIR}/src && pax -rw runtime ${WRKDIR}/base/ | | 100 | cd ${WRKDIR}/src && pax -rw runtime ${WRKDIR}/base/ |
101 | | | 101 | |
102 | # Turn of nlffi on powerpc (I guess it doesn't work?) | | | |
103 | # | | | |
104 | # XXX: this switch doesn't work any more as the line in question doesn't | | | |
105 | # exist in the current version. Someone with a PPC build machine, | | | |
106 | # please check it out and either change it to match the file if still | | | |
107 | # needed, or get rid of it. | | | |
108 | .if ${MACHINE_ARCH} == "powerpc" | | | |
109 | SUBST_CLASSES+= nlffi | | | |
110 | SUBST_STAGE.nlffi= pre-configure | | | |
111 | SUBST_MESSAGE.nlffi= Turning off nlffi | | | |
112 | SUBST_FILES.nlffi= config/targets | | | |
113 | SUBST_SED.nlffi= -e '/^request nlffi$$/d' | | | |
114 | .endif # powerpc | | | |
115 | | | | |
116 | # resolve definition of SML_BASE | | 102 | # resolve definition of SML_BASE |
117 | SUBST_CLASSES+= smlbase | | 103 | SUBST_CLASSES+= smlbase |
118 | SUBST_STAGE.smlbase= pre-configure | | 104 | SUBST_STAGE.smlbase= pre-configure |
119 | SUBST_MESSAGE.smlbase= Setting SML_BASE | | 105 | SUBST_MESSAGE.smlbase= Setting SML_BASE |
120 | SUBST_FILES.smlbase= ${SML_SCRIPTS:S/^/config\//} | | 106 | SUBST_FILES.smlbase= ${SML_SCRIPTS:S/^/config\//} |
121 | SUBST_VARS.smlbase= SML_BASE | | 107 | SUBST_VARS.smlbase= SML_BASE |
122 | | | 108 | |
123 | # resolve definition of CFLAGS in patched files | | 109 | # resolve definition of CFLAGS in patched files |
124 | # (note that we need to do this in both src/runtime and base/runtime) | | 110 | # (note that we need to do this in both src/runtime and base/runtime) |
125 | SUBST_CLASSES+= cflags | | 111 | SUBST_CLASSES+= cflags |
126 | SUBST_STAGE.cflags= pre-configure | | 112 | SUBST_STAGE.cflags= pre-configure |
127 | SUBST_MESSAGE.cflags= Setting CFLAGS | | 113 | SUBST_MESSAGE.cflags= Setting CFLAGS |
128 | SUBST_FILES.cflags= src/runtime/objs/* base/runtime/objs/* | | 114 | SUBST_FILES.cflags= src/runtime/objs/* base/runtime/objs/* |
129 | SUBST_VARS.cflags= CFLAGS | | 115 | SUBST_VARS.cflags= CFLAGS |
130 | | | 116 | |
131 | # use the proper shell | | 117 | # use the proper shell |
132 | SUBST_CLASSES+= shell | | 118 | SUBST_CLASSES+= shell |
133 | SUBST_STAGE.shell= pre-configure | | 119 | SUBST_STAGE.shell= pre-configure |
134 | SUBST_MESSAGE.shell= Choosing the right shell | | 120 | SUBST_MESSAGE.shell= Choosing the right shell |
135 | SUBST_FILES.shell= config/install.sh | | 121 | SUBST_FILES.shell= config/install.sh |
136 | SUBST_VARS.shell= CONFIG_SHELL | | 122 | SUBST_VARS.shell= CONFIG_SHELL |
137 | | | 123 | |
138 | # nothing here any more | | 124 | # nothing here any more |
139 | do-configure: | | 125 | do-configure: |
140 | ${DO_NADA} | | 126 | ${DO_NADA} |
141 | | | 127 | |
142 | # The build target needs to run $WRKDIR/config/install.sh | | 128 | # The build target needs to run $WRKDIR/config/install.sh |
143 | do-build: | | 129 | do-build: |
144 | cd ${WRKDIR} && unset PWD && ${SETENV} ${BUILD_ENV} \ | | 130 | cd ${WRKDIR} && unset PWD && ${SETENV} ${BUILD_ENV} \ |
145 | ${CONFIG_SHELL} ./config/install.sh | | 131 | ${CONFIG_SHELL} ./config/install.sh |
146 | | | 132 | |
147 | # install target | | 133 | # install target |
148 | # (see ftp://ftp.research.bell-labs.com/dist/smlnj/working/110.38/INSTALL) | | 134 | # (see ftp://ftp.research.bell-labs.com/dist/smlnj/working/110.38/INSTALL) |
149 | # 1. create installation directories | | 135 | # 1. create installation directories |
150 | # 2. copy the ./bin and ./lib directories across | | 136 | # 2. copy the ./bin and ./lib directories across |
151 | # 3. install links to executables in $PREFIX/bin | | 137 | # 3. install links to executables in $PREFIX/bin |
152 | INSTALLATION_DIRS= bin | | 138 | INSTALLATION_DIRS= bin |
153 | do-install: | | 139 | do-install: |
154 | ${INSTALL_DATA_DIR} ${DESTDIR}${SML_BASE} | | 140 | ${INSTALL_DATA_DIR} ${DESTDIR}${SML_BASE} |
155 | cd ${WRKDIR} && pax -rw -pam bin lib ${DESTDIR}${SML_BASE} | | 141 | cd ${WRKDIR} && pax -rw -pam bin lib ${DESTDIR}${SML_BASE} |
156 | cd ${DESTDIR}${PREFIX}/bin && ${LN} -sf ../lib/smlnj/bin/* . | | 142 | cd ${DESTDIR}${PREFIX}/bin && ${LN} -sf ../lib/smlnj/bin/* . |
157 | | | 143 | |
158 | .include "../../mk/bsd.pkg.mk" | | 144 | .include "../../mk/bsd.pkg.mk" |