* configure.in: Check whether getuid and getgid exist.
authorIan Lance Taylor <ian@airs.com>
Thu, 27 May 1999 22:48:53 +0000 (22:48 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 27 May 1999 22:48:53 +0000 (22:48 +0000)
* archive.c: Define getuid and getgid as macros if HAVE_GETUID or
HAVE_GETGID are not defined, respectively.
(bfd_write_armap): Don't special case on _WIN32 for getuid and
getgid.
* configure.host: Set ac_cv_func_get{ug}id for *-*-windows*.
* configure, config.in: Rebuild.

bfd/ChangeLog
bfd/archive.c
bfd/config.in
bfd/configure
bfd/configure.host
bfd/configure.in

index facda2789b10782e3831c9fe3793ef74d4b76e0d..09dac05d659ae3f69da6e7345afe878acfb43ec5 100644 (file)
@@ -1,3 +1,13 @@
+1999-05-28  Ian Lance Taylor  <ian@zembu.com>
+
+       * configure.in: Check whether getuid and getgid exist.
+       * archive.c: Define getuid and getgid as macros if HAVE_GETUID or
+       HAVE_GETGID are not defined, respectively.
+       (bfd_write_armap): Don't special case on _WIN32 for getuid and
+       getgid.
+       * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*.
+       * configure, config.in: Rebuild.
+
 1999-05-28  Martin Dorey  <mdorey@madge.com>
 
        * elf32-i960.c: New file.
index 8ac5aa4e95d501b60aa387b4e7727734ad0d1775..ac5aeaf6220d8a8e03eeebcafaff835ab9b72ce5 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for archive files (libraries).
-   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
    Written by Cygnus Support.  Mostly Gumby Henkel-Wallace's fault.
 
@@ -1340,6 +1340,14 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
 \f
 /** A couple of functions for creating ar_hdrs */
 
+#ifndef HAVE_GETUID
+#define getuid() 0
+#endif
+
+#ifndef HAVE_GETGID
+#define getgid() 0
+#endif
+
 /* Takes a filename, returns an arelt_data for it, or NULL if it can't
    make one.  The filename must refer to a filename in the filesystem.
    The filename field of the ar_hdr will NOT be initialized.  If member
@@ -1901,13 +1909,8 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
   bfd_ardata (arch)->armap_datepos = (SARMAG
                                      + offsetof (struct ar_hdr, ar_date[0]));
   sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
-#ifndef _WIN32
   sprintf (hdr.ar_uid, "%ld", (long) getuid ());
   sprintf (hdr.ar_gid, "%ld", (long) getgid ());
-#else
-  sprintf (hdr.ar_uid, "%ld", (long) 666);
-  sprintf (hdr.ar_gid, "%ld", (long) 42);
-#endif
   sprintf (hdr.ar_size, "%-10d", (int) mapsize);
   strncpy (hdr.ar_fmag, ARFMAG, 2);
   for (i = 0; i < sizeof (struct ar_hdr); i++)
index 51fa45b6928d9f732e5864f1b143ad0996f278ae..abb2c7872ccd3db72d2f07ea20f34ae70f452294 100644 (file)
 /* Define if you have the getcwd function.  */
 #undef HAVE_GETCWD
 
+/* Define if you have the getgid function.  */
+#undef HAVE_GETGID
+
 /* Define if you have the getpagesize function.  */
 #undef HAVE_GETPAGESIZE
 
+/* Define if you have the getuid function.  */
+#undef HAVE_GETUID
+
 /* Define if you have the madvise function.  */
 #undef HAVE_MADVISE
 
index 783a3932df82e77c3a81755b004f5442ca01b6a9..83e93e6bdbf510a5894c30bd526566ea47b0e025 100755 (executable)
@@ -4460,7 +4460,7 @@ fi
 
 fi
 
-for ac_func in fcntl getpagesize setitimer sysconf fdopen
+for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 echo "configure:4467: checking for $ac_func" >&5
index ef7048be13cffb3c39c82eeca0c2bac9045de7f5..e24cd600228c4966126c3a4980e41ff7c280dafe 100644 (file)
@@ -63,6 +63,8 @@ m68*-hp-hpux*)                HDEFINES=-DHOST_HP300HPUX ;;
                        ac_cv_func_getpagesize=no
                        ac_cv_func_madvise=no
                        ac_cv_func_mprotect=no
+                       ac_cv_func_getuid=no
+                       ac_cv_func_getgid=no
                        ac_cv_header_sys_file_h=no
                        ac_cv_header_sys_time_h=no
                        ac_cv_header_unistd_h=no
index d5aa882570a7b27875f70ce5d45dda96cf13fe27..94f3ef60feb4569afcc21ddd01160b9608463e0d 100644 (file)
@@ -98,7 +98,7 @@ AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
 AC_HEADER_TIME
 AC_HEADER_DIRENT
-AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen)
+AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
 
 BFD_BINARY_FOPEN
 
This page took 0.035233 seconds and 4 git commands to generate.