zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@fysh.org>
To: tatsuo@kobe.hp.com (Tatsuo Furukawa)
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: zsh for root
Date: Fri, 22 Oct 1999 10:09:26 +0100 (BST)	[thread overview]
Message-ID: <E11eahS-0002Hv-00@crucigera.fysh.org> (raw)
In-Reply-To: <199910220758.QAA09183@kidrd130.kobe.hp.com> from Tatsuo Furukawa at "Oct 22, 1999  4:58:25 pm"

Tatsuo Furukawa wrote:
>I am using HP-UX 10.20.  I want to make "zsh for root".  To do this, I
>must make zsh with static link.  But HP-UX's setlocale() depends
>/usr/lib/libdld.sl, so I can't.

This calls for a configure test.  Actually, two.

If setlocale() is actually unavailable when linking statically, that needs
to be detected by configure, and disable the locale stuff.  If it's just a
case of setlocale() doing stuff that you don't want a root zsh doing, that
needs to be manually configurable.  This patch does both of these things.

-zefram

diff -cr ../zsh-3.1.6-bart-7.old/Src/main.c ./Src/main.c
*** ../zsh-3.1.6-bart-7.old/Src/main.c	Fri Oct 22 09:22:03 1999
--- ./Src/main.c	Fri Oct 22 09:44:59 1999
***************
*** 35,41 ****
  main(int argc, char **argv)
  {
      char **t;
! #ifdef LC_ALL
      setlocale(LC_ALL, "");
  #endif
  
--- 35,41 ----
  main(int argc, char **argv)
  {
      char **t;
! #ifdef USE_LOCALE
      setlocale(LC_ALL, "");
  #endif
  
diff -cr ../zsh-3.1.6-bart-7.old/Src/params.c ./Src/params.c
*** ../zsh-3.1.6-bart-7.old/Src/params.c	Fri Oct 22 09:22:03 1999
--- ./Src/params.c	Fri Oct 22 09:45:40 1999
***************
*** 146,152 ****
  IPDEF2("IFS", ifsgetfn, ifssetfn, PM_DONTIMPORT),
  IPDEF2("_", underscoregetfn, nullsetfn, PM_READONLY),
  
! #ifdef LC_ALL
  # define LCIPDEF(name) IPDEF2(name, strgetfn, lcsetfn, PM_UNSET)
  IPDEF2("LANG", strgetfn, langsetfn, PM_UNSET),
  IPDEF2("LC_ALL", strgetfn, lc_allsetfn, PM_UNSET),
--- 146,152 ----
  IPDEF2("IFS", ifsgetfn, ifssetfn, PM_DONTIMPORT),
  IPDEF2("_", underscoregetfn, nullsetfn, PM_READONLY),
  
! #ifdef USE_LOCALE
  # define LCIPDEF(name) IPDEF2(name, strgetfn, lcsetfn, PM_UNSET)
  IPDEF2("LANG", strgetfn, langsetfn, PM_UNSET),
  IPDEF2("LC_ALL", strgetfn, lc_allsetfn, PM_UNSET),
***************
*** 162,168 ****
  # ifdef LC_TIME
  LCIPDEF("LC_TIME"),
  # endif
! #endif
  
  #define IPDEF4(A,B) {NULL,A,PM_INTEGER|PM_READONLY|PM_SPECIAL,BR((void *)B),SFN(nullsetfn),GFN(intvargetfn),stdunsetfn,10,NULL,NULL,NULL,0}
  IPDEF4("!", &lastpid),
--- 162,168 ----
  # ifdef LC_TIME
  LCIPDEF("LC_TIME"),
  # endif
! #endif /* USE_LOCALE */
  
  #define IPDEF4(A,B) {NULL,A,PM_INTEGER|PM_READONLY|PM_SPECIAL,BR((void *)B),SFN(nullsetfn),GFN(intvargetfn),stdunsetfn,10,NULL,NULL,NULL,0}
  IPDEF4("!", &lastpid),
***************
*** 2444,2450 ****
  
  /* Functions to set value of special parameters `LANG' and `LC_*' */
  
! #ifdef LC_ALL
  static struct localename {
      char *name;
      int category;
--- 2444,2450 ----
  
  /* Functions to set value of special parameters `LANG' and `LC_*' */
  
! #ifdef USE_LOCALE
  static struct localename {
      char *name;
      int category;
***************
*** 2511,2517 ****
  	if (!strcmp(ln->name, pm->nam))
  	    setlocale(ln->category, x ? x : "");
  }
! #endif
  
  /* Function to get value for special parameter `HISTSIZE' */
  
--- 2511,2517 ----
  	if (!strcmp(ln->name, pm->nam))
  	    setlocale(ln->category, x ? x : "");
  }
! #endif /* USE_LOCALE */
  
  /* Function to get value for special parameter `HISTSIZE' */
  
diff -cr ../zsh-3.1.6-bart-7.old/Src/system.h ./Src/system.h
*** ../zsh-3.1.6-bart-7.old/Src/system.h	Fri Oct 22 09:22:03 1999
--- ./Src/system.h	Fri Oct 22 09:44:42 1999
***************
*** 632,634 ****
--- 632,640 ----
  #undef ESRCH
  #define ESRCH EINVAL
  #endif /* BROKEN_KILL_ESRCH */
+ 
+ /* Can we do locale stuff? */
+ #undef USE_LOCALE
+ #if defined(CONFIG_LOCALE) && defined(HAVE_SETLOCALE) && defined(LC_ALL)
+ # define USE_LOCALE 1
+ #endif /* CONFIG_LOCALE && HAVE_SETLOCALE && LC_ALL */
diff -cr ../zsh-3.1.6-bart-7.old/acconfig.h ./acconfig.h
*** ../zsh-3.1.6-bart-7.old/acconfig.h	Fri Oct 22 09:21:58 1999
--- ./acconfig.h	Fri Oct 22 09:38:37 1999
***************
*** 163,168 ****
--- 163,171 ----
   * By default this is defined.                               */
  #undef RESTRICTED_R
  
+ /* Define if you want locale features.  By default this is defined. */
+ #undef CONFIG_LOCALE
+ 
  /* Define to 1 if your termcap library has the ospeed variable */
  #undef HAVE_OSPEED
  /* Define to 1 if you have ospeed, but it is not defined in termcap.h */
diff -cr ../zsh-3.1.6-bart-7.old/configure.in ./configure.in
*** ../zsh-3.1.6-bart-7.old/configure.in	Fri Oct 22 09:21:58 1999
--- ./configure.in	Fri Oct 22 09:40:23 1999
***************
*** 201,206 ****
--- 201,215 ----
  AC_DEFINE(RESTRICTED_R)
  )
  
+ dnl Do you want to disable use of locale functions
+ AC_ARG_ENABLE([locale],
+ [  --disable-locale           turn off locale features],
+ [if test x$enableval = xyes; then
+   AC_DEFINE(CONFIG_LOCALE)
+ fi],
+ AC_DEFINE(CONFIG_LOCALE)
+ )
+ 
  undefine([fndir])dnl
  AC_ARG_ENABLE(fndir,
  [  --enable-fndir=DIR        where functions go (default DATADIR/zsh/functions)],
***************
*** 766,772 ****
                sigprocmask setuid seteuid setreuid setresuid setsid strerror \
                nis_list initgroups fchdir cap_get_proc readlink nice \
  	      getgrgid getgrnam getpwent getpwnam getpwuid setpgrp \
! 	      fseeko ftello mmap munmap msync ftruncate)
  
  dnl ---------------
  dnl CHECK FUNCTIONS
--- 775,781 ----
                sigprocmask setuid seteuid setreuid setresuid setsid strerror \
                nis_list initgroups fchdir cap_get_proc readlink nice \
  	      getgrgid getgrnam getpwent getpwnam getpwuid setpgrp \
! 	      fseeko ftello mmap munmap msync ftruncate setlocale)
  
  dnl ---------------
  dnl CHECK FUNCTIONS
*** ../zsh-3.1.6-bart-7.old/INSTALL	Fri Oct 22 09:21:58 1999
--- ./INSTALL	Fri Oct 22 10:06:34 1999
***************
*** 358,360 ****
--- 358,361 ----
       function-subdirs    # if functions will be installed into subdirectories
       dynamic             # allow dynamically loaded binary modules
       lfs                 # allow configure check for large files
+      locale              # allow use of locale library
END


  reply	other threads:[~1999-10-22  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-22  7:58 Tatsuo Furukawa
1999-10-22  9:09 ` Zefram [this message]
1999-10-22 12:49   ` Tatsuo Furukawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E11eahS-0002Hv-00@crucigera.fysh.org \
    --to=zefram@fysh.org \
    --cc=tatsuo@kobe.hp.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).