You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Justin Erenkrantz <je...@ebuilt.com> on 2001/12/15 08:01:45 UTC

[PATCH] Fix buildcheck.sh on Solaris

The /bin/sh on Solaris does not seem to support the 
$(which glibtool...) semantics.  Furthermore, converting it to
`which glibtool libtool...` on Solaris does not work either as 
which does not send "not found" errors to stderr but to stdout.
This results in $libtool set to "glibtool not found" even when
libtool is in the path.

So, the following must be applied to get buildcheck.sh to 
work on Solaris.  -- justin

----

buildcheck.sh: Make libtool detection work with Solaris and /bin/sh.

Index: buildcheck.sh
===================================================================
--- .svn/text-base/buildcheck.sh.svn-base	Fri Dec 14 23:43:07 2001
+++ buildcheck.sh	Fri Dec 14 23:51:41 2001
@@ -20,7 +20,10 @@
 echo "buildcheck: autoconf version $ac_version (ok)"
 
 # libtool 1.4 or newer
-libtool=$(which glibtool libtool 2>/dev/null | head -1)
+libtool=`which glibtool`
+if test ! -x "$libtool"; then
+  libtool=`which libtool`
+fi
 lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
 if test -z "$lt_pversion"; then
   echo "buildcheck: libtool not found."


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Fix buildcheck.sh on Solaris

Posted by Russ Allbery <rr...@stanford.edu>.
subversion-dev <su...@thewrittenword.com> writes:

> /usr/xpg4/bin/sh will give you $() on Solaris. I think what you should
> check for is a POSIX-compatible shell and run buildcheck.sh with that.
> I'm not 100% sure POSIX defines $() though.

/usr/xpg4/bin/sh is part of an optional additional package and therefore
isn't reliably available.  /bin/ksh is a better choice on Solaris.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Fix buildcheck.sh on Solaris

Posted by su...@thewrittenword.com.
On Sat, Dec 15, 2001 at 12:01:45AM -0800, Justin Erenkrantz wrote:
> The /bin/sh on Solaris does not seem to support the 
> $(which glibtool...) semantics.  Furthermore, converting it to
> `which glibtool libtool...` on Solaris does not work either as 
> which does not send "not found" errors to stderr but to stdout.
> This results in $libtool set to "glibtool not found" even when
> libtool is in the path.
> 
> So, the following must be applied to get buildcheck.sh to 
> work on Solaris.  -- justin

/usr/xpg4/bin/sh will give you $() on Solaris. I think what you should
check for is a POSIX-compatible shell and run buildcheck.sh with that.
I'm not 100% sure POSIX defines $() though.

I've attached an autoconf macro, AC_PROG_SHELL, written by Paul
Eggert, that should find you a POSIX-compatible shell. I'm not sure
about the license for this macro so I've cc'ed Paul Eggert for
clarification.

-- 
albert chin (china@thewrittenword.com)

-- snip snip
#serial 1

# Check for a working (i.e. POSIX-compatible) shell.

# Written by Paul Eggert <eg...@twinsun.com>,
# from an idea suggested by Albert Chin-A-Young <ch...@thewrittenword.com>.

AC_DEFUN(AC_PROG_SHELL,
  [AC_MSG_CHECKING(for a POSIX-compliant shell)
   AC_CACHE_VAL(ac_cv_path_shell,
     [ac_cv_path_shell=no
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
      ac_dummy=/bin:/usr/bin:/usr/bin/posix:/usr/xpg4/bin:$PATH
      for ac_dir in $ac_dummy; do
	for ac_base in sh bash ksh sh5; do
	  case "$ac_dir" in
	  /*)
	    if ("$ac_dir/$ac_base" -c '

		  # Test the noclobber option,
		  # using the portable POSIX.2 syntax.
		  set -C
		  rm -f conftest.c || exit
		  >conftest.c || exit
		  >|conftest.c || exit
		  !>conftest.c || exit

	        ') 2>/dev/null; then
	      ac_cv_path_shell="$ac_dir/$ac_base"
	      break
	    fi
	    ;;
	  esac
	done
	if test "$ac_cv_path_shell" != no; then
	  break
	fi
      done
      IFS="$ac_save_ifs"])
   AC_MSG_RESULT($ac_cv_path_shell)
   SHELL=$ac_cv_path_shell
   if test "$SHELL" = no; then
     SHELL=/bin/sh
     AC_MSG_WARN(Using $SHELL, even though it is not POSIX-compliant)
   fi
   AC_SUBST(SHELL)])

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Fix buildcheck.sh on Solaris

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Justin Erenkrantz <je...@ebuilt.com> writes:
> The /bin/sh on Solaris does not seem to support the 
> $(which glibtool...) semantics.  Furthermore, converting it to
> `which glibtool libtool...` on Solaris does not work either as 
> which does not send "not found" errors to stderr but to stdout.
> This results in $libtool set to "glibtool not found" even when
> libtool is in the path.
> 
> So, the following must be applied to get buildcheck.sh to 
> work on Solaris.  -- justin

Applied, thanks Justin.

Slight tweak: in the first attempt, I made it redirect error to
/dev/null, since on those platforms that use stderr and don't have
glibtool, there's no point in the user seeing that the attempt
failed.

-K

> buildcheck.sh: Make libtool detection work with Solaris and /bin/sh.
> 
> Index: buildcheck.sh
> ===================================================================
> --- .svn/text-base/buildcheck.sh.svn-base	Fri Dec 14 23:43:07 2001
> +++ buildcheck.sh	Fri Dec 14 23:51:41 2001
> @@ -20,7 +20,10 @@
>  echo "buildcheck: autoconf version $ac_version (ok)"
>  
>  # libtool 1.4 or newer
> -libtool=$(which glibtool libtool 2>/dev/null | head -1)
> +libtool=`which glibtool`
> +if test ! -x "$libtool"; then
> +  libtool=`which libtool`
> +fi
>  lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
>  if test -z "$lt_pversion"; then
>    echo "buildcheck: libtool not found."
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org