logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

serf-1.3.8-static-lib.patch (1922B)


  1. respect the active archiver tool instead of using `ar` all the time.
  2. same for `ranlib`.
  3. also add support for BUILD_STATIC bool for controlling the libserf.a.
  4. --- a/SConstruct
  5. +++ b/SConstruct
  6. @@ -103,6 +103,9 @@
  7. BoolVariable('APR_STATIC',
  8. "Enable using a static compiled APR",
  9. False),
  10. + RawListVariable('AR', "Command name or path of the archiver", None),
  11. + RawListVariable('RANLIB', "Command name or path of the archiver indexer", None),
  12. + BoolVariable('BUILD_STATIC', 'Build libserf static library', True),
  13. RawListVariable('CC', "Command name or path of the C compiler", None),
  14. RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)",
  15. None),
  16. @@ -193,6 +196,7 @@ if gssapi and os.path.isdir(gssapi):
  17. debug = env.get('DEBUG', None)
  18. aprstatic = env.get('APR_STATIC', None)
  19. +build_static = env.get('BUILD_STATIC', True)
  20. Help(opts.GenerateHelpText(env))
  21. opts.Save(SAVED_CONFIG, env)
  22. @@ -384,7 +388,9 @@ pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,),
  23. env.get('GSSAPI_LIBS', '')),
  24. })
  25. -env.Default(lib_static, lib_shared, pkgconfig)
  26. +env.Default(lib_shared, pkgconfig)
  27. +if build_static:
  28. + env.Default(lib_static)
  29. if CALLOUT_OKAY:
  30. conf = Configure(env)
  31. @@ -420,8 +420,10 @@ if sys.platform == 'darwin':
  32. % (target_install_shared_path,
  33. install_shared_path)))
  34. -env.Alias('install-lib', [install_static, install_shared,
  35. - ])
  36. +install_libs = [install_shared]
  37. +if build_static:
  38. + install_libs.append(install_static)
  39. +env.Alias('install-lib', install_libs)
  40. env.Alias('install-inc', env.Install(incdir, HEADER_FILES))
  41. env.Alias('install-pc', env.Install(os.path.join(libdir, 'pkgconfig'),
  42. pkgconfig))