aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac18
2 files changed, 19 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 54085387..ad0e369f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,7 +47,7 @@ DEPENDENCIES= libfm.a $(LIBOBJS)
check_PROGRAMS=
TESTS= t.smoke t.validate-xhtml
-TESTS_ENVIRONMENT= srcdir="$(srcdir)" LC_ALL=C TZ=UTC SHELL="$(SHELL)"
+TESTS_ENVIRONMENT= srcdir="$(srcdir)" LC_ALL=C TZ=UTC SHELL="$(SHELL)" $(SHELL)
if NEED_TRIO
noinst_LIBRARIES+= libtrio.a
@@ -116,8 +116,6 @@ netrc_CFLAGS= -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
mxget_SOURCES= mxget.c
mxget_CFLAGS= -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
-# For some losing Unix makes.
-SHELL = /bin/sh
@SET_MAKE@
fetchmail.spec: Makefile.in specgen.sh
diff --git a/configure.ac b/configure.ac
index 40fa405e..9017f218 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,24 @@ dnl INTERACTIVE Systems Corporation Unix on 2006-07-23. New programs
dnl need not use this macro. It is implemented as
dnl `AC_SEARCH_LIBS([strerror], [cposix])'
+dnl check for b0rked Solaris (and other shells) and find one that works
+AC_MSG_CHECKING(for a working shell...)
+for i in /usr/xpg6/bin/sh /usr/xpg4/bin/sh /usr/ccs/bin/sh /bin/sh /usr/bin/sh /bin/ksh /bin/bash /usr/local/bin/bash ; do
+ $i -c 'if ! false ; then echo $(echo ok) ; fi' >config.$$ 2>/dev/null
+ j=`cat config.$$`
+ rm -f config.$$
+ if test "x$j" = "xok" ; then
+ SHELL=$i
+ AC_SUBST(SHELL)
+ break
+ fi
+done
+AC_MSG_RESULT($SHELL)
+if test "x$SHELL" = "x" ; then
+ AC_MSG_ERROR(no SUS compliant shell found - on Solaris, install SUNWxcu4)
+fi
+
+
AC_HEADER_STDC
AC_HEADER_TIME
AC_TYPE_SIZE_T