mac下修改后的ns2 install文件

来源:互联网 发布:去香港用什么网络 编辑:程序博客网 时间:2024/06/16 02:19
 

#! /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. 

# $Header: /cvsroot/nsnam/ns-2/allinone/install,v 1.31 2007/03/10 23:40:05 tom_henderson Exp $ 

X_INCL = /Developer/SDKs/MacOSX10.6.sdk/usr/X11R6/include 
X_LIBS = /Developer/SDKs/MacOSX10.6.sdk/usr/X11R6/lib 
MACOS_CONF = "--x-include=$X_INCL --x-libraries=$X_LIBS" 


die() { 
        echo "$@"  1>&2 
        test ! -z "$blame" && echo "$blame" 1>&2 
        exit 1 


warn() { 
        echo "$@" 

。。。

。。。

# Build otcl 

echo "============================================================" 
echo "* Build OTcl-$OTCLVER" 
echo "============================================================" 

cd ./otcl-$OTCLVER 

blame='Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.' 
if  [ "${test_cygwin}" = "true" ]; then 
        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "otcl-$OTCLVER configuration failed! Exiting ..."; 
else 
        ./configure
--x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include CFLAGS="-framework CoreFoundation" || die "otcl-$OTCLVER configuration failed! Exiting ..."; 
fi 

if make 
then 
        echo "otcl-$OTCLVER has been installed successfully." 
else 
        echo "otcl-$OTCLVER make failed! Exiting ..." 
        echo "See http://www.isi.edu/nsnam/ns/ns-problems.html for problems" 
        exit 
fi 

cd .. 

# Build tclcl 

echo "============================================================" 
echo "* Build Tclcl-$TCLCLVER" 
echo "============================================================" 

cd ./tclcl-$TCLCLVER 

if  [ "${test_cygwin}" = "true" ]; then 
        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "tclcl-$TCLCLVER configuration failed! Exiting ..."; 
else 
        ./configure
--x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include--with-otcl=../otcl-$OTCLVER || die "tclcl-$TCLCLVER configuration failed! Exiting ..." 
fi 

if make 
then 
        echo "tclcl-$TCLCLVER has been installed successfully." 
else 
        echo "tclcl-$TCLCLVER make failed! Exiting ..." 
        echo "See http://www.isi.edu/nsnam/ns/ns-problems.html for problems" 
        exit 
fi

cd ../ 

# John's hack 
test -f ./otcl-$OTCLVER/libotcl.a && rm ./otcl-$OTCLVER/libotcl.so 

echo "============================================================" 
echo "* Build ns-$NSVER" 
echo "============================================================" 

cd ./ns-$NSVER 
if [ -f Makefile ] ; then 
        make distclean 
fi 

if  [ "${test_cygwin}" = "true" ]; then 
        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "Ns configuration failed! Exiting ..."; 
else 
        ./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 ..."; 
fi 

if make 
then 
        echo " Ns has been installed successfully." 
else 
        echo "Ns make failed!" 
        echo "See http://www.isi.edu/nsnam/ns/ns-problems.html for problems" 
        exit 
fi 

cd ../ 

# Build nam 

echo "============================================================" 
echo "* Build nam-$NAMVER" 
echo "============================================================" 

ln -s otcl-$OTCLVER otcl 
ln -s tclcl-$TCLCLVER tclcl 

cd ./nam-$NAMVER 

# XXX temporary OS X hack 
if  [ "${test_darwin}" = "true" ]; then 
ln -s /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation libcorefoundation.dylib 
fi 

if  [ "${test_cygwin}" = "true" ]; then 
        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include --with-tclcl=$CUR_PATH/tclcl-$TCLCLVER  || die "Nam configuration failed! Exiting ..."; 
else 
        ./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 ..."; 
fi

原创粉丝点击