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

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

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

  1 dnl configure.in.head --
  2 dnl
  3 dnl     standard setup for vic/vat/etc. autoconf scripts.
  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.head,v 1.17 2004/12/07 22:30:48 aswan Exp $
 33 
 34 
 35 AC_ARG_WITH(defaultoptions, [  --with-defaultoptions[=filename]
 36                         use <filename> as default options file], , with_defaultoptions=".configure")
 37 
 38 if test "$with_defaultoptions" = "yes" ; then
 39         with_defaultoptions=".configure"
 40 elif test "$with_defaultoptions" = "no" ; then
 41         with_defaultoptions=""
 42 fi
 43 
 44 if test -n "$with_defaultoptions" ; then
 45         if test -f "$with_defaultoptions" ; then
 46                 read arglist < $with_defaultoptions
 47 
 48                 if test -n "$arglist" ; then
 49                         arguments="$0 $arglist $* --without-defaultoptions"
 50                         echo "Restarting: $arguments"
 51                         exec $arguments
 52                 fi
 53         else
 54                 if test "$with_defaultoptions" = ".configure" ; then
 55                         echo No .configure file found in current directory
 56                         echo Continuing with default options...
 57                 else
 58                         echo Cannot find file $with_defaultoptions
 59                         echo Aborting configure...
 60                         exit 1
 61                 fi
 62         fi
 63 fi
 64 
 65 
 66 AC_CANONICAL_SYSTEM
 67 
 68 AC_PROG_CC
 69 AC_PROG_CXX
 70 AC_STDC_HEADERS
 71 AC_HAVE_HEADERS(string.h)
 72 
 73 V_INCLUDE=""
 74 V_LIB=""
 75 V_OBJ=""
 76 V_BROKEN_OBJ="strtol.o strtoul.o"
 77 
 78 V_SHELL=""
 79 V_TARCMD="tar cfh"
 80 V_SIGRET="void"
 81 
 82 AC_CHECK_LIB(Xbsd, main, [V_LIB="$V_LIB -lXbsd"])
 83 AC_CHECK_LIB(socket, socket, [V_LIB="$V_LIB -lsocket"])
 84 AC_CHECK_LIB(c, gethostbyname, , [
 85     AC_CHECK_LIB(nsl, gethostbyname, [V_LIB="$V_LIB -lnsl"])
 86 ])
 87 AC_CHECK_LIB(intl, dcgettext, [V_LIB="$V_LIB -lintl"])
 88 AC_CHECK_LIB(dnet_stub, getnodebyname, [V_LIB="$V_LIB -ldnet_stub"])
 89 
 90 V_TAR_EXTRA=""
 91 V_DEFINE=""
 92 
 93 V_RANLIB=ranlib
 94 V_AR="ar cr"
 95 
 96 #FIXME
 97 V_SHM="-DUSE_SHM"
 98 
 99 AC_ARG_ENABLE(release, [  --enable-release      do a release build [default off]], , enable_release="no")
100 AC_ARG_ENABLE(debug, [  --enable-debug  build with debugging enabled [default off]], , enable_debug="no")
101 AC_ARG_ENABLE(devel, [  --enable-devel  do a development build [default on]], , enable_devel="yes")
102 
103 if test "$enable_devel" = yes ; then
104         enable_debug="yes"
105         OonS=""
106 else
107     if test "$CC" = gcc ; then
108             AC_MSG_CHECKING(that $CXX can handle -O2)
109             AC_TRY_COMPILE(,
110                 #if __GNUC__ < 2  || __GNUC_MINOR__ < 8
111                 /* gcc */
112                 error
113                 #endif
114                 #if __GNUC_MINOR__ < 92
115                 /* egcs */
116                 int error;
117                 #endif
118             ,AC_MSG_RESULT(yes)
119             OonS="-O2",                 # Optimize on Steroids
120             AC_MSG_RESULT(no))
121     fi
122 fi
123 
124 if test "$enable_debug" = yes ; then
125         V_CCOPT="-g"
126         if test "$CC" = gcc ; then
127                 V_CCOPT="$V_CCOPT -Wall"
128                 V_DEFINE="$V_DEFINE -fsigned-char -fno-inline"
129         fi
130 else
131         V_CCOPT="$OonS"
132         V_DEFINE="$V_DEFINE -DNDEBUG"
133 fi
134 
135 # XXX Some stupid sh on solaris does not set PWD correctly, i.e.,
136 # after chdir $PWD remains at the parent directory. :( 
137 # We'll just do this every time. Doesn't hurt anyway.
138 if test `pwd` != "$PWD"; then
139         PWD=`pwd`
140 fi
141 
142 solaris=""
143 macosx="no"
144 
145 MASH_FINAL_TARGET="mash_link"
146 AC_SUBST(MASH_FINAL_TARGET)
147 
148 V_OBJ_C="misc/random-c.o"
149 AC_SUBST(V_OBJ_C)
150 
151 case "$target_os" in
152     solaris2.*)
153         solaris="yes"
154         ;;
155 
156     darwin*)
157         macosx="yes"
158         MASH_FINAL_TARGET="mash_app"
159         V_OBJ_C=""
160         ;;
161 esac
162 
163         
164 
165 # We now default to non-static linking.
166 #
167 AC_ARG_ENABLE(static, [  --enable-static        enable/disable static building], , enable_static="")
168 
169 
170 # Check for existence of sockaddr_in.sin_len
171 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
172         [ V_DEFINE="$V_DEFINE -DHAVE_SOCKADDR_IN_SIN_LEN" ],
173         [],
174 [
175 #include <netinet/in.h>
176 ])
177 
178 # Check for getifaddrs() and snprintf()
179 AC_CHECK_FUNCS(getifaddrs snprintf)
180 
181 
182 # This is required by configure.in.tcl to provide absolute pathnames for 
183 # tclsh, and configure.in.tail to absolutize V_INCLUDES and V_LIBS.
184 absolutize() {
185     case $1 in
186     -L*) p=`echo $1 | sed 's/^-L//'` ;;
187     -I*) p=`echo $1 | sed 's/^-I//'` ;;
188     *) p=$1 ;;
189     esac
190     d=`dirname $p`
191     f=`basename $p`
192     ad=`(
193         cd $d
194         pwd
195     )`
196     case $1 in
197     -L*) echo -L$ad/$f ;;
198     -I*) echo -I$ad/$f ;;
199     *) echo $ad/$f ;;
200     esac
201 }

~ [ 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.