| @@ -1,124 +1,119 @@ | | | @@ -1,124 +1,119 @@ |
1 | # $NetBSD: Makefile,v 1.138 2020/12/09 10:33:04 jaapb Exp $ | | 1 | # $NetBSD: Makefile,v 1.139 2020/12/10 16:17:55 wiz Exp $ |
2 | | | 2 | |
3 | .include "Makefile.common" | | 3 | .include "Makefile.common" |
4 | | | 4 | |
5 | #CONFIGURE_ENV+= disable_x11=yes | | 5 | #CONFIGURE_ENV+= disable_x11=yes |
6 | | | 6 | |
7 | BUILD_TARGET= world | | 7 | BUILD_TARGET= world |
8 | TEST_PROGRAM= ocamltest | | 8 | TEST_PROGRAM= ocamltest |
9 | MAKE_JOBS_SAFE= no | | 9 | MAKE_JOBS_SAFE= no |
10 | UNLIMIT_RESOURCES= stacksize | | 10 | UNLIMIT_RESOURCES= stacksize |
11 | | | 11 | |
12 | USE_TOOLS+= bash | | 12 | USE_TOOLS+= bash |
13 | USE_LANGUAGES+= c | | 13 | USE_LANGUAGES+= c |
14 | USE_LIBTOOL= yes | | 14 | USE_LIBTOOL= yes |
15 | USE_GNU_CONFIGURE_HOST= no | | 15 | USE_GNU_CONFIGURE_HOST= no |
16 | | | 16 | |
17 | #USE_GCC_RUNTIME= yes | | 17 | #USE_GCC_RUNTIME= yes |
18 | | | 18 | |
19 | PLIST_VARS+= ocaml-stub ocaml-prof ocaml-opt ocaml-nat ocaml-spacetime \ | | 19 | PLIST_VARS+= ocaml-stub ocaml-prof ocaml-opt ocaml-nat ocaml-spacetime \ |
20 | instrumented_runtime | | 20 | instrumented_runtime |
21 | | | 21 | |
22 | .include "options.mk" | | 22 | .include "options.mk" |
23 | ### | | 23 | ### |
24 | ### PLIST components | | 24 | ### PLIST components |
25 | ### | | 25 | ### |
26 | | | 26 | |
27 | # Stub libraries for functions missing from base system. | | 27 | # Stub libraries for functions missing from base system. |
28 | .if !empty(MACHINE_PLATFORM:MDarwin-*-powerpc) || \ | | 28 | .if !empty(MACHINE_PLATFORM:MDarwin-*-powerpc) || \ |
29 | !empty(MACHINE_PLATFORM:MDarwin-9.*-i386) || \ | | 29 | !empty(MACHINE_PLATFORM:MDarwin-9.*-i386) || \ |
30 | !empty(MACHINE_PLATFORM:MDarwin-1[0-9].*) || \ | | 30 | !empty(MACHINE_PLATFORM:MDarwin-1[0-9].*) || \ |
31 | ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD" || \ | | 31 | ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD" || \ |
32 | ${OPSYS} == "FreeBSD" || ${OPSYS} == "SunOS" || \ | | 32 | ${OPSYS} == "FreeBSD" || ${OPSYS} == "SunOS" || \ |
33 | ${OPSYS} == "Linux" | | 33 | ${OPSYS} == "Linux" |
34 | PLIST.ocaml-stub= yes | | 34 | PLIST.ocaml-stub= yes |
35 | .endif | | 35 | .endif |
36 | | | 36 | |
37 | # Optional components built only on certain platforms. | | 37 | # Optional components built only on certain platforms. |
38 | .if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "powerpc") || \ | | 38 | .if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "powerpc") || \ |
39 | !empty(MACHINE_ARCH:M*arm*) || (${MACHINE_ARCH} == "aarch64") || \ | | 39 | !empty(MACHINE_ARCH:M*arm*) || (${MACHINE_ARCH} == "aarch64") || \ |
40 | (${MACHINE_ARCH} == "x86_64") | | 40 | (${MACHINE_ARCH} == "x86_64") |
41 | BUILD_TARGET+= opt opt.opt | | 41 | BUILD_TARGET+= opt opt.opt |
42 | TEST_PROGRAM+= ocamltest.opt | | 42 | TEST_PROGRAM+= ocamltest.opt |
43 | PLIST.ocaml-opt= yes | | 43 | PLIST.ocaml-opt= yes |
44 | . if empty(MACHINE_PLATFORM:MDarwin-*-powerpc) && \ | | 44 | . if empty(MACHINE_PLATFORM:MDarwin-*-powerpc) && \ |
45 | empty(MACHINE_PLATFORM:MSunOS-*-i386) && \ | | 45 | empty(MACHINE_PLATFORM:MSunOS-*-i386) && \ |
46 | (${MACHINE_ARCH} != "aarch64") | | 46 | (${MACHINE_ARCH} != "aarch64") |
47 | PLIST.ocaml-prof= yes | | 47 | PLIST.ocaml-prof= yes |
48 | . endif | | 48 | . endif |
49 | .endif | | 49 | .endif |
50 | | | 50 | |
51 | # XXX This conditional is not complete. It should match the | | 51 | # XXX This conditional is not complete. It should match the |
52 | # conditional in ocaml-x.y.z/configure. | | 52 | # conditional in ocaml-x.y.z/configure. |
53 | .if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64") || \ | | 53 | .if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64") || \ |
54 | (${MACHINE_ARCH} == "aarch64") | | 54 | (${MACHINE_ARCH} == "aarch64") |
55 | . if !empty(MACHINE_PLATFORM:MLinux-*-*) || \ | | 55 | . if !empty(MACHINE_PLATFORM:MLinux-*-*) || \ |
56 | !empty(MACHINE_PLATFORM:MFreeBSD-*-*) || \ | | 56 | !empty(MACHINE_PLATFORM:MFreeBSD-*-*) || \ |
57 | !empty(MACHINE_PLATFORM:MDragonFly-*-*) || \ | | 57 | !empty(MACHINE_PLATFORM:MDragonFly-*-*) || \ |
58 | (!empty(MACHINE_PLATFORM:MNetBSD-*-*) && empty(MACHINE_PLATFORM:MNetBSD-*-powerpc)) || \ | | 58 | (!empty(MACHINE_PLATFORM:MNetBSD-*-*) && empty(MACHINE_PLATFORM:MNetBSD-*-powerpc)) || \ |
59 | !empty(MACHINE_PLATFORM:MDarwin-*-*) || \ | | 59 | !empty(MACHINE_PLATFORM:MDarwin-*-*) || \ |
60 | !empty(MACHINE_PLATFORM:MSunOS-*-*) | | 60 | !empty(MACHINE_PLATFORM:MSunOS-*-*) |
61 | PLIST.ocaml-nat= yes | | 61 | PLIST.ocaml-nat= yes |
62 | . endif | | 62 | . endif |
63 | .endif | | 63 | .endif |
64 | | | 64 | |
65 | # Spacetime profiling is only available for native code on 64-bit targets. | | 65 | # Spacetime profiling is only available for native code on 64-bit targets. |
66 | .if (${MACHINE_ARCH} == "x86_64") || (${MACHINE_ARCH} == "aarch64") | | 66 | .if (${MACHINE_ARCH} == "x86_64") || (${MACHINE_ARCH} == "aarch64") |
67 | PLIST.ocaml-spacetime= yes | | 67 | PLIST.ocaml-spacetime= yes |
68 | .endif | | 68 | .endif |
69 | | | 69 | |
70 | # clock_gettime(2), required by POSIX, is necessary for the | | 70 | # clock_gettime(2), required by POSIX, is necessary for the |
71 | # instrumented_runtime feature. | | 71 | # instrumented_runtime feature. |
72 | # It is missing on macOS before 10.12. | | 72 | # It is missing on macOS before 10.12. |
73 | .if ${OPSYS} != "Darwin" || ${OS_VERSION:R:R} >= 16 | | 73 | .if ${OPSYS} != "Darwin" || ${OS_VERSION:R:R} >= 16 |
74 | PLIST.instrumented_runtime= yes | | 74 | PLIST.instrumented_runtime= yes |
75 | .endif | | 75 | .endif |
76 | | | 76 | |
77 | # This is needed because ${WRKSRC}/build/partial-install.sh uses | | 77 | # This is needed because ${WRKSRC}/build/partial-install.sh uses |
78 | # $PWD as part of its script. However, with /bin/sh on SunOS | | 78 | # $PWD as part of its script. However, with /bin/sh on SunOS |
79 | # (cd work/foo-1.0 && echo $PWD) will show that the value of PWD is | | 79 | # (cd work/foo-1.0 && echo $PWD) will show that the value of PWD is |
80 | # set before the cd takes place and is then passed down. So the end | | 80 | # set before the cd takes place and is then passed down. So the end |
81 | # result is when ./build/partial-install.sh is called, PWD is set | | 81 | # result is when ./build/partial-install.sh is called, PWD is set |
82 | # to /usr/pkgsrc/devel/ocaml instead of ${WRKSRC}. /bin/ksh, which | | 82 | # to /usr/pkgsrc/devel/ocaml instead of ${WRKSRC}. /bin/ksh, which |
83 | # is what ${SH} is on SunOS, doesn't exhibit this behaviour. | | 83 | # is what ${SH} is on SunOS, doesn't exhibit this behaviour. |
84 | .if ${OPSYS} == "SunOS" | | 84 | .if ${OPSYS} == "SunOS" |
85 | INSTALL_MAKE_FLAGS+= SHELL=${SH:Q} | | 85 | INSTALL_MAKE_FLAGS+= SHELL=${SH:Q} |
86 | .endif | | 86 | .endif |
87 | | | 87 | |
88 | #INSTALLATION_DIRS= ${PKGMANDIR}/man1 | | 88 | #INSTALLATION_DIRS= ${PKGMANDIR}/man1 |
89 | | | 89 | |
90 | OPSYSVARS+= EXTRA_RT_LIBS | | 90 | OPSYSVARS+= EXTRA_RT_LIBS |
91 | EXTRA_RT_LIBS.NetBSD= -lcurses | | 91 | EXTRA_RT_LIBS.NetBSD= -lcurses |
92 | EXTRA_RT_LIBS.*= | | 92 | EXTRA_RT_LIBS.*= |
93 | | | 93 | |
94 | PRINT_PLIST_AWK+= { gsub(/lib\/ocaml\/${PKGMANDIR:S|/|\\/|}/, "lib/ocaml/$${PKGMANDIR}"); } | | 94 | PRINT_PLIST_AWK+= { gsub(/lib\/ocaml\/${PKGMANDIR:S|/|\\/|}/, "lib/ocaml/$${PKGMANDIR}"); } |
95 | | | 95 | |
96 | .if defined(PLIST.instrumented_runtime) | | | |
97 | REPLACE_BASH+= tools/ocaml-instr-graph | | | |
98 | REPLACE_AWK+= tools/ocaml-instr-report | | | |
99 | .endif | | | |
100 | | | | |
101 | do-test: | | 96 | do-test: |
102 | cd ${WRKSRC} && ${MAKE_PROGRAM} ${TEST_PROGRAM} | | 97 | cd ${WRKSRC} && ${MAKE_PROGRAM} ${TEST_PROGRAM} |
103 | cd ${WRKSRC}/testsuite && ${MAKE_PROGRAM} all | | 98 | cd ${WRKSRC}/testsuite && ${MAKE_PROGRAM} all |
104 | | | 99 | |
105 | .if ${OPSYS} == "Darwin" | | 100 | .if ${OPSYS} == "Darwin" |
106 | .PHONY: fix-darwin-install-name | | 101 | .PHONY: fix-darwin-install-name |
107 | post-install: fix-darwin-install-name | | 102 | post-install: fix-darwin-install-name |
108 | fix-darwin-install-name: | | 103 | fix-darwin-install-name: |
109 | for f in ${DESTDIR}${PREFIX}/lib/ocaml/*.so \ | | 104 | for f in ${DESTDIR}${PREFIX}/lib/ocaml/*.so \ |
110 | ${DESTDIR}${PREFIX}/lib/ocaml/stublibs/*.so; do \ | | 105 | ${DESTDIR}${PREFIX}/lib/ocaml/stublibs/*.so; do \ |
111 | install_name_tool -id `${ECHO} $$f | ${SED} -e 's,${DESTDIR},,g'` $$f; \ | | 106 | install_name_tool -id `${ECHO} $$f | ${SED} -e 's,${DESTDIR},,g'` $$f; \ |
112 | done | | 107 | done |
113 | .endif | | 108 | .endif |
114 | | | 109 | |
115 | #post-install: | | 110 | #post-install: |
116 | # set -e ; cd ${DESTDIR}${PREFIX}/lib/ocaml/${PKGMANDIR}/man1; \ | | 111 | # set -e ; cd ${DESTDIR}${PREFIX}/lib/ocaml/${PKGMANDIR}/man1; \ |
117 | # for m in *; do \ | | 112 | # for m in *; do \ |
118 | # ln -sf ${PREFIX}/lib/ocaml/${PKGMANDIR}/man1/$$m \ | | 113 | # ln -sf ${PREFIX}/lib/ocaml/${PKGMANDIR}/man1/$$m \ |
119 | # ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/$$m; \ | | 114 | # ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/$$m; \ |
120 | # done | | 115 | # done |
121 | | | 116 | |
122 | .include "../../mk/dlopen.buildlink3.mk" | | 117 | .include "../../mk/dlopen.buildlink3.mk" |
123 | .include "../../mk/termcap.buildlink3.mk" | | 118 | .include "../../mk/termcap.buildlink3.mk" |
124 | .include "../../mk/bsd.pkg.mk" | | 119 | .include "../../mk/bsd.pkg.mk" |