# HG changeset patch # User Bruno Haible # Date 1170294754 0 # Node ID 5c79d44f739d724c1f5b0a61ea1c6c0964d0cd5f # Parent aa8abb5db935e177fcc76cf9057a73faab48ee71 New module description field 'Link'. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-01-31 Bruno Haible + + 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 Enforce the use of gnulib modules for unportable functions. diff --git a/gnulib-tool b/gnulib-tool --- 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 _LDADD when linking a program, or" + echo "in _a_LDFLAGS or _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 diff --git a/modules/acl b/modules/acl --- a/modules/acl +++ b/modules/acl @@ -18,6 +18,9 @@ Include: "acl.h" +Link: +$(LIB_ACL) + License: GPL diff --git a/modules/clock-time b/modules/clock-time --- a/modules/clock-time +++ b/modules/clock-time @@ -14,6 +14,9 @@ Include: +Link: +$(LIB_CLOCK_GETTIME) + License: GPL diff --git a/modules/euidaccess b/modules/euidaccess --- a/modules/euidaccess +++ b/modules/euidaccess @@ -18,6 +18,9 @@ Include: "euidaccess.h" +Link: +$(LIB_EACCESS) + License: LGPL diff --git a/modules/gettext b/modules/gettext --- a/modules/gettext +++ b/modules/gettext @@ -53,6 +53,9 @@ Include: "gettext.h" +Link: +$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise + License: LGPL diff --git a/modules/iconv b/modules/iconv --- a/modules/iconv +++ b/modules/iconv @@ -17,6 +17,9 @@ # include #endif +Link: +$(LTLIBICONV) when linking with libtool, $(LIBICONV) otherwise + License: LGPL diff --git a/modules/lock b/modules/lock --- a/modules/lock +++ b/modules/lock @@ -19,6 +19,9 @@ Include: "lock.h" +Link: +$(LTLIBTHREAD) when linking with libtool, $(LIBTHREAD) otherwise + License: LGPL diff --git a/modules/nanosleep b/modules/nanosleep --- a/modules/nanosleep +++ b/modules/nanosleep @@ -20,6 +20,9 @@ Include: "timespec.h" +Link: +$(LIB_NANOSLEEP) + License: GPL diff --git a/modules/readline b/modules/readline --- a/modules/readline +++ b/modules/readline @@ -18,6 +18,9 @@ Include: "readline.h" +Link: +$(LTLIBREADLINE) when linking with libtool, $(LIBREADLINE) otherwise + License: GPL