$NetBSD: patch-SConstruct,v 1.5 2014/02/12 14:35:11 jperkin Exp $ Hack: Use OPENSSL variable as final shared library path; fixes lib id on Darwin. Don't append -O2 compiler flag. --- SConstruct.orig 2013-10-04 15:11:04.000000000 +0000 +++ SConstruct @@ -106,6 +106,7 @@ opts.AddVariables( RawListVariable('CC', "Command name or path of the C compiler", None), RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)", None), + RawListVariable('LDFLAGS', "Extra linker flags from pkgsrc", None), RawListVariable('LIBS', "Extra libraries passed to the linker, " "e.g. \"-l -l\" (space separated)", None), RawListVariable('LINKFLAGS', "Extra flags for the linker (space-separated)", @@ -146,7 +147,7 @@ if sys.platform == 'win32': True), ) -env = Environment(variables=opts, +env = Environment(variables=opts, ENV=os.environ, tools=('default', 'textfile',), CPPPATH=['.', ], ) @@ -240,7 +241,6 @@ if sys.platform != 'win32': env.Append(CCFLAGS='-g') env.Append(CPPDEFINES=['DEBUG', '_DEBUG']) else: - env.Append(CCFLAGS='-O2') env.Append(CPPDEFINES='NDEBUG') ### works for Mac OS. probably needs to change @@ -372,6 +372,11 @@ if sys.platform == 'win32': for d in env['LIBPATH']: env.Append(RPATH=':'+d) +for l in env['LDFLAGS']: + if l.startswith('-l'): + env.Append(LINKFLAGS=" " + l) + env.Append(GSSAPI_LIBS=" " + l) + # Set up the construction of serf-*.pc pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,), env.File('build/serf.pc.in'), @@ -410,7 +415,7 @@ if sys.platform == 'darwin': # make applications depend on the exact major.minor.patch version of serf. install_shared_path = install_shared[0].abspath - target_install_shared_path = os.path.join(libdir, '%s.dylib' % LIBNAME) + target_install_shared_path = os.path.join('$OPENSSL', '%s.dylib' % LIBNAME) env.AddPostAction(install_shared, ('install_name_tool -id %s %s' % (target_install_shared_path, install_shared_path)))