Debian Codegraph @

pTk/mTk/tixUnix/tk8.2/configure.in

raw
1 dnl $Id: configure.in,v 1.1 2000/11/03 00:14:28 idiscovery Exp $
2 dnl This file is an input file used by the GNU "autoconf" program to
3 dnl generate the file "configure", which is run to configure the
4 dnl Makefile in this directory.
5
6 AC_INIT(../../generic/tixInit.c)
7
8 #--------------------------------------------------------------------
9 # Remove the ./config.cache file and rerun configure if
10 # the cache file belong to a different architecture
11 #
12 # This doesn't seem to work in the Cygnus environment,
13 # it causes an error message about having more than
14 # one target, so I disabled it. [email protected]
15 #----------------------------------------------------------------------
16 #AC_CHECK_PROG(UNAME, uname -a, [uname -a], "")
17 #if test "$UNAME" = ""; then
18 # AC_CHECK_PROG(UNAME, uname, [uname], "")
19 #fi
20 #
21 #if test "$UNAME" != ""; then
22 # uname=`$UNAME`
23 # AC_MSG_CHECKING([cached value of \$uname])
24 # AC_CACHE_VAL(ac_cv_prog_uname, [nocached=1 ac_cv_prog_uname=`$UNAME`])
25 # if test "$nocached" = "1"; then
26 # AC_MSG_RESULT(no)
27 # else
28 # AC_MSG_RESULT(yes)
29 # fi
30 #
31 # if test "$uname" != "$ac_cv_prog_uname"; then
32 # echo "Running on a different machine/architecture. Can't use cached values"
33 # echo "Removing config.cache and running configure again ..."
34 # rm -f config.cache
35 # CMDLINE="$0 $*"
36 # exec $CMDLINE
37 # fi
38 #fi
39
40 #----------------------------------------------------------------------
41 # We don't want to use any relative path because we need to generate
42 # Makefile's in subdirectories
43 #----------------------------------------------------------------------
44 if test "$INSTALL" = "./install.sh"; then
45 INSTALL=`pwd`/install.sh
46 fi
47
48 #--------------------------------------------------------------------
49 # Version information about this TIX release.
50 #--------------------------------------------------------------------
51
52 TIX_VERSION=8.1
53 TIX_MAJOR_VERSION=8
54 TIX_MINOR_VERSION=1
55
56 BIN_VERSION=${TIX_VERSION}.8.2
57
58
59 VERSION=${BIN_VERSION}
60
61 #--------------------------------------------------------------------
62 # See if user wants to use gcc to compile Tix. This option must
63 # be used before any checking that uses the C compiler.
64 #--------------------------------------------------------------------
65
66 AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available],
67 [tix_ok=$enableval], [tix_ok=no])
68 if test "$tix_ok" = "yes"; then
69 AC_PROG_CC
70 else
71 CC=${CC-cc}
72 AC_SUBST(CC)
73 fi
74
75 AC_PROG_INSTALL
76 AC_PROG_RANLIB
77 AC_HAVE_HEADERS(unistd.h limits.h)
78 AC_PROG_MAKE_SET
79
80 #--------------------------------------------------------------------
81 # unsigned char is not supported by some non-ANSI compilers.
82 #--------------------------------------------------------------------
83
84 AC_MSG_CHECKING([unsigned char])
85 AC_TRY_COMPILE([#include <stdio.h>],[
86 unsigned char c = 'c';
87 ], tcl_ok=supported, tcl_ok=notsupported)
88
89 AC_MSG_RESULT($tcl_ok)
90 if test $tcl_ok = supported; then
91 AC_DEFINE(UCHAR_SUPPORTED)
92 fi
93
94 #--------------------------------------------------------------------
95 # Check whether there is an strcasecmp function on this system.
96 # This is a bit tricky because under SCO it's in -lsocket and
97 # under Sequent Dynix it's in -linet.
98 #--------------------------------------------------------------------
99
100 AC_CHECK_FUNC(strcasecmp, tcl_ok=1, tcl_ok=0)
101 if test "$tcl_ok" = 0; then
102 AC_CHECK_LIB(socket, strcasecmp, tcl_ok=1, tcl_ok=0)
103 fi
104 if test "$tcl_ok" = 0; then
105 AC_CHECK_LIB(inet, strcasecmp, tcl_ok=1, tcl_ok=0)
106 fi
107 if test "$tcl_ok" = 0; then
108 AC_DEFINE(NO_STRCASECMP)
109 fi
110
111 # Check for Tcl and Tk.
112 CYG_AC_PATH_TCLCONFIG
113 CYG_AC_LOAD_TCLCONFIG
114 CYG_AC_PATH_TKCONFIG
115 CYG_AC_LOAD_TKCONFIG
116 CYG_AC_PATH_TCLH
117 # FIXME: consider only doing this if --with-x given.
118 CYG_AC_PATH_TKH
119
120 #--------------------------------------------------------------------
121 # Find out the top level source directory of the Tix package.
122 #--------------------------------------------------------------------
123 TIX_SRC_DIR=`cd ${srcdir}/../..; pwd`
124
125 #--------------------------------------------------------------------
126 # See if we should compile SAM
127 #--------------------------------------------------------------------
128
129 AC_ARG_ENABLE(sam,
130 [ --enable-sam build stand-alone modules],
131 [ok=$enableval], [ok=no])
132
133 if test "$ok" = "yes"; then
134 TIX_BUILD_SAM="yes"
135 TIX_SAM_TARGETS='$(SAM_TARGETS)'
136 else
137 TIX_BUILD_SAM="no"
138 fi
139
140 TIX_SAM_INSTALL=_install_sam_lib_
141
142 IS_ITCL=0
143 ITCL_BUILD_LIB_SPEC=""
144 ITK_BUILD_LIB_SPEC=""
145 TIX_EXE_FILE=tixwish
146 TCL_SAMEXE_FILE=satclsh
147 TK_SAMEXE_FILE=sawish
148 TIX_SAMEXE_FILE=satixwish
149
150 #--------------------------------------------------------------------
151 # Read in configuration information generated by Tcl for shared
152 # libraries, and arrange for it to be substituted into our
153 # Makefile.
154 #--------------------------------------------------------------------
155
156 CC=$TCL_CC
157 SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
158 SHLIB_LD=$TCL_SHLIB_LD
159 SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
160 SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
161 SHLIB_VERSION=$TCL_SHLIB_VERSION
162
163 DL_LIBS=$TCL_DL_LIBS
164 LD_FLAGS=$TCL_LD_FLAGS
165 TIX_LD_SEARCH_FLAGS=$TK_LD_SEARCH_FLAGS
166
167 #--------------------------------------------------------------------
168 # Read in configuration information generated by Tk and arrange
169 # for it to be substituted into our Makefile.
170 #--------------------------------------------------------------------
171
172 TIX_DEFS="$TK_DEFS $TCL_DEFS"
173
174 # Note: in the following variable, it's important to use the absolute
175 # path name of the Tcl directory rather than "..": this is because
176 # AIX remembers this path and will attempt to use it at run-time to look
177 # up the Tcl library.
178
179 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
180 TIX_BUILD_LIB_SPEC="-L`pwd` -ltix${VERSION}"
181 TIX_BUILD_SAM_SPEC="-L`pwd` -ltixsam${VERSION}"
182 TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam${TCL_VERSION}"
183 TK_BUILD_SAM_SPEC="-L`pwd` -ltksam${TK_VERSION}"
184 TIX_LIB_SPEC="-L${exec_prefix}/lib -ltix${VERSION}"
185 else
186 TIX_BUILD_LIB_SPEC="-L`pwd` -ltix`echo ${VERSION} | tr -d .`"
187 TIX_BUILD_SAM_SPEC="-L`pwd` -ltixsam`echo ${VERSION} | tr -d .`"
188 TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam`echo ${TCL_VERSION} | tr -d .`"
189 TK_BUILD_SAM_SPEC="-L`pwd` -ltksam`echo ${TK_VERSION} | tr -d .`"
190 TIX_LIB_SPEC="-L${exec_prefix}/lib -ltix`echo ${VERSION} | tr -d .`"
191 fi
192
193 #--------------------------------------------------------------------
194 # See if we should compile shared library.
195 #--------------------------------------------------------------------
196
197 AC_ARG_ENABLE(shared,
198 [ --enable-shared build libtix as a shared library],
199 [ok=$enableval], [ok=no])
200
201 if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then
202 TIX_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
203 TIX_RANLIB=":"
204
205 # The main Tix library
206 #
207 eval "TIX_LIB_FILE=libtix${TCL_SHARED_LIB_SUFFIX}"
208 TIX_MAKE_LIB="\${SHLIB_LD} -o ${TIX_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
209
210 # The Tcl SAM library
211 #
212 VERSION=8.2
213 eval "TCL_SAM_FILE=libtclsam${TCL_SHARED_LIB_SUFFIX}"
214 TCL_MAKE_SAM="\${SHLIB_LD} -o ${TCL_SAM_FILE} \${TCL_SAM_OBJS} ${SHLIB_LD_LIBS}"
215
216 # The Tk SAM library
217 #
218 VERSION=8.2
219 eval "TK_SAM_FILE=libtksam${TCL_SHARED_LIB_SUFFIX}"
220 TK_MAKE_SAM="\${SHLIB_LD} -o ${TK_SAM_FILE} \${TK_SAM_OBJS} ${SHLIB_LD_LIBS}"
221
222 # The Tix SAM library
223 #
224 VERSION=${BIN_VERSION}
225 eval "TIX_SAM_FILE=libtixsam${TCL_SHARED_LIB_SUFFIX}"
226 TIX_MAKE_SAM="\${SHLIB_LD} -o ${TIX_SAM_FILE} \${TIX_SAM_OBJS} ${SHLIB_LD_LIBS}"
227
228 else
229 TIX_SHLIB_CFLAGS=""
230 TIX_RANLIB='$(RANLIB)'
231
232 # The main Tix library
233 #
234 eval "TIX_LIB_FILE=libtix${TCL_UNSHARED_LIB_SUFFIX}"
235 TIX_MAKE_LIB="ar cr ${TIX_LIB_FILE} \${OBJS}"
236
237 # The Tcl SAM library
238
239 VERSION=8.2
240 eval "TCL_SAM_FILE=libtclsam${TCL_UNSHARED_LIB_SUFFIX}"
241 TCL_MAKE_SAM="ar cr ${TCL_SAM_FILE} \${TCL_SAM_OBJS}"
242
243 # The Tk SAM library
244 #
245 VERSION=8.2
246 eval "TK_SAM_FILE=libtksam${TCL_UNSHARED_LIB_SUFFIX}"
247 TK_MAKE_SAM="ar cr ${TK_SAM_FILE} \${TK_SAM_OBJS}"
248
249 # The Tix SAM library
250 #
251 VERSION=${BIN_VERSION}
252 eval "TIX_SAM_FILE=libtixsam${TCL_UNSHARED_LIB_SUFFIX}"
253 TIX_MAKE_SAM="ar cr ${TIX_SAM_FILE} \${TIX_SAM_OBJS}"
254 fi
255
256
257 #--------------------------------------------------------------------
258 # Check for the existence of the -lsocket and -lnsl libraries.
259 # The order here is important, so that they end up in the right
260 # order in the command line generated by make. Here are some
261 # special considerations:
262 # 1. Use "connect" and "accept" to check for -lsocket, and
263 # "gethostbyname" to check for -lnsl.
264 # 2. Use each function name only once: can't redo a check because
265 # autoconf caches the results of the last check and won't redo it.
266 # 3. Use -lnsl and -lsocket only if they supply procedures that
267 # aren't already present in the normal libraries. This is because
268 # IRIX 5.2 has libraries, but they aren't needed and they're
269 # bogus: they goof up name resolution if used.
270 # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
271 # To get around this problem, check for both libraries together
272 # if -lsocket doesn't work by itself.
273 #--------------------------------------------------------------------
274
275 checked=0
276 for i in $TK_LIBS; do
277 if test "$i" = "-lsocket"; then
278 checked=1
279 fi
280 done
281
282 if test "$checked" = "0"; then
283 tcl_checkBoth=0
284 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
285 if test "$tcl_checkSocket" = 1; then
286 AC_CHECK_LIB(socket, main, TK_LIBS="$TK_LIBS -lsocket",
287 tcl_checkBoth=1)
288 fi
289 if test "$tcl_checkBoth" = 1; then
290 tk_oldLibs=$TK_LIBS
291 TK_LIBS="$TK_LIBS -lsocket -lnsl"
292 AC_CHECK_FUNC(accept, tcl_checkNsl=0, [TK_LIBS=$tk_oldLibs])
293 fi
294 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main,
295 [TK_LIBS="$TK_LIBS -lnsl"]))
296 fi
297
298 #----------------------------------------------------------------------
299 # Substitution strings exported by TIX
300 #----------------------------------------------------------------------
301 AC_SUBST(SHELL)
302 AC_SUBST(CC)
303 AC_SUBST(RANLIB)
304 AC_SUBST(TIX_RANLIB)
305 AC_SUBST(SHLIB_CFLAGS)
306 AC_SUBST(SHLIB_LD)
307 AC_SUBST(SHLIB_LD_LIBS)
308 AC_SUBST(SHLIB_SUFFIX)
309 AC_SUBST(SHLIB_VERSION)
310 AC_SUBST(DL_LIBS)
311 AC_SUBST(LD_FLAGS)
312 AC_SUBST(TCL_BUILD_LIB_SPEC)
313 AC_SUBST(TCL_LIBS)
314 AC_SUBST(TCL_VERSION)
315 AC_SUBST(TCL_SRC_DIR)
316 AC_SUBST(TCL_BIN_DIR)
317 AC_SUBST(TK_BUILD_LIB_SPEC)
318 AC_SUBST(TK_LIBS)
319 AC_SUBST(TK_VERSION)
320 AC_SUBST(TK_SRC_DIR)
321 AC_SUBST(TK_BIN_DIR)
322 AC_SUBST(TK_XINCLUDES)
323 AC_SUBST(TIX_LD_SEARCH_FLAGS)
324 AC_SUBST(TIX_MAJOR_VERSION)
325 AC_SUBST(TIX_MINOR_VERSION)
326 AC_SUBST(TIX_VERSION)
327 AC_SUBST(TIX_SRC_DIR)
328 AC_SUBST(TIX_SHLIB_CFLAGS)
329 AC_SUBST(TIX_MAKE_LIB)
330 AC_SUBST(TIX_LIB_FILE)
331 AC_SUBST(TIX_BUILD_LIB_SPEC)
332 AC_SUBST(TIX_LIB_SPEC)
333 AC_SUBST(TIX_EXE_FILE)
334 AC_SUBST(TIX_SAM_TARGETS)
335 AC_SUBST(TIX_SAM_INSTALL)
336 AC_SUBST(TCL_SAM_FILE)
337 AC_SUBST(TCL_MAKE_SAM)
338 AC_SUBST(TK_SAM_FILE)
339 AC_SUBST(TK_MAKE_SAM)
340 AC_SUBST(TIX_SAM_FILE)
341 AC_SUBST(TIX_MAKE_SAM)
342 AC_SUBST(TIX_DEFS)
343 AC_SUBST(ITCL_BUILD_LIB_SPEC)
344 AC_SUBST(ITK_BUILD_LIB_SPEC)
345 AC_SUBST(TCL_SAMEXE_FILE)
346 AC_SUBST(TK_SAMEXE_FILE)
347 AC_SUBST(TIX_SAMEXE_FILE)
348 AC_SUBST(TCL_BUILD_SAM_SPEC)
349 AC_SUBST(TK_BUILD_SAM_SPEC)
350 AC_SUBST(TIX_BUILD_SAM_SPEC)
351 AC_SUBST(TCL_PACKAGE_PATH)
352
353 # The "binary version" of Tix (see docs/Pkg.txt)
354 TIX_VERSION_PKG=${BIN_VERSION}
355 AC_SUBST(TIX_VERSION_PKG)
356
357 TIXSAM_PKG_FILE="[[file join [file dirname \$dir] ${TIX_SAM_FILE}]]"
358 # if test "$TIX_BUILD_SAM" = "yes"; then
359 TIX_SAM_PACKAGE_IFNEEDED="package ifneeded Tixsam ${TIX_VERSION_PKG} [[list load \"${TIXSAM_PKG_FILE}\" Tixsam]]"
360 # fi
361
362 # The package file, usually a shared library
363 TIX_PKG_FILE="[[file join [file dirname \$dir] ${TIX_LIB_FILE}]]"
364 AC_SUBST(TIX_PKG_FILE)
365 AC_SUBST(TIX_SAM_PACKAGE_IFNEEDED)
366
367 AC_OUTPUT(Makefile pkgIndex.tcl ../../tixConfig.sh)
368