From: Ben Pfaff Date: Tue, 10 May 2011 22:57:44 +0000 (-0700) Subject: Automatically link every program against libintl and libiconv. X-Git-Tag: v0.7.9~301 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=985d1dada4dcf383db0371d10de692d3db24520d;p=pspp-builds.git Automatically link every program against libintl and libiconv. On glibc systems, libiconv and libintl are both built into libc. That means that it's very easy to forget to link programs against them, because it still builds OK on GNU/Linux. However, on other systems they are usually separate libraries and forgetting to link against them breaks the build. This commit switches from previous PSPP practice, in which these libraries were linked explicitly to every binary that requires them, to a simplified practice where they are in LIBS so that every binary is automatically linked to them. This has no disadvantage on GNU/Linux, our primary target, and the advantage that on other targets PSPP works more consistently. --- diff --git a/Makefile.am b/Makefile.am index 6cffa402..deafc2e2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,6 +45,7 @@ INSTALL_DATA_HOOKS = UNINSTALL_DATA_HOOKS = PHONY = SUFFIXES = .q +LDADD = gl/libgl.la generate-changelog: if test -d $(top_srcdir)/.git; then \ diff --git a/configure.ac b/configure.ac index d5609410..35337d6c 100644 --- a/configure.ac +++ b/configure.ac @@ -35,11 +35,11 @@ PSPP_PERL dnl Disable automatic po/ support, because PSPP provides its own po/ support. AC_PROVIDE([AM_PO_SUBDIRS]) AM_GNU_GETTEXT([external], [need-ngettext]) +LIBS="$LTLIBINTL $LIBS" dnl Checks for libraries. AC_SYS_LARGEFILE AC_SEARCH_LIBS([sin], [m]) -AC_SEARCH_LIBS([dcgettext], [intl]) PSPP_LC_PAPER @@ -327,6 +327,7 @@ AM_ICONV if test "$am_cv_func_iconv" != "yes"; then PSPP_REQUIRED_PREREQ([iconv (see http://www.gnu.org/software/libiconv/)]) fi +LIBS="$LTLIBICONV $LIBS" dnl Required by the gnulib 'relocatable-prog' module. dnl See doc/relocatable-maint.texi in the gnulib tree for details. diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index a426cefd..f004fa60 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -66,9 +66,7 @@ src_ui_gui_psppire_LDADD = \ src/libpspp.la \ src/libpspp-core.la \ $(GTK_LIBS) \ - $(CAIRO_LIBS) \ - $(LIBICONV) \ - $(LIBINTL) + $(CAIRO_LIBS) src_ui_gui_psppiredir = $(pkgdatadir) diff --git a/src/ui/terminal/automake.mk b/src/ui/terminal/automake.mk index 3fa72c41..af397a10 100644 --- a/src/ui/terminal/automake.mk +++ b/src/ui/terminal/automake.mk @@ -24,8 +24,7 @@ src_ui_terminal_pspp_LDADD = \ src/libpspp-core.la \ $(CAIRO_LIBS) \ $(NCURSES_LIBS) \ - $(LIBICONV) \ - $(LIBINTL) $(LIBREADLINE) + $(LIBREADLINE) src_ui_terminal_pspp_LDFLAGS = $(PSPP_LDFLAGS) $(PG_LDFLAGS) diff --git a/tests/automake.mk b/tests/automake.mk index d62ef637..d9012a24 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -33,25 +33,23 @@ check-programs: $(check_PROGRAMS) tests_data_datasheet_test_SOURCES = \ tests/data/datasheet-test.c -tests_data_datasheet_test_LDADD = src/libpspp-core.la $(LIBINTL) +tests_data_datasheet_test_LDADD = src/libpspp-core.la tests_data_datasheet_test_CFLAGS = $(AM_CFLAGS) tests_data_sack_SOURCES = \ tests/data/sack.c -tests_data_sack_LDADD = src/libpspp-core.la $(LIBINTL) +tests_data_sack_LDADD = src/libpspp-core.la tests_data_sack_CFLAGS = $(AM_CFLAGS) tests_libpspp_ll_test_SOURCES = \ src/libpspp/ll.c \ tests/libpspp/ll-test.c -tests_libpspp_ll_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_ll_test_CFLAGS = $(AM_CFLAGS) tests_libpspp_llx_test_SOURCES = \ src/libpspp/ll.c \ src/libpspp/llx.c \ tests/libpspp/llx-test.c -tests_libpspp_llx_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_llx_test_CFLAGS = $(AM_CFLAGS) tests_libpspp_encoding_guesser_test_SOURCES = \ @@ -63,42 +61,36 @@ tests_libpspp_heap_test_SOURCES = \ src/libpspp/pool.c \ src/libpspp/temp-file.c \ tests/libpspp/heap-test.c -tests_libpspp_heap_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_heap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_hmap_test_SOURCES = \ src/libpspp/hmap.c \ tests/libpspp/hmap-test.c -tests_libpspp_hmap_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_hmap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_hmapx_test_SOURCES = \ src/libpspp/hmap.c \ src/libpspp/hmapx.c \ tests/libpspp/hmapx-test.c -tests_libpspp_hmapx_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_hmapx_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_i18n_test_SOURCES = tests/libpspp/i18n-test.c -tests_libpspp_i18n_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) +tests_libpspp_i18n_test_LDADD = src/libpspp/libpspp.la gl/libgl.la tests_libpspp_abt_test_SOURCES = \ src/libpspp/abt.c \ tests/libpspp/abt-test.c -tests_libpspp_abt_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_abt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_bt_test_SOURCES = \ src/libpspp/bt.c \ tests/libpspp/bt-test.c -tests_libpspp_bt_test_LDADD = gl/libgl.la tests_libpspp_bt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_range_map_test_SOURCES = \ src/libpspp/bt.c \ src/libpspp/range-map.c \ tests/libpspp/range-map-test.c -tests_libpspp_range_map_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_range_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_range_set_test_SOURCES = \ @@ -107,12 +99,11 @@ tests_libpspp_range_set_test_SOURCES = \ src/libpspp/range-set.c \ src/libpspp/temp-file.c \ tests/libpspp/range-set-test.c -tests_libpspp_range_set_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_range_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_str_test_SOURCES = \ tests/libpspp/str-test.c -tests_libpspp_str_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) +tests_libpspp_str_test_LDADD = src/libpspp/libpspp.la gl/libgl.la tests_libpspp_string_map_test_SOURCES = \ src/libpspp/hash-functions.c \ @@ -120,7 +111,6 @@ tests_libpspp_string_map_test_SOURCES = \ src/libpspp/string-map.c \ src/libpspp/string-set.c \ tests/libpspp/string-map-test.c -tests_libpspp_string_map_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_string_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_stringi_map_test_SOURCES = \ @@ -133,7 +123,6 @@ tests_libpspp_stringi_map_test_SOURCES = \ src/libpspp/stringi-set.c \ src/libpspp/temp-file.c \ tests/libpspp/stringi-map-test.c -tests_libpspp_stringi_map_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_stringi_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_string_set_test_SOURCES = \ @@ -141,7 +130,6 @@ tests_libpspp_string_set_test_SOURCES = \ src/libpspp/hmap.c \ src/libpspp/string-set.c \ tests/libpspp/string-set-test.c -tests_libpspp_string_set_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_string_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_stringi_set_test_SOURCES = \ @@ -152,7 +140,6 @@ tests_libpspp_stringi_set_test_SOURCES = \ src/libpspp/stringi-set.c \ src/libpspp/temp-file.c \ tests/libpspp/stringi-set-test.c -tests_libpspp_stringi_set_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_stringi_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_tower_test_SOURCES = \ @@ -161,7 +148,6 @@ tests_libpspp_tower_test_SOURCES = \ src/libpspp/temp-file.c \ src/libpspp/tower.c \ tests/libpspp/tower-test.c -tests_libpspp_tower_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_tower_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_u8_istream_test_SOURCES = tests/libpspp/u8-istream-test.c @@ -172,7 +158,6 @@ tests_libpspp_sparse_array_test_SOURCES = \ src/libpspp/pool.c \ tests/libpspp/sparse-array-test.c \ src/libpspp/temp-file.c -tests_libpspp_sparse_array_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_sparse_array_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_libpspp_sparse_xarray_test_SOURCES = \ @@ -188,7 +173,6 @@ tests_libpspp_sparse_xarray_test_SOURCES = \ src/libpspp/pool.c \ src/libpspp/temp-file.c \ tests/libpspp/sparse-xarray-test.c -tests_libpspp_sparse_xarray_test_LDADD = gl/libgl.la $(LIBINTL) tests_libpspp_sparse_xarray_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10 tests_data_inexactify_SOURCES = tests/data/inexactify.c @@ -198,7 +182,6 @@ tests_dissect_sysfile_SOURCES = \ src/libpspp/integer-format.c \ 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)\" check_PROGRAMS += tests/language/lexer/command-name-test @@ -208,8 +191,7 @@ tests_language_lexer_command_name_test_SOURCES = \ tests/language/lexer/command-name-test.c tests_language_lexer_command_name_test_LDADD = \ src/libpspp/libpspp.la \ - gl/libgl.la \ - $(LIBINTL) + gl/libgl.la tests_language_lexer_command_name_test_CFLAGS = $(AM_CFLAGS) check_PROGRAMS += tests/language/lexer/scan-test @@ -224,7 +206,6 @@ tests_language_lexer_scan_test_SOURCES = \ src/libpspp/str.c \ src/libpspp/temp-file.c \ tests/language/lexer/scan-test.c -tests_language_lexer_scan_test_LDADD = gl/libgl.la $(LIBINTL) tests_language_lexer_scan_test_CFLAGS = $(AM_CFLAGS) check_PROGRAMS += tests/language/lexer/segment-test @@ -237,7 +218,6 @@ tests_language_lexer_segment_test_SOURCES = \ src/libpspp/str.c \ src/libpspp/temp-file.c \ tests/language/lexer/segment-test.c -tests_language_lexer_segment_test_LDADD = gl/libgl.la $(LIBINTL) tests_language_lexer_segment_test_CFLAGS = $(AM_CFLAGS) check_PROGRAMS += tests/output/render-test @@ -245,9 +225,7 @@ tests_output_render_test_SOURCES = tests/output/render-test.c tests_output_render_test_LDADD = \ src/libpspp.la \ src/libpspp-core.la \ - $(CAIRO_LIBS) \ - $(LIBICONV) \ - $(LIBINTL) + $(CAIRO_LIBS) EXTRA_DIST += \ tests/coverage.sh \