Indicate the presence of gnulib modules through C macros.
authorBruno Haible <bruno@clisp.org>
Tue, 2 Jan 2007 20:59:11 +0000 (20:59 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 2 Jan 2007 20:59:11 +0000 (20:59 +0000)
gnulib-tool

index 6c7f50b..5985810 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2002-2006 Free Software Foundation, Inc.
+# Copyright (C) 2002-2007 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2006-12-31 06:29:50 $'
+cvsdatestamp='$Date: 2007-01-02 20:59:11 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 nl='
@@ -185,7 +185,7 @@ Written by" "Bruno Haible" "and" "Simon Josefsson"
 # outputs to stdout a header for a generated file.
 func_emit_copyright_notice ()
 {
-  echo "# Copyright (C) 2004-2006 Free Software Foundation, Inc."
+  echo "# Copyright (C) 2004-2007 Free Software Foundation, Inc."
   echo "#"
   echo "# This file is free software, distributed under the terms of the GNU"
   echo "# General Public License.  As a special exception to the GNU General"
@@ -935,6 +935,9 @@ func_get_autoconf_snippet ()
 {
   func_lookup_file "modules/$1"
   sed -n -e "/^configure\.ac$sed_extract_prog" < "$lookedup_file"
+  # Define a C macro indicating the presence of the given module.
+  echo "  AC_DEFINE([GNULIB_"`echo "$1" | LC_ALL=C tr 'a-z' 'A-Z' | sed -e 's,[-./],_,g'`"], [1],"
+  echo "    [Define to 1 when using the gnulib module $1.])"
 }
 
 # func_get_automake_snippet module