From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10060 invoked from network); 25 Mar 2000 15:41:02 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Mar 2000 15:41:02 -0000 Received: (qmail 15161 invoked by alias); 25 Mar 2000 15:40:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10242 Received: (qmail 15149 invoked from network); 25 Mar 2000 15:40:52 -0000 Date: Sat, 25 Mar 2000 10:40:18 -0500 From: Clint Adams To: zsh-workers@sunsite.auc.dk Subject: PATCH: 3.1.6-dev-20: runtime determination of MACHTYPE Message-ID: <20000325104018.A3765@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.1.2i 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));