1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-08-13 16:53:48 -04:00

update a2lib converter

This commit is contained in:
Berke Viktor 2011-08-15 05:36:54 +02:00
parent 7a09aa74fe
commit dcb4bb2b30
2 changed files with 28 additions and 44 deletions

View File

@ -1,21 +1,14 @@
# script by Mikhail Titov # a2lib script by Mikhail Titov
# http://mail.gnome.org/archives/gtk-list/2011-March/msg00103.html # http://live.gnome.org/GTK%2B/Win32/NativeBuildWithOBS
import os,re,sys,shutil import os,re,sys,shutil
from os.path import join, getsize from os.path import join, getsize
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
os.environ['PATH'] = os.environ['PATH'] + ";C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\amd64;C:\\mozilla-build\\mingw64\\bin" os.environ['PATH'] = os.environ['PATH'] + ";C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\amd64;C:\\mozilla-build\\mingw64\\bin"
#gendef = "C:\\workspace\\glibmm-2.27.99\\MSVC_Net2008\\gendef\\Win32\\Debug\\gendef.exe" root = "c:\\mozilla-build\\build\\xchat-wdk\\dep-x64"
# dll = re.sub(".a", "", lib)
# output = Popen([gendef, d, dll, lib], stdout=PIPE).communicate()[0]
def gen(dll): def gen(dll,lib,d):
name = re.sub("^lib", "", dll) output = Popen(["nm", lib], stdout=PIPE).communicate()[0]
name = re.sub("(?:-\\d).dll", "", name)
# shutil.copyfile(lib, name + ".lib")
print("Working on %s\n" % dll)
output = Popen(["nm", "lib%s.dll.a" % name], stdout=PIPE).communicate()[0]
d = "%s.def" % name
with open(d, "wb") as f: with open(d, "wb") as f:
f.write(b"EXPORTS\n") f.write(b"EXPORTS\n")
for line in output.split(b"\r\n"): for line in output.split(b"\r\n"):
@ -23,16 +16,15 @@ def gen(dll):
line = re.sub(b"^.* T _|^.* I __nm__", b"", line) #|^.* I _ line = re.sub(b"^.* T _|^.* I __nm__", b"", line) #|^.* I _
f.write(line + b"\n") f.write(line + b"\n")
f.write(str.encode("LIBRARY %s\n" % dll)) f.write(str.encode("LIBRARY %s\n" % dll))
p = Popen(["lib", "/machine:x64", "/def:%s" % d]) #, shell = True) p = Popen(["lib", "/MACHINE:X64", "/def:%s" % d]) #, shell = True)
root = "c:\\mozilla-build\\build\\xchat-wdk\\dep-x64"
os.chdir(root + "\\lib") os.chdir(root + "\\lib")
for root, dirs, files in os.walk(root + "\\bin"): for root, dirs, files in os.walk(root + "\\bin"):
for name in files: for f in files:
if (re.search(".dll", name)): if (re.search(".dll", f)):
print("Processing: %s\n" % name) name = re.sub("^lib", "", f)
gen(name) name = re.sub("(?:-\\d).dll", "", name)
print("Working on %s\n" % f)
#gen("libatk-1.0-0.dll") d = "%s.def" % name
# glibmm-2.4.def libglibmm-2.4-1.dll libglibmm-2.4.dll.a lib = "lib%s.dll.a" % name
# dumpbin /SYMBOLS /OUT:dumpbin.out libglibmm-2.4.dll.a gen(f, lib, d)

View File

@ -1,21 +1,14 @@
# script by Mikhail Titov # a2lib script by Mikhail Titov
# http://mail.gnome.org/archives/gtk-list/2011-March/msg00103.html # http://live.gnome.org/GTK%2B/Win32/NativeBuildWithOBS
import os,re,sys,shutil import os,re,sys,shutil
from os.path import join, getsize from os.path import join, getsize
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
os.environ['PATH'] = os.environ['PATH'] + ";C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin;C:\\mozilla-build\\mingw32\\bin" os.environ['PATH'] = os.environ['PATH'] + ";C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin;C:\\mozilla-build\\mingw32\\bin"
#gendef = "C:\\workspace\\glibmm-2.27.99\\MSVC_Net2008\\gendef\\Win32\\Debug\\gendef.exe" root = "c:\\mozilla-build\\build\\xchat-wdk\\dep-x86"
# dll = re.sub(".a", "", lib)
# output = Popen([gendef, d, dll, lib], stdout=PIPE).communicate()[0]
def gen(dll): def gen(dll,lib,d):
name = re.sub("^lib", "", dll) output = Popen(["nm", lib], stdout=PIPE).communicate()[0]
name = re.sub("(?:-\\d).dll", "", name)
# shutil.copyfile(lib, name + ".lib")
print("Working on %s\n" % dll)
output = Popen(["nm", "lib%s.dll.a" % name], stdout=PIPE).communicate()[0]
d = "%s.def" % name
with open(d, "wb") as f: with open(d, "wb") as f:
f.write(b"EXPORTS\n") f.write(b"EXPORTS\n")
for line in output.split(b"\r\n"): for line in output.split(b"\r\n"):
@ -23,16 +16,15 @@ def gen(dll):
line = re.sub(b"^.* T _|^.* I __nm__", b"", line) #|^.* I _ line = re.sub(b"^.* T _|^.* I __nm__", b"", line) #|^.* I _
f.write(line + b"\n") f.write(line + b"\n")
f.write(str.encode("LIBRARY %s\n" % dll)) f.write(str.encode("LIBRARY %s\n" % dll))
p = Popen(["lib", "/machine:x86", "/def:%s" % d]) #, shell = True) p = Popen(["lib", "/MACHINE:X86", "/def:%s" % d]) #, shell = True)
root = "c:\\mozilla-build\\build\\xchat-wdk\\dep-x86"
os.chdir(root + "\\lib") os.chdir(root + "\\lib")
for root, dirs, files in os.walk(root + "\\bin"): for root, dirs, files in os.walk(root + "\\bin"):
for name in files: for f in files:
if (re.search(".dll", name)): if (re.search(".dll", f)):
print("Processing: %s\n" % name) name = re.sub("^lib", "", f)
gen(name) name = re.sub("(?:-\\d).dll", "", name)
print("Working on %s\n" % f)
#gen("libatk-1.0-0.dll") d = "%s.def" % name
# glibmm-2.4.def libglibmm-2.4-1.dll libglibmm-2.4.dll.a lib = "lib%s.dll.a" % name
# dumpbin /SYMBOLS /OUT:dumpbin.out libglibmm-2.4.dll.a gen(f, lib, d)