Newer
Older
PeiYong Zhang
committed
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
print ("\n\nCopying headers files ...\n");
@headerDirectories =
qw'sax
sax2
framework
framework/psvi
dom
dom/deprecated
internal
parsers
util
util/Compilers
util/MsgLoaders
util/MsgLoaders/ICU
util/MsgLoaders/InMemory
util/MsgLoaders/MsgCatalog
util/MsgLoaders/Win32
util/Platforms
util/Platforms/AIX
util/Platforms/HPUX
util/Platforms/BeOS
util/Platforms/Linux
util/Platforms/MacOS
util/Platforms/OS2
util/Platforms/OS390
util/Platforms/PTX
util/Platforms/Solaris
util/Platforms/Tandem
util/Platforms/Win32
util/regx
util/Transcoders
util/Transcoders/ICU
util/Transcoders/Iconv
util/Transcoders/Win32
validators
validators/common
validators/datatype
validators/DTD
validators/schema
validators/schema/identity';
foreach $dir (@headerDirectories) {
$inclDir = "include/xercesc/$dir";
if (! (-e $inclDir)) {
psystem("mkdir $inclDir");
}
$srcDir = "$XERCESCROOT/src/xercesc/$dir";
# Weed out directories that have no files to copy, to avoid a bunch of
# warnings from the cp command in the build output.
opendir(dir, $srcDir);
@allfiles = readdir(dir);
closedir(dir);
foreach $fileKind ("hpp", "c") {
$matches = grep(/\.$fileKind$/, @allfiles);
if ($matches > 0) {
psystem("cp -f $srcDir/*.$fileKind $inclDir/");
}
}
}
psystem("cp -Rf $XERCESCROOT/version.incl $targetdir");
#
# Remove internal implementation headers from the DOM include directory.
#
psystem ("rm -rf $targetdir/include/xercesc/dom/impl");
psystem ("rm -f $targetdir/include/xercesc/dom/deprecated/*Impl.hpp");
psystem ("rm -f $targetdir/include/xercesc/dom/deprecated/DS*.hpp");
}
sub populateSamples() {
print ("\n\nCopying sample files ...\n");
psystem("cp -Rf $XERCESCROOT/samples/SAXCount/* $targetdir/samples/SAXCount");
psystem("rm -f $targetdir/samples/SAXCount/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/SAX2Count/* $targetdir/samples/SAX2Count");
psystem("rm -f $targetdir/samples/SAX2Count/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/SAXPrint/* $targetdir/samples/SAXPrint");
psystem("rm -f $targetdir/samples/SAXPrint/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/SAX2Print/* $targetdir/samples/SAX2Print");
psystem("rm -f $targetdir/samples/SAX2Print/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/DOMCount/* $targetdir/samples/DOMCount");
psystem("rm -f $targetdir/samples/DOMCount/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/DOMPrint/* $targetdir/samples/DOMPrint");
psystem("rm -f $targetdir/samples/DOMPrint/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/Redirect/* $targetdir/samples/Redirect");
psystem("rm -f $targetdir/samples/Redirect/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/MemParse/* $targetdir/samples/MemParse");
psystem("rm -f $targetdir/samples/MemParse/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/PParse/* $targetdir/samples/PParse");
psystem("rm -f $targetdir/samples/PParse/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/StdInParse/* $targetdir/samples/StdInParse");
psystem("rm -f $targetdir/samples/StdInParse/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/EnumVal/* $targetdir/samples/EnumVal");
psystem("rm -f $targetdir/samples/EnumVal/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/SEnumVal/* $targetdir/samples/SEnumVal");
psystem("cp -Rf $XERCESCROOT/samples/CreateDOMDocument/* $targetdir/samples/CreateDOMDocument");
psystem("rm -f $targetdir/samples/CreateDOMDocument/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/PSVIWriter/* $targetdir/samples/PSVIWriter");
PeiYong Zhang
committed
psystem("rm -f $targetdir/samples/PSVIWriter/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/SCMPrint/* $targetdir/samples/SCMPrint");
PeiYong Zhang
committed
psystem("rm -f $targetdir/samples/SCMPrint/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/data/* $targetdir/samples/data");
PeiYong Zhang
committed
}
sub populateMisc() {
# Populate the scripts directory
print ("\n\nCopying script files ...\n");
psystem("cp $XERCESCROOT/scripts/sanityTest* $targetdir/scripts");
print ("\n\nCopying documentation ...\n");
psystem("cp $XERCESCROOT/Readme.html $targetdir");
psystem("cp $XERCESCROOT/credits.txt $targetdir");
psystem("cp $XERCESCROOT/LICENSE $targetdir");
psystem("cp $XERCESCROOT/NOTICE $targetdir");
psystem("rm -f $targetdir/doc/Doxyfile");
psystem("rm -rf $targetdir/doc/style");
psystem("rm -f $targetdir/doc/*.xml");
psystem("rm -f $targetdir/doc/*.ent");
psystem("rm -f $targetdir/doc/*.gif");
PeiYong Zhang
committed
PeiYong Zhang
committed
# copy ICU file to the directory specified
#
sub copyICUOnUNIX() {
pchdir ("$_[0]");
PeiYong Zhang
committed
#
# copy icudata dll
# For ICU 2.6:
# on AIX, it is called libicudata32.0.a
# on Solaris/Linux, it is called libicudata.so.32.0
# on HP, it is called libicudata.sl.32.0
PeiYong Zhang
committed
#
psystem("rm -f libicudata*");
psystem("cp -f $ICUROOT/lib/libicudata32.0.so .");
psystem("cp -f $ICUROOT/lib/libicudata32.0.a .");
psystem("cp -f $ICUROOT/lib/libicudata.so.32.0 .");
psystem("cp -f $ICUROOT/lib/libicudata.sl.32.0 .");
PeiYong Zhang
committed
psystem("find . -name 'libicudata32.0.so' -exec ln -s {} libicudata.so \\;");
psystem("find . -name 'libicudata32.0.so' -exec ln -s {} libicudata32.so \\;");
psystem("find . -name 'libicudata32.0.a' -exec ln -s {} libicudata.a \\;");
psystem("find . -name 'libicudata32.0.a' -exec ln -s {} libicudata32.a \\;");
psystem("find . -name 'libicudata.so.32.0' -exec ln -s {} libicudata.so \\;");
psystem("find . -name 'libicudata.so.32.0' -exec ln -s {} libicudata.so.32 \\;");
PeiYong Zhang
committed
psystem("find . -name 'libicudata.sl.32.0' -exec ln -s {} libicudata.sl \\;");
psystem("find . -name 'libicudata.sl.32.0' -exec ln -s {} libicudata.sl.32 \\;");
PeiYong Zhang
committed
#
# copy icuuc dll
# on AIX, it is called libicuuc32.0.a
# on Solaris/Linux, it is called libicuuc.so.32.0
# on HP, it is called libicuuc.sl.32.0
PeiYong Zhang
committed
#
psystem("rm -f libicuuc*");
psystem("cp -f $ICUROOT/lib/libicuuc32.0.so .");
psystem("cp -f $ICUROOT/lib/libicuuc32.0.a .");
psystem("cp -f $ICUROOT/lib/libicuuc.so.32.0 .");
psystem("cp -f $ICUROOT/lib/libicuuc.sl.32.0 .");
PeiYong Zhang
committed
psystem("find . -name 'libicuuc32.0.so' -exec ln -s {} libicuuc.so \\;");
psystem("find . -name 'libicuuc32.0.so' -exec ln -s {} libicuuc32.so \\;");
PeiYong Zhang
committed
psystem("find . -name 'libicuuc32.0.a' -exec ln -s {} libicuuc.a \\;");
psystem("find . -name 'libicuuc32.0.a' -exec ln -s {} libicuuc32.a \\;");
psystem("find . -name 'libicuuc.so.32.0' -exec ln -s {} libicuuc.so \\;");
psystem("find . -name 'libicuuc.so.32.0' -exec ln -s {} libicuuc.so.32 \\;");
psystem("find . -name 'libicuuc.sl.32.0' -exec ln -s {} libicuuc.sl \\;");
psystem("find . -name 'libicuuc.sl.32.0' -exec ln -s {} libicuuc.sl.32 \\;");
PeiYong Zhang
committed
}
PeiYong Zhang
committed
PeiYong Zhang
committed
my ($thefile, $Transcoder, $MsgLoader) = @_;
print "\nConverting Windows Xerces library project ($thefile) for ICU usage...";
my $thefiledotbak = $thefile . ".bak";
rename ($thefile, $thefiledotbak);
open (FIZZLE, $thefiledotbak);
open (FIZZLEOUT, ">$thefile");
while ($line = <FIZZLE>) {
Andy Heninger
committed
if ($line =~ /Win32 Debug/) {
$icuuc = "icuucd";
}
if ($line =~ /Win32 Release/) {
$icuuc = "icuuc";
}
$line =~ s[/D "PROJ_XMLPARSER"][/I "$ICUROOT\\include" /D "PROJ_XMLPARSER"];
$line =~ s[Debug/xerces-c_2D.lib"][Debug/xerces-c_2D.lib" /libpath:"$ICUROOT\\lib" /libpath:"$ICUROOT\\source\\data" /libpath:"$XERCESCROOT\\src\\xercesc\\util\\MsgLoaders\\ICU\\resources"];
$line =~ s[Release/xerces-c_2.lib"][Release/xerces-c_2.lib" /libpath:"$ICUROOT\\lib" /libpath:"$ICUROOT\\source\\data" /libpath:"$XERCESCROOT\\src\\xercesc\\util\\MsgLoaders\\ICU\\resources"];
PeiYong Zhang
committed
if ($MsgLoader)
$line =~ s/user32.lib/user32.lib $icuuc.lib XercesMessages2_6.lib/g;
PeiYong Zhang
committed
elsif ($Transcoder)
Alberto Massari
committed
$line =~ s/user32.lib/user32.lib $icuuc.lib/g;
PeiYong Zhang
committed
if ($Transcoder)
{
$line =~ s/XML_USE_WIN32_TRANSCODER/XML_USE_ICU_TRANSCODER/g;
$line =~ s/Transcoders\\Win32\\Win32TransService.cpp/Transcoders\\ICU\\ICUTransService.cpp/g;
$line =~ s/Transcoders\\Win32\\Win32TransService.hpp/Transcoders\\ICU\\ICUTransService.hpp/g;
PeiYong Zhang
committed
if ($MsgLoader)
{
$line =~ s/XML_USE_WIN32_MSGLOADER/XML_USE_ICU_MESSAGELOADER/g;
$line =~ s/MsgLoaders\\Win32\\Win32MsgLoader.cpp/MsgLoaders\\ICU\\ICUMsgLoader.cpp/g;
$line =~ s/MsgLoaders\\Win32\\Win32MsgLoader.hpp/MsgLoaders\\ICU\\ICUMsgLoader.hpp/g;
print FIZZLEOUT $line;
}
close (FIZZLEOUT);
close (FIZZLE);
unlink ($thefiledotbak);
sub change_windows_makefile_for_ICU() {
PeiYong Zhang
committed
my ($thefile, $Transcoder, $MsgLoader) = @_;
print "\nConverting Windows Xerces library makefile ($thefile) for ICU usage...";
my $thefiledotbak = $thefile . ".bak";
rename ($thefile, $thefiledotbak);
open (FIZZLE, $thefiledotbak);
open (FIZZLEOUT, ">$thefile");
while ($line = <FIZZLE>) {
if ($line =~ /Win64 Debug/ ){
$icuuc = "icuucd";
}
if ($line =~ /Win64 Release/ ) {
$icuuc = "icuuc";
}
$line =~ s[/D "PROJ_XMLPARSER"][/I "$ICUROOT\\include" /D "PROJ_XMLPARSER"];
$line =~ s[/machine:IA64][/libpath:"$ICUROOT\\lib" /libpath:"$ICUROOT\\source\\data" /libpath:"$XERCESCROOT\\src\\xercesc\\util\\MsgLoaders\\ICU\\resources" /machine:IA64];
PeiYong Zhang
committed
if ($MsgLoader)
$line =~ s/user32.lib/user32.lib $icuuc.lib XercesMessages2_6.lib/g;
PeiYong Zhang
committed
elsif ($Transcoder)
Alberto Massari
committed
$line =~ s/user32.lib/user32.lib $icuuc.lib/g;
PeiYong Zhang
committed
if ($Transcoder) {
PeiYong Zhang
committed
$line =~ s/XML_USE_WIN32_TRANSCODER/XML_USE_ICU_TRANSCODER/g;
$line =~ s/Transcoders\\Win32\\Win32TransService/Transcoders\\ICU\\ICUTransService/g;
$line =~ s/Win32TransService/ICUTransService/g;
}
PeiYong Zhang
committed
if ($MsgLoader)
PeiYong Zhang
committed
{
$line =~ s/XML_USE_WIN32_MSGLOADER/XML_USE_ICU_MESSAGELOADER/g;
$line =~ s/MsgLoaders\\Win32\\Win32MsgLoader/MsgLoaders\\ICU\\ICUMsgLoader/g;
PeiYong Zhang
committed
}
print FIZZLEOUT $line;
}
close (FIZZLEOUT);
close (FIZZLE);
unlink ($thefiledotbak);
}
sub change_windows_project_for_ICU_VC7() {
PeiYong Zhang
committed
my ($thefile, $Transcoder, $MsgLoader) = @_;
print "\nConverting Windows Xerces library project ($thefile) for ICU usage...";
my $thefiledotbak = $thefile . ".bak";
rename ($thefile, $thefiledotbak);
open (FIZZLE, $thefiledotbak);
open (FIZZLEOUT, ">$thefile");
while ($line = <FIZZLE>) {
if ($line =~ /Release\|Win32/) {
}
if ($line =~ /Debug\|Win32/) {
}
$line =~ s/AdditionalIncludeDirectories=\"([^"]*)/AdditionalIncludeDirectories=\"$ICUROOT\\include;$1/;
$line =~ s/AdditionalLibraryDirectories=\"([^"]*)/AdditionalLibraryDirectories=\"$ICUROOT\\lib;$ICUROOT\\source\\data;$XERCESCROOT\\src\\xercesc\\util\\MsgLoaders\\ICU\\resources;$1/;
PeiYong Zhang
committed
if ($MsgLoader)
$line =~ s/AdditionalDependencies=\"([^"]*)/AdditionalDependencies=\"$icuuc.lib XercesMessages2_6.lib $1/;
PeiYong Zhang
committed
elsif ($Transcoder)
Alberto Massari
committed
$line =~ s/AdditionalDependencies=\"([^"]*)/AdditionalDependencies=\"$icuuc.lib $1/;
PeiYong Zhang
committed
if ($Transcoder) {
$line =~ s/XML_USE_WIN32_TRANSCODER/XML_USE_ICU_TRANSCODER/g;
$line =~ s/Transcoders\\Win32\\Win32TransService.cpp/Transcoders\\ICU\\ICUTransService.cpp/g;
$line =~ s/Transcoders\\Win32\\Win32TransService.hpp/Transcoders\\ICU\\ICUTransService.hpp/g;
}
PeiYong Zhang
committed
if ($MsgLoader)
{
$line =~ s/XML_USE_WIN32_MSGLOADER/XML_USE_ICU_MESSAGELOADER/g;
$line =~ s/MsgLoaders\\Win32\\Win32MsgLoader/MsgLoaders\\ICU\\ICUMsgLoader/g;
$line =~ s/Win32MsgLoader/ICUMsgLoader/g;
}
print FIZZLEOUT $line;
}
close (FIZZLEOUT);
close (FIZZLE);
unlink ($thefiledotbak);
}
#
# This subroutine is used to munge the XercesLib project file to remove all
# traces of WinSock based NetAccessor. Once no NetAccessor is specified, the
# project file is configured for using the 'FileOnly' NetAccessor.
#
# For this function to work the assumption is that project file in CMVC is
# preconfigured to already use the WinSock based NetAccessor. So, the changes
# that need to be done are:
# - to remove references to any #defines
# - to remove references to wsock32.lib
# - to remove references to the source files for the WinSock based NetAccessor.
#
my ($thefile) = @_;
print "\nConfiguring Xerces library project ($thefile) for FileOnly NetAccessor...";
my $thefiledotbak = $thefile . ".bak";
rename ($thefile, $thefiledotbak);
open (PROJFILEIN, $thefiledotbak);
open (PROJFILEOUT, ">$thefile");
while ($aline = <PROJFILEIN>) {
# By skipping over lines between the NetAccessors group
# we can references to the WinSock based NetAccessor files.
if ($aline =~ m/^# Begin Group \"NetAccessors\"/g) {
# ...found it. Write out the line as a place holder. Also...
print PROJFILEOUT $aline;
# ...preserve the next two lines.
$aline = <PROJFILEIN>;
print PROJFILEOUT $aline;
$aline = <PROJFILEIN>;
print PROJFILEOUT $aline;
# Skip over the lines till you hit the WinSock NetAccessor 'End Group'.
while ($aline = <PROJFILEIN>) { # read the next line
last if ($aline =~ m/^# End Group/g);
}
# We need to preserve the 'End Group' line. The last statement of the
# enclosing while loop prints it out.
}
# From the remaining lines, remove any references to the #defines and
# the WinSock library.
$aline =~ s/\/D \"XML_USE_NETACCESSOR_WINSOCK\" //g; # "
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
if ($aline =~ /( )+ws2_32.lib( )*\"/) { # end of line
$aline =~ s/( )+ws2_32.lib( )*\"/\"/g;
} else { # beginning or middle of line
$aline =~ s/ws2_32.lib( )*//g;
}
print PROJFILEOUT $aline;
}
close (PROJFILEOUT);
close (PROJFILEIN);
unlink ($thefiledotbak);
}
sub changeWindowsProjectForFileOnlyNA_VC7() {
my ($thefile) = @_;
print "\nConfiguring Xerces library project ($thefile) for FileOnly NetAccessor...\n";
my $thefiledotbak = $thefile . ".bak";
rename ($thefile, $thefiledotbak);
open (PROJFILEIN, $thefiledotbak);
open (PROJFILEOUT, ">$thefile");
while ($aline = <PROJFILEIN>) {
# By skipping over lines between the NetAccessors group
# we can references to the WinSock based NetAccessor files.
if ($aline =~ m/^# Begin Group \"NetAccessors\"/g) {
# ...found it. Write out the line as a place holder. Also...
print PROJFILEOUT $aline;
# ...preserve the next two lines.
$aline = <PROJFILEIN>;
print PROJFILEOUT $aline;
$aline = <PROJFILEIN>;
print PROJFILEOUT $aline;
# Skip over the lines till you hit the WinSock NetAccessor 'End Group'.
while ($aline = <PROJFILEIN>) { # read the next line
last if ($aline =~ m/^# End Group/g);
}
# We need to preserve the 'End Group' line. The last statement of the
# enclosing while loop prints it out.
}
# From the remaining lines, remove any references to the #defines and
# the WinSock library.
if ($aline =~ /\;XML_USE_NETACCESSOR_WINSOCK/) { # end or middle of line
$aline =~ s/\;XML_USE_NETACCESSOR_WINSOCK//g;
} else { # beginning of line
$aline =~ s/\XML_USE_NETACCESSOR_WINSOCK\;*//g;
}
if ($aline =~ /\s+ws2_32\.lib\s*\"/) { # end of line
$aline =~ s/\s+ws2_32\.lib\s*\"/\"/g;
} else { # beginning or middle of line
$aline =~ s/ws2_32\.lib\s*//g;
}
print PROJFILEOUT $aline;
}
close (PROJFILEOUT);
close (PROJFILEIN);
unlink ($thefiledotbak);
}
PeiYong Zhang
committed
#
# psystem subroutine both prints and executes a system command.
#
sub psystem() {
print("$_[0]\n");
system($_[0]);
}
#
# chdir subroutine both prints and executes a chdir
#
sub pchdir() {
print("chdir $_[0]\n");
chdir $_[0];
}