+$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
+fi
+
+cat > $TMPC << EOF
+#include <time.h>
+int main( void ) { localtime_r(NULL, NULL); }
+EOF
+
+localtime_r=no
+if $cc -o $TMPE $TMPC 2> /dev/null ; then
+ localtime_r=yes
+fi
+
+if test "$zlib" = "yes"; then
+# check for zlib - mmu_man
+cat > $TMPC << EOF
+#include <zlib.h>
+int main ( void ) {
+if (zlibVersion() != ZLIB_VERSION)
+ puts("zlib version differs !!!");
+ return 1;
+return 0;
+}
+EOF
+$cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
+# $TMPE 2> /dev/null > /dev/null || zlib="no"
+# XXX: more tests needed - runtime test
+fi
+if test "$zlib" = "yes"; then
+extralibs="$extralibs -lz"
+fi
+
+# test for lrintf in math.h
+cat > $TMPC << EOF
+#define _ISOC9X_SOURCE 1
+#include <math.h>
+int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
+EOF
+
+have_lrintf="no"
+if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
+ have_lrintf="yes"
+ $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
+fi
+
+_restrict=
+for restrict_keyword in restrict __restrict__ __restrict; do
+ echo "void foo(char * $restrict_keyword p);" > $TMPC
+ if $cc -c -o $TMPO $TMPC 2> /dev/null; then
+ _restrict=$restrict_keyword
+ break;
+ fi
+done
+
+# test gcc version to see if vector builtins can be used
+# currently only used on i386 for MMX builtins
+cat > $TMPC << EOF
+int main(void) {
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+return 0;
+#else
+#error no vector builtins
+#endif
+}
+EOF
+
+builtin_vector=no
+if $cc -o $TMPO $TMPC 2> /dev/null ; then
+ builtin_vector=yes
+fi
+
+# dlopen/dlfcn.h probing
+
+cat > $TMPC << EOF
+#include <dlfcn.h>
+int main( void ) { return (int) dlopen("foo", 0); }
+EOF
+
+ldl=-ldl
+
+if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
+dlfcn=yes
+dlopen=yes
+fi
+
+if $cc -o $TMPE $TMPC 2> /dev/null ; then
+dlfcn=yes
+dlopen=yes
+ldl=""
+fi
+
+cat > $TMPC << EOF
+int main( void ) { return (int) dlopen("foo", 0); }
+EOF
+
+if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
+dlopen=yes
+fi
+
+if $cc -o $TMPE $TMPC 2> /dev/null ; then
+dlopen=yes
+ldl=""
+fi
+
+if test "$vhook" = "default" ; then
+ vhook="$dlopen"
+fi
+
+##########################################
+# imlib probe
+
+cat > $TMPC << EOF
+#include <X11/Xlib.h>
+#include <Imlib2.h>
+int main( void ) { return (int) imlib_load_font("foo"); }
+EOF
+
+imlib2=no
+if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null ; then
+imlib2=yes
+fi
+
+##########################################
+# freetype probe
+
+cat > $TMPC << EOF
+#include <ft2build.h>
+int main( void ) { return (int) FT_Init_FreeType(0); }
+EOF
+
+freetype2=no
+if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
+ if test "`which freetype-config`" != ""; then
+ if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` 2> /dev/null ; then
+ freetype2=yes
+ fi
+ fi
+fi
+
+##########################################
+# SDL probe
+
+cat > $TMPC << EOF
+#include <SDL.h>
+#undef main /* We don't want SDL to override our main() */
+int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
+EOF
+
+sdl_too_old=no
+sdl=no
+if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then
+_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
+if test "$_sdlversion" -lt 121 ; then
+sdl_too_old=yes
+else
+sdl=yes
+fi
+fi
+
+if test "$sdl" = "no" ; then
+ ffplay=no
+fi
+
+if test "$debug" = "yes"; then
+ CFLAGS="$CFLAGS -g"
+fi
+
+if test "$optimize" = "small"; then
+# CFLAGS=${CFLAGS//-O3/-Os}
+ CFLAGS="$CFLAGS -Os"
+fi
+
+if test "$optimize" = "yes"; then
+ CFLAGS="$CFLAGS -O3"
+fi
+
+if test x"$bindir" = x""; then
+bindir="${prefix}/bin"
+fi
+
+if test x"$mandir" = x""; then
+mandir="${prefix}/man"
+fi
+
+if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
+cat << EOF
+
+Usage: configure [options]
+Options: [defaults in brackets after descriptions]
+
+EOF
+echo "Standard options:"
+echo " --help print this message"
+echo " --prefix=PREFIX install in PREFIX [$prefix]"
+echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
+echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
+echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
+echo " --enable-faad enable faad support via libfaad [default=no]"
+echo " --enable-faadbin build faad support with runtime linking [default=no]"
+echo " --enable-faac enable faac support via libfaac [default=no]"
+echo " --enable-mingw32 enable mingw32 native/cross windows compile"
+echo " --enable-a52 enable GPL'ed A52 support [default=no]"
+echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
+echo " --enable-pp enable GPL'ed post processing support [default=no]"
+echo " --enable-shared-pp use libpostproc.so [default=no]"
+echo " --enable-shared build shared libraries [default=no]"
+echo " --enable-amr_nb enable amr_nb float audio codec"
+echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
+echo " --enable-sunmlib use Sun medialib [default=no]"
+echo ""
+echo "Advanced options (experts only):"
+echo " --source-path=PATH path of source code [$source_path]"
+echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
+echo " --cc=CC use C compiler CC [$cc]"
+echo " --make=MAKE use specified make [$make]"
+echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
+echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
+echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
+echo " --cpu=CPU force cpu to CPU [$cpu]"
+echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
+echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
+echo " --disable-mmx disable mmx usage"
+echo " --disable-altivec disable AltiVec usage"
+echo " --disable-audio-oss disable OSS audio support [default=no]"
+echo " --disable-audio-beos disable BeOS audio support [default=no]"
+echo " --disable-v4l disable video4linux grabbing [default=no]"
+echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
+echo " --disable-network disable network support [default=no]"
+echo " --disable-zlib disable zlib [default=no]"
+echo " --disable-simple_idct disable simple IDCT routines [default=no]"
+echo " --disable-vhook disable video hooking support"
+echo " --enable-gprof enable profiling with gprof [$gprof]"
+echo " --disable-debug disable debugging symbols"
+echo " --disable-opts disable compiler optimizations"
+echo " --disable-mpegaudio-hp faster (but less accurate)"
+echo " mpegaudio decoding [default=no]"
+echo " --disable-ffserver disable ffserver build"
+echo " --disable-ffplay disable ffplay build"
+echo " --disable-risky disables patent encumbered codecs"
+echo " --enable-small optimize for size instead of speed"
+echo ""
+echo "NOTE: The object files are build at the place where configure is launched"
+exit 1