Explorar o código

build: Check for needed programs when configuring for distribution

When building a distribution tarball, the full gettext suite is required
because the *.gmo files are shipped in there. A lex program is also
required because the tarball ships the pre-generated *.c files.

Reported-by: Cyril Brulebois <kibi@debian.org>
Guillem Jover %!s(int64=14) %!d(string=hai) anos
pai
achega
78e3a07f7e
Modificáronse 2 ficheiros con 12 adicións e 0 borrados
  1. 3 0
      configure.ac
  2. 9 0
      m4/dpkg-build.m4

+ 3 - 0
configure.ac

@@ -17,6 +17,8 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
 
 
 AM_GNU_GETTEXT_VERSION([0.18])
 AM_GNU_GETTEXT_VERSION([0.18])
 AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT([external])
+DPKG_DIST_CHECK([test "$GMSGFMT" = ":" && test "$USE_NLS" = "yes"],
+                [gettext required when NLS support enabled])
 
 
 # Allow compilation without optional programs
 # Allow compilation without optional programs
 DPKG_WITH_PROG([dselect])
 DPKG_WITH_PROG([dselect])
@@ -34,6 +36,7 @@ DPKG_WITH_DIR([logdir], [${localstatedir}/log],
 AC_PROG_CC
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_CXX
 AC_PROG_LEX
 AC_PROG_LEX
+DPKG_DIST_CHECK([test "$LEX" = ":"], [lex program required])
 AC_PROG_RANLIB
 AC_PROG_RANLIB
 AC_CHECK_PROGS([DOXYGEN], [doxygen])
 AC_CHECK_PROGS([DOXYGEN], [doxygen])
 AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])
 AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])

+ 9 - 0
m4/dpkg-build.m4

@@ -31,3 +31,12 @@ AC_DEFUN([DPKG_WITH_DIR], [
   )
   )
   AC_SUBST([$1])
   AC_SUBST([$1])
 ])# DPKG_WITH_DIR
 ])# DPKG_WITH_DIR
+
+# DPKG_DIST_CHECK(COND, ERROR)
+# ---------------
+# Check if the condition is fulfilled when preparing a distribution tarball.
+AC_DEFUN([DPKG_DIST_CHECK], [
+  AS_IF([test ! -f $srcdir/.dist-version && $1], [
+    AC_ERROR([not building from distributed tarball, $2])
+  ])
+])# DPKG_DIST_CHECK