Newer
Older
push(@INC, "/home/xml4c/bin", "/home/xml4c/bin/perl/perl-RUN/opt/perl5/lib", "/Development2/cupert/bin/perl/perl-RUN/opt/perl5/lib", "/Development/cupert/usr/local/perl/perl-RUN/opt/perl5/lib");
$|=1; # Force a flush after every print
# Extract the source and target directories
&Getopt('sopcxmntrb');
$targetdir = $opt_o;
# Check for the environment variables and exit if error
if (!length($XERCESCROOT) || !length($targetdir) || (length($opt_h) > 0) ) {
print ("Usage is: packageBinaries <options>\n");
print (" where options are:\n");
print (" -s <source_directory>\n");
print (" -o <target_directory>\n");
print (" -c <C compiler name> (e.g. gcc, cc or xlc_r)\n");
print (" -x <C++ compiler name> (e.g. g++, CC, aCC, c++, xlC_r, cl, ecl or ecc)\n");
print (" -m <message loader> can be 'inmem' \(default\), 'icu' or 'iconv'\n");
print (" -n <net accessor> can be 'fileonly' or 'socket' \(default\)\n");
print (" -t <transcoder> can be 'icu' or 'native' \(default\)\n");
print (" -r <thread option> can be 'pthread' \(default\)or 'dce' (only used on HP-11)\n");
print (" -b <bitsToBuild> (accepts '64', '32')\n");
print (" -j suppress building of ICU (speeds up builds when debugging)\n");
print (" -h to get help on these commands\n\n");
print ("Example: Under unix's\n");
print (" perl packageBinaries.pl -s \$HOME/xerces-c-src2_2_0");
print (" -o \$HOME/xerces-c_2_2_0-linux -c gcc -x g++ -m inmem -n fileonly -t native\n\n");
print (" perl packageBinaries.pl -s \\xerces-c-src2_2_0");
print (" -o\\xerces-c_2_2_0-win32 [-n fileonly] [-t icu]\n\n");
print ("Note:\n");
print (" Under Windows, by default the XercesLib project files is\n");
print (" configured to use Win32 resource file based message loader,\n");
print (" WinSocket based net accessor and native Win32 based transcoder.\n");
print (" The two options mentioned in the example above are the only\n");
print (" options relevant under Windows on the command line for this script.\n");
exit(-1);
# As of Version 3, ICU is not a required component of XERCES-C
print "You have not defined your ICU install directory.\n";
print "To build with ICU, you must set an environment variable called ICUROOT\n";
print "Proceeding to build XERCES-C without ICU...\n";
print ("The directory $XERCESCROOT does not exist. Cannot proceed any further.\n");
exit(-1);
}
# Check if the target directory exists, exit if it does
if (-e $targetdir) {
print ("Error: The target directory \'$targetdir\' already exists.\n");
print (" You must start with a clean directory to package your product.\n");
exit(1);
open(PLATFORM, "uname -s|");
$platform = <PLATFORM>;
chomp($platform);
close (PLATFORM);
#set platform variable if on windows 64bit
my $return_code = system( "ls" );
if ($return_code != 0)
{ $platform = "win64bit";
}
#Fix the backslashes on the Windows platform
{
$XERCESCROOT =~ s/\\/\//g;
$ICUROOT =~ s/\\/\//g;
$targetdir =~ s/\\/\//g;
}
print "Packaging binaries for \`" . $platform . "\` in " . $targetdir . " ...\n"; # "
#Construct the name of the zip file by extracting the last directory name
$zipfiles = $targetdir;
$zipfiles =~ s/.*(\/|\\)([\w-\.]*)$/$2/g;
$zipfiles = $zipfiles . "/*";
$buildmode = "Release"; # Universally, why do you want to package Debug builds anyway?
# OS: Windows XP
# Compiler: Intel's cl and/or ecl
# cygwin: Not Available
{
if ($opt_x ne "" && $opt_x ne "cl" && $opt_x ne "ecl")
{
print("Compiler on Itanium/WindowsXP must be \'cl\' or \'ecl\'\n");
if ($opt_x eq "")
{
$opt_x = 'cl';
}
$platformname = 'Win64'; # Needed this way by nmake
if (-e "$targetdir.zip") {
print ("Deleting old target file \'$targetdir.zip\' \n");
unlink("$targetdir.zip");
}
# Make the target directory and its main subdirectories
psystem ("mkdir $targetdir");
psystem ("mkdir $targetdir\\bin");
psystem ("mkdir $targetdir\\lib");
if ( $opt_m =~ m/icu/i ) {
psystem ("mkdir $targetdir\\msg");
}
psystem ("mkdir $targetdir\\etc");
psystem ("mkdir $targetdir\\include");
psystem ("mkdir $targetdir\\include\\xercesc");
psystem ("mkdir $targetdir\\samples");
psystem ("mkdir $targetdir\\samples\\Projects");
psystem ("mkdir $targetdir\\samples\\Projects\\Win32");
psystem ("mkdir $targetdir\\samples\\Projects\\Win32\\VC6");
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
psystem ("mkdir $targetdir\\samples\\data");
psystem ("mkdir $targetdir\\samples\\SAXCount");
psystem ("mkdir $targetdir\\samples\\SAX2Count");
psystem ("mkdir $targetdir\\samples\\SAXPrint");
psystem ("mkdir $targetdir\\samples\\SAX2Print");
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\\SEnumVal");
psystem ("mkdir $targetdir\\samples\\CreateDOMDocument");
psystem ("mkdir $targetdir\\doc");
psystem ("mkdir $targetdir\\doc\\html");
psystem ("mkdir $targetdir\\doc\\html\\apiDocs");
# If 'FileOnly' NetAccessor has been specified, then the project files have to be
# changed.
#REVISIT: we are make from makefile, not from *.dsp
# need to look at it later
if ($opt_n =~ m/fileonly/i) {
changeWindowsProjectForFileOnlyNA("$XERCESCROOT/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp");
}
#
# ICU Build happens here, if one is required.
#
#REVISIT: icu
#
if (($opt_t =~ m/icu/i || $opt_m =~ m/icu/i) && length($ICUROOT) > 0) {
PeiYong Zhang
committed
print ("Building ICU from $ICUROOT ...\n");
#Clean up all the dependency files, causes problems for nmake
pchdir ("$ICUROOT");
psystem ("del /s /f *.dep *.ncb *.plg *.opt");
# Make the icu dlls
pchdir ("$ICUROOT\\source\\allinone\\all");
if (!(length($opt_j) > 0)) { # Optionally suppress ICU build, to speed up overlong builds while debugging.
#For XP we ship both release and debug dlls
psystem("nmake -f all_win64_release.mak \"CFG=all - $platformname Release\" CPP=$opt_x.exe >buildlog.txt 2>&1");
psystem("type buildlog.txt");
psystem("nmake -f all_win64_debug.mak \"CFG=all - $platformname Debug\" CPP=$opt_x.exe >buildlog.txt 2>&1");
psystem("type buildlog.txt");
}
PeiYong Zhang
committed
$transcoder = 0;
if ($opt_t =~ m/icu/i )
{
$transcoder = 1;
}
PeiYong Zhang
committed
{
$msgloader = 1;
}
PeiYong Zhang
committed
change_windows_makefile_for_ICU("$XERCESCROOT\\Projects\\Win32\\VC6\\xerces-all/XercesLib/XercesLib.mak", $transcoder, $msgloader);
Loading
Loading full blame...