Advertisement
Guest User

install

a guest
Jan 23rd, 2012
2,915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.86 KB | None | 0 0
  1. #! /bin/sh
  2. #
  3. # Copyright (C) 2000 by USC/ISI
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms are permitted
  7. # provided that the above copyright notice and this paragraph are
  8. # duplicated in all such forms and that any documentation, advertising
  9. # materials, and other materials related to such distribution and use
  10. # acknowledge that the software was developed by the University of
  11. # Southern California, Information Sciences Institute. The name of the
  12. # University may not be used to endorse or promote products derived from
  13. # this software without specific prior written permission.
  14. #
  15. # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18. #
  19. # $Header: /cvsroot/nsnam/ns-2/allinone/install,v 1.31 2007/03/10 23:40:05 tom_henderson Exp $
  20.  
  21. X_INCL = /Developer/SDKs/MacOSX10.7.sdk/usr/X11R6/include
  22. X_LIBS = /Developer/SDKs/MacOSX10.7.sdk/usr/X11R6/lib
  23. MACOS_CONF = "--x-include=$X_INCL --x-libraries=$X_LIBS"
  24.  
  25. die() {
  26. echo "$@" 1>&2
  27. test ! -z "$blame" && echo "$blame" 1>&2
  28. exit 1
  29. }
  30.  
  31. warn() {
  32. echo "$@"
  33. }
  34.  
  35. test_proceed() {
  36. echo "";
  37. echo "The above test indicates that your installation of Cygwin";
  38. echo "is probably NOT SUITABLE for installing ns-2 allinone.";
  39. echo "(More details can be found in the specific error message above.)";
  40. echo "";
  41. echo -n "Do you wish to proceed regardless? [y/N] "
  42. read answer;
  43. if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then
  44. die "Installation aborted...";
  45. exit 1;
  46. fi;
  47. echo "";
  48. echo "*** OK, but you're on your own... ***";
  49. echo "";
  50. }
  51.  
  52. test_packages() {
  53. for i in $@; do
  54. echo -n "Checking for ${i}... ";
  55. cygcheck -c ${i} | grep ${i} >/dev/null 2>&1;
  56. if [ "$?" -eq "0" ]; then
  57. echo "ok";
  58. else
  59. echo "NO!";
  60. echo "";
  61. echo "Package ${i} is not present on your system.";
  62. echo "";
  63. echo "Please install it using Cygwin's setup.exe";
  64. echo "before trying to install the ns-2 distribution.";
  65. test_proceed;
  66. fi;
  67. done;
  68. }
  69.  
  70. cygwin_tests() {
  71. echo -n "Checking Cygwin version is >= 1.3.12... "
  72. cmaj=` uname -r | sed -e 's/^\([0-9]*\)\.\([0-9]*\).\([0-9]*\).*/\1/'`;
  73. echo $cmaj | grep -v [0-9] >/dev/null 2>&1
  74. if [ "$?" -eq "0" ]; then
  75. cmaj=0;
  76. fi;
  77. cmin=` uname -r | sed -e 's/^\([0-9]*\)\.\([0-9]*\).\([0-9]*\).*/\2/'`;
  78. echo $cmin | grep -v [0-9] >/dev/null 2>&1
  79. if [ "$?" -eq "0" ]; then
  80. cmin=0;
  81. fi;
  82. cpat=` uname -r | sed -e 's/^\([0-9]*\)\.\([0-9]*\).\([0-9]*\).*/\3/'`;
  83. echo $cpat | grep -v [0-9] >/dev/null 2>&1
  84. if [ "$?" -eq "0" ]; then
  85. cpat=0;
  86. fi;
  87. echo -n "$cmaj.$cmin.$cpat ";
  88. if ([ "$cmaj" -gt "1" ]) || ([ "$cmaj" -eq "1" ] && [ $cmin -gt "3" ]) || ([ "$cmaj" -eq 1 ] && [ $cmin -eq "3" ] && [ "$cpat" -ge "12" ]); then
  89. echo "(should be ok)";
  90. else
  91. echo "(NO!)";
  92. echo "";
  93. echo "ns-allinone-${NSVER} has not been tested under versions of Cygwin older than";
  94. echo "1.3.12. Your version ($cmaj.$cmin.$cpat) appears to be older than that. Success of";
  95. echo "the install process is therefore NOT GUARANTEED.";
  96. echo "";
  97. cygversion="failed";
  98. test_proceed;
  99. fi;
  100. echo -n "Checking filesystems are mounted as UNIX filetype... ";
  101. mount | grep "textmode" >/dev/null 2>&1;
  102. if [ "$?" -eq "0" ]; then
  103. echo "NO!";
  104. mount_test="failed";
  105. echo "";
  106. echo "It appears that some of your Cygwin shares are mounted as DOS file";
  107. echo "type. This has not been tested, but is likely to result in failure of";
  108. echo "validation tests. Success of the install process is also NOT";
  109. echo "GUARANTEED.";
  110. echo "";
  111. echo "Refer to the Cygwin user guide for how to install Cygwin with the UNIX";
  112. echo "file text mode.";
  113. test_proceed;
  114. else
  115. echo "yes";
  116. echo -n "Checking default mode is binmode... ";
  117. echo ${CYGWIN} | grep "nobinmode" >/dev/null 2>&1;
  118. if [ "$?" -eq "0" ]; then
  119. cyg_env_var="failed";
  120. echo "*** NO! ***";
  121. echo "";
  122. echo "Your \$CYGWIN environment variable specifies \"nobinmode\". This is";
  123. echo "likely to result in failure of validation tests, and (possibly) of";
  124. echo "the whole install process. You need to have the \$CYGWIN environment";
  125. echo "variable set to \"binmode\". Please refer to the Cygwin user guide for";
  126. echo "details on how to change this.";
  127. test_proceed;
  128. else
  129. echo "yes";
  130. fi;
  131. fi;
  132.  
  133. login=`whoami`
  134. echo -n "Checking legitimate login name... ";
  135. echo ${login} | grep " " >/dev/null 2>&1;
  136. if [ "$?" -eq "0" ]; then
  137. echo "NO!";
  138. echo "";
  139. echo "Your username (${login}) contains spaces,";
  140. echo "which makes the installation of ns-2 impossible.";
  141. echo "Please try to install ns-2 as a different user, whose";
  142. echo "name does not contain any spaces.";
  143.  
  144. test_proceed;
  145. else
  146. echo "ok";
  147. fi;
  148.  
  149. echo -n "Checking legitimate path name... ";
  150.  
  151. installpath=`cygpath -d /`;
  152. echo ${installpath} | grep " " >/dev/null 2>&1;
  153. if [ "$?" -eq "0" ]; then
  154. echo "NO!";
  155. echo "";
  156. echo "Your Cygwin installation path (${installpath}) contains spaces,";
  157. echo "which makes the installation of ns-2 impossible.";
  158. echo "Please reinstall Cygwin in a different directory, which";
  159. echo "does not contain any spaces.";
  160. test_proceed;
  161. else
  162. echo "ok";
  163. fi;
  164.  
  165. test_packages ${packages_base}
  166.  
  167. echo -n "Checking for diff... ";
  168. diff -v 2>&1 | grep -iv "not found" >/dev/null 2>&1;
  169. if [ "$?" -eq "0" ]; then
  170. echo "ok";
  171. else
  172. echo "NO!";
  173. echo "";
  174. echo "diff is not present on your system.";
  175. echo "";
  176. echo "Please install it using Cygwin's setup.exe";
  177. echo "before trying to install the ns-2 distribution.";
  178. test_proceed;
  179. fi;
  180.  
  181. echo -n "Checking for X... ";
  182. cygcheck -c xorg-x11-base | grep xorg-x11-base >/dev/null 2>&1;
  183. if [ "$?" -eq "0" ]; then
  184. echo "X.org";
  185. test_packages ${packages_xorg}
  186.  
  187. else
  188. cygcheck -c XFree86-base | grep XFree86-base >/dev/null 2>&1;
  189. if [ "$?" -eq "0" ]; then
  190. echo "XFree86";
  191. test_packages ${packages_xfree}
  192. else
  193. echo "None found!";
  194.  
  195. echo "";
  196. echo "Neither Package xorg-x11-base nor XFree86-base is present on your system.";
  197. echo "";
  198. echo "Please install one of it using Cygwin's setup.exe";
  199. echo "before trying to install the ns-2 distribution.";
  200. test_proceed;
  201.  
  202. fi;
  203. fi;
  204. }
  205.  
  206.  
  207.  
  208.  
  209. # Package VERSIONs. Change these when releasing new packages
  210. TCLVER=8.4.18
  211. TKVER=8.4.18
  212. OTCLVER=1.13
  213. TCLCLVER=1.19
  214. NSVER=2.34
  215. NAMVER=1.14
  216. XGRAPHVER=12.1
  217. ZLIBVER=1.2.3
  218. DEI80211MRVER=1.1.4
  219.  
  220. # Get current path
  221. CUR_PATH=`pwd`
  222.  
  223. echo "============================================================"
  224. echo "* Testing for Darwin (OS X) environment"
  225. echo "============================================================"
  226. if [ `uname` = "Darwin" ]; then
  227. echo "Darwin detected";
  228. DYLD_LIBRARY_PATH=$CUR_PATH/tcl$TCLVER/unix:$CUR_PATH/tk$TKVER/unix:$DYLD_LIBRARY_PATH
  229. export DYLD_LIBRARY_PATH
  230. test_darwin=true
  231. fi
  232.  
  233. # A Cygwin install requires these packages:
  234. packages_base="gcc gcc-g++ gawk tar gzip make patch perl w32api"
  235. packages_xfree="XFree86-bin XFree86-prog XFree86-lib XFree86-etc"
  236. packages_xorg="xorg-x11-bin xorg-x11-bin-dlls xorg-x11-devel xorg-x11-libs-data xorg-x11-etc"
  237.  
  238. # Check if we are using Cygwin, and if so, if it is a good install
  239. # Most Cygwin fixes in the tree and this part of the install script were
  240. # contributed by Nicolas Christin <christin@...>
  241.  
  242. echo "============================================================"
  243. echo "* Testing for Cygwin environment"
  244. echo "============================================================"
  245.  
  246. if [ -x /usr/bin/uname ]; then
  247. # it may be a Cygwin install
  248. test_cygwin=`uname | tr [a-z] [A-Z] | sed -e 's|.*CYGWIN.*|true|'`;
  249. if [ "${test_cygwin}" = "true" ]; then
  250. echo "Cygwin detected";
  251. echo "Note: Cygwin install is still considered EXPERIMENTAL";
  252. echo "";
  253. cygwin_tests;
  254.  
  255. echo "Patching Tcl/Tk for Cygwin.";
  256. if [ ! -f ./tcl${TCLVER}/generic/tcl.h.orig ]; then
  257. cp ./tcl${TCLVER}/generic/tcl.h ./tcl${TCLVER}/generic/tcl.h.orig;
  258. echo "The original tcl${TCLVER}/generic/tcl.h is backed up as tcl${TCLVER}/generic/tcl.h.orig";
  259. sed -e 's/\#define _TCL/\#define _TCL\`\`\#ifdef __CYGWIN__\`\#define HAVE_TM_ZONE 1\`\#endif \/\* __CYGWIN__ \*\//g' ./tcl${TCLVER}/generic/tcl.h.orig | tr '\`' '\n' > ./tcl${TCLVER}/generic/tcl.h;
  260. cp ./tk${TCLVER}/generic/default.h ./tk${TCLVER}/generic/default.h.orig;
  261. echo "The original tk${TKVER}/generic/default.h is backed up as tk${TKVER}/generic/default.h.orig";
  262. sed -e 's/defined(__CYGWIN__) || defined(__MINGW32__)/0/g' ./tk${TKVER}/generic/default.h.orig > ./tk${TKVER}/generic/default.h;
  263. fi;
  264. touch ./tcl${TCLVER}/generic/tclStubInit.c;
  265. echo "Patching sgb for Cygwin.";
  266. cp ./sgb/Makefile ./sgb/Makefile.orig;
  267. echo "The original sgb/Makefile is backed up as sgb/Makefile.orig";
  268. sed -e 's|rm \(.*\)test_io test_graph test_flip test_sample\(.*\)|rm -f \1test_io.exe test_graph.exe test_flip.exe test_sample.exe\2|' ./sgb/Makefile.orig > ./sgb/Makefile;
  269. echo "Setting executable format to .exe...";
  270. EXE=".exe";
  271. else
  272. echo "Cygwin not detected, proceeding with regular install.";
  273. EXE=;
  274. fi;
  275. else
  276. echo "Cygwin not detected, proceeding with regular install.";
  277. fi;
  278.  
  279. echo "============================================================"
  280. echo "* Testing for FreeBSD environment"
  281. echo "============================================================"
  282. # See if we need to use gmake.
  283. if [ "`uname -s`" = "FreeBSD" ]; then
  284. echo "FreeBSD detected; using gmake instead of make"
  285. if (type gmake &>/dev/null); then
  286. alias make="gmake"
  287. fi
  288. else
  289. echo "FreeBSD not detected"
  290. fi
  291.  
  292. # Compile and install xgraph
  293.  
  294. echo "============================================================"
  295. echo "* Build XGraph-$XGRAPHVER"
  296. echo "============================================================"
  297.  
  298. cd ./xgraph-$XGRAPHVER
  299. ./configure --prefix=../
  300. if [ "${test_cygwin}" = "true" ]; then
  301. touch stamp-h;
  302. fi;
  303. if make
  304. then
  305. echo "xgraph has been installed successfully. "
  306. else
  307. echo "Can not create xgraph; But xgraph is an optional package, continuing..."
  308. fi
  309.  
  310. cd ../
  311.  
  312. # Compile and install cweb and sgblib
  313.  
  314. echo "============================================================"
  315. echo "* Build CWeb"
  316. echo "============================================================"
  317.  
  318. cd ./cweb
  319.  
  320. if [ ! -f ./Makefile ]
  321. then
  322. 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.."
  323. else
  324. echo "Making cweb"
  325. touch *.c
  326. make all || warn "cweb failed to make, but it's optional"
  327. # xxx: other stuff will fail...
  328. chmod 755 cweave${EXE}
  329. chmod 755 ctangle${EXE}
  330. cd ..
  331. #echo "cd .."
  332. if [ ! -d bin ]
  333. then
  334. mkdir bin
  335. fi
  336. cd bin
  337. ln -s $CUR_PATH/cweb/cweave${EXE} cweave${EXE}
  338. ln -s $CUR_PATH/cweb/ctangle${EXE} ctangle${EXE}
  339. fi
  340.  
  341. cd ..
  342. PATH=$CUR_PATH/bin:$PATH
  343. export PATH
  344.  
  345. echo "============================================================"
  346. echo "* Build Stanford GraphBase"
  347. echo "============================================================"
  348.  
  349. cd ./sgb
  350. if [ ! -f ./Makefile ]
  351. then
  352. 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.."
  353. else
  354. echo "Making sgb"
  355. if make tests
  356. then
  357. if [ -f libgb.a ] ; then
  358. rm -f ../gt-itm/lib/libgb.a
  359. cp libgb.a ../gt-itm/lib/libgb.a
  360. else
  361. echo "* Weird: sgb said it has been built but we can't find libgb.a! "
  362. exit -1
  363. fi
  364. else
  365. echo "Unable to create sgb library, but it's optional, so continuing..."
  366. fi
  367. fi
  368.  
  369. cd ..
  370.  
  371. # Compile and install gt-itm & sgb2ns
  372.  
  373. echo "============================================================"
  374. echo "* Build GT-ITM"
  375. echo "============================================================"
  376.  
  377. if [ -f ./gt-itm/lib/libgb.a ]
  378. then
  379. if [ ! -f ./gt-itm/src/Makefile ]
  380. then
  381. echo "ns-alline is unable to install gt-itm sgb2ns for you, please install"
  382. echo "them manually. You can't run scenario generator without gt-itm"
  383. echo "and sgb2ns. But it will not affect you use ns, so continue ..."
  384. else
  385. cd ./gt-itm/src
  386. if make
  387. then
  388. echo "gt-itm has been installed successfully."
  389. fi
  390.  
  391. cd ../sgb2ns
  392. if make
  393. then
  394. echo "sgb2ns has been installed successfully."
  395. fi
  396. cd ../../
  397. fi
  398. else
  399. echo "sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing.."
  400. fi
  401.  
  402. # Build zlib
  403.  
  404. echo "============================================================"
  405. echo "* Build zlib"
  406. echo "============================================================"
  407.  
  408. cd ./zlib-$ZLIBVER
  409.  
  410. if ./configure --exec-prefix=../ --prefix=../
  411. then
  412. if make
  413. then
  414. echo "Zlib has been installed successfully."
  415. else
  416. warn "Zlib make failed, but it's optional Continue ..."
  417. fi
  418. else
  419. warn "Zlib-$ZLIBVER configuration failed, but it's optional, so continuing ..."
  420. fi
  421.  
  422. cd ../
  423.  
  424. # Build Tcl8.4.18
  425.  
  426. echo "============================================================"
  427. echo "* Build tcl$TCLVER"
  428. echo "============================================================"
  429.  
  430. cd ./tcl$TCLVER/unix
  431. if [ -f Makefile ] ; then
  432. make distclean
  433. fi
  434.  
  435. blame='Tcl is not part of the ns project. Please see www.Scriptics.com
  436. to see if they have a fix for your platform.'
  437. autoconf
  438. ./configure --enable-gcc --disable-shared --prefix=$CUR_PATH || die "tcl$TCLVER configuration failed! Exiting ..."
  439. if make
  440. then
  441. echo "tcl$TCLVER make succeeded."
  442. make install || die "tcl$TCLVER installation failed."
  443. echo "tcl$TCLVER installation succeeded."
  444. cp ../generic/*.h ../../include
  445. else
  446. echo "tcl$TCLVER make failed! Exiting ..."
  447. echo "For problems with Tcl/Tk see http://www.scriptics.com"
  448. exit
  449. fi
  450.  
  451. cd ../../
  452.  
  453. # compile and install tk
  454.  
  455. echo "============================================================"
  456. echo "* Build Tk$TKVER"
  457. echo "============================================================"
  458.  
  459. cd ./tk$TKVER/unix
  460. if [ -f Makefile ] ; then
  461. make distclean
  462. fi
  463.  
  464. blame='Tk is not part of the ns project. Please see www.Scriptics.com
  465. to see if they have a fix for your platform.'
  466. autoconf
  467. ./configure --disable-shared --prefix=$CUR_PATH || die "tk$TKVER configuration failed! Exiting ..."
  468. if make
  469. then
  470. echo "tk$TKVER build succeeded."
  471. make install || die "tk$TKVER installation failed."
  472. echo "tk$TKVER installation succeeded."
  473. else
  474. echo "tk$TKVER make failed! Exiting ..."
  475. echo "For problems with Tcl/Tk see http://www.scriptics.com"
  476. exit
  477. fi
  478.  
  479. cd ../../
  480.  
  481. #
  482. # Since our configures search for tclsh in $PATH, the following
  483. # is needed. This is necessary for otcl/tclcl/ns/nam
  484. #
  485. PATH=$CUR_PATH/tcl$TCLVER/unix:$CUR_PATH/tk$TKVER/unix:$PATH
  486. export PATH
  487. LD_LIBRARY_PATH=$CUR_PATH/tcl$TCLVER/unix:$CUR_PATH/tk$TKVER/unix:$LD_LIBRARY_PATH
  488. export LD_LIBRARY_PATH
  489.  
  490. # Build otcl
  491.  
  492. echo "============================================================"
  493. echo "* Build OTcl-$OTCLVER"
  494. echo "============================================================"
  495.  
  496. cd ./otcl-$OTCLVER
  497.  
  498. blame='Please check http://www.isi.edu/nsnam/ns/ns-problems.html
  499. for common problems and bug fixes.'
  500. if [ "${test_cygwin}" = "true" ]; then
  501. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "otcl-$OTCLVER configuration failed! Exiting ...";
  502. else
  503. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include CFLAGS="-framework CoreFoundation" || die "otcl-$OTCLVER configuration failed! Exiting ...";
  504. fi
  505.  
  506. if make
  507. then
  508. echo "otcl-$OTCLVER has been installed successfully."
  509. else
  510. echo "otcl-$OTCLVER make failed! Exiting ..."
  511. echo "See http://www.isi.edu/nsnam/ns/ns-problems.html for problems"
  512. exit
  513. fi
  514.  
  515. cd ..
  516.  
  517. # Build tclcl
  518.  
  519. echo "============================================================"
  520. echo "* Build Tclcl-$TCLCLVER"
  521. echo "============================================================"
  522.  
  523. cd ./tclcl-$TCLCLVER
  524.  
  525. if [ "${test_cygwin}" = "true" ]; then
  526. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "tclcl-$TCLCLVER configuration failed! Exiting ...";
  527. else
  528. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include --with-otcl=../otcl-$OTCLVER || die "tclcl-$TCLCLVER configuration failed! Exiting ..."
  529. fi
  530.  
  531. if make
  532. then
  533. echo "tclcl-$TCLCLVER has been installed successfully."
  534. else
  535. echo "tclcl-$TCLCLVER make failed! Exiting ..."
  536. echo "See http://www.isi.edu/nsnam/ns/ns-problems.html for problems"
  537. exit
  538. fi
  539.  
  540. cd ../
  541.  
  542. # John's hack
  543. test -f ./otcl-$OTCLVER/libotcl.a && rm ./otcl-$OTCLVER/libotcl.so
  544.  
  545. echo "============================================================"
  546. echo "* Build ns-$NSVER"
  547. echo "============================================================"
  548.  
  549. cd ./ns-$NSVER
  550. if [ -f Makefile ] ; then
  551. make distclean
  552. fi
  553.  
  554. if [ "${test_cygwin}" = "true" ]; then
  555. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "Ns configuration failed! Exiting ...";
  556. else
  557. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include LIBS="-framework CoreFoundation" --with-otcl=../otcl-$OTCLVER --with-tclcl=../tclcl-$TCLCLVER || die "Ns configuration failed! Exiting ...";
  558. fi
  559.  
  560. if make
  561. then
  562. echo " Ns has been installed successfully."
  563. else
  564. echo "Ns make failed!"
  565. echo "See http://www.isi.edu/nsnam/ns/ns-problems.html for problems"
  566. exit
  567. fi
  568.  
  569. cd ../
  570.  
  571. # Build nam
  572.  
  573. echo "============================================================"
  574. echo "* Build nam-$NAMVER"
  575. echo "============================================================"
  576.  
  577. ln -s otcl-$OTCLVER otcl
  578. ln -s tclcl-$TCLCLVER tclcl
  579.  
  580. cd ./nam-$NAMVER
  581.  
  582. # XXX temporary OS X hack
  583. if [ "${test_darwin}" = "true" ]; then
  584. ln -s /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation libcorefoundation.dylib
  585. fi
  586.  
  587. if [ "${test_cygwin}" = "true" ]; then
  588. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include --with-tclcl=$CUR_PATH/tclcl-$TCLCLVER || die "Nam configuration failed! Exiting ...";
  589. else
  590. ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include V_LIBS="-framework CoreFoundation" --with-otcl=../otcl-$OTCLVER --with-tclcl=../tclcl-$TCLCLVER || die "Nam configuration failed! Exiting ...";
  591. fi
  592.  
  593. if make
  594. then
  595. echo "Nam has been installed successfully."
  596. elif [ "${test_darwin}" = "true" ]; then
  597. # XXX workaround for OS X nam Tcl/Tk problems
  598. echo "Nam make failed! Trying to relink..."
  599. echo "g++ -o nam tkcompat.o tkUnixInit.o xwd.o netview.o netmodel.o edge.o packet.o node.o main.o trace.o queue.o drop.o animation.o agent.o feature.o route.o transform.o paint.o state.o monitor.o anetmodel.o random.o rng.o view.o graphview.o netgraph.o tracehook.o lan.o psview.o group.o editview.o tag.o address.o animator.o wnetmodel.o nam_stream.o enetmodel.o testview.o parser.o trafficsource.o lossmodel.o queuehandle.o gen/version.o gen/nam_tcl.o ../tcl8.4.18/unix/libtcl8.4.a ../tk8.4.18/unix/libtk8.4.a ../tcl8.4.18/unix/libtclstub8.4.a -L../tclcl-1.19 -ltclcl -L../otcl -lotcl -L/usr/lib -lz -L/usr/X11R6/lib -lXext -lX11 -lm -L. -lcorefoundation"
  600. g++ -o nam tkcompat.o tkUnixInit.o xwd.o netview.o netmodel.o edge.o packet.o node.o main.o trace.o queue.o drop.o animation.o agent.o feature.o route.o transform.o paint.o state.o monitor.o anetmodel.o random.o rng.o view.o graphview.o netgraph.o tracehook.o lan.o psview.o group.o editview.o tag.o address.o animator.o wnetmodel.o nam_stream.o enetmodel.o testview.o parser.o trafficsource.o lossmodel.o queuehandle.o gen/version.o gen/nam_tcl.o ../tcl8.4.18/unix/libtcl8.4.a ../tk8.4.18/unix/libtk8.4.a ../tcl8.4.18/unix/libtclstub8.4.a -L../tclcl-1.19 -ltclcl -L../otcl -lotcl -L/usr/lib -lz -L/usr/X11R6/lib -lXext -lX11 -lm -L. -lcorefoundation
  601. if [ -e nam ]; then
  602. echo "Nam relinking succeeded; nam has been installed successfully."
  603. else
  604. echo "Nam make failed! You may want to tweak the above linker path if libraries are not being picked up successfuly. Continue ..."
  605. echo "See http://www.isi.edu/nsnam/ns-problems.html for problems"
  606. fi
  607. else
  608. echo "Nam make failed! Continue ..."
  609. echo "See http://www.isi.edu/nsnam/ns-problems.html for problems"
  610. fi
  611.  
  612. cd ../
  613.  
  614.  
  615.  
  616.  
  617.  
  618. # Building dei80211mr
  619.  
  620. cd ./dei80211mr-${DEI80211MRVER}
  621.  
  622. ./configure --with-ns-allinone=${CUR_PATH} --prefix=${CUR_PATH} \
  623. && make \
  624. && make install
  625.  
  626. cd ..
  627.  
  628.  
  629. # Install nam, ns, xgraph into bin
  630.  
  631. if [ ! -d bin ] ; then
  632. mkdir bin
  633. fi
  634.  
  635. cd bin
  636.  
  637. ln -s $CUR_PATH/ns-$NSVER/ns${EXE} ns${EXE}
  638.  
  639. if test -x $CUR_PATH/nam-$NAMVER/nam${EXE}
  640. then
  641. ln -s $CUR_PATH/nam-$NAMVER/nam${EXE} nam${EXE}
  642. else
  643. echo "Please compile your nam separately."
  644. fi
  645.  
  646. if test -x $CUR_PATH/xgraph-$XGRAPHVER/xgraph${EXE}
  647. then
  648. ln -s $CUR_PATH/xgraph-$XGRAPHVER/xgraph${EXE} xgraph${EXE}
  649. else
  650. echo "Please compile your xgraph separately."
  651. fi
  652.  
  653. if test -x $CUR_PATH/gt-itm/bin/sgb2ns${EXE}
  654. then
  655. ln -s $CUR_PATH/gt-itm/bin/sgb2ns${EXE} sgb2ns${EXE}
  656. ln -s $CUR_PATH/gt-itm/bin/sgb2hierns${EXE} sgb2hierns${EXE}
  657. ln -s $CUR_PATH/gt-itm/bin/sgb2comns${EXE} sgb2comns${EXE}
  658. ln -s $CUR_PATH/gt-itm/bin/itm${EXE} itm${EXE}
  659. ln -s $CUR_PATH/gt-itm/bin/sgb2alt${EXE} sgb2alt${EXE}
  660. ln -s $CUR_PATH/gt-itm/bin/edriver${EXE} edriver${EXE}
  661. else
  662. echo "Please compile your gt-itm & sgb2ns separately."
  663. fi
  664.  
  665. echo ""
  666. echo "Ns-allinone package has been installed successfully."
  667. echo "Here are the installation places:"
  668. echo "tcl$TCLVER: $CUR_PATH/{bin,include,lib}"
  669. echo "tk$TKVER: $CUR_PATH/{bin,include,lib}"
  670. echo "otcl: $CUR_PATH/otcl-$OTCLVER"
  671. echo "tclcl: $CUR_PATH/tclcl-$TCLCLVER"
  672. echo "ns: $CUR_PATH/ns-$NSVER/ns"
  673.  
  674. if [ -x $CUR_PATH/nam-$NAMVER/nam ]
  675. then
  676. echo "nam: $CUR_PATH/nam-$NAMVER/nam"
  677. fi
  678.  
  679. if [ -x $CUR_PATH/xgraph-$XGRAPHVER/xgraph ]
  680. then
  681. echo "xgraph: $CUR_PATH/xgraph-$XGRAPHVER"
  682. fi
  683. if [ -x $CUR_PATH/gt-itm/bin/sgb2ns ]
  684. then
  685. echo "gt-itm: $CUR_PATH/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns"
  686. fi
  687.  
  688. echo ""
  689. echo "----------------------------------------------------------------------------------"
  690. echo ""
  691. echo "Please put $CUR_PATH/bin:$CUR_PATH/tcl$TCLVER/unix:$CUR_PATH/tk$TKVER/unix"
  692. echo "into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph."
  693. echo ""
  694. echo "IMPORTANT NOTICES:"
  695. echo ""
  696. echo "(1) You MUST put $CUR_PATH/otcl-$OTCLVER, $CUR_PATH/lib, "
  697. echo " into your LD_LIBRARY_PATH environment variable."
  698. echo " If it complains about X libraries, add path to your X libraries "
  699. echo " into LD_LIBRARY_PATH."
  700. echo " If you are using csh, you can set it like:"
  701. echo " setenv LD_LIBRARY_PATH <paths>"
  702. echo " If you are using sh, you can set it like:"
  703. echo " export LD_LIBRARY_PATH=<paths>"
  704. echo ""
  705. echo "(2) You MUST put $CUR_PATH/tcl$TCLVER/library into your TCL_LIBRARY environmental"
  706. echo " variable. Otherwise ns/nam will complain during startup."
  707. echo ""
  708. echo ""
  709. echo "After these steps, you can now run the ns validation suite with"
  710. echo "cd ns-$NSVER; ./validate"
  711. echo ""
  712. echo "For trouble shooting, please first read ns problems page "
  713. echo "http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive"
  714. echo "for related posts."
  715. echo ""
  716.  
  717. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement