Print this page
OS-2559 illumos-extra should provide native node in proto.strap
Split |
Close |
Expand all |
Collapse all |
--- old/node.js/Makefile
+++ new/node.js/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License, Version 1.0 only
6 6 # (the "License"). You may not use this file except in compliance
7 7 # with the License.
8 8 #
9 9 # You can obtain a copy of the license at COPYING
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at COPYING.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 # Copyright (c) 2013, Joyent, Inc. All rights reserved.
22 22 #
23 23
24 24 MAJOR_VER = 0.8
25 -VER = node-v0.8.20
25 +VER = node-v0.8.20
26 26
27 27 include ../Makefile.defs
28 28
29 29 NODE_ROOT = $(DESTDIR)/usr/node/$(MAJOR_VER)
30 30 VERSIONJS = $(NODE_ROOT)/node_modules/platform_node_version.js
31 31
32 32 CFLAGS += -Wno-unknown-pragmas
33 33
34 34 #
35 35 # Node's build system is super broken. If we pass it LIBS at configure time,
36 36 # it ignores it. If we pass it LIBS at make time, it completely replaces all
37 37 # libraries, including those the build system itself would normally add.
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
38 38 # So our only option is to add this to LDFLAGS, which has to be passed at
39 39 # build time... including for the install target, because the generated
40 40 # makefiles have missing dependencies and rebuild stuff when installing.
41 41 # This has to be the most complicated, baroque, pointlessly wrong way
42 42 # imaginable to build something with a few dozen source files. The next time
43 43 # you are here reading this and trying to work around the next piece of
44 44 # Node build stupidity, just stop. Rip all this out, write a simple makefile,
45 45 # and copy it in at unpack time like we do for bzip2.
46 46 #
47 47 LDFLAGS += -lumem
48 +
49 +ifeq ($(STRAP),strap)
50 + LDFLAGS += $(SYSLIBDIRS:%=-R$(DESTDIR)/%)
51 +endif
48 52
49 53 AUTOCONF_OPTS += \
50 54 --with-dtrace \
51 55 --openssl-use-sys \
52 56 --openssl-libpath=$(DESTDIR)/lib \
53 57 --openssl-includes=$(DESTDIR)/usr/include \
54 58 --shared-openssl-libname=sunw_crypto,sunw_ssl \
55 59 --shared-zlib \
56 60 --shared-zlib-libpath=$(DESTDIR)/lib \
57 61 --shared-zlib-includes=$(DESTDIR)/usr/include \
58 62 --prefix=/usr/node/$(MAJOR_VER)
59 63
60 64 AUTOCONF_CFLAGS = CFLAGS="$(CPPFLAGS) $(CFLAGS)"
61 65 AUTOCONF_LIBS =
62 66 AUTOCONF_ENV += CXXFLAGS="$(CPPFLAGS) $(CFLAGS)"
63 67
64 68 #
65 69 # Jump through hoops to get the locally-run build tools to build with the
66 70 # correct compiler and without referencing anything in the proto area.
67 71 # This is needed because the proto area may contain libraries that are not
68 72 # present or are of different versions on the build machine itself. A
69 73 # patch to the python configure program is also required to make this work.
70 74 #
71 75 AUTOCONF_ENV += LDFLAGS.host="-Wl,-i"
72 76 AUTOCONF_ENV += CXX.host="$(BASE)/wrapper $(GXX.host)"
73 77 AUTOCONF_ENV += CC.host="$(BASE)/wrapper $(GCC.host)"
74 78 AUTOCONF_ENV += CXX_host="$(BASE)/wrapper $(GXX.host)"
75 79 AUTOCONF_ENV += CC_host="$(BASE)/wrapper $(GCC.host)"
76 80 AUTOCONF_ENV += LINK.host="$(BASE)/wrapper $(GXX.host)"
77 81
78 82 OVERRIDES += $(AUTOCONF_ENV)
79 83
80 84 AUTOCONF_OUT = build/default/config.h
81 85
82 86 PATCHES = Patches/*
83 87 CLEANFILES += genversionjs
84 88
85 89 all: all_autoconf
86 90
87 91 all_autoconf: wrapper
88 92
89 93 #
90 94 # We build a host tool against the installed header so that we can spew a
91 95 # JavaScript file containing the version of the installed node.js binary.
92 96 #
93 97 genversionjs: genversionjs.c install_autoconf
94 98 $(GCC.host) -o $@ -include $(NODE_ROOT)/include/node/node_version.h $<
95 99
96 100 #
97 101 # Ready for another hack? This wrapper "translates" target gcc options into
98 102 # ones suitable for running on the host during the build. This is needed
99 103 # because node's build system doesn't have any way to pass different options
100 104 # for the host and taget, and tries to build host tools as part of the build.
101 105 # Hooray, node!
102 106 #
103 107 wrapper: wrapper.c
104 108 $(GCC.host) -Wall -Wextra -Werror -O2 -o $@ $<
105 109
106 110 # - platform_node_version.js is autogenerated with the current node version
107 111 # - we move man pages as we want them in /usr/node/0.8/man
108 112 install: install_autoconf genversionjs
109 113 mkdir -p $(NODE_ROOT)/node_modules
110 114 ./genversionjs > $(VERSIONJS)
111 115 rm -rf $(NODE_ROOT)/man
112 116 mv $(NODE_ROOT)/share/man $(NODE_ROOT)/
113 117
114 118 include ../Makefile.targ
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX