build-sys: fix PULSE_LOCALEDIR definition
authorTanu Kaskinen <tanuk@iki.fi>
Tue, 29 Sep 2015 08:41:51 +0000 (11:41 +0300)
committerDavid Henningsson <david.henningsson@canonical.com>
Mon, 7 Dec 2015 09:41:37 +0000 (10:41 +0100)
On some systems (at least Arch) DATADIRNAME is not defined. This
caused PULSE_LOCALEDIR to point to a wrong directory. This seemed like
an issue introduced in 7.0, but probably something else was updated in
Arch at the same time, causing DATADIRNAME to become undefined,
because there were no changes between 6.0 and 7.0 that could have
caused this.

After noticing that localedir is a standard variable, my first idea
was to use pulselocaledir='${localedir}' in configure.ac, but Jan
Steffens pointed out that it causes the final PULSE_LOCALEDIR to
become "${prefix}/share/locale", that is, the variables weren't fully
expanded. I then found a FAQ item in Autoconf's manual[1], which
recommends not to define any absolute installation directories in
configure.ac, because the installation directories should be possible
to change when running make. The recommended solution is to define the
constant in AM_CPPFLAGS instead, so that's what this patch does.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Defining-Directories.html

configure.ac
src/Makefile.am

index 91f9ab6..86b28d3 100644 (file)
@@ -108,9 +108,6 @@ AM_GNU_GETTEXT([external])
 GETTEXT_PACKAGE=pulseaudio
 AC_SUBST([GETTEXT_PACKAGE])
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
-
-pulselocaledir='${prefix}/${DATADIRNAME}/locale'
-AX_DEFINE_DIR(PULSE_LOCALEDIR, pulselocaledir, [Gettext locale dir])
 else
 # workaround till an intltool m4 bug is fixed upstream
 # (https://bugs.launchpad.net/intltool/+bug/904647)
index 0c58d37..de975c5 100644 (file)
@@ -46,7 +46,8 @@ AM_CPPFLAGS = \
        -DPA_ALSA_PATHS_DIR=\"$(alsapathsdir)\" \
        -DPA_ALSA_PROFILE_SETS_DIR=\"$(alsaprofilesetsdir)\" \
        -DPA_SRCDIR=\"$(abs_srcdir)\" \
-       -DPA_BUILDDIR=\"$(abs_builddir)\"
+       -DPA_BUILDDIR=\"$(abs_builddir)\" \
+       -DPULSE_LOCALEDIR=\"$(localedir)\"
 AM_CFLAGS = \
        $(PTHREAD_CFLAGS)
 AM_CXXFLAGS = $(AM_CFLAGS)