~awn-core/awn/0.2.4

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Neil J Patel
  • Date: 2008-02-14 17:14:00 UTC
  • mfrom: (155.1.34 awn-core-testing)
  • Revision ID: njp@neils-mbp-20080214171400-f2dikd9ivke2jhje
2008-02-14  Neil J. Patel  <njpatel@gmail.com>

        * .bzrignore:
        * CC.COPYING:
        * ChangeLog:
        * Makefile.am:
        * acinclude.m4:
        * applets/wscript_build:
        * autogen.sh:
        * awn-applet-activation/Makefile.am:
        * awn-applet-activation/main.c:
        * awn-applet-activation/wscript_build:
        * awn-manager/.directory:
        * awn-manager/Makefile.am:
        * awn-manager/awn-launcher-editor.in:
        * awn-manager/awnApplet.py:
        * awn-manager/awnDefs.py.in:
        * awn-manager/awnLauncher.py:
        * awn-manager/awnLauncherEditor.py:
        * awn-manager/awnManager.py.in:
        * awn-manager/awnPreferences.py:
        * awn-manager/awnTheme.py:
        * awn-manager/launcher-editor.glade:
        * awn-manager/window.glade:
        * awn-manager/wscript_build:
        * awn.pc.in:
        * bindings/Makefile.am:
        * bindings/python/Makefile.am:
        * bindings/python/__init__.py:
        * bindings/python/awn.defs:
        * bindings/python/awn.override:
        * bindings/python/awnmodule.c:
        * bindings/vala/Makefile.am:
        * bindings/vala/awn.deps:
        * bindings/vala/awn.files:
        * bindings/vala/awn.gi:
        * bindings/vala/awn.metadata:
        * bindings/vala/awn.namespace:
        * bindings/vala/awn.vapi:
        * config.h.in:
        * configure.in:
        * data/Makefile.am:
        * data/awn-schema-to-gconf:
        * data/awn.schema-ini:
        * data/wscript_build:
        * doc/Makefile.am:
        * doc/reference/Makefile.am:
        * doc/reference/libawn-docs.sgml:
        * doc/reference/libawn-sections.txt:
        * doc/reference/libawn.types:
        * docs/PPA_autoppa:
        * docs/waf:
        * libawn/Makefile.am:
        * libawn/awn-applet-dialog.c:
        * libawn/awn-applet-dialog.h:
        * libawn/awn-applet-gconf.c:
        * libawn/awn-applet-gconf.h:
        * libawn/awn-applet-simple.c:
        * libawn/awn-applet.c:
        * libawn/awn-applet.h:
        * libawn/awn-config-client-gconf.c:
        * libawn/awn-config-client-gkeyfile.c:
        * libawn/awn-config-client-shared.c:
        * libawn/awn-config-client.h:
        * libawn/awn-defines.h:
        * libawn/awn-desktop-item-egg.c:
        * libawn/awn-desktop-item-gnome.c:
        * libawn/awn-desktop-item.h:
        * libawn/awn-effects.c:
        * libawn/awn-effects.h:
        * libawn/awn-enum-types.c.in:
        * libawn/awn-settings.c:
        * libawn/awn-settings.h:
        * libawn/awn-title.c:
        * libawn/awn-vfs.c:
        * libawn/awn-vfs.h:
        * libawn/egg/Makefile.am:
        * libawn/egg/egg-enum-types.c.in:
        * libawn/egg/egg-enum-types.h.in:
        * libawn/egg/eggchecksum.c:
        * libawn/egg/eggchecksum.h:
        * libawn/egg/eggdesktopfile.c:
        * libawn/egg/eggdesktopfile.h:
        * libawn/egg/tests/checksum-test.c:
        * libawn/wscript_build:
        * po/wscript_build:
        * src/Makefile.am:
        * src/awn-applet-manager.c:
        * src/awn-applet-manager.h:
        * src/awn-bar.h:
        * src/awn-hotspot.h:
        * src/awn-task-manager.c:
        * src/awn-task-manager.h:
        * src/awn-task.c:
        * src/awn-task.h:
        * src/awn-utils.h:
        * src/awn-window.h:
        * src/awn-x.c:
        * src/awn-x.h:
        * src/main.c:
        * test/Makefile.am:
        * test/test-config-client.c:
        * test/test-config-client.py:
        * test/test.vala:
        * waf:
        * wscript:
        Merged awn-core-testing branch by malept, moonbeem & gilir.
        Abstracts configuration backends; Add support for GKeyfile backend.
        Abstracts Desktop File implementation; Adds support for libegg backend.
        Abstracts VFS backends; Adds support for Tunar & GVFS backend.
        Updated python bindings.
        Adds support for Vala bindings.
        Removes gnome-panel dependancy.
        Updated awn-manager interface.
        

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## this one is commonly used with AM_PATH_PYTHONDIR ...
 
1
dnl AC_PYTHON_DEVEL([version])
 
2
dnl 
 
3
dnl Originally copied from http://autoconf-archive.cryp.to/ac_python_devel.html
 
4
dnl (Original last modified 2007-07-31)
 
5
dnl 
 
6
dnl Copyright © 2007 Sebastian Huber <sebastian-huber@web.de>
 
7
dnl Copyright © 2007 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
 
8
dnl Copyright © 2007 Rafael Laboissiere <rafael@laboissiere.net>
 
9
dnl Copyright © 2007 Andrew Collier <colliera@ukzn.ac.za>
 
10
dnl Copyright © 2007 Matteo Settenvini <matteo@member.fsf.org>
 
11
dnl Copyright © 2007 Horst Knorr <hk_classes@knoda.org>
 
12
dnl
 
13
dnl This program is free software: you can redistribute it and/or modify it
 
14
dnl under the terms of the GNU General Public License as published by the Free
 
15
dnl Software Foundation, either version 3 of the License, or (at your option)
 
16
dnl any later version.
 
17
dnl
 
18
dnl This program is distributed in the hope that it will be useful, but WITHOUT
 
19
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
20
dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 
21
dnl more details.
 
22
dnl
 
23
dnl You should have received a copy of the GNU General Public License along with
 
24
dnl this program. If not, see <http://www.gnu.org/licenses/>.
 
25
dnl
 
26
dnl As a special exception, the respective Autoconf Macro's copyright owner
 
27
dnl gives unlimited permission to copy, distribute and modify the configure
 
28
dnl scripts that are the output of Autoconf when processing the Macro. You need
 
29
dnl not follow the terms of the GNU General Public License when using or
 
30
dnl distributing such scripts, even though portions of the text of the Macro
 
31
dnl appear in them. The GNU General Public License (GPL) does govern all other
 
32
dnl use of the material that constitutes the Autoconf Macro.
 
33
dnl
 
34
dnl This special exception to the GPL applies to versions of the Autoconf Macro
 
35
dnl released by the Autoconf Macro Archive. When you make and distribute a
 
36
dnl modified version of the Autoconf Macro, you may extend this special
 
37
dnl exception to the GPL to apply to your modified version as well.
 
38
dnl
 
39
AC_DEFUN([AC_PYTHON_DEVEL],[
 
40
        #
 
41
        # Allow the use of a (user set) custom python version
 
42
        #
 
43
        AC_ARG_VAR([PYTHON_VERSION],[The installed Python
 
44
                version to use, for example '2.3'. This string
 
45
                will be appended to the Python interpreter
 
46
                canonical name.])
 
47
 
 
48
        AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
 
49
        if test -z "$PYTHON"; then
 
50
           AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
 
51
           PYTHON_VERSION=""
 
52
        fi
 
53
 
 
54
        #
 
55
        # Check for a version of Python >= 2.1.0
 
56
        #
 
57
        AC_MSG_CHECKING([for a version of Python >= 2.1.0])
 
58
        ac_supports_python_ver=`$PYTHON -c "import sys, string; \
 
59
                ver = string.split(sys.version)[[0]]; \
 
60
                print ver >= '2.1.0'"`
 
61
        if test "$ac_supports_python_ver" != "True"; then
 
62
                if test -z "$PYTHON_NOVERSIONCHECK"; then
 
63
                        AC_MSG_RESULT([no])
 
64
                        AC_MSG_FAILURE([
 
65
This version of the AC@&t@_PYTHON_DEVEL macro
 
66
doesn't work properly with versions of Python before
 
67
2.1.0. You may need to re-run configure, setting the
 
68
variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
 
69
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
 
70
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
 
71
to something else than an empty string.
 
72
])
 
73
                else
 
74
                        AC_MSG_RESULT([skip at user request])
 
75
                fi
 
76
        else
 
77
                AC_MSG_RESULT([yes])
 
78
        fi
 
79
 
 
80
        #
 
81
        # if the macro parameter ``version'' is set, honour it
 
82
        #
 
83
        if test -n "$1"; then
 
84
                AC_MSG_CHECKING([for a version of Python >= $1])
 
85
                ac_supports_python_ver=`$PYTHON -c "import sys, string; \
 
86
                        ver = string.split(sys.version)[[0]]; \
 
87
                        print ver >= '$1'"`
 
88
                if test "$ac_supports_python_ver" = "True"; then
 
89
                   AC_MSG_RESULT([yes])
 
90
                else
 
91
                        AC_MSG_RESULT([no])
 
92
                        AC_MSG_ERROR([this package requires Python $1.
 
93
If you have it installed, but it isn't the default Python
 
94
interpreter in your system path, please pass the PYTHON_VERSION
 
95
variable to configure. See ``configure --help'' for reference.
 
96
])
 
97
                        PYTHON_VERSION=""
 
98
                fi
 
99
        fi
 
100
 
 
101
        #
 
102
        # Check if you have distutils, else fail
 
103
        #
 
104
        AC_MSG_CHECKING([for the distutils Python package])
 
105
        ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
 
106
        if test -z "$ac_distutils_result"; then
 
107
                AC_MSG_RESULT([yes])
 
108
        else
 
109
                AC_MSG_RESULT([no])
 
110
                AC_MSG_ERROR([cannot import Python module "distutils".
 
111
Please check your Python installation. The error was:
 
112
$ac_distutils_result])
 
113
                PYTHON_VERSION=""
 
114
        fi
 
115
 
 
116
        #
 
117
        # Check for Python include path
 
118
        #
 
119
        AC_MSG_CHECKING([for Python include path])
 
120
        if test -z "$PYTHON_CPPFLAGS"; then
 
121
                python_path=`$PYTHON -c "import distutils.sysconfig; \
 
122
                        print distutils.sysconfig.get_python_inc();"`
 
123
                if test -n "${python_path}"; then
 
124
                        python_path="-I$python_path"
 
125
                fi
 
126
                PYTHON_CPPFLAGS=$python_path
 
127
        fi
 
128
        AC_MSG_RESULT([$PYTHON_CPPFLAGS])
 
129
        AC_SUBST([PYTHON_CPPFLAGS])
 
130
 
 
131
        #
 
132
        # Check for Python library path
 
133
        #
 
134
        AC_MSG_CHECKING([for Python library path])
 
135
        if test -z "$PYTHON_LDFLAGS"; then
 
136
                # (makes two attempts to ensure we've got a version number
 
137
                # from the interpreter)
 
138
                py_version=`$PYTHON -c "from distutils.sysconfig import *; \
 
139
                        from string import join; \
 
140
                        print join(get_config_vars('VERSION'))"`
 
141
                if test "$py_version" == "[None]"; then
 
142
                        if test -n "$PYTHON_VERSION"; then
 
143
                                py_version=$PYTHON_VERSION
 
144
                        else
 
145
                                py_version=`$PYTHON -c "import sys; \
 
146
                                        print sys.version[[:3]]"`
 
147
                        fi
 
148
                fi
 
149
 
 
150
                PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
 
151
                        from string import join; \
 
152
                        print '-L' + get_python_lib(0,1), \
 
153
                        '-lpython';"`$py_version
 
154
        fi
 
155
        AC_MSG_RESULT([$PYTHON_LDFLAGS])
 
156
        AC_SUBST([PYTHON_LDFLAGS])
 
157
 
 
158
        #
 
159
        # Check for the site packages
 
160
        #
 
161
        AC_MSG_CHECKING([for Python site-packages path])
 
162
        AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
 
163
        if test -z "$PYTHON_SITE_PKG"; then
 
164
                PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
 
165
                        print distutils.sysconfig.get_python_lib(0,0,prefix='${PYTHON_EXEC_PREFIX}');"`
 
166
        fi
 
167
        AC_MSG_RESULT([$PYTHON_SITE_PKG])
 
168
        AC_SUBST([PYTHON_SITE_PKG])
 
169
 
 
170
        #
 
171
        # libraries which must be linked in when embedding
 
172
        #
 
173
        AC_MSG_CHECKING(python extra libraries)
 
174
        if test -z "$PYTHON_EXTRA_LIBS"; then
 
175
           PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
 
176
                conf = distutils.sysconfig.get_config_var; \
 
177
                print conf('LOCALMODLIBS'), conf('LIBS')"`
 
178
        fi
 
179
        AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
 
180
        AC_SUBST(PYTHON_EXTRA_LIBS)
 
181
 
 
182
        #
 
183
        # linking flags needed when embedding
 
184
        #
 
185
        AC_MSG_CHECKING(python extra linking flags)
 
186
        if test -z "$PYTHON_EXTRA_LDFLAGS"; then
 
187
                PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
 
188
                        conf = distutils.sysconfig.get_config_var; \
 
189
                        print conf('LINKFORSHARED')"`
 
190
        fi
 
191
        AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
 
192
        AC_SUBST(PYTHON_EXTRA_LDFLAGS)
 
193
 
 
194
        #
 
195
        # final check to see if everything compiles alright
 
196
        #
 
197
        AC_MSG_CHECKING([consistency of all components of python development environment])
 
198
        AC_LANG_PUSH([C])
 
199
        # save current global flags
 
200
        LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
 
201
        CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
 
202
        AC_TRY_LINK([
 
203
                #include <Python.h>
 
204
        ],[
 
205
                Py_Initialize();
 
206
        ],[pythonexists=yes],[pythonexists=no])
 
207
 
 
208
        AC_MSG_RESULT([$pythonexists])
 
209
 
 
210
        if test ! "$pythonexists" = "yes"; then
 
211
           AC_MSG_ERROR([
 
212
  Could not link test program to Python. Maybe the main Python library has been
 
213
  installed in some non-standard library path. If so, pass it to configure,
 
214
  via the LDFLAGS environment variable.
 
215
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
 
216
  ============================================================================
 
217
   ERROR!
 
218
   You probably have to install the development version of the Python package
 
219
   for your distribution.  The exact name of this package varies among them.
 
220
  ============================================================================
 
221
           ])
 
222
          PYTHON_VERSION=""
 
223
        fi
 
224
        AC_LANG_POP
 
225
        # turn back to default flags
 
226
        CPPFLAGS="$ac_save_CPPFLAGS"
 
227
        LIBS="$ac_save_LIBS"
 
228
 
 
229
        #
 
230
        # all done!
 
231
        #
 
232
])
 
233
 
2
234
dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
3
235
dnl Check if a module containing a given symbol is visible to python.
4
236
AC_DEFUN([AM_CHECK_PYMOD],
5
 
[AC_REQUIRE([AM_PATH_PYTHON])
 
237
[AC_REQUIRE([AC_PYTHON_DEVEL])
6
238
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
7
239
AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
8
240
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
36
268
fi
37
269
])
38
270
 
39
 
dnl a macro to check for ability to create python extensions
40
 
dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
41
 
dnl function also defines PYTHON_INCLUDES
42
 
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
43
 
[AC_REQUIRE([AM_PATH_PYTHON])
44
 
AC_MSG_CHECKING(for headers required to compile python extensions)
45
 
dnl deduce PYTHON_INCLUDES
46
 
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
47
 
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
48
 
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
49
 
if test "$py_prefix" != "$py_exec_prefix"; then
50
 
  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
51
 
fi
52
 
AC_SUBST(PYTHON_INCLUDES)
53
 
dnl check if the headers exist:
54
 
save_CPPFLAGS="$CPPFLAGS"
55
 
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
56
 
AC_TRY_CPP([#include <Python.h>],dnl
57
 
[AC_MSG_RESULT(found)
58
 
$1],dnl
59
 
[AC_MSG_RESULT(not found)
60
 
$2])
61
 
CPPFLAGS="$save_CPPFLAGS"
62
 
])
63
 
 
64
271
dnl
65
272
dnl JH_ADD_CFLAG(FLAG)
66
273
dnl checks whether the C compiler supports the given flag, and if so, adds
82
289
  fi
83
290
  ;;
84
291
esac])
 
292
dnl AM_GCONF_SOURCE_2
 
293
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
 
294
dnl  (i.e. pass to gconftool-2
 
295
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
 
296
dnl  you should install foo.schemas files
 
297
dnl
 
298
 
 
299
AC_DEFUN([AM_GCONF_SOURCE_2],
 
300
[
 
301
  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
 
302
    GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
303
  else
 
304
    GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
 
305
  fi
 
306
 
 
307
  AC_ARG_WITH(gconf-source, 
 
308
  [  --with-gconf-source=sourceaddress      Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
 
309
 
 
310
  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
 
311
  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
 
312
 
 
313
  if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
 
314
    GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
 
315
  fi
 
316
 
 
317
  AC_ARG_WITH(gconf-schema-file-dir, 
 
318
  [  --with-gconf-schema-file-dir=dir        Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
 
319
 
 
320
  AC_SUBST(GCONF_SCHEMA_FILE_DIR)
 
321
  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
 
322
 
 
323
  AC_ARG_ENABLE(schemas-install,
 
324
     [  --disable-schemas-install       Disable the schemas installation],
 
325
     [case ${enableval} in
 
326
       yes|no) ;;
 
327
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
 
328
      esac])
 
329
  AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
 
330
])
 
331
# vala.m4 serial 1 (vala @VERSION@)
 
332
dnl Autoconf scripts for the Vala compiler
 
333
dnl Copyright (C) 2007  Mathias Hasselmann
 
334
dnl
 
335
dnl This library is free software; you can redistribute it and/or
 
336
dnl modify it under the terms of the GNU Lesser General Public
 
337
dnl License as published by the Free Software Foundation; either
 
338
dnl version 2 of the License, or (at your option) any later version.
 
339
 
 
340
dnl This library is distributed in the hope that it will be useful,
 
341
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
 
342
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
343
dnl Lesser General Public License for more details.
 
344
 
 
345
dnl You should have received a copy of the GNU Lesser General Public
 
346
dnl License along with this library; if not, write to the Free Software
 
347
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
348
dnl
 
349
dnl Author:
 
350
dnl     Mathias Hasselmann <mathias.hasselmann@gmx.de>
 
351
dnl --------------------------------------------------------------------------
 
352
 
 
353
dnl VALA_PROG_VALAC([MINIMUM-VERSION])
 
354
dnl
 
355
dnl Check whether the Vala compiler exists in `PATH'. If it is found the
 
356
dnl variable VALAC is set. Optionally a minimum release number of the compiler
 
357
dnl can be requested.
 
358
dnl --------------------------------------------------------------------------
 
359
AC_DEFUN([VALA_PROG_VALAC],[
 
360
  AC_PATH_PROG([VALAC], [valac], [])
 
361
  AC_SUBST(VALAC)
 
362
 
 
363
  if test -z "x${VALAC}"; then
 
364
    AC_MSG_WARN([No Vala compiler found. You will not be able to recompile .vala source files.])
 
365
  elif test -n "x$1"; then
 
366
    AC_REQUIRE([AC_PROG_AWK])
 
367
    AC_MSG_CHECKING([valac is at least version $1])
 
368
 
 
369
    if "${VALAC}" --version | "${AWK}" -v r='$1' 'function vn(s) { if (3 == split(s,v,".")) return (v[1]*1000+v[2])*1000+v[3]; else exit 2; } /^Vala / { exit vn(r) > vn($[2]) }'; then
 
370
      AC_MSG_RESULT([yes])
 
371
    else
 
372
      AC_MSG_RESULT([no])
 
373
      AC_MSG_ERROR([Vala $1 not found.])
 
374
    fi
 
375
  fi
 
376
])
 
377
dnl as-ac-expand.m4 0.2.0                                   -*- autoconf -*-
 
378
dnl autostars m4 macro for expanding directories using configure's prefix
 
379
dnl
 
380
dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
 
381
dnl
 
382
dnl Copying and distribution of this file, with or without modification,
 
383
dnl are permitted in any medium without royalty provided the copyright
 
384
dnl notice and this notice are preserved.
 
385
dnl
 
386
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
 
387
dnl
 
388
dnl example:
 
389
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
 
390
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
 
391
AC_DEFUN([AS_AC_EXPAND],
 
392
[
 
393
  EXP_VAR=[$1]
 
394
  FROM_VAR=[$2]
 
395
 
 
396
  dnl first expand prefix and exec_prefix if necessary
 
397
  prefix_save=$prefix
 
398
  exec_prefix_save=$exec_prefix
 
399
 
 
400
  dnl if no prefix given, then use /usr/local, the default prefix
 
401
  if test "x$prefix" = "xNONE"; then
 
402
    prefix="$ac_default_prefix"
 
403
  fi
 
404
  dnl if no exec_prefix given, then use prefix
 
405
  if test "x$exec_prefix" = "xNONE"; then
 
406
    exec_prefix=$prefix
 
407
  fi
 
408
 
 
409
  full_var="$FROM_VAR"
 
410
  dnl loop until it doesn't change anymore
 
411
  while true; do
 
412
    new_full_var="`eval echo $full_var`"
 
413
    if test "x$new_full_var" = "x$full_var"; then break; fi
 
414
    full_var=$new_full_var
 
415
  done
 
416
 
 
417
  dnl clean up
 
418
  full_var=$new_full_var
 
419
  AC_SUBST([$1], "$full_var")
 
420
 
 
421
  dnl restore prefix and exec_prefix
 
422
  prefix=$prefix_save
 
423
  exec_prefix=$exec_prefix_save
 
424
])
 
425