From: Bruno Haible Date: Thu, 26 Sep 2024 01:52:16 +0000 (+0200) Subject: build: Add support for --enable-relocatable in mingw builds on Cygwin hosts. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc1ac330e1ef9060377a7423e0cdfd1612a6417f;p=thirdparty%2Fgettext.git build: Add support for --enable-relocatable in mingw builds on Cygwin hosts. Reported by Michele Locati in . * gettext-runtime/configure.ac: Determine bindir_c_make. * gettext-runtime/src/Makefile.am (*_CFLAGS): Fix value of INSTALLDIR. * gettext-tools/configure.ac: Determine bindir_c_make, pkglibdir_c_make. * gettext-tools/src/Makefile.am (*_CPPFLAGS): Fix value of INSTALLDIR. --- diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 126d0690f..28b202d30 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-runtime directory of GNU gettext -dnl Copyright (C) 1995-2010, 2012-2015, 2018-2023 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2010, 2012-2015, 2018-2024 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -28,6 +28,26 @@ AC_CONFIG_HEADERS([config.h]) dnl Installation directories. test "$docdir" != '${datarootdir}/doc/${PACKAGE_TARNAME}' || docdir='${datarootdir}/doc/gettext' +dnl Define bindir_c and bindir_c_make. +dnl Find the final value of bindir. +gt_save_prefix="${prefix}" +gt_save_exec_prefix="${exec_prefix}" +gt_save_bindir="${bindir}" +dnl Unfortunately, prefix and exec_prefix get only finally determined +dnl at the end of configure. +if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" +fi +if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' +fi +eval exec_prefix="$exec_prefix" +eval bindir="$bindir" +gl_BUILD_TO_HOST([bindir]) +bindir="${gt_save_bindir}" +exec_prefix="${gt_save_exec_prefix}" +prefix="${gt_save_prefix}" + dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL diff --git a/gettext-runtime/src/Makefile.am b/gettext-runtime/src/Makefile.am index e9974c4c2..ee06ff280 100644 --- a/gettext-runtime/src/Makefile.am +++ b/gettext-runtime/src/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-runtime/src subdirectory of GNU gettext -## Copyright (C) 1995-1998, 2000-2007, 2009, 2019, 2023 Free Software Foundation, Inc. +## Copyright (C) 1995-1998, 2000-2007, 2009, 2019, 2023-2024 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -46,9 +46,9 @@ envsubst_SOURCES = envsubst.c LDADD = ../gnulib-lib/libgrt.a @LTLIBINTL@ @LTLIBICONV@ $(WOE32_LDADD) # Specify installation directory, for --enable-relocatable. -gettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -ngettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\" -envsubst_CFLAGS = -DINSTALLDIR=\"$(bindir)\" +gettext_CFLAGS = -DINSTALLDIR=$(bindir_c_make) +ngettext_CFLAGS = -DINSTALLDIR=$(bindir_c_make) +envsubst_CFLAGS = -DINSTALLDIR=$(bindir_c_make) if RELOCATABLE_VIA_LD gettext_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)` ngettext_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)` diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 3610ee3ca..36a9f185b 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -28,6 +28,49 @@ AC_CONFIG_HEADERS([config.h]) dnl Installation directories. test "$docdir" != '${datarootdir}/doc/${PACKAGE_TARNAME}' || docdir='${datarootdir}/doc/gettext' +dnl Define bindir_c and bindir_c_make. +dnl Find the final value of bindir. +gt_save_prefix="${prefix}" +gt_save_exec_prefix="${exec_prefix}" +gt_save_bindir="${bindir}" +dnl Unfortunately, prefix and exec_prefix get only finally determined +dnl at the end of configure. +if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" +fi +if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' +fi +eval exec_prefix="$exec_prefix" +eval bindir="$bindir" +gl_BUILD_TO_HOST([bindir]) +bindir="${gt_save_bindir}" +exec_prefix="${gt_save_exec_prefix}" +prefix="${gt_save_prefix}" + +dnl Define pkglibdir_c and pkglibdir_c_make. +dnl Find the final value of pkglibdir. +gt_save_prefix="${prefix}" +gt_save_exec_prefix="${exec_prefix}" +gt_save_libdir="${libdir}" +gt_save_pkglibdir="${pkglibdir}" +dnl Unfortunately, prefix and exec_prefix get only finally determined +dnl at the end of configure. +if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" +fi +if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' +fi +eval exec_prefix="$exec_prefix" +eval libdir="$libdir" +eval pkglibdir="$pkglibdir" +gl_BUILD_TO_HOST([pkglibdir]) +pkglibdir="${gt_save_pkglibdir}" +libdir="${gt_save_libdir}" +exec_prefix="${gt_save_exec_prefix}" +prefix="${gt_save_prefix}" + dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index f77129d6f..89697fcb1 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools/src subdirectory of GNU gettext -## Copyright (C) 1995-1998, 2000-2023 Free Software Foundation, Inc. +## Copyright (C) 1995-1998, 2000-2024 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -403,25 +403,25 @@ hostname_DEPENDENCIES = $(OTHERPROGDEPENDENCIES) urlget_DEPENDENCIES = $(OTHERPROGDEPENDENCIES) # Specify installation directory, for --enable-relocatable. -msgcmp_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgfmt_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgmerge_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgunfmt_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -xgettext_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgattrib_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgcat_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgcomm_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgconv_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgen_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgexec_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msgfilter_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msggrep_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msginit_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -msguniq_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -recode_sr_latin_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\" -hostname_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(pkglibdir)\" -urlget_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(pkglibdir)\" -cldr_plurals_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(pkglibdir)\" +msgcmp_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgfmt_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgmerge_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgunfmt_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +xgettext_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgattrib_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgcat_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgcomm_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgconv_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgen_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgexec_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msgfilter_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msggrep_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msginit_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +msguniq_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +recode_sr_latin_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) +hostname_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(pkglibdir_c_make) +urlget_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(pkglibdir_c_make) +cldr_plurals_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=$(pkglibdir_c_make) if RELOCATABLE_VIA_LD msgcmp_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)` msgfmt_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`