This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: installing with make 3.77


   Date: Sun, 13 Sep 1998 20:10:14 -0700 (PDT)
   From: Matt McLean <keys@yikes.com>

   hello..

   I've noticed several problems in the make install with make 3.77.

   1. It can't even get past the localedata subdir.
   2. not all the subdirs in /usr/include get installed.

   ... there could be more ...

   reverting to 3.76.1 fixes things. the reason i thought this was funny is
   that configure allows for any make version above 3.74 (not including
   3.76).

   has anybody else experienced this? (i'm on powerpc but that shouldn't
   make any difference..)

There is a problem with Large File Support in the `glob'
subdirectory.  You can fix this by applying the patch included here.

Mark

--- /tmp/make-3.77/glob/configure.in	Wed Jul 29 22:17:55 1998
+++ make-3.77/glob/configure.in	Sun Aug  9 02:57:24 1998
@@ -13,6 +13,12 @@
 AC_AIX
 AC_MINIX
 AC_ISC_POSIX
+
+dnl This test must come as early as possible after the compiler configuration
+dnl tests, because the choice of the file model can (in principle) affect
+dnl whether functions and headers are available, whether they work, etc.
+AC_LFS
+
 AC_CONST
 AC_HEADER_STDC
 AC_CHECK_HEADERS(memory.h unistd.h string.h)
--- /tmp/make-3.77/glob/glob.c	Wed Jul 29 22:22:45 1998
+++ make-3.77/glob/glob.c	Wed Aug 26 12:36:51 1998
@@ -155,6 +155,12 @@
 
 #endif	/* Standard headers.  */
 
+#ifdef HAVE_GETLOGIN_R
+extern int getlogin_r __P ((char *, size_t));
+#else
+extern char *getlogin __P ((void));
+#endif
+
 #ifndef	ANSI_STRING
 
 # ifndef bzero
@@ -180,7 +186,6 @@
 # define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
 #endif
 
-
 #ifndef	__GNU_LIBRARY__
 # ifdef	__GNUC__
 __inline
@@ -240,11 +245,17 @@
 #endif
 
 #ifdef _LIBC
+# undef strdup
 # define strdup(str) __strdup (str)
 # define sysconf(id) __sysconf (id)
 # define closedir(dir) __closedir (dir)
 # define opendir(name) __opendir (name)
 # define readdir(str) __readdir (str)
+# define getpwnam_r(name, bufp, buf, len, res) \
+   __getpwnam_r (name, bufp, buf, len, res)
+# ifndef __stat
+#  define __stat(fname, buf) __xstat (_STAT_VER, fname, buf)
+# endif
 #endif
 
 #if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
@@ -282,7 +293,7 @@
 const char *next_brace_sub __P ((const char *begin));
 static int glob_in_dir __P ((const char *pattern, const char *directory,
 			     int flags,
-			     int (*errfunc) __P ((const char *, int)),
+			     int (*errfunc) (const char *, int),
 			     glob_t *pglob));
 static int prefix_array __P ((const char *prefix, char **array, size_t n));
 static int collated_compare __P ((const __ptr_t, const __ptr_t));
@@ -349,7 +360,7 @@
      glob_t *pglob;
 {
   const char *filename;
-  char *dirname;
+  const char *dirname;
   size_t dirlen;
   int status;
   int oldcount;
@@ -501,39 +512,40 @@
     {
       /* This can mean two things: a simple name or "~name".  The later
 	 case is nothing but a notation for a directory.  */
-      if ((flags & GLOB_TILDE) && pattern[0] == '~')
+      if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && pattern[0] == '~')
 	{
-	  dirname = (char *) pattern;
+	  dirname = pattern;
 	  dirlen = strlen (pattern);
 
-          /* Set FILENAME to NULL as a special flag.  This is ugly but
-             other solutions would require much more code.  We test for
-             this special case below.  */
-          filename = NULL;
+	  /* Set FILENAME to NULL as a special flag.  This is ugly but
+	     other solutions would require much more code.  We test for
+	     this special case below.  */
+	  filename = NULL;
 	}
       else
 	{
-          filename = pattern;
+	  filename = pattern;
 #ifdef _AMIGA
-          dirname = (char *) "";
+	  dirname = "";
 #else
-          dirname = (char *) ".";
+	  dirname = ".";
 #endif
-          dirlen = 0;
-        }
+	  dirlen = 0;
+	}
     }
   else if (filename == pattern)
     {
       /* "/pattern".  */
-      dirname = (char *) "/";
+      dirname = "/";
       dirlen = 1;
       ++filename;
     }
   else
     {
+      char *newp;
       dirlen = filename - pattern;
 #if defined __MSDOS__ || defined WINDOWS32
-      if ((*filename == ':')
+      if (*filename == ':'
 	  || (filename > pattern + 1 && filename[-1] == ':'))
 	{
 	  char *drive_spec;
@@ -555,30 +567,31 @@
 	     from "d:/", since "d:" and "d:/" are not the same.*/
 	}
 #endif
-      dirname = (char *) __alloca (dirlen + 1);
+      newp = (char *) __alloca (dirlen + 1);
 #ifdef HAVE_MEMPCPY
-      *((char *) mempcpy (dirname, pattern, dirlen)) = '\0';
+      *((char *) mempcpy (newp, pattern, dirlen)) = '\0';
 #else
-      memcpy (dirname, pattern, dirlen);
-      dirname[dirlen] = '\0';
+      memcpy (newp, pattern, dirlen);
+      newp[dirlen] = '\0';
 #endif
+      dirname = newp;
       ++filename;
 
       if (filename[0] == '\0'
 #if defined __MSDOS__ || defined WINDOWS32
-          && dirname[dirlen-1] != ':'
-          && (dirlen < 3 || dirname[dirlen-2] != ':'
-	      || dirname[dirlen-1] != '/')
-#endif
-          && dirlen > 1)
-      /* "pattern/".  Expand "pattern", appending slashes.  */
-      {
-        int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
-        if (val == 0)
-          pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
-                             | (flags & GLOB_MARK));
-        return val;
-      }
+          && dirname[dirlen - 1] != ':'
+	  && (dirlen < 3 || dirname[dirlen - 2] != ':'
+	      || dirname[dirlen - 1] != '/')
+#endif
+	  && dirlen > 1)
+	/* "pattern/".  Expand "pattern", appending slashes.  */
+	{
+	  int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
+	  if (val == 0)
+	    pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
+			       | (flags & GLOB_MARK));
+	  return val;
+	}
     }
 
   if (!(flags & GLOB_APPEND))
@@ -590,12 +603,12 @@
   oldcount = pglob->gl_pathc;
 
 #ifndef VMS
-  if ((flags & GLOB_TILDE) && dirname[0] == '~')
+  if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
     {
       if (dirname[1] == '\0' || dirname[1] == '/')
 	{
 	  /* Look up home directory.  */
-	  char *home_dir = getenv ("HOME");
+	  const char *home_dir = getenv ("HOME");
 # ifdef _AMIGA
 	  if (home_dir == NULL || home_dir[0] == '\0')
 	    home_dir = "SYS:";
@@ -607,37 +620,38 @@
 	  if (home_dir == NULL || home_dir[0] == '\0')
 	    {
 	      int success;
+	      char *name;
 #   if defined HAVE_GETLOGIN_R || defined _LIBC
-	      extern int getlogin_r __P ((char *, size_t));
 	      size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
-	      char *name;
 
 	      if (buflen == 0)
 		/* `sysconf' does not support _SC_LOGIN_NAME_MAX.  Try
 		   a moderate value.  */
-		buflen = 16;
+		buflen = 20;
 	      name = (char *) __alloca (buflen);
 
 	      success = getlogin_r (name, buflen) >= 0;
 #   else
-	      extern char *getlogin __P ((void));
-	      char *name;
-
 	      success = (name = getlogin ()) != NULL;
 #   endif
 	      if (success)
 		{
+		  struct passwd *p;
 #   if defined HAVE_GETPWNAM_R || defined _LIBC
 		  size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
 		  char *pwtmpbuf;
-		  struct passwd pwbuf, *p;
+		  struct passwd pwbuf;
 
+		  if (pwbuflen == -1)
+		    /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
+		       Try a moderate value.  */
+		    pwbuflen = 1024;
 		  pwtmpbuf = (char *) __alloca (pwbuflen);
 
-		  success = (__getpwnam_r (name, &pwbuf, pwtmpbuf,
-					   pwbuflen, &p) >= 0);
+		  success = (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
+			     >= 0);
 #   else
-		  struct passwd *p = getpwnam (name);
+		  p = getpwnam (name);
 		  success = p != NULL;
 #   endif
 		  if (success)
@@ -645,7 +659,10 @@
 		}
 	    }
 	  if (home_dir == NULL || home_dir[0] == '\0')
-	    home_dir = (char *) "~"; /* No luck.  */
+	    if (flags & GLOB_TILDE_CHECK)
+	      return GLOB_NOMATCH;
+	    else
+	      home_dir = "~"; /* No luck.  */
 #  endif /* WINDOWS32 */
 # endif
 	  /* Now construct the full directory.  */
@@ -670,35 +687,45 @@
       else
 	{
 	  char *end_name = strchr (dirname, '/');
-	  char *user_name;
-	  char *home_dir;
+	  const char *user_name;
+	  const char *home_dir;
 
 	  if (end_name == NULL)
 	    user_name = dirname + 1;
 	  else
 	    {
-	      user_name = (char *) __alloca (end_name - dirname);
+	      char *newp;
+	      newp = (char *) __alloca (end_name - dirname);
 # ifdef HAVE_MEMPCPY
-	      *((char *) mempcpy (user_name, dirname + 1, end_name - dirname))
+	      *((char *) mempcpy (newp, dirname + 1, end_name - dirname))
 		= '\0';
 # else
-	      memcpy (user_name, dirname + 1, end_name - dirname);
-	      user_name[end_name - dirname - 1] = '\0';
+	      memcpy (newp, dirname + 1, end_name - dirname);
+	      newp[end_name - dirname - 1] = '\0';
 # endif
+	      user_name = newp;
 	    }
 
 	  /* Look up specific user's home directory.  */
 	  {
+	    struct passwd *p;
 #  if defined HAVE_GETPWNAM_R || defined _LIBC
 	    size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
-	    char *pwtmpbuf = (char *) __alloca (buflen);
-	    struct passwd pwbuf, *p;
-	    if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
+	    char *pwtmpbuf;
+	    struct passwd pwbuf;
+
+	    if (buflen == -1)
+	      /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.  Try a
+		 moderate value.  */
+	      buflen = 1024;
+	    pwtmpbuf = (char *) __alloca (buflen);
+
+	    if (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
 	      home_dir = p->pw_dir;
 	    else
 	      home_dir = NULL;
 #  else
-	    struct passwd *p = getpwnam (user_name);
+	    p = getpwnam (user_name);
 	    if (p != NULL)
 	      home_dir = p->pw_dir;
 	    else
@@ -722,6 +749,11 @@
 #  endif
 	      dirname = newp;
 	    }
+	  else
+	    if (flags & GLOB_TILDE_CHECK)
+	      /* We have to regard it as an error if we cannot find the
+		 home directory.  */
+	      return GLOB_NOMATCH;
 	}
 # endif	/* Not Amiga && not WINDOWS32.  */
     }
@@ -915,8 +947,8 @@
 
 	    /* Now we know how large the gl_pathv vector must be.  */
 	    new_pathv = (char **) realloc (pglob->gl_pathv,
-                                           ((pglob->gl_pathc + 1)
-                                            * sizeof (char *)));
+					   ((pglob->gl_pathc + 1)
+					    * sizeof (char *)));
 	    if (new_pathv != NULL)
 	      pglob->gl_pathv = new_pathv;
 	  }
@@ -1092,6 +1124,8 @@
 }
 
 
+/* We must not compile this function twice.  */
+#if !defined _LIBC || !defined NO_GLOB_PATTERN_P
 /* Return nonzero if PATTERN contains any metacharacters.
    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
 int
@@ -1126,8 +1160,9 @@
 
   return 0;
 }
-#ifdef _LIBC
+# ifdef _LIBC
 weak_alias (__glob_pattern_p, glob_pattern_p)
+# endif
 #endif
 
 
--- /tmp/make-3.77/glob/glob.h	Mon Dec 22 22:59:07 1997
+++ make-3.77/glob/glob.h	Wed Aug 26 12:37:04 1998
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
 
    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
@@ -25,7 +25,9 @@
 #undef	__ptr_t
 #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
 # undef	__P
+# undef __PMT
 # define __P(protos)	protos
+# define __PMT(protos)	protos
 # define __ptr_t	void *
 # if !defined __GNUC__ || __GNUC__ < 2
 #  undef __const
@@ -33,7 +35,9 @@
 # endif
 #else /* Not C++ or ANSI C.  */
 # undef	__P
+# undef __PMT
 # define __P(protos)	()
+# define __PMT(protos)	()
 # undef	__const
 # define __const
 # define __ptr_t	char *
@@ -57,10 +61,12 @@
 # define GLOB_NOMAGIC	 (1 << 11)/* If no magic chars, return the pattern.  */
 # define GLOB_TILDE	 (1 << 12)/* Expand ~user and ~ to home directories. */
 # define GLOB_ONLYDIR	 (1 << 13)/* Match only directories.  */
+# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
+				      if the user name is not available.  */
 # define __GLOB_FLAGS	(GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
 			 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|     \
 			 GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE|     \
-			 GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR)
+			 GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
 #else
 # define __GLOB_FLAGS	(GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
 			 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|     \
@@ -71,41 +77,52 @@
 #define	GLOB_NOSPACE	1	/* Ran out of memory.  */
 #define	GLOB_ABORTED	2	/* Read error.  */
 #define	GLOB_NOMATCH	3	/* No matches found.  */
-
+#define GLOB_NOSYS	4	/* Not implemented.  */
 #ifdef _GNU_SOURCE
 /* Previous versions of this file defined GLOB_ABEND instead of
    GLOB_ABORTED.  Provide a compatibility definition here.  */
 # define GLOB_ABEND GLOB_ABORTED
 #endif
 
-/* This value is returned if the implementation does not support
-   `glob'.  Since this is not the case here it will never be
-   returned but the conformance test suites still require the symbol
-   to be defined.  */
-#if (_XOPEN_SOURCE - 0) == 500
-# define GLOB_NOSYS	(-1)
-#endif
-
 /* Structure describing a globbing run.  */
 #if !defined _AMIGA && !defined VMS /* Buggy compiler.   */
 struct stat;
 #endif
 typedef struct
   {
-    int gl_pathc;		/* Count of paths matched by the pattern.  */
+    size_t gl_pathc;		/* Count of paths matched by the pattern.  */
     char **gl_pathv;		/* List of matched pathnames.  */
-    int gl_offs;		/* Slots to reserve in `gl_pathv'.  */
+    size_t gl_offs;		/* Slots to reserve in `gl_pathv'.  */
     int gl_flags;		/* Set to FLAGS, maybe | GLOB_MAGCHAR.  */
 
     /* If the GLOB_ALTDIRFUNC flag is set, the following functions
        are used instead of the normal file access functions.  */
-    void (*gl_closedir) __P ((void *));
-    struct dirent *(*gl_readdir) __P ((void *));
-    __ptr_t (*gl_opendir) __P ((__const char *));
-    int (*gl_lstat) __P ((__const char *, struct stat *));
-    int (*gl_stat) __P ((__const char *, struct stat *));
+    void (*gl_closedir) __PMT ((void *));
+    struct dirent *(*gl_readdir) __PMT ((void *));
+    __ptr_t (*gl_opendir) __PMT ((__const char *));
+    int (*gl_lstat) __PMT ((__const char *, struct stat *));
+    int (*gl_stat) __PMT ((__const char *, struct stat *));
   } glob_t;
 
+#ifdef _LARGEFILE64_SOURCE
+struct stat64;
+typedef struct
+  {
+    size_t gl_pathc;
+    char **gl_pathv;
+    size_t gl_offs;
+    int gl_flags;
+
+    /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+       are used instead of the normal file access functions.  */
+    void (*gl_closedir) __PMT ((void *));
+    struct dirent64 *(*gl_readdir) __PMT ((void *));
+    __ptr_t (*gl_opendir) __PMT ((__const char *));
+    int (*gl_lstat) __PMT ((__const char *, struct stat64 *));
+    int (*gl_stat) __PMT ((__const char *, struct stat64 *));
+  } glob64_t;
+#endif
+
 /* Do glob searching for PATTERN, placing results in PGLOB.
    The bits defined above may be set in FLAGS.
    If a directory cannot be opened or read and ERRFUNC is not nil,
@@ -114,12 +131,33 @@
    `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
    If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
    Otherwise, `glob' returns zero.  */
+#if _FILE_OFFSET_BITS != 64
 extern int glob __P ((__const char *__pattern, int __flags,
 		      int (*__errfunc) __P ((__const char *, int)),
 		      glob_t *__pglob));
 
 /* Free storage allocated in PGLOB by a previous `glob' call.  */
 extern void globfree __P ((glob_t *__pglob));
+#else
+# if __GNUC__ >= 2
+extern int glob __P ((__const char *__pattern, int __flags,
+		      int (*__errfunc) __P ((__const char *, int)),
+		      glob_t *__pglob)) __asm__ ("glob64");
+
+extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
+# else
+#  define glob glob64
+#  define globfree globfree64
+# endif
+#endif
+
+#ifdef _LARGEFILE64_SOURCE
+extern int glob64 __P ((__const char *__pattern, int __flags,
+			int (*__errfunc) __P ((__const char *, int)),
+			glob64_t *__pglob));
+
+extern void globfree64 __P ((glob64_t *__pglob));
+#endif
 
 
 #ifdef _GNU_SOURCE



   matt.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]