From 2c81ed67896a7d3522c4ccdaf09e832491efd589 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 20 Sep 2009 14:04:28 -0700 Subject: [PATCH] Fix "make check" with --enable-relocatable. When --enable-relocatable was passed to "configure", "make check" failed while building datasheet-test: tests/data/datasheet-test.c: In function 'main': tests/data/datasheet-test.c:880: error: 'INSTALLDIR' undeclared (first use in this function) Line 880 of that file is: set_program_name (argv[0]); which is a little mysterious until one realizes that --enable-relocatable defines set_program_name() as a macro that expands to a value that includes INSTALLDIR. So this commit fixes the problem by making sure that INSTALLDIR is defined as part of CPPFLAGS for all compiles. --- Makefile.am | 6 +++++- src/ui/gui/automake.mk | 5 +---- src/ui/terminal/automake.mk | 2 +- tests/automake.mk | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 507503f0..4f9bc660 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,11 @@ SUBDIRS = gl DISTCLEANFILES = ./po/stamp-po xconfigure BUILT_SOURCES = -AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_builddir)/gl +AM_CPPFLAGS = \ + -I$(top_srcdir)/gl \ + -I$(top_builddir)/gl \ + -DINSTALLDIR=\"$(bindir)\" \ + -DDOCDIR=\"$(docdir)\" AM_CFLAGS= diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 110ef43f..9b938cf8 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -4,10 +4,7 @@ include $(top_srcdir)/src/ui/gui/sheet/automake.mk bin_PROGRAMS += src/ui/gui/psppire -src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) -Wall \ - -DINSTALLDIR=\"$(bindir)\" \ - -DDOCDIR=\"$(docdir)\" \ - -DGDK_MULTIHEAD_SAFE=1 +src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 src_ui_gui_psppire_LDFLAGS = \ diff --git a/src/ui/terminal/automake.mk b/src/ui/terminal/automake.mk index 5ab09857..0bfa32cc 100644 --- a/src/ui/terminal/automake.mk +++ b/src/ui/terminal/automake.mk @@ -14,7 +14,7 @@ src_ui_terminal_libui_la_SOURCES = \ src/ui/terminal/terminal-opts.h -src_ui_terminal_libui_la_CFLAGS = -DINSTALLDIR=\"$(bindir)\" $(NCURSES_CFLAGS) +src_ui_terminal_libui_la_CFLAGS = $(NCURSES_CFLAGS) bin_PROGRAMS += src/ui/terminal/pspp diff --git a/tests/automake.mk b/tests/automake.mk index 9d76bc99..6493a845 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -337,7 +337,6 @@ tests_dissect_sysfile_SOURCES = \ src/libpspp/float-format.c \ tests/dissect-sysfile.c tests_dissect_sysfile_LDADD = gl/libgl.la @LIBINTL@ -tests_dissect_sysfile_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" EXTRA_DIST += \ $(dist_TESTS) \ -- 2.30.2