diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-01-10 16:17:07 -0500 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-01-14 16:14:38 -0500 |
commit | 7cb2e9607aa593bc619fc8e194920144863d0061 (patch) | |
tree | 3cb4d1f309247fd6ca8af6930e4cc4d3f6056fd5 /buildscripts | |
parent | 89126c21f0eb3b9b1674ee64d0f75d91a841084e (diff) | |
download | mongo-7cb2e9607aa593bc619fc8e194920144863d0061.tar.gz |
SERVER-3364: The C++ Driver compiled as shared library must export the API
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/generate_def.py | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/buildscripts/generate_def.py b/buildscripts/generate_def.py deleted file mode 100644 index c8fdf828895..00000000000 --- a/buildscripts/generate_def.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/python - -# Copyright 2013 10gen Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -"""Generate a def file exposing all public symbols from .lib library files - -Usage: - python generate_def.py <def file> <library files> -""" - -import re -import string -import subprocess -import sys - -# These symbols appear in the 32-bit linkermember section 1, but -# we don't want to export them. -blacklist = ( "_MemoryBarrier", - "_md5_append", - "_md5_finish", - "_md5_init", - "_wmemcpy", - "_wmemmove" ) - -def main(argv): - defFilename = argv[1] - allLibFilenames = argv[2:] - defFile = open(defFilename, 'w') - defFile.write("LIBRARY " + re.search(r"\\([a-zA-Z0-9_]+).def", defFilename).group(1) + "\n") - defFile.write("EXPORTS\n") - for libFilename in allLibFilenames: - # Only use symbols from linkermember 1; ignore 2 and 3 - dumpBin = subprocess.Popen(["DUMPBIN", "/LINKERMEMBER:1", libFilename], - stdout=subprocess.PIPE) - # advance to the symbol section - seenPublicSymbols = False - for line in dumpBin.stdout: - if seenPublicSymbols == False: - if "public symbols" not in line: - continue - else: - seenPublicSymbols = True - continue - if line.startswith("Archive member name"): - # New linkermember section; skip ahead to the symbol section - seenPublicSymbols = False - continue - # the symbol section ends at this label - if line.startswith(" Summary"): - break - # filter out some symbols we don't want - symbol starts at column 10 - if (line.startswith(blacklist, 10)): - continue - - # leave off the symbol address in the first 10 characters - defFile.write(line[10:]) - - dumpBin.wait() - defFile.close() - -if __name__ == '__main__': - main(sys.argv) |