Author: rhuijben Date: Thu Sep 10 14:06:11 2015 New Revision: 1702256 URL: http://svn.apache.org/r1702256 Log: On the 1.3.x branch: Backport r1702221 from trunk to fix the solaris build.
Modified: serf/branches/1.3.x/ (props changed) serf/branches/1.3.x/SConstruct Propchange: serf/branches/1.3.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Sep 10 14:06:11 2015 @@ -1,4 +1,4 @@ /serf/branches/1.3.x:1699925,1699931 /serf/branches/multiple_ssl_impls:1699382 /serf/branches/windows-sspi:1698866-1698877 -/serf/trunk:1699516-1699518,1699520-1699522,1699528,1699530-1699535,1699537,1699539-1699541,1699543,1699548-1699549,1699553,1699555-1699556,1699559-1699560,1699563-1699565,1699567-1699570,1699572-1699573,1699578-1699580,1699582-1699597,1699599-1699602,1699607,1699610,1699615-1699618,1699622-1699623,1699626-1699627,1699633,1699637,1699642,1699645,1699647,1699649-1699650,1699652,1699654-1699655,1699659-1699665,1699671,1699674,1699680-1699683,1699687-1699688,1699690,1699692-1699694,1699698-1699700,1699702,1699707-1699708,1699712-1699716,1699720,1699724,1699728,1699730,1699733,1699762,1699770,1699773,1699777,1699780-1699781,1699798,1699800-1699801,1699817,1699819,1699838,1699843,1699846,1699850,1699858-1699859,1699861,1699873,1699881,1699884,1699902-1699903,1699906,1699924,1699926-1699927,1699930,1699932,1699936-1699937,1699941,1699944,1699948-1699950,1699954,1699957,1699964,1699973,1699975,1700234,1700236 +/serf/trunk:1699516-1699518,1699520-1699522,1699528,1699530-1699535,1699537,1699539-1699541,1699543,1699548-1699549,1699553,1699555-1699556,1699559-1699560,1699563-1699565,1699567-1699570,1699572-1699573,1699578-1699580,1699582-1699597,1699599-1699602,1699607,1699610,1699615-1699618,1699622-1699623,1699626-1699627,1699633,1699637,1699642,1699645,1699647,1699649-1699650,1699652,1699654-1699655,1699659-1699665,1699671,1699674,1699680-1699683,1699687-1699688,1699690,1699692-1699694,1699698-1699700,1699702,1699707-1699708,1699712-1699716,1699720,1699724,1699728,1699730,1699733,1699762,1699770,1699773,1699777,1699780-1699781,1699798,1699800-1699801,1699817,1699819,1699838,1699843,1699846,1699850,1699858-1699859,1699861,1699873,1699881,1699884,1699902-1699903,1699906,1699924,1699926-1699927,1699930,1699932,1699936-1699937,1699941,1699944,1699948-1699950,1699954,1699957,1699964,1699973,1699975,1700234,1700236,1702221 Modified: serf/branches/1.3.x/SConstruct URL: http://svn.apache.org/viewvc/serf/branches/1.3.x/SConstruct?rev=1702256&r1=1702255&r2=1702256&view=diff ============================================================================== --- serf/branches/1.3.x/SConstruct (original) +++ serf/branches/1.3.x/SConstruct Thu Sep 10 14:06:11 2015 @@ -211,7 +211,8 @@ incdir = '$PREFIX/include/serf-$MAJOR' # Unfortunately we can't set the .dylib compatibility_version option separately # from current_version, so don't use the PATCH level to avoid that build and # runtime patch levels have to be identical. -env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0) +if sys.platform != 'sunos5': + env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0) LIBNAME = 'libserf-%d' % (MAJOR,) if sys.platform != 'win32': @@ -227,12 +228,23 @@ if sys.platform == 'darwin': env.Append(LINKFLAGS=['-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,)]) if sys.platform != 'win32': - ### gcc only. figure out appropriate test / better way to check these - ### flags, and check for gcc. - env.Append(CFLAGS=['-std=c89']) + def CheckGnuCC(context): + src = ''' + #ifndef __GNUC__ + oh noes! + #endif + ''' + context.Message('Checking for GNU-compatible C compiler...') + result = context.TryCompile(src, '.c') + context.Result(result) + return result - ### These warnings are not available on Solaris - if sys.platform != 'sunos5': + conf = Configure(env, custom_tests = dict(CheckGnuCC=CheckGnuCC)) + have_gcc = conf.CheckGnuCC() + env = conf.Finish() + + if have_gcc: + env.Append(CFLAGS=['-std=c89']) env.Append(CCFLAGS=['-Wdeclaration-after-statement', '-Wmissing-prototypes', '-Wall']) @@ -249,6 +261,7 @@ if sys.platform != 'win32': if sys.platform == 'sunos5': env.Append(LIBS=['m']) + env.Append(PLATFORM='posix') else: # Warning level 4, no unused argument warnings env.Append(CCFLAGS=['/W4', '/wd4100']) @@ -443,18 +456,22 @@ if sys.platform == 'win32': else: TEST_EXES = [ os.path.join('test', '%s' % (prog)) for prog in TEST_PROGRAMS ] +# Find the (dynamic) library in this directory +tenv.Replace(RPATH=thisdir) +tenv.Prepend(LIBS=[LIBNAMESTATIC, ], + LIBPATH=[thisdir, ]) + check_script = env.File('build/check.py').rstr() test_dir = env.File('test/test_all.c').rfile().get_dir() src_dir = env.File('serf.h').rfile().get_dir() test_app = ("%s %s %s %s") % (sys.executable, check_script, test_dir, 'test') -env.AlwaysBuild(env.Alias('check', TEST_EXES, test_app, - ENV={'PATH' : os.environ['PATH'], - 'srcdir' : src_dir})) -# Find the (dynamic) library in this directory -tenv.Replace(RPATH=thisdir) -tenv.Prepend(LIBS=[LIBNAMESTATIC, ], - LIBPATH=[thisdir, ]) +# Set the library search path for the test programs +test_env = {'PATH' : os.environ['PATH'], + 'srcdir' : src_dir} +if sys.platform != 'win32': + test_env['LD_LIBRARY_PATH'] = ':'.join(tenv.get('LIBPATH', [])) +env.AlwaysBuild(env.Alias('check', TEST_EXES, test_app, ENV=test_env)) testall_files = [ 'test/test_all.c',