changeset 417:1afdd7a8eaf9

small fixes, x11libdir and --disable-x11 works before the detection
author arpi_esp
date Sat, 14 Apr 2001 21:16:23 +0000
parents dd528a763c6f
children d75c826a8ab9
files configure
diffstat 1 files changed, 55 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Apr 14 21:12:41 2001 +0000
+++ b/configure	Sat Apr 14 21:16:23 2001 +0000
@@ -130,6 +130,16 @@
 # ---  Check for C compiler:
 
 _cc=gcc
+_x11=auto
+
+_x11libdir=
+if [ -e /usr/X11R6 ]; then
+ _x11libdir=-L/usr/X11R6/lib
+else
+ if [ -e /usr/X11 ]; then
+  _x11libdir=-L/usr/X11/lib
+ fi
+fi
 
 for ac_option
 do
@@ -137,6 +147,15 @@
   --cc=*)
         _cc=`echo $ac_option | cut -d '=' -f 2`
         ;;
+  --with-x11libdir=*)
+        _x11libdir=-L`echo $ac_option | cut -d '=' -f 2`
+        ;;
+  --enable-x11)
+        _x11=yes
+        ;;
+  --disable-x11)
+        _x11=no
+        ;;
  esac
 done
 
@@ -163,7 +182,6 @@
 _sdl=no
 _xv=no
 _vm=no
-_x11=no
 _3dfx=no
 _syncfb=no
 _mlib=no
@@ -172,7 +190,7 @@
 _dga=no
 _dga2=no
 _svga=no
-_fbdev=no
+_fbdev=yes
 _lirc=no
 _xdpms=no
 
@@ -181,9 +199,8 @@
 
 _gllib=
 _sdllib=
+_xvlib=
 _x11lib=
-_xvlib=
-_xlibdir=
 
 for i in `echo $pparam`; do
 
@@ -220,13 +237,6 @@
 
 done
 
-if [ -e /usr/X11R6 ]; then
- _x11libdir=-L/usr/X11R6/lib
-else
- if [ -e /usr/X11 ]; then
-  _x11libdir=-L/usr/X11/lib
- fi
-fi
 
 _win32libdirnotify=no
 if [ -e /usr/lib/win32 ]; then
@@ -366,21 +376,15 @@
 #echo "DONE (${proc})."
 
 
-# check GL & X11 & Xext & Xv & SDL & termcap libs
+$_cc $TMPC -o $TMPO -lvgagl -lvga &> /dev/null && _svga=yes
 
-$_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null && _gl=yes
-$_cc $TMPC -o $TMPO $_x11libdir/ -lXxf86vm &> /dev/null && _vm=yes
-$_cc $TMPC -o $TMPO -lvgagl -lvga &> /dev/null && _svga=yes
-$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes
-$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms &> /dev/null && _xdpms=yes
-$_cc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes
-$_cc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lpthread &> /dev/null || \
+$_cc $TMPC -o $TMPO -lpthread &> /dev/null || \
  { echo "Lib pthread not found."; rm -f $TMPC $TMPO ; exit 1; }
 
 # SDL disabled by default (0.11pre22-) because of the compilation problems
 # this is very buggy & experimental code, use it only if you really need it!!
 _have_sdl=no
-$_cc $TMPC -o $TMPO $_x11libdir -L/usr/local/lib/ -lSDL -lpthread &> /dev/null && _have_sdl=yes
+$_cc $TMPC -o $TMPO -L/usr/local/lib/ -lSDL -lpthread &> /dev/null && _have_sdl=yes
 
 _termcap=no
 $_cc $TMPC -o $TMPO -ltermcap &> /dev/null && _termcap=yes
@@ -388,7 +392,28 @@
 _binutils=no
 as libac3/downmix/downmix_i386.S -o $TMPO &> /dev/null && _binutils=yes
 
-# LGB: Check DGA
+# ----------- Check X11 and related libs (GL, Xxf86vm, Xv, DGA) --------------
+
+if [ $_x11 = auto ]; then
+  _x11=no
+  $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes
+fi
+
+if [ $_x11 = yes ]; then
+
+$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms &> /dev/null && _xdpms=yes
+$_cc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes
+
+$_cc $TMPC -o $TMPO $_x11libdir -lGL &> /dev/null && _gl=yes
+
+cat > $TMPC << EOF
+#include <GL/gl.h>
+int main( void ) { return 0; }
+EOF
+$_cc $TMPC -o $TMPO $_x11libdir -lGL &> /dev/null || \
+ { _gl=no; echo "GL includes not found!";}
+
+$_cc $TMPC -o $TMPO $_x11libdir -lXxf86vm &> /dev/null && _vm=yes
 
 cat > $TMPC << EOF
 #include <stdio.h>
@@ -397,7 +422,6 @@
 int main (void) { return 0;}
 EOF
 
-_dga=no
 $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm &> /dev/null && _dga=yes
 # Note: the -lXxf86vm library is the VideoMode extension and though it's
 # not needed for DGA, AFAIK every distribution packages together with DGA
@@ -405,8 +429,6 @@
 # for further mplayer versions to set resolution by mplayer itself.
 # If you run into problems, remove '-lXxf86vm'.
 
-# ---
-
 # Check if DGA is 2.0 or greater
 cat > $TMPC << EOF
 #include <stdio.h>
@@ -418,24 +440,10 @@
 _dga2=no
 $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm &> /dev/null && _dga2=yes
 
-
-cat > $TMPC << EOF
-#include <GL/gl.h>
-int main( void ) { return 0; }
-EOF
-
-$_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null || \
- { _gl=no; echo "GL includes not found!";}
+fi
 
 rm -f $TMPC $TMPO
 
-
-if [ $_x11 = 'yes' ]; then
- if [ $_mga = 'yes' ]; then
-  _xmga=yes
- fi
-fi
-
 # ---
 
 # check for the parameters.
@@ -485,9 +493,6 @@
   --enable-vm)
         _vm=yes
         ;;
-  --enable-x11)
-        _x11=yes
-        ;;
   --enable-3dfx)
         _3dfx=yes
         ;;
@@ -540,9 +545,6 @@
   --disable-vm)
         _vm=no
         ;;
-  --disable-x11)
-        _x11=no
-        ;;
   --disable-mlib)
 	_mlib=no
 	;;
@@ -561,9 +563,6 @@
   --disable-termcap)
 	_termcap=no
 	;;
-  --with-x11libdir=*)
-        _x11libdir=-L`echo $ac_option | cut -d '=' -f 2`
-        ;;
   --with-win32libdir=*)
         _win32libdir=`echo $ac_option | cut -d '=' -f 2`
 	_win32libdirnotify=no
@@ -574,11 +573,19 @@
   --size-y=*)
 	_y=`echo $ac_option | cut -d '=' -f 2`
 	;;
+  --with-x11libdir=*)
+        ;;
   --cc=*)
 	;;
  esac
 done
 
+if [ $_x11 = 'yes' ]; then
+ if [ $_mga = 'yes' ]; then
+  _xmga=yes
+ fi
+fi
+
 # to screen.
 echo "Using C compiler: $_cc"
 echo "Checking for cpu vendor ... $pvendor ( $pfamily:$pmodel:$pstepping )"