Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure script needs an update #3014

Closed
pikajude opened this issue Sep 23, 2015 · 5 comments
Closed

Configure script needs an update #3014

pikajude opened this issue Sep 23, 2015 · 5 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@pikajude
Copy link

The configure script still prints out these when you pass --help:

    --shared-libuv-includes=SHARED_LIBUV_INCLUDES
                        directory containing libuv header files
    --shared-libuv-libname=SHARED_LIBUV_LIBNAME
                        alternative lib name to link to [default: uv]
    --shared-libuv-libpath=SHARED_LIBUV_LIBPATH
                        a directory to search for the shared libuv DLL

which really confused me when I tried to figure out why clang couldn't find uv.h.

@brendanashworth brendanashworth added build Issues and PRs related to build files or the CI. libuv Issues and PRs related to the libuv dependency or the uv binding. labels Sep 23, 2015
@saghul
Copy link
Member

saghul commented Sep 23, 2015

AFAIK Node still supports building against a shared libuv (Debian does this). What is the problem with those options?

@pikajude
Copy link
Author

@saghul node 0.12's configure script uses this:

def configure_libuv(o):
  o['variables']['node_shared_libuv'] = b(options.shared_libuv)

  # assume shared libuv if one of these is set?
  if options.shared_libuv_libpath:
    o['libraries'] += ['-L%s' % options.shared_libuv_libpath]
  else:
    o['variables']['uv_library'] = 'static_library'

  if options.shared_libuv_libname:
    o['libraries'] += ['-l%s' % options.shared_libuv_libname]
  elif options.shared_libuv:
    o['libraries'] += ['-luv']
  if options.shared_libuv_includes:
    o['include_dirs'] += [options.shared_libuv_includes]

whereas node 4.1.0's uses the more general configure_library:

def configure_library(lib, output):
  shared_lib = 'shared_' + lib
  output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib))

  if getattr(options, shared_lib):
    (pkg_libs, pkg_cflags, pkg_libpath) = pkg_config(lib)

    if pkg_cflags:
      output['include_dirs'] += (
          filter(None, map(str.strip, pkg_cflags.split('-I'))))

    # libpath needs to be provided ahead libraries
    if pkg_libpath:
      output['libraries'] += (
          filter(None, map(str.strip, pkg_libpath.split('-L'))))

    default_libs = getattr(options, shared_lib + '_libname')
    default_libs = map('-l{0}'.format, default_libs.split(','))

    if pkg_libs:
      output['libraries'] += pkg_libs.split()
    elif default_libs:
      output['libraries'] += default_libs

which calls out to pkg-config without heeding the libname, includes, or libpath options.

I suspected this was a bug in the configure script when I realized that options.shared_libuv_includes is defined here but never actually read from.

@brendanashworth FYI this bug is not (as far as I can tell) libuv-specific because it applies to all shared dependencies.

@brendanashworth brendanashworth removed the libuv Issues and PRs related to the libuv dependency or the uv binding. label Sep 24, 2015
@bnoordhuis
Copy link
Member

#3135 is one PR that addresses this, there may be more.

@evanlucas
Copy link
Contributor

@bnoordhuis was this fixed in #3135 or do more changes need to be made?

@bnoordhuis
Copy link
Member

Yes, #3135 should have fixed it. I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

5 participants