diff --git a/Makefile b/Makefile
index 7a066516a64d6469074e49160133dd4d92ad0d39..47ef0226076203625f762f7d49037aca13834d0f 100644
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,12 @@ INSTALLVHOOK=install-vhook
 CLEANVHOOK=clean-vhook
 endif
 
+ifeq ($(TARGET_OS), SunOS)
+TEST=/usr/bin/test
+else
+TEST=test
+endif
+
 OBJS = ffmpeg.o ffserver.o
 SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
 FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
@@ -112,7 +118,7 @@ endif
 
 .libs: lib
 	@test -f .libs || touch .libs
-	@for i in $(DEP_LIBS) ; do if test $$i -nt .libs ; then touch .libs; fi ; done
+	@for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
 
 clean: $(CLEANVHOOK)
 	$(MAKE) -C libavcodec clean
diff --git a/configure b/configure
index 9bacced277cfcedbc280724a68181e45a9f2c7c6..3aac719b2b3038f0f6855b9ff2a8675d3b1b2f56 100755
--- a/configure
+++ b/configure
@@ -568,8 +568,7 @@ EOF
 
 freetype2=no
 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
-  which freetype-config > /dev/null
-  if test $? -eq 0; then
+  if test "`which freetype-config`" != ""; then
     if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  2> /dev/null ; then
       freetype2=yes
     fi
@@ -864,6 +863,10 @@ if test "$os2" = "yes" ; then
   echo "CONFIG_OS2=yes" >> config.mak
 fi
 
+if test "$TARGET_OS" = "SunOS" ; then
+  echo "#define CONFIG_SUNOS 1" >> $TMPH
+fi
+
 if test "$darwin" = "yes"; then
   echo "#define CONFIG_DARWIN 1"  >> $TMPH
   echo "CONFIG_DARWIN=yes" >> config.mak
diff --git a/libavcodec/os_support.h b/libavcodec/os_support.h
index c3b3482b69dc22a3f9b0513011ad034d5e185a58..93930f03bacac49be4b942bd36a3c4d0535d28da 100644
--- a/libavcodec/os_support.h
+++ b/libavcodec/os_support.h
@@ -30,4 +30,8 @@ static inline float floorf(float f) { return floor(f); }
 static inline int strcasecmp(const char* s1, const char* s2) { return stricmp(s1,s2); }
 #endif
 
+#if defined(CONFIG_SUNOS)
+static inline float floorf(float f) { return floor(f); }
+#endif
+
 #endif /* _OS_SUPPORT_H */
diff --git a/tests/Makefile b/tests/Makefile
index 82c671e699b481a379de72d01479fda0b341aea0..2508456ac2cace0e0b0269ae5804ac0bc43a4356 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -73,4 +73,4 @@ dsptest: dsptest.c $(DSPDEPS)
 
 clean:
 	rm -rf vsynth1 vsynth2 data
-	rm -f asynth1.sw *~ audiogen videogen
+	rm -f asynth1.sw *~ audiogen videogen rotozoom tiny_psnr 
diff --git a/tests/regression.sh b/tests/regression.sh
index 227c413739ed0c807ebc47a795dd30aef13c8f65..eda779e48551523839681cced37c493e8f43ec6f 100755
--- a/tests/regression.sh
+++ b/tests/regression.sh
@@ -4,6 +4,14 @@
 #
 #
 #set -x
+# Even in the 21st century some diffs are not supporting -u.
+diff -u $0 $0 > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+  diff_cmd="diff -u"
+else
+  diff_cmd="diff"
+fi
+
 set -e
 
 datadir="./data"
@@ -61,7 +69,7 @@ do_ffmpeg()
     shift
     echo $ffmpeg -bitexact -dct_algo 1 -idct_algo 2 $*
     $ffmpeg -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
-    grep -v -e ^Stream -e ^Press -e ^Input -e ^Output -e ^frame -e '^  Stream' /tmp/ffmpeg$$ || true
+    egrep -v "^(Stream|Press|Input|Output|frame|  Stream)" /tmp/ffmpeg$$ || true
     rm -f /tmp/ffmpeg$$
     md5sum -b $f >> $logfile
     if [ $f = $raw_dst ] ; then
@@ -377,7 +385,7 @@ fi
 
 
 
-if diff -u $logfile $reffile ; then
+if $diff_cmd $logfile $reffile ; then
     echo 
     echo Regression test succeeded.
     exit 0