]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/aclocal.m4
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / gdb / aclocal.m4
CommitLineData
8fa71a71 1dnl aclocal.m4 generated automatically by aclocal 1.4
495c315a 2
8fa71a71 3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
495c315a
JB
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
b11485da
JI
19dnl This gets the standard macros, like the TCL, TK, etc ones.
20sinclude(../config/acinclude.m4)
047465fd 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
0abbe35d
JM
496# check for Itcl headers.
497
c98fe0c1
JI
498AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
499#
500# Ok, lets find the itcl configuration
501# First, look for one uninstalled.
502# the alternative search directory is invoked by --with-itclconfig
503#
504
505if test x"${no_itcl}" = x ; then
506 # we reset no_itcl in case something fails here
507 no_itcl=true
508 AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
509 with_itclconfig=${withval})
510 AC_MSG_CHECKING([for Itcl configuration])
511 AC_CACHE_VAL(ac_cv_c_itclconfig,[
512
513 # First check to see if --with-itclconfig was specified.
514 if test x"${with_itclconfig}" != x ; then
515 if test -f "${with_itclconfig}/itclConfig.sh" ; then
516 ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)`
517 else
518 AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh])
519 fi
520 fi
521
522 # then check for a private Itcl library
523 if test x"${ac_cv_c_itclconfig}" = x ; then
524 for i in \
525 ../itcl/itcl \
526 `ls -dr ../itcl[[4-9]]*/itcl 2>/dev/null` \
527 ../../itcl \
528 `ls -dr ../../itcl[[4-9]]*/itcl 2>/dev/null` \
529 ../../../itcl \
530 `ls -dr ../../../itcl[[4-9]]*/itcl 2>/dev/null` ; do
92cf4495
SP
531 if test -f "$i/itclConfig.sh" ; then
532 ac_cv_c_itclconfig=`(cd $i; pwd)`
c98fe0c1
JI
533 break
534 fi
535 done
536 fi
537 # check in a few common install locations
538 if test x"${ac_cv_c_itclconfig}" = x ; then
539 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
540 if test -f "$i/itclConfig.sh" ; then
541 ac_cv_c_itclconfig=`(cd $i; pwd)`
542 break
543 fi
544 done
545 fi
546 # check in a few other private locations
547 if test x"${ac_cv_c_itclconfig}" = x ; then
548 for i in \
549 ${srcdir}/../itcl/itcl \
550 `ls -dr ${srcdir}/../itcl[[4-9]]*/itcl 2>/dev/null` ; do
92cf4495
SP
551 if test -f "$i/itclConfig.sh" ; then
552 ac_cv_c_itclconfig=`(cd $i; pwd)`
c98fe0c1
JI
553 break
554 fi
555 done
556 fi
557 ])
558 if test x"${ac_cv_c_itclconfig}" = x ; then
559 ITCLCONFIG="# no Itcl configs found"
560 AC_MSG_WARN(Can't find Itcl configuration definitions)
561 else
562 no_itcl=
563 ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh
564 AC_MSG_RESULT(found $ITCLCONFIG)
565 fi
566fi
c98fe0c1
JI
567])
568
569# Defined as a separate macro so we don't have to cache the values
570# from PATH_ITCLCONFIG (because this can also be cached).
571AC_DEFUN(CY_AC_LOAD_ITCLCONFIG, [
572 if test -f "$ITCLCONFIG" ; then
573 . $ITCLCONFIG
574 fi
575
576 AC_SUBST(ITCL_VERSION)
577dnl not actually used, don't export to save symbols
578dnl AC_SUBST(ITCL_MAJOR_VERSION)
579dnl AC_SUBST(ITCL_MINOR_VERSION)
580 AC_SUBST(ITCL_DEFS)
581
582dnl not used, don't export to save symbols
583 dnl AC_SUBST(ITCL_LIB_FILE)
584
585dnl not used outside of configure
586dnl AC_SUBST(ITCL_LIBS)
587dnl not used, don't export to save symbols
588dnl AC_SUBST(ITCL_PREFIX)
589
590dnl not used, don't export to save symbols
591dnl AC_SUBST(ITCL_EXEC_PREFIX)
592
593 AC_SUBST(ITCL_BUILD_INCLUDES)
594 AC_SUBST(ITCL_BUILD_LIB_SPEC)
595 AC_SUBST(ITCL_LIB_SPEC)
596])
2476848a
MH
597
598# check for Itcl headers.
599
600AC_DEFUN(CY_AC_PATH_ITCLH, [
601AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir})
602if test x"${ac_cv_c_itclh}" = x ; then
c98fe0c1
JI
603 for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
604 if test -f $i/generic/itcl.h ; then
605 ac_cv_c_itclh=`(cd $i/generic; pwd)`
2476848a
MH
606 break
607 fi
608 done
609fi
610if test x"${ac_cv_c_itclh}" = x ; then
611 ITCLHDIR="# no Itcl private headers found"
612 AC_MSG_ERROR([Can't find Itcl private headers])
613fi
614if test x"${ac_cv_c_itclh}" != x ; then
615 ITCLHDIR="-I${ac_cv_c_itclh}"
616fi
617# should always be here
c98fe0c1 618# ITCLLIB="../itcl/itcl/unix/libitcl.a"
2476848a 619AC_SUBST(ITCLHDIR)
c98fe0c1
JI
620#AC_SUBST(ITCLLIB)
621])
622
623
624AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
625#
626# Ok, lets find the itk configuration
627# First, look for one uninstalled.
628# the alternative search directory is invoked by --with-itkconfig
629#
630
631if test x"${no_itk}" = x ; then
632 # we reset no_itk in case something fails here
633 no_itk=true
634 AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
635 with_itkconfig=${withval})
636 AC_MSG_CHECKING([for Itk configuration])
637 AC_CACHE_VAL(ac_cv_c_itkconfig,[
638
639 # First check to see if --with-itkconfig was specified.
640 if test x"${with_itkconfig}" != x ; then
641 if test -f "${with_itkconfig}/itkConfig.sh" ; then
642 ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)`
643 else
644 AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh])
645 fi
646 fi
647
648 # then check for a private Itk library
649 if test x"${ac_cv_c_itkconfig}" = x ; then
650 for i in \
651 ../itcl/itk \
652 `ls -dr ../itcl[[4-9]]*/itk 2>/dev/null` \
653 ../../itk \
654 `ls -dr ../../itcl[[4-9]]*/itk 2>/dev/null` \
655 ../../../itk \
656 `ls -dr ../../../itcl[[4-9]]*/itk 2>/dev/null` ; do
92cf4495
SP
657 if test -f "$i/itkConfig.sh" ; then
658 ac_cv_c_itkconfig=`(cd $i; pwd)`
c98fe0c1
JI
659 break
660 fi
661 done
662 fi
663 # check in a few common install locations
664 if test x"${ac_cv_c_itkconfig}" = x ; then
665 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
666 if test -f "$i/itkConfig.sh" ; then
667 ac_cv_c_itkconfig=`(cd $i; pwd)`
668 break
669 fi
670 done
671 fi
672 # check in a few other private locations
673 if test x"${ac_cv_c_itkconfig}" = x ; then
674 for i in \
675 ${srcdir}/../itcl/itk \
676 `ls -dr ${srcdir}/../itcl[[4-9]]*/itk 2>/dev/null` ; do
92cf4495
SP
677 if test -f "$i/itkConfig.sh" ; then
678 ac_cv_c_itkconfig=`(cd $i; pwd)`
c98fe0c1
JI
679 break
680 fi
681 done
682 fi
683 ])
684 if test x"${ac_cv_c_itkconfig}" = x ; then
685 ITKCONFIG="# no Itk configs found"
686 AC_MSG_WARN(Can't find Itk configuration definitions)
687 else
688 no_itk=
689 ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh
690 AC_MSG_RESULT(found $ITKCONFIG)
691 fi
692fi
693
694])
695
696# Defined as a separate macro so we don't have to cache the values
697# from PATH_ITKCONFIG (because this can also be cached).
698AC_DEFUN(CY_AC_LOAD_ITKCONFIG, [
699 if test -f "$ITKCONFIG" ; then
700 . $ITKCONFIG
701 fi
702
703 AC_SUBST(ITK_VERSION)
704dnl not actually used, don't export to save symbols
705dnl AC_SUBST(ITK_MAJOR_VERSION)
706dnl AC_SUBST(ITK_MINOR_VERSION)
707 AC_SUBST(ITK_DEFS)
708
709dnl not used, don't export to save symbols
710 dnl AC_SUBST(ITK_LIB_FILE)
711
712dnl not used outside of configure
713dnl AC_SUBST(ITK_LIBS)
714dnl not used, don't export to save symbols
715dnl AC_SUBST(ITK_PREFIX)
716
717dnl not used, don't export to save symbols
718dnl AC_SUBST(ITK_EXEC_PREFIX)
719
720 AC_SUBST(ITK_BUILD_INCLUDES)
721 AC_SUBST(ITK_BUILD_LIB_SPEC)
722 AC_SUBST(ITK_LIB_SPEC)
723])
724
725AC_DEFUN(CY_AC_PATH_ITKH, [
726AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir})
727if test x"${ac_cv_c_itkh}" = x ; then
728 for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
729 if test -f $i/generic/itk.h ; then
730 ac_cv_c_itkh=`(cd $i/generic; pwd)`
731 break
732 fi
733 done
734fi
735if test x"${ac_cv_c_itkh}" = x ; then
736 ITKHDIR="# no Itk private headers found"
737 AC_MSG_ERROR([Can't find Itk private headers])
738fi
739if test x"${ac_cv_c_itkh}" != x ; then
740 ITKHDIR="-I${ac_cv_c_itkh}"
741fi
742# should always be here
743# ITKLIB="../itcl/itk/unix/libitk.a"
744AC_SUBST(ITKHDIR)
745#AC_SUBST(ITKLIB)
2476848a
MH
746])
747
748# check for Tix headers.
749
b11485da 750AC_DEFUN(CY_AC_PATH_TIXH, [
2476848a
MH
751AC_MSG_CHECKING(for Tix private headers. srcdir=${srcdir})
752if test x"${ac_cv_c_tixh}" = x ; then
753 for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
754 if test -f $i/generic/tix.h ; then
755 ac_cv_c_tixh=`(cd $i/generic; pwd)`
756 break
757 fi
758 done
759fi
760if test x"${ac_cv_c_tixh}" = x ; then
761 TIXHDIR="# no Tix private headers found"
762 AC_MSG_ERROR([Can't find Tix private headers])
763fi
764if test x"${ac_cv_c_tixh}" != x ; then
765 TIXHDIR="-I${ac_cv_c_tixh}"
766fi
2476848a 767AC_SUBST(TIXHDIR)
2476848a 768])
495c315a 769
b11485da
JI
770AC_DEFUN(CY_AC_PATH_TIXCONFIG, [
771#
772# Ok, lets find the tix configuration
773# First, look for one uninstalled.
774# the alternative search directory is invoked by --with-itkconfig
775#
776
777if test x"${no_tix}" = x ; then
778 # we reset no_tix in case something fails here
779 no_tix=true
780 AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
781 with_tixconfig=${withval})
782 AC_MSG_CHECKING([for Tix configuration])
783 AC_CACHE_VAL(ac_cv_c_tixconfig,[
784
785 # First check to see if --with-tixconfig was specified.
786 if test x"${with_tixconfig}" != x ; then
787 if test -f "${with_tixconfig}/tixConfig.sh" ; then
788 ac_cv_c_tixconfig=`(cd ${with_tixconfig}; pwd)`
789 else
790 AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh])
791 fi
792 fi
793
794 # then check for a private Tix library
795 if test x"${ac_cv_c_tixconfig}" = x ; then
796 for i in \
797 ../tix \
798 `ls -dr ../tix 2>/dev/null` \
799 ../../tix \
800 `ls -dr ../../tix 2>/dev/null` \
801 ../../../tix \
802 `ls -dr ../../../tix 2>/dev/null` ; do
803 echo "**** Looking at $i - with ${configdir}"
804 if test -f "$i/tixConfig.sh" ; then
805 ac_cv_c_tixconfig=`(cd $i; pwd)`
806 break
807 fi
808 done
809 fi
810 # check in a few common install locations
811 if test x"${ac_cv_c_tixconfig}" = x ; then
812 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
813 echo "**** Looking at $i"
814 if test -f "$i/tixConfig.sh" ; then
815 ac_cv_c_tixconfig=`(cd $i; pwd)`
816 break
817 fi
818 done
819 fi
820 # check in a few other private locations
821 echo "**** Other private locations"
822 if test x"${ac_cv_c_tixconfig}" = x ; then
823 for i in \
824 ${srcdir}/../tix \
825 `ls -dr ${srcdir}/../tix 2>/dev/null` ; do
826 echo "**** Looking at $i - with ${configdir}"
827 if test -f "$i/${configdir}/tixConfig.sh" ; then
828 ac_cv_c_tixconfig=`(cd $i/${configdir}; pwd)`
829 break
830 fi
831 done
832 fi
833 ])
834 if test x"${ac_cv_c_tixconfig}" = x ; then
835 TIXCONFIG="# no Tix configs found"
836 AC_MSG_WARN(Can't find Tix configuration definitions)
837 else
838 no_tix=
839 TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh
840 AC_MSG_RESULT(found $TIXCONFIG)
841 fi
842fi
843
844])
845
846# Defined as a separate macro so we don't have to cache the values
847# from PATH_TIXCONFIG (because this can also be cached).
848AC_DEFUN(CY_AC_LOAD_TIXCONFIG, [
849 if test -f "$TIXCONFIG" ; then
850 . $TIXCONFIG
851 fi
852
853 AC_SUBST(TIX_VERSION)
854dnl not actually used, don't export to save symbols
855dnl AC_SUBST(TIX_MAJOR_VERSION)
856dnl AC_SUBST(TIX_MINOR_VERSION)
857dnl AC_SUBST(TIX_DEFS)
858
859dnl not used, don't export to save symbols
860dnl dnl AC_SUBST(TIX_LIB_FILE)
861
862dnl not used outside of configure
863dnl AC_SUBST(TIX_LIBS)
864dnl not used, don't export to save symbols
865dnl AC_SUBST(TIX_PREFIX)
866
867dnl not used, don't export to save symbols
868dnl AC_SUBST(TIX_EXEC_PREFIX)
869
870dnl AC_SUBST(TIX_BUILD_INCLUDES)
871 AC_SUBST(TIX_BUILD_LIB_SPEC)
872dnl AC_SUBST(TIX_LIB_SPEC)
873])
874
495c315a
JB
875
876# serial 1
877
878# @defmac AC_PROG_CC_STDC
879# @maindex PROG_CC_STDC
880# @ovindex CC
881# If the C compiler in not in ANSI C mode by default, try to add an option
882# to output variable @code{CC} to make it so. This macro tries various
883# options that select ANSI C on some system or another. It considers the
884# compiler to be in ANSI C mode if it handles function prototypes correctly.
885#
886# If you use this macro, you should check after calling it whether the C
887# compiler has been set to accept ANSI C; if not, the shell variable
888# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
889# code in ANSI C, you can make an un-ANSIfied copy of it by using the
890# program @code{ansi2knr}, which comes with Ghostscript.
891# @end defmac
892
893AC_DEFUN(AM_PROG_CC_STDC,
894[AC_REQUIRE([AC_PROG_CC])
895AC_BEFORE([$0], [AC_C_INLINE])
896AC_BEFORE([$0], [AC_C_CONST])
897dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
898dnl a magic option to avoid problems with ANSI preprocessor commands
899dnl like #elif.
900dnl FIXME: can't do this because then AC_AIX won't work due to a
901dnl circular dependency.
902dnl AC_BEFORE([$0], [AC_PROG_CPP])
903AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
904AC_CACHE_VAL(am_cv_prog_cc_stdc,
905[am_cv_prog_cc_stdc=no
906ac_save_CC="$CC"
907# Don't try gcc -ansi; that turns off useful extensions and
908# breaks some systems' header files.
909# AIX -qlanglvl=ansi
910# Ultrix and OSF/1 -std1
911# HP-UX -Aa -D_HPUX_SOURCE
912# SVR4 -Xc -D__EXTENSIONS__
913for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
914do
915 CC="$ac_save_CC $ac_arg"
916 AC_TRY_COMPILE(
917[#include <stdarg.h>
918#include <stdio.h>
919#include <sys/types.h>
920#include <sys/stat.h>
921/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
922struct buf { int x; };
923FILE * (*rcsopen) (struct buf *, struct stat *, int);
924static char *e (p, i)
925 char **p;
926 int i;
927{
928 return p[i];
929}
930static char *f (char * (*g) (char **, int), char **p, ...)
931{
932 char *s;
933 va_list v;
934 va_start (v,p);
935 s = g (p, va_arg (v,int));
936 va_end (v);
937 return s;
938}
939int test (int i, double x);
940struct s1 {int (*f) (int a);};
941struct s2 {int (*f) (double a);};
942int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
943int argc;
944char **argv;
945], [
946return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
947],
948[am_cv_prog_cc_stdc="$ac_arg"; break])
949done
950CC="$ac_save_CC"
951])
952if test -z "$am_cv_prog_cc_stdc"; then
953 AC_MSG_RESULT([none needed])
954else
955 AC_MSG_RESULT($am_cv_prog_cc_stdc)
956fi
957case "x$am_cv_prog_cc_stdc" in
958 x|xno) ;;
959 *) CC="$CC $am_cv_prog_cc_stdc" ;;
960esac
961])
962
8fa71a71
JM
963# This file is derived from `gettext.m4'. The difference is that the
964# included macros assume Cygnus-style source and build trees.
965
966# Macro to add for using GNU gettext.
967# Ulrich Drepper <drepper@cygnus.com>, 1995.
968#
969# This file file be copied and used freely without restrictions. It can
970# be used in projects which are not available under the GNU Public License
971# but which still want to provide support for the GNU gettext functionality.
972# Please note that the actual code is *not* freely available.
973
974# serial 3
975
976AC_DEFUN(CY_WITH_NLS,
977 [AC_MSG_CHECKING([whether NLS is requested])
978 dnl Default is enabled NLS
979 AC_ARG_ENABLE(nls,
980 [ --disable-nls do not use Native Language Support],
981 USE_NLS=$enableval, USE_NLS=yes)
982 AC_MSG_RESULT($USE_NLS)
983 AC_SUBST(USE_NLS)
984
985 USE_INCLUDED_LIBINTL=no
986
987 dnl If we use NLS figure out what method
988 if test "$USE_NLS" = "yes"; then
989 AC_DEFINE(ENABLE_NLS)
990 AC_MSG_CHECKING([whether included gettext is requested])
991 AC_ARG_WITH(included-gettext,
992 [ --with-included-gettext use the GNU gettext library included here],
993 nls_cv_force_use_gnu_gettext=$withval,
994 nls_cv_force_use_gnu_gettext=no)
995 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
996
997 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
998 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
999 dnl User does not insist on using GNU NLS library. Figure out what
1000 dnl to use. If gettext or catgets are available (in this order) we
1001 dnl use this. Else we have to fall back to GNU NLS library.
1002 dnl catgets is only used if permitted by option --with-catgets.
1003 nls_cv_header_intl=
1004 nls_cv_header_libgt=
1005 CATOBJEXT=NONE
1006
1007 AC_CHECK_HEADER(libintl.h,
1008 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
1009 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
1010 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
1011
1012 if test "$gt_cv_func_gettext_libc" != "yes"; then
1013 AC_CHECK_LIB(intl, bindtextdomain,
1014 [AC_CACHE_CHECK([for gettext in libintl],
1015 gt_cv_func_gettext_libintl,
1016 [AC_TRY_LINK([], [return (int) gettext ("")],
1017 gt_cv_func_gettext_libintl=yes,
1018 gt_cv_func_gettext_libintl=no)])])
1019 fi
1020
1021 if test "$gt_cv_func_gettext_libc" = "yes" \
1022 || test "$gt_cv_func_gettext_libintl" = "yes"; then
1023 AC_DEFINE(HAVE_GETTEXT)
1024 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1025 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1026 if test "$MSGFMT" != "no"; then
1027 AC_CHECK_FUNCS(dcgettext)
1028 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1029 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1030 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1031 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1032 return _nl_msg_cat_cntr],
1033 [CATOBJEXT=.gmo
1034 DATADIRNAME=share],
1035 [CATOBJEXT=.mo
1036 DATADIRNAME=lib])
1037 INSTOBJEXT=.mo
1038 fi
1039 fi
1040 ])
1041
1042 dnl In the standard gettext, we would now check for catgets.
1043 dnl However, we never want to use catgets for our releases.
1044
1045 if test "$CATOBJEXT" = "NONE"; then
1046 dnl Neither gettext nor catgets in included in the C library.
1047 dnl Fall back on GNU gettext library.
1048 nls_cv_use_gnu_gettext=yes
1049 fi
1050 fi
1051
1052 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1053 dnl Mark actions used to generate GNU NLS library.
1054 INTLOBJS="\$(GETTOBJS)"
1055 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1056 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
1057 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1058 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1059 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1060 AC_SUBST(MSGFMT)
1061 USE_INCLUDED_LIBINTL=yes
1062 CATOBJEXT=.gmo
1063 INSTOBJEXT=.mo
1064 DATADIRNAME=share
1065 INTLDEPS='$(top_builddir)/../intl/libintl.a'
1066 INTLLIBS=$INTLDEPS
1067 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
1068 nls_cv_header_intl=libintl.h
1069 nls_cv_header_libgt=libgettext.h
1070 fi
1071
1072 dnl Test whether we really found GNU xgettext.
1073 if test "$XGETTEXT" != ":"; then
1074 dnl If it is no GNU xgettext we define it as : so that the
1075 dnl Makefiles still can work.
1076 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1077 : ;
1078 else
1079 AC_MSG_RESULT(
1080 [found xgettext programs is not GNU xgettext; ignore it])
1081 XGETTEXT=":"
1082 fi
1083 fi
1084
1085 # We need to process the po/ directory.
1086 POSUB=po
1087 else
1088 DATADIRNAME=share
1089 nls_cv_header_intl=libintl.h
1090 nls_cv_header_libgt=libgettext.h
1091 fi
1092
1093 # If this is used in GNU gettext we have to set USE_NLS to `yes'
1094 # because some of the sources are only built for this goal.
1095 if test "$PACKAGE" = gettext; then
1096 USE_NLS=yes
1097 USE_INCLUDED_LIBINTL=yes
1098 fi
1099
1100 dnl These rules are solely for the distribution goal. While doing this
1101 dnl we only have to keep exactly one list of the available catalogs
1102 dnl in configure.in.
1103 for lang in $ALL_LINGUAS; do
1104 GMOFILES="$GMOFILES $lang.gmo"
1105 POFILES="$POFILES $lang.po"
1106 done
1107
1108 dnl Make all variables we use known to autoconf.
1109 AC_SUBST(USE_INCLUDED_LIBINTL)
1110 AC_SUBST(CATALOGS)
1111 AC_SUBST(CATOBJEXT)
1112 AC_SUBST(DATADIRNAME)
1113 AC_SUBST(GMOFILES)
1114 AC_SUBST(INSTOBJEXT)
1115 AC_SUBST(INTLDEPS)
1116 AC_SUBST(INTLLIBS)
1117 AC_SUBST(INTLOBJS)
1118 AC_SUBST(POFILES)
1119 AC_SUBST(POSUB)
1120 ])
1121
1122AC_DEFUN(CY_GNU_GETTEXT,
1123 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1124 AC_REQUIRE([AC_PROG_CC])dnl
1125 AC_REQUIRE([AC_PROG_RANLIB])dnl
1126 AC_REQUIRE([AC_ISC_POSIX])dnl
1127 AC_REQUIRE([AC_HEADER_STDC])dnl
1128 AC_REQUIRE([AC_C_CONST])dnl
1129 AC_REQUIRE([AC_C_INLINE])dnl
1130 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1131 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1132 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1133 AC_REQUIRE([AC_FUNC_MMAP])dnl
1134
1135 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1136unistd.h values.h sys/param.h])
1137 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1138__argz_count __argz_stringify __argz_next])
1139
1140 if test "${ac_cv_func_stpcpy+set}" != "set"; then
1141 AC_CHECK_FUNCS(stpcpy)
1142 fi
1143 if test "${ac_cv_func_stpcpy}" = "yes"; then
1144 AC_DEFINE(HAVE_STPCPY)
1145 fi
1146
1147 AM_LC_MESSAGES
1148 CY_WITH_NLS
1149
1150 if test "x$CATOBJEXT" != "x"; then
1151 if test "x$ALL_LINGUAS" = "x"; then
1152 LINGUAS=
1153 else
1154 AC_MSG_CHECKING(for catalogs to be installed)
1155 NEW_LINGUAS=
1156 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1157 case "$ALL_LINGUAS" in
1158 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1159 esac
1160 done
1161 LINGUAS=$NEW_LINGUAS
1162 AC_MSG_RESULT($LINGUAS)
1163 fi
1164
1165 dnl Construct list of names of catalog files to be constructed.
1166 if test -n "$LINGUAS"; then
1167 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1168 fi
1169 fi
1170
1171 dnl The reference to <locale.h> in the installed <libintl.h> file
1172 dnl must be resolved because we cannot expect the users of this
1173 dnl to define HAVE_LOCALE_H.
1174 if test $ac_cv_header_locale_h = yes; then
1175 INCLUDE_LOCALE_H="#include <locale.h>"
1176 else
1177 INCLUDE_LOCALE_H="\
1178/* The system does not provide the header <locale.h>. Take care yourself. */"
1179 fi
1180 AC_SUBST(INCLUDE_LOCALE_H)
1181
1182 dnl Determine which catalog format we have (if any is needed)
1183 dnl For now we know about two different formats:
1184 dnl Linux libc-5 and the normal X/Open format
1185 if test -f $srcdir/po2tbl.sed.in; then
1186 if test "$CATOBJEXT" = ".cat"; then
1187 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1188
1189 dnl Transform the SED scripts while copying because some dumb SEDs
1190 dnl cannot handle comments.
1191 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
1192 fi
1193 dnl po2tbl.sed is always needed.
1194 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1195 $srcdir/po2tbl.sed.in > po2tbl.sed
1196 fi
1197
1198 dnl In the intl/Makefile.in we have a special dependency which makes
1199 dnl only sense for gettext. We comment this out for non-gettext
1200 dnl packages.
1201 if test "$PACKAGE" = "gettext"; then
1202 GT_NO="#NO#"
1203 GT_YES=
1204 else
1205 GT_NO=
1206 GT_YES="#YES#"
1207 fi
1208 AC_SUBST(GT_NO)
1209 AC_SUBST(GT_YES)
1210
1211 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
1212 AC_SUBST(MKINSTALLDIRS)
1213
1214 dnl *** For now the libtool support in intl/Makefile is not for real.
1215 l=
1216 AC_SUBST(l)
1217
1218 dnl Generate list of files to be processed by xgettext which will
1219 dnl be included in po/Makefile. But only do this if the po directory
1220 dnl exists in srcdir.
1221 if test -d $srcdir/po; then
1222 test -d po || mkdir po
1223 if test "x$srcdir" != "x."; then
1224 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1225 posrcprefix="$srcdir/"
1226 else
1227 posrcprefix="../$srcdir/"
1228 fi
1229 else
1230 posrcprefix="../"
1231 fi
1232 rm -f po/POTFILES
1233 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1234 < $srcdir/po/POTFILES.in > po/POTFILES
1235 fi
1236 ])
1237
1238# Search path for a program which passes the given test.
1239# Ulrich Drepper <drepper@cygnus.com>, 1996.
1240#
1241# This file file be copied and used freely without restrictions. It can
1242# be used in projects which are not available under the GNU Public License
1243# but which still want to provide support for the GNU gettext functionality.
1244# Please note that the actual code is *not* freely available.
1245
1246# serial 1
1247
1248dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1249dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1250AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1251[# Extract the first word of "$2", so it can be a program name with args.
1252set dummy $2; ac_word=[$]2
1253AC_MSG_CHECKING([for $ac_word])
1254AC_CACHE_VAL(ac_cv_path_$1,
1255[case "[$]$1" in
1256 /*)
1257 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1258 ;;
1259 *)
1260 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1261 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1262 test -z "$ac_dir" && ac_dir=.
1263 if test -f $ac_dir/$ac_word; then
1264 if [$3]; then
1265 ac_cv_path_$1="$ac_dir/$ac_word"
1266 break
1267 fi
1268 fi
1269 done
1270 IFS="$ac_save_ifs"
1271dnl If no 4th arg is given, leave the cache variable unset,
1272dnl so AC_PATH_PROGS will keep looking.
1273ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1274])dnl
1275 ;;
1276esac])dnl
1277$1="$ac_cv_path_$1"
1278if test -n "[$]$1"; then
1279 AC_MSG_RESULT([$]$1)
1280else
1281 AC_MSG_RESULT(no)
1282fi
1283AC_SUBST($1)dnl
1284])
1285
1286# Check whether LC_MESSAGES is available in <locale.h>.
1287# Ulrich Drepper <drepper@cygnus.com>, 1995.
1288#
1289# This file file be copied and used freely without restrictions. It can
1290# be used in projects which are not available under the GNU Public License
1291# but which still want to provide support for the GNU gettext functionality.
1292# Please note that the actual code is *not* freely available.
1293
1294# serial 1
1295
1296AC_DEFUN(AM_LC_MESSAGES,
1297 [if test $ac_cv_header_locale_h = yes; then
1298 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1299 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1300 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1301 if test $am_cv_val_LC_MESSAGES = yes; then
1302 AC_DEFINE(HAVE_LC_MESSAGES)
1303 fi
1304 fi])
1305