~james-page/ubuntu/oneiric/jcc/fix-library-linking

« back to all changes in this revision

Viewing changes to helpers/mingw32.py

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon
  • Date: 2010-07-18 11:16:04 UTC
  • mfrom: (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100718111604-jccjt78g2cusy7h9
Tags: 2.6-1
* New upstream release.
* Fix typo in README.Debian.
* Refresh avoid-ftbfs-unknown-archs.patch.
* Update Standards-Version to 3.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#   Licensed under the Apache License, Version 2.0 (the "License");
 
2
#   you may not use this file except in compliance with the License.
 
3
#   You may obtain a copy of the License at
 
4
#
 
5
#       http://www.apache.org/licenses/LICENSE-2.0
 
6
#
 
7
#   Unless required by applicable law or agreed to in writing, software
 
8
#   distributed under the License is distributed on an "AS IS" BASIS,
 
9
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
10
#   See the License for the specific language governing permissions and
 
11
#   limitations under the License.
 
12
 
 
13
import os, copy
 
14
from distutils.cygwinccompiler import Mingw32CCompiler
 
15
 
 
16
class JCCMinGW32CCompiler(Mingw32CCompiler):
 
17
 
 
18
    def link(self, target_desc, objects, output_filename, output_dir=None,
 
19
             libraries=None, library_dirs=None, runtime_library_dirs=None,
 
20
             export_symbols=None, debug=0, extra_preargs=None,
 
21
             extra_postargs=None, build_temp=None, target_lang=None): 
 
22
 
 
23
        # use separate copies, so we can modify the lists
 
24
        extra_preargs = copy.copy(extra_preargs or [])
 
25
 
 
26
        (dll_name, dll_extension) = os.path.splitext(output_filename)
 
27
        if dll_extension.lower() == ".dll":
 
28
            extra_preargs.extend(["-Wl,--out-implib,%s" %(os.path.join(os.path.dirname(dll_name), "jcc", "jcc.lib"))])
 
29
 
 
30
        Mingw32CCompiler.link(self, target_desc=target_desc,
 
31
                              objects=objects,
 
32
                              output_filename=output_filename, 
 
33
                              output_dir=output_dir, libraries=libraries,
 
34
                              library_dirs=library_dirs,
 
35
                              runtime_library_dirs=runtime_library_dirs,
 
36
                              export_symbols=export_symbols, debug=debug,
 
37
                              extra_preargs=extra_preargs,
 
38
                              extra_postargs=extra_postargs, 
 
39
                              build_temp=build_temp,
 
40
                              target_lang=target_lang)