#!/bin/bash
#
touch env.h
soapcpp2 -penv env.h
#wsdl2h -ninterswitch -Ninterswitch -qinterswitch -o QuickTellerService.h https://stageserv.interswitchng.com/uat_quicktellerservice/quickteller.svc?wsdl
#soapcpp2 -n -pinterswitch -qinterswitch -1 -C -i -I/usr/share/gsoap/import/ QuickTellerService.h
LIST="XmlElements.cc XmlParser.cc sha512.cc safestring.cc vars.cc"
echo "*** Compiling SOAP Proxy ***"
for i in $LIST
do
    echo "*** Building $i"
    g++ -DTEST -Wno-deprecated -I../../include -I../../core -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -c ../../core/$i -o `echo $i|sed 's/.cc/.o/'`
done
LIST="interswitch.cc interswitchC.cc interswitchBasicHttpBinding_USCOREQuickTellerServiceProxy.cc"
echo "*** Compiling SOAP Proxy ***"
for i in $LIST
do
    echo "*** Building $i"
    g++ -DTEST -Wno-deprecated -I../../include -I../../core -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -c ../$i -o `echo $i|sed 's/.cc/.o/'`
done
#g++ -DWITH_NONAMESPACES -g -O2 -c stdsoap2.cpp -o stdsoap2.o
g++ -g -O2 -c envC.cpp -o envC.o
g++ -g -O2 -c namespaces.cc -o namespaces.o
echo "*** Linking ***"
g++ -lstdc++ -lgsoapssl++ -lssl -lz -L/usr/lib64 *.o -o test
# -DWITH_NONAMESPACES