|
楼主 |
发表于 2003-7-12 10:37:29
|
显示全部楼层
脚本运行的时候这个到底是什么错误?
我把genclntsh脚本也贴出来
#!/bin/sh
#
# $Id: genclntsh.sh 10-may-2002.22:20:53 madivi Exp $
# Copyright (c) 1996, 2002, Oracle Corporation. All rights reserved.
#
# genclntsh.sh (for Linux)
#
# Script to create single shared client library for OCI, Pro*C, and XA
#
# MODIFIED (MM/DD/YY)
# madivi 05/10/02 - Removed -lrt option and added stubs to link line.
# mkrohan 03/05/01 - Remove echo
# mkrohan 03/05/01 - Drop libnent9
# rlal 02/13/01 - Merges for 8i to 9i for Linux.
# mkrohan 12/13/00 - Fix symlinking
# mkrohan 12/07/00 - Final cleanup
# mkrohan 11/27/00 - Add support static library map file
# mkrohan 11/08/00 - Search for product 9 libraries
# mkrohan 10/26/00 - Update to version 9
# rachacos 11/25/98 - use naming adapter libraries
# rachacos 07/30/98 - use GS LDAP package
# hpiao 11/12/97 - Make libcommon$$.a writable
# jweisz 06/30/97 - ADE support: if lib is symlink, copy it
# mluong 05/30/97 - Read entry points from $PRODUCT/admin/shrept.lst
# hpiao 04/04/97 - Modify for 803
# dkozlows 05/01/95 - File created
#
#
# List the required symbols from a product's shrept.lst file
listf () {
product=$1
entryList=$ORACLE_HOME/$product/admin/shrept.lst
grep -v '#' $entryList | \
grep $product | \
awk '{ printf (" -u %s", $3); }'
}
#
# Main line starts here
#
#
# Explicit path to ensure that we're using the correct commands
PATH=/bin:/usr/bin:/usr/local/binPATH
export PATH
#
# each product _must_ provide a $PRODUCT/admin/shrept.lst
ErrFiles=
for product in rdbms precomp plsql ldap network
do
SHREPT=$ORACLE_HOME/$product/admin/shrept.lst
if [ ! -f $SHREPT ]
then
ErrFiles="$ErrFiles $SHREPT"
fi
done
if [ ! -z "$ErrFiles" ]
then
echo "genclntsh: Could not locate $ErrFiles" 1>&2
echo "genclntsh: exiting ..." 1>&2
exit 1
fi
#
# library definitions
OLIB=${ORACLE_HOME}/lib
# Precomp
LSQL="-lsql9"
# PL/SQL
LPLSQL="-lpls9"
# RDBMS
LMM="-lmm"
LCLIENT="-lclient9"
LCOMMON="-lcommon9"
LGENERIC="-lgeneric9"
# NLSRTL & CORE
LNLSRTL="-lnls9"
LUNLSRTL="-lunls9"
LCORE="-lcore9"
LXDK="-lxml9"
LXSD="-lxsd9"
# OTrace
LTRACE="-ltrace9"
# LDAP
LLDAP="-lldapclnt9"
# ICache
LWTC="-lwtc9"
# Network
LDFLAGS="`cat ${ORACLE_HOME}/lib/ldflags`"
LNENT=
[ -r ${OLIB}/libnent9.a ] && LNENT="-lnent9"
LNETWORK="${LDFLAGS} ${LNENT} -lnsslb9 -lncrypt9 -ln9 -lnl9 -lnro9 ${LDFLAGS}"
#
# Create lists of symbols to pass to ld
SYMS_OCIC="`listf rdbms` ${LCLIENT}"
SYMS_SQL="`listf precomp` ${LSQL}"
SYMS_PLSQL="`listf plsql` ${LPLSQL}"
SYMS_LDAP="`listf ldap` ${LLDAP}"
SYMS_NETWORK="`listf network` ${LNETWORK}"
#
# Library names and locations
CLNT_NAM=clntsh # (short) library name
CLNT_VER=9.0 # library version number
CLNT_LNK=lib${CLNT_NAM}.so # name of symlink to library
CLNT_LIB=${CLNT_LNK}.${CLNT_VER} # actual library file name
LIB_DIR=${ORACLE_HOME}/lib # lib. destination directory
if [ ! -z "$SRCHOME" ]
then
LIB_DIR=${SRCHOME}/rdbms/lib # lib. destination directory
fi
#
# If in ADE, the library may be a symlink to the label server. If so,
# pull it over...
if [ -h ${LIB_DIR}/${CLNT_LIB} ]
then
echo "copying ${CLNT_LIB} to local disk"
cp -p ${LIB_DIR}/${CLNT_LIB} ${LIB_DIR}/${CLNT_LIB}.tmp
rm -f ${LIB_DIR}/${CLNT_LIB}
mv ${LIB_DIR}/${CLNT_LIB}.tmp ${LIB_DIR}/${CLNT_LIB}
chmod +w ${LIB_DIR}/${CLNT_LIB}
fi
#
# Define the name of the map file
MAPFILE=${LIB_DIR}/${CLNT_NAM}.map
#
# Linker command and options
#LD="ld -i -G -z text -L${ORACLE_HOME}/lib" # shared library link command
LD="gcc -shared -Wl,-relax -L${ORACLE_HOME}/lib" # shared library link command
LD_RUNTIME="-Wl,-R${ORACLE_HOME}/lib"
LD_OPT="-Wl,-Map ${MAPFILE} -Wl,-h${CLNT_LIB}" # name inserted into library
LD_OUT="-o ${LIB_DIR}/${CLNT_LIB}" # output specification
#LD_SELF_CONTAINED="" ///////此处做了修改的!!!!!!!!!!!!!!!!!!!!!!!
#
# Oracle library dependencies
DEF_ON="${ORACLE_HOME}/rdbms/lib/kpudfo.o"
NAUTAB="${ORACLE_HOME}/lib/nautab.o"
NAETAB="${ORACLE_HOME}/lib/naeet.o ${ORACLE_HOME}/lib/naect.o"
NAEDHS="${ORACLE_HOME}/lib/naedhs.o"
XAONDY="${ORACLE_HOME}/rdbms/lib/xaondy.o"
OLIBS="${LCLIENT}"
OLIBS="${OLIBS} ${LSQL}"
OLIBS="${OLIBS} ${LNETWORK}"
OLIBS="${OLIBS} ${LCLIENT}"
OLIBS="${OLIBS} ${LCOMMON}"
OLIBS="${OLIBS} ${LGENERIC}"
OLIBS="${OLIBS} ${LMM}"
OLIBS="${OLIBS} ${XAONDY}"
OLIBS="${OLIBS} ${LWTC}"
OLIBS="${OLIBS} ${LNETWORK}"
OLIBS="${OLIBS} ${LCLIENT}"
OLIBS="${OLIBS} ${LCOMMON}"
OLIBS="${OLIBS} ${LGENERIC}"
OLIBS="${OLIBS} ${LTRACE}"
OLIBS="${OLIBS} ${LNLSRTL}"
OLIBS="${OLIBS} ${LCORE}"
OLIBS="${OLIBS} ${LNLSRTL}"
OLIBS="${OLIBS} ${LUNLSRTL}"
OLIBS="${OLIBS} ${LXDK}"
OLIBS="${OLIBS} ${LXSD}"
OLIBS="${OLIBS} ${LNLSRTL}"
OLIBS="${OLIBS} ${LUNLSRTL}"
OLIBS="${OLIBS} ${LCORE}"
#SYSLIBS=`cat ${ORACLE_HOME}/lib/sysliblist`" -laio -lm -lc"
#SYSLIBS=`cat ${ORACLE_HOME}/lib/sysliblist`" -ldl -lm -lc"
# LD does not seem to recognize -Wl,-relax, which CC needs
#SYSLIBS="-Wl,-relax -ldl -lnsl -lpthread -lrt -lm -lc"
# Removed -lrt option
SYSLIBS="-Wl,-relax -ldl -lnsl -lpthread -lm -lc"
# Introducing stubs for compatibility with higher version of glibc
STUBS=-L${ORACLE_HOME}/lib/stubs
# Create library
/bin/rm -f ${LIB_DIR}/${CLNT_LIB} ${MAPFILE}
${LD} ${LD_RUNTIME} ${STUBS} ${LD_OPT} ${LD_OUT} ${LD_SELF_CONTAINED} \
${DEF_ON} ${NAUTAB} ${NAETAB} ${NAEDHS} ${SYMS_SQL} \
${SYMS_PLSQL} ${SYMS_OCIC} ${SYMS_LDAP} ${SYMS_NETWORK} ${OLIBS} \
${SYSLIBS} ${USRLIBS} > ${MAPFILE}
# Create ".so" link to library in a non-development environment only
# and generate the client static library
if [ -z "${SRCHOME}" ]
then
if [ -s ${LIB_DIR}/${CLNT_LIB} ]
then
cd ${LIB_DIR}
rm -f ${CLNT_LNK}
ln -s ${CLNT_LIB} ${CLNT_LNK}
fi
${ORACLE_HOME}/bin/genclntst
else
if [ -s ${LIB_DIR}/${CLNT_LIB} ]
then
cd ${SRCHOME}/lib
rm -f ${CLNT_LNK}
if [ -d ../rdbms ]; then
ln -s ../rdbms/lib/${CLNT_LIB} ${CLNT_LNK}
else
ln -s ../../rdbms/lib/${CLNT_LIB} ${CLNT_LNK}
fi
fi
fi
exit 0 |
|