gbranden pushed a commit to branch master
in repository groff.

commit 069a8dd786738137110e0b63bd788aecf839136f
Author: Bruno Haible <[email protected]>
AuthorDate: Sun Apr 16 14:26:01 2023 +0200

    [build]: Fix gxditview linking on AIX.
    
    * m4/groff.m4 (GROFF_X11): Add macro dependency on `AC_CANONICAL_HOST`.
      Introduce new variable `X_AW_DEPS`, empty on most hosts.  If we
      otherwise have Athena widget library support, and the host is AIX,
      force linkage against Xpm and Xext libraries to reflect modern Athena
      dependencies, which AIX's linker doesn't figure out on its own.
      `AC_SUBST` this variable, exposing it to Automake files.
    
    * src/devices/xditview/xditview.am (gxditview_LDADD): Use it.
    
    {A similar change might also be useful for HP-UX, another Unix System V
    descendant; see <http://hpux.connect.org.uk/hppd/cgi-bin/wwwtar?/hpux/\
    Gnu/groff-1.23.0/groff-1.23.0-src-11.31.tar.gz+groff-1.23.0/\
    HPUX.Install+text>.  --GBR, 2023-07-10}
---
 ChangeLog                        | 19 +++++++++++++++++++
 m4/groff.m4                      | 19 ++++++++++++++++---
 src/devices/xditview/xditview.am |  4 ++--
 3 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6ea3f0f6e..7372d22ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2023-04-20  Bruno Haible <[email protected]>
+
+       [build]: Fix gxditview linking on AIX.
+
+       * m4/groff.m4 (GROFF_X11): Add macro dependency on
+       `AC_CANONICAL_HOST`.  Introduce new variable `X_AW_DEPS`, empty
+       on most hosts.  If we otherwise have Athena widget library
+       support, and the host is AIX, force linkage against Xpm and Xext
+       libraries to reflect modern Athena dependencies, which AIX's
+       linker doesn't figure out on its own.  `AC_SUBST` this variable,
+       exposing it to Automake files.
+       * src/devices/xditview/xditview.am (gxditview_LDADD): Use it.
+
+       {A similar change might also be useful for HP-UX, another Unix
+       System V descendant; see
+       <http://hpux.connect.org.uk/hppd/cgi-bin/wwwtar?/hpux/Gnu/\
+       groff-1.23.0/groff-1.23.0-src-11.31.tar.gz+groff-1.23.0/\
+       HPUX.Install+text>.  --GBR, 2023-07-10}
+
 2023-04-20  G. Branden Robinson <[email protected]>
 
        * bootstrap.conf (gnulib_modules): Add "sys_wait" module.  MinGW
diff --git a/m4/groff.m4 b/m4/groff.m4
index 19bf7f980..7ad4242a5 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -1628,6 +1628,7 @@ make an error "Path separator is ';'"
 # Check for X11.
 
 AC_DEFUN([GROFF_X11], [
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([AC_PATH_XTRA])
   groff_no_x=$no_x
   if test -z "$groff_no_x"
@@ -1638,6 +1639,7 @@ AC_DEFUN([GROFF_X11], [
     CFLAGS="$CFLAGS $X_CFLAGS"
     LDFLAGS="$LDFLAGS $X_LIBS"
     LIBS="$LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+    X_AW_DEPS=
 
     LIBS="$LIBS -lXaw"
     AC_MSG_CHECKING([for Xaw library and header files])
@@ -1650,9 +1652,20 @@ AC_DEFUN([GROFF_X11], [
         ]],
         [])
       ],
-      [AC_MSG_RESULT([yes])],
-      [AC_MSG_RESULT([no])
-      groff_no_x=yes])
+      [
+        AC_MSG_RESULT([yes])
+        # Modern versions of Xaw depend on the Xpm library and the SHAPE
+        # extension.  AIX's linker doesn't figure this out on its own.
+        case $host_os in
+          aix*) X_AW_DEPS="-lXpm -lXext" ;;
+        esac
+      ],
+      [
+        AC_MSG_RESULT([no])
+        groff_no_x=yes
+      ])
+
+    AC_SUBST([X_AW_DEPS])
 
     LIBS="$LIBS -lXmu"
     AC_MSG_CHECKING([for Xmu library and header files])
diff --git a/src/devices/xditview/xditview.am b/src/devices/xditview/xditview.am
index 7bb32ba0a..95bd91ead 100644
--- a/src/devices/xditview/xditview.am
+++ b/src/devices/xditview/xditview.am
@@ -50,8 +50,8 @@ xditview_srcdir = $(top_srcdir)/src/devices/xditview
 bin_PROGRAMS += gxditview
 gxditview_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS) -Dlint \
   -I$(top_builddir)/src/devices/xditview
-gxditview_LDADD = $(X_LIBS) $(X_PRE_LIBS) -lXaw -lXmu -lXt -lX11 \
-  $(X_EXTRA_LIBS) $(LIBM) libxutil.a lib/libgnu.a
+gxditview_LDADD = $(X_LIBS) $(X_PRE_LIBS) -lXaw -lXmu $(X_AW_DEPS) \
+  -lXt -lX11 $(X_EXTRA_LIBS) $(LIBM) libxutil.a lib/libgnu.a
 XDITVIEW_GENHDRS = \
  src/devices/xditview/GXditview-ad.h \
  $(GXDITVIEW_GROFF_VERSION_H)

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to