-
Notifications
You must be signed in to change notification settings - Fork 5
/
msys_link_VC_2008_dlls.py
2226 lines (2103 loc) · 38.6 KB
/
msys_link_VC_2008_dlls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
# -*- coding: ascii -*-
# Program msys_link_VC_2008_dlls.py
# Requires Python 2.4 or later and win32api.
"""Link dependency DLLs against the Visual C 2008 run-time using MinGW and MSYS
Configured for Pygame 1.8 and Python 2.6 and up.
By default the DLLs and export libraries are installed in directory ./lib_VC_2008.
msys_build_deps.py must run first to build the static libaries.
This program can be run from a Windows cmd.exe or MSYS terminal.
The recognized, and optional, environment variables are:
SHELL - MSYS shell program path - already defined in the MSYS terminal
LDFLAGS - linker options - prepended to flags set by the program
LIBRARY_PATH - library directory paths - appended to those used by this
program
To get a list of command line options run
python build_deps.py --help
This program has been tested against the following libraries:
SDL 1.2.14
SDL_image 1.2.10
SDL_mixer 1.2.11
SDL_ttf 2.0.9
#disabled for now since crashes (smpeg revision 389 from SVN)
freetype 2.3.12
libogg 1.2.0
libvorbis 1.3.1
FLAC 1.2.1
tiff 3.9.4
libpng 1.4.3
jpeg 8b
zlib 1.2.5
PortMidi revision 201 from SVN (patched)
The build environment used:
gcc-core-4.5.0-1-mingw32
gcc-c++-4.5.0-1-mingw32
binutils-2.20.1-2-mingw32
mingwrt-3.18-mingw32
pexports 0.44
MSYS 1.0.13
Builds have been performed on Windows XP.
Build issues:
For pre-2007 computers: MSYS bug "[ 1170716 ] executing a shell scripts
gives a memory leak" (http://sourceforge.net/tracker/
index.php?func=detail&aid=1170716&group_id=2435&atid=102435)
It may not be possible to use the --all option to build all Pygame
dependencies in one session. Instead the job may need to be split into two
or more sessions, with a reboot of the operatingsystem between each. Use
the --help-args option to list the libraries in the their proper build
order.
"""
import msys
from optparse import OptionParser, Option, OptionValueError
import os
import sys
import time
import re
import copy
# For Python 2.x/3.x compatibility
def geterror():
return sys.exc_info()[1]
DEFAULT_DEST_DIR_NAME = 'lib_VC_2008'
default_source_mp = '/usr/local'
def print_(*args, **kwds):
msys.msys_print(*args, **kwds)
def merge_strings(*args, **kwds):
"""Returns non empty string joined by sep
The default separator is an empty string.
"""
sep = kwds.get('sep', '')
return sep.join([s for s in args if s])
class BuildError(Exception):
"""Raised for missing source paths and failed script runs"""
pass
class Dependency(object):
"""Builds a library"""
def __init__(self, name, dlls, shell_script):
self.name = name
self.dlls = dlls
self.shell_script = shell_script
def build(self, msys):
return_code = msys.run_shell_script(self.shell_script)
if return_code != 0:
raise BuildError("The build for %s failed with code %d" %
(self.name, return_code))
class Preparation(object):
"""Perform necessary build environment preperations"""
def __init__(self, name, shell_script):
self.name = name
self.path = ''
self.paths = []
self.dlls = []
self.shell_script = shell_script
def build(self, msys):
return_code = msys.run_shell_script(self.shell_script)
if return_code != 0:
raise BuildError("Preparation '%s' failed with code %d" %
(self.name, return_code))
def build(dependencies, msys):
"""Execute that shell scripts for all dependencies"""
for dep in dependencies:
dep.build(msys)
def check_directory_path(option, opt, value):
# Remove those double quotes that Windows won't.
if re.match(r'([A-Za-z]:){0,1}[^"<>:|?*]+$', value) is None:
raise OptionValueError("option %s: invalid path" % value)
return value
class MyOption(Option):
TYPES = Option.TYPES + ("dir",)
TYPE_CHECKER = copy.copy(Option.TYPE_CHECKER)
TYPE_CHECKER["dir"] = check_directory_path
def command_line():
"""Process the command line and return the options"""
usage = ("usage: %prog [options] --all\n"
" %prog [options] [args]\n"
"\n"
"Build the Pygame dependencies. The args, if given, are\n"
"libraries to include or exclude.\n"
"\n"
"At startup this program may prompt for missing information.\n"
"Be aware of this before redirecting output or leaving the\n"
"program unattended. Once the 'Starting build' message appears\n"
"no more user input is required. The build process will"
"abort on the first error, as library build order is important.\n"
"\n"
"See --include and --help-args.\n"
"\n"
"For more details see the program's document string\n")
parser = OptionParser(usage, option_class=MyOption)
parser.add_option('-a', '--all', action='store_true', dest='build_all',
help="Include all libraries in the build")
parser.set_defaults(build_all=False)
parser.add_option('--console', action='store_true', dest='console',
help="Link with the console subsystem:"
" defaults to Win32 GUI")
parser.set_defaults(console=False)
parser.add_option('--no-strip', action='store_false', dest='strip',
help="Do not strip the library")
parser.set_defaults(strip=True)
parser.add_option('-e', '--exclude', action='store_true', dest='exclude',
help="Exclude the specified libraries")
parser.set_defaults(exclude=False)
parser.add_option('-d', '--destination-dir', type='dir',
dest='destination_dir',
help="Where the DLLs and export libraries will go",
metavar='PATH')
parser.set_defaults(destination_dir=DEFAULT_DEST_DIR_NAME)
parser.add_option('-m', '--msys-root', action='store', type='dir',
dest='msys_directory',
help="MSYS directory path, which may include"
" the 1.x subdirectory")
parser.add_option('-s', '--source', action='store',
dest='source_directory',
help="Directory where the DLLs and headers are installed:\n"
"(defaults to MSYS %s)"
% (default_source_mp,))
parser.set_defaults(source_directory='')
parser.add_option('--help-args', action='store_true', dest='arg_help',
help="Show a list of recognised libraries,"
" in build order, and exit")
parser.set_defaults(arg_help=False)
return parser.parse_args()
def set_environment_variables(msys, options):
"""Set the environment variables used by the scripts"""
environ = msys.environ
msys_root_wp = msys.msys_root
destination_dir_wp = os.path.abspath(options.destination_dir)
environ['BDWD'] = msys.windows_to_msys(destination_dir_wp)
source_mp = default_source_mp
if options.source_directory:
source_mp = msys.windows_to_msys(options.source_directory)
environ['BDBIN'] = source_mp + '/bin'
environ['BDLIB'] = source_mp + '/lib'
strip = ''
if options.strip:
strip = '-Wl,--strip-all'
environ['LDFLAGS'] = merge_strings(strip, environ.get('LDFLAGS', ''),
sep=' ')
msvcr90_wp = os.path.join(destination_dir_wp, 'msvcr90')
environ['DBMSVCR90'] = msys.windows_to_msys(msvcr90_wp)
# For dependency libraries and msvcrt hiding.
environ['LIBRARY_PATH'] = merge_strings(msvcr90_wp,
environ.get('LIBRARY_PATH', ''),
sep=';')
class ChooseError(Exception):
"""Failer to select dependencies"""
pass
def choose_dependencies(dependencies, options, args):
"""Return the dependencies to actually build"""
if options.build_all:
if args:
raise ChooseError("No library names are accepted"
" for the --all option.")
if options.exclude:
return []
else:
return dependencies
if args:
names = [d.name for d in dependencies]
args = [a.upper() for a in args]
for a in args:
if a not in names:
msg = ["%s is an unknown library; valid choices are:" % a]
msg.extend(names)
raise ChooseError('\n'.join(msg))
if options.exclude:
return [d for d in dependencies if d.name not in args]
return [d for d in dependencies if d.name in args]
return []
def summary(dependencies, msys, start_time, chosen_deps, options):
"""Display a summary report of new, existing and missing DLLs"""
import datetime
print_("\n\n=== Summary ===")
if start_time is not None:
print_(" Elapse time:",
datetime.timedelta(seconds=time.time()-start_time))
bin_dir = options.destination_dir
for d in dependencies:
name = d.name
dlls = d.dlls
for dll in dlls:
dll_path = os.path.join(bin_dir, dll)
try:
mod_time = os.path.getmtime(dll_path)
except:
msg = "No DLL"
else:
if mod_time >= start_time:
msg = "Installed new DLL %s" % dll_path
else:
msg = "-- (old DLL %s)" % dll_path
print_(" %-10s: %s" % (name, msg))
def main(dependencies, msvcr90_preparation, msys_preparation):
"""Build the dependencies according to the command line options."""
options, args = command_line()
if options.arg_help:
print_("These are the Pygame library dependencies:")
for dep in dependencies:
print_(" ", dep.name)
return 0
try:
chosen_deps = choose_dependencies(dependencies, options, args)
except ChooseError:
print_(geterror())
return 1
print_("Destination directory:", options.destination_dir)
if not chosen_deps:
if not args:
print_("No libraries specified.")
elif options.build_all:
print_("All libraries excluded")
chosen_deps.insert(0, msvcr90_preparation)
chosen_deps.insert(0, msys_preparation)
try:
msys_directory = options.msys_directory
except AttributeError:
msys_directory = None
try:
m = msys.Msys(msys_directory)
except msys.MsysException:
print_(geterror())
return 1
start_time = None
return_code = 1
set_environment_variables(m, options)
print_("\n=== Starting build ===")
start_time = time.time() # For file timestamp checks.
try:
build(chosen_deps, m)
except BuildError:
print_("Build aborted:", geterror())
else:
# A successful build!
return_code = 0
summary(dependencies, m, start_time, chosen_deps, options)
return return_code
#
# Build specific code
#
# This list includes the MSYS shell scripts to build each library. Each script
# runs in an environment where MINGW_ROOT_DIRECTORY is defined and the MinGW
# bin directory is in PATH. DBWD, is the working directory. A script will cd to
# it before doing anything else. BDBIN is the location of the dependency DLLs.
# BDLIB is the location of the dependency libraries. LDFLAGS are linker flags.
#
# The list order corresponds to build order. It is critical.
dependencies = [
Dependency('SDL', ['SDL.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/SDL.dll" >SDL.def
gcc -shared $LDFLAGS -mwindows -def SDL.def "$BDLIB/libSDL.a" -lwinmm -ldxguid -lgdi32 -o SDL.dll
dlltool -D SDL.dll -d SDL.def -l libSDL.dll.a
ranlib libSDL.dll.a
#strip --strip-all SDL.dll
"""),
Dependency('Z', ['zlib1.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/zlib1.dll" >z.def
gcc -shared $LDFLAGS -def z.def "$BDLIB/libz.a" -mwindows -o zlib1.dll
dlltool -D zlib1.dll -d z.def -l libz.dll.a
ranlib libz.dll.a
#strip --strip-all zlib1.dll
"""),
Dependency('FREETYPE', ['libfreetype-6.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/libfreetype-6.dll" >freetype.def
gcc -shared $LDFLAGS -L. -def freetype.def \
"$BDLIB/libfreetype.a" -mwindows -lz -o libfreetype-6.dll
dlltool -D libfreetype-6.dll -d freetype.def -l libfreetype.dll.a
ranlib libfreetype.dll.a
#strip --strip-all libfreetype-6.dll
"""),
Dependency('FONT', ['SDL_ttf.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/SDL_ttf.dll" >SDL_ttf.def
gcc -shared $LDFLAGS -L. "-L$BDLIB" -def SDL_ttf.def \
"$BDLIB/libSDL_ttf.a" -mwindows -lSDL -lfreetype -o SDL_ttf.dll
dlltool -D SDL_ttf.dll -d SDL_ttf.def -l libSDL_ttf.dll.a
ranlib libSDL_ttf.dll.a
#strip --strip-all SDL_ttf.dll
"""),
Dependency('PNG', ['libpng14.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/libpng14.dll" >png.def
gcc -shared $LDFLAGS -L. -def png.def "$BDLIB/libpng.a" -mwindows -lz -o libpng14.dll
dlltool -D libpng14.dll -d png.def -l libpng.dll.a
ranlib libpng.dll.a
#strip --strip-all libpng14.dll
"""),
Dependency('JPEG', ['libjpeg-8.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/libjpeg-8.dll" >jpeg.def
gcc -shared $LDFLAGS -def jpeg.def "$BDLIB/libjpeg.a" -mwindows -o libjpeg-8.dll
dlltool -D libjpeg-8.dll -d jpeg.def -l libjpeg.dll.a
ranlib libjpeg.dll.a
#strip --strip-all libjpeg-8.dll
"""),
Dependency('TIFF', ['libtiff-3.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/libtiff-3.dll" | sed '/libport_dummy_function/d' >tiff.def
gcc -shared $LDFLAGS -L. -def tiff.def \
"$BDLIB/libtiff.a" -mwindows -ljpeg -lz -o libtiff-3.dll
dlltool -D libtiff-3.dll -d tiff.def -l libtiff.dll.a
ranlib libtiff.dll.a
strip --strip-all libtiff-3.dll
"""),
Dependency('IMAGE', ['SDL_image.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/SDL_image.dll" >SDL_image.def
gcc -shared $LDFLAGS -L. -def SDL_image.def \
"$BDLIB/libSDL_image.a" -mwindows -lSDL -ljpeg -lpng -ltiff -o SDL_image.dll
dlltool -D SDL_image.dll -d SDL_image.def -l libSDL_image.dll.a
ranlib libSDL_image.dll.a
#strip --strip-all SDL_image.dll
"""),
Dependency('SMPEG', ['smpeg.dll'], """
set -e
cd "$BDWD"
dlltool --export-all-symbols -z smpeg.def "$BDLIB/libsmpeg.a"
g++ -shared $LDFLAGS -static-libstdc++ -static-libgcc -L. -def smpeg.def \
-Wl,--enable-auto-import,--out-implib,libsmpeg.dll.a \
"$BDLIB/libsmpeg.a" -mwindows -lSDL -o smpeg.dll
ranlib libsmpeg.dll.a
#strip --strip-all smpeg.dll
"""),
Dependency('OGG', ['libogg-0.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/libogg-0.dll" >ogg.def
gcc -shared $LDFLAGS -def ogg.def "$BDLIB/libogg.a" -mwindows -o libogg-0.dll
dlltool -D libogg-0.dll -d ogg.def -l libogg.dll.a
ranlib libogg.dll.a
#strip --strip-all libogg-0.dll
"""),
Dependency('VORBIS', ['libvorbis-0.dll', 'libvorbisfile-3.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/libvorbis-0.dll" >vorbis.def
gcc -shared $LDFLAGS -L. -def vorbis.def \
"$BDLIB/libvorbis.a" -mwindows -logg -o libvorbis-0.dll
dlltool -D libvorbis-0.dll -d vorbis.def -l libvorbis.dll.a
ranlib libvorbis.dll.a
#strip --strip-all libvorbis-0.dll
pexports "$BDBIN/libvorbisfile-3.dll" >vorbisfile.def
gcc -shared $LDFLAGS -L. -def vorbisfile.def \
"$BDLIB/libvorbisfile.a" -mwindows -lvorbis -logg -o libvorbisfile-3.dll
dlltool -D libvorbisfile-3.dll -d vorbisfile.def -l libvorbisfile.dll.a
ranlib libvorbisfile.dll.a
#strip --strip-all libvorbisfile-3.dll
"""),
Dependency('MIXER', ['SDL_mixer.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/SDL_mixer.dll" >SDL_mixer.def
gcc -shared -static-libgcc $LDFLAGS -L. -L"$BDLIB" -def SDL_mixer.def \
"$BDLIB/libSDL_mixer.a" -mwindows -lSDL -lsmpeg -lvorbisfile -lFLAC -lmikmod -lWs2_32 -lwinmm -o SDL_mixer.dll
dlltool -D SDL_mixer.dll -d SDL_mixer.def -l libSDL_mixer.dll.a
ranlib libSDL_mixer.dll.a
#strip --strip-all SDL_mixer.dll
"""),
Dependency('PORTMIDI', ['portmidi.dll'], """
set -e
cd "$BDWD"
pexports "$BDBIN/portmidi.dll" >portmidi.def
g++ -shared -static-libgcc $LDFLAGS -L. -L/usr/local/lib -def portmidi.def \
"$BDLIB/libportmidi.a" -mwindows -lwinmm -o portmidi.dll
dlltool -D portmidi.dll -d portmidi.def -l portmidi.dll.a
ranlib libSDL_mixer.dll.a
#strip --strip-all portmidi.dll
"""),
Dependency('FFMPEG', ['avformat-52.dll', 'swscale-0.dll',
'avcodec-52.dll', 'avutil-50.dll' ], """
set -e
cd "$BDWD"
dlltool --export-all-symbols -z avutil.def "$BDLIB/libavutil.a"
gcc -shared -L. -L"$BDLIB" -def avutil.def $LDFLAGS \
-Wl,-Bsymbolic,--as-needed,--out-implib,libavutil.dll.a \
"$BDLIB/libavutil.a" -mwindows -o avutil-50.dll
ranlib libavutil.dll.a
#strip --strip-all avutil-50.dll
set -e
cd "$BDWD"
dlltool --export-all-symbols -z avcodec.def "$BDLIB/libavcodec.a"
gcc -shared -L. -L"$BDLIB" -def avcodec.def $LDFLAGS \
-Wl,-Bsymbolic,--as-needed,--enable-auto-import,--out-implib,libavcodec.dll.a \
"$BDLIB/libavcodec.a" -mwindows -lavutil -lz -o avcodec-52.dll
ranlib libavcodec.dll.a
#strip --strip-all avcodec-52.dll
set -e
cd "$BDWD"
dlltool --export-all-symbols -z avformat.def "$BDLIB/libavformat.a"
gcc -shared -L. -L"BDLIB" -def avformat.def $LDFLAGS \
-Wl,-Bsymbolic,--as-needed,--enable-auto-import,--out-implib,libavformat.dll.a \
"$BDLIB/libavformat.a" -mwindows -lavcodec -lavutil -lz -lWs2_32 -o avformat-52.dll
ranlib libavformat.dll.a
#strip --strip-all avformat-52.dll
set -e
cd "$BDWD"
dlltool --export-all-symbols -z swscale.def "$BDLIB/libswscale.a"
gcc -shared -L. -L"$BDLIB" -def swscale.def $LDFLAGS \
-Wl,-Bsymbolic,--as-needed,--enable-auto-import,--out-implib,libswscale.dll.a \
"$BDLIB/libswscale.a" -mwindows -lavutil -o swscale-0.dll
ranlib libswscale.dll.a
#strip --strip-all swscale-0.dll
"""),
] # End dependencies = [.
msys_prep = Preparation('/usr/local', """
# Ensure destination directories exists.
mkdir -p "$BDWD"
mkdir -p "$DBMSVCR90"
""")
msvcr90_prep = Preparation('msvcr90.dll linkage', r"""
set -e
#
# msvcr90.dll support
#
if [ ! -f "$DBMSVCR90/libmoldnamed.dll.a" ]; then
OBJS='isascii.o iscsym.o iscsymf.o toascii.o
strcasecmp.o strncasecmp.o wcscmpi.o'
if [ ! -d /tmp/build_deps ]; then mkdir /tmp/build_deps; fi
cd /tmp/build_deps
# These definitions were generated with pexports on msvcr90.dll.
# The C++ stuff at the beginning was removed. _onexit and atexit made
# data entries.
cat > msvcr90.def << 'THE_END'
EXPORTS
_CIacos
_CIasin
_CIatan
_CIatan2
_CIcos
_CIcosh
_CIexp
_CIfmod
_CIlog
_CIlog10
_CIpow
_CIsin
_CIsinh
_CIsqrt
_CItan
_CItanh
_CRT_RTC_INIT
_CRT_RTC_INITW
_CreateFrameInfo
_CxxThrowException
_EH_prolog
_FindAndUnlinkFrame
_Getdays
_Getmonths
_Gettnames
_HUGE DATA
_IsExceptionObjectToBeDestroyed
_NLG_Dispatch2
_NLG_Return
_NLG_Return2
_Strftime
_XcptFilter
__AdjustPointer
__BuildCatchObject
__BuildCatchObjectHelper
__CppXcptFilter
__CxxCallUnwindDelDtor
__CxxCallUnwindDtor
__CxxCallUnwindStdDelDtor
__CxxCallUnwindVecDtor
__CxxDetectRethrow
__CxxExceptionFilter
__CxxFrameHandler
__CxxFrameHandler2
__CxxFrameHandler3
__CxxLongjmpUnwind
__CxxQueryExceptionSize
__CxxRegisterExceptionObject
__CxxUnregisterExceptionObject
__DestructExceptionObject
__FrameUnwindFilter
__RTCastToVoid
__RTDynamicCast
__RTtypeid
__STRINGTOLD
__STRINGTOLD_L
__TypeMatch
___fls_getvalue@4
___fls_setvalue@8
___lc_codepage_func
___lc_collate_cp_func
___lc_handle_func
___mb_cur_max_func
___mb_cur_max_l_func
___setlc_active_func
___unguarded_readlc_active_add_func
__argc DATA
__argv DATA
__badioinfo DATA
__clean_type_info_names_internal
__control87_2
__create_locale
__crtCompareStringA
__crtCompareStringW
__crtGetLocaleInfoW
__crtGetStringTypeW
__crtLCMapStringA
__crtLCMapStringW
__daylight
__dllonexit
__doserrno
__dstbias
__fpecode
__free_locale
__get_app_type
__get_current_locale
__get_flsindex
__get_tlsindex
__getmainargs
__initenv DATA
__iob_func
__isascii
__iscsym
__iscsymf
__iswcsym
__iswcsymf
__lc_clike DATA
__lc_codepage DATA
__lc_collate_cp DATA
__lc_handle DATA
__lconv DATA
__lconv_init
__libm_sse2_acos
__libm_sse2_acosf
__libm_sse2_asin
__libm_sse2_asinf
__libm_sse2_atan
__libm_sse2_atan2
__libm_sse2_atanf
__libm_sse2_cos
__libm_sse2_cosf
__libm_sse2_exp
__libm_sse2_expf
__libm_sse2_log
__libm_sse2_log10
__libm_sse2_log10f
__libm_sse2_logf
__libm_sse2_pow
__libm_sse2_powf
__libm_sse2_sin
__libm_sse2_sinf
__libm_sse2_tan
__libm_sse2_tanf
__mb_cur_max DATA
__p___argc
__p___argv
__p___initenv
__p___mb_cur_max
__p___wargv
__p___winitenv
__p__acmdln
__p__amblksiz
__p__commode
__p__daylight
__p__dstbias
__p__environ
__p__fmode
__p__iob
__p__mbcasemap
__p__mbctype
__p__pctype
__p__pgmptr
__p__pwctype
__p__timezone
__p__tzname
__p__wcmdln
__p__wenviron
__p__wpgmptr
__pctype_func
__pioinfo DATA
__pwctype_func
__pxcptinfoptrs
__report_gsfailure
__set_app_type
__set_flsgetvalue
__setlc_active DATA
__setusermatherr
__strncnt
__swprintf_l
__sys_errlist
__sys_nerr
__threadhandle
__threadid
__timezone
__toascii
__tzname
__unDName
__unDNameEx
__unDNameHelper
__uncaught_exception
__unguarded_readlc_active DATA
__vswprintf_l
__wargv DATA
__wcserror
__wcserror_s
__wcsncnt
__wgetmainargs
__winitenv DATA
_abnormal_termination
_abs64
_access
_access_s
_acmdln DATA
_adj_fdiv_m16i
_adj_fdiv_m32
_adj_fdiv_m32i
_adj_fdiv_m64
_adj_fdiv_r
_adj_fdivr_m16i
_adj_fdivr_m32
_adj_fdivr_m32i
_adj_fdivr_m64
_adj_fpatan
_adj_fprem
_adj_fprem1
_adj_fptan
_adjust_fdiv DATA
_aexit_rtn DATA
_aligned_free
_aligned_malloc
_aligned_msize
_aligned_offset_malloc
_aligned_offset_realloc
_aligned_offset_recalloc
_aligned_realloc
_aligned_recalloc
_amsg_exit
_assert
_atodbl
_atodbl_l
_atof_l
_atoflt
_atoflt_l
_atoi64
_atoi64_l
_atoi_l
_atol_l
_atoldbl
_atoldbl_l
_beep
_beginthread
_beginthreadex
_byteswap_uint64
_byteswap_ulong
_byteswap_ushort
_c_exit
_cabs
_callnewh
_calloc_crt
_cexit
_cgets
_cgets_s
_cgetws
_cgetws_s
_chdir
_chdrive
_chgsign
_chkesp
_chmod
_chsize
_chsize_s
_clearfp
_close
_commit
_commode DATA
_configthreadlocale
_control87
_controlfp
_controlfp_s
_copysign
_cprintf
_cprintf_l
_cprintf_p
_cprintf_p_l
_cprintf_s
_cprintf_s_l
_cputs
_cputws
_creat
_create_locale
_crt_debugger_hook
_cscanf
_cscanf_l
_cscanf_s
_cscanf_s_l
_ctime32
_ctime32_s
_ctime64
_ctime64_s
_cwait
_cwprintf
_cwprintf_l
_cwprintf_p
_cwprintf_p_l
_cwprintf_s
_cwprintf_s_l
_cwscanf
_cwscanf_l
_cwscanf_s
_cwscanf_s_l
_daylight DATA
_decode_pointer
_difftime32
_difftime64
_dosmaperr
_dstbias DATA
_dup
_dup2
_dupenv_s
_ecvt
_ecvt_s
_encode_pointer
_encoded_null
_endthread
_endthreadex
_environ DATA
_eof
_errno
_except_handler2
_except_handler3
_except_handler4_common
_execl
_execle
_execlp
_execlpe
_execv
_execve
_execvp
_execvpe
_exit
_expand
_fclose_nolock
_fcloseall
_fcvt
_fcvt_s
_fdopen
_fflush_nolock
_fgetchar
_fgetwc_nolock
_fgetwchar
_filbuf
_filelength
_filelengthi64
_fileno
_findclose
_findfirst32
_findfirst32i64
_findfirst64
_findfirst64i32
_findnext32
_findnext32i64
_findnext64
_findnext64i32
_finite
_flsbuf
_flushall
_fmode DATA
_fpclass
_fpieee_flt
_fpreset
_fprintf_l
_fprintf_p
_fprintf_p_l
_fprintf_s_l
_fputchar
_fputwc_nolock
_fputwchar
_fread_nolock
_fread_nolock_s
_free_locale
_freea
_freea_s
_freefls
_fscanf_l
_fscanf_s_l
_fseek_nolock
_fseeki64
_fseeki64_nolock
_fsopen
_fstat32
_fstat32i64
_fstat64
_fstat64i32
_ftell_nolock
_ftelli64
_ftelli64_nolock
_ftime32
_ftime32_s
_ftime64
_ftime64_s
_ftol
_fullpath
_futime32
_futime64
_fwprintf_l
_fwprintf_p
_fwprintf_p_l
_fwprintf_s_l
_fwrite_nolock
_fwscanf_l
_fwscanf_s_l
_gcvt
_gcvt_s
_get_amblksiz
_get_current_locale
_get_daylight
_get_doserrno
_get_dstbias
_get_errno
_get_fmode
_get_heap_handle
_get_invalid_parameter_handler
_get_osfhandle
_get_output_format
_get_pgmptr
_get_printf_count_output
_get_purecall_handler
_get_sbh_threshold
_get_terminate
_get_timezone
_get_tzname
_get_unexpected
_get_wpgmptr
_getc_nolock
_getch
_getch_nolock
_getche
_getche_nolock
_getcwd
_getdcwd
_getdcwd_nolock
_getdiskfree
_getdllprocaddr
_getdrive
_getdrives
_getmaxstdio
_getmbcp
_getpid
_getptd
_getsystime
_getw
_getwch
_getwch_nolock
_getwche
_getwche_nolock
_getws
_getws_s
_global_unwind2
_gmtime32
_gmtime32_s
_gmtime64
_gmtime64_s
_heapadd
_heapchk
_heapmin