groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 08/62: [build]: Fix gxditview linking on AIX.


From: G. Branden Robinson
Subject: [groff] 08/62: [build]: Fix gxditview linking on AIX.
Date: Thu, 20 Apr 2023 06:14:28 -0400 (EDT)

gbranden pushed a commit to branch branden-2023-04-20
in repository groff.

commit e43becec5611da8031d15e9b51f7480438e73fa9
Author: Bruno Haible <bruno@clisp.org>
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.
---
 ChangeLog                        | 13 +++++++++++++
 m4/groff.m4                      | 19 ++++++++++++++++---
 src/devices/xditview/xditview.am |  4 ++--
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 79fb7847d..33586d15e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2023-04-20  Bruno Haible <bruno@clisp.org>
+
+       [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.
+
 2023-04-20  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]