11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
14
dnl Autoconf macros used by PINENTRY
16
dnl Copyright (C) 2002 g10 Code GmbH
18
dnl IU_LIB_NCURSES, IU_LIB_CURSES and IU_LIB_TERMCAP are:
19
dnl Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
20
dnl Written by Miles Bader <miles@gnu.ai.mit.edu>
22
dnl This program is free software; you can redistribute it and/or modify
23
dnl it under the terms of the GNU General Public License as published by
24
dnl the Free Software Foundation; either version 2, or (at your option)
25
dnl any later version.
27
dnl This program is distributed in the hope that it will be useful,
28
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
29
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
dnl GNU General Public License for more details.
32
dnl You should have received a copy of the GNU General Public License
33
dnl along with this program; if not, write to the Free Software
34
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37
dnl IU_LIB_NCURSES -- check for, and configure, ncurses
39
dnl If libncurses is found to exist on this system and the --disable-ncurses
40
dnl flag wasn't specified, defines LIBNCURSES with the appropriate linker
41
dnl specification, and possibly defines NCURSES_INCLUDE with the appropriate
42
dnl -I flag to get access to ncurses include files.
44
AC_DEFUN([IU_LIB_NCURSES], [
45
AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses],
47
if test "$enable_ncurses" = yes; then
48
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")
49
if test "$LIBNCURSES"; then
50
# Use ncurses header files instead of the ordinary ones, if possible;
51
# is there a better way of doing this, that avoids looking in specific
53
AC_ARG_WITH(ncurses-include-dir,
54
[ --with-ncurses-include-dir=DIR
55
Set directory containing the include files for
56
use with -lncurses, when it isn't installed as
57
the default curses library. If DIR is "none",
58
then no special ncurses include files are used.
59
--without-ncurses-include-dir
60
Equivalent to --with-ncurses-include-dir=none])dnl
61
if test "${with_ncurses_include_dir+set}" = set; then
62
AC_MSG_CHECKING(for ncurses include dir)
63
case "$with_ncurses_include_dir" in
65
inetutils_cv_includedir_ncurses=none;;
67
inetutils_cv_includedir_ncurses="$with_ncurses_include_dir";;
69
AC_MSG_RESULT($inetutils_cv_includedir_ncurses)
71
AC_CACHE_CHECK(for ncurses include dir,
72
inetutils_cv_includedir_ncurses,
73
for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do
74
if test -d $D/ncurses; then
75
inetutils_cv_includedir_ncurses="$D/ncurses"
78
test "$inetutils_cv_includedir_ncurses" \
79
|| inetutils_cv_includedir_ncurses=none
82
if test "$inetutils_cv_includedir_ncurses" = none; then
85
NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses"
89
AC_SUBST(NCURSES_INCLUDE)
90
AC_SUBST(LIBNCURSES)])dnl
92
dnl IU_LIB_TERMCAP -- check for various termcap libraries
94
dnl Checks for various common libraries implementing the termcap interface,
95
dnl including ncurses (unless --disable ncurses is specified), curses (which
96
dnl does on some systems), termcap, and termlib. If termcap is found, then
97
dnl LIBTERMCAP is defined with the appropriate linker specification.
99
AC_DEFUN([IU_LIB_TERMCAP], [
100
AC_REQUIRE([IU_LIB_NCURSES])
101
if test "$LIBNCURSES"; then
102
LIBTERMCAP="$LIBNCURSES"
104
AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses)
105
if test "$ac_cv_lib_curses_tgetent" = no; then
106
AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap)
108
if test "$ac_cv_lib_termcap_tgetent" = no; then
109
AC_CHECK_LIB(termlib, tgetent, LIBTERMCAP=-ltermlib)
112
AC_SUBST(LIBTERMCAP)])dnl
114
dnl IU_LIB_CURSES -- checke for curses, and associated libraries
116
dnl Checks for varions libraries implementing the curses interface, and if
117
dnl found, defines LIBCURSES to be the appropriate linker specification,
118
dnl *including* any termcap libraries if needed (some versions of curses
119
dnl don't need termcap).
121
AC_DEFUN([IU_LIB_CURSES], [
122
AC_REQUIRE([IU_LIB_TERMCAP])
123
AC_REQUIRE([IU_LIB_NCURSES])
124
if test "$LIBNCURSES"; then
125
LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap
127
_IU_SAVE_LIBS="$LIBS"
129
AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses")
130
if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then
131
AC_CACHE_CHECK(whether curses needs $LIBTERMCAP,
132
inetutils_cv_curses_needs_termcap,
134
AC_TRY_LINK([#include <curses.h>], [initscr ();],
135
[inetutils_cv_curses_needs_termcap=no],
136
[inetutils_cv_curses_needs_termcap=yes]))
137
if test $inetutils_cv_curses_needs_termcap = yes; then
138
LIBCURSES="$LIBCURSES $LIBTERMCAP"
141
LIBS="$_IU_SAVE_LIBS"
143
AC_SUBST(LIBCURSES)])dnl
144
dnl additional configure macros
147
# From /usr/share/aclocal/iconv.m4.
151
dnl From Bruno Haible.
155
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
156
dnl those with the standalone portable GNU libiconv installed).
158
AC_ARG_WITH([libiconv-prefix],
159
[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
160
for dir in `echo "$withval" | tr : ' '`; do
161
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
162
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
166
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
167
am_cv_func_iconv="no, consider installing GNU libiconv"
169
AC_TRY_LINK([#include <stdlib.h>
171
[iconv_t cd = iconv_open("","");
172
iconv(cd,NULL,NULL,NULL,NULL);
174
am_cv_func_iconv=yes)
175
if test "$am_cv_func_iconv" != yes; then
178
AC_TRY_LINK([#include <stdlib.h>
180
[iconv_t cd = iconv_open("","");
181
iconv(cd,NULL,NULL,NULL,NULL);
184
am_cv_func_iconv=yes)
188
if test "$am_cv_func_iconv" = yes; then
189
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
190
AC_MSG_CHECKING([for iconv declaration])
191
AC_CACHE_VAL(am_cv_proto_iconv, [
199
#if defined(__STDC__) || defined(__cplusplus)
200
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
204
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
205
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
206
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
207
AC_MSG_RESULT([$]{ac_t:-
208
}[$]am_cv_proto_iconv)
209
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
210
[Define as const if the declaration of iconv() needs const.])
213
if test "$am_cv_lib_iconv" = yes; then
221
dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME)
222
dnl Check whether a typedef exists and create a #define $2 if it exists
224
AC_DEFUN(GNUPG_CHECK_TYPEDEF,
225
[ AC_MSG_CHECKING(for $1 typedef)
226
AC_CACHE_VAL(gnupg_cv_typedef_$1,
227
[AC_TRY_COMPILE([#define _GNU_SOURCE 1
229
#include <sys/types.h>], [
232
], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
233
AC_MSG_RESULT($gnupg_cv_typedef_$1)
234
if test "$gnupg_cv_typedef_$1" = yes; then
235
AC_DEFINE($2,1,[Defined if a `]$1[' is typedef'd])
240
# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
241
# is not called from uid 0 (not tested whether uid 0 works)
242
# For DECs Tru64 we have also to check whether mlock is in librt
243
# mlock is there a macro using memlk()
244
dnl GNUPG_CHECK_MLOCK
246
define(GNUPG_CHECK_MLOCK,
247
[ AC_CHECK_FUNCS(mlock)
248
if test "$ac_cv_func_mlock" = "no"; then
249
AC_CHECK_HEADERS(sys/mman.h)
250
if test "$ac_cv_header_sys_mman_h" = "yes"; then
252
AC_CHECK_LIB(rt, memlk)
253
AC_CACHE_CHECK([whether mlock is in sys/mman.h],
254
gnupg_cv_mlock_is_in_sys_mman,
257
#ifdef HAVE_SYS_MMAN_H
258
#include <sys/mman.h>
263
/* glibc defines this for functions which it implements
264
* to always fail with ENOSYS. Some functions are actually
265
* named something starting with __ and the normal name
267
#if defined (__stub_mlock) || defined (__stub___mlock)
274
gnupg_cv_mlock_is_in_sys_mman=yes,
275
gnupg_cv_mlock_is_in_sys_mman=no)])
276
if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then
277
AC_DEFINE(HAVE_MLOCK,1,
278
[Defined if the system supports an mlock() call])
282
if test "$ac_cv_func_mlock" = "yes"; then
283
AC_MSG_CHECKING(whether mlock is broken)
284
AC_CACHE_VAL(gnupg_cv_have_broken_mlock,
289
#include <sys/mman.h>
290
#include <sys/types.h>
297
long int pgsize = getpagesize();
299
pool = malloc( 4096 + pgsize );
302
pool += (pgsize - ((long int)pool % pgsize));
304
err = mlock( pool, 4096 );
305
if( !err || errno == EPERM )
312
gnupg_cv_have_broken_mlock="no",
313
gnupg_cv_have_broken_mlock="yes",
314
gnupg_cv_have_broken_mlock="assume-no"
317
if test "$gnupg_cv_have_broken_mlock" = "yes"; then
318
AC_DEFINE(HAVE_BROKEN_MLOCK,1,
319
[Defined if the mlock() call does not work])
321
AC_CHECK_FUNCS(plock)
323
if test "$gnupg_cv_have_broken_mlock" = "no"; then
326
AC_MSG_RESULT(assuming no)
332
# Configure paths for GLIB
333
# Owen Taylor 97-11-3
335
dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
336
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
337
dnl gthread is specified in MODULES, pass to glib-config
339
AC_DEFUN(AM_PATH_GLIB,
341
dnl Get the cflags and libraries from the glib-config script
343
AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
344
glib_config_prefix="$withval", glib_config_prefix="")
345
AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
346
glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
347
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
348
, enable_glibtest=yes)
350
if test x$glib_config_exec_prefix != x ; then
351
glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
352
if test x${GLIB_CONFIG+set} != xset ; then
353
GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
356
if test x$glib_config_prefix != x ; then
357
glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
358
if test x${GLIB_CONFIG+set} != xset ; then
359
GLIB_CONFIG=$glib_config_prefix/bin/glib-config
367
glib_config_args="$glib_config_args gmodule"
370
glib_config_args="$glib_config_args gthread"
375
AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
376
min_glib_version=ifelse([$1], ,0.99.7,$1)
377
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
379
if test "$GLIB_CONFIG" = "no" ; then
382
GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
383
GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
384
glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
385
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
386
glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
387
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
388
glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
389
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
390
if test "x$enable_glibtest" = "xyes" ; then
391
ac_save_CFLAGS="$CFLAGS"
393
CFLAGS="$CFLAGS $GLIB_CFLAGS"
394
LIBS="$GLIB_LIBS $LIBS"
396
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
397
dnl checks the results of glib-config to some extent
408
int major, minor, micro;
411
system ("touch conf.glibtest");
413
/* HP/UX 9 (%@#!) writes to sscanf strings */
414
tmp_version = g_strdup("$min_glib_version");
415
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
416
printf("%s, bad version string\n", "$min_glib_version");
420
if ((glib_major_version != $glib_config_major_version) ||
421
(glib_minor_version != $glib_config_minor_version) ||
422
(glib_micro_version != $glib_config_micro_version))
424
printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
425
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
426
glib_major_version, glib_minor_version, glib_micro_version);
427
printf ("*** was found! If glib-config was correct, then it is best\n");
428
printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
429
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
430
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
431
printf("*** required on your system.\n");
432
printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
433
printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
434
printf("*** before re-running configure\n");
436
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
437
(glib_minor_version != GLIB_MINOR_VERSION) ||
438
(glib_micro_version != GLIB_MICRO_VERSION))
440
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
441
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
442
printf("*** library (version %d.%d.%d)\n",
443
glib_major_version, glib_minor_version, glib_micro_version);
447
if ((glib_major_version > major) ||
448
((glib_major_version == major) && (glib_minor_version > minor)) ||
449
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
455
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
456
glib_major_version, glib_minor_version, glib_micro_version);
457
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
458
major, minor, micro);
459
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
461
printf("*** If you have already installed a sufficiently new version, this error\n");
462
printf("*** probably means that the wrong copy of the glib-config shell script is\n");
463
printf("*** being found. The easiest way to fix this is to remove the old version\n");
464
printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
465
printf("*** correct copy of glib-config. (In this case, you will have to\n");
466
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
467
printf("*** so that the correct libraries are found at run-time))\n");
472
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
473
CFLAGS="$ac_save_CFLAGS"
477
if test "x$no_glib" = x ; then
479
ifelse([$2], , :, [$2])
482
if test "$GLIB_CONFIG" = "no" ; then
483
echo "*** The glib-config script installed by GLIB could not be found"
484
echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
485
echo "*** your path, or set the GLIB_CONFIG environment variable to the"
486
echo "*** full path to glib-config."
488
if test -f conf.glibtest ; then
491
echo "*** Could not run GLIB test program, checking why..."
492
CFLAGS="$CFLAGS $GLIB_CFLAGS"
493
LIBS="$LIBS $GLIB_LIBS"
497
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
498
[ echo "*** The test program compiled, but did not run. This usually means"
499
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
500
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
501
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
502
echo "*** to the installed location Also, make sure you have run ldconfig if that"
503
echo "*** is required on your system"
505
echo "*** If you have an old version installed, it is best to remove it, although"
506
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
508
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
509
echo "*** came with the system with the command"
511
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
512
[ echo "*** The test program failed to compile or link. See the file config.log for the"
513
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
514
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
515
echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
516
CFLAGS="$ac_save_CFLAGS"
522
ifelse([$3], , :, [$3])
524
AC_SUBST(GLIB_CFLAGS)
530
# Configure paths for GTK+
531
# Owen Taylor 97-11-3
533
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
534
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
536
AC_DEFUN(AM_PATH_GTK,
538
dnl Get the cflags and libraries from the gtk-config script
540
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
541
gtk_config_prefix="$withval", gtk_config_prefix="")
542
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
543
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
544
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
545
, enable_gtktest=yes)
551
gtk_config_args="$gtk_config_args gthread"
556
if test x$gtk_config_exec_prefix != x ; then
557
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
558
if test x${GTK_CONFIG+set} != xset ; then
559
GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
562
if test x$gtk_config_prefix != x ; then
563
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
564
if test x${GTK_CONFIG+set} != xset ; then
565
GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
569
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
570
min_gtk_version=ifelse([$1], ,0.99.7,$1)
571
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
573
if test "$GTK_CONFIG" = "no" ; then
576
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
577
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
578
gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
579
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
580
gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
581
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
582
gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
583
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
584
if test "x$enable_gtktest" = "xyes" ; then
585
ac_save_CFLAGS="$CFLAGS"
587
CFLAGS="$CFLAGS $GTK_CFLAGS"
588
LIBS="$GTK_LIBS $LIBS"
590
dnl Now check if the installed GTK is sufficiently new. (Also sanity
591
dnl checks the results of gtk-config to some extent
602
int major, minor, micro;
605
system ("touch conf.gtktest");
607
/* HP/UX 9 (%@#!) writes to sscanf strings */
608
tmp_version = g_strdup("$min_gtk_version");
609
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
610
printf("%s, bad version string\n", "$min_gtk_version");
614
if ((gtk_major_version != $gtk_config_major_version) ||
615
(gtk_minor_version != $gtk_config_minor_version) ||
616
(gtk_micro_version != $gtk_config_micro_version))
618
printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
619
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
620
gtk_major_version, gtk_minor_version, gtk_micro_version);
621
printf ("*** was found! If gtk-config was correct, then it is best\n");
622
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
623
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
624
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
625
printf("*** required on your system.\n");
626
printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
627
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
628
printf("*** before re-running configure\n");
630
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
631
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
632
(gtk_minor_version != GTK_MINOR_VERSION) ||
633
(gtk_micro_version != GTK_MICRO_VERSION))
635
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
636
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
637
printf("*** library (version %d.%d.%d)\n",
638
gtk_major_version, gtk_minor_version, gtk_micro_version);
640
#endif /* defined (GTK_MAJOR_VERSION) ... */
643
if ((gtk_major_version > major) ||
644
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
645
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
651
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
652
gtk_major_version, gtk_minor_version, gtk_micro_version);
653
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
654
major, minor, micro);
655
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
657
printf("*** If you have already installed a sufficiently new version, this error\n");
658
printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
659
printf("*** being found. The easiest way to fix this is to remove the old version\n");
660
printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
661
printf("*** correct copy of gtk-config. (In this case, you will have to\n");
662
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
663
printf("*** so that the correct libraries are found at run-time))\n");
668
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
669
CFLAGS="$ac_save_CFLAGS"
673
if test "x$no_gtk" = x ; then
675
ifelse([$2], , :, [$2])
678
if test "$GTK_CONFIG" = "no" ; then
679
echo "*** The gtk-config script installed by GTK could not be found"
680
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
681
echo "*** your path, or set the GTK_CONFIG environment variable to the"
682
echo "*** full path to gtk-config."
684
if test -f conf.gtktest ; then
687
echo "*** Could not run GTK test program, checking why..."
688
CFLAGS="$CFLAGS $GTK_CFLAGS"
689
LIBS="$LIBS $GTK_LIBS"
693
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
694
[ echo "*** The test program compiled, but did not run. This usually means"
695
echo "*** that the run-time linker is not finding GTK or finding the wrong"
696
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
697
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
698
echo "*** to the installed location Also, make sure you have run ldconfig if that"
699
echo "*** is required on your system"
701
echo "*** If you have an old version installed, it is best to remove it, although"
702
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
704
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
705
echo "*** came with the system with the command"
707
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
708
[ echo "*** The test program failed to compile or link. See the file config.log for the"
709
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
710
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
711
echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
712
CFLAGS="$ac_save_CFLAGS"
718
ifelse([$3], , :, [$3])
726
dnl This file is part of the KDE libraries/packages
727
dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
728
dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
729
dnl (C) 2002 g10 Code GmbH
730
dnl Modified for PINENTRY by Marcus Brinkmann.
732
dnl This file is free software; you can redistribute it and/or
733
dnl modify it under the terms of the GNU Library General Public
734
dnl License as published by the Free Software Foundation; either
735
dnl version 2 of the License, or (at your option) any later version.
737
dnl This library is distributed in the hope that it will be useful,
738
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
739
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
740
dnl Library General Public License for more details.
742
dnl You should have received a copy of the GNU Library General Public License
743
dnl along with this library; see the file COPYING.LIB. If not, write to
744
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
745
dnl Boston, MA 02111-1307, USA.
747
dnl ------------------------------------------------------------------------
748
dnl Find a file (or one of more files in a list of dirs)
749
dnl ------------------------------------------------------------------------
751
AC_DEFUN(QT_FIND_FILE,
758
echo "configure: __oline__: $i/$j" >&AS_MESSAGE_LOG_FD
759
if test -r "$i/$j"; then
760
echo "taking that" >&AS_MESSAGE_LOG_FD
768
dnl ------------------------------------------------------------------------
769
dnl Find the meta object compiler in the PATH,
770
dnl in $QTDIR/bin, and some more usual places
771
dnl ------------------------------------------------------------------------
773
AC_DEFUN(QT_PATH_MOC,
776
for dir in $qt_dirs; do
777
qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc"
779
qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin"
780
if test ! "$ac_qt_bindir" = "NO"; then
781
qt_bindirs="$ac_qt_bindir:$qt_bindirs"
784
AC_PATH_PROG(MOC, moc, no, [$qt_bindirs])
785
if test "$MOC" = no; then
786
#AC_MSG_ERROR([No Qt meta object compiler (moc) found!
787
#Please check whether you installed Qt correctly.
788
#You need to have a running moc binary.
789
#configure tried to run $ac_cv_path_moc and the test didn't
790
#succeed. If configure shouldn't have tried this one, set
791
#the environment variable MOC to the right one before running
802
dnl ------------------------------------------------------------------------
803
dnl Find the header files and libraries for the X Window System.
804
dnl Extended the macro AC_PATH_XTRA.
805
dnl ------------------------------------------------------------------------
811
[ --enable-embedded link to Qt-embedded, don't use X],
812
qt_use_emb=$enableval,
818
[ --enable-palmtop link to Qt-embedded, don't use X, link to the Qt Palmtop Environment],
819
qt_use_emb_palm=$enableval,
823
if test "$qt_use_emb" = "no"; then
826
if test "$no_x" = yes; then
827
AC_MSG_ERROR([Can't find X. Please check your installation and add the correct paths!])
829
QT_CXXFLAGS="$X_CFLAGS"
831
QT_LIBS="$X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
834
dnl We're using QT Embedded
835
QT_CXXFLAGS="-fno-rtti -DQWS"
838
QTE_NORTTI="-fno-rtti -DQWS"
840
AC_SUBST(QT_CXXFLAGS)
846
AC_DEFUN(QT_PRINT_PROGRAM,
848
AC_REQUIRE([QT_CHECK_VERSION])
849
cat > conftest.$ac_ext <<EOF
850
#include "confdefs.h"
852
#include <qapplication.h>
854
if test "$qt_ver" = "2"; then
855
cat >> conftest.$ac_ext <<EOF
861
if test $qt_subver -gt 0; then
862
cat >> conftest.$ac_ext <<EOF
863
#include <qiconview.h>
868
if test "$qt_ver" = "3"; then
869
cat >> conftest.$ac_ext <<EOF
871
#include <qstylefactory.h>
872
#include <private/qucomextra_p.h>
876
echo "#if ! ($qt_verstring)" >> conftest.$ac_ext
877
cat >> conftest.$ac_ext <<EOF
883
if test "$qt_ver" = "2"; then
884
cat >> conftest.$ac_ext <<EOF
885
QStringList *t = new QStringList();
888
if test $qt_subver -gt 0; then
889
cat >> conftest.$ac_ext <<EOF
891
iv.setWordWrapIconText(false);
893
s.setLatin1("Elvis is alive", 14);
897
if test "$qt_ver" = "3"; then
898
cat >> conftest.$ac_ext <<EOF
899
(void)QStyleFactory::create(QString::null);
900
QCursor c(Qt::WhatsThisCursor);
903
cat >> conftest.$ac_ext <<EOF
910
AC_DEFUN(QT_CHECK_VERSION,
912
if test -z "$1"; then
916
qt_subver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
917
# following is the check if subversion isn�t found in passed argument
918
if test "$qt_subver" = "$1"; then
921
qt_ver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
922
if test "$qt_ver" = "1"; then
927
if test -z "$2"; then
928
if test "$qt_ver" = "2"; then
929
if test $qt_subver -gt 0; then
930
qt_minversion=">= Qt 2.2.2"
932
qt_minversion=">= Qt 2.0.2"
935
if test "$qt_ver" = "3"; then
936
qt_minversion=">= Qt 3.0.1"
938
if test "$qt_ver" = "1"; then
939
qt_minversion=">= 1.42 and < 2.0"
945
if test -z "$3"; then
946
if test $qt_ver = 3; then
947
qt_verstring="QT_VERSION >= 301"
949
if test $qt_ver = 2; then
950
if test $qt_subver -gt 0; then
951
qt_verstring="QT_VERSION >= 222"
953
qt_verstring="QT_VERSION >= 200"
956
if test $qt_ver = 1; then
957
qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
963
if test $qt_ver = 3; then
964
qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
966
if test $qt_ver = 2; then
967
qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
969
if test $qt_ver = 1; then
970
qt_dirs="$QTDIR /usr/lib/qt"
975
AC_DEFUN(QT_CHECK_DIRECT,
977
AC_REQUIRE([QT_CHECK_VERSION])
978
AC_MSG_CHECKING([if Qt compiles without flags])
979
AC_CACHE_VAL(kde_cv_qt_direct,
982
ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
983
ac_LIBRARY_PATH="$LIBRARY_PATH"
984
ac_cxxflags_safe="$CXXFLAGS"
985
ac_ldflags_safe="$LDFLAGS"
988
CXXFLAGS="$CXXFLAGS -I$qt_includes"
989
LDFLAGS="$LDFLAGS $QT_LDFLAGS"
992
export LD_LIBRARY_PATH
998
if AC_TRY_EVAL(ac_link) && test -s conftest; then
999
kde_cv_qt_direct="yes"
1001
kde_cv_qt_direct="no"
1002
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1003
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1007
CXXFLAGS="$ac_cxxflags_safe"
1008
LDFLAGS="$ac_ldflags_safe"
1009
LIBS="$ac_libs_safe"
1011
LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1012
export LD_LIBRARY_PATH
1013
LIBRARY_PATH="$ac_LIBRARY_PATH"
1018
if test "$kde_cv_qt_direct" = "yes"; then
14
# lib-ld.m4 serial 3 (gettext-0.13)
15
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
16
dnl This file is free software, distributed under the terms of the GNU
17
dnl General Public License. As a special exception to the GNU General
18
dnl Public License, this file may be distributed as part of a program
19
dnl that contains a configuration script generated by Autoconf, under
20
dnl the same distribution terms as the rest of that program.
22
dnl Subroutines of libtool.m4,
23
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
26
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
27
AC_DEFUN([AC_LIB_PROG_LD_GNU],
28
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
29
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
30
case `$LD -v 2>&1 </dev/null` in
32
acl_cv_prog_gnu_ld=yes ;;
34
acl_cv_prog_gnu_ld=no ;;
36
with_gnu_ld=$acl_cv_prog_gnu_ld
39
dnl From libtool-1.4. Sets the variable LD.
40
AC_DEFUN([AC_LIB_PROG_LD],
42
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
43
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
44
AC_REQUIRE([AC_PROG_CC])dnl
45
AC_REQUIRE([AC_CANONICAL_HOST])dnl
46
# Prepare PATH_SEPARATOR.
47
# The user is always right.
48
if test "${PATH_SEPARATOR+set}" != set; then
49
echo "#! /bin/sh" >conf$$.sh
50
echo "exit 0" >>conf$$.sh
52
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
60
if test "$GCC" = yes; then
61
# Check if gcc -print-prog-name=ld gives a path.
62
AC_MSG_CHECKING([for ld used by GCC])
65
# gcc leaves a trailing carriage return which upsets mingw
66
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
68
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
71
# Accept absolute paths.
72
[[\\/]* | [A-Za-z]:[\\/]*)]
73
[re_direlt='/[^/][^/]*/\.\./']
74
# Canonicalize the path of ld
75
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
76
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
77
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
79
test -z "$LD" && LD="$ac_prog"
82
# If it fails, then pretend we aren't using GCC.
86
# If it is relative, then search for the first ld in PATH.
90
elif test "$with_gnu_ld" = yes; then
91
AC_MSG_CHECKING([for GNU ld])
93
AC_MSG_CHECKING([for non-GNU ld])
95
AC_CACHE_VAL(acl_cv_path_LD,
96
[if test -z "$LD"; then
97
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
98
for ac_dir in $PATH; do
99
test -z "$ac_dir" && ac_dir=.
100
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
101
acl_cv_path_LD="$ac_dir/$ac_prog"
102
# Check to see if the program is GNU ld. I'd rather use --version,
103
# but apparently some GNU ld's only accept -v.
104
# Break only if it was the GNU/non-GNU ld that we prefer.
105
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
106
*GNU* | *'with BFD'*)
107
test "$with_gnu_ld" != no && break ;;
109
test "$with_gnu_ld" != yes && break ;;
115
acl_cv_path_LD="$LD" # Let the user override the test with a path.
118
if test -n "$LD"; then
1022
121
AC_MSG_RESULT(no)
1027
dnl ------------------------------------------------------------------------
1028
dnl Try to find the Qt headers and libraries.
1029
dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1030
dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1031
dnl ------------------------------------------------------------------------
1033
AC_DEFUN(QT_PATH_1_3,
1035
AC_REQUIRE([QT_PATH_X])
1036
AC_REQUIRE([QT_CHECK_VERSION])
1038
dnl ------------------------------------------------------------------------
1039
dnl Add configure flag to enable linking to MT version of Qt library.
1040
dnl ------------------------------------------------------------------------
1044
[ --disable-mt link to non-threaded Qt (deprecated)],
1045
qt_use_mt=$enableval,
1047
if test $qt_ver = 3; then
1057
dnl ------------------------------------------------------------------------
1058
dnl If we not get --disable-qt-mt then adjust some vars for the host.
1059
dnl ------------------------------------------------------------------------
1063
if test "x$qt_use_mt" = "xyes"; then
1065
if test "x$qt_use_threading" = "xyes"; then
1066
QT_CXXFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $QT_CXXFLAGS"
1067
QT_MT_LDFLAGS="$USE_THREADS"
1068
QT_MT_LIBS="$LIBPTHREAD"
1073
AC_SUBST(QT_MT_LDFLAGS)
1074
AC_SUBST(QT_MT_LIBS)
1076
dnl ------------------------------------------------------------------------
1077
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1078
dnl ------------------------------------------------------------------------
1079
if test -z "$LIBQT_GLOB"; then
1080
if test "x$qt_use_emb" = "xyes"; then
1081
LIBQT_GLOB="libqte.*"
1083
LIBQT_GLOB="libqt.*"
1087
if test -z "$LIBQT"; then
1088
dnl ------------------------------------------------------------
1089
dnl If we got --enable-embedded then adjust the Qt library name.
1090
dnl ------------------------------------------------------------
1091
if test "x$qt_use_emb" = "xyes"; then
1098
if test -z "$LIBQPE"; then
1099
dnl ------------------------------------------------------------
1100
dnl If we got --enable-palmtop then add -lqpe to the link line
1101
dnl ------------------------------------------------------------
1102
if test "x$qt_use_emb" = "xyes"; then
1103
if test "x$qt_use_emb_palm" = "xyes"; then
1113
dnl ------------------------------------------------------------------------
1114
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1115
dnl ------------------------------------------------------------------------
1117
if test "x$qt_use_mt" = "xyes"; then
1118
if test -z "$LIBQT"; then
1123
LIBQT_GLOB="lib$qtlib-mt.*"
1124
USING_QT_MT="using -mt"
1129
AC_MSG_CHECKING([for Qt])
1131
QT_LIBS="$LIBQT $QT_LIBS"
1132
test -z "$QT_MT_LIBS" || QT_LIBS="$QT_LIBS $QT_MT_LIBS"
1134
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1138
[ --with-qt-dir=DIR where the root of Qt is installed ],
1139
[ ac_qt_includes="$withval"/include
1140
ac_qt_libraries="$withval"/lib
1141
ac_qt_bindir="$withval"/bin
1144
AC_ARG_WITH(qt-includes,
1145
[ --with-qt-includes=DIR where the Qt includes are. ],
1147
ac_qt_includes="$withval"
1150
kde_qt_libs_given=no
1152
AC_ARG_WITH(qt-libraries,
1153
[ --with-qt-libraries=DIR where the Qt library is installed.],
1154
[ ac_qt_libraries="$withval"
1155
kde_qt_libs_given=yes
1158
AC_CACHE_VAL(ac_cv_have_qt,
1159
[#try to guess Qt locations
1162
for dir in $qt_dirs; do
1163
qt_incdirs="$qt_incdirs $dir/include $dir"
1165
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
1166
if test ! "$ac_qt_includes" = "NO"; then
1167
qt_incdirs="$ac_qt_includes $qt_incdirs"
1170
if test "$qt_ver" != "1"; then
1171
kde_qt_header=qstyle.h
1173
kde_qt_header=qglobal.h
1176
QT_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1177
ac_qt_includes="$qt_incdir"
1180
for dir in $qt_dirs; do
1181
qt_libdirs="$qt_libdirs $dir/lib $dir"
1183
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1184
if test ! "$ac_qt_libraries" = "NO"; then
1185
qt_libdir=$ac_qt_libraries
1187
qt_libdirs="$ac_qt_libraries $qt_libdirs"
1188
# if the Qt was given, the chance is too big that libqt.* doesn't exist
1190
for dir in $qt_libdirs; do
1191
try="ls -1 $dir/${LIBQT_GLOB}"
1192
if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AS_MESSAGE_LOG_FD; fi
1196
ac_qt_libraries="$qt_libdir"
1200
ac_cxxflags_safe="$CXXFLAGS"
1201
ac_ldflags_safe="$LDFLAGS"
1202
ac_libs_safe="$LIBS"
1204
CXXFLAGS="$CXXFLAGS -I$qt_incdir $QT_CXXFLAGS"
1205
LDFLAGS="$LDFLAGS -L$qt_libdir $QT_LDFLAGS"
1206
LIBS="$LIBS $QT_LIBS"
1210
if AC_TRY_EVAL(ac_link) && test -s conftest; then
1213
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
1214
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
1215
ac_qt_libraries="NO"
1218
CXXFLAGS="$ac_cxxflags_safe"
1219
LDFLAGS="$ac_ldflags_safe"
1220
LIBS="$ac_libs_safe"
1223
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1224
ac_cv_have_qt="have_qt=no"
1227
if test "$ac_qt_includes" = NO; then
1228
if test "$ac_qt_libraries" = NO; then
1229
ac_qt_notfound="(headers and libraries)";
1231
ac_qt_notfound="(headers)";
1234
if test "x$qt_use_mt" = "xyes"; then
1236
Make sure that you have compiled Qt with thread support!"
1237
ac_qt_notfound="(library $qtlib-mt)";
1239
ac_qt_notfound="(library $qtlib)";
1243
#AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation!
1244
#For more details about this problem, look at the end of config.log.$missing_qt_mt])
1251
eval "$ac_cv_have_qt"
1253
if test "$have_qt" != yes; then
1254
AC_MSG_RESULT([$have_qt]);
1256
ac_cv_have_qt="have_qt=yes \
1257
ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1258
AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1260
qt_libraries="$ac_qt_libraries"
1261
qt_includes="$ac_qt_includes"
1264
if test ! "$kde_qt_libs_given" = "yes"; then
1265
QT_CHECK_DIRECT(qt_libraries= ,[])
1268
AC_SUBST(qt_libraries)
1269
AC_SUBST(qt_includes)
1271
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1274
QT_INCLUDES="-I$qt_includes"
1277
if test "$qt_libraries" != "$x_libraries" && test -n "$qt_libraries"; then
1278
QT_LDFLAGS="$QT_LDFLAGS -L$qt_libraries"
1280
test -z "$QT_MT_LDFLAGS" || QT_LDFLAGS="$QT_LDFLAGS $QT_MT_LDFLAGS"
1282
AC_SUBST(QT_INCLUDES)
1296
AC_DEFUN(QT_CHECK_COMPILER_FLAG,
1298
AC_MSG_CHECKING(whether $CXX supports -$1)
1299
kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
1300
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
1303
save_CXXFLAGS="$CXXFLAGS"
1304
CXXFLAGS="$CXXFLAGS -$1"
1305
AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
1306
CXXFLAGS="$save_CXXFLAGS"
1309
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
1320
dnl QT_REMOVE_FORBIDDEN removes forbidden arguments from variables
1321
dnl use: QT_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
1322
dnl it's all white-space separated
1323
AC_DEFUN(QT_REMOVE_FORBIDDEN,
1326
if test -n "$__val"; then
1332
*" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
1333
*) # Careful to not add spaces, where there were none, because otherwise
1334
# libtool gets confused, if we change e.g. CXX
1335
if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
1343
dnl QT_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
1344
AC_DEFUN(QT_VALIDIFY_CXXFLAGS,
1346
if test "x$qt_use_emb" != "xyes"; then
1347
QT_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
1348
QT_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
1350
QT_REMOVE_FORBIDDEN(CXX, [-rpath])
1351
QT_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
1355
AC_DEFUN(QT_CHECK_COMPILERS,
1359
QT_CHECK_COMPILER_FLAG(fexceptions,[QT_CXXFLAGS="$QT_CXXFLAGS -fexceptions"])
1362
*-*-irix*) test "$GXX" = yes && QT_CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $QT_CXXFLAGS" ;;
1363
*-*-sysv4.2uw*) QT_CXXFLAGS="-D_UNIXWARE $QT_CXXFLAGS";;
1364
*-*-sysv5uw7*) QT_CXXFLAGS="-D_UNIXWARE7 $QT_CXXFLAGS";;
1366
if test "$GXX" = yes; then
1367
libstdcpp=`$CXX -print-file-name=libstdc++.so`
1368
if test ! -f $libstdcpp; then
1369
AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with the Qt pinentry. Please recompile gcc with --enable-shared to receive a libstdc++.so])
123
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
127
# lib-link.m4 serial 4 (gettext-0.12)
128
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
129
dnl This file is free software, distributed under the terms of the GNU
130
dnl General Public License. As a special exception to the GNU General
131
dnl Public License, this file may be distributed as part of a program
132
dnl that contains a configuration script generated by Autoconf, under
133
dnl the same distribution terms as the rest of that program.
135
dnl From Bruno Haible.
137
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
138
dnl the libraries corresponding to explicit and implicit dependencies.
139
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
140
dnl augments the CPPFLAGS variable.
141
AC_DEFUN([AC_LIB_LINKFLAGS],
143
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
144
AC_REQUIRE([AC_LIB_RPATH])
145
define([Name],[translit([$1],[./-], [___])])
146
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
147
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
148
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
149
AC_LIB_LINKFLAGS_BODY([$1], [$2])
150
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
151
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
152
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
154
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
155
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
156
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
157
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
159
AC_SUBST([LTLIB]NAME)
160
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
161
dnl results of this search when this library appears as a dependency.
167
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
168
dnl searches for libname and the libraries corresponding to explicit and
169
dnl implicit dependencies, together with the specified include files and
170
dnl the ability to compile and link the specified testcode. If found, it
171
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
172
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
173
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
174
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
175
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
177
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
178
AC_REQUIRE([AC_LIB_RPATH])
179
define([Name],[translit([$1],[./-], [___])])
180
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
181
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
183
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
185
AC_LIB_LINKFLAGS_BODY([$1], [$2])
187
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
188
dnl because if the user has installed lib[]Name and not disabled its use
189
dnl via --without-lib[]Name-prefix, he wants to use it.
190
ac_save_CPPFLAGS="$CPPFLAGS"
191
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
193
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
195
LIBS="$LIBS $LIB[]NAME"
196
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
199
if test "$ac_cv_lib[]Name" = yes; then
201
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
202
AC_MSG_CHECKING([how to link with lib[]$1])
203
AC_MSG_RESULT([$LIB[]NAME])
206
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
207
dnl $INC[]NAME either.
208
CPPFLAGS="$ac_save_CPPFLAGS"
212
AC_SUBST([HAVE_LIB]NAME)
214
AC_SUBST([LTLIB]NAME)
219
dnl Determine the platform dependent parameters needed to use rpath:
220
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
221
dnl hardcode_direct, hardcode_minus_L.
222
AC_DEFUN([AC_LIB_RPATH],
224
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
225
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
226
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
227
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
228
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
229
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
230
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
236
libext="$acl_cv_libext"
237
shlibext="$acl_cv_shlibext"
238
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
239
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
240
hardcode_direct="$acl_cv_hardcode_direct"
241
hardcode_minus_L="$acl_cv_hardcode_minus_L"
242
dnl Determine whether the user wants rpath handling at all.
244
[ --disable-rpath do not hardcode runtime library paths],
248
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
249
dnl the libraries corresponding to explicit and implicit dependencies.
250
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
251
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
253
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
254
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
255
dnl By default, look in $includedir and $libdir.
257
AC_LIB_WITH_FINAL_PREFIX([
258
eval additional_includedir=\"$includedir\"
259
eval additional_libdir=\"$libdir\"
261
AC_LIB_ARG_WITH([lib$1-prefix],
262
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
263
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
265
if test "X$withval" = "Xno"; then
268
if test "X$withval" = "X"; then
269
AC_LIB_WITH_FINAL_PREFIX([
270
eval additional_includedir=\"$includedir\"
271
eval additional_libdir=\"$libdir\"
274
additional_includedir="$withval/include"
275
additional_libdir="$withval/lib"
279
dnl Search the library and its dependencies in $additional_libdir and
280
dnl $LDFLAGS. Using breadth-first-seach.
286
names_already_handled=
287
names_next_round='$1 $2'
288
while test -n "$names_next_round"; do
289
names_this_round="$names_next_round"
291
for name in $names_this_round; do
293
for n in $names_already_handled; do
294
if test "$n" = "$name"; then
299
if test -z "$already_handled"; then
300
names_already_handled="$names_already_handled $name"
301
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
302
dnl or AC_LIB_HAVE_LINKFLAGS call.
303
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
304
eval value=\"\$HAVE_LIB$uppername\"
305
if test -n "$value"; then
306
if test "$value" = yes; then
307
eval value=\"\$LIB$uppername\"
308
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
309
eval value=\"\$LTLIB$uppername\"
310
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
312
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
313
dnl that this library doesn't exist. So just drop it.
1375
QT_VALIDIFY_CXXFLAGS
1380
AC_DEFUN(QT_CHECK_RPATH,
1382
AC_MSG_CHECKING(for rpath)
1383
AC_ARG_ENABLE(rpath,
1384
[ --disable-rpath do not use the rpath feature of ld],
1385
USE_RPATH=$enableval, USE_RPATH=yes)
1387
if test -z "$QT_RPATH" && test "$USE_RPATH" = "yes"; then
1390
if test -n "$qt_libraries"; then
1391
QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(qt_libraries)"
1393
dnl $x_libraries is set to /usr/lib in case
1394
if test -n "$X_LIBS"; then
1395
QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(x_libraries)"
1398
AC_SUBST(x_libraries)
1400
AC_MSG_RESULT($USE_RPATH)
1404
AC_DEFUN(QT_CHECK_LIBPTHREAD,
1406
AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
1407
AC_SUBST(LIBPTHREAD)
1410
AC_DEFUN(QT_CHECK_PTHREAD_OPTION,
1412
AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
1413
kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
1415
if test "$kde_use_kernthreads" = "yes"; then
1416
ac_save_CXXFLAGS="$CXXFLAGS"
1417
ac_save_CFLAGS="$CXXFLAGS"
1418
CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
1419
CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
1420
AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
1421
CXXFLAGS="$ac_save_CXXFLAGS"
1422
CFLAGS="$ac_save_CFLAGS"
1423
if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
1424
kde_use_kernthreads=no
1426
dnl Add proper -I and -l statements
1427
AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
1428
if test "x$LIBPTHREAD" = "x"; then
1429
kde_use_kernthreads=no
1431
USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
1436
if test -z "$LIBPTHREAD"; then
1437
QT_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
1443
QT_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
1444
QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
1447
QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE"
1450
QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE"
1451
LIBPTHREAD="$LIBPTHREAD -lc_r"
1453
linux*) QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT"
1454
if test "$CXX" = "KCC"; then
1455
QT_CXXFLAGS="$QT_CXXFLAGS --thread_safe"
1461
AC_SUBST(USE_THREADS)
1462
AC_SUBST(LIBPTHREAD)
1465
AC_DEFUN(QT_CHECK_THREADING,
1467
AC_REQUIRE([QT_CHECK_LIBPTHREAD])
1468
AC_REQUIRE([QT_CHECK_PTHREAD_OPTION])
1469
dnl default is yes if libpthread is found and no if no libpthread is available
1470
if test -z "$LIBPTHREAD"; then
1471
if test -z "$USE_THREADS"; then
1472
kde_check_threading_default=no
1474
kde_check_threading_default=yes
1477
kde_check_threading_default=yes
1479
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
1480
qt_use_threading=$enableval, qt_use_threading=$kde_check_threading_default)
1481
if test "x$qt_use_threading" = "xyes"; then
1482
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
1486
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
1488
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
1490
# This program is free software; you can redistribute it and/or modify
1491
# it under the terms of the GNU General Public License as published by
1492
# the Free Software Foundation; either version 2, or (at your option)
1493
# any later version.
1495
# This program is distributed in the hope that it will be useful,
1496
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1497
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1498
# GNU General Public License for more details.
1500
# You should have received a copy of the GNU General Public License
1501
# along with this program; if not, write to the Free Software
1502
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1509
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
1510
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1512
# Do all the work for Automake. -*- Autoconf -*-
1514
# This macro actually does too much some checks are only needed if
1515
# your package does certain things. But this isn't really a big deal.
1517
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
1518
# Free Software Foundation, Inc.
1520
# This program is free software; you can redistribute it and/or modify
1521
# it under the terms of the GNU General Public License as published by
1522
# the Free Software Foundation; either version 2, or (at your option)
1523
# any later version.
1525
# This program is distributed in the hope that it will be useful,
1526
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1527
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1528
# GNU General Public License for more details.
1530
# You should have received a copy of the GNU General Public License
1531
# along with this program; if not, write to the Free Software
1532
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1539
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
1540
# the ones we care about.
1541
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1543
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1544
# AM_INIT_AUTOMAKE([OPTIONS])
1545
# -----------------------------------------------
1546
# The call with PACKAGE and VERSION arguments is the old style
1547
# call (pre autoconf-2.50), which is being phased out. PACKAGE
1548
# and VERSION should now be passed to AC_INIT and removed from
1549
# the call to AM_INIT_AUTOMAKE.
1550
# We support both call styles for the transition. After
1551
# the next Automake release, Autoconf can make the AC_INIT
1552
# arguments mandatory, and then we can depend on a new Autoconf
1553
# release and drop the old call support.
1554
AC_DEFUN([AM_INIT_AUTOMAKE],
1555
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1556
AC_REQUIRE([AC_PROG_INSTALL])dnl
1557
# test to see if srcdir already configured
1558
if test "`cd $srcdir && pwd`" != "`pwd`" &&
1559
test -f $srcdir/config.status; then
1560
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1563
# test whether we have cygpath
1564
if test -z "$CYGPATH_W"; then
1565
if (cygpath --version) >/dev/null 2>/dev/null; then
1566
CYGPATH_W='cygpath -w'
1571
AC_SUBST([CYGPATH_W])
1573
# Define the identity of the package.
1574
dnl Distinguish between old-style and new-style calls.
1576
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1577
AC_SUBST([PACKAGE], [$1])dnl
1578
AC_SUBST([VERSION], [$2])],
1579
[_AM_SET_OPTIONS([$1])dnl
1580
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1581
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1583
_AM_IF_OPTION([no-define],,
1584
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1585
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1587
# Some tools Automake needs.
1588
AC_REQUIRE([AM_SANITY_CHECK])dnl
1589
AC_REQUIRE([AC_ARG_PROGRAM])dnl
1590
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1591
AM_MISSING_PROG(AUTOCONF, autoconf)
1592
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1593
AM_MISSING_PROG(AUTOHEADER, autoheader)
1594
AM_MISSING_PROG(MAKEINFO, makeinfo)
1595
AM_MISSING_PROG(AMTAR, tar)
1597
AM_PROG_INSTALL_STRIP
1598
# We need awk for the "check" target. The system "awk" is bad on
1600
AC_REQUIRE([AC_PROG_AWK])dnl
1601
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1602
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1604
_AM_IF_OPTION([no-dependencies],,
1605
[AC_PROVIDE_IFELSE([AC_PROG_CC],
1606
[_AM_DEPENDENCIES(CC)],
1607
[define([AC_PROG_CC],
1608
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1609
AC_PROVIDE_IFELSE([AC_PROG_CXX],
1610
[_AM_DEPENDENCIES(CXX)],
1611
[define([AC_PROG_CXX],
1612
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1617
# When config.status generates a header, we must update the stamp-h file.
1618
# This file resides in the same directory as the config header
1619
# that is generated. The stamp files are numbered to have different names.
1621
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1622
# loop where config.status creates the headers, so we can generate
1623
# our stamp files there.
1624
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1625
[# Compute $1's index in $config_headers.
1627
for _am_header in $config_headers :; do
1632
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
1635
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
1637
# Copyright 2002 Free Software Foundation, Inc.
317
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
318
dnl and the already constructed $LIBNAME/$LTLIBNAME.
323
if test $use_additional = yes; then
324
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
325
found_dir="$additional_libdir"
326
found_so="$additional_libdir/lib$name.$shlibext"
327
if test -f "$additional_libdir/lib$name.la"; then
328
found_la="$additional_libdir/lib$name.la"
331
if test -f "$additional_libdir/lib$name.$libext"; then
332
found_dir="$additional_libdir"
333
found_a="$additional_libdir/lib$name.$libext"
334
if test -f "$additional_libdir/lib$name.la"; then
335
found_la="$additional_libdir/lib$name.la"
340
if test "X$found_dir" = "X"; then
341
for x in $LDFLAGS $LTLIB[]NAME; do
342
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
345
dir=`echo "X$x" | sed -e 's/^X-L//'`
346
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
348
found_so="$dir/lib$name.$shlibext"
349
if test -f "$dir/lib$name.la"; then
350
found_la="$dir/lib$name.la"
353
if test -f "$dir/lib$name.$libext"; then
355
found_a="$dir/lib$name.$libext"
356
if test -f "$dir/lib$name.la"; then
357
found_la="$dir/lib$name.la"
363
if test "X$found_dir" != "X"; then
368
if test "X$found_dir" != "X"; then
369
dnl Found the library.
370
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
371
if test "X$found_so" != "X"; then
372
dnl Linking with a shared library. We attempt to hardcode its
373
dnl directory into the executable's runpath, unless it's the
374
dnl standard /usr/lib.
375
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
376
dnl No hardcoding is needed.
377
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
379
dnl Use an explicit option to hardcode DIR into the resulting
381
dnl Potentially add DIR to ltrpathdirs.
382
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
384
for x in $ltrpathdirs; do
385
if test "X$x" = "X$found_dir"; then
390
if test -z "$haveit"; then
391
ltrpathdirs="$ltrpathdirs $found_dir"
393
dnl The hardcoding into $LIBNAME is system dependent.
394
if test "$hardcode_direct" = yes; then
395
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
396
dnl resulting binary.
397
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
399
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
400
dnl Use an explicit option to hardcode DIR into the resulting
402
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
403
dnl Potentially add DIR to rpathdirs.
404
dnl The rpathdirs will be appended to $LIBNAME at the end.
406
for x in $rpathdirs; do
407
if test "X$x" = "X$found_dir"; then
412
if test -z "$haveit"; then
413
rpathdirs="$rpathdirs $found_dir"
416
dnl Rely on "-L$found_dir".
417
dnl But don't add it if it's already contained in the LDFLAGS
418
dnl or the already constructed $LIBNAME
420
for x in $LDFLAGS $LIB[]NAME; do
421
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
422
if test "X$x" = "X-L$found_dir"; then
427
if test -z "$haveit"; then
428
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
430
if test "$hardcode_minus_L" != no; then
431
dnl FIXME: Not sure whether we should use
432
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
434
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
436
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
437
dnl here, because this doesn't fit in flags passed to the
438
dnl compiler. So give up. No hardcoding. This affects only
439
dnl very old systems.
440
dnl FIXME: Not sure whether we should use
441
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
443
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
449
if test "X$found_a" != "X"; then
450
dnl Linking with a static library.
451
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
453
dnl We shouldn't come here, but anyway it's good to have a
455
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
458
dnl Assume the include files are nearby.
459
additional_includedir=
462
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
463
additional_includedir="$basedir/include"
466
if test "X$additional_includedir" != "X"; then
467
dnl Potentially add $additional_includedir to $INCNAME.
469
dnl 1. if it's the standard /usr/include,
470
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
471
dnl 3. if it's already present in $CPPFLAGS or the already
472
dnl constructed $INCNAME,
473
dnl 4. if it doesn't exist as a directory.
474
if test "X$additional_includedir" != "X/usr/include"; then
476
if test "X$additional_includedir" = "X/usr/local/include"; then
477
if test -n "$GCC"; then
483
if test -z "$haveit"; then
484
for x in $CPPFLAGS $INC[]NAME; do
485
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
486
if test "X$x" = "X-I$additional_includedir"; then
491
if test -z "$haveit"; then
492
if test -d "$additional_includedir"; then
493
dnl Really add $additional_includedir to $INCNAME.
494
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
500
dnl Look for dependencies.
501
if test -n "$found_la"; then
502
dnl Read the .la file. It defines the variables
503
dnl dlname, library_names, old_library, dependency_libs, current,
504
dnl age, revision, installed, dlopen, dlpreopen, libdir.
505
save_libdir="$libdir"
507
*/* | *\\*) . "$found_la" ;;
508
*) . "./$found_la" ;;
510
libdir="$save_libdir"
511
dnl We use only dependency_libs.
512
for dep in $dependency_libs; do
515
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
516
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
518
dnl 1. if it's the standard /usr/lib,
519
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
520
dnl 3. if it's already present in $LDFLAGS or the already
521
dnl constructed $LIBNAME,
522
dnl 4. if it doesn't exist as a directory.
523
if test "X$additional_libdir" != "X/usr/lib"; then
525
if test "X$additional_libdir" = "X/usr/local/lib"; then
526
if test -n "$GCC"; then
532
if test -z "$haveit"; then
534
for x in $LDFLAGS $LIB[]NAME; do
535
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
536
if test "X$x" = "X-L$additional_libdir"; then
541
if test -z "$haveit"; then
542
if test -d "$additional_libdir"; then
543
dnl Really add $additional_libdir to $LIBNAME.
544
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
548
for x in $LDFLAGS $LTLIB[]NAME; do
549
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
550
if test "X$x" = "X-L$additional_libdir"; then
555
if test -z "$haveit"; then
556
if test -d "$additional_libdir"; then
557
dnl Really add $additional_libdir to $LTLIBNAME.
558
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
565
dir=`echo "X$dep" | sed -e 's/^X-R//'`
566
if test "$enable_rpath" != no; then
567
dnl Potentially add DIR to rpathdirs.
568
dnl The rpathdirs will be appended to $LIBNAME at the end.
570
for x in $rpathdirs; do
571
if test "X$x" = "X$dir"; then
576
if test -z "$haveit"; then
577
rpathdirs="$rpathdirs $dir"
579
dnl Potentially add DIR to ltrpathdirs.
580
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
582
for x in $ltrpathdirs; do
583
if test "X$x" = "X$dir"; then
588
if test -z "$haveit"; then
589
ltrpathdirs="$ltrpathdirs $dir"
594
dnl Handle this in the next round.
595
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
598
dnl Handle this in the next round. Throw away the .la's
599
dnl directory; it is already contained in a preceding -L
601
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
604
dnl Most likely an immediate library name.
605
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
606
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
612
dnl Didn't find the library; assume it is in the system directories
613
dnl known to the linker and runtime loader. (All the system
614
dnl directories known to the linker should also be known to the
615
dnl runtime loader, otherwise the system is severely misconfigured.)
616
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
617
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
623
if test "X$rpathdirs" != "X"; then
624
if test -n "$hardcode_libdir_separator"; then
625
dnl Weird platform: only the last -rpath option counts, the user must
626
dnl pass all path elements in one option. We can arrange that for a
627
dnl single library, but not when more than one $LIBNAMEs are used.
629
for found_dir in $rpathdirs; do
630
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
632
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
633
acl_save_libdir="$libdir"
635
eval flag=\"$hardcode_libdir_flag_spec\"
636
libdir="$acl_save_libdir"
637
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
639
dnl The -rpath options are cumulative.
640
for found_dir in $rpathdirs; do
641
acl_save_libdir="$libdir"
643
eval flag=\"$hardcode_libdir_flag_spec\"
644
libdir="$acl_save_libdir"
645
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
649
if test "X$ltrpathdirs" != "X"; then
650
dnl When using libtool, the option that works for both libraries and
651
dnl executables is -R. The -R options are cumulative.
652
for found_dir in $ltrpathdirs; do
653
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
658
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
659
dnl unless already present in VAR.
660
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
661
dnl contains two or three consecutive elements that belong together.
662
AC_DEFUN([AC_LIB_APPENDTOVAR],
664
for element in [$2]; do
667
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
668
if test "X$x" = "X$element"; then
673
if test -z "$haveit"; then
674
[$1]="${[$1]}${[$1]:+ }$element"
679
# lib-prefix.m4 serial 3 (gettext-0.13)
680
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
681
dnl This file is free software, distributed under the terms of the GNU
682
dnl General Public License. As a special exception to the GNU General
683
dnl Public License, this file may be distributed as part of a program
684
dnl that contains a configuration script generated by Autoconf, under
685
dnl the same distribution terms as the rest of that program.
687
dnl From Bruno Haible.
689
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
690
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
691
dnl require excessive bracketing.
692
ifdef([AC_HELP_STRING],
693
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
694
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
696
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
697
dnl to access previously installed libraries. The basic assumption is that
698
dnl a user will want packages to use other packages he previously installed
699
dnl with the same --prefix option.
700
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
701
dnl libraries, but is otherwise very convenient.
702
AC_DEFUN([AC_LIB_PREFIX],
704
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
705
AC_REQUIRE([AC_PROG_CC])
706
AC_REQUIRE([AC_CANONICAL_HOST])
707
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
708
dnl By default, look in $includedir and $libdir.
710
AC_LIB_WITH_FINAL_PREFIX([
711
eval additional_includedir=\"$includedir\"
712
eval additional_libdir=\"$libdir\"
714
AC_LIB_ARG_WITH([lib-prefix],
715
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
716
--without-lib-prefix don't search for libraries in includedir and libdir],
718
if test "X$withval" = "Xno"; then
721
if test "X$withval" = "X"; then
722
AC_LIB_WITH_FINAL_PREFIX([
723
eval additional_includedir=\"$includedir\"
724
eval additional_libdir=\"$libdir\"
727
additional_includedir="$withval/include"
728
additional_libdir="$withval/lib"
732
if test $use_additional = yes; then
733
dnl Potentially add $additional_includedir to $CPPFLAGS.
735
dnl 1. if it's the standard /usr/include,
736
dnl 2. if it's already present in $CPPFLAGS,
737
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
738
dnl 4. if it doesn't exist as a directory.
739
if test "X$additional_includedir" != "X/usr/include"; then
741
for x in $CPPFLAGS; do
742
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
743
if test "X$x" = "X-I$additional_includedir"; then
748
if test -z "$haveit"; then
749
if test "X$additional_includedir" = "X/usr/local/include"; then
750
if test -n "$GCC"; then
756
if test -z "$haveit"; then
757
if test -d "$additional_includedir"; then
758
dnl Really add $additional_includedir to $CPPFLAGS.
759
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
764
dnl Potentially add $additional_libdir to $LDFLAGS.
766
dnl 1. if it's the standard /usr/lib,
767
dnl 2. if it's already present in $LDFLAGS,
768
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
769
dnl 4. if it doesn't exist as a directory.
770
if test "X$additional_libdir" != "X/usr/lib"; then
772
for x in $LDFLAGS; do
773
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
774
if test "X$x" = "X-L$additional_libdir"; then
779
if test -z "$haveit"; then
780
if test "X$additional_libdir" = "X/usr/local/lib"; then
781
if test -n "$GCC"; then
787
if test -z "$haveit"; then
788
if test -d "$additional_libdir"; then
789
dnl Really add $additional_libdir to $LDFLAGS.
790
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
798
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
799
dnl acl_final_exec_prefix, containing the values to which $prefix and
800
dnl $exec_prefix will expand at the end of the configure script.
801
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
803
dnl Unfortunately, prefix and exec_prefix get only finally determined
804
dnl at the end of configure.
805
if test "X$prefix" = "XNONE"; then
806
acl_final_prefix="$ac_default_prefix"
808
acl_final_prefix="$prefix"
810
if test "X$exec_prefix" = "XNONE"; then
811
acl_final_exec_prefix='${prefix}'
813
acl_final_exec_prefix="$exec_prefix"
815
acl_save_prefix="$prefix"
816
prefix="$acl_final_prefix"
817
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
818
prefix="$acl_save_prefix"
821
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
822
dnl variables prefix and exec_prefix bound to the values they will have
823
dnl at the end of the configure script.
824
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
826
acl_save_prefix="$prefix"
827
prefix="$acl_final_prefix"
828
acl_save_exec_prefix="$exec_prefix"
829
exec_prefix="$acl_final_exec_prefix"
831
exec_prefix="$acl_save_exec_prefix"
832
prefix="$acl_save_prefix"
836
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
837
# Generated from amversion.in; do not edit by hand.
1639
839
# This program is free software; you can redistribute it and/or modify
1640
840
# it under the terms of the GNU General Public License as published by