bug-gnulib
[Top][All Lists]
Advanced

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

putting external library dependencies into the module description


From: Bruno Haible
Subject: putting external library dependencies into the module description
Date: Thu, 1 Feb 2007 02:55:52 +0100
User-agent: KMail/1.5.4

Hi,

Ralf noticed that since the latest change to copy-file.c the gettext CVS
does not build any more on some platforms. The problem is the dependency to
libacl, which is currently not documented - not in comments of m4/acl.m4,
and not in the module descriptions. We also had similar problems in the
past, with the iconv dependency, IIRC.

To avoid surprises like this for the future, the solution is
  1) to note external library dependencies in the module description,
  2) to change gnulib-tool to show these dependencies.

Like the list of include files, this field for informational purposes only.

2007-01-31  Bruno Haible  <address@hidden>

        New module description field 'Link'.
        * gnulib-tool (func_usage): Document --extract-link-directive.
        (sed_extract_prog): Recognize 'Link' directive.
        (func_get_link_directive): New function.
        (func_import): Show summary of link directives.
        Handle --extract-link-directive option.
        * modules/acl (Link): New section.
        * modules/clock-time (Link): New section.
        * modules/euidaccess (Link): New section.
        * modules/gettext (Link): New section.
        * modules/iconv (Link): New section.
        * modules/lock (Link): New section.
        * modules/nanosleep (Link): New section.
        * modules/readline (Link): New section.

*** gnulib-tool 28 Jan 2007 13:58:02 -0000      1.219
--- gnulib-tool 1 Feb 2007 01:40:00 -0000
***************
*** 93,98 ****
--- 93,99 ----
         gnulib-tool --extract-autoconf-snippet module
         gnulib-tool --extract-automake-snippet module
         gnulib-tool --extract-include-directive module
+        gnulib-tool --extract-link-directive module
         gnulib-tool --extract-license module
         gnulib-tool --extract-maintainer module
         gnulib-tool --extract-tests-module module
***************
*** 117,122 ****
--- 118,124 ----
        --extract-autoconf-snippet   extract the snippet for configure.ac
        --extract-automake-snippet   extract the snippet for library makefile
        --extract-include-directive  extract the #include directive
+       --extract-link-directive     extract the linker directive
        --extract-license            report the license terms of the source 
files
                                     under lib/
        --extract-maintainer         report the maintainer(s) inside gnulib
***************
*** 891,896 ****
--- 893,899 ----
      s/^configure\.ac:[         ]*$//
      s/^Makefile\.am:[  ]*$//
      s/^Include:[       ]*$//
+     s/^Link:[  ]*$//
      s/^License:[       ]*$//
      s/^Maintainer:[    ]*$//
      tb
***************
*** 1015,1020 ****
--- 1018,1032 ----
    sed -e 's/^\(["<]\)/#include \1/'
  }
  
+ # func_get_link_directive module
+ # Input:
+ # - local_gnulib_dir  from --local-dir
+ func_get_link_directive ()
+ {
+   func_lookup_file "modules/$1"
+   sed -n -e "/^Link$sed_extract_prog" < "$lookedup_file"
+ }
+ 
  # func_get_license module
  # Input:
  # - local_gnulib_dir  from --local-dir
***************
*** 2252,2257 ****
--- 2264,2282 ----
    ) | sed -e '/^$/d' -e 's/^/  /'
    rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if
  
+   for module in $modules; do
+     func_get_link_directive "$module"
+   done \
+     | LC_ALL=C sort -u | sed -e '/^$/d' -e 's/^/  /' > "$tmp"/link
+   if test `wc -l < "$tmp"/link` != 0; then
+     echo
+     echo "You may need to use the following Makefile variables when linking."
+     echo "Use them in <program>_LDADD when linking a program, or"
+     echo "in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a 
library."
+     cat "$tmp"/link
+   fi
+   rm -f "$tmp"/link
+ 
    echo
    echo "Don't forget to"
    if test "$makefile_am" = Makefile.am; then
***************
*** 3056,3061 ****
--- 3081,3096 ----
      done
      ;;
  
+   extract-link-directive )
+     for module
+     do
+       func_verify_module
+       if test -n "$module"; then
+         func_get_link_directive "$module"
+       fi
+     done
+     ;;
+ 
    extract-license )
      for module
      do
*** modules/acl 13 Oct 2006 12:40:23 -0000      1.9
--- modules/acl 1 Feb 2007 01:40:00 -0000
***************
*** 18,23 ****
--- 18,26 ----
  Include:
  "acl.h"
  
+ Link:
+ $(LIB_ACL)
+ 
  License:
  GPL
  
*** modules/clock-time  26 Sep 2006 06:36:30 -0000      1.2
--- modules/clock-time  1 Feb 2007 01:40:01 -0000
***************
*** 14,19 ****
--- 14,22 ----
  
  Include:
  
+ Link:
+ $(LIB_CLOCK_GETTIME)
+ 
  License:
  GPL
  
*** modules/euidaccess  27 Oct 2006 20:46:43 -0000      1.11
--- modules/euidaccess  1 Feb 2007 01:40:01 -0000
***************
*** 18,23 ****
--- 18,26 ----
  Include:
  "euidaccess.h"
  
+ Link:
+ $(LIB_EACCESS)
+ 
  License:
  LGPL
  
*** modules/gettext     27 Oct 2006 14:06:54 -0000      1.15
--- modules/gettext     1 Feb 2007 01:40:01 -0000
***************
*** 53,58 ****
--- 53,61 ----
  Include:
  "gettext.h"
  
+ Link:
+ $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
+ 
  License:
  LGPL
  
*** modules/iconv       14 Jan 2007 22:21:36 -0000      1.9
--- modules/iconv       1 Feb 2007 01:40:01 -0000
***************
*** 17,22 ****
--- 17,25 ----
  # include <iconv.h>
  #endif
  
+ Link:
+ $(LTLIBICONV) when linking with libtool, $(LIBICONV) otherwise
+ 
  License:
  LGPL
  
*** modules/lock        2 Sep 2005 14:44:37 -0000       1.2
--- modules/lock        1 Feb 2007 01:40:01 -0000
***************
*** 19,24 ****
--- 19,27 ----
  Include:
  "lock.h"
  
+ Link:
+ $(LTLIBTHREAD) when linking with libtool, $(LIBTHREAD) otherwise
+ 
  License:
  LGPL
  
*** modules/nanosleep   18 Jan 2007 08:33:35 -0000      1.12
--- modules/nanosleep   1 Feb 2007 01:40:01 -0000
***************
*** 20,25 ****
--- 20,28 ----
  Include:
  "timespec.h"
  
+ Link:
+ $(LIB_NANOSLEEP)
+ 
  License:
  GPL
  
*** modules/readline    13 Oct 2006 12:40:23 -0000      1.5
--- modules/readline    1 Feb 2007 01:40:01 -0000
***************
*** 18,23 ****
--- 18,26 ----
  Include:
  "readline.h"
  
+ Link:
+ $(LTLIBREADLINE) when linking with libtool, $(LIBREADLINE) otherwise
+ 
  License:
  GPL
  





reply via email to

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