3.0.6 patches

Albert Chin <[email protected]>
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
1. [acconfig.h, configure.ac]
   Remove use of acconfig.h (deprecated in newer versions of autoconf)
2. [lib/fnmatch.h, m4/fnmatch.h, configure.ac]
   Drop AC_FUNC_FNMATCH and LFTP_GNU_FNMATCH in favor of
   AC_FUNC_FNMATCH_GNU. This removes m4/fnmatch.m4 and moves
   lib/fnmatch.h to lib/fnmatch_.h
3. Replace custom AC__GNU_SOURCE with AC_GNU_SOURCE

-- 
albert chin ([email protected])

-- snip snip
--- lib/fnmatch.h	2001-03-26 22:53:06.000000000 -0600
+++ /dev/null	2004-06-28 19:32:50.000000000 -0500
@@ -1,85 +0,0 @@
-/* Copyright (C) 1991,92,93,96,97,98,99,2001 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifndef	_FNMATCH_H
-#define	_FNMATCH_H	1
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
-# if !defined __GLIBC__ || !defined __P
-#  undef	__P
-#  define __P(protos)	protos
-# endif
-#else /* Not C++ or ANSI C.  */
-# undef	__P
-# define __P(protos)	()
-/* We can get away without defining `const' here only because in this file
-   it is used only inside the prototype for `fnmatch', which is elided in
-   non-ANSI C where `const' is problematical.  */
-#endif /* C++ or ANSI C.  */
-
-#ifndef const
-# if (defined __STDC__ && __STDC__) || defined __cplusplus
-#  define __const	const
-# else
-#  define __const
-# endif
-#endif
-
-/* We #undef these before defining them because some losing systems
-   (HP-UX A.08.07 for example) define these in <unistd.h>.  */
-#undef	FNM_PATHNAME
-#undef	FNM_NOESCAPE
-#undef	FNM_PERIOD
-
-/* Bits set in the FLAGS argument to `fnmatch'.  */
-#define	FNM_PATHNAME	(1 << 0) /* No wildcard can ever match `/'.  */
-#define	FNM_NOESCAPE	(1 << 1) /* Backslashes don't quote special chars.  */
-#define	FNM_PERIOD	(1 << 2) /* Leading `.' is matched only explicitly.  */
-
-#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
-# define FNM_FILE_NAME	 FNM_PATHNAME	/* Preferred GNU name.  */
-# define FNM_LEADING_DIR (1 << 3)	/* Ignore `/...' after a match.  */
-# define FNM_CASEFOLD	 (1 << 4)	/* Compare without regard to case.  */
-# define FNM_EXTMATCH	 (1 << 5)	/* Use ksh-like extended matching. */
-#endif
-
-/* Value returned by `fnmatch' if STRING does not match PATTERN.  */
-#define	FNM_NOMATCH	1
-
-/* This value is returned if the implementation does not support
-   `fnmatch'.  Since this is not the case here it will never be
-   returned but the conformance test suites still require the symbol
-   to be defined.  */
-#ifdef _XOPEN_SOURCE
-# define FNM_NOSYS	(-1)
-#endif
-
-/* Match NAME against the filename pattern PATTERN,
-   returning zero if it matches, FNM_NOMATCH if not.  */
-extern int fnmatch __P ((__const char *__pattern, __const char *__name,
-			 int __flags));
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif /* fnmatch.h */
--- /dev/null	2004-06-28 19:32:50.000000000 -0500
+++ lib/fnmatch_.h	2004-06-28 22:56:41.116326000 -0500
@@ -0,0 +1,85 @@
+/* Copyright (C) 1991,92,93,96,97,98,99,2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef	_FNMATCH_H
+#define	_FNMATCH_H	1
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
+# if !defined __GLIBC__ || !defined __P
+#  undef	__P
+#  define __P(protos)	protos
+# endif
+#else /* Not C++ or ANSI C.  */
+# undef	__P
+# define __P(protos)	()
+/* We can get away without defining `const' here only because in this file
+   it is used only inside the prototype for `fnmatch', which is elided in
+   non-ANSI C where `const' is problematical.  */
+#endif /* C++ or ANSI C.  */
+
+#ifndef const
+# if (defined __STDC__ && __STDC__) || defined __cplusplus
+#  define __const	const
+# else
+#  define __const
+# endif
+#endif
+
+/* We #undef these before defining them because some losing systems
+   (HP-UX A.08.07 for example) define these in <unistd.h>.  */
+#undef	FNM_PATHNAME
+#undef	FNM_NOESCAPE
+#undef	FNM_PERIOD
+
+/* Bits set in the FLAGS argument to `fnmatch'.  */
+#define	FNM_PATHNAME	(1 << 0) /* No wildcard can ever match `/'.  */
+#define	FNM_NOESCAPE	(1 << 1) /* Backslashes don't quote special chars.  */
+#define	FNM_PERIOD	(1 << 2) /* Leading `.' is matched only explicitly.  */
+
+#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
+# define FNM_FILE_NAME	 FNM_PATHNAME	/* Preferred GNU name.  */
+# define FNM_LEADING_DIR (1 << 3)	/* Ignore `/...' after a match.  */
+# define FNM_CASEFOLD	 (1 << 4)	/* Compare without regard to case.  */
+# define FNM_EXTMATCH	 (1 << 5)	/* Use ksh-like extended matching. */
+#endif
+
+/* Value returned by `fnmatch' if STRING does not match PATTERN.  */
+#define	FNM_NOMATCH	1
+
+/* This value is returned if the implementation does not support
+   `fnmatch'.  Since this is not the case here it will never be
+   returned but the conformance test suites still require the symbol
+   to be defined.  */
+#ifdef _XOPEN_SOURCE
+# define FNM_NOSYS	(-1)
+#endif
+
+/* Match NAME against the filename pattern PATTERN,
+   returning zero if it matches, FNM_NOMATCH if not.  */
+extern int fnmatch __P ((__const char *__pattern, __const char *__name,
+			 int __flags));
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* fnmatch.h */
--- m4/fnmatch.m4	2003-02-28 00:19:21.000000000 -0600
+++ /dev/null	2004-06-29 10:03:20.000000000 -0500
@@ -1,17 +0,0 @@
-AC_DEFUN([LFTP_GNU_FNMATCH],[
-   AC_MSG_CHECKING(for gnu fnmatch)
-   AC_CACHE_VAL(lftp_cv_gnu_fnmatch,
-   [
-      lftp_cv_gnu_fnmatch=no
-      AC_TRY_COMPILE([
-	 #include <fnmatch.h>
-      ],
-      [
-	 fnmatch("x","y",FNM_CASEFOLD);
-      ],
-      [
-	 lftp_cv_gnu_fnmatch=yes
-      ])
-   ])
-   AC_MSG_RESULT($lftp_cv_gnu_fnmatch)
-])
--- acconfig.h	2004-05-27 04:29:24.000000000 -0500
+++ /dev/null	2004-06-29 12:41:48.000000000 -0500
@@ -1,28 +0,0 @@
-/*
- * lftp and utils
- *
- * Copyright (c) 1996-2004 by Alexander V. Lukyanov ([email protected])
- *
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef CONFIG_H
-#define CONFIG_H
-@TOP@
-@BOTTOM@
-
-#include <post-config.h>
-
-#endif /* CONFIG_H */
--- configure.ac.orig	2004-06-28 23:03:50.903050000 -0500
+++ configure.ac	2004-06-29 12:41:46.218173000 -0500
@@ -2,12 +2,13 @@
 AC_PREREQ(2.53)
 AC_INIT([lftp], [3.0.6], [[email protected]])
 AM_INIT_AUTOMAKE
+AC_CONFIG_LIBOBJ_DIR(lib)
 AC_CONFIG_SRCDIR([src/ftpclass.cc])
 AM_CONFIG_HEADER(include/config.h)
 
 # This doesn't *require* GNU extensions; it merely enables them if
 # they're there.
-AC__GNU_SOURCE
+AC_GNU_SOURCE
 
 test -z "$CXX"	     && DEFAULT_CXX=yes
 test -z "$CFLAGS"    && DEFAULT_CFLAGS=yes
@@ -348,8 +349,7 @@
 AC_FUNC_UTIME_NULL
 AC_FUNC_GETPGRP
 AC_FUNC_VPRINTF
-AC_FUNC_FNMATCH
-LFTP_GNU_FNMATCH
+AC_FUNC_FNMATCH_GNU
 AC_HEADER_STAT
 LFTP_FUNC_POLL
 LFTP_FUNC_SSCANF_CONST
@@ -400,7 +400,7 @@
    AC_LIBOBJ(glob)
    AC_CONFIG_LINKS([include/glob.h:lib/glob.h])
 fi
-if test x$ac_cv_func_fnmatch_works = xno -o x$lftp_cv_gnu_fnmatch = xno; then
+if test x$ac_cv_func_fnmatch_gnu = xno; then
    AC_LIBOBJ(fnmatch)
    AC_CONFIG_LINKS([include/fnmatch.h:lib/fnmatch.h])
    AC_DEFINE_UNQUOTED(fnmatch, rpl_fnmatch, [Define to rpl_fnmatch if system fnmatch does not work])
@@ -410,5 +410,25 @@
    sysconfdir=/etc
 fi
 
-AC_CONFIG_FILES([Makefile src/Makefile lib/Makefile include/Makefile doc/Makefile readline-4.3/Makefile po/Makefile.in m4/Makefile contrib/Makefile])
+AH_TOP([
+#ifndef CONFIG_H
+#define CONFIG_H
+])
+
+AH_BOTTOM([
+#include <post-config.h>
+
+#endif /* CONFIG_H */
+])
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([src/Makefile])
+AC_CONFIG_FILES([lib/Makefile])
+AC_CONFIG_FILES([include/Makefile])
+AC_CONFIG_FILES([doc/Makefile])
+AC_CONFIG_FILES([readline-4.3/Makefile])
+AC_CONFIG_FILES([po/Makefile.in])
+AC_CONFIG_FILES([m4/Makefile])
+AC_CONFIG_FILES([contrib/Makefile])
+
 AC_OUTPUT
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.