~ubuntu-branches/ubuntu/lucid/sawfish/lucid-updates

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2005-02-23 16:16:46 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050223161646-4id6qyw4h9lkvb0v
Tags: 1:1.3+cvs20050222-1
* New cvs release.
* Add an emacs initialisation script to load sawfish.el (Closes: #295290)
* Updated sawfish.el to 1.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
2
 
 
3
 
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4
 
dnl This file 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 Configure paths for librep
14
 
dnl $Id: rep.m4,v 1.6 1999/11/19 14:50:26 john Exp $
15
 
dnl
16
 
dnl AM_PATH_REP([MINIMUM_VERSION])
17
 
dnl Test for librep, define REP_VERSION, REP_CFLAGS, REP_LIBS and REP_EXECDIR
18
 
dnl
19
 
AC_DEFUN(AM_PATH_REP,
20
 
[dnl
21
 
  AC_ARG_WITH(rep_prefix,[  --with-rep-prefix=PFX   Prefix where rep is installed (optional)],
22
 
              [rep_prefix="$withval"], [rep_prefix=""])
23
 
  if test "x$rep_prefix" = "x"; then
24
 
    rep_config="rep-config"
25
 
  else
26
 
    rep_config="${rep_prefix}/bin/rep-config"
27
 
  fi
28
 
  min_rep_version=ifelse([$1], ,0.1,$1)
29
 
  AC_MSG_CHECKING(for rep - version >= $min_rep_version)
30
 
  rep_version=`$rep_config --version`
31
 
  if test $? -eq 0; then
32
 
    rep_major=`echo $rep_version \
33
 
        | sed -e 's/\([[0-9]]*\)\..*/\1/'`
34
 
    rep_minor=`echo $rep_version \
35
 
        | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
36
 
    min_rep_major=`echo $min_rep_version \
37
 
        | sed -e 's/\([[0-9]]*\)\..*/\1/'`
38
 
    min_rep_minor=`echo $min_rep_version \
39
 
        | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
40
 
    if test '(' $rep_major -gt $min_rep_major ')' \
41
 
        -o '(' $rep_major -eq $min_rep_major \
42
 
               -a $rep_minor -ge $min_rep_minor ')';
43
 
    then
44
 
      REP_VERSION="${rep_version}"
45
 
      REP_CFLAGS="`$rep_config --cflags`"
46
 
      REP_LIBS="`$rep_config --libs`"
47
 
      REP_EXECDIR="`$rep_config --execdir`"
48
 
      AC_SUBST(REP_VERSION)
49
 
      AC_SUBST(REP_CFLAGS)
50
 
      AC_SUBST(REP_LIBS)
51
 
      AC_SUBST(REP_EXECDIR)
52
 
      AC_MSG_RESULT([version ${rep_version}])
53
 
    else
54
 
      AC_MSG_ERROR([version ${rep_version}; require $min_rep_version])
55
 
    fi
56
 
  else
57
 
    AC_MSG_ERROR([can't find librep; is it installed?])
58
 
  fi
59
 
 
60
 
  dnl scan for GNU msgfmt
61
 
  AC_MSG_CHECKING(for GNU msgfmt)
62
 
  REP_MSGFMT=
63
 
  for p in `echo "$PATH" | sed -e 's/:/ /g'`; do
64
 
    if test -x $p/msgfmt; then
65
 
      if $p/msgfmt --version 2>&1 | grep GNU >/dev/null; then
66
 
        REP_MSGFMT=$p/msgfmt
67
 
      fi
68
 
    fi
69
 
  done
70
 
  if test x$REP_MSGFMT != x; then
71
 
    AC_MSG_RESULT($REP_MSGFMT)
72
 
  else
73
 
    AC_MSG_RESULT(unavailable, disabling i18n)
74
 
    REP_MSGFMT=true
75
 
  fi
76
 
  AC_SUBST(REP_MSGFMT)
77
 
])
78
 
 
79
 
# Configure paths for IMLIB
80
 
# Frank Belew     98-8-31
81
 
# stolen from Manish Singh
82
 
# Shamelessly stolen from Owen Taylor
83
 
 
84
 
dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
85
 
dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
86
 
dnl
87
 
AC_DEFUN(AM_PATH_IMLIB,
88
 
[dnl 
89
 
dnl Get the cflags and libraries from the imlib-config script
90
 
dnl
91
 
AC_ARG_WITH(imlib-prefix,[  --with-imlib-prefix=PFX   Prefix where IMLIB is installed (optional)],
92
 
            imlib_prefix="$withval", imlib_prefix="")
93
 
AC_ARG_WITH(imlib-exec-prefix,[  --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
94
 
            imlib_exec_prefix="$withval", imlib_exec_prefix="")
95
 
AC_ARG_ENABLE(imlibtest, [  --disable-imlibtest       Do not try to compile and run a test IMLIB program],
96
 
                    , enable_imlibtest=yes)
97
 
 
98
 
  if test x$imlib_exec_prefix != x ; then
99
 
     imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
100
 
     if test x${IMLIB_CONFIG+set} != xset ; then
101
 
        IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
102
 
     fi
103
 
  fi
104
 
  if test x$imlib_prefix != x ; then
105
 
     imlib_args="$imlib_args --prefix=$imlib_prefix"
106
 
     if test x${IMLIB_CONFIG+set} != xset ; then
107
 
        IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
108
 
     fi
109
 
  fi
110
 
 
111
 
  AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
112
 
  min_imlib_version=ifelse([$1], ,1.8.2,$1)
113
 
  AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
114
 
  no_imlib=""
115
 
  if test "$IMLIB_CONFIG" = "no" ; then
116
 
    no_imlib=yes
117
 
  else
118
 
    IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags`
119
 
    IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs`
120
 
 
121
 
    imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
122
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
123
 
    imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
124
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
125
 
    imlib_micro_version=`$IMLIB_CONFIG $imlib_args --version | \
126
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
127
 
    if test "x$enable_imlibtest" = "xyes" ; then
128
 
      ac_save_CFLAGS="$CFLAGS"
129
 
      ac_save_LIBS="$LIBS"
130
 
      CFLAGS="$CFLAGS $IMLIB_CFLAGS"
131
 
      LIBS="$LIBS $IMLIB_LIBS"
132
 
dnl
133
 
dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
134
 
dnl checks the results of imlib-config to some extent
135
 
dnl
136
 
      rm -f conf.imlibtest
137
 
      AC_TRY_RUN([
138
 
#include <stdio.h>
139
 
#include <stdlib.h>
140
 
#include <string.h>
141
 
#include <Imlib.h>
142
 
 
143
 
char*
144
 
my_strdup (char *str)
145
 
{
146
 
  char *new_str;
147
 
  
148
 
  if (str)
149
 
    {
150
 
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
151
 
      strcpy (new_str, str);
152
 
    }
153
 
  else
154
 
    new_str = NULL;
155
 
  
156
 
  return new_str;
157
 
}
158
 
 
159
 
int main ()
160
 
{
161
 
  int major, minor, micro;
162
 
  char *tmp_version;
163
 
 
164
 
  system ("touch conf.imlibtest");
165
 
 
166
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
167
 
  tmp_version = my_strdup("$min_imlib_version");
168
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
169
 
     printf("%s, bad version string\n", "$min_imlib_version");
170
 
     exit(1);
171
 
   }
172
 
 
173
 
    if (($imlib_major_version > major) ||
174
 
        (($imlib_major_version == major) && ($imlib_minor_version > minor)) ||
175
 
        (($imlib_major_version == major) && ($imlib_minor_version == minor) &&
176
 
        ($imlib_micro_version >= micro)))
177
 
    {
178
 
      return 0;
179
 
    }
180
 
  else
181
 
    {
182
 
      printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
183
 
      printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
184
 
      printf("*** best to upgrade to the required version.\n");
185
 
      printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
186
 
      printf("*** to point to the correct copy of imlib-config, and remove the file\n");
187
 
      printf("*** config.cache before re-running configure\n");
188
 
      return 1;
189
 
    }
190
 
}
191
 
 
192
 
],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
193
 
       CFLAGS="$ac_save_CFLAGS"
194
 
       LIBS="$ac_save_LIBS"
195
 
     fi
196
 
  fi
197
 
  if test "x$no_imlib" = x ; then
198
 
     AC_MSG_RESULT(yes)
199
 
     ifelse([$2], , :, [$2])     
200
 
  else
201
 
     AC_MSG_RESULT(no)
202
 
     if test "$IMLIB_CONFIG" = "no" ; then
203
 
       echo "*** The imlib-config script installed by IMLIB could not be found"
204
 
       echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
205
 
       echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
206
 
       echo "*** full path to imlib-config."
207
 
     else
208
 
       if test -f conf.imlibtest ; then
209
 
        :
210
 
       else
211
 
          echo "*** Could not run IMLIB test program, checking why..."
212
 
          CFLAGS="$CFLAGS $IMLIB_CFLAGS"
213
 
          LIBS="$LIBS $IMLIB_LIBS"
214
 
          AC_TRY_LINK([
215
 
#include <stdio.h>
216
 
#include <Imlib.h>
217
 
],      [ return 0; ],
218
 
        [ echo "*** The test program compiled, but did not run. This usually means"
219
 
          echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
220
 
          echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
221
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
222
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
223
 
          echo "*** is required on your system"
224
 
          echo "***"
225
 
          echo "*** If you have an old version installed, it is best to remove it, although"
226
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
227
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
228
 
          echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
229
 
          echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
230
 
          echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
231
 
          CFLAGS="$ac_save_CFLAGS"
232
 
          LIBS="$ac_save_LIBS"
233
 
       fi
234
 
     fi
235
 
     IMLIB_CFLAGS=""
236
 
     IMLIB_LIBS=""
237
 
     ifelse([$3], , :, [$3])
238
 
  fi
239
 
  AC_SUBST(IMLIB_CFLAGS)
240
 
  AC_SUBST(IMLIB_LIBS)
241
 
  rm -f conf.imlibtest
242
 
])
243
 
 
244
 
# Check for gdk-imlib
245
 
AC_DEFUN(AM_PATH_GDK_IMLIB,
246
 
[dnl 
247
 
dnl Get the cflags and libraries from the imlib-config script
248
 
dnl
249
 
AC_ARG_WITH(imlib-prefix,[  --with-imlib-prefix=PFX   Prefix where IMLIB is installed (optional)],
250
 
            imlib_prefix="$withval", imlib_prefix="")
251
 
AC_ARG_WITH(imlib-exec-prefix,[  --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
252
 
            imlib_exec_prefix="$withval", imlib_exec_prefix="")
253
 
AC_ARG_ENABLE(imlibtest, [  --disable-imlibtest       Do not try to compile and run a test IMLIB program],
254
 
                    , enable_imlibtest=yes)
255
 
 
256
 
  if test x$imlib_exec_prefix != x ; then
257
 
     imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
258
 
     if test x${IMLIB_CONFIG+set} != xset ; then
259
 
        IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
260
 
     fi
261
 
  fi
262
 
  if test x$imlib_prefix != x ; then
263
 
     imlib_args="$imlib_args --prefix=$imlib_prefix"
264
 
     if test x${IMLIB_CONFIG+set} != xset ; then
265
 
        IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
266
 
     fi
267
 
  fi
268
 
 
269
 
  AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
270
 
  min_imlib_version=ifelse([$1], ,1.8.2,$1)
271
 
  AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
272
 
  no_imlib=""
273
 
  if test "$IMLIB_CONFIG" = "no" ; then
274
 
    no_imlib=yes
275
 
  else
276
 
    GDK_IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags-gdk`
277
 
    GDK_IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs-gdk`
278
 
 
279
 
    imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
280
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
281
 
    imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
282
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
283
 
    if test "x$enable_imlibtest" = "xyes" ; then
284
 
      ac_save_CFLAGS="$CFLAGS"
285
 
      ac_save_LIBS="$LIBS"
286
 
      CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
287
 
      LIBS="$LIBS $GDK_IMLIB_LIBS"
288
 
dnl
289
 
dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
290
 
dnl checks the results of imlib-config to some extent
291
 
dnl
292
 
      rm -f conf.imlibtest
293
 
      AC_TRY_RUN([
294
 
#include <stdio.h>
295
 
#include <stdlib.h>
296
 
#include <gdk_imlib.h>
297
 
 
298
 
int main ()
299
 
{
300
 
  int major, minor;
301
 
  char *tmp_version;
302
 
 
303
 
  system ("touch conf.gdkimlibtest");
304
 
 
305
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
306
 
  tmp_version = g_strdup("$min_imlib_version");
307
 
  if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
308
 
     printf("%s, bad version string\n", "$min_imlib_version");
309
 
     exit(1);
310
 
   }
311
 
 
312
 
    if (($imlib_major_version > major) ||
313
 
        (($imlib_major_version == major) && ($imlib_minor_version >= minor)))
314
 
    {
315
 
      return 0;
316
 
    }
317
 
  else
318
 
    {
319
 
      printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
320
 
      printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
321
 
      printf("*** best to upgrade to the required version.\n");
322
 
      printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
323
 
      printf("*** to point to the correct copy of imlib-config, and remove the file\n");
324
 
      printf("*** config.cache before re-running configure\n");
325
 
      return 1;
326
 
    }
327
 
}
328
 
 
329
 
],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
330
 
       CFLAGS="$ac_save_CFLAGS"
331
 
       LIBS="$ac_save_LIBS"
332
 
     fi
333
 
  fi
334
 
  if test "x$no_imlib" = x ; then
335
 
     AC_MSG_RESULT(yes)
336
 
     ifelse([$2], , :, [$2])     
337
 
  else
338
 
     AC_MSG_RESULT(no)
339
 
     if test "$IMLIB_CONFIG" = "no" ; then
340
 
       echo "*** The imlib-config script installed by IMLIB could not be found"
341
 
       echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
342
 
       echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
343
 
       echo "*** full path to imlib-config."
344
 
     else
345
 
       if test -f conf.gdkimlibtest ; then
346
 
        :
347
 
       else
348
 
          echo "*** Could not run IMLIB test program, checking why..."
349
 
          CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
350
 
          LIBS="$LIBS $GDK_IMLIB_LIBS"
351
 
          AC_TRY_LINK([
352
 
#include <stdio.h>
353
 
#include <gdk_imlib.h>
354
 
],      [ return 0; ],
355
 
        [ echo "*** The test program compiled, but did not run. This usually means"
356
 
          echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
357
 
          echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
358
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
359
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
360
 
          echo "*** is required on your system"
361
 
          echo "***"
362
 
          echo "*** If you have an old version installed, it is best to remove it, although"
363
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
364
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
365
 
          echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
366
 
          echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
367
 
          echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
368
 
          CFLAGS="$ac_save_CFLAGS"
369
 
          LIBS="$ac_save_LIBS"
370
 
       fi
371
 
     fi
372
 
     IMLIB_CFLAGS=""
373
 
     IMLIB_LIBS=""
374
 
     ifelse([$3], , :, [$3])
375
 
  fi
376
 
  AC_SUBST(GDK_IMLIB_CFLAGS)
377
 
  AC_SUBST(GDK_IMLIB_LIBS)
378
 
  rm -f conf.gdkimlibtest
379
 
])
 
1
# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
 
2
 
 
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 
4
# 2005  Free Software Foundation, Inc.
 
5
# This file is free software; the Free Software Foundation
 
6
# gives unlimited permission to copy and/or distribute it,
 
7
# with or without modifications, as long as this notice is preserved.
 
8
 
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
12
# PARTICULAR PURPOSE.
380
13
 
381
14
# Configure paths for GTK+
382
 
# Owen Taylor     97-11-3
 
15
# Owen Taylor     1997-2001
383
16
 
384
 
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
385
 
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
 
17
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
18
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
 
19
dnl pass to pkg-config
386
20
dnl
387
 
AC_DEFUN(AM_PATH_GTK,
 
21
AC_DEFUN([AM_PATH_GTK_2_0],
388
22
[dnl 
389
 
dnl Get the cflags and libraries from the gtk-config script
 
23
dnl Get the cflags and libraries from pkg-config
390
24
dnl
391
 
AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
392
 
            gtk_config_prefix="$withval", gtk_config_prefix="")
393
 
AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
394
 
            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
395
 
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
 
25
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
396
26
                    , enable_gtktest=yes)
397
27
 
 
28
  pkg_config_args=gtk+-2.0
398
29
  for module in . $4
399
30
  do
400
31
      case "$module" in
401
32
         gthread) 
402
 
             gtk_config_args="$gtk_config_args gthread"
 
33
             pkg_config_args="$pkg_config_args gthread-2.0"
403
34
         ;;
404
35
      esac
405
36
  done
406
37
 
407
 
  if test x$gtk_config_exec_prefix != x ; then
408
 
     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
409
 
     if test x${GTK_CONFIG+set} != xset ; then
410
 
        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
411
 
     fi
412
 
  fi
413
 
  if test x$gtk_config_prefix != x ; then
414
 
     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
415
 
     if test x${GTK_CONFIG+set} != xset ; then
416
 
        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
417
 
     fi
418
 
  fi
419
 
 
420
 
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
421
 
  min_gtk_version=ifelse([$1], ,0.99.7,$1)
422
 
  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
423
38
  no_gtk=""
424
 
  if test "$GTK_CONFIG" = "no" ; then
 
39
 
 
40
  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
41
 
 
42
  if test x$PKG_CONFIG != xno ; then
 
43
    if pkg-config --atleast-pkgconfig-version 0.7 ; then
 
44
      :
 
45
    else
 
46
      echo "*** pkg-config too old; version 0.7 or better required."
 
47
      no_gtk=yes
 
48
      PKG_CONFIG=no
 
49
    fi
 
50
  else
425
51
    no_gtk=yes
426
 
  else
427
 
    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
428
 
    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
429
 
    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
 
52
  fi
 
53
 
 
54
  min_gtk_version=ifelse([$1], ,2.0.0,$1)
 
55
  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
 
56
 
 
57
  if test x$PKG_CONFIG != xno ; then
 
58
    ## don't try to run the test against uninstalled libtool libs
 
59
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
 
60
          echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
 
61
          enable_gtktest=no
 
62
    fi
 
63
 
 
64
    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
 
65
          :
 
66
    else
 
67
          no_gtk=yes
 
68
    fi
 
69
  fi
 
70
 
 
71
  if test x"$no_gtk" = x ; then
 
72
    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
 
73
    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
 
74
    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
430
75
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
431
 
    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
 
76
    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
432
77
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
433
 
    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
 
78
    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
434
79
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
435
80
    if test "x$enable_gtktest" = "xyes" ; then
436
81
      ac_save_CFLAGS="$CFLAGS"
438
83
      CFLAGS="$CFLAGS $GTK_CFLAGS"
439
84
      LIBS="$GTK_LIBS $LIBS"
440
85
dnl
441
 
dnl Now check if the installed GTK is sufficiently new. (Also sanity
442
 
dnl checks the results of gtk-config to some extent
 
86
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
 
87
dnl checks the results of pkg-config to some extent)
443
88
dnl
444
89
      rm -f conf.gtktest
445
90
      AC_TRY_RUN([
466
111
      (gtk_minor_version != $gtk_config_minor_version) ||
467
112
      (gtk_micro_version != $gtk_config_micro_version))
468
113
    {
469
 
      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
 
114
      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
470
115
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
471
116
             gtk_major_version, gtk_minor_version, gtk_micro_version);
472
 
      printf ("*** was found! If gtk-config was correct, then it is best\n");
 
117
      printf ("*** was found! If pkg-config was correct, then it is best\n");
473
118
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
474
119
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
475
120
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
476
121
      printf("*** required on your system.\n");
477
 
      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
478
 
      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
479
 
      printf("*** before re-running configure\n");
 
122
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
 
123
      printf("*** to point to the correct configuration files\n");
480
124
    } 
481
 
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
482
125
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
483
126
           (gtk_minor_version != GTK_MINOR_VERSION) ||
484
127
           (gtk_micro_version != GTK_MICRO_VERSION))
488
131
      printf("*** library (version %d.%d.%d)\n",
489
132
             gtk_major_version, gtk_minor_version, gtk_micro_version);
490
133
    }
491
 
#endif /* defined (GTK_MAJOR_VERSION) ... */
492
134
  else
493
135
    {
494
136
      if ((gtk_major_version > major) ||
506
148
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
507
149
        printf("***\n");
508
150
        printf("*** If you have already installed a sufficiently new version, this error\n");
509
 
        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
 
151
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
510
152
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
511
 
        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
512
 
        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
 
153
        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
 
154
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
513
155
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
514
156
        printf("*** so that the correct libraries are found at run-time))\n");
515
157
      }
522
164
     fi
523
165
  fi
524
166
  if test "x$no_gtk" = x ; then
525
 
     AC_MSG_RESULT(yes)
 
167
     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
526
168
     ifelse([$2], , :, [$2])     
527
169
  else
528
170
     AC_MSG_RESULT(no)
529
 
     if test "$GTK_CONFIG" = "no" ; then
530
 
       echo "*** The gtk-config script installed by GTK could not be found"
531
 
       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
532
 
       echo "*** your path, or set the GTK_CONFIG environment variable to the"
533
 
       echo "*** full path to gtk-config."
 
171
     if test "$PKG_CONFIG" = "no" ; then
 
172
       echo "*** A new enough version of pkg-config was not found."
 
173
       echo "*** See http://pkgconfig.sourceforge.net"
534
174
     else
535
175
       if test -f conf.gtktest ; then
536
176
        :
537
177
       else
538
 
          echo "*** Could not run GTK test program, checking why..."
 
178
          echo "*** Could not run GTK+ test program, checking why..."
 
179
          ac_save_CFLAGS="$CFLAGS"
 
180
          ac_save_LIBS="$LIBS"
539
181
          CFLAGS="$CFLAGS $GTK_CFLAGS"
540
182
          LIBS="$LIBS $GTK_LIBS"
541
183
          AC_TRY_LINK([
543
185
#include <stdio.h>
544
186
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
545
187
        [ echo "*** The test program compiled, but did not run. This usually means"
546
 
          echo "*** that the run-time linker is not finding GTK or finding the wrong"
547
 
          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
 
188
          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
 
189
          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
548
190
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
549
191
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
550
192
          echo "*** is required on your system"
551
193
          echo "***"
552
194
          echo "*** If you have an old version installed, it is best to remove it, although"
553
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
554
 
          echo "***"
555
 
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
556
 
          echo "*** came with the system with the command"
557
 
          echo "***"
558
 
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
 
195
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
559
196
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
560
 
          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
561
 
          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
562
 
          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
 
197
          echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
563
198
          CFLAGS="$ac_save_CFLAGS"
564
199
          LIBS="$ac_save_LIBS"
565
200
       fi
573
208
  rm -f conf.gtktest
574
209
])
575
210
 
 
211
 
 
212
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
 
213
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
 
214
dnl also defines GSTUFF_PKG_ERRORS on error
 
215
AC_DEFUN(PKG_CHECK_MODULES, [
 
216
  succeeded=no
 
217
 
 
218
  if test -z "$PKG_CONFIG"; then
 
219
    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
220
  fi
 
221
 
 
222
  if test "$PKG_CONFIG" = "no" ; then
 
223
     echo "*** The pkg-config script could not be found. Make sure it is"
 
224
     echo "*** in your path, or set the PKG_CONFIG environment variable"
 
225
     echo "*** to the full path to pkg-config."
 
226
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
 
227
  else
 
228
     PKG_CONFIG_MIN_VERSION=0.9.0
 
229
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
 
230
        AC_MSG_CHECKING(for $2)
 
231
 
 
232
        if $PKG_CONFIG --exists "$2" ; then
 
233
            AC_MSG_RESULT(yes)
 
234
            succeeded=yes
 
235
 
 
236
            AC_MSG_CHECKING($1_CFLAGS)
 
237
            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
 
238
            AC_MSG_RESULT($$1_CFLAGS)
 
239
 
 
240
            AC_MSG_CHECKING($1_LIBS)
 
241
            $1_LIBS=`$PKG_CONFIG --libs "$2"`
 
242
            AC_MSG_RESULT($$1_LIBS)
 
243
        else
 
244
            $1_CFLAGS=""
 
245
            $1_LIBS=""
 
246
            ## If we have a custom action on failure, don't print errors, but 
 
247
            ## do set a variable so people can do so.
 
248
            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
249
            ifelse([$4], ,echo $$1_PKG_ERRORS,)
 
250
        fi
 
251
 
 
252
        AC_SUBST($1_CFLAGS)
 
253
        AC_SUBST($1_LIBS)
 
254
     else
 
255
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
 
256
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
 
257
     fi
 
258
  fi
 
259
 
 
260
  if test $succeeded = yes; then
 
261
     ifelse([$3], , :, [$3])
 
262
  else
 
263
     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
 
264
  fi
 
265
])
 
266
 
 
267
 
 
268
 
 
269
dnl Configure paths for librep
 
270
dnl $Id: rep.m4,v 1.6 1999/11/19 14:50:26 john Exp $
 
271
dnl
 
272
dnl AM_PATH_REP([MINIMUM_VERSION])
 
273
dnl Test for librep, define REP_VERSION, REP_CFLAGS, REP_LIBS and REP_EXECDIR
 
274
dnl
 
275
AC_DEFUN(AM_PATH_REP,
 
276
[dnl
 
277
  AC_ARG_WITH(rep_prefix,[  --with-rep-prefix=PFX   Prefix where rep is installed (optional)],
 
278
              [rep_prefix="$withval"], [rep_prefix=""])
 
279
  if test "x$rep_prefix" = "x"; then
 
280
    rep_config="rep-config"
 
281
  else
 
282
    rep_config="${rep_prefix}/bin/rep-config"
 
283
  fi
 
284
  min_rep_version=ifelse([$1], ,0.1,$1)
 
285
  AC_MSG_CHECKING(for rep - version >= $min_rep_version)
 
286
  rep_version=`$rep_config --version`
 
287
  if test $? -eq 0; then
 
288
    rep_major=`echo $rep_version \
 
289
        | sed -e 's/\([[0-9]]*\)\..*/\1/'`
 
290
    rep_minor=`echo $rep_version \
 
291
        | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
 
292
    min_rep_major=`echo $min_rep_version \
 
293
        | sed -e 's/\([[0-9]]*\)\..*/\1/'`
 
294
    min_rep_minor=`echo $min_rep_version \
 
295
        | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
 
296
    if test '(' $rep_major -gt $min_rep_major ')' \
 
297
        -o '(' $rep_major -eq $min_rep_major \
 
298
               -a $rep_minor -ge $min_rep_minor ')';
 
299
    then
 
300
      REP_VERSION="${rep_version}"
 
301
      REP_CFLAGS="`$rep_config --cflags`"
 
302
      REP_LIBS="`$rep_config --libs`"
 
303
      REP_EXECDIR="`$rep_config --execdir`"
 
304
      AC_SUBST(REP_VERSION)
 
305
      AC_SUBST(REP_CFLAGS)
 
306
      AC_SUBST(REP_LIBS)
 
307
      AC_SUBST(REP_EXECDIR)
 
308
      AC_MSG_RESULT([version ${rep_version}])
 
309
    else
 
310
      AC_MSG_ERROR([version ${rep_version}; require $min_rep_version])
 
311
    fi
 
312
  else
 
313
    AC_MSG_ERROR([can't find librep; is it installed?])
 
314
  fi
 
315
 
 
316
  dnl scan for GNU msgfmt
 
317
  AC_MSG_CHECKING(for GNU msgfmt)
 
318
  REP_MSGFMT=
 
319
  for p in `echo "$PATH" | sed -e 's/:/ /g'`; do
 
320
    if test -x $p/msgfmt; then
 
321
      if $p/msgfmt --version 2>&1 | grep GNU >/dev/null; then
 
322
        REP_MSGFMT=$p/msgfmt
 
323
      fi
 
324
    fi
 
325
  done
 
326
  if test x$REP_MSGFMT != x; then
 
327
    AC_MSG_RESULT($REP_MSGFMT)
 
328
  else
 
329
    AC_MSG_RESULT(unavailable, disabling i18n)
 
330
    REP_MSGFMT=true
 
331
  fi
 
332
  AC_SUBST(REP_MSGFMT)
 
333
])
 
334