bug-gnulib
[Top][All Lists]
Advanced

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

Re: Proposed Module: canonicalize-lgpl


From: Paul Eggert
Subject: Re: Proposed Module: canonicalize-lgpl
Date: Fri, 03 Nov 2006 15:21:26 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Charles Wilson" <address@hidden> writes:

> If gnulib is to have an LGPL canoncicalize, it will necessarily be
> *different* code.

OK, thanks for the analysis.  I'll start the ball rolling by
installing this change, which affects only the existing canonicalize
module.  A later email will address canonicalize-lgpl.

The basic idea here is for canonicalize-lgpl to use the gettext
canonicalize.c unchanged, except for LGPL/GPL wording.  Also, I think
it's nicer if client code can just include "canonicalize.h" without
worrying about the license; this makes canonicalize-lgpl more like
fts-gpl.

2006-11-03  Paul Eggert  <address@hidden>

        * lib/canonicalize.h: (canonicalize_mode_t, CAN_EXISTING):
        (CAN_ALL_BUT_LAST, CAN_MISSING, canonicalize_filename_mode):
        Define only if PROVIDE_CANONICALIZE_FILENAME_MODE is defined.
        * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME):
        Check for functions and headers just once.
        Check for declaration of canonicalize_file_name.
        Define PROVIDE_CANONICALIZE_FILENAME_MODE.

Index: lib/canonicalize.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/canonicalize.h,v
retrieving revision 1.3
diff -p -u -r1.3 canonicalize.h
--- lib/canonicalize.h  2 Jun 2005 20:41:05 -0000       1.3
+++ lib/canonicalize.h  3 Nov 2006 23:14:59 -0000
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2005 Free Software Foundation, Inc.
+   Copyright (C) 1996-2006 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
@@ -19,6 +19,7 @@
 #ifndef CANONICALIZE_H_
 # define CANONICALIZE_H_
 
+# ifdef PROVIDE_CANONICALIZE_FILENAME_MODE
 enum canonicalize_mode_t
   {
     /* All components must exist.  */
@@ -33,8 +34,11 @@ enum canonicalize_mode_t
 typedef enum canonicalize_mode_t canonicalize_mode_t;
 
 char *canonicalize_filename_mode (const char *, canonicalize_mode_t);
+# endif
 
-# if !HAVE_CANONICALIZE_FILE_NAME
+# if HAVE_DECL_CANONICALIZE_FILE_NAME
+#  include <stdlib.h>
+# else
 char *canonicalize_file_name (const char *);
 # endif
 
Index: m4/canonicalize.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/canonicalize.m4,v
retrieving revision 1.7
diff -p -u -r1.7 canonicalize.m4
--- m4/canonicalize.m4  21 Aug 2006 21:46:31 -0000      1.7
+++ m4/canonicalize.m4  3 Nov 2006 23:14:59 -0000
@@ -1,6 +1,6 @@
-#serial 10
+#serial 11
 
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,9 @@ AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME
   [
     AC_LIBOBJ([canonicalize])
 
-    AC_CHECK_HEADERS(sys/param.h)
-    AC_CHECK_FUNCS(resolvepath canonicalize_file_name)
+    AC_CHECK_HEADERS_ONCE([sys/param.h])
+    AC_CHECK_DECLS_ONCE([canonicalize_file_name])
+    AC_CHECK_FUNCS_ONCE([canonicalize_file_name resolvepath])
+    AC_DEFINE([PROVIDE_CANONICALIZE_FILENAME_MODE], 1,
+      [Define to 1 to provide canonicalize_filename_mode.])
   ])




reply via email to

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