# gp-gettext-setup.m4 - set up gettext with some checks -*- Autoconf -*- # serial 13 dnl | Increment the above serial number every time you edit this file. dnl | When it finds multiple m4 files with the same name, dnl | aclocal will use the one with the highest serial. dnl dnl #################################################################### dnl GP_GETTEXT_SETUP(...) dnl Gettext setup with e.g. consistency checks for value of DOMAIN. dnl #################################################################### dnl dnl Usage: dnl GP_GETTEXT_SETUP([DOMAIN_LIBGPHOTO2], dnl [libgphoto2-${LIBGPHOTO2_CURRENT_MIN}], dnl [po]) dnl GP_GETTEXT_SETUP([DOMAIN_LIBGPHOTO2_PORT], dnl [libgphoto2_port-${LIBGPHOTO2_PORT_CURRENT_MIN}], dnl [libgphoto2_port/po]) dnl dnl with the corresponding top level Makefile.am containing dnl dnl @GP_GETTEXT_SETUP_MK@ dnl dnl # Dummy target to force Automake to make the "all" target depend on it dnl all-local: dnl @: dnl dnl # Dummy target to force Automake to make the "distclean" target depend on it dnl distclean-local: dnl @: dnl dnl #################################################################### dnl AC_DEFUN([GP_GETTEXT_SETUP], [dnl AC_REQUIRE([AC_PROG_GREP])dnl AC_REQUIRE([GP_GETTEXT_SETUP_INIT])dnl dnl AC_MSG_CHECKING([translation text domain symbol]) AC_MSG_RESULT([$1]) AC_MSG_CHECKING([translation text domain value]) AC_MSG_RESULT([$2]) AC_MSG_CHECKING([translation subdirectory]) AC_MSG_RESULT([$3]) dnl dnl The text domain can be evaluated as a shell variable, no need for dnl recursive make variable evaluation, so we can put the text domain dnl into the include file and do not need to define it from a make dnl rule on the compiler command line. AC_DEFINE_UNQUOTED([$1], ["$2"], [text domain for string translations]) dnl AM_CPPFLAGS="$AM_CPPFLAGS -D$1=\\\""'$2'"\\\"" AC_SUBST([$1], [$2]) dnl dnl dnl The following check will have "make all" print something like dnl DOMAIN = libgphoto2-6 dnl if the consistency check has been successful, and have "make all" abort dnl Error: Inconsistent values for GETTEXT_PACKAGE_LIBGPHOTO2 and po/Makevars DOMAIN. dnl if the consistency check has failed. dnl cat >>${GP_GETTEXT_SETUP_MK} <${GP_GETTEXT_SETUP_MK} <