Status: New
Owner: ----

New issue 2086 by [email protected]: Please allow building using Makefiles and without Framework (iso Xcode) on Darwin
http://code.google.com/p/v8/issues/detail?id=2086

gyp's build generator defaults to xcode on Darwin, but can be overridden to be set to make. However, if that's done, generation fails:

make -j8 V=1 GYP_GENERATORS=make library=shared werror=no soname_version=3.9.24 snapshot=on x64.release
build/gyp/gyp --generator-output="out" build/all.gyp \
              -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 \
-S-x64 -Dcomponent=shared_library -Dv8_can_use_vfp_instructions=true -Dsoname_version=3.9.24 -Dwerror=''
Traceback (most recent call last):
  File "build/gyp/gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "build/gyp/pylib/gyp/__init__.py", line 472, in main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "build/gyp/pylib/gyp/generator/make.py", line 2516, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "build/gyp/pylib/gyp/generator/make.py", line 1242, in Write
    mac_bundle_deps, extra_outputs, part_of_all)
  File "build/gyp/pylib/gyp/generator/make.py", line 1951, in WriteTarget
    install_path, self.output)
AssertionError: $(builddir)/libv8.so.3.9.24 != $(obj).host/tools/gyp/libv8.so.3.9.24
make: *** [out/Makefile-x64] Error 1

I applied some ugly sedding to force gyp into thinking it's building an ordinary library (instead of a Framework) using a darwin flavour:

    sed -i \
        -e '/params\.get.*mac.*darwin.*linux/s/mac/darwin/' \
        -e "/if GetFlavor(params) == 'mac':/s/mac/darwin/" \
        -e "/^  if flavor == 'mac':/s/mac/darwin/" \
-e '/^LINK_COMMANDS_MAC =/,/^SHARED_HEADER =/s#-shared#-dynamiclib -all_load#' \
        build/gyp/pylib/gyp/generator/make.py || die

This allows me to build, which is just a mere proof that it is possible to build without a Framework on Darwin. The changes hackishly 1) introduce a darwin flavour, 2) set amongst other things OS to mac and SHARED_LIB_SUFFIX to .dylib, 3) enable the use of gyp-mac-tool for darwin flavour (but avoid setting up xcode settings), and 4) produce a non-empty v8.dylib (-all_load forces including the unused members from the .a).

The LINK_COMMANDS_MAC should also include a -install_name /path/to/v8.(version).dylib, but I don't know how to obtain the "/path/to" part at that place. The $(@F) bit seems to be expand to ELF-style soname, hence useless for Darwin. This probably requires hacking tools/gyp/v8.gyp when it sets product_extension.


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to