~ubuntu-branches/debian/squeeze/intltool/squeeze

« back to all changes in this revision

Viewing changes to intltool.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2008-06-04 08:33:24 UTC
  • mfrom: (1.3.1 upstream) (4.1.16 hardy)
  • Revision ID: james.westby@ubuntu.com-20080604083324-3ze9v7vq1u97wujt
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
## the same distribution terms that you use for the rest of that program.
24
24
 
25
25
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
26
 
# serial 35 IT_PROG_INTLTOOL
 
26
# serial 40 IT_PROG_INTLTOOL
27
27
AC_DEFUN([IT_PROG_INTLTOOL],
28
28
[AC_PREREQ([2.50])dnl
29
29
 
36
36
esac
37
37
 
38
38
if test -n "$1"; then
39
 
    AC_MSG_CHECKING(for intltool >= $1)
 
39
    AC_MSG_CHECKING([for intltool >= $1])
40
40
 
41
41
    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
42
 
    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
43
 
    [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`
 
42
    INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
 
43
    [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
44
44
    ]
45
45
    AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
46
46
    test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
47
47
        AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
48
48
fi
49
49
 
 
50
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
 
51
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
 
52
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
 
53
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
 
54
    AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
 
55
fi
 
56
 
50
57
  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 $< [$]@' 
51
58
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.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 $< [$]@' 
52
59
     INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
65
72
  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 $< [$]@' 
66
73
    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 $< [$]@' 
67
74
    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 $< [$]@'
 
75
   INTLTOOL_POLICY_RULE='%.policy:    %.policy.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
68
76
 
69
77
AC_SUBST(INTLTOOL_DESKTOP_RULE)
70
78
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
84
92
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
85
93
AC_SUBST(INTLTOOL_THEME_RULE)
86
94
AC_SUBST(INTLTOOL_SERVICE_RULE)
87
 
 
88
 
# Use the tools built into the package, not the ones that are installed.
89
 
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
90
 
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
91
 
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
92
 
 
93
 
AC_PATH_PROG(INTLTOOL_PERL, perl)
 
95
AC_SUBST(INTLTOOL_POLICY_RULE)
 
96
 
 
97
# Check the gettext tools to make sure they are GNU
 
98
AC_PATH_PROG(XGETTEXT, xgettext)
 
99
AC_PATH_PROG(MSGMERGE, msgmerge)
 
100
AC_PATH_PROG(MSGFMT, msgfmt)
 
101
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
 
102
    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
 
103
fi
 
104
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
 
105
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
 
106
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
 
107
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
 
108
    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
 
109
fi
 
110
 
 
111
AC_PATH_PROG(INTLTOOL_PERL, [perl])
94
112
if test -z "$INTLTOOL_PERL"; then
95
113
   AC_MSG_ERROR([perl not found; required for intltool])
96
114
fi
106
124
   fi
107
125
fi
108
126
 
109
 
AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv)
110
 
AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
111
 
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
112
 
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
113
 
 
114
127
# Substitute ALL_LINGUAS so we can use it in po/Makefile
115
128
AC_SUBST(ALL_LINGUAS)
116
 
    
 
129
 
 
130
# Set DATADIRNAME correctly if it is not set yet
 
131
# (copied from glib-gettext.m4)
 
132
if test -z "$DATADIRNAME"; then
 
133
  AC_LINK_IFELSE(
 
134
    [AC_LANG_PROGRAM([[]],
 
135
                     [[extern int _nl_msg_cat_cntr;
 
136
                       return _nl_msg_cat_cntr]])],
 
137
    [DATADIRNAME=share],
 
138
    [case $host in
 
139
    *-*-solaris*)
 
140
    dnl On Solaris, if bind_textdomain_codeset is in libc,
 
141
    dnl GNU format message catalog is always supported,
 
142
    dnl since both are added to the libc all together.
 
143
    dnl Hence, we'd like to go with DATADIRNAME=share
 
144
    dnl in this case.
 
145
    AC_CHECK_FUNC(bind_textdomain_codeset,
 
146
      [DATADIRNAME=share], [DATADIRNAME=lib])
 
147
    ;;
 
148
    *)
 
149
    [DATADIRNAME=lib]
 
150
    ;;
 
151
    esac])
 
152
fi
 
153
AC_SUBST(DATADIRNAME)
 
154
 
117
155
IT_PO_SUBDIR([po])
118
156
 
119
 
dnl The following is very similar to
120
 
dnl
121
 
dnl     AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
122
 
dnl
123
 
dnl with the following slight differences:
124
 
dnl  - the *.in files are in ac_aux_dir,
125
 
dnl  - if the file haven't changed upon reconfigure, it's not touched,
126
 
dnl  - the evaluation of the third parameter enables a hack which computes
127
 
dnl    the actual value of $libdir,
128
 
dnl  - the user sees "executing intltool commands", instead of
129
 
dnl    "creating intltool-extract" and such.
130
 
dnl
131
 
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
132
 
dnl a reason for it.
133
 
 
134
 
AC_CONFIG_COMMANDS([intltool], [
135
 
 
136
 
for file in intltool-extract intltool-merge intltool-update; do
137
 
  sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
138
 
      -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
139
 
      -e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
140
 
      -e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
141
 
      -e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
142
 
      -e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
143
 
      -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
144
 
        < ${ac_aux_dir}/${file}.in > ${file}.out
145
 
  if cmp -s ${file} ${file}.out 2>/dev/null; then
146
 
    rm -f ${file}.out
147
 
  else
148
 
    mv -f ${file}.out ${file}
149
 
  fi
150
 
  chmod ugo+x ${file}
151
 
  chmod u+w ${file}
152
 
done
153
 
 
154
 
],
155
 
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
156
 
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" 
157
 
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
158
 
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
159
 
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
160
 
 
161
157
])
162
158
 
163
159