Newer
Older
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
psystem ("mkdir $targetdir/include/xercesc/sax2");
psystem ("mkdir $targetdir/include/xercesc/framework");
psystem ("mkdir $targetdir/include/xercesc/internal");
psystem ("mkdir $targetdir/include/xercesc/parsers");
psystem ("mkdir $targetdir/include/xercesc/util");
psystem ("mkdir $targetdir/include/xercesc/util/Compilers");
psystem ("mkdir $targetdir/include/xercesc/util/MsgLoaders");
psystem ("mkdir $targetdir/include/xercesc/util/MsgLoaders/ICU");
psystem ("mkdir $targetdir/include/xercesc/util/MsgLoaders/InMemory");
psystem ("mkdir $targetdir/include/xercesc/util/MsgLoaders/MsgCatalog");
psystem ("mkdir $targetdir/include/xercesc/util/MsgLoaders/Win32");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/AIX");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/HPUX");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/Linux");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/MacOS");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/OS2");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/OS390");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/PTX");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/Solaris");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/Tandem");
psystem ("mkdir $targetdir/include/xercesc/util/Platforms/Win32");
psystem ("mkdir $targetdir/include/xercesc/util/regx");
psystem ("mkdir $targetdir/include/xercesc/util/Transcoders");
psystem ("mkdir $targetdir/include/xercesc/util/Transcoders/ICU");
psystem ("mkdir $targetdir/include/xercesc/util/Transcoders/Iconv");
psystem ("mkdir $targetdir/include/xercesc/util/Transcoders/Win32");
psystem ("mkdir $targetdir/include/xercesc/dom");
psystem ("mkdir $targetdir/include/xercesc/dom/impl");
psystem ("mkdir $targetdir/include/xercesc/dom/deprecated");
psystem ("mkdir $targetdir/include/xercesc/validators");
psystem ("mkdir $targetdir/include/xercesc/validators/common");
psystem ("mkdir $targetdir/include/xercesc/validators/datatype");
psystem ("mkdir $targetdir/include/xercesc/validators/DTD");
psystem ("mkdir $targetdir/include/xercesc/validators/schema");
psystem ("mkdir $targetdir/include/xercesc/validators/schema/identity");
psystem ("mkdir $targetdir/samples");
psystem ("mkdir $targetdir/samples/data");
psystem ("mkdir $targetdir/samples/SAXCount");
psystem ("mkdir $targetdir/samples/SAX2Count");
psystem ("mkdir $targetdir/samples/SAXPrint");
psystem ("mkdir $targetdir/samples/DOMCount");
psystem ("mkdir $targetdir/samples/DOMPrint");
psystem ("mkdir $targetdir/samples/Redirect");
psystem ("mkdir $targetdir/samples/MemParse");
psystem ("mkdir $targetdir/samples/PParse");
psystem ("mkdir $targetdir/samples/StdInParse");
psystem ("mkdir $targetdir/samples/EnumVal");
psystem ("mkdir $targetdir/samples/CreateDOMDocument");
psystem ("mkdir $targetdir/doc");
psystem ("mkdir $targetdir/doc/html");
psystem ("mkdir $targetdir/doc/html/apiDocs");
if (($opt_t =~ m/icu/i || $opt_m =~ m/icu/i) && !(length($opt_j) > 0))
if(length($ICUROOT) == 0) {
print("Error, ICUROOT not set, can not build ICU\n");
exit(-1);
}
# First make the ICU files executable
pchdir ("$ICUROOT/source");
psystem ("chmod +x configure config.*");
psystem ("chmod +x install-sh");
$ENV{'ICU_DATA'} = "$ICUROOT/data";
psystem ("chmod +x runConfigureICU");
psystem ("./runConfigureICU PTX");
psystem ("CC=$opt_c CXX=$opt_x CXXFLAGS=$icu_cxxflags CFLAGS=$icu_cflags configure --prefix=$ICUROOT --disable-64bit-libs");
psystem ("CC=$opt_c CXX=$opt_x CXXFLAGS=$icu_cxxflags CFLAGS=$icu_cflags configure --prefix=$ICUROOT");
psystem ("$MAKE clean"); # Clean up the build, may want to comment this line out!
psystem ("rm -f $ICUROOT/data/*.o"); # make clean is not enough
psystem ("rm -f $ICUROOT/data/*.c"); # same for .c files
psystem ("$MAKE"); # This will take a long time!
psystem ("$MAKE install"); # Make this separate since this breaks on Solaris
# Please check if the following needs any change in Version 1.5
# For the antiquated CC compiler under HPUX, we need to invoke
# make one extra time to generate the .cnv files.
# if ( ($platform =~ m/hp-/i) && ($opt_x eq 'CC') ) {
# For ptx, ICUROOT must now be set to XMLINSTALL for further work.
if ($platform =~ m/ptx/i) {
$ENV{'ICUROOT'} = $ENV{'XMLINSTALL'};
}
# make the source files
print("\n\nBuild the xerces-c library ...\n");
psystem ("chmod +x run* con* install-sh");
psystem ("./runConfigure -p$platform -c$opt_c -x$opt_x -m$opt_m -n$opt_n -t$opt_t -r$opt_r -b$opt_b");
psystem ("./runConfigure -p$platform -c$opt_c -x$opt_x -m$opt_m -n$opt_n -t$opt_t -b$opt_b");
psystem ("$MAKE clean"); # May want to comment this line out to speed up
psystem ("$MAKE");
# Move ICU libs into lib dir, so samples will link. This matches the structure of
# the eventual binary packaging, even though we are doing it in the build directory.
#
if (length($ICUROOT) > 0) {
Tinny Ng
committed
pchdir ("$XERCESCROOT/lib");
# on AIX, it is called libicudata24.0.so
# on Solaris/Linux, it is called libicudata.so.24.0
# on HP, it is called libicudata.s1.24.0
Tinny Ng
committed
psystem("rm -f libicudata*");
psystem("cp -f $ICUROOT/lib/libicudata24.0.so .");
psystem("cp -f $ICUROOT/lib/libicudata.so.24.0 .");
psystem("cp -f $ICUROOT/lib/libicudata.sl.24.0 .");
psystem("find . -name 'libicudata24.0.so' -exec ln -s {} libicudata.so \\;");
psystem("find . -name 'libicudata24.0.so' -exec ln -s {} libicudata24.so \\;");
psystem("find . -name 'libicudata.so.24.0' -exec ln -s {} libicudata.so \\;");
psystem("find . -name 'libicudata.so.24.0' -exec ln -s {} libicudata.so.24 \\;");
psystem("find . -name 'libicudata.sl.24.0' -exec ln -s {} libicudata.sl \\;");
psystem("find . -name 'libicudata.sl.24.0' -exec ln -s {} libicudata.sl.24 \\;");
Tinny Ng
committed
# on AIX, it is called libicuuc24.0.so
# on Solaris/Linux, it is called libicuuc.so.24.0
# on HP, it is called libicuuc.sl.24.0
psystem("cp -f $ICUROOT/lib/libicuuc24.0.so .");
psystem("cp -f $ICUROOT/lib/libicuuc.so.24.0 .");
psystem("cp -f $ICUROOT/lib/libicuuc.sl.24.0 .");
psystem("find . -name 'libicuuc24.0.so' -exec ln -s {} libicuuc.so \\;");
psystem("find . -name 'libicuuc24.0.so' -exec ln -s {} libicuuc24.so \\;");
psystem("find . -name 'libicuuc.so.24.0' -exec ln -s {} libicuuc.so \\;");
psystem("find . -name 'libicuuc.so.24.0' -exec ln -s {} libicuuc.so.24 \\;");
psystem("find . -name 'libicuuc.sl.24.0' -exec ln -s {} libicuuc.sl \\;");
psystem("find . -name 'libicuuc.sl.24.0' -exec ln -s {} libicuuc.sl.24 \\;");
# Now build the samples
print("\n\nBuild the samples ...\n");
pchdir ("$XERCESCROOT/samples");
psystem ("chmod +x run* con* install-sh");
psystem ("./runConfigure -p$platform -c$opt_c -x$opt_x -b$opt_b");
psystem ("$MAKE clean"); # May want to comment this line out to speed up
psystem ("$MAKE");
# Next build the tests
print("\n\nBuild the tests ...\n");
pchdir ("$XERCESCROOT/tests");
psystem ("chmod +x run* con* install-sh");
psystem ("./runConfigure -p$platform -c$opt_c -x$opt_x -b$opt_b");
psystem ("$MAKE clean"); # May want to comment this line out to speed up
psystem ("$MAKE");
pchdir ($targetdir);
# Populate the include output directory
print ("\n\nCopying headers files ...\n");
psystem("cp -Rf $XERCESCROOT/src/xercesc/sax/*.hpp $targetdir/include/xercesc/sax");
psystem("cp -Rf $XERCESCROOT/src/xercesc/sax2/*.hpp $targetdir/include/xercesc/sax2");
psystem("cp -Rf $XERCESCROOT/src/xercesc/framework/*.hpp $targetdir/include/xercesc/framework");
psystem("cp -Rf $XERCESCROOT/src/xercesc/dom/*.hpp $targetdir/include/xercesc/dom");
psystem("cp -Rf $XERCESCROOT/src/xercesc/dom/deprecated/*.hpp $targetdir/include/xercesc/dom/deprecated");
psystem("cp -Rf $XERCESCROOT/version.incl $targetdir");
psystem("rm -rf $targetdir/include/xercesc/dom/impl");
psystem("rm $targetdir/include/xercesc/dom/deprecated/*Impl.hpp");
psystem("rm $targetdir/include/xercesc/dom/deprecated/DS*.hpp");
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
psystem("cp -Rf $XERCESCROOT/src/xercesc/internal/*.hpp $targetdir/include/xercesc/internal");
psystem("cp -Rf $XERCESCROOT/src/xercesc/internal/*.c $targetdir/include/xercesc/internal");
psystem("cp -Rf $XERCESCROOT/src/xercesc/parsers/*.hpp $targetdir/include/xercesc/parsers");
psystem("cp -Rf $XERCESCROOT/src/xercesc/parsers/*.c $targetdir/include/xercesc/parsers");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/*.hpp $targetdir/include/xercesc/util");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/*.c $targetdir/include/xercesc/util");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Compilers/*.hpp $targetdir/include/xercesc/util/Compilers");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/MsgLoaders/*.hpp $targetdir/include/xercesc/util/MsgLoaders");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/MsgLoaders/ICU/*.hpp $targetdir/include/xercesc/util/MsgLoaders/ICU");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/MsgLoaders/InMemory/*.hpp $targetdir/include/xercesc/util/MsgLoaders/InMemory");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/MsgLoaders/MsgCatalog/*.hpp $targetdir/include/xercesc/util/MsgLoaders/MsgCatalog");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/MsgLoaders/Win32/*.hpp $targetdir/include/xercesc/util/MsgLoaders/Win32");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/*.hpp $targetdir/include/xercesc/util/Platforms");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/AIX/*.hpp $targetdir/include/xercesc/util/Platforms/AIX");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/HPUX/*.hpp $targetdir/include/xercesc/util/Platforms/HPUX");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/Linux/*.hpp $targetdir/include/xercesc/util/Platforms/Linux");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/MacOS/*.hpp $targetdir/include/xercesc/util/Platforms/MacOS");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/OS2/*.hpp $targetdir/include/xercesc/util/Platforms/OS2");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/OS390/*.hpp $targetdir/include/xercesc/util/Platforms/OS390");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/PTX/*.hpp $targetdir/include/xercesc/util/Platforms/PTX");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/Solaris/*.hpp $targetdir/include/xercesc/util/Platforms/Solaris");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/Tandem/*.hpp $targetdir/include/xercesc/util/Platforms/Tandem");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Platforms/Win32/*.hpp $targetdir/include/xercesc/util/Platforms/Win32");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/regx/*.hpp $targetdir/include/xercesc/util/regx");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Transcoders/*.hpp $targetdir/include/xercesc/util/Transcoders");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Transcoders/ICU/*.hpp $targetdir/include/xercesc/util/Transcoders/ICU");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Transcoders/Iconv/*.hpp $targetdir/include/xercesc/util/Transcoders/Iconv");
psystem("cp -Rf $XERCESCROOT/src/xercesc/util/Transcoders/Win32/*.hpp $targetdir/include/xercesc/util/Transcoders/Win32");
psystem("cp -Rf $XERCESCROOT/src/xercesc/validators/common/*.hpp $targetdir/include/xercesc/validators/common");
psystem("cp -Rf $XERCESCROOT/src/xercesc/validators/datatype/*.hpp $targetdir/include/xercesc/validators/datatype");
psystem("cp -Rf $XERCESCROOT/src/xercesc/validators/DTD/*.hpp $targetdir/include/xercesc/validators/DTD");
psystem("cp -Rf $XERCESCROOT/src/xercesc/validators/schema/*.hpp $targetdir/include/xercesc/validators/schema");
psystem("cp -Rf $XERCESCROOT/src/xercesc/validators/schema/identity/*.hpp $targetdir/include/xercesc/validators/schema/identity");
print "\nICU files are being copied from \'$ICUROOT\'";
psystem("cp -Rf $ICUROOT/include/* $targetdir/include");
# Populate the binary output directory
print ("\n\nCopying binary outputs ...\n");
psystem("cp -Rf $XERCESCROOT/bin/* $targetdir/bin");
Tinny Ng
committed
psystem("rm -rf $targetdir/bin/obj");
Tinny Ng
committed
# Populate the library output directory
print ("\n\nCopying library outputs ...\n");
if ((-e "$XERCESCROOT/lib/libxerces-c.so.23.0" )) {
psystem("cp -f $XERCESCROOT/lib/libxerces-c.so.23.0 .");
psystem("ln -s libxerces-c.so.23.0 libxerces-c.so.23 ");
psystem("ln -s libxerces-c.so.23 libxerces-c.so ");
if ((-e "$XERCESCROOT/lib/libxerces-c.sl.23.0" )) {
psystem("cp -f $XERCESCROOT/lib/libxerces-c.sl.23.0 .");
psystem("ln -s libxerces-c.sl.23.0 libxerces-c.sl.23 ");
psystem("ln -s libxerces-c.sl.23 libxerces-c.sl ");
if ((-e "$XERCESCROOT/lib/libxerces-c23.0.so" )) {
psystem("cp -f $XERCESCROOT/lib/libxerces-c23.0.so .");
psystem("ln -s libxerces-c23.0.so libxerces-c23.so ");
psystem("ln -s libxerces-c23.so libxerces-c.so ");
if ((-e "$XERCESCROOT/lib/libxerces-c.23.0.dylib" )) {
psystem("cp -f $XERCESCROOT/lib/libxerces-c.23.0.dylib .");
psystem("ln -s libxerces-c.23.0.dylib libxerces-c.23.dylib ");
psystem("ln -s libxerces-c.23.dylib libxerces-c.dylib ");
# Populate the Message Catalog Files
if ( $opt_m =~ m/iconv/i ) {
print ("\n\nCopying Message Catalog Files ...\n");
pchdir ("$targetdir/msg");
psystem("rm -f XercesMessages* ");
psystem("cp -f $XERCESCROOT/msg/XercesMessages*.cat .");
}
Tinny Ng
committed
#
# Create symbolic link for those ICU libraries
#
if (length($ICUROOT) > 0) {
pchdir ("$targetdir/lib");
# on AIX, it is called libicudata24.0.so
# on Solaris/Linux, it is called libicudata.so.24.0
# on HP, it is called libicudata.s1.24.0
Tinny Ng
committed
psystem("rm -f libicudata*");
psystem("cp -f $XERCESCROOT/lib/libicudata24.0.so .");
psystem("cp -f $XERCESCROOT/lib/libicudata.so.24.0 .");
psystem("cp -f $XERCESCROOT/lib/libicudata.sl.24.0 .");
psystem("find . -name 'libicudata24.0.so' -exec ln -s {} libicudata.so \\;");
psystem("find . -name 'libicudata24.0.so' -exec ln -s {} libicudata24.so \\;");
psystem("find . -name 'libicudata.so.24.0' -exec ln -s {} libicudata.so \\;");
psystem("find . -name 'libicudata.so.24.0' -exec ln -s {} libicudata.so.24 \\;");
psystem("find . -name 'libicudata.sl.24.0' -exec ln -s {} libicudata.sl \\;");
psystem("find . -name 'libicudata.sl.24.0' -exec ln -s {} libicudata.sl.24 \\;");
Tinny Ng
committed
# on AIX, it is called libicuuc24.0.so
# on Solaris/Linux, it is called libicuuc.so.24.0
# on HP, it is called libicuuc.sl.24.0
psystem("cp -f $XERCESCROOT/lib/libicuuc24.0.so .");
psystem("cp -f $XERCESCROOT/lib/libicuuc.so.24.0 .");
psystem("cp -f $XERCESCROOT/lib/libicuuc.sl.24.0 .");
psystem("find . -name 'libicuuc24.0.so' -exec ln -s {} libicuuc.so \\;");
psystem("find . -name 'libicuuc24.0.so' -exec ln -s {} libicuuc24.so \\;");
psystem("find . -name 'libicuuc.so.24.0' -exec ln -s {} libicuuc.so \\;");
psystem("find . -name 'libicuuc.so.24.0' -exec ln -s {} libicuuc.so.24 \\;");
psystem("find . -name 'libicuuc.sl.24.0' -exec ln -s {} libicuuc.sl \\;");
psystem("find . -name 'libicuuc.sl.24.0' -exec ln -s {} libicuuc.sl.24 \\;");
# Copy the Resouce Bundle for ICUMsgLoader
if ( $opt_m =~ m/icu/i) {
print ("\n\nCopying ICU message bundles ...\n");
psystem("cp -f $XERCESCROOT/msg/XercesMessages*.res $targetdir/msg");
psystem("cp -f $XERCESCROOT/lib/libXercesMessages23.0.so .");
psystem("find . -name 'libXercesMessages23.0.so' -exec ln -s {} libXercesMessages23.so \\;");
psystem("find . -name 'libXercesMessages23.so' -exec ln -s {} libXercesMessages.so \\;");
psystem("cp -f $XERCESCROOT/lib/libXercesMessages.so.23.0 .");
psystem("find . -name 'libXercesMessages.so.23.0' -exec ln -s {} libXercesMessages.so.23 \\;");
psystem("find . -name 'libXercesMessages.so.23' -exec ln -s {} libXercesMessages.so \\;");
psystem("cp -f $XERCESCROOT/lib/libXercesMessages.sl.23.0 .");
psystem("find . -name 'libXercesMessages.sl.23.0' -exec ln -s {} libXercesMessages.sl.23 \\;");
psystem("find . -name 'libXercesMessages.sl.23' -exec ln -s {} libXercesMessages.sl \\;");
Tinny Ng
committed
}
# Populate the etc output directory like config.status and the map file
print ("\n\nCopying misc output to etc ...\n");
psystem("cp -Rf $XERCESCROOT/src/xercesc/config.status $targetdir/etc");
psystem("cp -Rf $XERCESCROOT/obj/*.map $targetdir/etc");
# Populate the samples directory
print ("\n\nCopying sample files ...\n");
foreach $iii ('config.guess', 'config.h.in', 'config.sub', 'configure', 'configure.in',
'install-sh', 'runConfigure', 'Makefile.in', 'Makefile.incl', 'Makefile') {
psystem("cp -f $XERCESCROOT/samples/$iii $targetdir/samples");
psystem("cp -Rf $XERCESCROOT/samples/data/* $targetdir/samples/data");
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("rm -f $targetdir/samples/SEnumVal/Makefile");
psystem("cp -Rf $XERCESCROOT/samples/CreateDOMDocument/* $targetdir/samples/CreateDOMDocument");
psystem("rm -f $targetdir/samples/CreateDOMDocument/Makefile");
psystem("rm -f $targetdir/samples/Makefile");
print ("\n\nCopying documentation ...\n");
psystem("cp -Rf $XERCESCROOT/doc/* $targetdir/doc");
psystem("cp $XERCESCROOT/Readme.html $targetdir");
psystem("cp $XERCESCROOT/credits.txt $targetdir");
psystem("cp $XERCESCROOT/LICENSE.txt $targetdir");
psystem("cp $XERCESCROOT/license.html $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");
# Change the directory permissions
psystem ("chmod 644 `find $targetdir -type f`");
Tinny Ng
committed
psystem ("chmod 755 $targetdir/bin/* $targetdir/lib/*");
psystem ("chmod +x $targetdir/samples/runConfigure $targetdir/samples/configure $targetdir/samples/install-sh");
psystem ("chmod +x $targetdir/samples/config.sub $targetdir/samples/config.guess $targetdir/samples/config.status");
psystem ("chmod 755 `find $targetdir -type d`");
# Now package it all up using tar
print ("\n\nTARing up all files ...\n");
pchdir ("$targetdir/..");
$zipname = $targetdir . ".tar";
$platformzipname = $zipname;
psystem ("$TAR -cvf $platformzipname $zipfiles");
# Finally compress the files
print ("Compressing $platformzipname ...\n");
psystem ("gzip $platformzipname");
# 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];
}
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"];
$line =~ s/user32.lib/user32.lib $icuuc.lib icudata.lib XercesMessages2_3_0.lib/g;
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;
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];
$line =~ s/user32.lib/user32.lib $icuuc.lib icudata.lib XercesMessages2_3_0.lib/g;
PeiYong Zhang
committed
if ($transcoder) {
$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)
{
$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() {
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/;
$line =~ s/AdditionalDependencies=\"([^"]*)/AdditionalDependencies=\"$icuuc.lib icudata.lib XercesMessages2_3_0.lib $1/;
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
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;
}
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; # "
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
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);
}