Fixed X11 library detection
authorSam Lantinga <slouken@libsdl.org>
Mon, 20 Feb 2006 11:30:29 +0000
changeset 1389ce65f014190a
parent 1388 9a9b87172b4b
child 1390 67781f790694
Fixed X11 library detection
Allow passing CFLAGS for the build in the environment
configure.in
     1.1 --- a/configure.in	Mon Feb 20 11:29:36 2006 +0000
     1.2 +++ b/configure.in	Mon Feb 20 11:30:29 2006 +0000
     1.3 @@ -49,34 +49,30 @@
     1.4      AC_DEFINE(SDL_BYTEORDER, 1234)
     1.5  fi
     1.6  
     1.7 -dnl Set up the base CFLAGS and LIBS
     1.8 -case "$target" in
     1.9 -    *-*-cygwin*)
    1.10 -        # We build SDL on cygwin without the UNIX emulation layer
    1.11 -        BASE_CFLAGS="-I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
    1.12 -        BASE_LIBS="-mno-cygwin"
    1.13 -        ;;
    1.14 -    *)
    1.15 -        BASE_CFLAGS="-D_GNU_SOURCE=1"
    1.16 -        BASE_LIBS=""
    1.17 -        ;;
    1.18 -esac
    1.19 -CFLAGS="$CFLAGS $BASE_CFLAGS"
    1.20 -
    1.21 -dnl Set up the compiler and linker flags for building SDL
    1.22 +dnl Set up the compiler and linker flags
    1.23  INCLUDE="-I$srcdir/include"
    1.24  if test x$srcdir != x.; then
    1.25      INCLUDE="-Iinclude $INCLUDE"
    1.26  fi
    1.27 -BUILD_CFLAGS="$BASE_CFLAGS \$(INCLUDE)"
    1.28 -BUILD_LIBS="$BASE_LIBS"
    1.29 -
    1.30 -dnl Set up the compiler and linker flags for SDL applications
    1.31 -SDL_CFLAGS="$BASE_CFLAGS"
    1.32 -SDL_LIBS="$BASE_LIBS -lSDL"
    1.33 +case "$target" in
    1.34 +    *-*-cygwin*)
    1.35 +        # We build SDL on cygwin without the UNIX emulation layer
    1.36 +        CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
    1.37 +        BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
    1.38 +        BUILD_LIBS="-mno-cygwin"
    1.39 +        SDL_CFLAGS="-I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
    1.40 +        SDL_LIBS="-lSDL -mno-cygwin"
    1.41 +        ;;
    1.42 +    *)
    1.43 +        CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
    1.44 +        BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
    1.45 +        BUILD_LIBS=""
    1.46 +        SDL_CFLAGS=""
    1.47 +        SDL_LIBS="-lSDL"
    1.48 +        ;;
    1.49 +esac
    1.50  
    1.51  dnl Check for tools
    1.52 -#AC_LIBTOOL_DLOPEN
    1.53  AC_LIBTOOL_WIN32_DLL
    1.54  AC_PROG_LIBTOOL
    1.55  AC_PROG_CC
    1.56 @@ -751,9 +747,9 @@
    1.57                      ;;
    1.58                  *)
    1.59                      if test x$X_LIBS = x; then X_LIBS="-L/usr/lib"; fi
    1.60 -                    x11_lib_spec=`echo $X_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libX11.so*/'`
    1.61 +                    x11_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libX11.so.[0-9]/'`]
    1.62                      x11_lib=`ls $x11_lib_spec 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`
    1.63 -                    x11ext_lib_spec=`echo $X_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libXext.so*/'`
    1.64 +                    x11ext_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libXext.so.[0-9]/'`]
    1.65                      x11ext_lib=`ls $x11ext_lib_spec 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`
    1.66                      ;;
    1.67              esac