~ubuntu-branches/ubuntu/oneiric/rhythmbox/oneiric

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-06-26 19:06:10 UTC
  • mto: (2.1.1 lenny) (1.1.37 upstream)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20060626190610-08x8lgvvfs0gr619
Tags: upstream-0.9.5
ImportĀ upstreamĀ versionĀ 0.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
900
900
 
901
901
 
902
902
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
903
 
# serial 2 IT_PROG_INTLTOOL
 
903
# serial 35 IT_PROG_INTLTOOL
904
904
AC_DEFUN([IT_PROG_INTLTOOL],
905
 
[
 
905
[AC_PREREQ([2.50])dnl
 
906
 
 
907
case "$am__api_version" in
 
908
    1.[01234])
 
909
        AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
 
910
    ;;
 
911
    *)
 
912
    ;;
 
913
esac
906
914
 
907
915
if test -n "$1"; then
908
916
    AC_MSG_CHECKING(for intltool >= $1)
909
917
 
910
 
    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
911
 
    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }'  < ${ac_aux_dir}/intltool-update.in`
912
 
    changequote({{,}})
913
 
    INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in`
914
 
    changequote([,])
915
 
 
916
 
    if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
917
 
        AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
918
 
    else
919
 
        AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool $1 or later.])
920
 
        exit 1
921
 
    fi
 
918
    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
 
919
    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
 
920
    [INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in`
 
921
    ]
 
922
    AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
 
923
    test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
 
924
        AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
922
925
fi
923
926
 
924
927
  INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
938
941
    INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
939
942
  INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
940
943
    INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
944
    INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
941
945
 
942
946
AC_SUBST(INTLTOOL_DESKTOP_RULE)
943
947
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
956
960
AC_SUBST(INTLTOOL_CAVES_RULE)
957
961
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
958
962
AC_SUBST(INTLTOOL_THEME_RULE)
 
963
AC_SUBST(INTLTOOL_SERVICE_RULE)
959
964
 
960
965
# Use the tools built into the package, not the ones that are installed.
961
 
 
962
 
INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
963
 
INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
964
 
INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
965
 
 
966
 
AC_SUBST(INTLTOOL_EXTRACT)
967
 
AC_SUBST(INTLTOOL_MERGE)
968
 
AC_SUBST(INTLTOOL_UPDATE)
 
966
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
 
967
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
 
968
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
969
969
 
970
970
AC_PATH_PROG(INTLTOOL_PERL, perl)
971
971
if test -z "$INTLTOOL_PERL"; then
988
988
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
989
989
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
990
990
 
991
 
# Remove file type tags (using []) from po/POTFILES.
992
 
 
993
 
ifdef([AC_DIVERSION_ICMDS],[
994
 
  AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
995
 
     [mv -f po/POTFILES po/POTFILES.tmp
996
 
      sed -e '/[[]encoding.*]/d' -e 's/[[].*] *//' < po/POTFILES.tmp > po/POTFILES
997
 
      rm -f po/POTFILES.tmp
998
 
     ]dnl
999
 
  AC_DIVERT_POP()
1000
 
],[
1001
 
  ifdef([AC_CONFIG_COMMANDS_PRE],[
1002
 
    AC_CONFIG_COMMANDS_PRE([
1003
 
       [mv -f po/POTFILES po/POTFILES.tmp
1004
 
        sed -e '/[[]encoding.*]/d' -e 's/[[].*] *//' < po/POTFILES.tmp > po/POTFILES
1005
 
        rm -f po/POTFILES.tmp
1006
 
       ]dnl
1007
 
    ])
1008
 
  ])
1009
 
])
1010
 
 
1011
 
# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
 
991
# Substitute ALL_LINGUAS so we can use it in po/Makefile
 
992
AC_SUBST(ALL_LINGUAS)
 
993
    
 
994
IT_PO_SUBDIR([po])
 
995
 
 
996
dnl The following is very similar to
 
997
dnl
 
998
dnl     AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
 
999
dnl
 
1000
dnl with the following slight differences:
 
1001
dnl  - the *.in files are in ac_aux_dir,
 
1002
dnl  - if the file haven't changed upon reconfigure, it's not touched,
 
1003
dnl  - the evaluation of the third parameter enables a hack which computes
 
1004
dnl    the actual value of $libdir,
 
1005
dnl  - the user sees "executing intltool commands", instead of
 
1006
dnl    "creating intltool-extract" and such.
 
1007
dnl
 
1008
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
 
1009
dnl a reason for it.
1012
1010
 
1013
1011
AC_CONFIG_COMMANDS([intltool], [
1014
1012
 
1015
 
intltool_edit="-e 's#@INTLTOOL_EXTRACT@#`pwd`/intltool-extract#g' \
1016
 
               -e 's#@INTLTOOL_ICONV@#${INTLTOOL_ICONV}#g' \
1017
 
               -e 's#@INTLTOOL_MSGFMT@#${INTLTOOL_MSGFMT}#g' \
1018
 
               -e 's#@INTLTOOL_MSGMERGE@#${INTLTOOL_MSGMERGE}#g' \
1019
 
               -e 's#@INTLTOOL_XGETTEXT@#${INTLTOOL_XGETTEXT}#g' \
1020
 
               -e 's#@INTLTOOL_PERL@#${INTLTOOL_PERL}#g'"
1021
 
 
1022
 
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-extract.in \
1023
 
  > intltool-extract.out
1024
 
if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
1025
 
  rm -f intltool-extract.out
1026
 
else
1027
 
  mv -f intltool-extract.out intltool-extract
1028
 
fi
1029
 
chmod ugo+x intltool-extract
1030
 
chmod u+w intltool-extract
1031
 
 
1032
 
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-merge.in \
1033
 
  > intltool-merge.out
1034
 
if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
1035
 
  rm -f intltool-merge.out
1036
 
else
1037
 
  mv -f intltool-merge.out intltool-merge
1038
 
fi
1039
 
chmod ugo+x intltool-merge
1040
 
chmod u+w intltool-merge
1041
 
 
1042
 
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-update.in \
1043
 
  > intltool-update.out
1044
 
if cmp -s intltool-update intltool-update.out 2>/dev/null; then
1045
 
  rm -f intltool-update.out
1046
 
else
1047
 
  mv -f intltool-update.out intltool-update
1048
 
fi
1049
 
chmod ugo+x intltool-update
1050
 
chmod u+w intltool-update
1051
 
 
1052
 
], INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir=${ac_aux_dir}
1053
 
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' ICONV='${INTLTOOL_ICONV}'
1054
 
MSGFMT='${INTLTOOL_MSGFMT}' MSGMERGE='${INTLTOOL_MSGMERGE}'
1055
 
XGETTEXT='${INTLTOOL_XGETTEXT}')
1056
 
 
1057
 
])
 
1013
for file in intltool-extract intltool-merge intltool-update; do
 
1014
  sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
 
1015
      -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
 
1016
      -e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
 
1017
      -e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
 
1018
      -e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
 
1019
      -e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
 
1020
      -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
 
1021
        < ${ac_aux_dir}/${file}.in > ${file}.out
 
1022
  if cmp -s ${file} ${file}.out 2>/dev/null; then
 
1023
    rm -f ${file}.out
 
1024
  else
 
1025
    mv -f ${file}.out ${file}
 
1026
  fi
 
1027
  chmod ugo+x ${file}
 
1028
  chmod u+w ${file}
 
1029
done
 
1030
 
 
1031
],
 
1032
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
 
1033
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" 
 
1034
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
 
1035
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
 
1036
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
 
1037
 
 
1038
])
 
1039
 
 
1040
 
 
1041
# IT_PO_SUBDIR(DIRNAME)
 
1042
# ---------------------
 
1043
# All po subdirs have to be declared with this macro; the subdir "po" is
 
1044
# declared by IT_PROG_INTLTOOL.
 
1045
#
 
1046
AC_DEFUN([IT_PO_SUBDIR],
 
1047
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
 
1048
dnl
 
1049
dnl The following CONFIG_COMMANDS should be exetuted at the very end
 
1050
dnl of config.status.
 
1051
AC_CONFIG_COMMANDS_PRE([
 
1052
  AC_CONFIG_COMMANDS([$1/stamp-it], [
 
1053
    rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
 
1054
    >"$1/stamp-it.tmp"
 
1055
    [sed '/^#/d
 
1056
         s/^[[].*] *//
 
1057
         /^[    ]*$/d
 
1058
        '"s|^|  $ac_top_srcdir/|" \
 
1059
      "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
 
1060
    ]
 
1061
    if test ! -f "$1/Makefile"; then
 
1062
      AC_MSG_ERROR([$1/Makefile is not ready.])
 
1063
    fi
 
1064
    mv "$1/Makefile" "$1/Makefile.tmp"
 
1065
    [sed '/^POTFILES =/,/[^\\]$/ {
 
1066
                /^POTFILES =/!d
 
1067
                r $1/POTFILES
 
1068
          }
 
1069
         ' "$1/Makefile.tmp" >"$1/Makefile"]
 
1070
    rm -f "$1/Makefile.tmp"
 
1071
    mv "$1/stamp-it.tmp" "$1/stamp-it"
 
1072
  ])
 
1073
])dnl
 
1074
])
 
1075
 
1058
1076
 
1059
1077
# deprecated macros
1060
 
AC_DEFUN([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL($@)])
 
1078
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
 
1079
# A hint is needed for aclocal from Automake <= 1.9.4:
 
1080
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1061
1081
 
1062
1082
 
1063
1083
# isc-posix.m4 serial 2 (gettext-0.11.2)
8181
8201
  AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
8182
8202
])
8183
8203
 
 
8204
dnl GNOME_DOC_INIT([MINIMUM-VERSION])
 
8205
 
 
8206
AC_DEFUN([GNOME_DOC_INIT],
 
8207
[
 
8208
dnl Only apply the version check if we're not configuring ourselves!
 
8209
if test "x$PACKAGE" != "xgnome-doc-utils"; then
 
8210
  GDU_REQUIRED_VERSION=0.3.2
 
8211
  if test -n "$1"; then
 
8212
    GDU_REQUIRED_VERSION=$1
 
8213
  fi
 
8214
 
 
8215
  PKG_CHECK_MODULES([GDU_MODULE_VERSION_CHECK],[gnome-doc-utils >= $GDU_REQUIRED_VERSION])
 
8216
fi
 
8217
 
 
8218
AC_ARG_WITH([help-dir],
 
8219
  AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),,
 
8220
  [with_help_dir='${datadir}/gnome/help'])
 
8221
HELP_DIR="$with_help_dir"
 
8222
AC_SUBST(HELP_DIR)
 
8223
 
 
8224
AC_ARG_WITH([omf-dir],
 
8225
  AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),,
 
8226
  [with_omf_dir='${datadir}/omf'])
 
8227
OMF_DIR="$with_omf_dir"
 
8228
AC_SUBST(OMF_DIR)
 
8229
 
 
8230
AC_ARG_WITH([help-formats],
 
8231
  AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),,
 
8232
  [with_help_formats=''])
 
8233
DOC_USER_FORMATS="$with_help_formats"
 
8234
AC_SUBST(DOC_USER_FORMATS)
 
8235
 
 
8236
AC_ARG_ENABLE([scrollkeeper],
 
8237
        [AC_HELP_STRING([--disable-scrollkeeper],
 
8238
                        [do not make updates to the scrollkeeper database])],,
 
8239
        enable_scrollkeeper=yes)
 
8240
AM_CONDITIONAL(ENABLE_SK, test "x$enable_scrollkeeper" = "xyes")
 
8241
 
 
8242
AC_OUTPUT_COMMANDS([
 
8243
gdumk=`pkg-config --variable datadir gnome-doc-utils`/gnome-doc-utils/gnome-doc-utils.make
 
8244
if test -f $srcdir/gnome-doc-utils.m4; then
 
8245
  if ! cmp -s $srcdir/gnome-doc-utils.make gnome-doc-utils.make; then
 
8246
    cp $srcdir/gnome-doc-utils.make gnome-doc-utils.make
 
8247
  fi
 
8248
else
 
8249
  if ! cmp -s $gdumk gnome-doc-utils.make; then
 
8250
    cp $gdumk gnome-doc-utils.make
 
8251
  fi
 
8252
fi
 
8253
if ! grep 'gnome-doc-utils\.make' $ac_top_srcdir/Makefile.am >/dev/null; then
 
8254
  echo gnome-doc-utils.make should be added to EXTRA_DIST in Makefile.am
 
8255
fi
 
8256
])
 
8257
])
 
8258
 
 
8259
 
 
8260
# Copyright 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
 
8261
 
 
8262
# This program is free software; you can redistribute it and/or modify
 
8263
# it under the terms of the GNU General Public License as published by
 
8264
# the Free Software Foundation; either version 2, or (at your option)
 
8265
# any later version.
 
8266
 
 
8267
# This program is distributed in the hope that it will be useful,
 
8268
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
8269
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
8270
# GNU General Public License for more details.
 
8271
 
 
8272
# You should have received a copy of the GNU General Public License
 
8273
# along with this program; if not, write to the Free Software
 
8274
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
8275
# 02111-1307, USA.
 
8276
 
 
8277
# AM_PATH_PYTHON([MINIMUM-VERSION])
 
8278
 
 
8279
# Adds support for distributing Python modules and packages.  To
 
8280
# install modules, copy them to $(pythondir), using the python_PYTHON
 
8281
# automake variable.  To install a package with the same name as the
 
8282
# automake package, install to $(pkgpythondir), or use the
 
8283
# pkgpython_PYTHON automake variable.
 
8284
 
 
8285
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
 
8286
# locations to install python extension modules (shared libraries).
 
8287
# Another macro is required to find the appropriate flags to compile
 
8288
# extension modules.
 
8289
 
 
8290
# If your package is configured with a different prefix to python,
 
8291
# users will have to add the install directory to the PYTHONPATH
 
8292
# environment variable, or create a .pth file (see the python
 
8293
# documentation for details).
 
8294
 
 
8295
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
 
8296
# cause an error if the version of python installed on the system
 
8297
# doesn't meet the requirement.  MINIMUM-VERSION should consist of
 
8298
# numbers and dots only.
 
8299
 
 
8300
AC_DEFUN([AM_PATH_PYTHON],
 
8301
 [
 
8302
  dnl Find a Python interpreter.  Python versions prior to 1.5 are not
 
8303
  dnl supported because the default installation locations changed from
 
8304
  dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
 
8305
  dnl in 1.5.
 
8306
  m4_define([_AM_PYTHON_INTERPRETER_LIST],
 
8307
            [python python2 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5])
 
8308
 
 
8309
  m4_if([$1],[],[
 
8310
    dnl No version check is needed.
 
8311
    # Find any Python interpreter.
 
8312
    AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST)
 
8313
    am_display_PYTHON=python
 
8314
  ], [
 
8315
    dnl A version check is needed.
 
8316
    if test -n "$PYTHON"; then
 
8317
      # If the user set $PYTHON, use it and don't search something else.
 
8318
      AC_MSG_CHECKING([whether $PYTHON version >= $1])
 
8319
      AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
 
8320
                              [AC_MSG_RESULT(yes)],
 
8321
                              [AC_MSG_ERROR(too old)])
 
8322
    else
 
8323
      # Otherwise, try each interpreter until we find one that satisfies
 
8324
      # VERSION.
 
8325
      AC_CACHE_CHECK([for a Python interpreter with version >= $1],
 
8326
        [am_cv_pathless_PYTHON],[
 
8327
        for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST : ; do
 
8328
          if test "$am_cv_pathless_PYTHON" = : ; then
 
8329
            AC_MSG_ERROR([no suitable Python interpreter found])
 
8330
          fi
 
8331
          AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
 
8332
        done])
 
8333
      # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
 
8334
      AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
 
8335
      am_display_PYTHON=$am_cv_pathless_PYTHON
 
8336
    fi
 
8337
  ])
 
8338
 
 
8339
  dnl Query Python for its version number.  Getting [:3] seems to be
 
8340
  dnl the best way to do this; it's what "site.py" does in the standard
 
8341
  dnl library.
 
8342
 
 
8343
  AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
 
8344
    [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
 
8345
  AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
 
8346
 
 
8347
  dnl Use the values of $prefix and $exec_prefix for the corresponding
 
8348
  dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
 
8349
  dnl distinct variables so they can be overridden if need be.  However,
 
8350
  dnl general consensus is that you shouldn't need this ability.
 
8351
 
 
8352
  AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
 
8353
  AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
 
8354
 
 
8355
  dnl At times (like when building shared libraries) you may want
 
8356
  dnl to know which OS platform Python thinks this is.
 
8357
 
 
8358
  AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
 
8359
    [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
 
8360
  AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
 
8361
 
 
8362
 
 
8363
  dnl Set up 4 directories:
 
8364
 
 
8365
  dnl pythondir -- where to install python scripts.  This is the
 
8366
  dnl   site-packages directory, not the python standard library
 
8367
  dnl   directory like in previous automake betas.  This behavior
 
8368
  dnl   is more consistent with lispdir.m4 for example.
 
8369
  dnl Query distutils for this directory.  distutils does not exist in
 
8370
  dnl Python 1.5, so we fall back to the hardcoded directory if it
 
8371
  dnl doesn't work.
 
8372
  AC_CACHE_CHECK([for $am_display_PYTHON script directory],
 
8373
    [am_cv_python_pythondir],
 
8374
    [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
 
8375
     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
 
8376
  AC_SUBST([pythondir], [$am_cv_python_pythondir])
 
8377
 
 
8378
  dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
 
8379
  dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
 
8380
  dnl   more consistent with the rest of automake.
 
8381
 
 
8382
  AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
 
8383
 
 
8384
  dnl pyexecdir -- directory for installing python extension modules
 
8385
  dnl   (shared libraries)
 
8386
  dnl Query distutils for this directory.  distutils does not exist in
 
8387
  dnl Python 1.5, so we fall back to the hardcoded directory if it
 
8388
  dnl doesn't work.
 
8389
  AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
 
8390
    [am_cv_python_pyexecdir],
 
8391
    [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
 
8392
     echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
 
8393
  AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
 
8394
 
 
8395
  dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
 
8396
 
 
8397
  AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
 
8398
])
 
8399
 
 
8400
 
 
8401
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 
8402
# ---------------------------------------------------------------------------
 
8403
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
 
8404
# Run ACTION-IF-FALSE otherwise.
 
8405
# This test uses sys.hexversion instead of the string equivalent (first
 
8406
# word of sys.version), in order to cope with versions such as 2.2c1.
 
8407
# hexversion has been introduced in Python 1.5.2; it's probably not
 
8408
# worth to support older versions (1.5.1 was released on October 31, 1998).
 
8409
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
 
8410
 [prog="import sys, string
 
8411
# split strings by '.' and convert to numeric.  Append some zeros
 
8412
# because we need at least 4 digits for the hex conversion.
 
8413
minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
 
8414
minverhex = 0
 
8415
for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
 
8416
sys.exit(sys.hexversion < minverhex)"
 
8417
  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
 
8418
 
 
8419
# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
 
8420
 
 
8421
# This program is free software; you can redistribute it and/or modify
 
8422
# it under the terms of the GNU General Public License as published by
 
8423
# the Free Software Foundation; either version 2, or (at your option)
 
8424
# any later version.
 
8425
 
 
8426
# This program is distributed in the hope that it will be useful,
 
8427
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
8428
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
8429
# GNU General Public License for more details.
 
8430
 
 
8431
# You should have received a copy of the GNU General Public License
 
8432
# along with this program; if not, write to the Free Software
 
8433
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
8434
# 02111-1307, USA.
 
8435
 
 
8436
# AM_RUN_LOG(COMMAND)
 
8437
# -------------------
 
8438
# Run COMMAND, save the exit status in ac_status, and log it.
 
8439
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
 
8440
AC_DEFUN([AM_RUN_LOG],
 
8441
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
 
8442
   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
 
8443
   ac_status=$?
 
8444
   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
 
8445
   (exit $ac_status); }])
 
8446
 
 
8447
dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 
8448
dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS
 
8449
dnl
 
8450
 
 
8451
AC_DEFUN([AM_PATH_CHECK],
 
8452
[
 
8453
  AC_ARG_WITH([check],
 
8454
  [  --with-check=PATH       prefix where check is installed [default=auto]])
 
8455
 
 
8456
  min_check_version=ifelse([$1], ,0.8.2,$1)
 
8457
 
 
8458
  AC_MSG_CHECKING(for check - version >= $min_check_version)
 
8459
 
 
8460
  if test x$with_check = xno; then
 
8461
    AC_MSG_RESULT(disabled)
 
8462
    ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3])
 
8463
  else
 
8464
    if test "x$with_check" != x; then
 
8465
      CHECK_CFLAGS="-I$with_check/include"
 
8466
      CHECK_LIBS="-L$with_check/lib -lcheck"
 
8467
    else
 
8468
      CHECK_CFLAGS=""
 
8469
      CHECK_LIBS="-lcheck"
 
8470
    fi
 
8471
 
 
8472
    ac_save_CFLAGS="$CFLAGS"
 
8473
    ac_save_LIBS="$LIBS"
 
8474
 
 
8475
    CFLAGS="$CFLAGS $CHECK_CFLAGS"
 
8476
    LIBS="$CHECK_LIBS $LIBS"
 
8477
 
 
8478
    rm -f conf.check-test
 
8479
    AC_TRY_RUN([
 
8480
#include <stdio.h>
 
8481
#include <stdlib.h>
 
8482
 
 
8483
#include <check.h>
 
8484
 
 
8485
int main ()
 
8486
{
 
8487
  int major, minor, micro;
 
8488
  char *tmp_version;
 
8489
 
 
8490
  system ("touch conf.check-test");
 
8491
 
 
8492
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
8493
  tmp_version = strdup("$min_check_version");
 
8494
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
8495
     printf("%s, bad version string\n", "$min_check_version");
 
8496
     return 1;
 
8497
   }
 
8498
    
 
8499
  if ((CHECK_MAJOR_VERSION != check_major_version) ||
 
8500
      (CHECK_MINOR_VERSION != check_minor_version) ||
 
8501
      (CHECK_MICRO_VERSION != check_micro_version))
 
8502
    {
 
8503
      printf("\n*** The check header file (version %d.%d.%d) does not match\n",
 
8504
             CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION);
 
8505
      printf("*** the check library (version %d.%d.%d).\n",
 
8506
             check_major_version, check_minor_version, check_micro_version);
 
8507
      return 1;
 
8508
    }
 
8509
 
 
8510
  if ((check_major_version > major) ||
 
8511
      ((check_major_version == major) && (check_minor_version > minor)) ||
 
8512
      ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro)))
 
8513
    {
 
8514
      return 0;
 
8515
    }
 
8516
  else
 
8517
    {
 
8518
      printf("\n*** An old version of check (%d.%d.%d) was found.\n",
 
8519
             check_major_version, check_minor_version, check_micro_version);
 
8520
      printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro);
 
8521
      printf("***\n"); 
 
8522
      printf("*** If you have already installed a sufficiently new version, this error\n");
 
8523
      printf("*** probably means that the wrong copy of the check library and header\n");
 
8524
      printf("*** file is being found. Rerun configure with the --with-check=PATH option\n");
 
8525
      printf("*** to specify the prefix where the correct version was installed.\n");
 
8526
    }
 
8527
 
 
8528
  return 1;
 
8529
}
 
8530
],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
8531
 
 
8532
    CFLAGS="$ac_save_CFLAGS"
 
8533
    LIBS="$ac_save_LIBS"
 
8534
 
 
8535
    if test "x$no_check" = x ; then
 
8536
      AC_MSG_RESULT(yes)
 
8537
      ifelse([$2], , :, [$2])
 
8538
    else
 
8539
      AC_MSG_RESULT(no)
 
8540
      if test -f conf.check-test ; then
 
8541
        :
 
8542
      else
 
8543
        echo "*** Could not run check test program, checking why..."
 
8544
        CFLAGS="$CFLAGS $CHECK_CFLAGS"
 
8545
        LIBS="$CHECK_LIBS $LIBS"
 
8546
        AC_TRY_LINK([
 
8547
#include <stdio.h>
 
8548
#include <stdlib.h>
 
8549
 
 
8550
#include <check.h>
 
8551
], ,  [ echo "*** The test program compiled, but did not run. This usually means"
 
8552
        echo "*** that the run-time linker is not finding check. You'll need to set your"
 
8553
        echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
8554
        echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
8555
        echo "*** is required on your system"
 
8556
        echo "***"
 
8557
        echo "*** If you have an old version installed, it is best to remove it, although"
 
8558
        echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
 
8559
      [ echo "*** The test program failed to compile or link. See the file config.log for"
 
8560
        echo "*** the exact error that occured." ])
 
8561
      
 
8562
        CFLAGS="$ac_save_CFLAGS"
 
8563
        LIBS="$ac_save_LIBS"
 
8564
      fi
 
8565
 
 
8566
      CHECK_CFLAGS=""
 
8567
      CHECK_LIBS=""
 
8568
 
 
8569
      rm -f conf.check-test
 
8570
      ifelse([$3], , AC_MSG_ERROR([check not found]), [$3])
 
8571
    fi
 
8572
 
 
8573
    AC_SUBST(CHECK_CFLAGS)
 
8574
    AC_SUBST(CHECK_LIBS)
 
8575
 
 
8576
    rm -f conf.check-test
 
8577
 
 
8578
  fi
 
8579
])
 
8580