Below is a script I wrote that patches in support for the Sun WorkShop
5.0 compiler
on the Xerces-C 1.1.0 source tree.
This script does the following:
Removes NO_NATIVE_BOOL. (Sun WorkShop 5.0 now has native bool
support.)
Makes various changes to support the external template instance
placement and linkage method.
Removes -lC parameter to the linker. Explicitly specifying it
confuses WorkShop.
Adds -mt as a parameter to the compiler and linker when
compiling the samples. This is already set up correctly
in the src directory.
In order to support the external template instance method, Makefile.incl
had to be changed.
Make now directs the compiler to output its object files to
$XERCESCROOT/obj
rather than creating them in the current directory followed by a copy to
$XERCESCROOT/obj.
This is needed to ensure that the template repository is created
properly.
Note: Because object files are directly compiled into $XERCESCROOT you
will see
the following sorts of error messages during the make:
cp: cannot access BinFileInputStream.o
cp: cannot access BinInputStream.o
cp: cannot access BinMemInputStream.o
.
.
.
They can be safely ignored.
I would be willing to be spend some more time to get Xerces-C compiling
out of the box
under the Sun WorkShop 5.0 compiler.
Any questions,
-Eric Yankowitz
[EMAIL PROTECTED]
To run the script modify the "export SRCROOT=....." and "export
PACKAGE=......"
lines WITHIN the script and ensure that your path points to gnu make,
gnu autoconf,
and gnu m4 ahead of any other versions.
#! /bin/ksh
export SRCROOT=/home/statemnt/libs/xerces
export PACKAGE=/home/statemnt/pack/cpp/xml/xerces-csrc_1_1_0_d05.tar.gz
export XERCESCROOT=$SRCROOT/xerces-csrc_1_1_0_d05
cd $SRCROOT
echo "Attempting to remove any previous installations @ $XERCESCROOT"
echo
rm -rf $XERCESCROOT
echo "Unpacking $PACKAGE"
echo
gzip -dc $PACKAGE | tar xvf -
cd $XERCESCROOT/src
echo "Running: autoconf"
echo
autoconf
echo "Configuring the source tree"
echo
./runConfigure -psolaris -ccc -xCC -d -nfileonly -rpthread
echo "Patching up files for WorkShop Compilers 5.0 98/12/15 C++ 5.0"
echo
echo "Sun WorkShop 5.0 Compiler supports native bools."
echo "Removing NO_NATIVE_BOOL define."
echo
mv util/Compilers/SunCCDefs.hpp util/Compilers/SunCCDefs.hpp.orig
sed -e "s/^#define NO_NATIVE_BOOL$//" util/Compilers/SunCCDefs.hpp.orig
>
util/Compilers/SunCCDefs.hpp
echo "External template instance placement and linkage is prefered, so I
am"
echo "defining XML4C_TMPLSINC."
echo
echo "#define XML4C_TMPLSINC" >> util/Compilers/SunCCDefs.hpp
echo "Patching Makefile.incl for external template instance support."
echo "To ensure creating a correct template repository, Object files"
echo "will now be directly outputed to $XERCESCROOT/obj."
echo "Also, The -lC option is redundant and causes problems, so I am
removing it."
echo
mv Makefile.incl Makefile.incl.orig
sed -e "186s/-lC -lc//" -e "189s/-lC -lc//" \
-e "180s/-instances=static//" \
-e "424s/[EMAIL PROTECTED]/$\(ALL_OBJECTS_DIR\)\/$\(@F\)/" \
-e "430s/[EMAIL PROTECTED]/$\(ALL_OBJECTS_DIR\)\/$\(@F\)/" \
-e "432s/[EMAIL PROTECTED]/$\(ALL_OBJECTS_DIR\)\/$\(@F\)/" \
Makefile.incl.orig > Makefile.incl
make
cd ../samples
echo "Removing -lC from the samples/runConfigure"
echo
mv ./runConfigure ./runConfigure.orig
sed -e"247d" ./runConfigure.orig > ./runConfigure
chmod +x ./runConfigure
echo "Setting/Removing the following in samples/Makefile.incl:"
echo " Removing -lC"
echo " Setting external template instances"
echo " Setting multi-threading"
echo
mv Makefile.incl Makefile.incl.orig
sed -e "129s/-lC -lc//" \
-e "126s/-instances=static//" \
-e "126,127s/$/ -mt/" \
Makefile.incl.orig > Makefile.incl
./runConfigure -psolaris -ccc -xCC -d
make