]> git.sesse.net Git - vlc/blobdiff - configure
MacOS X port : native QuickTime video output, courtesy of Florian G.
[vlc] / configure
index fed795101b52eb3b5da140b940331c952bb6dd37..7ed641a18fbdcbecc63f1be07d62b247299537fc 100755 (executable)
--- a/configure
+++ b/configure
@@ -12,37 +12,57 @@ ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_help="$ac_help
-  --disable-dummy         dummy module (default enabled)"
-ac_help="$ac_help
-  --disable-null          Null module (default enabled)"
+  --with-words=endianness Set endianness (big or little)"
 ac_help="$ac_help
-  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)"
+  --with-tuning=[arch]    Enable special tuning for an architecture
+                          (default i686 on IA-32 and 750 on PPC)"
 ac_help="$ac_help
   --disable-mmx           Disable MMX optimizations (default enabled for x86)"
 ac_help="$ac_help
-  --enable-altivec        Enable altivec optimizations (default disabled since it is broken)"
-ac_help="$ac_help
-  --disable-css           Disable DVD CSS decryption (default enabled)"
+  --disable-altivec       Disable altivec optimizations (default enabled on PPC)"
 ac_help="$ac_help
   --enable-debug          Enable debug mode (default disabled)"
 ac_help="$ac_help
-  --enable-stats          Enable printing of statistics (default disabled)"
+  --enable-trace          Enable trace mode (default disabled)"
+ac_help="$ac_help
+  --enable-gprof          Enable gprof profiling (default disabled)"
+ac_help="$ac_help
+  --enable-cprof          Enable cprof profiling (default disabled)"
 ac_help="$ac_help
   --disable-optimizations Disable compiler optimizations (default enabled)"
+ac_help="$ac_help
+  --enable-pth            Enable GNU Pth support (default disabled)"
+ac_help="$ac_help
+  --with-dvdcss[=name]    way to use libdvdcss, either 'yes' or 'no',
+                          or 'local-static', 'local-shared', or a path to
+                          another libdvdcss such as '/usr/local'
+                          (default 'local-static')"
+ac_help="$ac_help
+  --disable-dummy         dummy module (default enabled)"
+ac_help="$ac_help
+  --disable-null          Null module (default enabled)"
+ac_help="$ac_help
+  --disable-rc            rc module (default enabled)"
 ac_help="$ac_help
   --disable-dsp           Linux /dev/dsp support (default enabled)"
 ac_help="$ac_help
   --enable-esd            Esound library support (default disabled)"
 ac_help="$ac_help
-  --enable-darwin         Darwin sound support (default disabled)"
+  --enable-darwin         Darwin sound support (default enabled on MacOS X)"
+ac_help="$ac_help
+  --enable-macosx         MacOS X support (default enabled on MacOS X)"
 ac_help="$ac_help
-  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)"
+  --disable-qnx           QNX RTOS support (default enabled on QNX RTOS)"
 ac_help="$ac_help
   --enable-fb             Linux framebuffer support (default disabled)"
 ac_help="$ac_help
   --with-ggi[=name]       GGI support (default disabled)"
 ac_help="$ac_help
-  --with-sdl[=name]       SDL support (default enabled)"
+  --disable-sdl           SDL support (default enabled)"
+ac_help="$ac_help
+  --with-sdl-config-path=path sdl-config path (default search in \$PATH)"
+ac_help="$ac_help
+  --with-directx[=name]   Windows DirectX support (default enabled)"
 ac_help="$ac_help
   --with-glide[=name]     Glide (3dfx) support (default disabled)"
 ac_help="$ac_help
@@ -58,9 +78,12 @@ ac_help="$ac_help
 ac_help="$ac_help
   --disable-x11           X11 support (default enabled)"
 ac_help="$ac_help
-  --enable-xvideo         XVideo interface support (default disabled)"
+  --disable-xvideo        XVideo support (default enabled)"
 ac_help="$ac_help
-  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)"
+  --enable-alsa           Alsa sound drivers support (Only for linux)
+                          (default disabled)"
+ac_help="$ac_help
+  --disable-plugins       Make all plug-ins built-in (default plug-ins enabled)"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -501,7 +524,7 @@ echo > confdefs.h
 
 # A filename unique to this package, relative to the directory that
 # configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=src/interface/main.c
+ac_unique_file=include/common.h
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
@@ -593,13 +616,34 @@ ac_config_sub=$ac_aux_dir/config.sub
 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 
 
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+#    same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+#    as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
 # Make sure we can run config.sub.
 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:603: checking host system type" >&5
+echo "configure:647: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -619,14 +663,69 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:668: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+  case $nonopt in
+  NONE) target_alias=$host_alias ;;
+  *) target_alias=$nonopt ;;
+  esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:686: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
 
-VLC_VERSION=0.2.72
+HAVE_VLC=0
+if test -r src/interface/main.c; then
+  HAVE_VLC=1
+  VLC_VERSION=0.2.83
+  
+  VLC_CODENAME=Ourumov
+  
+fi
 
-VLC_CODENAME=Ourumov
+HAVE_LIBDVDCSS=0
+if test -r extras/libdvdcss/libdvdcss.c; then
+  HAVE_LIBDVDCSS=1
+  LIBDVDCSS_VERSION=0.0.3
+  
+fi
 
+save_CFLAGS="${CFLAGS}"
+save_LDFLAGS="${LDFLAGS}"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:630: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:729: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -652,11 +751,10 @@ else
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
-if test -z "$CC"; then
-  # Extract the first word of "gcc", so it can be a program name with args.
+# Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:660: checking for $ac_word" >&5
+echo "configure:758: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -686,7 +784,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:690: checking for $ac_word" >&5
+echo "configure:788: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -737,7 +835,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:741: checking for $ac_word" >&5
+echo "configure:839: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -769,7 +867,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:773: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:871: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -780,12 +878,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 784 "configure"
+#line 882 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -811,12 +909,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:913: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:820: checking whether we are using GNU C" >&5
+echo "configure:918: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -825,7 +923,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -844,7 +942,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:848: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:946: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -875,10 +973,8 @@ else
   fi
 fi
 
-fi
-if test -z "$CPP"; then
-  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:882: checking how to run the C preprocessor" >&5
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:978: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -893,13 +989,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 897 "configure"
+#line 993 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -910,13 +1006,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 914 "configure"
+#line 1010 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -927,13 +1023,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 931 "configure"
+#line 1027 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -957,8 +1053,37 @@ else
 fi
 echo "$ac_t""$CPP" 1>&6
 
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1060: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
 fi
 
+
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -971,7 +1096,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:975: checking for a BSD compatible install" >&5
+echo "configure:1100: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1024,90 +1149,16 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1029: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1034 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this.  */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this.  */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
-   It does not let you subtract one const X* pointer from another in an arm
-   of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this.  */
-  char *t;
-  char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-  *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-  int x[] = {25, 17};
-  const int *foo = &x[0];
-  ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-  typedef const int *iptr;
-  iptr p = 0;
-  ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
-     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-  struct s { int j; const int *ap[3]; };
-  struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-  const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:1083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_c_const=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_c_const=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
-if test $ac_cv_c_const = no; then
-  cat >> confdefs.h <<\EOF
-#define const 
-EOF
-
-fi
-
-echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1104: checking whether byte ordering is bigendian" >&5
+if test x${cross_compiling} != xyes; then
+  echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
+echo "configure:1155: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 1111 "configure"
+#line 1162 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1118,11 +1169,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 1126 "configure"
+#line 1177 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1133,7 +1184,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:1137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -1153,7 +1204,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1157 "configure"
+#line 1208 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -1166,7 +1217,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:1170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -1189,16 +1240,74 @@ EOF
 
 fi
 
+else
+      # Check whether --with-words or --without-words was given.
+if test "${with_words+set}" = set; then
+  withval="$with_words"
+  :
+fi
+
+  case "x$withval" in
+    xbig)
+      ac_cv_c_bigendian=yes
+      ;;
+    xlittle)
+      ac_cv_c_bigendian=no
+      ;;
+    *)
+                  ac_cv_c_bigendian=unknown
+      echo $ac_n "checking what the byte order looks to be""... $ac_c" 1>&6
+echo "configure:1261: checking what the byte order looks to be" >&5
+        cat >conftest.c <<EOF
+        short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
+        short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
+        void _a(void) { char*s = (char*)am; s = (char *)ai; }
+        short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
+        short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
+        void _e(void) { char*s = (char*)em; s = (char*)ei; }
+        int main(void) { _a(); _e(); return 0; }
+EOF
+      
+      if test -f conftest.c
+      then 
+        if ${CC-cc} conftest.c -o conftest.o >config.log 2>&1 \
+            && test -f conftest.o
+        then
+          if test `grep -l BIGenDianSyS conftest.o`
+          then
+            echo "$ac_t"""big endian"" 1>&6
+            ac_cv_c_bigendian=yes
+          fi
+          if test `grep -l LiTTleEnDian conftest.o`
+          then
+            echo "$ac_t"""little endian"" 1>&6
+            ac_cv_c_bigendian=no
+          fi
+        fi
+      fi
+      if test $ac_cv_c_bigendian = xunknown
+      then
+        { echo "configure: error: Could not guess endianness, please use --with-words" 1>&2; exit 1; }
+      fi
+            if test $ac_cv_c_bigendian = yes
+      then
+        cat >> confdefs.h <<\EOF
+#define WORDS_BIGENDIAN 1
+EOF
+      fi
+      ;;
+  esac
+fi
 
 for ac_func in gettimeofday select strerror strtod strtol
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1197: checking for $ac_func" >&5
+echo "configure:1306: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1202 "configure"
+#line 1311 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1221,7 +1330,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1248,12 +1357,12 @@ done
 for ac_func in setenv putenv
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1252: checking for $ac_func" >&5
+echo "configure:1361: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1257 "configure"
+#line 1366 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1276,7 +1385,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1301,12 +1410,12 @@ fi
 done
 
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1305: checking for connect" >&5
+echo "configure:1414: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1310 "configure"
+#line 1419 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -1329,7 +1438,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -1346,8 +1455,9 @@ if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
   :
 else
   echo "$ac_t""no" 1>&6
-echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:1351: checking for connect in -lsocket" >&5
+
+  echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+echo "configure:1461: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1355,7 +1465,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1359 "configure"
+#line 1469 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1366,7 +1476,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1381,20 +1491,21 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -lsocket"
+  LIB="${LIB} -lsocket"
 else
   echo "$ac_t""no" 1>&6
 fi
 
+
 fi
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1393: checking for gethostbyname" >&5
+echo "configure:1504: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1398 "configure"
+#line 1509 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -1417,7 +1528,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -1434,8 +1545,9 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
   :
 else
   echo "$ac_t""no" 1>&6
-echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1439: checking for gethostbyname in -lnsl" >&5
+
+  echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:1551: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1443,7 +1555,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1447 "configure"
+#line 1559 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1454,7 +1566,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1469,20 +1581,21 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -lnsl"
+  LIB="${LIB} -lnsl"
 else
   echo "$ac_t""no" 1>&6
 fi
 
+
 fi
 
 echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
-echo "configure:1481: checking for nanosleep" >&5
+echo "configure:1594: checking for nanosleep" >&5
 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1486 "configure"
+#line 1599 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char nanosleep(); below.  */
@@ -1505,7 +1618,7 @@ nanosleep();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_nanosleep=yes"
 else
@@ -1522,8 +1635,9 @@ if eval "test \"`echo '$ac_cv_func_'nanosleep`\" = yes"; then
   :
 else
   echo "$ac_t""no" 1>&6
-echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
-echo "configure:1527: checking for nanosleep in -lrt" >&5
+
+  echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
+echo "configure:1641: checking for nanosleep in -lrt" >&5
 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1531,7 +1645,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1535 "configure"
+#line 1649 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1542,7 +1656,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:1546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1557,11 +1671,12 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -lrt"
+  LIB="${LIB} -lrt"
 else
   echo "$ac_t""no" 1>&6
-echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
-echo "configure:1565: checking for nanosleep in -lposix4" >&5
+
+    echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
+echo "configure:1680: checking for nanosleep in -lposix4" >&5
 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1569,7 +1684,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1573 "configure"
+#line 1688 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1580,7 +1695,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:1584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1595,24 +1710,26 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -lposix4"
+  LIB="${LIB} -lposix4"
 else
   echo "$ac_t""no" 1>&6
 fi
 
+  
 fi
 
+
 fi
 
 for ac_func in usleep
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1611: checking for $ac_func" >&5
+echo "configure:1728: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1616 "configure"
+#line 1733 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1635,7 +1752,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1660,12 +1777,12 @@ fi
 done
 
 echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:1664: checking for inet_aton" >&5
+echo "configure:1781: checking for inet_aton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1669 "configure"
+#line 1786 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_aton(); below.  */
@@ -1688,7 +1805,7 @@ inet_aton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_aton=yes"
 else
@@ -1705,8 +1822,9 @@ if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then
   :
 else
   echo "$ac_t""no" 1>&6
-echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:1710: checking for inet_aton in -lresolv" >&5
+
+  echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
+echo "configure:1828: checking for inet_aton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1714,7 +1832,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1718 "configure"
+#line 1836 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1725,7 +1843,7 @@ int main() {
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1740,22 +1858,23 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -lresolv"
+  LIB="${LIB} -lresolv"
 else
   echo "$ac_t""no" 1>&6
 fi
 
+
 fi
 
 for ac_func in vasprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1754: checking for $ac_func" >&5
+echo "configure:1873: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1759 "configure"
+#line 1878 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1778,7 +1897,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1802,130 +1921,296 @@ else
 fi
 done
 
-
-echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:1808: checking for getopt_long" >&5
-if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
+for ac_func in swab
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1928: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1813 "configure"
+#line 1933 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char getopt_long(); below.  */
+    which can conflict with char $ac_func(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char getopt_long();
+char $ac_func();
 
 int main() {
 
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_getopt_long) || defined (__stub___getopt_long)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-getopt_long();
+$ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:1836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_getopt_long=yes"
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_getopt_long=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'getopt_long`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_GETOPT_LONG 1
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
 EOF
-
 else
   echo "$ac_t""no" 1>&6
- # FreeBSD has a gnugetopt library for this:
-  echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
-echo "configure:1858: checking for getopt_long in -lgnugetopt" >&5
-ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+fi
+done
+
+for ac_func in memalign valloc
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1983: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgnugetopt  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1866 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 1988 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char getopt_long();
+char $ac_func();
 
 int main() {
-getopt_long()
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:1877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_GETOPT_LONG 1
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
 EOF
- LIB=${LIB}" -lgnugetopt"
 else
   echo "$ac_t""no" 1>&6
-GETOPT=1
-fi
-
 fi
+done
 
 
-
-for ac_hdr in unistd.h
+for ac_func in sigrelse
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1909: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2039: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1914 "configure"
+#line 2044 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+NEED_GETOPT=0
+echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
+echo "configure:2094: checking for getopt_long" >&5
+if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2099 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char getopt_long(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char getopt_long();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_getopt_long) || defined (__stub___getopt_long)
+choke me
+#else
+getopt_long();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_getopt_long=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_getopt_long=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'getopt_long`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_GETOPT_LONG 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+ # FreeBSD has a gnugetopt library for this:
+  echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
+echo "configure:2144: checking for getopt_long in -lgnugetopt" >&5
+ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lgnugetopt  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2152 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char getopt_long();
+
+int main() {
+getopt_long()
+; return 0; }
+EOF
+if { (eval echo configure:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_GETOPT_LONG 1
+EOF
+ LIB="${LIB} -lgnugetopt"
+else
+  echo "$ac_t""no" 1>&6
+NEED_GETOPT=1
+fi
+
+fi
+
+
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2194: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2199 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
@@ -1944,12 +2229,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1948: checking for $ac_func" >&5
+echo "configure:2233: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1953 "configure"
+#line 2238 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1972,7 +2257,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1997,7 +2282,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2001: checking for working mmap" >&5
+echo "configure:2286: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2005,7 +2290,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2009 "configure"
+#line 2294 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2032,12 +2317,15 @@ else
 #include <sys/types.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
@@ -2092,7 +2380,7 @@ main()
        /*
         * First, make a file with some known garbage in it.
         */
-       data = malloc(pagesize);
+       data = (char*)malloc(pagesize);
        if (!data)
                exit(1);
        for (i = 0; i < pagesize; ++i)
@@ -2113,7 +2401,7 @@ main()
        fd = open("conftestmmap", O_RDWR);
        if (fd < 0)
                exit(1);
-       data2 = malloc(2 * pagesize);
+       data2 = (char*)malloc(2 * pagesize);
        if (!data2)
                exit(1);
        data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
@@ -2131,7 +2419,7 @@ main()
         */
        for (i = 0; i < pagesize; ++i)
                *(data2 + i) = *(data2 + i) + 1;
-       data3 = malloc(pagesize);
+       data3 = (char*)malloc(pagesize);
        if (!data3)
                exit(1);
        if (read(fd, data3, pagesize) != pagesize)
@@ -2145,7 +2433,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2168,12 +2456,12 @@ EOF
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2172: checking return type of signal handlers" >&5
+echo "configure:2460: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2177 "configure"
+#line 2465 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2190,7 +2478,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2209,7 +2497,7 @@ EOF
 
 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2213: checking for dlopen in -ldl" >&5
+echo "configure:2501: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2217,7 +2505,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2221 "configure"
+#line 2509 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2228,7 +2516,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2243,13 +2531,13 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -ldl"
+  LIB="${LIB} -ldl"
 else
   echo "$ac_t""no" 1>&6
 fi
 
 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:2253: checking for pow in -lm" >&5
+echo "configure:2541: checking for pow in -lm" >&5
 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2257,7 +2545,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2261 "configure"
+#line 2549 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2268,7 +2556,7 @@ int main() {
 pow()
 ; return 0; }
 EOF
-if { (eval echo configure:2272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2283,32 +2571,35 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB_YUV=${LIB_YUV}" -lm"
+  LIB_YUV="${LIB_YUV} -lm"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:2293: checking for pthread_create in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+
+THREAD_LIB=error
+if test "x${THREAD_LIB}" = xerror; then
+  echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
+echo "configure:2584: checking for pthread_attr_init in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2301 "configure"
+#line 2592 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char pthread_create();
+char pthread_attr_init();
 
 int main() {
-pthread_create()
+pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2323,32 +2614,34 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -lpthread"
+  THREAD_LIB="-lpthread"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6
-echo "configure:2333: checking for thread_create in -lthreads" >&5
-ac_lib_var=`echo threads'_'thread_create | sed 'y%./+-%__p_%'`
+fi
+if test "x${THREAD_LIB}" = xerror; then
+  echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
+echo "configure:2626: checking for pthread_attr_init in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lthreads  $LIBS"
+LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2341 "configure"
+#line 2634 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char thread_create();
+char pthread_attr_init();
 
 int main() {
-thread_create()
+pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2363,109 +2656,196 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIB=${LIB}" -lthreads"
+  THREAD_LIB="-lpthreads"
 else
   echo "$ac_t""no" 1>&6
 fi
 
-
-CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
-for ac_hdr in stddef.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2378: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+fi
+if test "x${THREAD_LIB}" = xerror; then
+  echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
+echo "configure:2668: checking for pthread_attr_init in -lc_r" >&5
+ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2383 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lc_r  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2676 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char pthread_attr_init();
+
+int main() {
+pthread_attr_init()
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:2687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
+  THREAD_LIB="-lc_r"
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
-for ac_hdr in getopt.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2418: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+fi
+if test "x${THREAD_LIB}" = xerror; then
+  echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
+echo "configure:2710: checking for pthread_attr_init" >&5
+if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2423 "configure"
+#line 2715 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char pthread_attr_init(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char pthread_attr_init();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_pthread_attr_init) || defined (__stub___pthread_attr_init)
+choke me
+#else
+pthread_attr_init();
+#endif
+
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_func_pthread_attr_init=yes"
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_func_pthread_attr_init=no"
 fi
 rm -f conftest*
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'pthread_attr_init`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
+  :
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
-for ac_hdr in sys/sockio.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2458: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  THREAD_LIB=""
+fi
+
+echo $ac_n "checking for cthread_fork in -lthreads""... $ac_c" 1>&6
+echo "configure:2761: checking for cthread_fork in -lthreads" >&5
+ac_lib_var=`echo threads'_'cthread_fork | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2463 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lthreads  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2769 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char cthread_fork();
+
+int main() {
+cthread_fork()
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if { (eval echo configure:2780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  THREAD_LIB="-lthreads"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+cat > conftest.$ac_ext <<EOF
+#line 2802 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_cond_t" >/dev/null 2>&1; then
+  rm -rf conftest*
+  
+  cat >> confdefs.h <<\EOF
+#define PTHREAD_COND_T_IN_PTHREAD_H 1
+EOF
+
+fi
+rm -f conftest*
+
+cat > conftest.$ac_ext <<EOF
+#line 2818 "configure"
+#include "confdefs.h"
+#include <strings.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "strncasecmp" >/dev/null 2>&1; then
+  rm -rf conftest*
+  
+  cat >> confdefs.h <<\EOF
+#define STRNCASECMP_IN_STRINGS_H 1
+EOF
+
+fi
+rm -f conftest*
+
+
+for ac_hdr in stddef.h getopt.h strings.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2838: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2843 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2490,21 +2870,21 @@ else
 fi
 done
 
-for ac_hdr in fcntl.h sys/time.h unistd.h
+for ac_hdr in sys/sockio.h fcntl.h sys/time.h sys/times.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2498: checking for $ac_hdr" >&5
+echo "configure:2878: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2503 "configure"
+#line 2883 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2534,17 +2914,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2538: checking for $ac_hdr" >&5
+echo "configure:2918: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2543 "configure"
+#line 2923 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2574,17 +2954,17 @@ for ac_hdr in dlfcn.h image.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2578: checking for $ac_hdr" >&5
+echo "configure:2958: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2583 "configure"
+#line 2963 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2614,17 +2994,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2618: checking for $ac_hdr" >&5
+echo "configure:2998: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2623 "configure"
+#line 3003 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2654,17 +3034,17 @@ for ac_hdr in machine/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2658: checking for $ac_hdr" >&5
+echo "configure:3038: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2663 "configure"
+#line 3043 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2695,17 +3075,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2699: checking for $ac_hdr" >&5
+echo "configure:3079: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2704 "configure"
+#line 3084 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 done
 
 
-save_CFLAGS=$CFLAGS
-
-CFLAGS="${CFLAGS} -Wall -Werror"
 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:2740: checking for ntohl in sys/param.h" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2742 "configure"
+echo "configure:3117: checking for ntohl in sys/param.h" >&5
+if eval "test \"`echo '$''{'ac_cv_c_ntohl_sys_param_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  CFLAGS="${save_CFLAGS} -Wall -Werror"
+     cat > conftest.$ac_ext <<EOF
+#line 3123 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
-void foo() { int meuh; ntohl(meuh); }
 int main() {
-
+void foo() { int meuh; ntohl(meuh); }
 ; return 0; }
 EOF
-if { (eval echo configure:2750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  cat >> confdefs.h <<\EOF
+  ac_cv_c_ntohl_sys_param_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_ntohl_sys_param_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_ntohl_sys_param_h" 1>&6
+if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
+    cat >> confdefs.h <<\EOF
 #define NTOHL_IN_SYS_PARAM_H 1
 EOF
 
- echo "$ac_t""yes" 1>&6
+fi
+
+echo $ac_n "checking if \$CC accepts -finline-limit""... $ac_c" 1>&6
+echo "configure:3151: checking if \$CC accepts -finline-limit" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline_limit'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  CFLAGS="${save_CFLAGS} -finline-limit-30000"
+     cat > conftest.$ac_ext <<EOF
+#line 3157 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_inline_limit=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  ac_cv_c_inline_limit=no
 fi
 rm -f conftest*
+fi
 
-CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
-echo $ac_n "checking if \$CC accepts -rdynamic""... $ac_c" 1>&6
-echo "configure:2767: checking if \$CC accepts -rdynamic" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2769 "configure"
+echo "$ac_t""$ac_cv_c_inline_limit" 1>&6
+if test x"$ac_cv_c_inline_limit" != x"no"; then
+    save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
+fi
+
+echo $ac_n "checking if \$CC accepts -bundle -undefined error""... $ac_c" 1>&6
+echo "configure:3182: checking if \$CC accepts -bundle -undefined error" >&5
+if eval "test \"`echo '$''{'ac_cv_ld_darwin'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  CFLAGS="${save_CFLAGS} -bundle -undefined error"
+     cat > conftest.$ac_ext <<EOF
+#line 3188 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  LCFLAGS=${LCFLAGS}" -rdynamic"
- echo "$ac_t""yes" 1>&6
+  ac_cv_ld_darwin=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  ac_cv_ld_darwin=no
 fi
 rm -f conftest*
+fi
 
-CFLAGS=$save_CFLAGS
+echo "$ac_t""$ac_cv_ld_darwin" 1>&6
+if test x"$ac_cv_ld_darwin" != x"no"; then
+    PLCFLAGS="${PLCFLAGS} -bundle -undefined error"
+fi
 
-echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2791: checking for boolean_t in sys/types.h" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2793 "configure"
+echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6
+echo "configure:3213: checking if \$CC accepts -shared" >&5
+if eval "test \"`echo '$''{'ac_cv_ld_plugins'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  CFLAGS="${save_CFLAGS} -shared"
+     cat > conftest.$ac_ext <<EOF
+#line 3219 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-void quux() { boolean_t foo; }
+
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  cat >> confdefs.h <<\EOF
-#define BOOLEAN_T_IN_SYS_TYPES_H 1
+  ac_cv_ld_plugins=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_ld_plugins=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_ld_plugins" 1>&6
+if test x"$ac_cv_ld_plugins" != x"no"; then
+    PLCFLAGS="${PLCFLAGS} -shared"
+fi
+        
+if test x"${SOFLAGS}" = x; then
+    echo $ac_n "checking for soname setting""... $ac_c" 1>&6
+echo "configure:3245: checking for soname setting" >&5
+if eval "test \"`echo '$''{'ac_cv_ld_soname'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        # Standard
+        try_SOFLAGS="-Wl,-soname -Wl,"
+        LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
+        cat > conftest.$ac_ext <<EOF
+#line 3254 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_ld_soname="${try_SOFLAGS}"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+            # SunOS
+            try_SOFLAGS="-Wl,-h -Wl,"
+            LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
+            cat > conftest.$ac_ext <<EOF
+#line 3273 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
 EOF
+if { (eval echo configure:3280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_ld_soname="${try_SOFLAGS}"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_ld_soname=none
+fi
+rm -f conftest*
+        
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_ld_soname" 1>&6
+    if test x"$ac_cv_ld_soname" != x"none"; then
+        SOFLAGS=$ac_cv_ld_soname
+    else
+        echo "
+------------
+Your system doesn't seem to have support for dynamic linking. You may
+have problems using libdvdcss.
+------------
+"
+    fi
+fi
+
+CFLAGS="${save_CFLAGS}"
+LDFLAGS="${save_LDFLAGS}"
 
- echo "$ac_t""yes" 1>&6
+echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:3312: checking for boolean_t in sys/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_c_boolean_t_sys_types_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3317 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+void quux() { boolean_t foo; }
+; return 0; }
+EOF
+if { (eval echo configure:3324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_boolean_t_sys_types_h=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  ac_cv_c_boolean_t_sys_types_h=no
 fi
 rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_boolean_t_sys_types_h" 1>&6
+if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
+    cat >> confdefs.h <<\EOF
+#define BOOLEAN_T_IN_SYS_TYPES_H 1
+EOF
+
+fi
+
 echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
-echo "configure:2816: checking for boolean_t in pthread.h" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2818 "configure"
+echo "configure:3345: checking for boolean_t in pthread.h" >&5
+if eval "test \"`echo '$''{'ac_cv_c_boolean_t_pthread_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3350 "configure"
 #include "confdefs.h"
 #include <pthread.h>
-void quux() { boolean_t foo; }
 int main() {
-
+void quux() { boolean_t foo; }
 ; return 0; }
 EOF
-if { (eval echo configure:2826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  cat >> confdefs.h <<\EOF
+  ac_cv_c_boolean_t_pthread_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_boolean_t_pthread_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_boolean_t_pthread_h" 1>&6
+if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
+    cat >> confdefs.h <<\EOF
 #define BOOLEAN_T_IN_PTHREAD_H 1
 EOF
 
- echo "$ac_t""yes" 1>&6
+fi
+
+echo $ac_n "checking for boolean_t in cthreads.h""... $ac_c" 1>&6
+echo "configure:3378: checking for boolean_t in cthreads.h" >&5
+if eval "test \"`echo '$''{'ac_cv_c_boolean_t_cthreads_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3383 "configure"
+#include "confdefs.h"
+#include <cthreads.h>
+int main() {
+void quux() { boolean_t foo; }
+; return 0; }
+EOF
+if { (eval echo configure:3390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_boolean_t_cthreads_h=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  ac_cv_c_boolean_t_cthreads_h=no
 fi
 rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_boolean_t_cthreads_h" 1>&6
+if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
+    cat >> confdefs.h <<\EOF
+#define BOOLEAN_T_IN_CTHREADS_H 1
+EOF
+
+fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2842: checking for working const" >&5
+echo "configure:3411: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2847 "configure"
+#line 3416 "configure"
 #include "confdefs.h"
 
 int main() {
 
 /* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0,0};
 /* SunOS 4.1.1 cc rejects this.  */
 char const *const *ccp;
 char **p;
@@ -2892,7 +3461,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2913,12 +3482,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2917: checking for ANSI C header files" >&5
+echo "configure:3486: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2922 "configure"
+#line 3491 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2926,7 +3495,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2943,7 +3512,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2947 "configure"
+#line 3516 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2961,7 +3530,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2965 "configure"
+#line 3534 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2982,7 +3551,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2986 "configure"
+#line 3555 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2993,7 +3562,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -3017,12 +3586,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3021: checking for size_t" >&5
+echo "configure:3590: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3026 "configure"
+#line 3595 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3050,12 +3619,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3054: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3623: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3059 "configure"
+#line 3628 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3064,7 +3633,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3085,114 +3654,903 @@ EOF
 fi
 
 
-ARCH=${host_cpu}
-
-#PLUGINS=${PLUGINS}"ps ts yuv idct idctclassic motion "
-BUILTINS=${BUILTINS}"ps ts yuv idct idctclassic motion "
-if test x$host_os = xbeos; then
-    ACCEL_PLUGINS="yuvmmx idctmmx motionmmx "
-else
-    ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext "
-fi
-
-for ac_hdr in sys/ioctl.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3103: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
+echo "configure:3659: checking __attribute__ ((aligned ())) support" >&5
+if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3108 "configure"
+  ac_cv_c_attribute_aligned=0
+    for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
+        cat > conftest.$ac_ext <<EOF
+#line 3666 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+int main() {
+static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:3673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
+    done
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+
+echo "$ac_t""$ac_cv_c_attribute_aligned" 1>&6
+if test x"$ac_cv_c_attribute_aligned" != x"0"; then
+    cat >> confdefs.h <<EOF
+#define ATTRIBUTE_ALIGNED_MAX $ac_cv_c_attribute_aligned
 EOF
-  BUILTINS=${BUILTINS}"dvd "
-  for ac_hdr in linux/cdrom.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3139: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+
+fi
+
+
+
+ARCH=${target_cpu}
+
+BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion imdct downmix"
+PLUGINS="${PLUGINS}"
+
+MMX_MODULES="yuvmmx idctmmx motionmmx"
+MMXEXT_MODULES="idctmmxext motionmmxext"
+THREEDNOW_MODULES="imdct3dn downmix3dn"
+SSE_MODULES="imdctsse downmixsse"
+ALTIVEC_MODULES="idctaltivec motionaltivec"
+
+echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
+echo "configure:3706: checking if \$CC groks MMX inline assembly" >&5
+if eval "test \"`echo '$''{'ac_cv_mmx_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3144 "configure"
+#line 3711 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+int main() {
+void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:3718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cv_mmx_inline=yes
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  ac_cv_mmx_inline=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mmx_inline" 1>&6
+if test x"$ac_cv_mmx_inline" != x"no"; then
+  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
+fi
+
+echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6
+echo "configure:3736: checking if \$CC groks MMX EXT inline assembly" >&5
+if eval "test \"`echo '$''{'ac_cv_mmxext_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3741 "configure"
+#include "confdefs.h"
+
+int main() {
+void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}
+; return 0; }
+EOF
+if { (eval echo configure:3748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_mmxext_inline=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_mmxext_inline=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mmxext_inline" 1>&6
+if test x"$ac_cv_mmxext_inline" != x"no"; then
+  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
+fi
+
+echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6
+echo "configure:3766: checking if \$CC groks 3D Now! inline assembly" >&5
+if eval "test \"`echo '$''{'ac_cv_3dnow_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3771 "configure"
+#include "confdefs.h"
+
+int main() {
+void quux(){void *p;asm("pfadd %%mm1,%%mm2"::"r"(p));}
+; return 0; }
+EOF
+if { (eval echo configure:3778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_3dnow_inline=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_3dnow_inline=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_3dnow_inline" 1>&6
+if test x"$ac_cv_3dnow_inline" != x"no"; then
+  ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
+fi
+
+echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6
+echo "configure:3796: checking if \$CC groks SSE inline assembly" >&5
+if eval "test \"`echo '$''{'ac_cv_sse_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3801 "configure"
+#include "confdefs.h"
+
+int main() {
+void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}
+; return 0; }
+EOF
+if { (eval echo configure:3808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_sse_inline=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_sse_inline=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_sse_inline" 1>&6
+if test x"$ac_cv_sse_inline" != x"no"; then
+  ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
+fi
+
+echo $ac_n "checking if \$CC groks Altivec inline assembly""... $ac_c" 1>&6
+echo "configure:3826: checking if \$CC groks Altivec inline assembly" >&5
+if eval "test \"`echo '$''{'ac_cv_altivec_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3831 "configure"
+#include "confdefs.h"
+
+int main() {
+void quux(){asm("vperm 0,1,2,3");}
+; return 0; }
+EOF
+if { (eval echo configure:3838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_altivec_inline=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  save_CFLAGS=$CFLAGS
+          CFLAGS="$CFLAGS -Wa,-m7400"
+          cat > conftest.$ac_ext <<EOF
+#line 3848 "configure"
+#include "confdefs.h"
+
+int main() {
+void quux(){asm("vperm 0,1,2,3");}
+; return 0; }
+EOF
+if { (eval echo configure:3855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_altivec_inline=yes; CFLAGS_ALTIVEC="-Wa,-m7400"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_altivec_inline=no
+fi
+rm -f conftest*
+          CFLAGS=$save_CFLAGS
+         
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_altivec_inline" 1>&6
+if test x"$ac_cv_altivec_inline" != x"no"; then
+  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
+fi
+
+echo $ac_n "checking if \$CC groks Altivec C extensions""... $ac_c" 1>&6
+echo "configure:3877: checking if \$CC groks Altivec C extensions" >&5
+if eval "test \"`echo '$''{'ac_cv_c_altivec'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  save_CFLAGS=$CFLAGS
+     CFLAGS="$CFLAGS -faltivec"
+     # Darwin test
+     cat > conftest.$ac_ext <<EOF
+#line 3885 "configure"
+#include "confdefs.h"
+
+int main() {
+void quux(){vec_mtvscr((vector unsigned int)(0));}
+; return 0; }
+EOF
+if { (eval echo configure:3892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_altivec=-faltivec
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+        # Linux/PPC test
+        CFLAGS="$save_CFLAGS $CFLAGS_ALTIVEC -fvec"
+        cat > conftest.$ac_ext <<EOF
+#line 3903 "configure"
+#include "confdefs.h"
+
+int main() {
+void quux(){vec_mtvscr((vector unsigned int)(0));}
+; return 0; }
+EOF
+if { (eval echo configure:3910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_altivec="-fvec"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_altivec=no
+fi
+rm -f conftest*
+        
+fi
+rm -f conftest*
+     CFLAGS=$save_CFLAGS
+    
+fi
+
+echo "$ac_t""$ac_cv_c_altivec" 1>&6
+if test x"$ac_cv_c_altivec" != x"no"; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_C_ALTIVEC 1
+EOF
+
+  CFLAGS_ALTIVEC="$CFLAGS_ALTIVEC $ac_cv_c_altivec"
+fi
+
+echo $ac_n "checking if linker needs -framework vecLib""... $ac_c" 1>&6
+echo "configure:3937: checking if linker needs -framework vecLib" >&5
+if eval "test \"`echo '$''{'ac_cv_ld_altivec'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  save_LDFLAGS=$LDFLAGS
+     LDFLAGS="$LDFLAGS -framework vecLib"
+     cat > conftest.$ac_ext <<EOF
+#line 3944 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_ld_altivec=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_ld_altivec=no
+fi
+rm -f conftest*
+     LDFLAGS=$save_LDFLAGS
+    
+fi
+
+echo "$ac_t""$ac_cv_ld_altivec" 1>&6
+if test x"$ac_cv_ld_altivec" != x"no"; then
+  LIB_ALTIVEC="-framework vecLib"
+fi
+
+
+CAN_BUILD_LIBDVDCSS=0
+
+for ac_hdr in winioctl.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3977: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3982 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+for ac_hdr in sys/ioctl.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4020: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4025 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
+  for ac_hdr in sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4056: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4061 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+  BSD_DVD_STRUCT=0
+  LINUX_DVD_STRUCT=0
+        cat > conftest.$ac_ext <<EOF
+#line 4095 "configure"
+#include "confdefs.h"
+#include <sys/dvdio.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "dvd_struct" >/dev/null 2>&1; then
+  rm -rf conftest*
+  
+    cat >> confdefs.h <<\EOF
+#define DVD_STRUCT_IN_SYS_DVDIO_H 1
+EOF
+
+    BSD_DVD_STRUCT=1
+  
+fi
+rm -f conftest*
+
+        cat > conftest.$ac_ext <<EOF
+#line 4113 "configure"
+#include "confdefs.h"
+#include <sys/cdio.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "dvd_struct" >/dev/null 2>&1; then
+  rm -rf conftest*
+  
+    cat >> confdefs.h <<\EOF
+#define DVD_STRUCT_IN_SYS_CDIO_H 1
+EOF
+
+    BSD_DVD_STRUCT=1
+  
+fi
+rm -f conftest*
+
+        cat > conftest.$ac_ext <<EOF
+#line 4131 "configure"
+#include "confdefs.h"
+#include <linux/cdrom.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "dvd_struct" >/dev/null 2>&1; then
+  rm -rf conftest*
+  
+    cat >> confdefs.h <<\EOF
+#define DVD_STRUCT_IN_LINUX_CDROM_H 1
+EOF
+
+    LINUX_DVD_STRUCT=1
+  
+fi
+rm -f conftest*
+
+        NEED_BSDI_LIBDVD=0
+  cat > conftest.$ac_ext <<EOF
+#line 4150 "configure"
+#include "confdefs.h"
+#include <dvd.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "dvd_struct" >/dev/null 2>&1; then
+  rm -rf conftest*
+  
+    cat >> confdefs.h <<\EOF
+#define DVD_STRUCT_IN_DVD_H 1
+EOF
+
+    LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
+    LINUX_DVD_STRUCT=1
+  
+else
+  rm -rf conftest*
+  
+                for ac_hdr in /sys/dev/scsi/scsi_ioctl.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4172: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4177 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+      NEED_BSDI_LIBDVD=1
+      cat >> confdefs.h <<\EOF
+#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1
+EOF
+
+      OBJ_LIBDVDCSS="${OBJ_LIBDVDCSS} bsdi_dvdioctl.o"
+      LINUX_DVD_STRUCT=1
+    
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+  
+fi
+rm -f conftest*
+
+        ac_safe=`echo "sys/scsi/scsi_types.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/scsi/scsi_types.h""... $ac_c" 1>&6
+echo "configure:4222: checking for sys/scsi/scsi_types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4227 "configure"
+#include "confdefs.h"
+#include <sys/scsi/scsi_types.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+    ac_safe=`echo "sys/scsi/impl/uscsi.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/scsi/impl/uscsi.h""... $ac_c" 1>&6
+echo "configure:4251: checking for sys/scsi/impl/uscsi.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4256 "configure"
+#include "confdefs.h"
+#include <sys/scsi/impl/uscsi.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+      cat >> confdefs.h <<\EOF
+#define SOLARIS_USCSI 1
+EOF
+
+    
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+        if test x$LINUX_DVD_STRUCT = x1; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_DVD_STRUCT 1
+EOF
+
+  else
+    if test x$BSD_DVD_STRUCT = x1; then
+      cat >> confdefs.h <<\EOF
+#define HAVE_BSD_DVD_STRUCT 1
+EOF
+
+    fi
+  fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+case ${target_os} in
+  bsdi*)
+    SYS=bsdi
+    ;;
+  darwin*)
+    SYS=darwin
+    ;;
+  *)
+    SYS=${target_os}
+    ;;
+esac
+
+# Check whether --with-tuning or --without-tuning was given.
+if test "${with_tuning+set}" = set; then
+  withval="$with_tuning"
+  :
+fi
+
+if test "x$withval" != "x"; then
+    TUNING=$withval
+else
+    if test x${target_cpu} = xi686; then TUNING="pentiumpro"
+    else
+        if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
+    fi
+fi
+
+# Check whether --enable-mmx or --disable-mmx was given.
+if test "${enable_mmx+set}" = set; then
+  enableval="$enable_mmx"
+   if test x$enableval = xyes; then ARCH="${ARCH} mmx";
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
+else
+   if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386; then ARCH="${ARCH} mmx";
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
+fi
+
+
+# Check whether --enable-altivec or --disable-altivec was given.
+if test "${enable_altivec+set}" = set; then
+  enableval="$enable_altivec"
+   if test x$enableval = xyes; then ARCH="${ARCH} altivec";
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
+else
+   if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
+fi
+
+
+DEBUG=0
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+   if test x$enableval = xyes; then DEBUG=1; fi 
+fi
+
+
+TRACE=0
+# Check whether --enable-trace or --disable-trace was given.
+if test "${enable_trace+set}" = set; then
+  enableval="$enable_trace"
+   if test x$enableval = xyes; then TRACE=1; fi 
+fi
+
+
+GPROF=0
+# Check whether --enable-gprof or --disable-gprof was given.
+if test "${enable_gprof+set}" = set; then
+  enableval="$enable_gprof"
+   if test x$enableval = xyes; then GPROF=1; fi 
+fi
+
+
+CPROF=0
+# Check whether --enable-cprof or --disable-cprof was given.
+if test "${enable_cprof+set}" = set; then
+  enableval="$enable_cprof"
+   if test x$enableval = xyes;
+  then
+    LIB="${LIB} -lcprof"
+    CPROF=1
+  fi
+
+fi
+
+
+# Check whether --enable-optimizations or --disable-optimizations was given.
+if test "${enable_optimizations+set}" = set; then
+  enableval="$enable_optimizations"
+   if test x$enableval = xno; then OPTIMS=0; fi 
+else
+   OPTIMS=1 
+fi
+
+
+# Check whether --enable-pth or --disable-pth was given.
+if test "${enable_pth+set}" = set; then
+  enableval="$enable_pth"
+   if test x$enableval = xyes; then
+    echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
+echo "configure:4413: checking for pth_init in -lpth" >&5
+ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpth  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4421 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char pth_init();
+
+int main() {
+pth_init()
+; return 0; }
+EOF
+if { (eval echo configure:4432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo pth | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+#define $ac_tr_lib 1
 EOF
+
+  LIBS="-lpth $LIBS"
+
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
-  cat > conftest.$ac_ext <<EOF
-#line 3176 "configure"
+    cat > conftest.$ac_ext <<EOF
+#line 4460 "configure"
 #include "confdefs.h"
-#include <linux/cdrom.h>
+#include <pth.h>
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "dvd" >/dev/null 2>&1; then
+  egrep "pth_init" >/dev/null 2>&1; then
   rm -rf conftest*
   
-    cat >> confdefs.h <<\EOF
-#define LINUX_DVD 1
+      cat >> confdefs.h <<\EOF
+#define PTH_INIT_IN_PTH_H 1
 EOF
 
-  
+    THREAD_LIB="-lpth"
+    fi
 fi
 rm -f conftest*
 
 
+fi
+
+
+LIB="${LIB} ${THREAD_LIB}"
+
+NEED_LIBDVDCSS=0
+STATIC_LIBDVDCSS=0
+DUMMY_LIBDVDCSS=0
+# Check whether --with-dvdcss or --without-dvdcss was given.
+if test "${with_dvdcss+set}" = set; then
+  withval="$with_dvdcss"
+   case "x${withval}" in
+    xlocal-static|xyes)
+      # local libdvdcss, statically linked
+      if test x${CAN_BUILD_LIBDVDCSS} = x1
+      then
+        NEED_LIBDVDCSS=1
+        STATIC_LIBDVDCSS=1
+        BUILTINS="${BUILTINS} dvd"
+        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
+        LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
+        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
+      fi
+    ;;
+    xlocal-shared)
+      # local libdvdcss, dynamically linked
+      if test x${CAN_BUILD_LIBDVDCSS} = x1
+      then
+        NEED_LIBDVDCSS=1
+        BUILTINS="${BUILTINS} dvd"
+        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
+        LIB_DVD="${LIB_DVD} -Llib -ldvdcss"
+        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L../../lib -ldvdcss"
+      fi
+    ;;
+    xno)
+      # don't use libdvdcss at all, build a DVD module that can dlopen() it
+      DUMMY_LIBDVDCSS=1
+      BUILTINS="${BUILTINS} dvd"
+      OBJ_DVD="${OBJ_DVD} dummy_dvdcss.o"
+      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
+      CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
+      LIB_DVD="${LIB_DVD} -ldl"
+      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
+    ;;
+    *)
+      # existing libdvdcss
+      BUILTINS="${BUILTINS} dvd"
+      if test "x$withval" != "xyes"
+      then
+        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L"$withval"/lib"
+        CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
+      fi
+      LIB_DVD="${LIB_DVD} -ldvdcss"
+      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldvdcss"
+    esac 
 else
-  echo "$ac_t""no" 1>&6
+  # user didn't decide, we choose to use local libdvdcss and link statically
+  # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
+   if test x${CAN_BUILD_LIBDVDCSS} = x1
+    then
+      NEED_LIBDVDCSS=1
+      STATIC_LIBDVDCSS=1
+      BUILTINS="${BUILTINS} dvd"
+      CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
+      LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
+      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
+    else
+      # XXX: no check for libdl is done, don't try this at home !
+      DUMMY_LIBDVDCSS=1
+      BUILTINS="${BUILTINS} dvd"
+      OBJ_DVD="${OBJ_DVD} dummy_dvdcss.o"
+      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
+      LIB_DVD="${LIB_DVD} -ldl"
+      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
+    fi 
 fi
-done
 
 
 # Check whether --enable-dummy or --disable-dummy was given.
@@ -3201,8 +4559,11 @@ if test "${enable_dummy+set}" = set; then
   :
 fi
 
-if test x$enable_dummy != xno; then
-  BUILTINS=${BUILTINS}"dummy "; fi
+
+if test x$enable_dummy != xno
+then
+  BUILTINS="${BUILTINS} dummy"
+fi
 
 # Check whether --enable-null or --disable-null was given.
 if test "${enable_null+set}" = set; then
@@ -3210,141 +4571,403 @@ if test "${enable_null+set}" = set; then
   :
 fi
 
-if test x$enable_null != xno; then
-  BUILTINS=${BUILTINS}"null "; fi
 
-# Check whether --enable-ppro or --disable-ppro was given.
-if test "${enable_ppro+set}" = set; then
-  enableval="$enable_ppro"
-   if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi 
+if test x$enable_null != xno
+then
+  BUILTINS="${BUILTINS} null"
+fi
+
+# Check whether --enable-rc or --disable-rc was given.
+if test "${enable_rc+set}" = set; then
+  enableval="$enable_rc"
+  :
+fi
+
+
+if test x$enable_rc != xno
+then
+  BUILTINS="${BUILTINS} rc"
+fi
+
+if test x$SYS = xbeos
+then
+    BUILTINS="${BUILTINS} beos"
+    LIB_BEOS="-lbe -lgame -lroot -ltracker"
+    PLCFLAGS="${PLCFLAGS} -nostart"
+
 else
-   if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi 
+
+# Check whether --enable-dsp or --disable-dsp was given.
+if test "${enable_dsp+set}" = set; then
+  enableval="$enable_dsp"
+  :
 fi
 
 
-# Check whether --enable-mmx or --disable-mmx was given.
-if test "${enable_mmx+set}" = set; then
-  enableval="$enable_mmx"
-   if test x$enableval = xyes; then ARCH=${ARCH}" mmx";
-  BUILTINS=${BUILTINS}${ACCEL_PLUGINS}; fi 
+if test x$enable_dsp != xno
+then
+  if test -c /dev/dsp
+  then
+    PLUGINS="${PLUGINS} dsp"
+  fi
+fi
+
+# Check whether --enable-esd or --disable-esd was given.
+if test "${enable_esd+set}" = set; then
+  enableval="$enable_esd"
+  if test x$enable_esd = xyes
+   then
+     # Extract the first word of "esd-config", so it can be a program name with args.
+set dummy esd-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4624: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$ESD_CONFIG" in
+  /*)
+  ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_ESD_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no"
+  ;;
+esac
+fi
+ESD_CONFIG="$ac_cv_path_ESD_CONFIG"
+if test -n "$ESD_CONFIG"; then
+  echo "$ac_t""$ESD_CONFIG" 1>&6
 else
-   if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86; then ARCH=${ARCH}" mmx";
-  BUILTINS=${BUILTINS}${ACCEL_PLUGINS}; fi 
+  echo "$ac_t""no" 1>&6
+fi
+
+     if test x${ESD_CONFIG} != xno
+     then
+       PLUGINS="${PLUGINS} esd"
+       LIB_ESD="`${ESD_CONFIG} --libs`"
+     fi
+   fi
 fi
 
 
-# Check whether --enable-altivec or --disable-altivec was given.
-if test "${enable_altivec+set}" = set; then
-  enableval="$enable_altivec"
-   if test x$enableval = xyes; then ARCH=${ARCH}" altivec";
-    BUILTINS=${BUILTINS}"idctaltivec "
-    LIB_IDCTALTIVEC="-framework vecLib"
-  fi 
+# Check whether --enable-darwin or --disable-darwin was given.
+if test "${enable_darwin+set}" = set; then
+  enableval="$enable_darwin"
+  if test x$enable_darwin = xyes; then
+     PLUGINS="${PLUGINS} darwin"
+     LIB_DARWIN="-framework CoreAudio"
+   fi
 fi
 
-#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH=${ARCH}" altivec"; PLUGINS=${PLUGINS}"idctaltivec "; fi ])
 
-# Check whether --enable-css or --disable-css was given.
-if test "${enable_css+set}" = set; then
-  enableval="$enable_css"
-   if test x$enableval = xyes; then CSS=1; else CSS=0; fi 
+# Check whether --enable-macosx or --disable-macosx was given.
+if test "${enable_macosx+set}" = set; then
+  enableval="$enable_macosx"
+  if test x$enable_macosx = xyes
+   then
+     BUILTINS="${BUILTINS} macosx macosx_qt"
+     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL -framework QuickTime"
+     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
+     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
+   fi
+else
+  for ac_hdr in Carbon/Carbon.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4691: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4696 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
 else
-   CSS=1; 
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
-
-if test x${CSS} = x1; then cat >> confdefs.h <<\EOF
-#define HAVE_CSS 1
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
 EOF
- fi
+ BUILTINS="${BUILTINS} macosx macosx_qt"
+     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL -framework QuickTime"
+     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
+     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
+   
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
 
-# Check whether --enable-debug or --disable-debug was given.
-if test "${enable_debug+set}" = set; then
-  enableval="$enable_debug"
-   if test x$enableval = xyes; then DEBUG=1; fi 
 fi
 
 
-# Check whether --enable-stats or --disable-stats was given.
-if test "${enable_stats+set}" = set; then
-  enableval="$enable_stats"
-   if test x$enableval = xyes; then STATS=1; fi 
+# Check whether --enable-qnx or --disable-qnx was given.
+if test "${enable_qnx+set}" = set; then
+  enableval="$enable_qnx"
+  :
 fi
 
-
-# Check whether --enable-optimizations or --disable-optimizations was given.
-if test "${enable_optimizations+set}" = set; then
-  enableval="$enable_optimizations"
-   if test x$enableval = xno; then OPTIMS=0; fi 
+    if test x$enable_qnx != xno
+    then
+      for ac_hdr in Ph.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4746: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-   OPTIMS=1 
+  cat > conftest.$ac_ext <<EOF
+#line 4751 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+        PLUGINS="${PLUGINS} qnx"
+        LIB_QNX="-lasound -lph"
+      
+else
+  echo "$ac_t""no" 1>&6
 fi
+done
 
+    fi
 
-SYS=${host_os}
+# Check whether --enable-fb or --disable-fb was given.
+if test "${enable_fb+set}" = set; then
+  enableval="$enable_fb"
+   if test x$enable_fb = xyes
+    then
+      PLUGINS="${PLUGINS} fb"
+    fi 
+fi
 
-if test x$host_os = xbeos; then
-    BUILTINS=${BUILTINS}"beos "
-    LIB_BEOS="-lbe -lgame -lroot -ltracker"
 
-else
+# Check whether --with-ggi or --without-ggi was given.
+if test "${with_ggi+set}" = set; then
+  withval="$with_ggi"
+   if test "x$withval" != "xno"
+    then
+      PLUGINS="${PLUGINS} ggi"
+      if test "x$withval" != "xyes"
+      then
+        LIB_GGI="-l"$withval
+      else
+        LIB_GGI="-lggi"
+      fi
+    fi 
+fi
 
-# Check whether --enable-dsp or --disable-dsp was given.
-if test "${enable_dsp+set}" = set; then
-  enableval="$enable_dsp"
+
+# Check whether --enable-sdl or --disable-sdl was given.
+if test "${enable_sdl+set}" = set; then
+  enableval="$enable_sdl"
   :
 fi
 
-if test x$enable_dsp != xno; then
-  if test -c /dev/dsp; then
-    PLUGINS=${PLUGINS}"dsp "
-  fi
+if test "x$enable_sdl" != "xno"
+then
+  SDL_PATH=$PATH
+  # Check whether --with-sdl-config-path or --without-sdl-config-path was given.
+if test "${with_sdl_config_path+set}" = set; then
+  withval="$with_sdl_config_path"
+   if test "x$withval" != "xno"
+      then
+        SDL_PATH=$withval:$PATH
+      fi 
 fi
 
-# Check whether --enable-esd or --disable-esd was given.
-if test "${enable_esd+set}" = set; then
-  enableval="$enable_esd"
-  if test x$enable_esd = xyes; then
-     PLUGINS=${PLUGINS}"esd "
-     LIB_ESD="`esd-config --libs`"
-   fi
+  # Extract the first word of "sdl12-config", so it can be a program name with args.
+set dummy sdl12-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4834: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$SDL12_CONFIG" in
+  /*)
+  ac_cv_path_SDL12_CONFIG="$SDL12_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_SDL12_CONFIG="$SDL12_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$SDL_PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_SDL12_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_SDL12_CONFIG" && ac_cv_path_SDL12_CONFIG="no"
+  ;;
+esac
+fi
+SDL12_CONFIG="$ac_cv_path_SDL12_CONFIG"
+if test -n "$SDL12_CONFIG"; then
+  echo "$ac_t""$SDL12_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  SDL_CONFIG=${SDL12_CONFIG}
+  SDL_HEADER="SDL12/SDL.h"
+  if test x${SDL_CONFIG} = xno
+  then
+    # Extract the first word of "sdl11-config", so it can be a program name with args.
+set dummy sdl11-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4874: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$SDL11_CONFIG" in
+  /*)
+  ac_cv_path_SDL11_CONFIG="$SDL11_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_SDL11_CONFIG="$SDL11_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$SDL_PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_SDL11_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_SDL11_CONFIG" && ac_cv_path_SDL11_CONFIG="no"
+  ;;
+esac
+fi
+SDL11_CONFIG="$ac_cv_path_SDL11_CONFIG"
+if test -n "$SDL11_CONFIG"; then
+  echo "$ac_t""$SDL11_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    SDL_CONFIG=${SDL11_CONFIG}
+    SDL_HEADER="SDL11/SDL.h"
+  fi
+  if test x${SDL_CONFIG} = xno
+  then
+    # Extract the first word of "sdl-config", so it can be a program name with args.
+set dummy sdl-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4915: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$SDL_CONFIG" in
+  /*)
+  ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$SDL_PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_SDL_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no"
+  ;;
+esac
 fi
-
-
-# Check whether --enable-darwin or --disable-darwin was given.
-if test "${enable_darwin+set}" = set; then
-  enableval="$enable_darwin"
-  if test x$enable_darwin = xyes; then
-     PLUGINS=${PLUGINS}"darwin "
-     LIB_DARWIN="-framework CoreAudio"
-   fi
+SDL_CONFIG="$ac_cv_path_SDL_CONFIG"
+if test -n "$SDL_CONFIG"; then
+  echo "$ac_t""$SDL_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
 fi
 
-
-# Check whether --enable-macosx or --disable-macosx was given.
-if test "${enable_macosx+set}" = set; then
-  enableval="$enable_macosx"
-  if test x$enable_macosx = xyes; then
-     BUILTINS=${BUILTINS}"macosx "
-     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
-     LIB_TS=${LIB_TS}" -framework AGL -framework Carbon"
-     LIB_SDL=${LIB_SDL}" -framework AGL -framework Carbon"
-   fi
-else
-  for ac_hdr in Carbon/Carbon.h
+    SDL_HEADER="SDL/SDL.h"
+  fi
+  if test x${SDL_CONFIG} != xno
+  then
+    PLUGINS="${PLUGINS} sdl"
+    CFLAGS_SDL="`${SDL_CONFIG} --cflags`"
+    LIB_SDL="`${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
+    save_CPPFLAGS=$CPPFLAGS
+    CPPFLAGS="$CPPFLAGS $CFLAGS_SDL"
+    for ac_hdr in ${SDL_HEADER}
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3338: checking for $ac_hdr" >&5
+echo "configure:4961: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3343 "configure"
+#line 4966 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3364,68 +4987,60 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
- BUILTINS=${BUILTINS}"macosx "
-     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
-     LIB_TS=${LIB_TS}" -framework AGL -framework Carbon"
-     LIB_SDL=${LIB_SDL}" -framework AGL -framework Carbon"
-   
+ cat >> confdefs.h <<EOF
+#define SDL_INCLUDE_FILE <${SDL_HEADER}>
+EOF
+
 else
   echo "$ac_t""no" 1>&6
+{ echo "configure: error: The development package for SDL is not installed. 
+Please install it and try again. Alternatively you can also configure with 
+--disable-sdl." 1>&2; exit 1; }
+      
 fi
 done
 
-fi
-
-
-# Check whether --enable-fb or --disable-fb was given.
-if test "${enable_fb+set}" = set; then
-  enableval="$enable_fb"
-  if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; fi
-fi
-
-
-# Check whether --with-ggi or --without-ggi was given.
-if test "${with_ggi+set}" = set; then
-  withval="$with_ggi"
-   if test "x$withval" != "xno";
+    CPPFLAGS=$save_CPPFLAGS
+    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
     then
-      PLUGINS=${PLUGINS}"ggi ";
-      if test "x$withval" != "xyes";
-      then
-        LIB_GGI="-l"$withval
-      else
-        LIB_GGI="-lggi"
-      fi
-    fi 
+      { echo "configure: error: The development package for SDL is not installed.
+Please install it and try again. Alternatively you can also configure with
+--disable-sdl." 1>&2; exit 1; }
+    fi
+  elif test "x$enable_sdl" =  "xyes"
+  then
+    { echo "configure: error: I couldn't find the SDL package. You can download libSDL
+from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
+    " 1>&2; exit 1; }
+  fi
 fi
 
-
-# Check whether --with-sdl or --without-sdl was given.
-if test "${with_sdl+set}" = set; then
-  withval="$with_sdl"
-   if test "x$withval" != "xno";
+# Check whether --with-directx or --without-directx was given.
+if test "${with_directx+set}" = set; then
+  withval="$with_directx"
+   if test "x$withval" != "xno"
     then
-      PLUGINS=${PLUGINS}"sdl ";
-      if test "x$withval" != "xyes";
+      PLUGINS="${PLUGINS} directx"
+      if test "x$withval" != "xyes"
       then
-        LIB_SDL=${LIB_SDL}" -L/usr/X11R6/lib -L"$withval"/lib -l"$withval
-        INCLUDE=${INCLUDE}" -I"$withval"/include"
+        LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
+        INCLUDE="${INCLUDE} -I"$withval"/include"
       else
-        for ac_hdr in SDL/SDL.h
+        for ac_hdr in directx.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3419: checking for $ac_hdr" >&5
+echo "configure:5034: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3424 "configure"
+#line 5039 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3448,32 +5063,33 @@ EOF
  
 else
   echo "$ac_t""no" 1>&6
-echo "Cannot find SDL headers !"; exit
+{ echo "configure: error: Cannot find DirectX headers !" 1>&2; exit 1; }
+        
 fi
 done
 
-        LIB_SDL=${LIB_SDL}" -L/usr/X11R6/lib -lSDL"
+        LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
       fi
     fi 
 fi
 
-    if test "x$withval" = "x";
+    if test "x$withval" = "x"
     then
-      for ac_hdr in SDL/SDL.h
+      for ac_hdr in directx.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3467: checking for $ac_hdr" >&5
+echo "configure:5083: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3472 "configure"
+#line 5088 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3493,8 +5109,8 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
- PLUGINS=${PLUGINS}"sdl "
-       LIB_SDL=${LIB_SDL}" -L/usr/X11R6/lib -lSDL"
+ PLUGINS="${PLUGINS} directx"
+       LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
 else
   echo "$ac_t""no" 1>&6
 fi
@@ -3505,14 +5121,14 @@ done
 # Check whether --with-glide or --without-glide was given.
 if test "${with_glide+set}" = set; then
   withval="$with_glide"
-   if test "x$withval" != "xno";
+   if test "x$withval" != "xno"
     then
-      PLUGINS=${PLUGINS}"glide ";
-      if test "x$withval" != "xyes";
+      PLUGINS="${PLUGINS} glide"
+      if test "x$withval" != "xyes"
       then
-        LIB_GLIDE="-l"$withval
+        LIB_GLIDE="-l"$withval" -lm"
       else
-        LIB_GLIDE="-lglide2x"
+        LIB_GLIDE="-lglide2x -lm"
       fi
     fi 
 fi
@@ -3522,7 +5138,7 @@ fi
 if test "${enable_ncurses+set}" = set; then
   enableval="$enable_ncurses"
   if test x$enable_ncurses = xyes; then
-     PLUGINS=${PLUGINS}"ncurses "
+     PLUGINS="${PLUGINS} ncurses"
      LIB_NCURSES="-lncurses"
    fi
 fi
@@ -3532,9 +5148,15 @@ fi
 if test "${enable_qt+set}" = set; then
   enableval="$enable_qt"
   if test x$enable_qt = xyes; then
-     PLUGINS=${PLUGINS}"qt "
-     ALIASES=${ALIASES}"qvlc "
+     PLUGINS="${PLUGINS} qt"
+     ALIASES="${ALIASES} qvlc"
      LIB_QT="-lqt -L${QTDIR}/lib"
+     if test -x ${QTDIR}/bin/moc
+     then
+       MOC=${QTDIR}/bin/moc
+     else
+       MOC=moc
+     fi
    fi
 fi
 
@@ -3542,7 +5164,17 @@ fi
 # Check whether --enable-kde or --disable-kde was given.
 if test "${enable_kde+set}" = set; then
   enableval="$enable_kde"
-  if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASES=${ALIASES}"kvlc "; fi
+  if test x$enable_kde = xyes; then
+     PLUGINS="${PLUGINS} kde"
+     ALIASES="${ALIASES} kvlc"
+     LIB_KDE="-L${KDEDIR}/lib -lkfile"
+     if test -x ${QTDIR}/bin/moc
+     then
+       MOC=${QTDIR}/bin/moc
+     else
+       MOC=moc
+     fi
+   fi
 fi
 
 
 if test "${enable_gnome+set}" = set; then
   enableval="$enable_gnome"
   if test x$enable_gnome = xyes; then
-     PLUGINS=${PLUGINS}"gnome "
-     ALIASES=${ALIASES}"gnome-vlc "
-     LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
-   fi
+    # look for gnome-config
+    # Extract the first word of "gnome-config", so it can be a program name with args.
+set dummy gnome-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:5190: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$GNOME_CONFIG" in
+  /*)
+  ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_GNOME_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_GNOME_CONFIG" && ac_cv_path_GNOME_CONFIG="no"
+  ;;
+esac
+fi
+GNOME_CONFIG="$ac_cv_path_GNOME_CONFIG"
+if test -n "$GNOME_CONFIG"; then
+  echo "$ac_t""$GNOME_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    if test -x ${GNOME_CONFIG}
+    then
+       CFLAGS_GNOME="`${GNOME_CONFIG} --cflags gnomeui`"
+       LIB_GNOME="`${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
+    fi
+    # now look for the gnome.h header
+    saved_CPPFLAGS=$CPPFLAGS
+    CPPFLAGS="$CPPFLAGS $CFLAGS_GNOME"
+    for ac_hdr in gnome.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5235: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5240 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+      PLUGINS="${PLUGINS} gnome"
+      ALIASES="${ALIASES} gnome-vlc"
+     
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: Can't find gnome headers. Please install the gnome
+developement librairie or remove the --enable-gnome option" 1>&2; exit 1; }
+     
+fi
+done
+
+  
+    CPPFLAGS=$saved_CPPFLAGS
+  fi
 fi
 
 
@@ -3563,12 +5285,97 @@ if test "${enable_gtk+set}" = set; then
   :
 fi
 
-if test x$enable_gtk != xno; then
-  if which gtk-config; then
-    PLUGINS=${PLUGINS}"gtk "
-    ALIASES=${ALIASES}"gvlc "
-    LIB_GTK="`gtk-config --libs gtk | sed 's,-rdynamic,,'`"
+if test x$enable_gtk != xno
+then
+  # look for gtk-config
+  # Extract the first word of "gtk-config", so it can be a program name with args.
+set dummy gtk-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:5295: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$GTK_CONFIG" in
+  /*)
+  ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_GTK_CONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no"
+  ;;
+esac
+fi
+GTK_CONFIG="$ac_cv_path_GTK_CONFIG"
+if test -n "$GTK_CONFIG"; then
+  echo "$ac_t""$GTK_CONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  if test -x ${GTK_CONFIG}
+  then
+    CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
+    LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
   fi
+  # now look for the gtk.h header
+  saved_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $CFLAGS_GTK"
+  for ac_hdr in gtk/gtk.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5340: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5345 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+    PLUGINS="${PLUGINS} gtk"
+    ALIASES="${ALIASES} gvlc"
+  
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+  CPPFLAGS=$saved_CPPFLAGS
 fi
 
 # Check whether --enable-x11 or --disable-x11 was given.
@@ -3578,21 +5385,29 @@ if test "${enable_x11+set}" = set; then
 fi
 
 if test x$enable_x11 != xno; then
+  if test x$x_includes = xNONE; then
+    x_includes=/usr/X11R6/include
+  fi
+  if test x$x_libraries = xNONE; then
+    x_libraries=/usr/X11R6/lib
+  fi
+  saved_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS -I$x_includes"
   for ac_hdr in X11/Xlib.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3586: checking for $ac_hdr" >&5
+echo "configure:5401: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3591 "configure"
+#line 5406 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3613,9 +5428,11 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-    PLUGINS=${PLUGINS}"x11 "
-    LIB_X11="-L/usr/X11R6/lib -lX11 -lXext"
+    PLUGINS="${PLUGINS} x11"
+    LIB_X11="-L$x_libraries -lX11 -lXext"
+    CFLAGS_X11="-I$x_includes"
   
+  CPPFLAGS=$saved_CPPFLAGS
 else
   echo "$ac_t""no" 1>&6
 fi
@@ -3626,29 +5443,83 @@ fi
 # Check whether --enable-xvideo or --disable-xvideo was given.
 if test "${enable_xvideo+set}" = set; then
   enableval="$enable_xvideo"
-  if test x$enable_xvideo = xyes; then
-     PLUGINS=${PLUGINS}"xvideo "
-     LIB_XVIDEO="-L/usr/X11R6/lib -lX11 -lXext -lXv"
-   fi
+  :
+fi
+
+if test x$enable_xvideo != xno; then
+  if test x$x_includes = xNONE; then
+    x_includes=/usr/X11R6/include
+  fi
+  if test x$x_libraries = xNONE; then
+    x_libraries=/usr/X11R6/lib
+  fi
+  saved_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS -I$x_includes"
+  for ac_hdr in X11/extensions/Xv.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5463: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5468 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+    PLUGINS="${PLUGINS} xvideo"
+    LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
+    CFLAGS_X11="-I$x_includes"
+  
+  CPPFLAGS=$saved_CPPFLAGS
+else
+  echo "$ac_t""no" 1>&6
 fi
+done
 
+fi
 
 # Check whether --enable-alsa or --disable-alsa was given.
 if test "${enable_alsa+set}" = set; then
   enableval="$enable_alsa"
-  if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
+  if test x$enable_alsa = xyes
+   then
+     ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
-echo "configure:3642: checking for sys/asoundlib.h" >&5
+echo "configure:5513: checking for sys/asoundlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3647 "configure"
+#line 5518 "configure"
 #include "confdefs.h"
 #include <sys/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3665,7 +5536,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:3669: checking for main in -lasound" >&5
+echo "configure:5540: checking for main in -lasound" >&5
 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3673,14 +5544,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3677 "configure"
+#line 5548 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3705,15 +5576,58 @@ else
   echo "$ac_t""no" 1>&6
 have_alsa="false"
 fi
- if test $have_alsa = true; then
-     PLUGINS=${PLUGINS}"alsa "
-     LIB_ALSA="-lasound"
-   fi; fi
+
+     if test x$have_alsa = xtrue
+     then
+       PLUGINS="${PLUGINS} alsa"
+       LIB_ALSA="-lasound"
+     fi
+   fi
 fi
 
 
 fi
 
+# Check whether --enable-plugins or --disable-plugins was given.
+if test "${enable_plugins+set}" = set; then
+  enableval="$enable_plugins"
+  if test x$enable_plugins = xno
+   then
+     BUILTINS="${BUILTINS} ${PLUGINS}"
+     PLUGINS=
+   fi
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -3884,44 +5798,86 @@ s%@host_alias@%$host_alias%g
 s%@host_cpu@%$host_cpu%g
 s%@host_vendor@%$host_vendor%g
 s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
 s%@VLC_VERSION@%$VLC_VERSION%g
 s%@VLC_CODENAME@%$VLC_CODENAME%g
+s%@LIBDVDCSS_VERSION@%$LIBDVDCSS_VERSION%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
+s%@RANLIB@%$RANLIB%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@GETOPT@%$GETOPT%g
+s%@ESD_CONFIG@%$ESD_CONFIG%g
+s%@SDL12_CONFIG@%$SDL12_CONFIG%g
+s%@SDL11_CONFIG@%$SDL11_CONFIG%g
+s%@SDL_CONFIG@%$SDL_CONFIG%g
+s%@GNOME_CONFIG@%$GNOME_CONFIG%g
+s%@GTK_CONFIG@%$GTK_CONFIG%g
 s%@SYS@%$SYS%g
 s%@ARCH@%$ARCH%g
 s%@PLUGINS@%$PLUGINS%g
 s%@BUILTINS@%$BUILTINS%g
 s%@ALIASES@%$ALIASES%g
+s%@DEFINE@%$DEFINE%g
 s%@INCLUDE@%$INCLUDE%g
 s%@DEBUG@%$DEBUG%g
-s%@STATS@%$STATS%g
+s%@ASM@%$ASM%g
+s%@TRACE@%$TRACE%g
+s%@CPROF@%$CPROF%g
+s%@GPROF@%$GPROF%g
 s%@OPTIMS@%$OPTIMS%g
-s%@CSS@%$CSS%g
+s%@TUNING@%$TUNING%g
+s%@NEED_GETOPT@%$NEED_GETOPT%g
+s%@MOC@%$MOC%g
+s%@WINDRES@%$WINDRES%g
 s%@LCFLAGS@%$LCFLAGS%g
+s%@PLCFLAGS@%$PLCFLAGS%g
+s%@SOFLAGS@%$SOFLAGS%g
 s%@LIB@%$LIB%g
 s%@LIB_ALSA@%$LIB_ALSA%g
+s%@LIB_ALTIVEC@%$LIB_ALTIVEC%g
 s%@LIB_BEOS@%$LIB_BEOS%g
 s%@LIB_DARWIN@%$LIB_DARWIN%g
+s%@LIB_DVD@%$LIB_DVD%g
+s%@LIB_DVD_PLUGIN@%$LIB_DVD_PLUGIN%g
 s%@LIB_ESD@%$LIB_ESD%g
 s%@LIB_GGI@%$LIB_GGI%g
 s%@LIB_GLIDE@%$LIB_GLIDE%g
 s%@LIB_GNOME@%$LIB_GNOME%g
 s%@LIB_GTK@%$LIB_GTK%g
-s%@LIB_IDCTALTIVEC@%$LIB_IDCTALTIVEC%g
+s%@LIB_LIBDVDCSS@%$LIB_LIBDVDCSS%g
+s%@LIB_KDE@%$LIB_KDE%g
 s%@LIB_MACOSX@%$LIB_MACOSX%g
+s%@LIB_QNX@%$LIB_QNX%g
 s%@LIB_NCURSES@%$LIB_NCURSES%g
 s%@LIB_QT@%$LIB_QT%g
 s%@LIB_TS@%$LIB_TS%g
 s%@LIB_SDL@%$LIB_SDL%g
+s%@LIB_DIRECTX@%$LIB_DIRECTX%g
 s%@LIB_X11@%$LIB_X11%g
 s%@LIB_XVIDEO@%$LIB_XVIDEO%g
 s%@LIB_YUV@%$LIB_YUV%g
+s%@CFLAGS_VLC@%$CFLAGS_VLC%g
+s%@CFLAGS_ALTIVEC@%$CFLAGS_ALTIVEC%g
+s%@CFLAGS_DVD@%$CFLAGS_DVD%g
+s%@CFLAGS_LIBDVDCSS@%$CFLAGS_LIBDVDCSS%g
+s%@CFLAGS_GTK@%$CFLAGS_GTK%g
+s%@CFLAGS_SDL@%$CFLAGS_SDL%g
+s%@CFLAGS_X11@%$CFLAGS_X11%g
+s%@OBJ_DVD@%$OBJ_DVD%g
+s%@OBJ_LIBDVDCSS@%$OBJ_LIBDVDCSS%g
+s%@NEED_LIBDVDCSS@%$NEED_LIBDVDCSS%g
 
 CEOF
 EOF
@@ -4143,19 +6099,52 @@ test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
 
 echo "
+global configuration
+--------------------
+system                : ${SYS}
+architecture          : ${ARCH}
+optimizations         : ${OPTIMS}
+tuning:               : ${TUNING}"
+
+if test x${HAVE_VLC} = x1
+then
+  echo "
 vlc configuration
 -----------------
 vlc version           : ${VLC_VERSION}
-system                : ${SYS}
-architecture          : ${ARCH}
 debug mode            : ${DEBUG}
-statistics            : ${STATS}
-optimizations         : ${OPTIMS}
-CSS decryption        : ${CSS}
-need builtin getopt   : ${GETOPT}
-plugin modules        : ${PLUGINS}
-built-in modules      : ${BUILTINS}
-vlc aliases           : ${ALIASES}
+trace mode            : ${TRACE}
+cprof/gprof support   : ${CPROF}/${GPROF}
+need builtin getopt   : ${NEED_GETOPT}
+built-in modules      :${BUILTINS}
+plug-in modules       :${PLUGINS}
+vlc aliases           :${ALIASES}"
+fi
+
+echo "
+libdvdcss configuration
+-----------------------
+can be built          : ${CAN_BUILD_LIBDVDCSS}
+will be built         : ${NEED_LIBDVDCSS}"
+if test x${NEED_LIBDVDCSS} = x1
+then
+  echo "need BSDI libdvd      : ${NEED_BSDI_LIBDVD}"
+  echo "link statically       : ${STATIC_LIBDVDCSS}"
+else
+  echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
+fi
 
-You may now tune Makefile.opts at your convenience."
+echo "
+You may now tune Makefile.opts at your convenience, for instance to choose
+which modules get compiled as plugins.
+"
+if test x${HAVE_VLC} = x1
+then
+  echo "To build vlc and its plugins, type \`make vlc'."
+fi
+if test x${HAVE_LIBDVDCSS} = x1
+then
+  echo "To build libdvdcss only, type \`make libdvdcss'."
+fi
+echo ""