📄 install
字号:
#! /bin/sh## Copyright (C) 2000 by USC/ISI# All rights reserved.## Redistribution and use in source and binary forms are permitted# provided that the above copyright notice and this paragraph are# duplicated in all such forms and that any documentation, advertising# materials, and other materials related to such distribution and use# acknowledge that the software was developed by the University of# Southern California, Information Sciences Institute. The name of the# University may not be used to endorse or promote products derived from# this software without specific prior written permission.## THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.### Maintainer: Nader Salehi <salehi@isi.edu># Version Date: 1999/03/16 16:10:50 PST##die() { echo "$@" 1>&2 test ! -z "$blame" && echo "$blame" 1>&2 exit 1}warn() { echo "$@"}# Get current pathCUR_PATH=`pwd`# create tcl8.0.4 and tk8.0.4 installation directoryif [ ! -d tclbox ]then mkdir tclboxfiif [ ! -d tkbox ]then mkdir tkboxfi# install and install Tcl8.0.4cd ./tcl8.0.4/unixblame='Tcl is not part of the ns project. Please see www.Scriptics.comto see if they have a fix for your platform.'./configure --enable-gcc --prefix="$CUR_PATH/tclbox" || die "tcl8.0.4 configuration failed! Exiting ..."if make then make install || die "tcl8.0.4 installation failed! Exiting ..."else echo "tcl8.0.4 make failed! Exiting ..." echo "For problems with Tcl/Tk see http://www.scriptics.com" exitficd ../../# compile and install tkcd ./tk8.0.4/unixblame='Tk is not part of the ns project. Please see www.Scriptics.comto see if they have a fix for your platform.'./configure --enable-gcc --prefix="$CUR_PATH/tkbox" || die "tk8.0.4 configuration failed! Exiting ..."if make then make install || die "tk8.0.4 installation failed! Exiting ..."else echo "tk8.0.4 make failed! Exiting ..." echo "For problems with Tcl/Tk see http://www.scriptics.com" exitficd ../../# do some copy for otclcp ./tcl8.0.4/generic/*.h ./tclbox/include/ || die "cp failed"cp ./tk8.0.4/generic/*.h ./tkbox/include/ || die "cp failed"# compile and install otclcd ./otcl-1.0a5blame='Please check http://www-mash.cs.berkeley.edu/ns/ns-problems.htmlfor common problems and bug fixes.'./configure --enable-gcc --with-tcl=../tclbox --with-tk=../tkbox || die "otcl-1.0a4 configuration failed! Exiting ..."if make then echo "otcl-1.0a5 has been installed successfully."else echo "otcl-1.0a5 make failed! Exiting ..." echo "See http://www-mash.CS.Berkeley.EDU/ns/ns-problems.html for problems" exitficd ../# compile and install tclcl-1.0b9cd ./tclcl-1.0b9./configure --enable-gcc --with-otcl=../otcl-1.0a5 --with-tcl=../tclbox --with-tk=../tkbox --with-tcl-ver=8.0.4 --with-tk-ver=8.0.4 || die "tclcl-1.0b9 configuration failed! Exiting ..."if makethen echo "tclcl-1.0b9 has been installed successfully."else echo "tclcl-1.0b9 make failed! Exiting ..." echo "See http://www-mash.CS.Berkeley.EDU/ns/ns-problems.html for problems" exitfi cd ../#compile and install xgraphcd ./xgraph-12.1./configure --enable-gcc --prefix=../if makethen echo "xgraph has been installed successfully. "else echo "Can not create xgraph; But xgraph is an optional package, continuing..."ficd ../#compile and install cweb and sgblibcd ./cwebif [ ! -f ./Makefile ]then echo "ns-allinone unable to install cweb for you. Please install it manually. cweb is used by sgb to create sgblibrary needed by scenario-generator. But this will not affect the use of ns as such, so continue.."else echo "Making cweb" touch *.c make all || warn "cweb failed to make, but it's optional" # xxx: other stuff will fail... chmod 755 cweave chmod 755 ctangle cd .. #echo "cd .." if [ ! -d bin ] then mkdir bin fi cd bin ln -s $CUR_PATH/cweb/cweave cweave ln -s $CUR_PATH/cweb/ctangle ctangle ficd ..PATH=$CUR_PATH/bin:$PATHexport PATH#echo $PATHcd ./sgbif [ ! -f ./Makefile ] then echo "Unable to create sgb library. This library is used by gt-itm and so for scenario generators. If you already have sgblib (possible if you are on solaris,sunos or freebsd platforms) you may still be able to run gt-itm. so continuing.."else echo "Making sgb" if make tests then if [ -f lib*.a ] then if [ -f ../gt-itm/lib/libgb.a ] then rm ../gt-itm/lib/libgb.a cp lib*.a ../gt-itm/lib/libgb.a fi fi else echo "Unable to create sgb library, but it's optional, so continuing..." fificd ..# compile and install gt-itm & sgb2ns## don't need to do this any longer##./tclbox/bin/tclsh8.0.4 ./bin/gtitm.tclif [ -f ./gt-itm/lib/libgb.a ]then if [ ! -f ./gt-itm/src/Makefile ] then echo "ns-alline is unable to install gt-itm sgb2ns for you, please install" echo "them manually. You can't run scenario generator without gt-itm" echo "and sgb2ns. But it will not affect you use ns, so continue ..." else cd ./gt-itm/src if make then echo "gt-itm has been installed successfully." fi cd ../sgb2ns if make then echo "sgb2ns has been installed successfully." fi cd ../../ fielse echo "sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing.."fi#compile and install nsPATH=$CUR_PATH/tclbox/bin:$CUR_PATH/tkbox/bin:$PATHexport PATH#echo $PATH# John's hacktest -f ./otcl-1.0a5/libotcl.a && rm ./otcl-1.0a5/libotcl.socd ./ns-2.1b6./configure --enable-gcc --with-otcl=../otcl-1.0a5 --with-tclcl=../tclcl-1.0b9 --with-tcl=../tclbox --with-tk=../tkbox --disable-static || die "Ns configuration failed! Exiting ..."if makethen echo " Ns has been installed successfully." else echo "Ns make failed!" echo "See http://www-mash.CS.Berkeley.EDU/ns/ns-problems.html for problems" exitficd ../#compile and install zlibcd ./zlib-1.1.3if ./configure --exec-prefix=../ --prefix=../then if make then echo "Zlib has been installed successfully." else warn "Zlib make failed, but it's optional Continue ..." fielse warn "Zlib-1.1.3 configuration failed, but it's optional, so continuing ..."ficd ../#compile and install namcd ./nam-1.0a8./configure --enable-gcc --with-otcl=../otcl-1.0a5 --with-tclcl=../tclcl-1.0b9 --with-tcl=../tclbox --with-tk=../tkbox --with-tcldebug=no --disable-static || die "Nam configuration failed! Exiting ..."if makethen echo "Nam has been installed successfully."else echo "Nam make failed! Continue ..." echo "See http://www-mash.CS.Berkeley.EDU/ns/ns-problems.html for problems"ficd ../# install nam, ns, xgraph into binif [ ! -d bin ]thenmkdir binficd binln -s $CUR_PATH/ns-2.1b6/ns nsif test -x $CUR_PATH/nam-1.0a8/namthen ln -s $CUR_PATH/nam-1.0a8/nam namelse echo "Please compile your nam separately."fiif test -x $CUR_PATH/xgraph-12.1/xgraphthen ln -s $CUR_PATH/xgraph-12.1/xgraph xgraphelse echo "Please compile your xgraph separately."fiif test -x $CUR_PATH/gt-itm/bin/sgb2nsthen ln -s $CUR_PATH/gt-itm/bin/sgb2ns sgb2ns ln -s $CUR_PATH/gt-itm/bin/sgb2hierns sgb2hierns ln -s $CUR_PATH/gt-itm/bin/sgb2comns sgb2comns ln -s $CUR_PATH/gt-itm/bin/itm itm ln -s $CUR_PATH/gt-itm/bin/sgb2alt sgb2alt ln -s $CUR_PATH/gt-itm/bin/edriver edriverelse echo "Please compile your gt-itm & sgb2ns separately."fiecho "Ns-allinone package has been installed successfully."echo "Here are the installation places:"echo "ns: $CUR_PATH/ns-2.1b6/ns"echo "otcl: $CUR_PATH/otcl-1.0a5"echo "tclcl: $CUR_PATH/tclcl-1.0b9"echo "tcl8.0.4: $CUR_PATH/tclbox"echo "tk8.0.4: $CUR_PATH/tkbox"if [ -x $CUR_PATH/nam-1.0a8/nam ]thenecho "nam: $CUR_PATH/nam-1.0a8/nam"fiif [ -x $CUR_PATH/xgraph-12.1/xgraph ]thenecho "xgraph: $CUR_PATH/xgraph-12.1"fiif [ -x $CUR_PATH/gt-itm/bin/sgb2ns ] thenecho "gt-itm: $CUR_PATH/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns"fiecho ""echo "You can delete $CUR_PATH/tcl8.0.4 and $CUR_PATH/tk8.0.4 if "echo "you want save your disk space"echo "-----------------------------------------------------"echo "Please put $CUR_PATH/bin into your PATH environment."echo "On some systems you many need to put $CUR_PATH/otcl-1.0a5 into your LD_LIBRARY_PATH environment!"echo ""echo "You can run the ns validation suite with"echo "cd ns-2.1b6; ./validate"exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -