Discussion:
[Dvipng] small fix to configure.ac
Moraes, Mark
2006-05-26 00:05:35 UTC
Permalink
On Solaris and lots of other Unix variants, 'which' is a csh script that
takes a long time to run, and at least on my Solaris, produces output
that fails to work with cp (I'm still a bit puzzled why). Anyway, using
the sh builtin 'type' is much faster and works well. (Solaris 8 sh
doesn't support 'type -p', alas)

Mark.

*** configure.ac- Mon Feb 27 07:05:56 2006
--- configure.ac Thu May 25 19:56:04 2006
***************
*** 187,193 ****
TEXMF_CNF=`kpsewhich texmf.cnf`
AC_MSG_RESULT([$TEXMF_CNF])
AC_MSG_CHECKING([for psfonts.map])
! cp `which kpsewhich` .
PSFONTS_MAP=`./kpsewhich psfonts.map`
rm -f ./kpsewhich
if test -n "$PSFONTS_MAP"; then
--- 187,193 ----
TEXMF_CNF=`kpsewhich texmf.cnf`
AC_MSG_RESULT([$TEXMF_CNF])
AC_MSG_CHECKING([for psfonts.map])
! cp `type kpsewhich | awk '$2 == "is" {print $3}'` .
PSFONTS_MAP=`./kpsewhich psfonts.map`
rm -f ./kpsewhich
if test -n "$PSFONTS_MAP"; then
Jan-Åke Larsson
2006-11-07 21:52:42 UTC
Permalink
Post by Moraes, Mark
On Solaris and lots of other Unix variants, 'which' is a csh script that
takes a long time to run, and at least on my Solaris, produces output
that fails to work with cp (I'm still a bit puzzled why). Anyway, using
the sh builtin 'type' is much faster and works well. (Solaris 8 sh
doesn't support 'type -p', alas)
Sure? On Solaris 9 and 10, 'which' is a tcsh built-in. No other reports
have ever mentioned this.

/JÅ
Moraes, Mark
2006-11-07 22:53:51 UTC
Permalink
configure is a Bourne-shell script, so the tcsh 'which' builtin
isn't relevant to it. Instead sh will search PATH for an
executable. On Linux and Solaris, that'll most
likely be /usr/bin/which; on Linux, that's an executable
compiled from a C program, works just fine.
But on Solaris 8 and 10, (and as far as I remember,
on all 4.* BSD derived systems, SunOS3,4 as well)
it's a executable csh script that starts with #!/usr/bin/csh -f
and then pretends to be interactive by setting $prompt
and then sourcing the user's .cshrc; given that many
csh users use if ( $?prompt ) to protect interactive initialization
(echo, evals, terminal settings etc), this csh script
is somewhat unpredictable, to put it mildly...

"type" has been a Bourne-shell builtin for long enough that
it's significantly more portable/reliable. (Wasn't in v7 or
4BSD, but pretty much every other Un*x)

I'd guess that since Linux or bash users won't see this,
it'd have to be a Solaris *csh user with a non-trivial
.cshrc who'd run into this problem :-)

Mark.

-----Original Message-----
From: Jan-Åke Larsson [mailto:***@mai.liu.se]
Sent: Tuesday, November 07, 2006 4:53 PM
To: Moraes, Mark; ***@nongnu.org
Subject: Re: [Dvipng] small fix to configure.ac
Post by Moraes, Mark
On Solaris and lots of other Unix variants, 'which' is a csh script that
takes a long time to run, and at least on my Solaris, produces output
that fails to work with cp (I'm still a bit puzzled why). Anyway, using
the sh builtin 'type' is much faster and works well. (Solaris 8 sh
doesn't support 'type -p', alas)
Sure? On Solaris 9 and 10, 'which' is a tcsh built-in. No other reports
have ever mentioned this.

/JÅ
Jan-Åke Larsson
2006-11-08 08:04:32 UTC
Permalink
Post by Moraes, Mark
configure is a Bourne-shell script, so the tcsh 'which' builtin
isn't relevant to it.
Ah. You mentioned tcsh in your mailing so that threw me off the mark.
And sh finds the csh script 'which'. Amusing. In my opinion csh scripts
are an abomination :-)

Then, I might as well bite the bullet and use AC_CHECK_PROG proper.
/JÅ
--
[ This .signature intentionally left blank ]
Loading...