-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure.vbs
executable file
·1598 lines (1348 loc) · 44.4 KB
/
configure.vbs
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
on error resume next
' run with cscript
If InStr(LCase(WScript.FullName),"cscript")=0 Then
WScript.Echo("Please run: cscript /nologo configure.vbs")
WScript.Quit
End If
' command line arguments
OPTCPPFLAGS="/O2"
DEBUGCPPFLAGS="/MD"
DEBUGLDFLAGS=""
hexversion=""
disableutil=false
disableserver=false
disableoracle=false
disablemysql=false
disablepostgresql=false
disablesap=false
disableodbc=false
disabledb2=false
disablefirebird=false
disableinformix=false
disablerouter=false
disableodbcdriver=false
disablecpp=false
disableperl=false
disablepython=false
disableruby=false
disablejava=false
disablephp=false
disabletcl=false
disablenodejs=false
disablecs=false
disablecmdline=false
disabledoc=false
ORACLEPREFIX=""
MYSQLPREFIX=""
POSTGRESQLPREFIX=""
SYBASEPREFIX=""
DB2PREFIX=""
FIREBIRDPREFIX=""
INFORMIXPREFIX=""
PERLPREFIX=""
PERLVERSION=""
PYTHONPREFIX=""
PYTHONVERSION=""
PYTHONMAJOR=""
PYTHONMINOR=""
RUBYPREFIX=""
RUBYVERSION=""
JAVAPREFIX=""
PHPPREFIX=""
TCLPREFIX=""
NODEJSPREFIX=""
SQLR="sqlr"
SQLRELAY="sqlrelay"
SQL_RELAY="SQL Relay"
ABS_MAXCONNECTIONS="4096"
if WScript.Arguments.Count>0 then
if Wscript.Arguments.Item(0)="--help" then
WScript.Echo("Usage: cscript /nologo configure.vbs [OPTION]...")
WScript.Echo("")
WScript.Echo("Optional Features:")
WScript.Echo(" --enable-small-code optimize for small code size")
WScript.Echo(" --enable-debug compile with debug option")
WScript.Echo(" --disable-oracle Don't build Oracle connection module")
WScript.Echo(" --disable-mysql Don't build MySQL connection module")
WScript.Echo(" --disable-postgresql Don't build PostgreSQL connection module")
WScript.Echo(" --disable-sap Don't build SAP/Sybase connection module")
WScript.Echo(" --disable-odbc Don't build ODBC connection module")
WScript.Echo(" --disable-db2 Don't build DB2 connection module")
WScript.Echo(" --disable-firebird Don't build Firebird connection module")
WScript.Echo(" --disable-informix Don't build Informix connection module")
WScript.Echo(" --disable-router Don't build router connection module")
WScript.Echo(" --disable-odbc-driver Don't build ODBC driver")
WScript.Echo(" --disable-perl Don't build Perl api")
WScript.Echo(" --disable-python Don't build Python api")
WScript.Echo(" --disable-ruby Don't build Ruby api")
WScript.Echo(" --disable-java Don't build Java api")
WScript.Echo(" --disable-php Don't build PHP api")
WScript.Echo(" --disable-tcl Don't build TCL api")
WScript.Echo(" --disable-nodejs Don't build node.js api")
WScript.Echo(" --disable-cs Don't build C# api")
WScript.Echo("")
WScript.Echo("Optional Packages:")
WScript.Echo(" --with-oracle-prefix Location of Oracle")
WScript.Echo(" --with-mysql-prefix Location of MySQL")
WScript.Echo(" --with-postgresql-prefix Location of PostgreSQL")
WScript.Echo(" --with-sap-prefix Location of SAP/Sybase")
WScript.Echo(" --with-db2-prefix Location of DB2")
WScript.Echo(" --with-firebird-prefix Location of Firebird")
WScript.Echo(" --with-informix-prefix Location of Informix")
WScript.Echo(" --with-perl-prefix Location of Perl")
WScript.Echo(" --with-perl-version Perl version")
WScript.Echo(" --with-python-prefix Location of Perl")
WScript.Echo(" --with-python-version Python version")
WScript.Echo(" --with-ruby-prefix Location of Perl")
WScript.Echo(" --with-ruby-version Ruby version")
WScript.Echo(" --with-java-prefix Location of Perl")
WScript.Echo(" --with-php-prefix Location of Perl")
WScript.Echo(" --with-tcl-prefix Location of Perl")
WScript.Echo(" --with-nodejs-prefix Location of Perl")
WScript.Echo(" --with-sqlr replacement for ""sqlr""")
WScript.Echo(" --with-sqlrelay replacement for ""sqlrelay""")
WScript.Echo(" --with-sql-relay replacement for ""SQL Relay""")
WScript.Quit
end if
end if
for i=0 to WScript.Arguments.Count-1
arg=Wscript.Arguments.Item(i)
if arg="--enable-small-code" then
OPTCPPFLAGS="/O1"
elseif arg="--enable-debug" then
DEBUGCPPFLAGS="/Zi /MDd /D _DEBUG"
DEBUGLDFLAGS="/debug"
elseif arg="--disable-oracle" then
disableoracle=true
elseif mid(arg,1,21)="--with-oracle-prefix=" then
ORACLEPREFIX=mid(arg,22)
elseif arg="--disable-mysql" then
disablemysql=true
elseif mid(arg,1,20)="--with-mysql-prefix=" then
MYSQLPREFIX=mid(arg,21)
elseif arg="--disable-postgresql" then
disablepostgresql=true
elseif mid(arg,1,25)="--with-postgresql-prefix=" then
POSTGRESQLPREFIX=mid(arg,26)
elseif arg="--disable-sap" then
disablesap=true
elseif mid(arg,1,18)="--with-sap-prefix=" then
SYBASEPREFIX=mid(arg,19)
elseif arg="--disable-odbc" then
disableodbc=true
elseif arg="--disable-db2" then
disabledb2=true
elseif mid(arg,1,18)="--with-db2-prefix=" then
DB2PREFIX=mid(arg,19)
elseif arg="--disable-firebird" then
disablefirebird=true
elseif mid(arg,1,23)="--with-firebird-prefix=" then
FIREBIRDPREFIX=mid(arg,24)
elseif arg="--disable-informix" then
disableinformix=true
elseif mid(arg,1,23)="--with-informix-prefix=" then
INFORMIXPREFIX=mid(arg,24)
elseif arg="--disable-router" then
disablerouter=true
elseif arg="--disable-odbc-driver" then
disableodbcdriver=true
elseif arg="--disable-perl" then
disableperl=true
elseif mid(arg,1,19)="--with-perl-prefix=" then
PERLPREFIX=mid(arg,20)
elseif mid(arg,1,20)="--with-perl-version=" then
PERLVERSION=mid(arg,21)
elseif arg="--disable-python" then
disablepython=true
elseif mid(arg,1,21)="--with-python-prefix=" then
PYTHONPREFIX=mid(arg,22)
elseif mid(arg,1,22)="--with-python-version=" then
PYTHONVERSION=mid(arg,23)
elseif arg="--disable-ruby" then
disableruby=true
elseif mid(arg,1,19)="--with-ruby-prefix=" then
RUBYPREFIX=mid(arg,20)
elseif mid(arg,1,20)="--with-ruby-version=" then
RUBYVERSION=mid(arg,21)
elseif arg="--disable-java" then
disablejava=true
elseif mid(arg,1,19)="--with-java-prefix=" then
JAVAPREFIX=mid(arg,20)
elseif arg="--disable-php" then
disablephp=true
elseif mid(arg,1,18)="--with-php-prefix=" then
PHPPREFIX=mid(arg,19)
elseif arg="--disable-tcl" then
disabletcl=true
elseif mid(arg,1,18)="--with-tcl-prefix=" then
TCLPREFIX=mid(arg,19)
elseif arg="--disable-nodejs" then
disablenodejs=true
elseif mid(arg,1,21)="--with-nodejs-prefix=" then
NODEJSPREFIX=mid(arg,22)
elseif arg="--disable-cs" then
disablecs=true
elseif mid(arg,1,12)="--with-sqlr=" then
SQLR=mid(arg,13)
elseif mid(arg,1,16)="--with-sqlrelay=" then
SQLRELAY=mid(arg,17)
elseif mid(arg,1,17)="--with-sql-relay=" then
SQL_RELAY=mid(arg,18)
elseif mid(arg,1,16)="--disable-server" then
disableserver=true
disableoracle=true
disablemysql=true
disablepostgresql=true
disablesap=true
disableodbc=true
disabledb2=true
disablefirebird=true
disableinformix=true
disablerouter=true
elseif mid(arg,1,16)="--disable-client" then
disablecmdline=true
disableodbcdriver=true
disablecpp=true
disableperl=true
disablepython=true
disableruby=true
disablejava=true
disablephp=true
disabletcl=true
disablecs=true
disablenodejs=true
disablerouter=true
elseif mid(arg,1,17)="--disable-cmdline" then
disablecmdline=true
elseif mid(arg,1,13)="--disable-doc" then
disabledoc=true
elseif mid(arg,1,23)="--with-windows-version=" then
hexversion=mid(arg,24)
end if
next
if disableserver=true and disablecmdline=true then
disableutil=true
end if
' version
SQLR_VERSION="2.0.0"
' paths
pfix="C:\\Program Files\\Firstworks"
prefix=pfix
exec_prefix=prefix
bindir=pfix+"\\bin"
includedir=pfix+"\\include"
libdir=pfix+"\\lib"
javadir=pfix+"\\java"
libexecdir=pfix+"\\libexec\\sqlrelay"
localstatedir=pfix+"\\var"
sysconfdir=pfix+"\\etc"
mandir=pfix+"\\share\\man"
datadir=pfix+"\\share"
docdir=pfix+"\\doc\\sqlrelay"
EXAMPLEDIR=pfix+"\\doc\\sqlrelay\\examples"
tmpdir=pfix+"\\var\\sqlrelay\\tmp"
cachedir=pfix+"\\var\\sqlrelay\\cache"
debugdir=pfix+"\\var\\sqlrelay\\debug"
logdir=pfix+"\\var\\sqlrelay\\log"
initscript_prefix=""
' extension
EXE=".exe"
' create file system object
set fso=CreateObject("Scripting.FileSystemObject")
' create shell object
set WshShell=WScript.CreateObject("WScript.Shell")
' get top_builddir
top_builddir=chr(34) & fso.GetAbsolutePathName(".") & chr(34)
WScript.Echo("")
WScript.Echo("***** Platform ***************")
' determine VC++ version and architecture
set cmd=WshShell.exec("cl")
stdout=cmd.StdOut.ReadAll()
stderr=cmd.StdErr.ReadLine()
parts=split(stderr)
arch=parts(ubound(parts))
if arch="80x86" then
arch="x86"
end if
version=parts(ubound(parts)-2)
parts=split(version,".")
version=parts(0)
WScript.Echo("Visual C++ Version: " & version)
WScript.Echo("Visual C++ Architecture: " & arch)
' set some architecture-based flags
USE_32BIT_TIME_T=""
if arch="x86" then
USE_32BIT_TIME_T="/D _USE_32BIT_TIME_T"
end if
' determine OS Version number
if len(hexversion)=0 then
set cmd=WshShell.exec("%comspec% /c ver")
stdout=cmd.StdOut.ReadAll()
stderr=cmd.StdErr.ReadLine()
if instr(stdout,"Windows NT Version 4.0")>0 then
hexversion="0x0400"
else
parts0=split(stdout,"[")
parts1=split(parts0(1)," ")
parts2=split(parts1(1),"]")
parts3=split(parts2(0),".")
if parts3(1)="00" then
parts3(1)="0"
end if
hexversion="0x0"&parts3(0)&"0"&parts3(1)
end if
end if
WScript.Echo("Windows Version: " & hexversion)
' in general, we need to set WIN32WINNT to the hexversion
WINVER=""
WIN32WINDOWS=""
WIN32WINNT=hexversion
' but, for OS'es older than WinXP we have to do some special things...
' for Win2k and WinNT4, set WINVER also
if hexversion="0x0500" or hexversion="0x0400" then
WINVER=hexversion
' for WinME, set WIN32WINDOWS and unset WIN32WINNT
elseif hexversion="0x0490" then
WIN32WINDOWS=hexversion
WIN32WINNT=""
' for Win98, set WIN32WINDOWS and WINVER and unset WIN32WINNT
elseif hexversion="0x0410" then
WIN32WINDOWS=hexversion
WINVER=hexversion
WIN32WINNT=""
' for Win95, set WINVER and unset WIN32WINNT
elseif hexversion="0x0400" then
WINVER=hexversion
WIN32WINNT=""
' FIXME: not sure about WinNT3X, Win3X or below
end if
' add /D and macro name
if WINVER<>"" then
WINVER="/D WINVER="&WINVER
end if
if WIN32WINDOWS<>"" then
WIN32WINDOWS="/D _WIN32_WINDOWS="&WIN32WINDOWS
end if
if WIN32WINNT<>"" then
WIN32WINNT="/D _WIN32_WINNT="&WIN32WINNT
end if
' determine config.h template...
configwindowsh="config_windows.h"
' determine SDK headers and libs... (FIXME: make this configurable)
' VS2002, VS2003 and VS2008 and up come with a platform SDK
SDKINCLUDES=""
SDKLIBS=""
' VS2005 doesn't come with an SDK and there are several that are compatible
if version=14 then
' older SDK's have various issues
' 5.2.3700.0 - Microsoft Platform SDK February 2003
'SDKINCLUDES="/I""C:\Program Files\Microsoft SDK\include"""
'SDKLIBS="/LIBPATH:""C:\Program Files\Microsoft SDK\Lib"""
' 5.2.3790.1830.15 - Windows Server 2003 SP1 Platform SDK
SDKINCLUDES="/I""C:\Program Files\Microsoft Platform SDK\Include"""
SDKLIBS="/LIBPATH:""C:\Program Files\Microsoft Platform SDK\Lib"""
' 5.2.3790.2075.51 - Windows Server 2003 R2 Platform SDK
'SDKINCLUDES="/I""C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include"""
'SDKLIBS="/LIBPATH:""C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib"""
' 6.0A (comes with VC2008)
'SDKINCLUDES="/I""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include"""
'SDKLIBS="/LIBPATH:""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib"""
' not sure about newer SDK's
' VS6 doesn't come with a platform SDK
elseif version=12 then
' older SDK's might work too
' 5.2.3700.0 - Microsoft Platform SDK February 2003
SDKINCLUDES="/I""C:\Program Files\Microsoft SDK\include"""
SDKLIBS="/LIBPATH:""C:\Program Files\Microsoft SDK\Lib"""
' not sure about newer SDK's
' VS5 and lower don't come with a platform SDK
elseif version<=11 then
' older SDK's might work too
' 5.1.2600.2180 - Microsoft Platform SDK for Windows XP SP2
' (this doesn't actually work)
'SDKINCLUDES="/I""C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include"""
'SDKLIBS="/LIBPATH:""C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Lib"""
' newer SDK's give link errors
end if
WScript.Echo("******************************")
' util
ALLUTIL=""
INSTALLUTIL=""
if disableutil=false then
ALLUTIL="all-util"
INSTALLUTIL="install-util"
end if
' server
ALLSERVER=""
INSTALLSERVER=""
if disableserver=false then
ALLSERVER="all-server all-configs all-parsers all-queries all-loggers all-notifications all-schedules all-routers all-protocols all-pwdencs all-auths all-directives all-querytranslations all-bindvariabletranslations all-resultsettranslations all-resultsetrowtranslations all-resultsetrowblocktranslations all-resultsetheadertranslations all-errortranslations all-filters all-triggers all-moduledatas all-connections"
INSTALLSERVER="install-server install-configs install-parsers install-queries install-loggers install-notifications install-schedules install-routers install-protocols install-pwdencs install-auths install-directives install-querytranslations install-bindvariabletranslations install-resultsettranslations install-resultsetrowtranslations install-resultsetrowblocktranslations install-resultsetheadertranslations install-errortranslations install-filters install-triggers install-moduledatas install-connections"
end if
' oracle
WScript.Echo("")
WScript.Echo("***** Oracle *****************")
configureDatabase "Oracle","oracle",disableoracle,_
"C:\Program Files\Oracle","instantclient_",_
"sdk\include","oci.h",_
"sdk\lib\msvc","oci.lib","",_
"\include","\lib\msvc","oci.lib",_
ORACLEPREFIX,ORACLEINCLUDES,ORACLELIBS,_
ALLORACLE,INSTALLORACLE
ORACLEVERSION
WScript.Echo("******************************")
' mysql
WScript.Echo("")
WScript.Echo("***** MySQL ******************")
'"MySQL Connector.C ",_
configureDatabase "MySQL","mysql",disablemysql,_
"C:\Program Files\MySQL",_
"MySQL Connector C ",_
"include","mysql.h",_
"lib","libmysql.lib","",_
"\include","\lib","libmysql.lib",_
MYSQLPREFIX,MYSQLINCLUDES,MYSQLLIBS,_
ALLMYSQL,INSTALLMYSQL
WScript.Echo("******************************")
' postgresql
WScript.Echo("")
WScript.Echo("***** PostgreSQL *************")
configureDatabase "PostgreSQL","postgresql",disablepostgresql,_
"C:\Program Files\PostgreSQL","",_
"include","libpq-fe.h",_
"lib","libpq.lib","",_
"\include","\lib","libpq.lib",_
POSTGRESQLPREFIX,POSTGRESQLINCLUDES,POSTGRESQLLIBS,_
ALLPOSTGRESQL,INSTALLPOSTGRESQL
WScript.Echo("******************************")
' sqlite
SQLITEINCLUDES=""
SQLITELIBS=""
ALLSQLITE=""
INSTALLSQLITE=""
' sap
WScript.Echo("")
WScript.Echo("***** SAP/Sybase *************")
configureDatabase "SAP/SYBASE","sap",disablesap,_
"C:\SAP","OCS-",_
"include","ctpublic.h",_
"lib","libsybct64.lib",_
"libsybblk64.lib libsybcs64.lib",_
"\include","\lib","libsybct64.lib",_
SYBASEPREFIX,SYBASEINCLUDES,SYBASELIBS,_
ALLSYBASE,INSTALLSYBASE
WScript.Echo("******************************")
' odbc
WScript.Echo("")
WScript.Echo("***** ODBC *******************")
ODBCINCLUDES=""
ODBCLIBS="user32.lib gdi32.lib odbc32.lib odbccp32.lib"
' VS2015 requires legacy_stdio_definitions.lib or
' __vsnwprintf_s will be unresolved
set WshShell=WScript.CreateObject("WScript.Shell")
set cmd=WshShell.exec("cl")
stdout=cmd.StdOut.ReadAll()
stderr=cmd.StdErr.ReadLine()
parts=split(stderr)
arch=parts(ubound(parts))
version=""
for i=lbound(parts) to ubound(parts)
if parts(i)="Version" then
version=parts(i+1)
end if
next
parts=split(version,".")
version=parts(0)
if version=19 then
ODBCLIBS=ODBCLIBS+" legacy_stdio_definitions.lib"
end if
if disableodbc=false then
ALLODBC="all-odbc"
INSTALLODBC="installdll-odbc"
WScript.Echo("ODBC includes... " & ODBCINCLUDES)
WScript.Echo("ODBC libs... " & ODBCLIBS)
else
WScript.Echo("ODBC support will not be built. ")
end if
WScript.Echo("******************************")
' db2
WScript.Echo("")
WScript.Echo("***** DB2 ********************")
configureDatabase "DB2","db2",disabledb2,_
"C:\Program Files\IBM","SQLLIB",_
"include","sqlcli1.h",_
"lib","db2api.lib",_
"",_
"\include","\lib","db2api.lib",_
DB2PREFIX,DB2INCLUDES,DB2LIBS,_
ALLDB2,INSTALLDB2
WScript.Echo("******************************")
' firebid
WScript.Echo("")
WScript.Echo("***** Firebird ***************")
configureDatabase "Firebird","firebird",disablefirebird,_
"C:\Program Files\Firebird","Firebird_",_
"include","ibase.h",_
"lib","fbclient_ms.lib",_
"",_
"\include","\lib","fbclient_ms.lib",_
FIREBIRDPREFIX,FIREBIRDINCLUDES,FIREBIRDLIBS,_
ALLFIREBIRD,INSTALLFIREBIRD
WScript.Echo("******************************")
' informix
WScript.Echo("")
WScript.Echo("***** Informix ***************")
configureDatabase "Informix","informix",disableinformix,_
"C:\Program Files","IBM Informix Software Bundle",_
"incl\cli","infxcli.h",_
"lib","iclit",_
"",_
"\incl\cli","\lib","iclit09b.lib",_
INFORMIXPREFIX,INFORMIXINCLUDES,INFORMIXLIBS,_
ALLINFORMIX,INSTALLINFORMIX
WScript.Echo("******************************")
' router
ALLROUTER=""
INSTALLROUTER=""
if disablerouter=false then
ALLROUTER="all-router"
INSTALLROUTER="installdll-router"
end if
' cmdline programs
ALLCMDLINE=""
INSTALLCMDLINE=""
if disablecmdline=false then
ALLCMDLINE="all-cmdline"
INSTALLCMDLINE="install-cmdline"
end if
' api's...
APIALLSUBDIRS=""
APICLEANSUBDIRS=""
APIINSTALLSUBDIRS=""
APIUNINSTALLSUBDIRS=""
if disablecpp=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-cpp all-c"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-cpp clean-c"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-cpp install-c"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+" uninstall-cpp uninstall-c"
end if
if disableodbcdriver=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-odbc"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-odbc"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-odbc"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+" uninstall-odbc"
end if
' c#
WScript.Echo("")
WScript.Echo("***** C# *********************")
if disablecs=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-cs"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-cs"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-cs"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-cs"
else
WScript.Echo("C# support will not be built. ")
end if
WScript.Echo("******************************")
' perl
WScript.Echo("")
WScript.Echo("***** Perl *******************")
if PERLPREFIX="" then
findPrefix "C:\","Perl",PERLPREFIX,disableperl
end if
if PERLPREFIX<>"" and PERLVERSION="" then
findVersion PERLPREFIX & "\lib\CORE","perl",".lib",PERLVERSION
end if
if disableperl=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-perl"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-perl"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-perl"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-perl"
WScript.Echo("Perl prefix... " & PERLPREFIX)
WScript.Echo("Perl version... " & PERLVERSION)
else
WScript.Echo("Perl support will not be built. ")
end if
WScript.Echo("******************************")
' python
WScript.Echo("")
WScript.Echo("***** Python *****************")
if PYTHONPREFIX="" then
findPrefix "C:\","Python",PYTHONPREFIX,disablepython
end if
if PYTHONPREFIX<>"" and PYTHONVERSION="" then
findVersion PYTHONPREFIX & "\libs","python",".lib",PYTHONVERSION
end if
PYTHONMAJOR=mid(PYTHONVERSION,1,1)
PYTHONMINOR=mid(PYTHONVERSION,2)
if PYTHONMAJOR=2 then
IMPORTEXCEPTIONS="import exceptions"
EXCEPTIONSSTANDARDERROR="exceptions.StandardError"
else
IMPORTEXCEPTIONS=""
EXCEPTIONSSTANDARDERROR="Exception"
end if
SQLRELAY_NEED_PY_SSIZE_T_CLEAN="/* #undef SQLRELAY_NEED_PY_SSIZE_T_CLEAN */"
if PYTHONMAJOR>=3 then
if PYTHONMAJOR>3 or PYTHONMINOR>=10 then
SQLRELAY_NEED_PY_SSIZE_T_CLEAN="#define SQLRELAY_NEED_PY_SSIZE_T_CLEAN 1"
end if
end if
if disablepython=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-python"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-python"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-python"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-python"
WScript.Echo("Python prefix... " & PYTHONPREFIX)
WScript.Echo("Python version... " & PYTHONVERSION)
else
WScript.Echo("Python support will not be built. ")
end if
WScript.Echo("******************************")
' ruby
WScript.Echo("")
WScript.Echo("***** Ruby *******************")
if RUBYPREFIX="" then
findPrefix "C:\","Ruby",RUBYPREFIX,disableruby
end if
if RUBYPREFIX<>"" and RUBYVERSION="" then
findVersion RUBYPREFIX & "\include","ruby-","",RUBYVERSION
RUBYLIBVERSION=RUBYVERSION
while InStr(RUBYLIBVERSION,".")>0
RUBYLIBVERSION=Replace(RUBYLIBVERSION,".","")
wend
end if
if RUBYPREFIX<>"" and RUBYVERSION<>"" then
if arch="x86" then
RUBYTARGET="i386-mswin32"
findVersion RUBYPREFIX & "\lib","msvcr","-ruby" & RUBYLIBVERSION & ".lib",RUBYVCVERSION
RUBYLIBPREFIX="msvcr" & RUBYVCVERSION
RUBYSITEARCHDIRSUFFIX="i386-msvcr" & RUBYVCVERSION
else
RUBYTARGET="x64-mswin64"
findVersion RUBYPREFIX & "\lib","x64-msvcr","-ruby" & RUBYLIBVERSION & ".lib",RUBYVCVERSION
RUBYLIBPREFIX="x64-msvcr" & RUBYVCVERSION
RUBYSITEARCHDIRSUFFIX="x64-msvcr" & RUBYVCVERSION
end if
end if
if disableruby=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-ruby"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-ruby"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-ruby"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-ruby"
WScript.Echo("Ruby prefix... " & RUBYPREFIX)
WScript.Echo("Ruby version... " & RUBYVERSION)
else
WScript.Echo("Ruby support will not be built. ")
end if
WScript.Echo("******************************")
' php
WScript.Echo("")
WScript.Echo("***** PHP ********************")
if PHPPREFIX="" then
findPrefix "C:\","PHP",PHPPREFIX,disablephp
end if
if disablephp=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-php all-phppdo"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-php clean-phppdo"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-php install-phppdo"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-php uninstall-phppdo"
WScript.Echo("PHP prefix... " & PHPPREFIX)
else
WScript.Echo("PHP support will not be built. ")
end if
WScript.Echo("******************************")
' java
WScript.Echo("")
WScript.Echo("***** Java *******************")
if JAVAPREFIX="" then
findPrefix "C:\Program Files\Java\","jdk",JAVAPREFIX,disablejava
end if
if disablejava=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-java all-jdbc"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-java clean-jdbc"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-java install-jdbc"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-java uninstall-jdbc"
WScript.Echo("Java prefix... " & JAVAPREFIX)
else
WScript.Echo("Java support will not be built. ")
end if
WScript.Echo("******************************")
' tcl
WScript.Echo("")
WScript.Echo("***** TCL ********************")
if TCLPREFIX="" then
findPrefix "C:\","Tcl",TCLPREFIX,disabletcl
end if
if disabletcl=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-tcl"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-tcl"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-tcl"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-tcl"
WScript.Echo("TCL prefix... " & TCLPREFIX)
else
WScript.Echo("TCL support will not be built. ")
end if
WScript.Echo("******************************")
' node.js
WScript.Echo("")
WScript.Echo("***** node.js ****************")
if NODEJSPREFIX="" then
findPrefix "C:\Program Files\","nodejs",NODEJSPREFIX,disablenodejs
end if
NODEJSMSVSVERSION=2005
if version=15 then
NODEJSMSVSVERSION=2008
elseif version=16 then
NODEJSMSVSVERSION=2010
elseif version=17 then
NODEJSMSVSVERSION=2012
elseif version=18 then
NODEJSMSVSVERSION=2013
elseif version=19 then
NODEJSMSVSVERSION=2015
else
NODEJSMSVSVERSION=2000+version-4
end if
if disablenodejs=false then
APIALLSUBDIRS=APIALLSUBDIRS+" all-nodejs"
APICLEANSUBDIRS=APICLEANSUBDIRS+" clean-nodejs"
APIINSTALLSUBDIRS=APIINSTALLSUBDIRS+" install-nodejs"
APIUNINSTALLSUBDIRS=APIUNINSTALLSUBDIRS+ " uninstall-nodejs"
WScript.Echo("node.js prefix... " & NODEJSPREFIX)
else
WScript.Echo("node.js support will not be built. ")
end if
WScript.Echo("******************************")
' docs
INSTALLDOC=""
if disabledoc=false then
INSTALLDOC="install-doc"
end if
TESTDBS=""
TESTAPIS=""
HOSTNAME=LCase(WScript.CreateObject("WScript.Network").ComputerName)
Set RegExp=CreateObject("VBScript.RegExp")
patterns=Array(_
"^centos",_
"^debian",_
"^fedora",_
"^freebsd",_
"^haiku",_
"^openbsd",_
"^netbsd",_
"^opensuse",_
"^solaris",_
"^syllable",_
"^ubuntu",_
"^win",_
"alpha$",_
"mipsel$",_
"mips64el$",_
"hppa$",_
"i386$",_
"sparc$",_
"sparc64$"_
)
replacements=Array(_
"co",_
"db",_
"fc",_
"fb",_
"hk",_
"ob",_
"nb",_
"os",_
"sl",_
"sb",_
"u",_
"w",_
"a",_
"m32",_
"m64",_
"hp",_
"x86",_
"s32",_
"s64"_
)
SHORTHOSTNAME=HOSTNAME
for i=lbound(patterns) to ubound(patterns)
RegExp.Pattern=patterns(i)
SHORTHOSTNAME = RegExp.Replace(SHORTHOSTNAME,replacements(i))
next
CMDLINEBUILD="no "
CPPBUILD="no "
PERLBUILD="no "
PYTHONBUILD="no "
RUBYBUILD="no "
PHPBUILD="no "
PHPPDOBUILD="no "
ODBCDRIVERBUILD="no "
JAVABUILD="no "
TCLBUILD="no "
CSBUILD="no "
NODEJSBUILD="no "
ODBCBUILD="no "
if disablecmdline=false then
CMDLINEBUILD="yes"
end if
if disablecpp=false then
CPPBUILD="yes"
TESTAPIS=TESTAPIS & """c"",""c++"","
end if
if disableperl=false then
PERLBUILD="yes"
TESTAPIS=TESTAPIS & """perl"",""perldbi"","
end if
if disablepython=false then
PYTHONBUILD="yes"
TESTAPIS=TESTAPIS & """python"",""pythondb"","
end if
if disableruby=false then
RUBYBUILD="yes"
TESTAPIS=TESTAPIS & """ruby"","
end if
if disablephp=false then
PHPBUILD="yes"
TESTAPIS=TESTAPIS & """php"","
end if
if disablephp=false then
PHPPDOBUILD="yes"
TESTAPIS=TESTAPIS & """phppdo"","
end if
if disableodbcdriver=false then
ODBCDRIVERBUILD="yes"
end if
if disablejava=false then
JAVABUILD="yes"
TESTAPIS=TESTAPIS & """java"","
end if
if disabletcl=false then
TCLBUILD="yes"
TESTAPIS=TESTAPIS & """tcl"","
end if
if disablecs=false then
CSBUILD="yes"
TESTAPIS=TESTAPIS & """cs"","
end if
if disablenodejs=false then
NODEJSBUILD="yes"
TESTAPIS=TESTAPIS & """nodejs"","
end if
if disableodbc=false then
ODBCBUILD="yes"
end if
ORACLE8BUILD="no "
MYSQLBUILD="no "
POSTGRESQLBUILD="no "
FREETDSBUILD="no "
SYBASEBUILD="no "
ODBCBUILD="no "
DB2BUILD="no "
FIREBIRDBUILD="no "