bug-gnulib
[Top][All Lists]
Advanced

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

termcap: Fix link error when no suitable library is found


From: Bruno Haible
Subject: termcap: Fix link error when no suitable library is found
Date: Sat, 14 May 2022 22:05:02 +0200

Building a testdir for module 'termcap' on a machine with neither libtermcap
nor libncurses installed, I get a link error:

gcc  -Wno-error -g -O2  -L/home/bruno/inst-x86_64-64/lib -o test-termcap 
test-termcap.o libtests.a ../gllib/libgnu.a libtests.a ../gllib/libgnu.a 
libtests.a  -ltermcap -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm
/usr/bin/ld: cannot find -ltermcap: No such file or directory
collect2: error: ld returned 1 exit status

This patch fixes it.


2022-05-14  Bruno Haible  <bruno@clisp.org>

        termcap: Fix link error when no suitable library is found.
        * m4/termcap.m4 (gl_TERMCAP_BODY): If no suitable library is found,
        set LIBTERMCAP and LTLIBTERMCAP to empty.

diff --git a/m4/termcap.m4 b/m4/termcap.m4
index 4817b5343c..89765a5352 100644
--- a/m4/termcap.m4
+++ b/m4/termcap.m4
@@ -1,4 +1,4 @@
-# termcap.m4 serial 8
+# termcap.m4 serial 9
 dnl Copyright (C) 2000-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -120,6 +120,11 @@ AC_DEFUN([gl_TERMCAP_BODY],
       ;;
     libtermcap)
       ;;
+    "not found"*)
+      LIBTERMCAP=
+      LTLIBTERMCAP=
+      INCTERMCAP=
+      ;;
   esac
   case "$gl_cv_termcap" in
     libc | libncurses | libtermcap)






reply via email to

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