~ubuntu-branches/ubuntu/vivid/basilisk2/vivid

« back to all changes in this revision

Viewing changes to src/Unix/aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-03-06 19:33:01 UTC
  • mfrom: (2.1.4 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080306193301-cc2ofn705nfsq3y0
Tags: 0.9.20070407-4
* Update copyright-check cdbs snippet to parse licensecheck using perl:
  + No longer randomly drops newlines
  + More compact hint file (and ordered more like wiki-proposed new copyright
    syntax).
  + No longer ignore files without copyright.
* Update copyright_hints.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
 
 
3
 
dnl Copyright (C) 1994, 1995-8, 1999, 2001 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 Additional macros for Basilisk II
14
 
 
15
 
 
16
 
dnl Check for libgnomeui
17
 
dnl B2_PATH_GNOMEUI([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
18
 
dnl Test to see if libgnomeui is installed, and define GNOMEUI_CFLAGS, LIBS
19
 
AC_DEFUN(B2_PATH_GNOMEUI,
20
 
[dnl
21
 
dnl Get the cflags and libraries from the gnome-config script
22
 
dnl
23
 
AC_ARG_WITH(gnome-config,
24
 
[  --with-gnome-config=GNOME_CONFIG  Location of gnome-config],
25
 
GNOME_CONFIG="$withval")
26
 
 
27
 
AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
28
 
AC_MSG_CHECKING(for libgnomeui)
29
 
if test "$GNOME_CONFIG" = "no"; then
30
 
  AC_MSG_RESULT(no)
31
 
  ifelse([$2], , :, [$2])
32
 
else
33
 
  AC_MSG_RESULT(yes)
34
 
  GNOMEUI_CFLAGS=`$GNOME_CONFIG --cflags gnomeui`
35
 
  GNOMEUI_LIBS=`$GNOME_CONFIG --libs gnomeui`
36
 
  ifelse([$1], , :, [$1])
37
 
fi  
38
 
AC_SUBST(GNOMEUI_CFLAGS)
39
 
AC_SUBST(GNOMEUI_LIBS)  
40
 
AC_SUBST(EXTRACFLAGS)
41
 
AC_SUBST(EXTRACXXFLAGS)
42
 
])
43
 
 
44
 
# lib-prefix.m4 serial 3 (gettext-0.12.2)
45
 
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
46
 
dnl This file is free software, distributed under the terms of the GNU
47
 
dnl General Public License.  As a special exception to the GNU General
48
 
dnl Public License, this file may be distributed as part of a program
49
 
dnl that contains a configuration script generated by Autoconf, under
50
 
dnl the same distribution terms as the rest of that program.
51
 
 
52
 
dnl From Bruno Haible.
53
 
 
54
 
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
55
 
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
56
 
dnl require excessive bracketing.
57
 
ifdef([AC_HELP_STRING],
58
 
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
59
 
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
60
 
 
61
 
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
62
 
dnl to access previously installed libraries. The basic assumption is that
63
 
dnl a user will want packages to use other packages he previously installed
64
 
dnl with the same --prefix option.
65
 
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
66
 
dnl libraries, but is otherwise very convenient.
67
 
AC_DEFUN([AC_LIB_PREFIX],
68
 
[
69
 
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
70
 
  AC_REQUIRE([AC_PROG_CC])
71
 
  AC_REQUIRE([AC_CANONICAL_HOST])
72
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
73
 
  dnl By default, look in $includedir and $libdir.
74
 
  use_additional=yes
75
 
  AC_LIB_WITH_FINAL_PREFIX([
76
 
    eval additional_includedir=\"$includedir\"
77
 
    eval additional_libdir=\"$libdir\"
78
 
  ])
79
 
  AC_LIB_ARG_WITH([lib-prefix],
80
 
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
81
 
  --without-lib-prefix    don't search for libraries in includedir and libdir],
82
 
[
83
 
    if test "X$withval" = "Xno"; then
84
 
      use_additional=no
85
 
    else
86
 
      if test "X$withval" = "X"; then
87
 
        AC_LIB_WITH_FINAL_PREFIX([
88
 
          eval additional_includedir=\"$includedir\"
89
 
          eval additional_libdir=\"$libdir\"
90
 
        ])
91
 
      else
92
 
        additional_includedir="$withval/include"
93
 
        additional_libdir="$withval/lib"
94
 
      fi
95
 
    fi
96
 
])
97
 
  if test $use_additional = yes; then
98
 
    dnl Potentially add $additional_includedir to $CPPFLAGS.
99
 
    dnl But don't add it
100
 
    dnl   1. if it's the standard /usr/include,
101
 
    dnl   2. if it's already present in $CPPFLAGS,
102
 
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
103
 
    dnl   4. if it doesn't exist as a directory.
104
 
    if test "X$additional_includedir" != "X/usr/include"; then
105
 
      haveit=
106
 
      for x in $CPPFLAGS; do
107
 
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
108
 
        if test "X$x" = "X-I$additional_includedir"; then
109
 
          haveit=yes
110
 
          break
111
 
        fi
112
 
      done
113
 
      if test -z "$haveit"; then
114
 
        if test "X$additional_includedir" = "X/usr/local/include"; then
115
 
          if test -n "$GCC"; then
116
 
            case $host_os in
117
 
              linux*) haveit=yes;;
118
 
            esac
119
 
          fi
120
 
        fi
121
 
        if test -z "$haveit"; then
122
 
          if test -d "$additional_includedir"; then
123
 
            dnl Really add $additional_includedir to $CPPFLAGS.
124
 
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
125
 
          fi
126
 
        fi
127
 
      fi
128
 
    fi
129
 
    dnl Potentially add $additional_libdir to $LDFLAGS.
130
 
    dnl But don't add it
131
 
    dnl   1. if it's the standard /usr/lib,
132
 
    dnl   2. if it's already present in $LDFLAGS,
133
 
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
134
 
    dnl   4. if it doesn't exist as a directory.
135
 
    if test "X$additional_libdir" != "X/usr/lib"; then
136
 
      haveit=
137
 
      for x in $LDFLAGS; do
138
 
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
139
 
        if test "X$x" = "X-L$additional_libdir"; then
140
 
          haveit=yes
141
 
          break
142
 
        fi
143
 
      done
144
 
      if test -z "$haveit"; then
145
 
        if test "X$additional_libdir" = "X/usr/local/lib"; then
146
 
          if test -n "$GCC"; then
147
 
            case $host_os in
148
 
              linux*) haveit=yes;;
149
 
            esac
150
 
          fi
151
 
        fi
152
 
        if test -z "$haveit"; then
153
 
          if test -d "$additional_libdir"; then
154
 
            dnl Really add $additional_libdir to $LDFLAGS.
155
 
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
156
 
          fi
157
 
        fi
158
 
      fi
159
 
    fi
160
 
  fi
161
 
])
162
 
 
163
 
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
164
 
dnl acl_final_exec_prefix, containing the values to which $prefix and
165
 
dnl $exec_prefix will expand at the end of the configure script.
166
 
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
167
 
[
168
 
  dnl Unfortunately, prefix and exec_prefix get only finally determined
169
 
  dnl at the end of configure.
170
 
  if test "X$prefix" = "XNONE"; then
171
 
    acl_final_prefix="$ac_default_prefix"
172
 
  else
173
 
    acl_final_prefix="$prefix"
174
 
  fi
175
 
  if test "X$exec_prefix" = "XNONE"; then
176
 
    acl_final_exec_prefix='${prefix}'
177
 
  else
178
 
    acl_final_exec_prefix="$exec_prefix"
179
 
  fi
180
 
  acl_save_prefix="$prefix"
181
 
  prefix="$acl_final_prefix"
182
 
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
183
 
  prefix="$acl_save_prefix"
184
 
])
185
 
 
186
 
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
187
 
dnl variables prefix and exec_prefix bound to the values they will have
188
 
dnl at the end of the configure script.
189
 
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
190
 
[
191
 
  acl_save_prefix="$prefix"
192
 
  prefix="$acl_final_prefix"
193
 
  acl_save_exec_prefix="$exec_prefix"
194
 
  exec_prefix="$acl_final_exec_prefix"
195
 
  $1
196
 
  exec_prefix="$acl_save_exec_prefix"
197
 
  prefix="$acl_save_prefix"
198
 
])
199
 
 
200
 
# lib-link.m4 serial 4 (gettext-0.12)
201
 
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
202
 
dnl This file is free software, distributed under the terms of the GNU
203
 
dnl General Public License.  As a special exception to the GNU General
204
 
dnl Public License, this file may be distributed as part of a program
205
 
dnl that contains a configuration script generated by Autoconf, under
206
 
dnl the same distribution terms as the rest of that program.
207
 
 
208
 
dnl From Bruno Haible.
209
 
 
210
 
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
211
 
dnl the libraries corresponding to explicit and implicit dependencies.
212
 
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
213
 
dnl augments the CPPFLAGS variable.
214
 
AC_DEFUN([AC_LIB_LINKFLAGS],
215
 
[
216
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
217
 
  AC_REQUIRE([AC_LIB_RPATH])
218
 
  define([Name],[translit([$1],[./-], [___])])
219
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
220
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
221
 
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
222
 
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
223
 
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
224
 
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
225
 
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
226
 
  ])
227
 
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
228
 
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
229
 
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
230
 
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
231
 
  AC_SUBST([LIB]NAME)
232
 
  AC_SUBST([LTLIB]NAME)
233
 
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
234
 
  dnl results of this search when this library appears as a dependency.
235
 
  HAVE_LIB[]NAME=yes
236
 
  undefine([Name])
237
 
  undefine([NAME])
238
 
])
239
 
 
240
 
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
241
 
dnl searches for libname and the libraries corresponding to explicit and
242
 
dnl implicit dependencies, together with the specified include files and
243
 
dnl the ability to compile and link the specified testcode. If found, it
244
 
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
245
 
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
246
 
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
247
 
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
248
 
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
249
 
[
250
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
251
 
  AC_REQUIRE([AC_LIB_RPATH])
252
 
  define([Name],[translit([$1],[./-], [___])])
253
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
254
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
255
 
 
256
 
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
257
 
  dnl accordingly.
258
 
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
259
 
 
260
 
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
261
 
  dnl because if the user has installed lib[]Name and not disabled its use
262
 
  dnl via --without-lib[]Name-prefix, he wants to use it.
263
 
  ac_save_CPPFLAGS="$CPPFLAGS"
264
 
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
265
 
 
266
 
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
267
 
    ac_save_LIBS="$LIBS"
268
 
    LIBS="$LIBS $LIB[]NAME"
269
 
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
270
 
    LIBS="$ac_save_LIBS"
271
 
  ])
272
 
  if test "$ac_cv_lib[]Name" = yes; then
273
 
    HAVE_LIB[]NAME=yes
274
 
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
275
 
    AC_MSG_CHECKING([how to link with lib[]$1])
276
 
    AC_MSG_RESULT([$LIB[]NAME])
277
 
  else
278
 
    HAVE_LIB[]NAME=no
279
 
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
280
 
    dnl $INC[]NAME either.
281
 
    CPPFLAGS="$ac_save_CPPFLAGS"
282
 
    LIB[]NAME=
283
 
    LTLIB[]NAME=
284
 
  fi
285
 
  AC_SUBST([HAVE_LIB]NAME)
286
 
  AC_SUBST([LIB]NAME)
287
 
  AC_SUBST([LTLIB]NAME)
288
 
  undefine([Name])
289
 
  undefine([NAME])
290
 
])
291
 
 
292
 
dnl Determine the platform dependent parameters needed to use rpath:
293
 
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
294
 
dnl hardcode_direct, hardcode_minus_L.
295
 
AC_DEFUN([AC_LIB_RPATH],
296
 
[
297
 
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
298
 
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
299
 
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
300
 
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
301
 
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
302
 
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
303
 
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
304
 
    . ./conftest.sh
305
 
    rm -f ./conftest.sh
306
 
    acl_cv_rpath=done
307
 
  ])
308
 
  wl="$acl_cv_wl"
309
 
  libext="$acl_cv_libext"
310
 
  shlibext="$acl_cv_shlibext"
311
 
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
312
 
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
313
 
  hardcode_direct="$acl_cv_hardcode_direct"
314
 
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
315
 
  dnl Determine whether the user wants rpath handling at all.
316
 
  AC_ARG_ENABLE(rpath,
317
 
    [  --disable-rpath         do not hardcode runtime library paths],
318
 
    :, enable_rpath=yes)
319
 
])
320
 
 
321
 
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
322
 
dnl the libraries corresponding to explicit and implicit dependencies.
323
 
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
324
 
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
325
 
[
326
 
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
327
 
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
328
 
  dnl By default, look in $includedir and $libdir.
329
 
  use_additional=yes
330
 
  AC_LIB_WITH_FINAL_PREFIX([
331
 
    eval additional_includedir=\"$includedir\"
332
 
    eval additional_libdir=\"$libdir\"
333
 
  ])
334
 
  AC_LIB_ARG_WITH([lib$1-prefix],
335
 
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
336
 
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
337
 
[
338
 
    if test "X$withval" = "Xno"; then
339
 
      use_additional=no
340
 
    else
341
 
      if test "X$withval" = "X"; then
342
 
        AC_LIB_WITH_FINAL_PREFIX([
343
 
          eval additional_includedir=\"$includedir\"
344
 
          eval additional_libdir=\"$libdir\"
345
 
        ])
346
 
      else
347
 
        additional_includedir="$withval/include"
348
 
        additional_libdir="$withval/lib"
349
 
      fi
350
 
    fi
351
 
])
352
 
  dnl Search the library and its dependencies in $additional_libdir and
353
 
  dnl $LDFLAGS. Using breadth-first-seach.
354
 
  LIB[]NAME=
355
 
  LTLIB[]NAME=
356
 
  INC[]NAME=
357
 
  rpathdirs=
358
 
  ltrpathdirs=
359
 
  names_already_handled=
360
 
  names_next_round='$1 $2'
361
 
  while test -n "$names_next_round"; do
362
 
    names_this_round="$names_next_round"
363
 
    names_next_round=
364
 
    for name in $names_this_round; do
365
 
      already_handled=
366
 
      for n in $names_already_handled; do
367
 
        if test "$n" = "$name"; then
368
 
          already_handled=yes
369
 
          break
370
 
        fi
371
 
      done
372
 
      if test -z "$already_handled"; then
373
 
        names_already_handled="$names_already_handled $name"
374
 
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
375
 
        dnl or AC_LIB_HAVE_LINKFLAGS call.
376
 
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
377
 
        eval value=\"\$HAVE_LIB$uppername\"
378
 
        if test -n "$value"; then
379
 
          if test "$value" = yes; then
380
 
            eval value=\"\$LIB$uppername\"
381
 
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
382
 
            eval value=\"\$LTLIB$uppername\"
383
 
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
384
 
          else
385
 
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
386
 
            dnl that this library doesn't exist. So just drop it.
387
 
            :
388
 
          fi
389
 
        else
390
 
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
391
 
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
392
 
          found_dir=
393
 
          found_la=
394
 
          found_so=
395
 
          found_a=
396
 
          if test $use_additional = yes; then
397
 
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
398
 
              found_dir="$additional_libdir"
399
 
              found_so="$additional_libdir/lib$name.$shlibext"
400
 
              if test -f "$additional_libdir/lib$name.la"; then
401
 
                found_la="$additional_libdir/lib$name.la"
402
 
              fi
403
 
            else
404
 
              if test -f "$additional_libdir/lib$name.$libext"; then
405
 
                found_dir="$additional_libdir"
406
 
                found_a="$additional_libdir/lib$name.$libext"
407
 
                if test -f "$additional_libdir/lib$name.la"; then
408
 
                  found_la="$additional_libdir/lib$name.la"
409
 
                fi
410
 
              fi
411
 
            fi
412
 
          fi
413
 
          if test "X$found_dir" = "X"; then
414
 
            for x in $LDFLAGS $LTLIB[]NAME; do
415
 
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
416
 
              case "$x" in
417
 
                -L*)
418
 
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
419
 
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
420
 
                    found_dir="$dir"
421
 
                    found_so="$dir/lib$name.$shlibext"
422
 
                    if test -f "$dir/lib$name.la"; then
423
 
                      found_la="$dir/lib$name.la"
424
 
                    fi
425
 
                  else
426
 
                    if test -f "$dir/lib$name.$libext"; then
427
 
                      found_dir="$dir"
428
 
                      found_a="$dir/lib$name.$libext"
429
 
                      if test -f "$dir/lib$name.la"; then
430
 
                        found_la="$dir/lib$name.la"
431
 
                      fi
432
 
                    fi
433
 
                  fi
434
 
                  ;;
435
 
              esac
436
 
              if test "X$found_dir" != "X"; then
437
 
                break
438
 
              fi
439
 
            done
440
 
          fi
441
 
          if test "X$found_dir" != "X"; then
442
 
            dnl Found the library.
443
 
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
444
 
            if test "X$found_so" != "X"; then
445
 
              dnl Linking with a shared library. We attempt to hardcode its
446
 
              dnl directory into the executable's runpath, unless it's the
447
 
              dnl standard /usr/lib.
448
 
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
449
 
                dnl No hardcoding is needed.
450
 
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
451
 
              else
452
 
                dnl Use an explicit option to hardcode DIR into the resulting
453
 
                dnl binary.
454
 
                dnl Potentially add DIR to ltrpathdirs.
455
 
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
456
 
                haveit=
457
 
                for x in $ltrpathdirs; do
458
 
                  if test "X$x" = "X$found_dir"; then
459
 
                    haveit=yes
460
 
                    break
461
 
                  fi
462
 
                done
463
 
                if test -z "$haveit"; then
464
 
                  ltrpathdirs="$ltrpathdirs $found_dir"
465
 
                fi
466
 
                dnl The hardcoding into $LIBNAME is system dependent.
467
 
                if test "$hardcode_direct" = yes; then
468
 
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
469
 
                  dnl resulting binary.
470
 
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
471
 
                else
472
 
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
473
 
                    dnl Use an explicit option to hardcode DIR into the resulting
474
 
                    dnl binary.
475
 
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
476
 
                    dnl Potentially add DIR to rpathdirs.
477
 
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
478
 
                    haveit=
479
 
                    for x in $rpathdirs; do
480
 
                      if test "X$x" = "X$found_dir"; then
481
 
                        haveit=yes
482
 
                        break
483
 
                      fi
484
 
                    done
485
 
                    if test -z "$haveit"; then
486
 
                      rpathdirs="$rpathdirs $found_dir"
487
 
                    fi
488
 
                  else
489
 
                    dnl Rely on "-L$found_dir".
490
 
                    dnl But don't add it if it's already contained in the LDFLAGS
491
 
                    dnl or the already constructed $LIBNAME
492
 
                    haveit=
493
 
                    for x in $LDFLAGS $LIB[]NAME; do
494
 
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
495
 
                      if test "X$x" = "X-L$found_dir"; then
496
 
                        haveit=yes
497
 
                        break
498
 
                      fi
499
 
                    done
500
 
                    if test -z "$haveit"; then
501
 
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
502
 
                    fi
503
 
                    if test "$hardcode_minus_L" != no; then
504
 
                      dnl FIXME: Not sure whether we should use
505
 
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
506
 
                      dnl here.
507
 
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
508
 
                    else
509
 
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
510
 
                      dnl here, because this doesn't fit in flags passed to the
511
 
                      dnl compiler. So give up. No hardcoding. This affects only
512
 
                      dnl very old systems.
513
 
                      dnl FIXME: Not sure whether we should use
514
 
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
515
 
                      dnl here.
516
 
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
517
 
                    fi
518
 
                  fi
519
 
                fi
520
 
              fi
521
 
            else
522
 
              if test "X$found_a" != "X"; then
523
 
                dnl Linking with a static library.
524
 
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
525
 
              else
526
 
                dnl We shouldn't come here, but anyway it's good to have a
527
 
                dnl fallback.
528
 
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
529
 
              fi
530
 
            fi
531
 
            dnl Assume the include files are nearby.
532
 
            additional_includedir=
533
 
            case "$found_dir" in
534
 
              */lib | */lib/)
535
 
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
536
 
                additional_includedir="$basedir/include"
537
 
                ;;
538
 
            esac
539
 
            if test "X$additional_includedir" != "X"; then
540
 
              dnl Potentially add $additional_includedir to $INCNAME.
541
 
              dnl But don't add it
542
 
              dnl   1. if it's the standard /usr/include,
543
 
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
544
 
              dnl   3. if it's already present in $CPPFLAGS or the already
545
 
              dnl      constructed $INCNAME,
546
 
              dnl   4. if it doesn't exist as a directory.
547
 
              if test "X$additional_includedir" != "X/usr/include"; then
548
 
                haveit=
549
 
                if test "X$additional_includedir" = "X/usr/local/include"; then
550
 
                  if test -n "$GCC"; then
551
 
                    case $host_os in
552
 
                      linux*) haveit=yes;;
553
 
                    esac
554
 
                  fi
555
 
                fi
556
 
                if test -z "$haveit"; then
557
 
                  for x in $CPPFLAGS $INC[]NAME; do
558
 
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
559
 
                    if test "X$x" = "X-I$additional_includedir"; then
560
 
                      haveit=yes
561
 
                      break
562
 
                    fi
563
 
                  done
564
 
                  if test -z "$haveit"; then
565
 
                    if test -d "$additional_includedir"; then
566
 
                      dnl Really add $additional_includedir to $INCNAME.
567
 
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
568
 
                    fi
569
 
                  fi
570
 
                fi
571
 
              fi
572
 
            fi
573
 
            dnl Look for dependencies.
574
 
            if test -n "$found_la"; then
575
 
              dnl Read the .la file. It defines the variables
576
 
              dnl dlname, library_names, old_library, dependency_libs, current,
577
 
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
578
 
              save_libdir="$libdir"
579
 
              case "$found_la" in
580
 
                */* | *\\*) . "$found_la" ;;
581
 
                *) . "./$found_la" ;;
582
 
              esac
583
 
              libdir="$save_libdir"
584
 
              dnl We use only dependency_libs.
585
 
              for dep in $dependency_libs; do
586
 
                case "$dep" in
587
 
                  -L*)
588
 
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
589
 
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
590
 
                    dnl But don't add it
591
 
                    dnl   1. if it's the standard /usr/lib,
592
 
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
593
 
                    dnl   3. if it's already present in $LDFLAGS or the already
594
 
                    dnl      constructed $LIBNAME,
595
 
                    dnl   4. if it doesn't exist as a directory.
596
 
                    if test "X$additional_libdir" != "X/usr/lib"; then
597
 
                      haveit=
598
 
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
599
 
                        if test -n "$GCC"; then
600
 
                          case $host_os in
601
 
                            linux*) haveit=yes;;
602
 
                          esac
603
 
                        fi
604
 
                      fi
605
 
                      if test -z "$haveit"; then
606
 
                        haveit=
607
 
                        for x in $LDFLAGS $LIB[]NAME; do
608
 
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
609
 
                          if test "X$x" = "X-L$additional_libdir"; then
610
 
                            haveit=yes
611
 
                            break
612
 
                          fi
613
 
                        done
614
 
                        if test -z "$haveit"; then
615
 
                          if test -d "$additional_libdir"; then
616
 
                            dnl Really add $additional_libdir to $LIBNAME.
617
 
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
618
 
                          fi
619
 
                        fi
620
 
                        haveit=
621
 
                        for x in $LDFLAGS $LTLIB[]NAME; do
622
 
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
623
 
                          if test "X$x" = "X-L$additional_libdir"; then
624
 
                            haveit=yes
625
 
                            break
626
 
                          fi
627
 
                        done
628
 
                        if test -z "$haveit"; then
629
 
                          if test -d "$additional_libdir"; then
630
 
                            dnl Really add $additional_libdir to $LTLIBNAME.
631
 
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
632
 
                          fi
633
 
                        fi
634
 
                      fi
635
 
                    fi
636
 
                    ;;
637
 
                  -R*)
638
 
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
639
 
                    if test "$enable_rpath" != no; then
640
 
                      dnl Potentially add DIR to rpathdirs.
641
 
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
642
 
                      haveit=
643
 
                      for x in $rpathdirs; do
644
 
                        if test "X$x" = "X$dir"; then
645
 
                          haveit=yes
646
 
                          break
647
 
                        fi
648
 
                      done
649
 
                      if test -z "$haveit"; then
650
 
                        rpathdirs="$rpathdirs $dir"
651
 
                      fi
652
 
                      dnl Potentially add DIR to ltrpathdirs.
653
 
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
654
 
                      haveit=
655
 
                      for x in $ltrpathdirs; do
656
 
                        if test "X$x" = "X$dir"; then
657
 
                          haveit=yes
658
 
                          break
659
 
                        fi
660
 
                      done
661
 
                      if test -z "$haveit"; then
662
 
                        ltrpathdirs="$ltrpathdirs $dir"
663
 
                      fi
664
 
                    fi
665
 
                    ;;
666
 
                  -l*)
667
 
                    dnl Handle this in the next round.
668
 
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
669
 
                    ;;
670
 
                  *.la)
671
 
                    dnl Handle this in the next round. Throw away the .la's
672
 
                    dnl directory; it is already contained in a preceding -L
673
 
                    dnl option.
674
 
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
675
 
                    ;;
676
 
                  *)
677
 
                    dnl Most likely an immediate library name.
678
 
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
679
 
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
680
 
                    ;;
681
 
                esac
682
 
              done
683
 
            fi
684
 
          else
685
 
            dnl Didn't find the library; assume it is in the system directories
686
 
            dnl known to the linker and runtime loader. (All the system
687
 
            dnl directories known to the linker should also be known to the
688
 
            dnl runtime loader, otherwise the system is severely misconfigured.)
689
 
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
690
 
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
691
 
          fi
692
 
        fi
693
 
      fi
694
 
    done
695
 
  done
696
 
  if test "X$rpathdirs" != "X"; then
697
 
    if test -n "$hardcode_libdir_separator"; then
698
 
      dnl Weird platform: only the last -rpath option counts, the user must
699
 
      dnl pass all path elements in one option. We can arrange that for a
700
 
      dnl single library, but not when more than one $LIBNAMEs are used.
701
 
      alldirs=
702
 
      for found_dir in $rpathdirs; do
703
 
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
704
 
      done
705
 
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
706
 
      acl_save_libdir="$libdir"
707
 
      libdir="$alldirs"
708
 
      eval flag=\"$hardcode_libdir_flag_spec\"
709
 
      libdir="$acl_save_libdir"
710
 
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
711
 
    else
712
 
      dnl The -rpath options are cumulative.
713
 
      for found_dir in $rpathdirs; do
714
 
        acl_save_libdir="$libdir"
715
 
        libdir="$found_dir"
716
 
        eval flag=\"$hardcode_libdir_flag_spec\"
717
 
        libdir="$acl_save_libdir"
718
 
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
719
 
      done
720
 
    fi
721
 
  fi
722
 
  if test "X$ltrpathdirs" != "X"; then
723
 
    dnl When using libtool, the option that works for both libraries and
724
 
    dnl executables is -R. The -R options are cumulative.
725
 
    for found_dir in $ltrpathdirs; do
726
 
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
727
 
    done
728
 
  fi
729
 
])
730
 
 
731
 
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
732
 
dnl unless already present in VAR.
733
 
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
734
 
dnl contains two or three consecutive elements that belong together.
735
 
AC_DEFUN([AC_LIB_APPENDTOVAR],
736
 
[
737
 
  for element in [$2]; do
738
 
    haveit=
739
 
    for x in $[$1]; do
740
 
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
741
 
      if test "X$x" = "X$element"; then
742
 
        haveit=yes
743
 
        break
744
 
      fi
745
 
    done
746
 
    if test -z "$haveit"; then
747
 
      [$1]="${[$1]}${[$1]:+ }$element"
748
 
    fi
749
 
  done
750
 
])
751
 
 
752
 
# lib-ld.m4 serial 2 (gettext-0.12)
753
 
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
754
 
dnl This file is free software, distributed under the terms of the GNU
755
 
dnl General Public License.  As a special exception to the GNU General
756
 
dnl Public License, this file may be distributed as part of a program
757
 
dnl that contains a configuration script generated by Autoconf, under
758
 
dnl the same distribution terms as the rest of that program.
759
 
 
760
 
dnl Subroutines of libtool.m4,
761
 
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
762
 
dnl with libtool.m4.
763
 
 
764
 
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
765
 
AC_DEFUN([AC_LIB_PROG_LD_GNU],
766
 
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
767
 
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
768
 
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
769
 
  acl_cv_prog_gnu_ld=yes
770
 
else
771
 
  acl_cv_prog_gnu_ld=no
772
 
fi])
773
 
with_gnu_ld=$acl_cv_prog_gnu_ld
774
 
])
775
 
 
776
 
dnl From libtool-1.4. Sets the variable LD.
777
 
AC_DEFUN([AC_LIB_PROG_LD],
778
 
[AC_ARG_WITH(gnu-ld,
779
 
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
780
 
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
781
 
AC_REQUIRE([AC_PROG_CC])dnl
782
 
AC_REQUIRE([AC_CANONICAL_HOST])dnl
783
 
# Prepare PATH_SEPARATOR.
784
 
# The user is always right.
785
 
if test "${PATH_SEPARATOR+set}" != set; then
786
 
  echo "#! /bin/sh" >conf$$.sh
787
 
  echo  "exit 0"   >>conf$$.sh
788
 
  chmod +x conf$$.sh
789
 
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
790
 
    PATH_SEPARATOR=';'
791
 
  else
792
 
    PATH_SEPARATOR=:
793
 
  fi
794
 
  rm -f conf$$.sh
795
 
fi
796
 
ac_prog=ld
797
 
if test "$GCC" = yes; then
798
 
  # Check if gcc -print-prog-name=ld gives a path.
799
 
  AC_MSG_CHECKING([for ld used by GCC])
800
 
  case $host in
801
 
  *-*-mingw*)
802
 
    # gcc leaves a trailing carriage return which upsets mingw
803
 
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
804
 
  *)
805
 
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
806
 
  esac
807
 
  case $ac_prog in
808
 
    # Accept absolute paths.
809
 
    [[\\/]* | [A-Za-z]:[\\/]*)]
810
 
      [re_direlt='/[^/][^/]*/\.\./']
811
 
      # Canonicalize the path of ld
812
 
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
813
 
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
814
 
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
815
 
      done
816
 
      test -z "$LD" && LD="$ac_prog"
817
 
      ;;
818
 
  "")
819
 
    # If it fails, then pretend we aren't using GCC.
820
 
    ac_prog=ld
821
 
    ;;
822
 
  *)
823
 
    # If it is relative, then search for the first ld in PATH.
824
 
    with_gnu_ld=unknown
825
 
    ;;
826
 
  esac
827
 
elif test "$with_gnu_ld" = yes; then
828
 
  AC_MSG_CHECKING([for GNU ld])
829
 
else
830
 
  AC_MSG_CHECKING([for non-GNU ld])
831
 
fi
832
 
AC_CACHE_VAL(acl_cv_path_LD,
833
 
[if test -z "$LD"; then
834
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
835
 
  for ac_dir in $PATH; do
836
 
    test -z "$ac_dir" && ac_dir=.
837
 
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
838
 
      acl_cv_path_LD="$ac_dir/$ac_prog"
839
 
      # Check to see if the program is GNU ld.  I'd rather use --version,
840
 
      # but apparently some GNU ld's only accept -v.
841
 
      # Break only if it was the GNU/non-GNU ld that we prefer.
842
 
      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
843
 
        test "$with_gnu_ld" != no && break
844
 
      else
845
 
        test "$with_gnu_ld" != yes && break
846
 
      fi
847
 
    fi
848
 
  done
849
 
  IFS="$ac_save_ifs"
850
 
else
851
 
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
852
 
fi])
853
 
LD="$acl_cv_path_LD"
854
 
if test -n "$LD"; then
855
 
  AC_MSG_RESULT($LD)
856
 
else
857
 
  AC_MSG_RESULT(no)
858
 
fi
859
 
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
860
 
AC_LIB_PROG_LD_GNU
861
 
])
862
 
 
863
 
# Configure paths for GTK+
864
 
# Owen Taylor     97-11-3
865
 
 
866
 
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
867
 
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
868
 
dnl
869
 
AC_DEFUN(AM_PATH_GTK,
870
 
[dnl 
871
 
dnl Get the cflags and libraries from the gtk-config script
872
 
dnl
873
 
AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
874
 
            gtk_config_prefix="$withval", gtk_config_prefix="")
875
 
AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
876
 
            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
877
 
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
878
 
                    , enable_gtktest=yes)
879
 
 
880
 
  for module in . $4
881
 
  do
882
 
      case "$module" in
883
 
         gthread) 
884
 
             gtk_config_args="$gtk_config_args gthread"
885
 
         ;;
886
 
      esac
887
 
  done
888
 
 
889
 
  if test x$gtk_config_exec_prefix != x ; then
890
 
     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
891
 
     if test x${GTK_CONFIG+set} != xset ; then
892
 
        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
893
 
     fi
894
 
  fi
895
 
  if test x$gtk_config_prefix != x ; then
896
 
     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
897
 
     if test x${GTK_CONFIG+set} != xset ; then
898
 
        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
899
 
     fi
900
 
  fi
901
 
 
902
 
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
903
 
  min_gtk_version=ifelse([$1], ,0.99.7,$1)
904
 
  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
905
 
  no_gtk=""
906
 
  if test "$GTK_CONFIG" = "no" ; then
907
 
    no_gtk=yes
908
 
  else
909
 
    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
910
 
    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
911
 
    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
912
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
913
 
    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
914
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
915
 
    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
916
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
917
 
    if test "x$enable_gtktest" = "xyes" ; then
918
 
      ac_save_CFLAGS="$CFLAGS"
919
 
      ac_save_LIBS="$LIBS"
920
 
      CFLAGS="$CFLAGS $GTK_CFLAGS"
921
 
      LIBS="$GTK_LIBS $LIBS"
922
 
dnl
923
 
dnl Now check if the installed GTK is sufficiently new. (Also sanity
924
 
dnl checks the results of gtk-config to some extent
925
 
dnl
926
 
      rm -f conf.gtktest
927
 
      AC_TRY_RUN([
928
 
#include <gtk/gtk.h>
929
 
#include <stdio.h>
930
 
#include <stdlib.h>
931
 
 
932
 
int 
933
 
main ()
934
 
{
935
 
  int major, minor, micro;
936
 
  char *tmp_version;
937
 
 
938
 
  system ("touch conf.gtktest");
939
 
 
940
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
941
 
  tmp_version = g_strdup("$min_gtk_version");
942
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
943
 
     printf("%s, bad version string\n", "$min_gtk_version");
944
 
     exit(1);
945
 
   }
946
 
 
947
 
  if ((gtk_major_version != $gtk_config_major_version) ||
948
 
      (gtk_minor_version != $gtk_config_minor_version) ||
949
 
      (gtk_micro_version != $gtk_config_micro_version))
950
 
    {
951
 
      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
952
 
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
953
 
             gtk_major_version, gtk_minor_version, gtk_micro_version);
954
 
      printf ("*** was found! If gtk-config was correct, then it is best\n");
955
 
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
956
 
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
957
 
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
958
 
      printf("*** required on your system.\n");
959
 
      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
960
 
      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
961
 
      printf("*** before re-running configure\n");
962
 
    } 
963
 
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
964
 
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
965
 
           (gtk_minor_version != GTK_MINOR_VERSION) ||
966
 
           (gtk_micro_version != GTK_MICRO_VERSION))
967
 
    {
968
 
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
969
 
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
970
 
      printf("*** library (version %d.%d.%d)\n",
971
 
             gtk_major_version, gtk_minor_version, gtk_micro_version);
972
 
    }
973
 
#endif /* defined (GTK_MAJOR_VERSION) ... */
974
 
  else
975
 
    {
976
 
      if ((gtk_major_version > major) ||
977
 
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
978
 
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
979
 
      {
980
 
        return 0;
981
 
       }
982
 
     else
983
 
      {
984
 
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
985
 
               gtk_major_version, gtk_minor_version, gtk_micro_version);
986
 
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
987
 
               major, minor, micro);
988
 
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
989
 
        printf("***\n");
990
 
        printf("*** If you have already installed a sufficiently new version, this error\n");
991
 
        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
992
 
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
993
 
        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
994
 
        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
995
 
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
996
 
        printf("*** so that the correct libraries are found at run-time))\n");
997
 
      }
998
 
    }
999
 
  return 1;
1000
 
}
1001
 
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1002
 
       CFLAGS="$ac_save_CFLAGS"
1003
 
       LIBS="$ac_save_LIBS"
1004
 
     fi
1005
 
  fi
1006
 
  if test "x$no_gtk" = x ; then
1007
 
     AC_MSG_RESULT(yes)
1008
 
     ifelse([$2], , :, [$2])     
1009
 
  else
1010
 
     AC_MSG_RESULT(no)
1011
 
     if test "$GTK_CONFIG" = "no" ; then
1012
 
       echo "*** The gtk-config script installed by GTK could not be found"
1013
 
       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
1014
 
       echo "*** your path, or set the GTK_CONFIG environment variable to the"
1015
 
       echo "*** full path to gtk-config."
1016
 
     else
1017
 
       if test -f conf.gtktest ; then
1018
 
        :
1019
 
       else
1020
 
          echo "*** Could not run GTK test program, checking why..."
1021
 
          CFLAGS="$CFLAGS $GTK_CFLAGS"
1022
 
          LIBS="$LIBS $GTK_LIBS"
1023
 
          AC_TRY_LINK([
1024
 
#include <gtk/gtk.h>
1025
 
#include <stdio.h>
1026
 
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1027
 
        [ echo "*** The test program compiled, but did not run. This usually means"
1028
 
          echo "*** that the run-time linker is not finding GTK or finding the wrong"
1029
 
          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
1030
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1031
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1032
 
          echo "*** is required on your system"
1033
 
          echo "***"
1034
 
          echo "*** If you have an old version installed, it is best to remove it, although"
1035
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1036
 
          echo "***"
1037
 
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1038
 
          echo "*** came with the system with the command"
1039
 
          echo "***"
1040
 
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
1041
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1042
 
          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
1043
 
          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
1044
 
          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
1045
 
          CFLAGS="$ac_save_CFLAGS"
1046
 
          LIBS="$ac_save_LIBS"
1047
 
       fi
1048
 
     fi
1049
 
     GTK_CFLAGS=""
1050
 
     GTK_LIBS=""
1051
 
     ifelse([$3], , :, [$3])
1052
 
  fi
1053
 
  AC_SUBST(GTK_CFLAGS)
1054
 
  AC_SUBST(GTK_LIBS)
1055
 
  rm -f conf.gtktest
1056
 
])
1057
 
 
1058
 
# Configure paths for ESD
1059
 
# Manish Singh    98-9-30
1060
 
# stolen back from Frank Belew
1061
 
# stolen from Manish Singh
1062
 
# Shamelessly stolen from Owen Taylor
1063
 
 
1064
 
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1065
 
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
1066
 
dnl
1067
 
AC_DEFUN(AM_PATH_ESD,
1068
 
[dnl 
1069
 
dnl Get the cflags and libraries from the esd-config script
1070
 
dnl
1071
 
AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
1072
 
            esd_prefix="$withval", esd_prefix="")
1073
 
AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
1074
 
            esd_exec_prefix="$withval", esd_exec_prefix="")
1075
 
AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
1076
 
                    , enable_esdtest=yes)
1077
 
 
1078
 
  if test x$esd_exec_prefix != x ; then
1079
 
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
1080
 
     if test x${ESD_CONFIG+set} != xset ; then
1081
 
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
1082
 
     fi
1083
 
  fi
1084
 
  if test x$esd_prefix != x ; then
1085
 
     esd_args="$esd_args --prefix=$esd_prefix"
1086
 
     if test x${ESD_CONFIG+set} != xset ; then
1087
 
        ESD_CONFIG=$esd_prefix/bin/esd-config
1088
 
     fi
1089
 
  fi
1090
 
 
1091
 
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1092
 
  min_esd_version=ifelse([$1], ,0.2.7,$1)
1093
 
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
1094
 
  no_esd=""
1095
 
  if test "$ESD_CONFIG" = "no" ; then
1096
 
    no_esd=yes
1097
 
  else
1098
 
    AC_LANG_SAVE
1099
 
    AC_LANG_C
1100
 
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
1101
 
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
1102
 
 
1103
 
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
1104
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1105
 
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
1106
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1107
 
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
1108
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1109
 
    if test "x$enable_esdtest" = "xyes" ; then
1110
 
      ac_save_CFLAGS="$CFLAGS"
1111
 
      ac_save_LIBS="$LIBS"
1112
 
      CFLAGS="$CFLAGS $ESD_CFLAGS"
1113
 
      LIBS="$LIBS $ESD_LIBS"
1114
 
dnl
1115
 
dnl Now check if the installed ESD is sufficiently new. (Also sanity
1116
 
dnl checks the results of esd-config to some extent
1117
 
dnl
1118
 
      rm -f conf.esdtest
1119
 
      AC_TRY_RUN([
1120
 
#include <stdio.h>
1121
 
#include <stdlib.h>
1122
 
#include <string.h>
1123
 
#include <esd.h>
1124
 
 
1125
 
char*
1126
 
my_strdup (char *str)
1127
 
{
1128
 
  char *new_str;
1129
 
  
1130
 
  if (str)
1131
 
    {
1132
 
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
1133
 
      strcpy (new_str, str);
1134
 
    }
1135
 
  else
1136
 
    new_str = NULL;
1137
 
  
1138
 
  return new_str;
1139
 
}
1140
 
 
1141
 
int main ()
1142
 
{
1143
 
  int major, minor, micro;
1144
 
  char *tmp_version;
1145
 
 
1146
 
  system ("touch conf.esdtest");
1147
 
 
1148
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
1149
 
  tmp_version = my_strdup("$min_esd_version");
1150
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1151
 
     printf("%s, bad version string\n", "$min_esd_version");
1152
 
     exit(1);
1153
 
   }
1154
 
 
1155
 
   if (($esd_major_version > major) ||
1156
 
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
1157
 
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
1158
 
    {
1159
 
      return 0;
1160
 
    }
1161
 
  else
1162
 
    {
1163
 
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
1164
 
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
1165
 
      printf("*** best to upgrade to the required version.\n");
1166
 
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
1167
 
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
1168
 
      printf("*** config.cache before re-running configure\n");
1169
 
      return 1;
1170
 
    }
1171
 
}
1172
 
 
1173
 
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1174
 
       CFLAGS="$ac_save_CFLAGS"
1175
 
       LIBS="$ac_save_LIBS"
1176
 
       AC_LANG_RESTORE
1177
 
     fi
1178
 
  fi
1179
 
  if test "x$no_esd" = x ; then
1180
 
     AC_MSG_RESULT(yes)
1181
 
     ifelse([$2], , :, [$2])     
1182
 
  else
1183
 
     AC_MSG_RESULT(no)
1184
 
     if test "$ESD_CONFIG" = "no" ; then
1185
 
       echo "*** The esd-config script installed by ESD could not be found"
1186
 
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
1187
 
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
1188
 
       echo "*** full path to esd-config."
1189
 
     else
1190
 
       if test -f conf.esdtest ; then
1191
 
        :
1192
 
       else
1193
 
          echo "*** Could not run ESD test program, checking why..."
1194
 
          CFLAGS="$CFLAGS $ESD_CFLAGS"
1195
 
          LIBS="$LIBS $ESD_LIBS"
1196
 
          AC_LANG_SAVE
1197
 
          AC_LANG_C
1198
 
          AC_TRY_LINK([
1199
 
#include <stdio.h>
1200
 
#include <esd.h>
1201
 
],      [ return 0; ],
1202
 
        [ echo "*** The test program compiled, but did not run. This usually means"
1203
 
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
1204
 
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
1205
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1206
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1207
 
          echo "*** is required on your system"
1208
 
          echo "***"
1209
 
          echo "*** If you have an old version installed, it is best to remove it, although"
1210
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1211
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1212
 
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
1213
 
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
1214
 
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
1215
 
          CFLAGS="$ac_save_CFLAGS"
1216
 
          LIBS="$ac_save_LIBS"
1217
 
          AC_LANG_RESTORE
1218
 
       fi
1219
 
     fi
1220
 
     ESD_CFLAGS=""
1221
 
     ESD_LIBS=""
1222
 
     ifelse([$3], , :, [$3])
1223
 
  fi
1224
 
  AC_SUBST(ESD_CFLAGS)
1225
 
  AC_SUBST(ESD_LIBS)
1226
 
  rm -f conf.esdtest
1227
 
])
1228
 
 
1229
 
dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
1230
 
dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
1231
 
dnl
1232
 
AC_DEFUN(AM_ESD_SUPPORTS_MULTIPLE_RECORD,
1233
 
[dnl
1234
 
  AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
1235
 
  ac_save_ESD_CFLAGS="$ESD_CFLAGS"
1236
 
  ac_save_ESD_LIBS="$ESD_LIBS"
1237
 
  AM_PATH_ESD(0.2.21,
1238
 
    ifelse([$1], , [
1239
 
      AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
1240
 
      AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
1241
 
        [Define if you have esound with support of multiple recording clients.])],
1242
 
    [$1]),
1243
 
    ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
1244
 
    if test "x$ac_save_ESD_CFLAGS" != x ; then
1245
 
       ESD_CFLAGS="$ac_save_ESD_CFLAGS"
1246
 
    fi
1247
 
    if test "x$ac_save_ESD_LIBS" != x ; then
1248
 
       ESD_LIBS="$ac_save_ESD_LIBS"
1249
 
    fi
1250
 
  )
1251
 
])
1252
 
 
1253
 
# Define a conditional.
1254
 
 
1255
 
AC_DEFUN([AM_CONDITIONAL],
1256
 
[AC_SUBST($1_TRUE)
1257
 
AC_SUBST($1_FALSE)
1258
 
if $2; then
1259
 
  $1_TRUE=
1260
 
  $1_FALSE='#'
1261
 
else
1262
 
  $1_TRUE='#'
1263
 
  $1_FALSE=
1264
 
fi])
1265
 
 
 
1
# generated automatically by aclocal 1.9.6 -*- 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.
 
13
 
 
14
m4_include([m4/esd.m4])
 
15
m4_include([m4/gettext.m4])
 
16
m4_include([m4/gtk-2.0.m4])
 
17
m4_include([m4/gtk.m4])
 
18
m4_include([acinclude.m4])