Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 677398 | Differences between
and this patch

Collapse All | Expand All

(-)pypy3.5-v7.0.0-src.orig/lib_pypy/_sysconfigdata.py (+1 lines)
Lines 15-20 Link Here
15
    'CFLAGS': "-DNDEBUG -O2",
15
    'CFLAGS': "-DNDEBUG -O2",
16
    'CCSHARED': "-fPIC",
16
    'CCSHARED': "-fPIC",
17
    'LDSHARED': "cc -pthread -shared",
17
    'LDSHARED': "cc -pthread -shared",
18
    'LDCXXSHARED': "c++ -pthread -shared",
18
    'EXT_SUFFIX': so_ext,
19
    'EXT_SUFFIX': so_ext,
19
    'SHLIB_SUFFIX': ".so",
20
    'SHLIB_SUFFIX': ".so",
20
    'AR': "ar",
21
    'AR': "ar",
(-)pypy3.5-v7.0.0-src.orig/lib-python/3/distutils/cygwinccompiler.py (-3 / +18 lines)
Lines 125-132 Link Here
125
        # dllwrap 2.10.90 is buggy
125
        # dllwrap 2.10.90 is buggy
126
        if self.ld_version >= "2.10.90":
126
        if self.ld_version >= "2.10.90":
127
            self.linker_dll = "gcc"
127
            self.linker_dll = "gcc"
128
            self.linker_dll_cxx = "g++"
128
        else:
129
        else:
129
            self.linker_dll = "dllwrap"
130
            self.linker_dll = "dllwrap"
131
            self.linker_dll_cxx = "dllwrap"
130
132
131
        # ld_version >= "2.13" support -shared so use it instead of
133
        # ld_version >= "2.13" support -shared so use it instead of
132
        # -mdll -static
134
        # -mdll -static
Lines 140-148 Link Here
140
        self.set_executables(compiler='gcc -mcygwin -O -Wall',
142
        self.set_executables(compiler='gcc -mcygwin -O -Wall',
141
                             compiler_so='gcc -mcygwin -mdll -O -Wall',
143
                             compiler_so='gcc -mcygwin -mdll -O -Wall',
142
                             compiler_cxx='g++ -mcygwin -O -Wall',
144
                             compiler_cxx='g++ -mcygwin -O -Wall',
145
                             compiler_so_cxx='g++ -mcygwin -mdll -O -Wall',
143
                             linker_exe='gcc -mcygwin',
146
                             linker_exe='gcc -mcygwin',
144
                             linker_so=('%s -mcygwin %s' %
147
                             linker_so=('%s -mcygwin %s' %
145
                                        (self.linker_dll, shared_option)))
148
                                        (self.linker_dll, shared_option)),
149
                             linker_exe_cxx='g++ -mcygwin',
150
                             linker_so_cxx=('%s -mcygwin %s' %
151
                                            (self.linker_dll_cxx, shared_option)))
146
152
147
        # cygwin and mingw32 need different sets of libraries
153
        # cygwin and mingw32 need different sets of libraries
148
        if self.gcc_version == "2.91.57":
154
        if self.gcc_version == "2.91.57":
Lines 166-173 Link Here
166
                raise CompileError(msg)
172
                raise CompileError(msg)
167
        else: # for other files use the C-compiler
173
        else: # for other files use the C-compiler
168
            try:
174
            try:
169
                self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
175
                if self.detect_language(src) == 'c++':
170
                           extra_postargs)
176
                    self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
177
                               extra_postargs)
178
                else:
179
                    self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
180
                               extra_postargs)
171
            except DistutilsExecError as msg:
181
            except DistutilsExecError as msg:
172
                raise CompileError(msg)
182
                raise CompileError(msg)
173
183
Lines 302-310 Link Here
302
        self.set_executables(compiler='gcc -O -Wall',
312
        self.set_executables(compiler='gcc -O -Wall',
303
                             compiler_so='gcc -mdll -O -Wall',
313
                             compiler_so='gcc -mdll -O -Wall',
304
                             compiler_cxx='g++ -O -Wall',
314
                             compiler_cxx='g++ -O -Wall',
315
                             compiler_so_cxx='g++ -mdll -O -Wall',
305
                             linker_exe='gcc',
316
                             linker_exe='gcc',
306
                             linker_so='%s %s %s'
317
                             linker_so='%s %s %s'
307
                                        % (self.linker_dll, shared_option,
318
                                        % (self.linker_dll, shared_option,
319
                                           entry_point),
320
                             linker_exe_cxx='g++',
321
                             linker_so_cxx='%s %s %s'
322
                                        % (self.linker_dll_cxx, shared_option,
308
                                           entry_point))
323
                                           entry_point))
309
        # Maybe we should also append -mthreads, but then the finished
324
        # Maybe we should also append -mthreads, but then the finished
310
        # dlls need another dll (mingwm10.dll see Mingw32 docs)
325
        # dlls need another dll (mingwm10.dll see Mingw32 docs)
(-)pypy3.5-v7.0.0-src.orig/lib-python/3/distutils/sysconfig_cpython.py (-5 / +20 lines)
Lines 173-181 Link Here
173
                _osx_support.customize_compiler(_config_vars)
173
                _osx_support.customize_compiler(_config_vars)
174
                _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
174
                _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
175
175
176
        (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
176
        (cc, cxx, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \
177
            get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
177
            get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
178
                            'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
178
                            'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
179
180
        cflags = ''
181
        cxxflags = ''
179
182
180
        if 'CC' in os.environ:
183
        if 'CC' in os.environ:
181
            newcc = os.environ['CC']
184
            newcc = os.environ['CC']
Lines 190-208 Link Here
190
            cxx = os.environ['CXX']
193
            cxx = os.environ['CXX']
191
        if 'LDSHARED' in os.environ:
194
        if 'LDSHARED' in os.environ:
192
            ldshared = os.environ['LDSHARED']
195
            ldshared = os.environ['LDSHARED']
196
        if 'LDCXXSHARED' in os.environ:
197
            ldcxxshared = os.environ['LDCXXSHARED']
193
        if 'CPP' in os.environ:
198
        if 'CPP' in os.environ:
194
            cpp = os.environ['CPP']
199
            cpp = os.environ['CPP']
195
        else:
200
        else:
196
            cpp = cc + " -E"           # not always
201
            cpp = cc + " -E"           # not always
197
        if 'LDFLAGS' in os.environ:
202
        if 'LDFLAGS' in os.environ:
198
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
203
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
204
            ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
199
        if 'CFLAGS' in os.environ:
205
        if 'CFLAGS' in os.environ:
200
            cflags = opt + ' ' + os.environ['CFLAGS']
206
            cflags = os.environ['CFLAGS']
201
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
207
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
208
        if 'CXXFLAGS' in os.environ:
209
            cxxflags = os.environ['CXXFLAGS']
210
            ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
202
        if 'CPPFLAGS' in os.environ:
211
        if 'CPPFLAGS' in os.environ:
203
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
212
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
204
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
213
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
214
            cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
205
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
215
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
216
            ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
206
        if 'AR' in os.environ:
217
        if 'AR' in os.environ:
207
            ar = os.environ['AR']
218
            ar = os.environ['AR']
208
        if 'ARFLAGS' in os.environ:
219
        if 'ARFLAGS' in os.environ:
Lines 211-223 Link Here
211
            archiver = ar + ' ' + ar_flags
222
            archiver = ar + ' ' + ar_flags
212
223
213
        cc_cmd = cc + ' ' + cflags
224
        cc_cmd = cc + ' ' + cflags
225
        cxx_cmd = cxx + ' ' + cxxflags
214
        compiler.set_executables(
226
        compiler.set_executables(
215
            preprocessor=cpp,
227
            preprocessor=cpp,
216
            compiler=cc_cmd,
228
            compiler=cc_cmd,
217
            compiler_so=cc_cmd + ' ' + ccshared,
229
            compiler_so=cc_cmd + ' ' + ccshared,
218
            compiler_cxx=cxx,
230
            compiler_cxx=cxx_cmd,
231
            compiler_so_cxx=cxx_cmd + ' ' + ccshared,
219
            linker_so=ldshared,
232
            linker_so=ldshared,
220
            linker_exe=cc,
233
            linker_exe=cc,
234
            linker_so_cxx=ldcxxshared,
235
            linker_exe_cxx=cxx,
221
            archiver=archiver)
236
            archiver=archiver)
222
237
223
        compiler.shared_lib_extension = shlib_suffix
238
        compiler.shared_lib_extension = shlib_suffix
(-)pypy3.5-v7.0.0-src.orig/lib-python/3/distutils/sysconfig_pypy.py (-7 / +27 lines)
Lines 145-180 Link Here
145
                _osx_support.customize_compiler(_config_vars)
145
                _osx_support.customize_compiler(_config_vars)
146
                _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
146
                _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
147
147
148
        (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
148
        (cc, cxx, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \
149
            get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
149
            get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED',
150
                            'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
150
                            'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
151
152
        cflags = ''
153
        cxxflags = ''
151
154
152
        if 'CC' in os.environ:
155
        if 'CC' in os.environ:
153
            newcc = os.environ['CC']
156
            newcc = os.environ['CC']
154
            if (sys.platform == 'darwin'
157
            if (True
155
                    and 'LDSHARED' not in os.environ
158
                    and 'LDSHARED' not in os.environ
156
                    and ldshared.startswith(cc)):
159
                    and ldshared.startswith(cc)):
157
                # On OS X, if CC is overridden, use that as the default
160
                # On OS X, if CC is overridden, use that as the default
158
                #       command for LDSHARED as well
161
                #       command for LDSHARED as well
162
                # Gentoo: s/OS X/every system/
159
                ldshared = newcc + ldshared[len(cc):]
163
                ldshared = newcc + ldshared[len(cc):]
160
            cc = newcc
164
            cc = newcc
161
        if 'CXX' in os.environ:
165
        if 'CXX' in os.environ:
162
            cxx = os.environ['CXX']
166
            newcxx = os.environ['CXX']
167
            if ('LDCXXSHARED' not in os.environ
168
                    and ldcxxshared.startswith(cxx)):
169
                ldcxxshared = newcxx + ldcxxshared[len(cxx):]
170
            cxx = newcxx
163
        if 'LDSHARED' in os.environ:
171
        if 'LDSHARED' in os.environ:
164
            ldshared = os.environ['LDSHARED']
172
            ldshared = os.environ['LDSHARED']
173
        if 'LDCXXSHARED' in os.environ:
174
            ldcxxshared = os.environ['LDCXXSHARED']
165
        if 'CPP' in os.environ:
175
        if 'CPP' in os.environ:
166
            cpp = os.environ['CPP']
176
            cpp = os.environ['CPP']
167
        else:
177
        else:
168
            cpp = cc + " -E"           # not always
178
            cpp = cc + " -E"           # not always
169
        if 'LDFLAGS' in os.environ:
179
        if 'LDFLAGS' in os.environ:
170
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
180
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
181
            ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
171
        if 'CFLAGS' in os.environ:
182
        if 'CFLAGS' in os.environ:
172
            cflags = opt + ' ' + os.environ['CFLAGS']
183
            cflags = os.environ['CFLAGS']
173
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
184
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
185
        if 'CXXFLAGS' in os.environ:
186
            cxxflags = os.environ['CXXFLAGS']
187
            ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
174
        if 'CPPFLAGS' in os.environ:
188
        if 'CPPFLAGS' in os.environ:
175
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
189
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
176
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
190
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
191
            cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
177
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
192
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
193
            ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
178
        if 'AR' in os.environ:
194
        if 'AR' in os.environ:
179
            ar = os.environ['AR']
195
            ar = os.environ['AR']
180
        if 'ARFLAGS' in os.environ:
196
        if 'ARFLAGS' in os.environ:
Lines 183-195 Link Here
183
            archiver = ar + ' ' + ar_flags
199
            archiver = ar + ' ' + ar_flags
184
200
185
        cc_cmd = cc + ' ' + cflags
201
        cc_cmd = cc + ' ' + cflags
202
        cxx_cmd = cxx + ' ' + cxxflags
186
        compiler.set_executables(
203
        compiler.set_executables(
187
            preprocessor=cpp,
204
            preprocessor=cpp,
188
            compiler=cc_cmd,
205
            compiler=cc_cmd,
189
            compiler_so=cc_cmd + ' ' + ccshared,
206
            compiler_so=cc_cmd + ' ' + ccshared,
190
            compiler_cxx=cxx,
207
            compiler_cxx=cxx_cmd,
208
            compiler_so_cxx=cxx_cmd + ' ' + ccshared,
191
            linker_so=ldshared,
209
            linker_so=ldshared,
192
            linker_exe=cc,
210
            linker_exe=cc,
211
            linker_so_cxx=ldcxxshared,
212
            linker_exe_cxx=cxx,
193
            archiver=archiver)
213
            archiver=archiver)
194
214
195
        compiler.shared_lib_extension = shlib_suffix
215
        compiler.shared_lib_extension = shlib_suffix
(-)pypy3.5-v7.0.0-src.orig/lib-python/3/distutils/unixccompiler.py (-25 / +29 lines)
Lines 52-65 Link Here
52
    # are pretty generic; they will probably have to be set by an outsider
52
    # are pretty generic; they will probably have to be set by an outsider
53
    # (eg. using information discovered by the sysconfig about building
53
    # (eg. using information discovered by the sysconfig about building
54
    # Python extensions).
54
    # Python extensions).
55
    executables = {'preprocessor' : None,
55
    executables = {'preprocessor'    : None,
56
                   'compiler'     : ["cc"],
56
                   'compiler'        : ["cc"],
57
                   'compiler_so'  : ["cc"],
57
                   'compiler_so'     : ["cc"],
58
                   'compiler_cxx' : ["c++"],  # pypy: changed, 'cc' is bogus
58
                   'compiler_cxx'    : ["c++"],
59
                   'linker_so'    : ["cc", "-shared"],
59
                   'compiler_so_cxx' : ["c++"],
60
                   'linker_exe'   : ["cc"],
60
                   'linker_so'       : ["cc", "-shared"],
61
                   'archiver'     : ["ar", "-cr"],
61
                   'linker_exe'      : ["cc"],
62
                   'ranlib'       : None,
62
                   'linker_so_cxx'   : ["c++", "-shared"],
63
                   'linker_exe_cxx'  : ["c++"],
64
                   'archiver'        : ["ar", "-cr"],
65
                   'ranlib'          : None,
63
                  }
66
                  }
64
67
65
    if sys.platform[:6] == "darwin":
68
    if sys.platform[:6] == "darwin":
Lines 125-136 Link Here
125
128
126
    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
129
    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
127
        compiler_so = self.compiler_so
130
        compiler_so = self.compiler_so
131
        compiler_so_cxx = self.compiler_so_cxx
128
        if sys.platform == 'darwin':
132
        if sys.platform == 'darwin':
129
            compiler_so = _osx_support.compiler_fixup(compiler_so,
133
            compiler_so = _osx_support.compiler_fixup(compiler_so,
130
                                                    cc_args + extra_postargs)
134
                                                    cc_args + extra_postargs)
135
            compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx,
136
                                                    cc_args + extra_postargs)
131
        try:
137
        try:
132
            self.spawn(compiler_so + cc_args + [src, '-o', obj] +
138
            if self.detect_language(src) == 'c++':
133
                       extra_postargs)
139
                self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] +
140
                           extra_postargs)
141
            else:
142
                self.spawn(compiler_so + cc_args + [src, '-o', obj] +
143
                           extra_postargs)
134
        except DistutilsExecError as msg:
144
        except DistutilsExecError as msg:
135
            raise CompileError(msg)
145
            raise CompileError(msg)
136
146
Lines 188-209 Link Here
188
                ld_args.extend(extra_postargs)
198
                ld_args.extend(extra_postargs)
189
            self.mkpath(os.path.dirname(output_filename))
199
            self.mkpath(os.path.dirname(output_filename))
190
            try:
200
            try:
191
                if target_desc == CCompiler.EXECUTABLE:
201
                if target_lang == "c++":
192
                    linker = self.linker_exe[:]
202
                    if target_desc == CCompiler.EXECUTABLE:
203
                        linker = self.linker_exe_cxx[:]
204
                    else:
205
                        linker = self.linker_so_cxx[:]
193
                else:
206
                else:
194
                    linker = self.linker_so[:]
207
                    if target_desc == CCompiler.EXECUTABLE:
195
                if target_lang == "c++" and self.compiler_cxx:
208
                        linker = self.linker_exe[:]
196
                    # skip over environment variable settings if /usr/bin/env
209
                    else:
197
                    # is used to set up the linker's environment.
210
                        linker = self.linker_so[:]
198
                    # This is needed on OSX. Note: this assumes that the
199
                    # normal and C++ compiler have the same environment
200
                    # settings.
201
                    i = 0
202
                    if os.path.basename(linker[0]) == "env":
203
                        i = 1
204
                        while '=' in linker[i]:
205
                            i += 1
206
                    linker[i] = self.compiler_cxx[i]
207
211
208
                if sys.platform == 'darwin':
212
                if sys.platform == 'darwin':
209
                    linker = _osx_support.compiler_fixup(linker, ld_args)
213
                    linker = _osx_support.compiler_fixup(linker, ld_args)
(-)pypy3.5-v7.0.0-src.orig/lib-python/3/_osx_support.py (-5 / +5 lines)
Lines 14-26 Link Here
14
# configuration variables that may contain universal build flags,
14
# configuration variables that may contain universal build flags,
15
# like "-arch" or "-isdkroot", that may need customization for
15
# like "-arch" or "-isdkroot", that may need customization for
16
# the user environment
16
# the user environment
17
_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
17
_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
18
                            'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
18
                          'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
19
                            'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
19
                          'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
20
                            'PY_CORE_CFLAGS')
20
                          'PY_CPPFLAGS', 'PY_CORE_CFLAGS')
21
21
22
# configuration variables that may contain compiler calls
22
# configuration variables that may contain compiler calls
23
_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
23
_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
24
24
25
# prefix added to original configuration variable names
25
# prefix added to original configuration variable names
26
_INITPRE = '_OSX_SUPPORT_INITIAL_'
26
_INITPRE = '_OSX_SUPPORT_INITIAL_'

Return to bug 677398