force some flags always on in linkflags
Liang Guo
13 years ago
0 | When LDFLAGS, CXXFLAGS and others is defined in system environment, the value defined | |
1 | in system environment should be appended to env, rather than replace. | |
0 | From: Mike <mikeandmore@gmail.com> | |
1 | Description: force some flags always on in linkflags | |
2 | ||
3 | * SConstruct: force some flags always on in linkflags | |
4 | ||
5 | Origin: upstream | |
6 | ||
2 | 7 | --- a/SConstruct |
3 | 8 | +++ b/SConstruct |
4 | @@ -158,7 +158,7 @@ | |
5 | for (x, y) in envvar: | |
6 | if x in os.environ: | |
7 | print 'Warning: you\'ve set %s in the environmental variable!' % x | |
8 | - env[y] = os.environ[x] | |
9 | + env[y] += os.environ[x] | |
10 | ||
11 | env = CreateEnvironment() | |
12 | opts.Update(env) | |
9 | @@ -180,12 +180,6 @@ | |
10 | libdatadir = env['LIBDATADIR'] + '/sunpinyin/data' | |
11 | headersdir = env['PREFIX'] + '/include/sunpinyin-2.0' | |
12 | ||
13 | -if GetOS() != 'Darwin': | |
14 | - env.Append(LINKFLAGS=['-Wl,-soname=libsunpinyin.so.%d' % abi_major]) | |
15 | - | |
16 | -if GetOption('rpath') is not None and GetOS() != 'Darwin': | |
17 | - env.Append(LINKFLAGS='-Wl,-R -Wl,%s' % GetOption('rpath')) | |
18 | - | |
19 | # pass through environmental variables | |
20 | envvar = [('CC', 'CC'), | |
21 | ('CXX', 'CXX'), | |
22 | @@ -202,6 +196,12 @@ | |
23 | env.Append(CFLAGS=extra_cflags) | |
24 | env.Append(CXXFLAGS=extra_cflags) | |
25 | ||
26 | +if GetOS() != 'Darwin': | |
27 | + env.Append(LINKFLAGS=['-Wl,-soname=libsunpinyin.so.%d' % abi_major]) | |
28 | + | |
29 | +if GetOption('rpath') is not None and GetOS() != 'Darwin': | |
30 | + env.Append(LINKFLAGS=['-Wl,-R', '-Wl,%s' % GetOption('rpath')]) | |
31 | + | |
32 | # | |
33 | #==============================configure================================ | |
34 | # |