Source-Changes-HG archive

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

[src/trunk]: src/tools/compat * Check for mkstemp() and mkdtemp(), and build ...



details:   https://anonhg.NetBSD.org/src/rev/7b821da408e4
branches:  trunk
changeset: 536377:7b821da408e4
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 14 04:30:27 2002 +0000

description:
* Check for mkstemp() and mkdtemp(), and build them into libnbcompat
  if necessary.
* mktemp is now a host-tool, so nuke the lame script (which isn't even
  properly installed during the tools bootstrap).

diffstat:

 tools/compat/Makefile       |  15 ++++++++-------
 tools/compat/compat_defs.h  |  15 ++++++++++++++-
 tools/compat/config.h.in    |   4 +++-
 tools/compat/configure      |   8 ++++----
 tools/compat/configure.ac   |  10 +++++-----
 tools/compat/scripts/mktemp |  11 -----------
 6 files changed, 34 insertions(+), 29 deletions(-)

diffs (137 lines):

diff -r 4783aebb38ab -r 7b821da408e4 tools/compat/Makefile
--- a/tools/compat/Makefile     Sat Sep 14 04:26:23 2002 +0000
+++ b/tools/compat/Makefile     Sat Sep 14 04:30:27 2002 +0000
@@ -1,14 +1,14 @@
-#      $NetBSD: Makefile,v 1.14 2002/09/13 19:07:01 thorpej Exp $
+#      $NetBSD: Makefile,v 1.15 2002/09/14 04:30:27 thorpej Exp $
 
 HOSTLIB=       nbcompat
 
 SRCS=          basename.c dirname.c fgetln.c flock.c fparseln.c \
-               getmode.c getopt_long.c issetugid.c libyywrap.c \
-               md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c pread.c \
-               pwcache.c pwrite.c pw_scan.c rmd160.c rmd160hl.c setenv.c \
-               setgroupent.c setpassent.c setprogname.c sha1.c sha1hl.c \
-               snprintf.c strlcat.c strlcpy.c strmode.c strsep.c \
-               unvis.c vis.c \
+               getmode.c getopt_long.c gettemp.c issetugid.c libyywrap.c \
+               md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c mkdtemp.c \
+               mkstemp.c pread.c pwcache.c pwrite.c pw_scan.c rmd160.c \
+               rmd160hl.c setenv.c setgroupent.c setpassent.c setprogname.c \
+               sha1.c sha1hl.c snprintf.c strlcat.c strlcpy.c strmode.c \
+               strsep.c unvis.c vis.c \
                _err.c _errx.c _verr.c _verrx.c _vwarn.c _vwarnx.c \
                _warn.c _warnx.c __fts13.c __glob13.c
 
@@ -21,6 +21,7 @@
 .PATH:         ${.CURDIR}/../../lib/libc/gen \
                ${.CURDIR}/../../lib/libc/hash \
                ${.CURDIR}/../../lib/libc/md \
+               ${.CURDIR}/../../lib/libc/stdio \
                ${.CURDIR}/../../lib/libc/stdlib \
                ${.CURDIR}/../../lib/libc/string \
                ${.CURDIR}/../../lib/libutil \
diff -r 4783aebb38ab -r 7b821da408e4 tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Sat Sep 14 04:26:23 2002 +0000
+++ b/tools/compat/compat_defs.h        Sat Sep 14 04:30:27 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_defs.h,v 1.17 2002/09/13 23:35:34 bjh21 Exp $   */
+/*     $NetBSD: compat_defs.h,v 1.18 2002/09/14 04:30:27 thorpej Exp $ */
 
 #ifndef        __NETBSD_COMPAT_DEFS_H__
 #define        __NETBSD_COMPAT_DEFS_H__
@@ -190,6 +190,19 @@
                         ((u_int64_t)bswap32((x) >> 32)))
 #endif
 
+#if !HAVE_MKSTEMP
+int mkstemp(char *);
+#endif
+
+#if !HAVE_MKDTEMP
+char *mkdtemp(char *);
+#endif
+
+#if !HAVE_MKSTEMP || !HAVE_MKDTEMP
+/* This is a prototype for the internal function. */
+int gettemp(char *, int *, int);
+#endif
+
 #if !HAVE_PREAD
 ssize_t pread(int, void *, size_t, off_t);
 #endif
diff -r 4783aebb38ab -r 7b821da408e4 tools/compat/config.h.in
--- a/tools/compat/config.h.in  Sat Sep 14 04:26:23 2002 +0000
+++ b/tools/compat/config.h.in  Sat Sep 14 04:30:27 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config.h.in,v 1.20 2002/09/13 19:07:01 thorpej Exp $   */
+/*     $NetBSD: config.h.in,v 1.21 2002/09/14 04:30:27 thorpej Exp $   */
 
 #ifndef        __NETBSD_COMPAT_CONFIG_H__
 #define        __NETBSD_COMPAT_CONFIG_H__
@@ -62,6 +62,8 @@
 #undef HAVE_LCHMOD
 #undef HAVE_LCHOWN
 #undef HAVE_LUTIMES
+#undef HAVE_MKSTEMP
+#undef HAVE_MKDTEMP
 #undef HAVE_PREAD
 #undef HAVE_PWCACHE_USERDB
 #undef HAVE_PWRITE
diff -r 4783aebb38ab -r 7b821da408e4 tools/compat/configure
--- a/tools/compat/configure    Sat Sep 14 04:26:23 2002 +0000
+++ b/tools/compat/configure    Sat Sep 14 04:30:27 2002 +0000
@@ -4583,10 +4583,10 @@
 
 for ac_func in asprintf asnprintf basename dirfd dirname \
        fgetln flock fparseln futimes getopt getopt_long \
-       isblank issetugid lchmod lchown lutimes pread pwcache_userdb \
-       pwrite random setenv setgroupent setprogname setpassent \
-       snprintf strlcat strlcpy strsep user_from_uid \
-       vasprintf vasnprintf vsnprintf
+       isblank issetugid lchmod lchown lutimes mkstemp mkdtemp \
+       pread pwcache_userdb pwrite random setenv setgroupent \
+       setprogname setpassent snprintf strlcat strlcpy strsep \
+       user_from_uid vasprintf vasnprintf vsnprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:4592: checking for $ac_func" >&5
diff -r 4783aebb38ab -r 7b821da408e4 tools/compat/configure.ac
--- a/tools/compat/configure.ac Sat Sep 14 04:26:23 2002 +0000
+++ b/tools/compat/configure.ac Sat Sep 14 04:30:27 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: configure.ac,v 1.22 2002/09/13 19:07:01 thorpej Exp $
+#      $NetBSD: configure.ac,v 1.23 2002/09/14 04:30:27 thorpej Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -95,10 +95,10 @@
 AC_SEARCH_LIBS(fparseln, util)
 AC_CHECK_FUNCS(asprintf asnprintf basename dirfd dirname \
        fgetln flock fparseln futimes getopt getopt_long \
-       isblank issetugid lchmod lchown lutimes pread pwcache_userdb \
-       pwrite random setenv setgroupent setprogname setpassent \
-       snprintf strlcat strlcpy strsep user_from_uid \
-       vasprintf vasnprintf vsnprintf)
+       isblank issetugid lchmod lchown lutimes mkstemp mkdtemp \
+       pread pwcache_userdb pwrite random setenv setgroupent \
+       setprogname setpassent snprintf strlcat strlcpy strsep \
+       user_from_uid vasprintf vasnprintf vsnprintf)
 
 AC_CHECK_DECLS([setgroupent, setpassent],,, [
 #include <grp.h>
diff -r 4783aebb38ab -r 7b821da408e4 tools/compat/scripts/mktemp
--- a/tools/compat/scripts/mktemp       Sat Sep 14 04:26:23 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#! /bin/sh
-#
-# $NetBSD: mktemp,v 1.1 2002/01/31 22:43:50 tv Exp $
-#
-# A script that pretends to act like a stripped-down version of mktemp(1).
-# This is used by lorder.sh, and possibly other script-based host tools.
-# This version simply replaces the X's with mktemp's pid ($$).
-
-fname=`echo $1 | sed 's,XX*$,'$$','`
-touch $fname || exit 1
-echo $fname



Home | Main Index | Thread Index | Old Index