Newer
Older
PeiYong Zhang
committed
util
util/AtomicOpManagers
PeiYong Zhang
committed
util/MsgLoaders
util/MsgLoaders/ICU
util/MsgLoaders/InMemory
util/MsgLoaders/MsgCatalog
util/MsgLoaders/Win32
util/FileManagers
util/MutexManagers
util/NetAccessors
util/NetAccessors/Curl
util/NetAccessors/libWWW
util/NetAccessors/MacOSURLAccess
util/NetAccessors/MacOSURLAccessCF
util/NetAccessors/Socket
util/NetAccessors/WinSock
PeiYong Zhang
committed
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
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.
#
David Abram Cargill
committed
psystem ("rm -rf $targetdir/include/xercesc/dom/impl");
PeiYong Zhang
committed
}
sub populateSamples() {
print ("\n\nCopying sample files ...\n");
psystem("cp $XERCESCROOT/samples/.libs/* $targetdir/bin");
psystem("cp $XERCESCROOT/tests/.libs/* $targetdir/bin");
foreach $iii ('SAXCount', 'SAX2Count', 'SAXPrint', 'SAX2Print', 'DOMCount',
'DOMPrint', 'Redirect', 'MemParse', 'PParse', 'StdInParse',
'EnumVal', 'SEnumVal', 'CreateDOMDocument', 'PSVIWriter', 'SCMPrint')
{
psystem("cp -Rf $XERCESCROOT/samples/src/$iii/* $targetdir/samples/$iii");
psystem("rm -f $targetdir/samples/$iii/*.o");
}
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 "XERCES_BUILDING_LIBRARY"][/I "$ICUROOT\\include" /D "XERCES_BUILDING_LIBRARY"];
$line =~ s[Debug/xerces-c_3D.lib"][Debug/xerces-c_3D.lib" /libpath:"$ICUROOT\\lib" /libpath:"$ICUROOT\\source\\data" /libpath:"$XERCESCROOT\\src\\xercesc\\util\\MsgLoaders\\ICU\\resources"];
$line =~ s[Release/xerces-c_3.lib"][Release/xerces-c_3.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 XercesMessages3_0.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/XERCES_USE_TRANSCODER_WINDOWS/XERCES_USE_TRANSCODER_ICU/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/XERCES_USE_WIN32_MSGLOADER/XERCES_USE_MSGLOADER_ICU/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 "XERCES_BUILDING_LIBRARY"][/I "$ICUROOT\\include" /D "XERCES_BUILDING_LIBRARY"];
$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 XercesMessages3_0.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/XERCES_USE_TRANSCODER_WINDOWS/XERCES_USE_TRANSCODER_ICU/g;
PeiYong Zhang
committed
$line =~ s/Transcoders\\Win32\\Win32TransService/Transcoders\\ICU\\ICUTransService/g;
$line =~ s/Win32TransService/ICUTransService/g;
}
PeiYong Zhang
committed
if ($MsgLoader)
PeiYong Zhang
committed
{
$line =~ s/XERCES_USE_WIN32_MSGLOADER/XERCES_USE_MSGLOADER_ICU/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_or_VC8() {
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 XercesMessages3_0.lib $1/;
PeiYong Zhang
committed
elsif ($Transcoder)
Alberto Massari
committed
$line =~ s/AdditionalDependencies=\"([^"]*)/AdditionalDependencies=\"$icuuc.lib $1/;
PeiYong Zhang
committed
if ($Transcoder) {
$line =~ s/XERCES_USE_TRANSCODER_WINDOWS/XERCES_USE_TRANSCODER_ICU/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/XERCES_USE_WIN32_MSGLOADER/XERCES_USE_MSGLOADER_ICU/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 \"XERCES_USE_NETACCESSOR_WINSOCK\" //g; # "
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_or_VC8() {
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
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 =~ /\;XERCES_USE_NETACCESSOR_WINSOCK/) { # end or middle of line
$aline =~ s/\;XERCES_USE_NETACCESSOR_WINSOCK//g;
} else { # beginning of line
$aline =~ s/\XERCES_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];