OSDN Git Service

TiMidity++-1.2.1
[timidity41/timidity41.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.3
2
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl MY_DEFINE(VARIABLE)
14 AC_DEFUN(MY_DEFINE,
15 [cat >> confdefs.h <<EOF
16 [#define] $1 1
17 EOF
18 ])
19
20 dnl CONFIG_INTERFACE(package,macro_name,interface_id,help
21 dnl                  $1      $2         $3           $4
22 dnl                  action-if-yes-or-dynamic,
23 dnl                  $5
24 dnl                  action-if-yes,action-if-dynamic,action-if-no)
25 dnl                  $6            $7                $8
26 AC_DEFUN(CONFIG_INTERFACE,
27 [AC_ARG_ENABLE($1,[$4],
28 [case "x$enable_$1" in xyes|xdynamic) $5 ;; esac])
29 case "x$enable_$1" in
30 xyes)
31   MY_DEFINE(IA_$2)
32   AM_CONDITIONAL(ENABLE_$2, true)
33   $6
34   ;;
35 xdynamic)
36   dynamic_targets="$dynamic_targets interface_$3.\$(so)"
37   $7
38   ;;
39 *)
40   $8
41   ;;
42 esac
43 AC_SUBST($3_so_libs)
44 ])
45
46
47 dnl alsa.m4 starts form here
48 dnl Configure Paths for Alsa
49 dnl Christopher Lansdown (lansdoct@cs.alfred.edu)
50 dnl 29/10/1998
51 dnl modified for TiMidity++ by Isaku Yamahata(yamahata@kusm.kyoto-u.ac.jp)
52 dnl 16/12/1998
53 dnl AM_PATH_ALSA_LOCAL(MINIMUM-VERSION)
54 dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
55 dnl if there exit ALSA, define have_alsa=yes, otherwise no.
56 dnl enables arguments --with-alsa-prefix= --with-alsa-enc-prefix= --disable-alsatest
57 dnl
58 AC_DEFUN(AM_PATH_ALSA_LOCAL,
59 [dnl
60 dnl Get the clfags and libraries for alsa
61 dnl
62 have_alsa=no
63 AC_ARG_WITH(alsa-prefix,[  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)],
64         [alsa_prefix="$withval"], [alsa_prefix=""])
65 AC_ARG_WITH(alsa-inc-prefix, [  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)],
66         [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
67 AC_ARG_ENABLE(alsatest, [  --disable-alsatest      Do not try to compile and run a test Alsa program], [enable_alsatest=no], [enable_alsatest=yes])
68
69 dnl Add any special include directories
70 AC_MSG_CHECKING(for ALSA CFLAGS)
71 if test "$alsa_inc_prefix" != "" ; then
72         ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
73         CFLAGS="$CFLAGS -I$alsa_inc_prefix"
74 fi
75 AC_MSG_RESULT($ALSA_CFLAGS)
76
77 dnl add any special lib dirs
78 AC_MSG_CHECKING(for ALSA LDFLAGS)
79 if test "$alsa_prefix" != "" ; then
80         ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
81         LIBS="-L$alsa_prefix"
82 fi
83
84 dnl add the alsa library
85 ALSA_LIBS="$ALSA_LIBS -lasound"
86 AC_MSG_RESULT($ALSA_LIBS)
87
88 dnl Check for the presence of the library
89 dnl if test $enable_alsatest = yes; then
90 dnl   AC_MSG_CHECKING(for working libasound)
91 dnl   AC_TRY_RUN([
92 dnl #include <sys/asoundlib.h>
93 dnl void main(void)
94 dnl {
95 dnl   snd_cards();
96 dnl   exit(0);
97 dnl }
98 dnl ],
99 dnl    [AC_MSG_RESULT("present")],
100 dnl    [AC_MSG_RESULT("not found. ")
101 dnl    AC_MSG_ERROR(Fatal error: Install alsa-lib package or use --with-alsa-prefix option...)],
102 dnl    [AC_MSG_RESULT(unsopported)
103 dnl     AC_MSG_ERROR(Cross-compiling isn't supported...)]
104 dnl  )
105 dnl fi
106
107 dnl Check for a working version of libasound that is of the right version.
108 min_alsa_version=ifelse([$1], ,0.1.1,$1)
109 AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
110 no_alsa=""
111     alsa_min_major_version=`echo $min_alsa_version | \
112            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
113     alsa_min_minor_version=`echo $min_alsa_version | \
114            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
115     alsa_min_micro_version=`echo $min_alsa_version | \
116            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
117
118 AC_TRY_COMPILE([
119 #include <sys/asoundlib.h>
120 ], [
121 /* ensure backward compatibility */
122 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
123 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
124 #endif
125 #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
126 #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
127 #endif
128 #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
129 #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
130 #endif
131
132 #  if(SND_LIB_MAJOR > $alsa_min_major_version)
133   exit(0);
134 #  else
135 #    if(SND_LIB_MAJOR < $alsa_min_major_version)
136 #       error not present
137 #    endif
138
139 #   if(SND_LIB_MINOR > $alsa_min_minor_version)
140   exit(0);
141 #   else
142 #     if(SND_LIB_MINOR < $alsa_min_minor_version)
143 #          error not present
144 #      endif
145
146 #      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
147 #        error not present
148 #      endif
149 #    endif
150 #  endif
151 exit(0);
152 ],
153   [AC_MSG_RESULT(found.)
154    have_alsa=yes],
155   [AC_MSG_RESULT(not present.)]
156 )
157
158 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
159 AC_CHECK_LIB([asound], [snd_cards],,
160         [AC_MSG_RESULT(No linkable libasound was found.)]
161 )
162
163 dnl That should be it.  Now just export out symbols:
164 AC_SUBST(ALSA_CFLAGS)
165 AC_SUBST(ALSA_LIBS)
166 ])
167 dnl alsa.m4 ends here
168
169
170 dnl CHECK_DLSYM_UNDERSCORE([ACTION-IF-NEED [, ACTION IF-NOT-NEED]])
171 dnl variable input:
172 dnl   CC CFLAGS CPPFLAGS LDFLAGS LIBS SHCFLAGS SHLD SHLDFLAGS
173 dnl   ac_cv_header_dlfcn_h lib_dl_opt so
174 AC_DEFUN(CHECK_DLSYM_UNDERSCORE,
175 [dnl Check if dlsym need a leading underscore
176 AC_MSG_CHECKING(whether your dlsym() needs a leading underscore)
177 AC_CACHE_VAL(timidity_cv_func_dlsym_underscore,
178 [case "$ac_cv_header_dlfcn_h" in
179 yes) i_dlfcn=define;;
180 *)   i_dlfcn=undef;;
181 esac
182 cat > dyna.c <<EOM
183 fred () { }
184 EOM
185
186 cat > fred.c <<EOM
187 #include <stdio.h>
188 #$i_dlfcn I_DLFCN
189 #ifdef I_DLFCN
190 #include <dlfcn.h>      /* the dynamic linker include file for Sunos/Solaris */
191 #else
192 #include <sys/types.h>
193 #include <nlist.h>
194 #include <link.h>
195 #endif
196
197 extern int fred() ;
198
199 main()
200 {
201     void * handle ;
202     void * symbol ;
203 #ifndef RTLD_LAZY
204     int mode = 1 ;
205 #else
206     int mode = RTLD_LAZY ;
207 #endif
208     handle = dlopen("./dyna.$so", mode) ;
209     if (handle == NULL) {
210         printf ("1\n") ;
211         fflush (stdout) ;
212         exit(0);
213     }
214     symbol = dlsym(handle, "fred") ;
215     if (symbol == NULL) {
216         /* try putting a leading underscore */
217         symbol = dlsym(handle, "_fred") ;
218         if (symbol == NULL) {
219             printf ("2\n") ;
220             fflush (stdout) ;
221             exit(0);
222         }
223         printf ("3\n") ;
224     }
225     else
226         printf ("4\n") ;
227     fflush (stdout) ;
228     exit(0);
229 }
230 EOM
231 : Call the object file tmp-dyna.o in case dlext=o.
232 if ${CC-cc} $CFLAGS $SHCFLAGS $CPPFLAGS -c dyna.c > /dev/null 2>&1 &&
233         mv dyna.o tmp-dyna.o > /dev/null 2>&1 && 
234         $SHLD $SHLDFLAGS -o dyna.$so tmp-dyna.o > /dev/null 2>&1 && 
235         ${CC-cc} -o fred $CFLAGS $CPPFLAGS $LDFLAGS fred.c $LIBS $lib_dl_opt > /dev/null 2>&1; then
236         xxx=`./fred`
237         case $xxx in
238         1)      AC_MSG_WARN(Test program failed using dlopen.  Perhaps you should not use dynamic loading.)
239                 ;;
240         2)      AC_MSG_WARN(Test program failed using dlsym.  Perhaps you should not use dynamic loading.)
241                 ;;
242         3)      timidity_cv_func_dlsym_underscore=yes
243                 ;;
244         4)      timidity_cv_func_dlsym_underscore=no
245                 ;;
246         esac
247 else
248         AC_MSG_WARN(I can't compile and run the test program.)
249 fi
250 rm -f dyna.c dyna.o dyna.$so tmp-dyna.o fred.c fred.o fred
251 ])
252 case "x$timidity_cv_func_dlsym_underscore" in
253 xyes)   [$1]
254         AC_MSG_RESULT(yes)
255         ;;
256 xno)    [$2]
257         AC_MSG_RESULT(no)
258         ;;
259 esac
260 ])
261
262
263 dnl contains program from perl5
264 dnl CONTAINS_INIT()
265 AC_DEFUN(CONTAINS_INIT,
266 [dnl Some greps do not return status, grrr.
267 AC_MSG_CHECKING(whether grep returns status)
268 echo "grimblepritz" >grimble
269 if grep blurfldyick grimble >/dev/null 2>&1 ; then
270         contains="./contains"
271 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
272         contains=grep
273 else
274         contains="./contains"
275 fi
276 rm -f grimble
277 dnl the following should work in any shell
278 case "$contains" in
279 grep)   AC_MSG_RESULT(yes)
280         ;;
281 ./contains)
282         AC_MSG_RESULT(AGH!  Grep doesn't return a status.  Attempting remedial action.)
283         cat >./contains <<'EOSS'
284 grep "[$]1" "[$]2" >.greptmp && cat .greptmp && test -s .greptmp
285 EOSS
286         chmod +x "./contains"
287         ;;
288 esac
289 ])
290
291
292 dnl CONTAINS(word,filename,action-if-found,action-if-not-found)
293 AC_DEFUN(CONTAINS,
294 [if $contains "^[$1]"'[$]' $2 >/dev/null 2>&1; then
295   [$3]
296 else
297   [$4]
298 fi
299 ])
300
301
302 dnl SET_UNIQ_WORDS(shell-variable,words...)
303 AC_DEFUN(SET_UNIQ_WORDS,
304 [rm -f wordtmp >/dev/null 2>&1
305 val=''
306 for f in $2; do
307   CONTAINS([$f],wordtmp,:,[echo $f >>wordtmp; val="$val $f"])
308 done
309 $1="$val"
310 rm -f wordtmp >/dev/null 2>&1
311 ])
312
313 # Define a conditional.
314
315 AC_DEFUN(AM_CONDITIONAL,
316 [AC_SUBST($1_TRUE)
317 AC_SUBST($1_FALSE)
318 if $2; then
319   $1_TRUE=
320   $1_FALSE='#'
321 else
322   $1_TRUE='#'
323   $1_FALSE=
324 fi])
325
326 # Do all the work for Automake.  This macro actually does too much --
327 # some checks are only needed if your package does certain things.
328 # But this isn't really a big deal.
329
330 # serial 1
331
332 dnl Usage:
333 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
334
335 AC_DEFUN(AM_INIT_AUTOMAKE,
336 [AC_REQUIRE([AM_PROG_INSTALL])
337 PACKAGE=[$1]
338 AC_SUBST(PACKAGE)
339 VERSION=[$2]
340 AC_SUBST(VERSION)
341 dnl test to see if srcdir already configured
342 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
343   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
344 fi
345 ifelse([$3],,
346 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
347 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
348 AC_REQUIRE([AM_SANITY_CHECK])
349 AC_REQUIRE([AC_ARG_PROGRAM])
350 dnl FIXME This is truly gross.
351 missing_dir=`cd $ac_aux_dir && pwd`
352 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
353 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
354 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
355 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
356 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
357 AC_REQUIRE([AC_PROG_MAKE_SET])])
358
359
360 # serial 1
361
362 AC_DEFUN(AM_PROG_INSTALL,
363 [AC_REQUIRE([AC_PROG_INSTALL])
364 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
365 AC_SUBST(INSTALL_SCRIPT)dnl
366 ])
367
368 #
369 # Check to make sure that the build environment is sane.
370 #
371
372 AC_DEFUN(AM_SANITY_CHECK,
373 [AC_MSG_CHECKING([whether build environment is sane])
374 # Just in case
375 sleep 1
376 echo timestamp > conftestfile
377 # Do `set' in a subshell so we don't clobber the current shell's
378 # arguments.  Must try -L first in case configure is actually a
379 # symlink; some systems play weird games with the mod time of symlinks
380 # (eg FreeBSD returns the mod time of the symlink's containing
381 # directory).
382 if (
383    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
384    if test "[$]*" = "X"; then
385       # -L didn't work.
386       set X `ls -t $srcdir/configure conftestfile`
387    fi
388    if test "[$]*" != "X $srcdir/configure conftestfile" \
389       && test "[$]*" != "X conftestfile $srcdir/configure"; then
390
391       # If neither matched, then we have a broken ls.  This can happen
392       # if, for instance, CONFIG_SHELL is bash and it inherits a
393       # broken ls alias from the environment.  This has actually
394       # happened.  Such a system could not be considered "sane".
395       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
396 alias in your environment])
397    fi
398
399    test "[$]2" = conftestfile
400    )
401 then
402    # Ok.
403    :
404 else
405    AC_MSG_ERROR([newly created file is older than distributed files!
406 Check your system clock])
407 fi
408 rm -f conftest*
409 AC_MSG_RESULT(yes)])
410
411 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
412 dnl The program must properly implement --version.
413 AC_DEFUN(AM_MISSING_PROG,
414 [AC_MSG_CHECKING(for working $2)
415 # Run test in a subshell; some versions of sh will print an error if
416 # an executable is not found, even if stderr is redirected.
417 # Redirect stdin to placate older versions of autoconf.  Sigh.
418 if ($2 --version) < /dev/null > /dev/null 2>&1; then
419    $1=$2
420    AC_MSG_RESULT(found)
421 else
422    $1="$3/missing $2"
423    AC_MSG_RESULT(missing)
424 fi
425 AC_SUBST($1)])
426
427 # Like AC_CONFIG_HEADER, but automatically create stamp file.
428
429 AC_DEFUN(AM_CONFIG_HEADER,
430 [AC_PREREQ([2.12])
431 AC_CONFIG_HEADER([$1])
432 dnl When config.status generates a header, we must update the stamp-h file.
433 dnl This file resides in the same directory as the config header
434 dnl that is generated.  We must strip everything past the first ":",
435 dnl and everything past the last "/".
436 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
437 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
438 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
439 <<am_indx=1
440 for am_file in <<$1>>; do
441   case " <<$>>CONFIG_HEADERS " in
442   *" <<$>>am_file "*<<)>>
443     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
444     ;;
445   esac
446   am_indx=`expr "<<$>>am_indx" + 1`
447 done<<>>dnl>>)
448 changequote([,]))])
449
450
451 # serial 1
452
453 AC_DEFUN(AM_PATH_LISPDIR,
454  [# If set to t, that means we are running in a shell under Emacs.
455   # If you have an Emacs named "t", then use the full path.
456   test "$EMACS" = t && EMACS=
457   AC_PATH_PROG(EMACS, emacs xemacs, no)
458   if test $EMACS != "no"; then
459     AC_MSG_CHECKING([where .elc files should go])
460     dnl Set default value
461     lispdir="\$(datadir)/emacs/site-lisp"
462     if test "x$prefix" = "xNONE"; then
463       if test -d $ac_default_prefix/share/emacs/site-lisp; then
464         lispdir="\$(prefix)/share/emacs/site-lisp"
465       else
466         if test -d $ac_default_prefix/lib/emacs/site-lisp; then
467           lispdir="\$(prefix)/lib/emacs/site-lisp"
468         fi
469       fi
470     else
471       if test -d $prefix/share/emacs/site-lisp; then
472         lispdir="\$(prefix)/share/emacs/site-lisp"
473       else
474         if test -d $prefix/lib/emacs/site-lisp; then
475           lispdir="\$(prefix)/lib/emacs/site-lisp"
476         fi
477       fi
478     fi
479     AC_MSG_RESULT($lispdir)
480   fi
481   AC_SUBST(lispdir)])
482
483 # Configure paths for GTK+
484 # Owen Taylor     97-11-3
485
486 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
487 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
488 dnl
489 AC_DEFUN(AM_PATH_GTK,
490 [dnl 
491 dnl Get the cflags and libraries from the gtk-config script
492 dnl
493 AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
494             gtk_config_prefix="$withval", gtk_config_prefix="")
495 AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
496             gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
497 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
498                     , enable_gtktest=yes)
499
500   if test x$gtk_config_exec_prefix != x ; then
501      gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
502      if test x${GTK_CONFIG+set} != xset ; then
503         GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
504      fi
505   fi
506   if test x$gtk_config_prefix != x ; then
507      gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
508      if test x${GTK_CONFIG+set} != xset ; then
509         GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
510      fi
511   fi
512
513   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
514   min_gtk_version=ifelse([$1], ,0.99.7,$1)
515   AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
516   no_gtk=""
517   if test "$GTK_CONFIG" = "no" ; then
518     no_gtk=yes
519   else
520     GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
521     GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
522     gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
523            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
524     gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
525            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
526     gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
527            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
528     if test "x$enable_gtktest" = "xyes" ; then
529       ac_save_CFLAGS="$CFLAGS"
530       ac_save_LIBS="$LIBS"
531       CFLAGS="$CFLAGS $GTK_CFLAGS"
532       LIBS="$LIBS $GTK_LIBS"
533 dnl
534 dnl Now check if the installed GTK is sufficiently new. (Also sanity
535 dnl checks the results of gtk-config to some extent
536 dnl
537       rm -f conf.gtktest
538       AC_TRY_RUN([
539 #include <gtk/gtk.h>
540 #include <stdio.h>
541
542 int 
543 main ()
544 {
545   int major, minor, micro;
546   char *tmp_version;
547
548   system ("touch conf.gtktest");
549
550   /* HP/UX 9 (%@#!) writes to sscanf strings */
551   tmp_version = g_strdup("$min_gtk_version");
552   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
553      printf("%s, bad version string\n", "$min_gtk_version");
554      exit(1);
555    }
556
557   if ((gtk_major_version != $gtk_config_major_version) ||
558       (gtk_minor_version != $gtk_config_minor_version) ||
559       (gtk_micro_version != $gtk_config_micro_version))
560     {
561       printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
562              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
563              gtk_major_version, gtk_minor_version, gtk_micro_version);
564       printf ("*** was found! If gtk-config was correct, then it is best\n");
565       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
566       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
567       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
568       printf("*** required on your system.\n");
569       printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
570       printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
571       printf("*** before re-running configure\n");
572     } 
573   else
574     {
575       if ((gtk_major_version > major) ||
576         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
577         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
578       {
579         return 0;
580        }
581      else
582       {
583         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
584                gtk_major_version, gtk_minor_version, gtk_micro_version);
585         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
586                major, minor, micro);
587         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
588         printf("***\n");
589         printf("*** If you have already installed a sufficiently new version, this error\n");
590         printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
591         printf("*** being found. The easiest way to fix this is to remove the old version\n");
592         printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
593         printf("*** correct copy of gtk-config. (In this case, you will have to\n");
594         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
595         printf("*** so that the correct libraries are found at run-time))\n");
596       }
597     }
598   return 1;
599 }
600 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
601        CFLAGS="$ac_save_CFLAGS"
602        LIBS="$ac_save_LIBS"
603      fi
604   fi
605   if test "x$no_gtk" = x ; then
606      AC_MSG_RESULT(yes)
607      ifelse([$2], , :, [$2])     
608   else
609      AC_MSG_RESULT(no)
610      if test "$GTK_CONFIG" = "no" ; then
611        echo "*** The gtk-config script installed by GTK could not be found"
612        echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
613        echo "*** your path, or set the GTK_CONFIG environment variable to the"
614        echo "*** full path to gtk-config."
615      else
616        if test -f conf.gtktest ; then
617         :
618        else
619           echo "*** Could not run GTK test program, checking why..."
620           CFLAGS="$CFLAGS $GTK_CFLAGS"
621           LIBS="$LIBS $GTK_LIBS"
622           AC_TRY_LINK([
623 #include <gtk/gtk.h>
624 #include <stdio.h>
625 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
626         [ echo "*** The test program compiled, but did not run. This usually means"
627           echo "*** that the run-time linker is not finding GTK or finding the wrong"
628           echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
629           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
630           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
631           echo "*** is required on your system"
632           echo "***"
633           echo "*** If you have an old version installed, it is best to remove it, although"
634           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
635           echo "***"
636           echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
637           echo "*** came with the system with the command"
638           echo "***"
639           echo "***    rpm --erase --nodeps gtk gtk-devel" ],
640         [ echo "*** The test program failed to compile or link. See the file config.log for the"
641           echo "*** exact error that occured. This usually means GTK was incorrectly installed"
642           echo "*** or that you have moved GTK since it was installed. In the latter case, you"
643           echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
644           CFLAGS="$ac_save_CFLAGS"
645           LIBS="$ac_save_LIBS"
646        fi
647      fi
648      GTK_CFLAGS=""
649      GTK_LIBS=""
650      ifelse([$3], , :, [$3])
651   fi
652   AC_SUBST(GTK_CFLAGS)
653   AC_SUBST(GTK_LIBS)
654   rm -f conf.gtktest
655 ])
656