Fri Jan 29 16:44:01 1999 Edith Epstein <eepstein@sophia.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / aclocal.m4
CommitLineData
495c315a
JB
1dnl aclocal.m4 generated automatically by aclocal 1.3b
2
3dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
4e327047 13dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
047465fd
TT
14dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
15
495c315a
JB
16dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition.
17sinclude(../bfd/acinclude.m4)
fef1696f 18
047465fd
TT
19dnl CY_AC_PATH_TCLCONFIG and CY_AC_LOAD_TCLCONFIG should be invoked
20dnl (in that order) before any other TCL macros. Similarly for TK.
21
4e327047
TT
22dnl CYGNUS LOCAL: This gets the right posix flag for gcc
23AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
24[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
047465fd 25AC_MSG_CHECKING([if running LynxOS])
4e327047
TT
26AC_CACHE_VAL(ac_cv_os_lynx,
27[AC_EGREP_CPP(yes,
28[/*
29 * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
30 */
31#if defined(__Lynx__) || defined(Lynx)
32yes
33#endif
34], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)])
5436fc65 35#
4e327047
TT
36if test "$ac_cv_os_lynx" = "yes" ; then
37 AC_MSG_RESULT(yes)
38 AC_DEFINE(LYNX)
39 AC_MSG_CHECKING([whether -mposix or -X is available])
40 AC_CACHE_VAL(ac_cv_c_posix_flag,
41 [AC_TRY_COMPILE(,[
42 /*
43 * This flag varies depending on how old the compiler is.
44 * -X is for the old "cc" and "gcc" (based on 1.42).
45 * -mposix is for the new gcc (at least 2.5.8).
46 */
47 #if defined(__GNUC__) && __GNUC__ >= 2
48 choke me
49 #endif
50 ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")])
51 CC="$CC $ac_cv_c_posix_flag"
52 AC_MSG_RESULT($ac_cv_c_posix_flag)
53 else
54 AC_MSG_RESULT(no)
55fi
56])
4bd9f70f 57
047465fd
TT
58#
59# Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
60# makes configure think it's cross compiling. If --target wasn't used, then
61# we can't configure, so something is wrong. We don't use the cache
62# here cause if somebody fixes their compiler install, we want this to work.
63AC_DEFUN(CY_AC_C_WORKS,
64[# If we cannot compile and link a trivial program, we can't expect anything to work
65AC_MSG_CHECKING(whether the compiler ($CC) actually works)
66AC_TRY_COMPILE(, [/* don't need anything here */],
67 c_compiles=yes, c_compiles=no)
68
69AC_TRY_LINK(, [/* don't need anything here */],
70 c_links=yes, c_links=no)
71
72if test x"${c_compiles}" = x"no" ; then
73 AC_MSG_ERROR(the native compiler is broken and won't compile.)
74fi
75
76if test x"${c_links}" = x"no" ; then
77 AC_MSG_ERROR(the native compiler is broken and won't link.)
78fi
79AC_MSG_RESULT(yes)
80])
81
4e327047
TT
82AC_DEFUN(CY_AC_PATH_TCLH, [
83#
84# Ok, lets find the tcl source trees so we can use the headers
85# Warning: transition of version 9 to 10 will break this algorithm
86# because 10 sorts before 9. We also look for just tcl. We have to
87# be careful that we don't match stuff like tclX by accident.
88# the alternative search directory is involked by --with-tclinclude
89#
8a19b35a 90
4e327047 91no_tcl=true
8a19b35a 92AC_MSG_CHECKING(for Tcl private headers. dir=${configdir})
ba68ad57 93AC_ARG_WITH(tclinclude, [ --with-tclinclude=DIR Directory where tcl private headers are], with_tclinclude=${withval})
4e327047
TT
94AC_CACHE_VAL(ac_cv_c_tclh,[
95# first check to see if --with-tclinclude was specified
96if test x"${with_tclinclude}" != x ; then
97 if test -f ${with_tclinclude}/tclInt.h ; then
98 ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
047465fd
TT
99 elif test -f ${with_tclinclude}/generic/tclInt.h ; then
100 ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)`
5436fc65 101 else
4e327047 102 AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers])
5436fc65 103 fi
4e327047 104fi
047465fd
TT
105
106# next check if it came with Tcl configuration file
107if test x"${ac_cv_c_tclconfig}" = x ; then
108 if test -f $ac_cv_c_tclconfig/../generic/tclInt.h ; then
109 ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/..; pwd)`
110 fi
111fi
112
4e327047
TT
113# next check in private source directory
114#
115# since ls returns lowest version numbers first, reverse its output
116if test x"${ac_cv_c_tclh}" = x ; then
117 for i in \
118 ${srcdir}/../tcl \
047465fd 119 `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` \
4e327047 120 ${srcdir}/../../tcl \
047465fd 121 `ls -dr ${srcdir}/../../tcl[[7-9]]* 2>/dev/null` \
4e327047 122 ${srcdir}/../../../tcl \
047465fd 123 `ls -dr ${srcdir}/../../../tcl[[7-9]]* 2>/dev/null ` ; do
4e327047 124 if test -f $i/generic/tclInt.h ; then
047465fd 125 ac_cv_c_tclh=`(cd $i/generic; pwd)`
4bd9f70f 126 break
4e327047
TT
127 fi
128 done
129fi
130# finally check in a few common install locations
131#
132# since ls returns lowest version numbers first, reverse its output
133if test x"${ac_cv_c_tclh}" = x ; then
134 for i in \
047465fd
TT
135 `ls -dr /usr/local/src/tcl[[7-9]]* 2>/dev/null` \
136 `ls -dr /usr/local/lib/tcl[[7-9]]* 2>/dev/null` \
4e327047
TT
137 /usr/local/src/tcl \
138 /usr/local/lib/tcl \
139 ${prefix}/include ; do
047465fd
TT
140 if test -f $i/generic/tclInt.h ; then
141 ac_cv_c_tclh=`(cd $i/generic; pwd)`
4e327047
TT
142 break
143 fi
144 done
145fi
146# see if one is installed
147if test x"${ac_cv_c_tclh}" = x ; then
148 AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
149fi
150])
151if test x"${ac_cv_c_tclh}" = x ; then
152 TCLHDIR="# no Tcl private headers found"
153 AC_MSG_ERROR([Can't find Tcl private headers])
154fi
155if test x"${ac_cv_c_tclh}" != x ; then
156 no_tcl=""
4bd9f70f 157 if test x"${ac_cv_c_tclh}" = x"installed" ; then
4e327047
TT
158 AC_MSG_RESULT([is installed])
159 TCLHDIR=""
160 else
161 AC_MSG_RESULT([found in ${ac_cv_c_tclh}])
162 # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
163 TCLHDIR="-I${ac_cv_c_tclh}"
5436fc65
C
164 fi
165fi
4e327047 166
4e327047
TT
167AC_SUBST(TCLHDIR)
168])
047465fd
TT
169
170
171AC_DEFUN(CY_AC_PATH_TCLCONFIG, [
5436fc65 172#
047465fd 173# Ok, lets find the tcl configuration
5436fc65 174# First, look for one uninstalled.
047465fd 175# the alternative search directory is invoked by --with-tclconfig
5436fc65 176#
4e327047 177
4e327047 178if test x"${no_tcl}" = x ; then
047465fd 179 # we reset no_tcl in case something fails here
4e327047 180 no_tcl=true
ba68ad57 181 AC_ARG_WITH(tclconfig, [ --with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh)],
047465fd
TT
182 with_tclconfig=${withval})
183 AC_MSG_CHECKING([for Tcl configuration])
184 AC_CACHE_VAL(ac_cv_c_tclconfig,[
185
186 # First check to see if --with-tclconfig was specified.
187 if test x"${with_tclconfig}" != x ; then
188 if test -f "${with_tclconfig}/tclConfig.sh" ; then
189 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
4e327047 190 else
047465fd 191 AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
4e327047 192 fi
5436fc65 193 fi
047465fd
TT
194
195 # then check for a private Tcl installation
196 if test x"${ac_cv_c_tclconfig}" = x ; then
4e327047
TT
197 for i in \
198 ../tcl \
047465fd 199 `ls -dr ../tcl[[7-9]]* 2>/dev/null` \
4e327047 200 ../../tcl \
047465fd 201 `ls -dr ../../tcl[[7-9]]* 2>/dev/null` \
4e327047 202 ../../../tcl \
047465fd 203 `ls -dr ../../../tcl[[7-9]]* 2>/dev/null` ; do
8a19b35a
MH
204 if test -f "$i/${configdir}/tclConfig.sh" ; then
205 ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
4e327047
TT
206 break
207 fi
208 done
5436fc65 209 fi
4e327047 210 # check in a few common install locations
047465fd 211 if test x"${ac_cv_c_tclconfig}" = x ; then
4e327047 212 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
047465fd
TT
213 if test -f "$i/tclConfig.sh" ; then
214 ac_cv_c_tclconfig=`(cd $i; pwd)`
4e327047
TT
215 break
216 fi
217 done
5436fc65 218 fi
4e327047 219 # check in a few other private locations
047465fd 220 if test x"${ac_cv_c_tclconfig}" = x ; then
4e327047
TT
221 for i in \
222 ${srcdir}/../tcl \
047465fd 223 `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` ; do
8a19b35a
MH
224 if test -f "$i/${configdir}/tclConfig.sh" ; then
225 ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
4e327047
TT
226 break
227 fi
228 done
5436fc65 229 fi
4e327047 230 ])
047465fd
TT
231 if test x"${ac_cv_c_tclconfig}" = x ; then
232 TCLCONFIG="# no Tcl configs found"
233 AC_MSG_WARN(Can't find Tcl configuration definitions)
4e327047 234 else
4e327047 235 no_tcl=
047465fd
TT
236 TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
237 AC_MSG_RESULT(found $TCLCONFIG)
4e327047 238 fi
5436fc65 239fi
047465fd
TT
240])
241
242# Defined as a separate macro so we don't have to cache the values
243# from PATH_TCLCONFIG (because this can also be cached).
244AC_DEFUN(CY_AC_LOAD_TCLCONFIG, [
245 . $TCLCONFIG
246
247 AC_SUBST(TCL_VERSION)
248 AC_SUBST(TCL_MAJOR_VERSION)
249 AC_SUBST(TCL_MINOR_VERSION)
250 AC_SUBST(TCL_CC)
251 AC_SUBST(TCL_DEFS)
252
253dnl not used, don't export to save symbols
254dnl AC_SUBST(TCL_LIB_FILE)
255
256dnl don't export, not used outside of configure
257dnl AC_SUBST(TCL_LIBS)
258dnl not used, don't export to save symbols
259dnl AC_SUBST(TCL_PREFIX)
260
261dnl not used, don't export to save symbols
262dnl AC_SUBST(TCL_EXEC_PREFIX)
5436fc65 263
047465fd
TT
264 AC_SUBST(TCL_SHLIB_CFLAGS)
265 AC_SUBST(TCL_SHLIB_LD)
266dnl don't export, not used outside of configure
267 AC_SUBST(TCL_SHLIB_LD_LIBS)
268 AC_SUBST(TCL_SHLIB_SUFFIX)
269dnl not used, don't export to save symbols
270 AC_SUBST(TCL_DL_LIBS)
271 AC_SUBST(TCL_LD_FLAGS)
272dnl don't export, not used outside of configure
273 AC_SUBST(TCL_LD_SEARCH_FLAGS)
274 AC_SUBST(TCL_COMPAT_OBJS)
275 AC_SUBST(TCL_RANLIB)
276 AC_SUBST(TCL_BUILD_LIB_SPEC)
277 AC_SUBST(TCL_LIB_SPEC)
278 AC_SUBST(TCL_LIB_VERSIONS_OK)
279
280dnl not used, don't export to save symbols
281dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX)
282
283dnl not used, don't export to save symbols
284dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
5436fc65 285])
047465fd
TT
286
287# Warning: Tk definitions are very similar to Tcl definitions but
288# are not precisely the same. There are a couple of differences,
289# so don't do changes to Tcl thinking you can cut and paste it do
290# the Tk differences and later simply substitute "Tk" for "Tcl".
291# Known differences:
292# - Acceptable Tcl major version #s is 7-9 while Tk is 4-9
293# - Searching for Tcl includes looking for tclInt.h, Tk looks for tk.h
294# - Computing major/minor versions is different because Tk depends on
295# headers to Tcl, Tk, and X.
296# - Symbols in tkConfig.sh are different than tclConfig.sh
297# - Acceptable for Tk to be missing but not Tcl.
298
4e327047 299AC_DEFUN(CY_AC_PATH_TKH, [
5436fc65 300#
4e327047
TT
301# Ok, lets find the tk source trees so we can use the headers
302# If the directory (presumably symlink) named "tk" exists, use that one
303# in preference to any others. Same logic is used when choosing library
304# and again with Tcl. The search order is the best place to look first, then in
305# decreasing significance. The loop breaks if the trigger file is found.
306# Note the gross little conversion here of srcdir by cd'ing to the found
307# directory. This converts the path from a relative to an absolute, so
308# recursive cache variables for the path will work right. We check all
309# the possible paths in one loop rather than many seperate loops to speed
310# things up.
047465fd 311# the alternative search directory is involked by --with-tkinclude
5436fc65 312#
4e327047 313no_tk=true
047465fd 314AC_MSG_CHECKING(for Tk private headers)
ba68ad57 315AC_ARG_WITH(tkinclude, [ --with-tkinclude=DIR Directory where tk private headers are], with_tkinclude=${withval})
4e327047
TT
316AC_CACHE_VAL(ac_cv_c_tkh,[
317# first check to see if --with-tkinclude was specified
318if test x"${with_tkinclude}" != x ; then
319 if test -f ${with_tkinclude}/tk.h ; then
320 ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
047465fd
TT
321 elif test -f ${with_tkinclude}/generic/tk.h ; then
322 ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)`
5436fc65 323 else
4e327047 324 AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers])
5436fc65 325 fi
4e327047 326fi
047465fd
TT
327
328# next check if it came with Tk configuration file
329if test x"${ac_cv_c_tkconfig}" = x ; then
330 if test -f $ac_cv_c_tkconfig/../generic/tk.h ; then
331 ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/..; pwd)`
332 fi
333fi
334
4e327047
TT
335# next check in private source directory
336#
047465fd 337# since ls returns lowest version numbers first, reverse its output
4e327047
TT
338if test x"${ac_cv_c_tkh}" = x ; then
339 for i in \
340 ${srcdir}/../tk \
047465fd 341 `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` \
4e327047 342 ${srcdir}/../../tk \
047465fd 343 `ls -dr ${srcdir}/../../tk[[4-9]]* 2>/dev/null` \
4e327047 344 ${srcdir}/../../../tk \
047465fd
TT
345 `ls -dr ${srcdir}/../../../tk[[4-9]]* 2>/dev/null ` ; do
346 if test -f $i/generic/tk.h ; then
347 ac_cv_c_tkh=`(cd $i/generic; pwd)`
4e327047
TT
348 break
349 fi
4e327047
TT
350 done
351fi
352# finally check in a few common install locations
353#
047465fd 354# since ls returns lowest version numbers first, reverse its output
4e327047
TT
355if test x"${ac_cv_c_tkh}" = x ; then
356 for i in \
047465fd
TT
357 `ls -dr /usr/local/src/tk[[4-9]]* 2>/dev/null` \
358 `ls -dr /usr/local/lib/tk[[4-9]]* 2>/dev/null` \
4e327047
TT
359 /usr/local/src/tk \
360 /usr/local/lib/tk \
361 ${prefix}/include ; do
047465fd
TT
362 if test -f $i/generic/tk.h ; then
363 ac_cv_c_tkh=`(cd $i/generic; pwd)`
4e327047
TT
364 break
365 fi
366 done
367fi
368# see if one is installed
369if test x"${ac_cv_c_tkh}" = x ; then
047465fd 370 AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed, ac_cv_c_tkh="")
4e327047
TT
371fi
372])
373if test x"${ac_cv_c_tkh}" != x ; then
374 no_tk=""
375 if test x"${ac_cv_c_tkh}" = x"installed" ; then
376 AC_MSG_RESULT([is installed])
377 TKHDIR=""
378 else
047465fd 379 AC_MSG_RESULT([found in ${ac_cv_c_tkh}])
4e327047
TT
380 # this hack is cause the TKHDIR won't print if there is a "-I" in it.
381 TKHDIR="-I${ac_cv_c_tkh}"
5436fc65
C
382 fi
383else
4e327047
TT
384 TKHDIR="# no Tk directory found"
385 AC_MSG_WARN([Can't find Tk private headers])
386 no_tk=true
5436fc65
C
387fi
388
4e327047
TT
389AC_SUBST(TKHDIR)
390])
047465fd
TT
391
392
393AC_DEFUN(CY_AC_PATH_TKCONFIG, [
5436fc65 394#
047465fd
TT
395# Ok, lets find the tk configuration
396# First, look for one uninstalled.
397# the alternative search directory is invoked by --with-tkconfig
5436fc65 398#
4e327047
TT
399
400if test x"${no_tk}" = x ; then
047465fd
TT
401 # we reset no_tk in case something fails here
402 no_tk=true
ba68ad57 403 AC_ARG_WITH(tkconfig, [ --with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh)],
047465fd
TT
404 with_tkconfig=${withval})
405 AC_MSG_CHECKING([for Tk configuration])
406 AC_CACHE_VAL(ac_cv_c_tkconfig,[
4e327047 407
047465fd
TT
408 # First check to see if --with-tkconfig was specified.
409 if test x"${with_tkconfig}" != x ; then
410 if test -f "${with_tkconfig}/tkConfig.sh" ; then
411 ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
4e327047 412 else
047465fd 413 AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
4e327047 414 fi
5436fc65 415 fi
047465fd 416
4e327047 417 # then check for a private Tk library
047465fd 418 if test x"${ac_cv_c_tkconfig}" = x ; then
4e327047
TT
419 for i in \
420 ../tk \
047465fd 421 `ls -dr ../tk[[4-9]]* 2>/dev/null` \
4e327047 422 ../../tk \
047465fd 423 `ls -dr ../../tk[[4-9]]* 2>/dev/null` \
4e327047 424 ../../../tk \
047465fd 425 `ls -dr ../../../tk[[4-9]]* 2>/dev/null` ; do
8a19b35a
MH
426 if test -f "$i/${configdir}/tkConfig.sh" ; then
427 ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
4e327047 428 break
4e327047
TT
429 fi
430 done
431 fi
047465fd
TT
432 # check in a few common install locations
433 if test x"${ac_cv_c_tkconfig}" = x ; then
4e327047 434 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
047465fd
TT
435 if test -f "$i/tkConfig.sh" ; then
436 ac_cv_c_tkconfig=`(cd $i; pwd)`
4e327047 437 break
4e327047
TT
438 fi
439 done
440 fi
441 # check in a few other private locations
047465fd 442 if test x"${ac_cv_c_tkconfig}" = x ; then
4e327047
TT
443 for i in \
444 ${srcdir}/../tk \
047465fd 445 `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` ; do
8a19b35a
MH
446 if test -f "$i/${configdir}/tkConfig.sh" ; then
447 ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
4e327047 448 break
4e327047
TT
449 fi
450 done
451 fi
4e327047 452 ])
047465fd
TT
453 if test x"${ac_cv_c_tkconfig}" = x ; then
454 TKCONFIG="# no Tk configs found"
455 AC_MSG_WARN(Can't find Tk configuration definitions)
4e327047 456 else
4e327047 457 no_tk=
047465fd
TT
458 TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
459 AC_MSG_RESULT(found $TKCONFIG)
5436fc65 460 fi
5436fc65 461fi
047465fd 462
4e327047 463])
047465fd
TT
464
465# Defined as a separate macro so we don't have to cache the values
466# from PATH_TKCONFIG (because this can also be cached).
467AC_DEFUN(CY_AC_LOAD_TKCONFIG, [
468 if test -f "$TKCONFIG" ; then
469 . $TKCONFIG
470 fi
471
472 AC_SUBST(TK_VERSION)
473dnl not actually used, don't export to save symbols
474dnl AC_SUBST(TK_MAJOR_VERSION)
475dnl AC_SUBST(TK_MINOR_VERSION)
476 AC_SUBST(TK_DEFS)
477
478dnl not used, don't export to save symbols
479 dnl AC_SUBST(TK_LIB_FILE)
480
481dnl not used outside of configure
482dnl AC_SUBST(TK_LIBS)
483dnl not used, don't export to save symbols
484dnl AC_SUBST(TK_PREFIX)
485
486dnl not used, don't export to save symbols
487dnl AC_SUBST(TK_EXEC_PREFIX)
488
9b119644 489 AC_SUBST(TK_BUILD_INCLUDES)
047465fd
TT
490 AC_SUBST(TK_XINCLUDES)
491 AC_SUBST(TK_XLIBSW)
492 AC_SUBST(TK_BUILD_LIB_SPEC)
493 AC_SUBST(TK_LIB_SPEC)
4e327047 494])
047465fd 495
c98fe0c1
JI
496AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
497#
498# Ok, lets find the itcl configuration
499# First, look for one uninstalled.
500# the alternative search directory is invoked by --with-itclconfig
501#
502
503if test x"${no_itcl}" = x ; then
504 # we reset no_itcl in case something fails here
505 no_itcl=true
506 AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
507 with_itclconfig=${withval})
508 AC_MSG_CHECKING([for Itcl configuration])
509 AC_CACHE_VAL(ac_cv_c_itclconfig,[
510
511 # First check to see if --with-itclconfig was specified.
512 if test x"${with_itclconfig}" != x ; then
513 if test -f "${with_itclconfig}/itclConfig.sh" ; then
514 ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)`
515 else
516 AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh])
517 fi
518 fi
519
520 # then check for a private Itcl library
521 if test x"${ac_cv_c_itclconfig}" = x ; then
522 for i in \
523 ../itcl/itcl \
524 `ls -dr ../itcl[[4-9]]*/itcl 2>/dev/null` \
525 ../../itcl \
526 `ls -dr ../../itcl[[4-9]]*/itcl 2>/dev/null` \
527 ../../../itcl \
528 `ls -dr ../../../itcl[[4-9]]*/itcl 2>/dev/null` ; do
529 if test -f "$i/${configdir}/itclConfig.sh" ; then
530 ac_cv_c_itclconfig=`(cd $i/${configdir}; pwd)`
531 break
532 fi
533 done
534 fi
535 # check in a few common install locations
536 if test x"${ac_cv_c_itclconfig}" = x ; then
537 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
538 if test -f "$i/itclConfig.sh" ; then
539 ac_cv_c_itclconfig=`(cd $i; pwd)`
540 break
541 fi
542 done
543 fi
544 # check in a few other private locations
545 if test x"${ac_cv_c_itclconfig}" = x ; then
546 for i in \
547 ${srcdir}/../itcl/itcl \
548 `ls -dr ${srcdir}/../itcl[[4-9]]*/itcl 2>/dev/null` ; do
549 if test -f "$i/${configdir}/itclConfig.sh" ; then
550 ac_cv_c_itclconfig=`(cd $i/${configdir}; pwd)`
551 break
552 fi
553 done
554 fi
555 ])
556 if test x"${ac_cv_c_itclconfig}" = x ; then
557 ITCLCONFIG="# no Itcl configs found"
558 AC_MSG_WARN(Can't find Itcl configuration definitions)
559 else
560 no_itcl=
561 ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh
562 AC_MSG_RESULT(found $ITCLCONFIG)
563 fi
564fi
565
566])
567
568# Defined as a separate macro so we don't have to cache the values
569# from PATH_ITCLCONFIG (because this can also be cached).
570AC_DEFUN(CY_AC_LOAD_ITCLCONFIG, [
571 if test -f "$ITCLCONFIG" ; then
572 . $ITCLCONFIG
573 fi
574
575 AC_SUBST(ITCL_VERSION)
576dnl not actually used, don't export to save symbols
577dnl AC_SUBST(ITCL_MAJOR_VERSION)
578dnl AC_SUBST(ITCL_MINOR_VERSION)
579 AC_SUBST(ITCL_DEFS)
580
581dnl not used, don't export to save symbols
582 dnl AC_SUBST(ITCL_LIB_FILE)
583
584dnl not used outside of configure
585dnl AC_SUBST(ITCL_LIBS)
586dnl not used, don't export to save symbols
587dnl AC_SUBST(ITCL_PREFIX)
588
589dnl not used, don't export to save symbols
590dnl AC_SUBST(ITCL_EXEC_PREFIX)
591
592 AC_SUBST(ITCL_BUILD_INCLUDES)
593 AC_SUBST(ITCL_BUILD_LIB_SPEC)
594 AC_SUBST(ITCL_LIB_SPEC)
595])
2476848a
MH
596
597# check for Itcl headers.
598
599AC_DEFUN(CY_AC_PATH_ITCLH, [
600AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir})
601if test x"${ac_cv_c_itclh}" = x ; then
c98fe0c1
JI
602 for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
603 if test -f $i/generic/itcl.h ; then
604 ac_cv_c_itclh=`(cd $i/generic; pwd)`
2476848a
MH
605 break
606 fi
607 done
608fi
609if test x"${ac_cv_c_itclh}" = x ; then
610 ITCLHDIR="# no Itcl private headers found"
611 AC_MSG_ERROR([Can't find Itcl private headers])
612fi
613if test x"${ac_cv_c_itclh}" != x ; then
614 ITCLHDIR="-I${ac_cv_c_itclh}"
615fi
616# should always be here
c98fe0c1 617# ITCLLIB="../itcl/itcl/unix/libitcl.a"
2476848a 618AC_SUBST(ITCLHDIR)
c98fe0c1
JI
619#AC_SUBST(ITCLLIB)
620])
621
622
623AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
624#
625# Ok, lets find the itk configuration
626# First, look for one uninstalled.
627# the alternative search directory is invoked by --with-itkconfig
628#
629
630if test x"${no_itk}" = x ; then
631 # we reset no_itk in case something fails here
632 no_itk=true
633 AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
634 with_itkconfig=${withval})
635 AC_MSG_CHECKING([for Itk configuration])
636 AC_CACHE_VAL(ac_cv_c_itkconfig,[
637
638 # First check to see if --with-itkconfig was specified.
639 if test x"${with_itkconfig}" != x ; then
640 if test -f "${with_itkconfig}/itkConfig.sh" ; then
641 ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)`
642 else
643 AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh])
644 fi
645 fi
646
647 # then check for a private Itk library
648 if test x"${ac_cv_c_itkconfig}" = x ; then
649 for i in \
650 ../itcl/itk \
651 `ls -dr ../itcl[[4-9]]*/itk 2>/dev/null` \
652 ../../itk \
653 `ls -dr ../../itcl[[4-9]]*/itk 2>/dev/null` \
654 ../../../itk \
655 `ls -dr ../../../itcl[[4-9]]*/itk 2>/dev/null` ; do
656 if test -f "$i/${configdir}/itkConfig.sh" ; then
657 ac_cv_c_itkconfig=`(cd $i/${configdir}; pwd)`
658 break
659 fi
660 done
661 fi
662 # check in a few common install locations
663 if test x"${ac_cv_c_itkconfig}" = x ; then
664 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
665 if test -f "$i/itkConfig.sh" ; then
666 ac_cv_c_itkconfig=`(cd $i; pwd)`
667 break
668 fi
669 done
670 fi
671 # check in a few other private locations
672 if test x"${ac_cv_c_itkconfig}" = x ; then
673 for i in \
674 ${srcdir}/../itcl/itk \
675 `ls -dr ${srcdir}/../itcl[[4-9]]*/itk 2>/dev/null` ; do
676 if test -f "$i/${configdir}/itkConfig.sh" ; then
677 ac_cv_c_itkconfig=`(cd $i/${configdir}; pwd)`
678 break
679 fi
680 done
681 fi
682 ])
683 if test x"${ac_cv_c_itkconfig}" = x ; then
684 ITKCONFIG="# no Itk configs found"
685 AC_MSG_WARN(Can't find Itk configuration definitions)
686 else
687 no_itk=
688 ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh
689 AC_MSG_RESULT(found $ITKCONFIG)
690 fi
691fi
692
693])
694
695# Defined as a separate macro so we don't have to cache the values
696# from PATH_ITKCONFIG (because this can also be cached).
697AC_DEFUN(CY_AC_LOAD_ITKCONFIG, [
698 if test -f "$ITKCONFIG" ; then
699 . $ITKCONFIG
700 fi
701
702 AC_SUBST(ITK_VERSION)
703dnl not actually used, don't export to save symbols
704dnl AC_SUBST(ITK_MAJOR_VERSION)
705dnl AC_SUBST(ITK_MINOR_VERSION)
706 AC_SUBST(ITK_DEFS)
707
708dnl not used, don't export to save symbols
709 dnl AC_SUBST(ITK_LIB_FILE)
710
711dnl not used outside of configure
712dnl AC_SUBST(ITK_LIBS)
713dnl not used, don't export to save symbols
714dnl AC_SUBST(ITK_PREFIX)
715
716dnl not used, don't export to save symbols
717dnl AC_SUBST(ITK_EXEC_PREFIX)
718
719 AC_SUBST(ITK_BUILD_INCLUDES)
720 AC_SUBST(ITK_BUILD_LIB_SPEC)
721 AC_SUBST(ITK_LIB_SPEC)
722])
723
724AC_DEFUN(CY_AC_PATH_ITKH, [
725AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir})
726if test x"${ac_cv_c_itkh}" = x ; then
727 for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
728 if test -f $i/generic/itk.h ; then
729 ac_cv_c_itkh=`(cd $i/generic; pwd)`
730 break
731 fi
732 done
733fi
734if test x"${ac_cv_c_itkh}" = x ; then
735 ITKHDIR="# no Itk private headers found"
736 AC_MSG_ERROR([Can't find Itk private headers])
737fi
738if test x"${ac_cv_c_itkh}" != x ; then
739 ITKHDIR="-I${ac_cv_c_itkh}"
740fi
741# should always be here
742# ITKLIB="../itcl/itk/unix/libitk.a"
743AC_SUBST(ITKHDIR)
744#AC_SUBST(ITKLIB)
2476848a
MH
745])
746
747# check for Tix headers.
748
749AC_DEFUN(CY_AC_PATH_TIX, [
750AC_MSG_CHECKING(for Tix private headers. srcdir=${srcdir})
751if test x"${ac_cv_c_tixh}" = x ; then
752 for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
753 if test -f $i/generic/tix.h ; then
754 ac_cv_c_tixh=`(cd $i/generic; pwd)`
755 break
756 fi
757 done
758fi
759if test x"${ac_cv_c_tixh}" = x ; then
760 TIXHDIR="# no Tix private headers found"
761 AC_MSG_ERROR([Can't find Tix private headers])
762fi
763if test x"${ac_cv_c_tixh}" != x ; then
764 TIXHDIR="-I${ac_cv_c_tixh}"
765fi
2476848a 766AC_SUBST(TIXHDIR)
2476848a 767])
495c315a
JB
768
769
770# serial 1
771
772# @defmac AC_PROG_CC_STDC
773# @maindex PROG_CC_STDC
774# @ovindex CC
775# If the C compiler in not in ANSI C mode by default, try to add an option
776# to output variable @code{CC} to make it so. This macro tries various
777# options that select ANSI C on some system or another. It considers the
778# compiler to be in ANSI C mode if it handles function prototypes correctly.
779#
780# If you use this macro, you should check after calling it whether the C
781# compiler has been set to accept ANSI C; if not, the shell variable
782# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
783# code in ANSI C, you can make an un-ANSIfied copy of it by using the
784# program @code{ansi2knr}, which comes with Ghostscript.
785# @end defmac
786
787AC_DEFUN(AM_PROG_CC_STDC,
788[AC_REQUIRE([AC_PROG_CC])
789AC_BEFORE([$0], [AC_C_INLINE])
790AC_BEFORE([$0], [AC_C_CONST])
791dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
792dnl a magic option to avoid problems with ANSI preprocessor commands
793dnl like #elif.
794dnl FIXME: can't do this because then AC_AIX won't work due to a
795dnl circular dependency.
796dnl AC_BEFORE([$0], [AC_PROG_CPP])
797AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
798AC_CACHE_VAL(am_cv_prog_cc_stdc,
799[am_cv_prog_cc_stdc=no
800ac_save_CC="$CC"
801# Don't try gcc -ansi; that turns off useful extensions and
802# breaks some systems' header files.
803# AIX -qlanglvl=ansi
804# Ultrix and OSF/1 -std1
805# HP-UX -Aa -D_HPUX_SOURCE
806# SVR4 -Xc -D__EXTENSIONS__
807for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
808do
809 CC="$ac_save_CC $ac_arg"
810 AC_TRY_COMPILE(
811[#include <stdarg.h>
812#include <stdio.h>
813#include <sys/types.h>
814#include <sys/stat.h>
815/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
816struct buf { int x; };
817FILE * (*rcsopen) (struct buf *, struct stat *, int);
818static char *e (p, i)
819 char **p;
820 int i;
821{
822 return p[i];
823}
824static char *f (char * (*g) (char **, int), char **p, ...)
825{
826 char *s;
827 va_list v;
828 va_start (v,p);
829 s = g (p, va_arg (v,int));
830 va_end (v);
831 return s;
832}
833int test (int i, double x);
834struct s1 {int (*f) (int a);};
835struct s2 {int (*f) (double a);};
836int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
837int argc;
838char **argv;
839], [
840return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
841],
842[am_cv_prog_cc_stdc="$ac_arg"; break])
843done
844CC="$ac_save_CC"
845])
846if test -z "$am_cv_prog_cc_stdc"; then
847 AC_MSG_RESULT([none needed])
848else
849 AC_MSG_RESULT($am_cv_prog_cc_stdc)
850fi
851case "x$am_cv_prog_cc_stdc" in
852 x|xno) ;;
853 *) CC="$CC $am_cv_prog_cc_stdc" ;;
854esac
855])
856
857# This file is derived from `gettext.m4'. The difference is that the
858# included macros assume Cygnus-style source and build trees.
859
860# Macro to add for using GNU gettext.
861# Ulrich Drepper <drepper@cygnus.com>, 1995.
862#
863# This file file be copied and used freely without restrictions. It can
864# be used in projects which are not available under the GNU Public License
865# but which still want to provide support for the GNU gettext functionality.
866# Please note that the actual code is *not* freely available.
867
868# serial 3
869
870AC_DEFUN(CY_WITH_NLS,
871 [AC_MSG_CHECKING([whether NLS is requested])
872 dnl Default is enabled NLS
873 AC_ARG_ENABLE(nls,
874 [ --disable-nls do not use Native Language Support],
875 USE_NLS=$enableval, USE_NLS=yes)
876 AC_MSG_RESULT($USE_NLS)
877 AC_SUBST(USE_NLS)
878
879 USE_INCLUDED_LIBINTL=no
880
881 dnl If we use NLS figure out what method
882 if test "$USE_NLS" = "yes"; then
883 AC_DEFINE(ENABLE_NLS)
884 AC_MSG_CHECKING([whether included gettext is requested])
885 AC_ARG_WITH(included-gettext,
886 [ --with-included-gettext use the GNU gettext library included here],
887 nls_cv_force_use_gnu_gettext=$withval,
888 nls_cv_force_use_gnu_gettext=no)
889 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
890
891 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
892 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
893 dnl User does not insist on using GNU NLS library. Figure out what
894 dnl to use. If gettext or catgets are available (in this order) we
895 dnl use this. Else we have to fall back to GNU NLS library.
896 dnl catgets is only used if permitted by option --with-catgets.
897 nls_cv_header_intl=
898 nls_cv_header_libgt=
899 CATOBJEXT=NONE
900
901 AC_CHECK_HEADER(libintl.h,
902 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
903 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
904 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
905
906 if test "$gt_cv_func_gettext_libc" != "yes"; then
907 AC_CHECK_LIB(intl, bindtextdomain,
908 [AC_CACHE_CHECK([for gettext in libintl],
909 gt_cv_func_gettext_libintl,
910 [AC_TRY_LINK([], [return (int) gettext ("")],
911 gt_cv_func_gettext_libintl=yes,
912 gt_cv_func_gettext_libintl=no)])])
913 fi
914
915 if test "$gt_cv_func_gettext_libc" = "yes" \
916 || test "$gt_cv_func_gettext_libintl" = "yes"; then
917 AC_DEFINE(HAVE_GETTEXT)
918 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
919 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
920 if test "$MSGFMT" != "no"; then
921 AC_CHECK_FUNCS(dcgettext)
922 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
923 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
924 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
925 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
926 return _nl_msg_cat_cntr],
927 [CATOBJEXT=.gmo
928 DATADIRNAME=share],
929 [CATOBJEXT=.mo
930 DATADIRNAME=lib])
931 INSTOBJEXT=.mo
932 fi
933 fi
934 ])
935
936 dnl In the standard gettext, we would now check for catgets.
937 dnl However, we never want to use catgets for our releases.
938
939 if test "$CATOBJEXT" = "NONE"; then
940 dnl Neither gettext nor catgets in included in the C library.
941 dnl Fall back on GNU gettext library.
942 nls_cv_use_gnu_gettext=yes
943 fi
944 fi
945
946 if test "$nls_cv_use_gnu_gettext" = "yes"; then
947 dnl Mark actions used to generate GNU NLS library.
948 INTLOBJS="\$(GETTOBJS)"
949 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
950 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
951 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
952 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
953 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
954 AC_SUBST(MSGFMT)
955 USE_INCLUDED_LIBINTL=yes
956 CATOBJEXT=.gmo
957 INSTOBJEXT=.mo
958 DATADIRNAME=share
959 INTLDEPS='$(top_builddir)/../intl/libintl.a'
960 INTLLIBS=$INTLDEPS
961 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
962 nls_cv_header_intl=libintl.h
963 nls_cv_header_libgt=libgettext.h
964 fi
965
966 dnl Test whether we really found GNU xgettext.
967 if test "$XGETTEXT" != ":"; then
968 dnl If it is no GNU xgettext we define it as : so that the
969 dnl Makefiles still can work.
970 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
971 : ;
972 else
973 AC_MSG_RESULT(
974 [found xgettext programs is not GNU xgettext; ignore it])
975 XGETTEXT=":"
976 fi
977 fi
978
979 # We need to process the po/ directory.
980 POSUB=po
981 else
982 DATADIRNAME=share
983 nls_cv_header_intl=libintl.h
984 nls_cv_header_libgt=libgettext.h
985 fi
986
987 # If this is used in GNU gettext we have to set USE_NLS to `yes'
988 # because some of the sources are only built for this goal.
989 if test "$PACKAGE" = gettext; then
990 USE_NLS=yes
991 USE_INCLUDED_LIBINTL=yes
992 fi
993
994 dnl These rules are solely for the distribution goal. While doing this
995 dnl we only have to keep exactly one list of the available catalogs
996 dnl in configure.in.
997 for lang in $ALL_LINGUAS; do
998 GMOFILES="$GMOFILES $lang.gmo"
999 POFILES="$POFILES $lang.po"
1000 done
1001
1002 dnl Make all variables we use known to autoconf.
1003 AC_SUBST(USE_INCLUDED_LIBINTL)
1004 AC_SUBST(CATALOGS)
1005 AC_SUBST(CATOBJEXT)
1006 AC_SUBST(DATADIRNAME)
1007 AC_SUBST(GMOFILES)
1008 AC_SUBST(INSTOBJEXT)
1009 AC_SUBST(INTLDEPS)
1010 AC_SUBST(INTLLIBS)
1011 AC_SUBST(INTLOBJS)
1012 AC_SUBST(POFILES)
1013 AC_SUBST(POSUB)
1014 ])
1015
1016AC_DEFUN(CY_GNU_GETTEXT,
1017 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1018 AC_REQUIRE([AC_PROG_CC])dnl
1019 AC_REQUIRE([AC_PROG_RANLIB])dnl
1020 AC_REQUIRE([AC_ISC_POSIX])dnl
1021 AC_REQUIRE([AC_HEADER_STDC])dnl
1022 AC_REQUIRE([AC_C_CONST])dnl
1023 AC_REQUIRE([AC_C_INLINE])dnl
1024 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1025 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1026 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1027 AC_REQUIRE([AC_FUNC_MMAP])dnl
1028
1029 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1030unistd.h values.h sys/param.h])
1031 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1032__argz_count __argz_stringify __argz_next])
1033
1034 if test "${ac_cv_func_stpcpy+set}" != "set"; then
1035 AC_CHECK_FUNCS(stpcpy)
1036 fi
1037 if test "${ac_cv_func_stpcpy}" = "yes"; then
1038 AC_DEFINE(HAVE_STPCPY)
1039 fi
1040
1041 AM_LC_MESSAGES
1042 CY_WITH_NLS
1043
1044 if test "x$CATOBJEXT" != "x"; then
1045 if test "x$ALL_LINGUAS" = "x"; then
1046 LINGUAS=
1047 else
1048 AC_MSG_CHECKING(for catalogs to be installed)
1049 NEW_LINGUAS=
1050 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1051 case "$ALL_LINGUAS" in
1052 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1053 esac
1054 done
1055 LINGUAS=$NEW_LINGUAS
1056 AC_MSG_RESULT($LINGUAS)
1057 fi
1058
1059 dnl Construct list of names of catalog files to be constructed.
1060 if test -n "$LINGUAS"; then
1061 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1062 fi
1063 fi
1064
1065 dnl The reference to <locale.h> in the installed <libintl.h> file
1066 dnl must be resolved because we cannot expect the users of this
1067 dnl to define HAVE_LOCALE_H.
1068 if test $ac_cv_header_locale_h = yes; then
1069 INCLUDE_LOCALE_H="#include <locale.h>"
1070 else
1071 INCLUDE_LOCALE_H="\
1072/* The system does not provide the header <locale.h>. Take care yourself. */"
1073 fi
1074 AC_SUBST(INCLUDE_LOCALE_H)
1075
1076 dnl Determine which catalog format we have (if any is needed)
1077 dnl For now we know about two different formats:
1078 dnl Linux libc-5 and the normal X/Open format
1079 if test -f $srcdir/po2tbl.sed.in; then
1080 if test "$CATOBJEXT" = ".cat"; then
1081 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1082
1083 dnl Transform the SED scripts while copying because some dumb SEDs
1084 dnl cannot handle comments.
1085 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
1086 fi
1087 dnl po2tbl.sed is always needed.
1088 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1089 $srcdir/po2tbl.sed.in > po2tbl.sed
1090 fi
1091
1092 dnl In the intl/Makefile.in we have a special dependency which makes
1093 dnl only sense for gettext. We comment this out for non-gettext
1094 dnl packages.
1095 if test "$PACKAGE" = "gettext"; then
1096 GT_NO="#NO#"
1097 GT_YES=
1098 else
1099 GT_NO=
1100 GT_YES="#YES#"
1101 fi
1102 AC_SUBST(GT_NO)
1103 AC_SUBST(GT_YES)
1104
1105 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
1106 AC_SUBST(MKINSTALLDIRS)
1107
1108 dnl *** For now the libtool support in intl/Makefile is not for real.
1109 l=
1110 AC_SUBST(l)
1111
1112 dnl Generate list of files to be processed by xgettext which will
1113 dnl be included in po/Makefile. But only do this if the po directory
1114 dnl exists in srcdir.
1115 if test -d $srcdir/po; then
1116 test -d po || mkdir po
1117 if test "x$srcdir" != "x."; then
1118 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1119 posrcprefix="$srcdir/"
1120 else
1121 posrcprefix="../$srcdir/"
1122 fi
1123 else
1124 posrcprefix="../"
1125 fi
1126 rm -f po/POTFILES
1127 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1128 < $srcdir/po/POTFILES.in > po/POTFILES
1129 fi
1130 ])
1131
1132# Search path for a program which passes the given test.
1133# Ulrich Drepper <drepper@cygnus.com>, 1996.
1134#
1135# This file file be copied and used freely without restrictions. It can
1136# be used in projects which are not available under the GNU Public License
1137# but which still want to provide support for the GNU gettext functionality.
1138# Please note that the actual code is *not* freely available.
1139
1140# serial 1
1141
1142dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1143dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1144AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1145[# Extract the first word of "$2", so it can be a program name with args.
1146set dummy $2; ac_word=[$]2
1147AC_MSG_CHECKING([for $ac_word])
1148AC_CACHE_VAL(ac_cv_path_$1,
1149[case "[$]$1" in
1150 /*)
1151 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1152 ;;
1153 *)
1154 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1155 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1156 test -z "$ac_dir" && ac_dir=.
1157 if test -f $ac_dir/$ac_word; then
1158 if [$3]; then
1159 ac_cv_path_$1="$ac_dir/$ac_word"
1160 break
1161 fi
1162 fi
1163 done
1164 IFS="$ac_save_ifs"
1165dnl If no 4th arg is given, leave the cache variable unset,
1166dnl so AC_PATH_PROGS will keep looking.
1167ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1168])dnl
1169 ;;
1170esac])dnl
1171$1="$ac_cv_path_$1"
1172if test -n "[$]$1"; then
1173 AC_MSG_RESULT([$]$1)
1174else
1175 AC_MSG_RESULT(no)
1176fi
1177AC_SUBST($1)dnl
1178])
1179
1180# Check whether LC_MESSAGES is available in <locale.h>.
1181# Ulrich Drepper <drepper@cygnus.com>, 1995.
1182#
1183# This file file be copied and used freely without restrictions. It can
1184# be used in projects which are not available under the GNU Public License
1185# but which still want to provide support for the GNU gettext functionality.
1186# Please note that the actual code is *not* freely available.
1187
1188# serial 1
1189
1190AC_DEFUN(AM_LC_MESSAGES,
1191 [if test $ac_cv_header_locale_h = yes; then
1192 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1193 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1194 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1195 if test $am_cv_val_LC_MESSAGES = yes; then
1196 AC_DEFINE(HAVE_LC_MESSAGES)
1197 fi
1198 fi])
1199
1200# Check to see if we're running under Win32, without using
1201# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
1202# Otherwise set it to "".
1203
1204dnl AM_EXEEXT()
1205dnl This knows we add .exe if we're building in the Cygwin32
1206dnl environment. But if we're not, then it compiles a test program
1207dnl to see if there is a suffix for executables.
1208AC_DEFUN(AM_EXEEXT,
1209[AC_REQUIRE([AM_CYGWIN32])
1210AC_REQUIRE([AM_MINGW32])
1211AC_MSG_CHECKING([for executable suffix])
1212AC_CACHE_VAL(am_cv_exeext,
1213[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
1214am_cv_exeext=.exe
1215else
1216cat > am_c_test.c << 'EOF'
1217int main() {
1218/* Nothing needed here */
1219}
1220EOF
1221${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
1222am_cv_exeext=
1223for file in am_c_test.*; do
1224 case $file in
1225 *.c) ;;
1226 *.o) ;;
1227 *) am_cv_exeext=`echo $file | sed -e s/am_c_test//` ;;
1228 esac
1229done
1230rm -f am_c_test*])
1231test x"${am_cv_exeext}" = x && am_cv_exeext=no
1232fi
1233EXEEXT=""
1234test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
1235AC_MSG_RESULT(${am_cv_exeext})
1236AC_SUBST(EXEEXT)])
1237
1238# Check to see if we're running under Cygwin32, without using
1239# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
1240# Otherwise set it to "no".
1241
1242dnl AM_CYGWIN32()
1243AC_DEFUN(AM_CYGWIN32,
1244[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
1245[AC_TRY_COMPILE(,[return __CYGWIN32__;],
1246am_cv_cygwin32=yes, am_cv_cygwin32=no)
1247rm -f conftest*])
1248CYGWIN32=
1249test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
1250
1251# Check to see if we're running under Mingw, without using
1252# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
1253# Otherwise set it to "no".
1254
1255dnl AM_MINGW32()
1256AC_DEFUN(AM_MINGW32,
1257[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
1258[AC_TRY_COMPILE(,[return __MINGW32__;],
1259am_cv_mingw32=yes, am_cv_mingw32=no)
1260rm -f conftest*])
1261MINGW32=
1262test "$am_cv_mingw32" = yes && MINGW32=yes])
1263
This page took 0.227485 seconds and 4 git commands to generate.