zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: 3.1.6-dev-20: runtime determination of MACHTYPE
@ 2000-03-25 15:40 Clint Adams
  2000-03-25 17:15 ` Bart Schaefer
  2000-03-26 13:13 ` Zefram
  0 siblings, 2 replies; 6+ messages in thread
From: Clint Adams @ 2000-03-25 15:40 UTC (permalink / raw)
  To: zsh-workers

This patch allows zsh to determine MACHTYPE at run-time, rather
than from the configure results of the build-machine, assuming
uname(2) is available.

I assume that the overhead is low enough that no one will feel
the need to disable this.

Index: configure.in
===================================================================
RCS file: /cvs/zsh/zsh/configure.in,v
retrieving revision 1.1.1.64
diff -u -r1.1.1.64 configure.in
--- configure.in	2000/03/13 01:52:19	1.1.1.64
+++ configure.in	2000/03/25 15:34:25
@@ -826,7 +826,8 @@
 	       mmap munmap msync \
 	       cap_get_proc \
 	       getrlimit \
-	       setlocale)
+	       setlocale \
+	       uname)
 AC_FUNC_STRCOLL
 
 if test $ac_cv_func_setpgrp = yes; then
Index: Src/params.c
===================================================================
RCS file: /cvs/zsh/zsh/Src/params.c,v
retrieving revision 1.1.1.48
diff -u -r1.1.1.48 params.c
--- Src/params.c	2000/03/14 08:17:02	1.1.1.48
+++ Src/params.c	2000/03/25 15:34:25
@@ -453,6 +453,10 @@
     char **new_environ, **envp, **envp2, **sigptr, **t;
     char buf[50], *str, *iname;
     int num_env, oae = opts[ALLEXPORT];
+#ifdef HAVE_UNAME
+    struct utsname unamebuf;
+    char *machinebuf;
+#endif
 
     paramtab = realparamtab = newparamtable(151, "paramtab");
 
@@ -538,7 +542,17 @@
 
     /* Add the standard non-special parameters */
     set_pwd_env();
+#ifdef HAVE_UNAME
+    if(uname(&unamebuf)) setsparam("MACHTYPE", ztrdup(MACHTYPE));
+    else
+    {
+       machinebuf = ztrdup(unamebuf.machine);
+       setsparam("MACHTYPE", machinebuf);
+    }
+	
+#else
     setsparam("MACHTYPE", ztrdup(MACHTYPE));
+#endif
     setsparam("OSTYPE", ztrdup(OSTYPE));
     setsparam("TTY", ztrdup(ttystrname));
     setsparam("VENDOR", ztrdup(VENDOR));


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-03-26 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-25 15:40 PATCH: 3.1.6-dev-20: runtime determination of MACHTYPE Clint Adams
2000-03-25 17:15 ` Bart Schaefer
2000-03-25 17:55   ` Thomas Köhler
2000-03-26 13:13 ` Zefram
2000-03-26 18:58   ` Clint Adams
2000-03-26 20:11     ` Zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).