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
$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 or ecl)\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-src_2_0_0");
print (" -o \$HOME/xerces-c_2_0_0-linux -c gcc -x g++ -m inmem -n fileonly -t native\n\n");
print (" perl packageBinaries.pl -s \\xerces-c-src_2_0_0");
print (" -o\\xerces-c_2_0_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);
#Fix the backslashes on the Windows platform
if ($platform ne "")
{
$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;
Tinny Ng
committed
$zipfiles =~ s/.*\/([\w-\.]*)$/$1/g;
$zipfiles = $zipfiles . "/*";
$buildmode = "Release"; # Universally, why do you want to package Debug builds anyway?
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
#
# Itanium platform builds happen here ...
#
if ($platform eq "" )
{
if ($opt_x ne "" && $opt_x ne "cl" && $opt_x ne "ecl")
{
print("Compiler on Itanium must be \'cl\' or \'ecl\'\n");
exit(-1);
}
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");
psystem ("mkdir $targetdir\\etc");
psystem ("mkdir $targetdir\\include");
psystem ("mkdir $targetdir\\include\\xercesc");
psystem ("mkdir $targetdir\\samples");
psystem ("mkdir $targetdir\\samples\\Projects");
#REVISIT: to change to /Win64 if necessary
psystem ("mkdir $targetdir\\samples\\Projects\\Win32");
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 && length($ICUROOT) > 0) {
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");
if (!$opt_j) { # Optionally suppress ICU build, to speed up overlong builds while debugging.
#For nt we ship both debug and release dlls
psystem("msdev allinone.dsw /MAKE \"all - $platformname Release\" /REBUILD /OUT buildlog.txt");
psystem("type buildlog.txt");
psystem("msdev allinone.dsw /MAKE \"all - $platformname Debug\" /REBUILD /OUT buildlog.txt");
psystem("type buildlog.txt");
}
change_windows_project_for_ICU("$XERCESCROOT/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp");
}
# Clean up all the dependency files, causes problems for nmake
# Also clean up all MSVC-generated project files that just cache the IDE state
pchdir ("$XERCESCROOT");
psystem ("del /s /f *.dep *.ncb *.plg *.opt");
# Make all files in the Xerces-C system including libraries, samples and tests
pchdir ("$XERCESCROOT\\Projects\\Win64\\Nmake\\xerces-all\\all");
psystem( "nmake -f all.mak \"CFG=all - $platformname Release\" CPP=$opt_x.exe >buildlog.txt 2>&1");
system("type buildlog.txt");
pchdir ("$XERCESCROOT\\Projects\\Win64\\Nmake\\xerces-all\\XercesLib");
psystem("nmake -f XercesLib.mak \"CFG=XercesLib - $platformname Debug\" CPP=$opt_x.exe > buildlog.txt 2>&1 ");
system("type buildlog.txt");
# Decide where you want the build copied from
pchdir ($targetdir);
$BUILDDIR = $XERCESCROOT . "\\Build\\Win64\\Nmake\\" . $buildmode;
print "\nBuild is being copied from \'" . $BUILDDIR . "\'";
# Populate the include output directory
print ("\n\nCopying headers files ...\n");
@headerDirectories =
qw'sax
Loading
Loading full blame...