I am trying to figure out how to get rid of the buildserver options being put in when I recompile using 10GR3 tuxedo for hpux 64 bit(it over-rides the compiler via the CC but not CFLAGS). I have both CFLAGS and CC set, CC is picked up but appears to be no way to get rid of the implied CFLAGS(+DA2.0W -Wl,+s -D__BIGMSGQUEUE_ENABLED ) below. The older version did not have this behaviour
New 10GR3
sdevcomp:/home/jurban/cwork>make CLEANCONN
CFLAGS="-g -L /opt/tuxedo10gR3/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib -I /opt/tuxedo10gR3/include -I /home/hems/prod/include -L /opt/tuxedo10gR3/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib -I /opt/tuxedo10gR3/include -I /home/hems/prod/include" \
CC="gcc" \
buildserver -v -s CLEANCONN -o CLEANCONN -l cleanconn.o -l -lclntsh -l -lusr -r Oracle_XA
gcc +DA2.0W -Wl,+s -D__BIGMSGQUEUE_ENABLED -g -L /opt/tuxedo10gR3/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib -I /opt/tuxedo10gR3/include -I /home/hems/prod/include -L /opt/tuxedo10gR3/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib -I /opt/tuxedo10gR3/include -I /home/hems/prod/include -I$TUXDIR/include -o CLEANCONN BS-6c55.c -L${TUXDIR}/lib -ltux -lbuft -L${ORACLE_HOME}/lib -lclntsh -lfml -lfml32 -lengine -lpthread -lcl -lnsl cleanconn.o -lclntsh -lusr
gcc: +DA2.0W: No such file or directory
CMDTUX_CAT:1832: ERROR: can't execute gcc +DA2.0W -Wl,+s -D__BIGMSGQUEUE_ENABLED -g -L /opt/tuxedo10gR3/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib -I /opt/tuxedo10gR3/include -I /home/hems/prod/include -L /opt/tuxedo10gR3/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib -I /opt/tuxedo10gR3/include -I /home/hems/prod/include -I$TUXDIR/include -o CLEANCONN BS-6c55.c -L${TUXDIR}/lib -ltux -lbuft -L${ORACLE_HOME}/lib -lclntsh -lfml -lfml32 -lengine -lpthread -lcl -lnsl cleanconn.o -lclntsh -lusr
*** Error exit code 1
Older version:
gcc -c -g -L /opt/tuxedo6.5/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib32 -I /opt/tuxedo6.5/include -I /home/hems/prod/include cleanconn.c
CFLAGS="-g -L /opt/tuxedo6.5/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib32 -I /opt/tuxedo6.5/include -I /home/hems/prod/include -L /opt/tuxedo6.5/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib32 -I /opt/tuxedo6.5/include -I /home/hems/prod/include" \
CC="gcc" \
buildserver -v -s CLEANCONN -o CLEANCONN -l cleanconn.o -l -lclntsh -l -lusr -r Oracle_XA
gcc -g -L /opt/tuxedo6.5/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib32 -I /opt/tuxedo6.5/include -I /home/hems/prod/include -L /opt/tuxedo6.5/lib -L /home/hems/prod/lib -L /opt/oracle/product/current/lib32 -I /opt/tuxedo6.5/include -I /home/hems/prod/include -I$TUXDIR/include -o CLEANCONN BS-6dc7.c -L${TUXDIR}/lib -ltux -lbuft -ltux2 -L${ORACLE_HOME}/lib32 ${ORACLE_HOME}/lib32/libsql9.a -lcore9 -lnls9 -lcore9 -lmm -lfml -lfml32 -lgp -lnsl cleanconn.o -lclntsh -lusr
Current make lines:
CFLAGS=${DEBUGFLAGS} ${LIBDIRS} ${INCDIRS}
# 32 bit CFLAGS=${DEBUGFLAGS} ${LIBDIRS} ${INCDIRS}
#CFLAGS=${DEBUGFLAGS} ${INCDIRS}
CC=gcc
${CLEAN_CONN}: ${CLEAN_CONN_OBJ}
CFLAGS="${CFLAGS} ${LIBDIRS} ${INCDIRS}" \
CC="${CC}" \
buildserver ${VERBOSE} -s ${CLEAN_CONN} -o $@ -l ${CLEAN_CONN_OBJ} -l ${LIBS} -r Oracle_XA中间件技术社区-Tuxedo论坛
If the environment variable CC is set, buildclient and buildserver use the value of this variable as the C++ or C compiler to be executed. You can remove unwanted compiler options by creating a shell script called ccedit with the following contents:
REALCC=gcc
CCCMD=`echo $* | sed -e 's/+DA2.0W //g' -e 's/-Wl,+s //g' -e's/-D__BIGMSGQUEUE_ENABLED //g'`
echo "Executing $REALCC $CCCMD"
exec $REALCC $CCCMD
If you then export CC=ccedit Tuxedo will invoke your shell script as the compiler, which will remove the unwanted options and invoke the actual C compiler.
Note that some flag settings must be consistent throughout the set of binaries linked into an executable, so exercise care in deciding which default compiler flags to remove.
(If any other customer is using COBOL and wants to remove unwanted options passed to a COBOL compiler, the ALTCC environment variable can be used in a similar way for COBOL.)
A previous discussion on this issue can be found at
http://forums.oracle.com/forums/thread.jspa?messageID=3302823
Ed
--转自