Print this page
OS-2552 add node-lockfd (v0.0.2) to platform
OS-2558 smartos-live should run tools from proto.strap, not proto

Split Close
Expand all
Collapse all
          --- old/src/Makefile
          +++ new/src/Makefile
↓ open down ↓ 108 lines elided ↑ open up ↑
 109  109  KSTAT_OBJDIR =  node-kstat/build/Release
 110  110  KSTAT.NODE =    $(KSTAT_OBJDIR)/kstat.node
 111  111  
 112  112  $(KSTAT.NODE) : WARN_FLAGS +=   -Wno-unused -Wno-write-strings -Wno-sign-compare
 113  113  $(KSTAT.NODE) : CPPFLAGS +=     $(NODE_CPPFLAGS)
 114  114  $(KSTAT.NODE) : CXXFLAGS +=     $(NODE_CFLAGS)
 115  115  $(KSTAT.NODE) : LDFLAGS +=      $(NODE_LDFLAGS)
 116  116  $(KSTAT.NODE) : LIBS +=         -lkstat
 117  117  
 118  118  #
      119 +# The lockfd Node add-on is based on v8plus, which has its own system of
      120 +# Makefiles.
      121 +#
      122 +LOCKFD_BINDING.NODE =           node-lockfd/lib/lockfd_binding.node
      123 +
      124 +LOCKFD_SRC_DIR =                $(PWD)/node-lockfd/src
      125 +LOCKFD_V8PLUS_DIR =             $(PWD)/node-lockfd/node_modules/v8plus
      126 +
      127 +#
 119  128  # The dtrace-provider add-on uses a combination of C, assembly and C++ files in
 120  129  # multiple directories.
 121  130  #
 122  131  DTRACE_PROVIDER_OBJDIR =        node-dtrace-provider/build/Release
 123  132  DTRACE_PROVIDER_SRCDIR =        node-dtrace-provider
 124  133  DTRACE_PROVIDER.NODE =          $(DTRACE_PROVIDER_OBJDIR)/dtrace-provider.node
 125  134  
 126  135  DTRACE_PROVIDER_SRCS += \
 127  136                          dtrace_probe.cc \
 128  137                          dtrace_provider.cc
↓ open down ↓ 178 lines elided ↑ open up ↑
 307  316          disk_size \
 308  317          mkzpool \
 309  318          removable_disk \
 310  319          vmunbundle \
 311  320          zfs_recv \
 312  321          zfs_send \
 313  322          zoneevent \
 314  323          $(EXPAT.NODE) \
 315  324          $(DTRACE_PROVIDER.NODE) \
 316  325          $(KSTAT.NODE) \
      326 +        $(LOCKFD_BINDING.NODE) \
 317  327          $(MICROTIME.NODE) \
 318  328          $(SYSLOG.NODE) \
 319  329          $(SQLITE3_BINDINGS.NODE) \
 320  330          $(UUID.NODE) \
 321  331          $(ZSOCK_BINDINGS.NODE) \
 322  332          $(ZUTIL_BINDINGS.NODE)
 323  333  
 324  334  USR_LIB_TARGETS = \
 325  335          measure_terminal
 326  336  
↓ open down ↓ 10 lines elided ↑ open up ↑
 337  347          mkdir -p $(DESTDIR)/usr/bin
 338  348          cp -p $(TARGETS) sysinfo nictagadm $(DESTDIR)/usr/bin
 339  349          cp -p $(USR_LIB_TARGETS) $(DESTDIR)/usr/lib
 340  350          mkdir -p $(DESTDIR)/smartdc/bin
 341  351          cp -p $(SMARTDC_TARGETS) $(DESTDIR)/smartdc/bin
 342  352          mkdir -p $(DESTDIR)/smartdc/lib
 343  353          cp -p $(SMARTDC_LIB_TARGETS) $(DESTDIR)/smartdc/lib
 344  354          mkdir -m 0755 -p $(PREFIX_NODE)/node_modules
 345  355          cp -Pr node_modules/* $(PREFIX_NODE)/node_modules
 346  356          cp $(KSTAT.NODE) $(PREFIX_NODE)/node_modules/
      357 +        cp node-lockfd/lib/index.js $(PREFIX_NODE)/node_modules/lockfd.js
      358 +        cp $(LOCKFD_BINDING.NODE) $(PREFIX_NODE)/node_modules/lockfd_binding.node
 347  359          cp $(MICROTIME.NODE) $(PREFIX_NODE)/node_modules/
 348  360          rm -rf $(DESTDIR)/usr/vm
 349  361          cp -PR vm $(DESTDIR)/usr/
 350  362          mkdir -m 0755 -p $(DESTDIR)/usr/vm/node_modules
 351  363          mkdir -p $(PREFIX_NODE)/node_modules/{zsock,zutil}/build/Release
 352  364          mkdir -p $(DESTDIR)/usr/vm/test/tests
 353  365          cp -Pr vm/common $(DESTDIR)/usr/vm/test/
 354  366          cp -Pr vm/node-tap $(DESTDIR)/usr/vm/test/
 355  367          cp -Pr vm/tests $(DESTDIR)/usr/vm/test/
 356  368          cp vm/runtest $(DESTDIR)/usr/vm/test/
↓ open down ↓ 98 lines elided ↑ open up ↑
 455  467              | sed -e "s|^tests/|f usr/vm/test/tests/|" \
 456  468              > $(DESTDIR)/$(DESTNAME) \
 457  469  
 458  470  $(JSLINT):
 459  471          (cd $(ROOT); $(MAKE) jsl)
 460  472  
 461  473  clean:
 462  474          -rm -f $(TARGETS) $(SMARTDC_TARGETS) $(SMARTDC_LIB_TARGETS) *.o \
 463  475              $(CLEANFILES)
 464  476          -rm -rf node-sqlite3/build
      477 +        cd $(LOCKFD_SRC_DIR) && $(MAKE) clean
 465  478  
 466  479  include Makefile.targ
 467  480  
 468  481  #
 469  482  # Custom rules for building our various real targets follow.  Generic rules
 470  483  # belong in Makefile.targ.
 471  484  #
 472  485  disklayout: disklayout.js
 473  486          cp disklayout.js disklayout
 474  487          chmod 0755 disklayout
↓ open down ↓ 14 lines elided ↑ open up ↑
 489  502  
 490  503  #
 491  504  # Node native add-on target patterns.  Follow these patterns when adding a new
 492  505  # add-on and see the comment and definitions for EXPAT.NODE above as well.
 493  506  #
 494  507  $(EXPAT.NODE): node-expat/node-expat.cc
 495  508          @mkdir -p $(EXPAT_OBJDIR)
 496  509          $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
 497  510  
 498  511  #
      512 +# node-lockfd is built using the v8plus-based Makefile contained within the
      513 +# project.  We use LD_OPTIONS, here, to induce the linker to include libc,
      514 +# which gcc as configured in proto.strap does not, but which other C compilers
      515 +# generally do.
      516 +#
      517 +$(LOCKFD_BINDING.NODE): FRC
      518 +        cd $(LOCKFD_SRC_DIR) && \
      519 +        LD_OPTIONS=-lc \
      520 +        $(MAKE) \
      521 +                CC=$(GCC) CXX=$(GXX) \
      522 +                PREFIX_NODE=$(PREFIX_NODE) \
      523 +                NODE_EXEC=$(NODE_EXEC) \
      524 +                V8PLUS=$(LOCKFD_V8PLUS_DIR) \
      525 +                CTFCONVERT=$(CTFCONVERT) \
      526 +                CTFMERGE=$(CTFMERGE)
      527 +
      528 +#
 499  529  # The next two are used to build libusdt files into
 500  530  # $(DTRACE_PROVIDER_OBJDIR)/libusdt/*.o, instead of building libusdt.a
 501  531  #
 502  532  $(DTRACE_PROVIDER_OBJDIR)/%.o: $(DTRACE_PROVIDER_SRCDIR)/%.c \
 503  533              $(DTRACE_PROVIDER_HDRS)
 504  534          @mkdir -p $(DTRACE_PROVIDER_OBJDIR)/libusdt
 505  535          $(GCC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
 506  536  
 507  537  $(DTRACE_PROVIDER_OBJDIR)/%.o: $(DTRACE_PROVIDER_SRCDIR)/%.s
 508  538          @mkdir -p $(DTRACE_PROVIDER_OBJDIR)/libusdt
↓ open down ↓ 37 lines elided ↑ open up ↑
 546  576  
 547  577  #
 548  578  # The zutil add-on requires a slightly more complex 2-phase build.
 549  579  #
 550  580  $(ZUTIL_OBJDIR)/%.o: $(ZUTIL_SRCDIR)/%.cc $(ZUTIL_BINDINGS_HDRS)
 551  581          @mkdir -p $(ZUTIL_OBJDIR)
 552  582          $(GXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
 553  583  
 554  584  $(ZUTIL_BINDINGS.NODE): $(ZUTIL_BINDINGS_OBJS)
 555  585          $(GXX) $(LDFLAGS) -o $@ $(ZUTIL_BINDINGS_OBJS) $(LIBS)
      586 +
      587 +FRC:
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX