Fix "make check" with --enable-relocatable.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 20 Sep 2009 21:04:28 +0000 (14:04 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 20 Sep 2009 21:04:28 +0000 (14:04 -0700)
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
src/ui/gui/automake.mk
src/ui/terminal/automake.mk
tests/automake.mk

index 507503f0235a3eaf6596c25680d3bf84e00e4b00..4f9bc660a080089f478aac5d2755e0d05875ece2 100644 (file)
@@ -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=
 
index 110ef43f04ac2d53551ba457153a75fd0208888b..9b938cf8dcc7e986c95f1c677afd06a1857f557c 100644 (file)
@@ -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 = \
index 5ab098577a57f015040543faf7387960ab46a8cd..0bfa32ccad62ac1169ce23da07717f9e16f7a1f5 100644 (file)
@@ -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
 
index 9d76bc99ee92b6bbff4f6329a51e2f61b5c5b7cf..6493a845643ce08525650aff6925a725a13355f7 100644 (file)
@@ -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) \