configure.in
changeset 1168 045f186426e1
parent 1162 2651158f59b8
child 1170 bb1a52a8d3d6
     1.1 --- a/configure.in	Sat Nov 05 17:41:11 2005 +0000
     1.2 +++ b/configure.in	Sat Nov 05 19:53:37 2005 +0000
     1.3 @@ -609,11 +609,45 @@
     1.4          AC_PATH_X
     1.5          AC_PATH_XTRA
     1.6          if test x$have_x = xyes; then
     1.7 -            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
     1.8 +            AC_ARG_ENABLE(x11-shared,
     1.9 +[  --enable-x11-shared     dynamically load X11 support [default=yes]],
    1.10 +                          , enable_x11_shared=yes)
    1.11 +
    1.12 +            dnl !!! FIXME: make this work?
    1.13 +            dnl x11_lib_spec=`echo $X11_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libX11.so.*/'`
    1.14 +            dnl x11_lib=`ls $x11_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
    1.15 +            dnl echo "-- $x11_lib_spec -> $x11_lib"
    1.16 +            dnl x11ext_lib_spec=`echo $X11EXT_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libXext.so.*/'`
    1.17 +            dnl x11ext_lib=`ls $x11ext_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
    1.18 +            dnl echo "-- $x11ext_lib_spec -> $x11ext_lib"
    1.19 +
    1.20 +            x11_lib_spec='/usr/X11R6/lib/libX11.so.*'
    1.21 +            x11_lib='libX11.so.6'
    1.22 +            echo "-- $x11_lib_spec -> $x11_lib"
    1.23 +            x11ext_lib_spec='/usr/X11R6/lib/libXext.so.*'
    1.24 +            x11_lib='libXext.so.6'
    1.25 +            echo "-- $x11ext_lib_spec -> $x11_lib"
    1.26 +
    1.27 +            if test x$use_dlopen != xyes && \
    1.28 +               test x$enable_x11_shared = xyes; then
    1.29 +                AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
    1.30 +            fi
    1.31 +
    1.32 +            if test x$use_dlopen = xyes && \
    1.33 +               test x$enable_x11_shared = xyes && test x$x11_lib != x; then
    1.34 +                CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
    1.35 +                SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
    1.36 +                AC_SUBST(x11_lib)
    1.37 +                AC_SUBST(x11ext_lib)
    1.38 +            else
    1.39 +                CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
    1.40 +                SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
    1.41 +            fi
    1.42 +
    1.43              if test x$ac_cv_func_shmat != xyes; then
    1.44                  CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
    1.45              fi
    1.46 -            SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
    1.47 +
    1.48              VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
    1.49              VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
    1.50