changeset 8055:5c79d44f739d

New module description field 'Link'.
author Bruno Haible <bruno@clisp.org>
date Thu, 01 Feb 2007 01:52:34 +0000
parents aa8abb5db935
children 273c47dfe264
files ChangeLog gnulib-tool modules/acl modules/clock-time modules/euidaccess modules/gettext modules/iconv modules/lock modules/nanosleep modules/readline
diffstat 10 files changed, 77 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2007-01-31  Bruno Haible  <bruno@clisp.org>
+
+	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.
+
 2007-01-27  Bruno Haible  <bruno@clisp.org>
 
 	Enforce the use of gnulib modules for unportable <string.h> functions.
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2007-01-28 13:58:02 $'
+cvsdatestamp='$Date: 2007-02-01 01:52:34 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 nl='
@@ -93,6 +93,7 @@
        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,6 +118,7 @@
       --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,6 +893,7 @@
     s/^configure\.ac:[	 ]*$//
     s/^Makefile\.am:[	 ]*$//
     s/^Include:[	 ]*$//
+    s/^Link:[	 ]*$//
     s/^License:[	 ]*$//
     s/^Maintainer:[	 ]*$//
     tb
@@ -1015,6 +1018,15 @@
   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,6 +2264,19 @@
   ) | 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,6 +3081,16 @@
     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
--- a/modules/acl
+++ b/modules/acl
@@ -18,6 +18,9 @@
 Include:
 "acl.h"
 
+Link:
+$(LIB_ACL)
+
 License:
 GPL
 
--- a/modules/clock-time
+++ b/modules/clock-time
@@ -14,6 +14,9 @@
 
 Include:
 
+Link:
+$(LIB_CLOCK_GETTIME)
+
 License:
 GPL
 
--- a/modules/euidaccess
+++ b/modules/euidaccess
@@ -18,6 +18,9 @@
 Include:
 "euidaccess.h"
 
+Link:
+$(LIB_EACCESS)
+
 License:
 LGPL
 
--- a/modules/gettext
+++ b/modules/gettext
@@ -53,6 +53,9 @@
 Include:
 "gettext.h"
 
+Link:
+$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
+
 License:
 LGPL
 
--- a/modules/iconv
+++ b/modules/iconv
@@ -17,6 +17,9 @@
 # include <iconv.h>
 #endif
 
+Link:
+$(LTLIBICONV) when linking with libtool, $(LIBICONV) otherwise
+
 License:
 LGPL
 
--- a/modules/lock
+++ b/modules/lock
@@ -19,6 +19,9 @@
 Include:
 "lock.h"
 
+Link:
+$(LTLIBTHREAD) when linking with libtool, $(LIBTHREAD) otherwise
+
 License:
 LGPL
 
--- a/modules/nanosleep
+++ b/modules/nanosleep
@@ -20,6 +20,9 @@
 Include:
 "timespec.h"
 
+Link:
+$(LIB_NANOSLEEP)
+
 License:
 GPL
 
--- a/modules/readline
+++ b/modules/readline
@@ -18,6 +18,9 @@
 Include:
 "readline.h"
 
+Link:
+$(LTLIBREADLINE) when linking with libtool, $(LIBREADLINE) otherwise
+
 License:
 GPL