~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Open Mash Cross Reference
mash/conf/configure.in.tcl

Component: ~ [ mash ] ~ [ apps ] ~ [ gsm ] ~ [ lib ] ~ [ otcl ] ~ [ srm ] ~ [ tcl8.3 ] ~ [ tclcl ] ~ [ tk8.3 ] ~ [ tutorials ] ~

  1 dnl configure.in.tcl --
  2 dnl
  3 dnl     autoconf rules to find tcl
  4 dnl
  5 dnl Copyright (c) 2000-2002 The Regents of the University of California.
  6 dnl All rights reserved.
  7 dnl
  8 dnl Redistribution and use in source and binary forms, with or without
  9 dnl modification, are permitted provided that the following conditions are met:
 10 dnl
 11 dnl A. Redistributions of source code must retain the above copyright notice,
 12 dnl    this list of conditions and the following disclaimer.
 13 dnl B. Redistributions in binary form must reproduce the above copyright
 14 dnl    notice, this list of conditions and the following disclaimer in the
 15 dnl    documentation and/or other materials provided with the distribution.
 16 dnl C. Neither the names of the copyright holders nor the names of its
 17 dnl    contributors may be used to endorse or promote products derived from
 18 dnl    this software without specific prior written permission.
 19 dnl
 20 dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
 21 dnl IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 22 dnl THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 23 dnl PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
 24 dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 25 dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 26 dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 27 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 28 dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 29 dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 30 dnl POSSIBILITY OF SUCH DAMAGE.
 31 dnl
 32 dnl $Header: /usr/mash/src/repository/conf/configure.in.tcl,v 1.13 2004/12/07 22:54:48 aswan Exp $
 33 
 34 AC_ARG_WITH(tcl, [  --with-tcl=path     specify a pathname for tcl], d=$withval, d="")
 35 
 36 AC_ARG_WITH(tcl-ver, [  --with-tcl-ver=path     specify the version of tcl], TCL_VERS=$withval, TCL_VERS=8.3.3)
 37 
 38 if test "$macosx" = "yes" ; then
 39         framework_places="\
 40                 $HOME/Library/Frameworks \
 41                 /Library/Frameworks \
 42                 /Network/Library/Frameworks \
 43                 /System/Library/Frameworks"
 44 
 45         AC_MSG_CHECKING(for Tcl)
 46         tcl_framework="notfound"
 47         for f in $framework_places ; do
 48                 if test -r $f/Tcl.framework/Versions/Current/Tcl ; then
 49                         tcl_framework=$f
 50                         break
 51                 fi
 52         done
 53         AC_MSG_RESULT($tcl_framework)
 54 
 55         if test "$tcl_framework" = "notfound" ; then
 56                 AC_MSG_ERROR(Cannot find Tcl)
 57         fi
 58 
 59         V_TCLSH="/usr/bin/tclsh"
 60         V_LIBRARY_TCL="$tcl_framework/Tcl.framework/Resources/Scripts"
 61 
 62         V_INCLUDES="$V_INCLUDES -I$tcl_framework/Tcl.framework/Headers -I$tcl_framework/Tcl.framework/PrivateHeaders"
 63         V_LIB_TCL="-F$tcl_framework -framework Tcl"
 64 else
 65 
 66         dnl Truncate anything beyond and including the second decimal point
 67         TCL_HI_VERS=`echo $TCL_VERS | sed 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1.\2/'`
 68         TCL_MAJOR_VERS=`echo $TCL_VERS | sed 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
 69         TCL_ALT_VERS=`echo $TCL_HI_VERS | sed 's/\.//'`
 70 
 71         dnl These paths are pretty hellish and should probably be pruned.
 72         TCL_TCL_PLACES_D="$d \
 73                 $d/lib/tcl$TCL_HI_VERS \
 74                 $d/lib/tcl$TCL_VERS \
 75                 $d/lib/tcl$TCL_ALT_VERS \
 76                 $d/lib/tcl \
 77                 $d/../lib/tcl$TCL_HI_VERS \
 78                 $d/../lib/tcl$TCL_VERS \
 79                 $d/../lib/tcl$TCL_ALT_VERS \
 80                 $d/lib \
 81                 $d/library \
 82                 $d/../library"
 83         TCL_TCL_PLACES="../lib/tcl$TCL_HI_VERS \
 84                 ../lib/tcl$TCL_ALT_VERS \
 85                 ../lib/tcl$TCL_VERS \
 86                 ../lib/tcl \
 87                 ../tcl$TCL_HI_VERS/library \
 88                 ../tcl$TCL_VERS/library \
 89                 ../tcl$TCL_ALT_VERS/library \
 90                 /usr/lib/tcl$TCL_VERS \
 91                 /usr/lib/tcl$TCL_HI_VERS \
 92                 /usr/lib/tcl$TCL_ALT_VERS \
 93                 /usr/lib/tcl \
 94                 /lib/tcl$TCL_VERS \
 95                 /lib/tcl$TCL_HI_VERS \
 96                 /lib/tcl$TCL_ALT_VERS \
 97                 /usr/lib \
 98                 /usr/src/local/tcl$TCL_VERS/library \
 99                 /usr/src/local/tcl$TCL_HI_VERS/library \
100                 /usr/src/local/tcl$TCL_ALT_VERS/library \
101                 /usr/local/lib/tcl$TCL_VERS \
102                 /usr/local/lib/tcl$TCL_HI_VERS \
103                 /usr/local/lib/tcl$TCL_ALT_VERS \
104                 /usr/local/include/tcl$TCL_VERS \
105                 /usr/local/include/tcl$TCL_HI_VERS \
106                 /usr/local/include/tcl$TCL_ALT_VERS \
107                 /usr/local/include \
108                 $prefix/include \
109                 $prefix/lib/tcl \
110                 $x_includes/tk \
111                 $x_includes \
112                 /usr/contrib/include \
113                 /usr/include"
114         TCL_H_PLACES_D="$d/generic \
115                 $d/../generic \
116                 $d/unix \
117                 $d/include/tcl$TCL_HI_VERS \
118                 $d/include/tcl$TCL_VERS \
119                 $d/include/tcl$TCL_ALT_VERS \
120                 $d/include \
121                 "
122         TCL_H_PLACES=" \
123                 ../include \
124                 ../tcl$TCL_VERS/unix \
125                 ../tcl$TCL_ALT_VERS/unix \
126                 ../tcl$TCL_HI_VERS/generic \
127                 ../tcl$TCL_VERS/generic \
128                 ../tcl$TCL_ALT_VERS/generic \
129                 /usr/src/local/tcl$TCL_VERS/generic \
130                 /usr/src/local/tcl$TCL_HI_VERS/generic \
131                 /usr/src/local/tcl$TCL_ALT_VERS/generic \
132                 /usr/src/local/tcl$TCL_VERS/unix \
133                 /usr/src/local/tcl$TCL_HI_VERS/unix \
134                 /usr/src/local/tcl$TCL_ALT_VERS/unix \
135                 /usr/contrib/include \
136                 /usr/local/lib/tcl$TCL_VERS \
137                 /usr/local/lib/tcl$TCL_HI_VERS \
138                 /usr/local/lib/tcl$TCL_ALT_VERS \
139                 /usr/local/include/tcl$TCL_VERS \
140                 /usr/local/include/tcl$TCL_HI_VERS \
141                 /usr/local/include/tcl$TCL_ALT_VERS \
142                 /usr/local/include \
143                 /import/tcl/include/tcl$TCL_VERS \
144                 /import/tcl/include/tcl$TCL_HI_VERS \
145                 /import/tcl/include/tcl$TCL_ALT_VERS \
146                 $prefix/include \
147                 $x_includes/tk \
148                 $x_includes \
149                 /usr/include \
150                 /usr/include/tcl$TCL_VERS \
151                 /usr/include/tcl$TCL_HI_VERS \
152                 /usr/include/tcl$TCL_ALT_VERS \
153                 /usr/include/tcl"
154 
155         TCL_LIB_PLACES_D="$d \
156                 $d/lib \
157                 $d/unix"
158         TCL_LIB_PLACES=" \
159                 ../lib \
160                 ../tcl$TCL_VERS/unix \
161                 ../tcl$TCL_HI_VERS/unix \
162                 ../tcl$TCL_ALT_VERS/unix \
163                 /usr/src/local/tcl$TCL_VERS/unix \
164                 /usr/src/local/tcl$TCL_HI_VERS/unix \
165                 /usr/src/local/tcl$TCL_ALT_VERS/unix \
166                 /usr/contrib/lib \
167                 /usr/local/lib/tcl$TCL_VERS \
168                 /usr/local/lib/tcl$TCL_HI_VERS \
169                 /usr/local/lib/tcl$TCL_ALT_VERS \
170                 /usr/lib/tcl$TCL_VERS \
171                 /usr/lib/tcl$TCL_HI_VERS \
172                 /usr/lib/tcl$TCL_ALT_VERS \
173                 /usr/local/lib \
174                 $prefix/lib \
175                 $x_libs/tk \
176                 $x_libs \
177                 /usr/lib \
178                 "
179 
180         dnl
181         dnl If the --with-tcl argument points to a build directory that
182         dnl is separate from the source directory, try to read tclConfig.sh
183         dnl to chase it back to the source and add that directory to
184         dnl some search paths.
185         dnl
186 
187         if test -r $d/tclConfig.sh ; then
188                 d2=`(. $d/tclConfig.sh ; echo $TCL_SRC_DIR)`
189 
190                 TCL_TCL_PLACES_D="${TCL_TCL_PLACES_D} $d2/library"
191                 TCL_H_PLACES_D="${TCL_H_PLACES_D} $d2/generic"
192         fi
193 
194 
195         NS_BEGIN_PACKAGE(tcl)
196         NS_CHECK_HEADER_PATH(tcl.h,$TCL_H_PLACES,$d,$TCL_H_PLACES_D,V_INCLUDE_TCL,tcl)
197         NS_CHECK_LIB_PATH(tcl$TCL_HI_VERS,$TCL_LIB_PLACES,$d,$TCL_LIB_PLACES_D,V_LIB_TCL,tcl)
198         NS_CHECK_ANY_PATH(init.tcl,$TCL_TCL_PLACES,$d,$TCL_TCL_PLACES_D,V_LIBRARY_TCL,tcl)
199 
200         #
201         # check for tclsh
202         #
203         # We need to check the possible paths separately to avoid picking up a
204         # non-working local version of tclsh instead of the working tclsh
205         # distributed with Mash.
206         #
207         # First, check user-specified Tcl path, if specified.
208         # $d alone works if the --with-tcl arg points to the build dir
209         # $d/unix works if $d is the 8.0 distribution
210         # $d/bin is for the ns-allinone distribution (kind of hacky, isn't it?)
211         #
212         if test x"$d" = x; then
213                 V_TCLSH=no
214         else
215                 AC_PATH_PROGS(V_TCLSH,tclsh$TCL_VERS tclsh$TCL_HI_VERS tclsh,no,$d:$d/unix:$d/bin)
216         fi
217         if test x"$V_TCLSH" = xno; then
218                 #
219                 # Next, check Tcl distributed with Mash.
220                 #
221                 TCLSH_PLACES="../tcl$TCL_VERS/unix:../tcl$TCL_HI_VERS/unix:../tcl$TCL_VERS:../tcl$TCL_HI_VERS"
222                 AC_PATH_PROGS(V_TCLSH,tclsh$TCL_VERS tclsh$TCL_HI_VERS tclsh ,no,$TCLSH_PLACES)
223                 if test x"$V_TCLSH" = xno; then
224                         #
225                         # Last resort, check user's path.
226                         #
227                         AC_PATH_PROGS(V_TCLSH,tclsh$TCL_VERS tclsh$TCL_HI_VERS tclsh,no)
228                         if test x"$V_TCLSH" = xno; then
229                                 # out of luck
230                                 NS_PACKAGE_NOT_COMPLETE(tcl)
231                         fi
232                 fi
233         fi
234 
235         # absolutize it
236         V_TCLSH=`absolutize $V_TCLSH`
237 
238         # in case this tclsh has not been installed, make sure we
239         # give it the full path to the runtime library files
240         V_TCLSH="env TCL_LIBRARY=$V_LIBRARY_TCL $V_TCLSH"
241 
242         NS_END_PACKAGE(tcl,yes)
243 
244 fi
245 
246 AC_SUBST(V_LIBRARY_TCL)
247 
248 if test -d "$V_LIBRARY_TCL/http2.4" ; then
249         V_TCL_HTTP_DIR="http2.4"
250 else
251         V_TCL_HTTP_DIR="http"
252 fi
253 AC_SUBST(V_TCL_HTTP_DIR)
254 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.