Fixed X11 library detection
Allow passing CFLAGS for the build in the environment --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401393
This commit is contained in:
parent
5b3fcf92ea
commit
e149d87d15
1 changed files with 20 additions and 24 deletions
44
configure.in
44
configure.in
|
@ -49,34 +49,30 @@ else
|
||||||
AC_DEFINE(SDL_BYTEORDER, 1234)
|
AC_DEFINE(SDL_BYTEORDER, 1234)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl Set up the base CFLAGS and LIBS
|
dnl Set up the compiler and linker flags
|
||||||
case "$target" in
|
|
||||||
*-*-cygwin*)
|
|
||||||
# We build SDL on cygwin without the UNIX emulation layer
|
|
||||||
BASE_CFLAGS="-I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
|
|
||||||
BASE_LIBS="-mno-cygwin"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
BASE_CFLAGS="-D_GNU_SOURCE=1"
|
|
||||||
BASE_LIBS=""
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
CFLAGS="$CFLAGS $BASE_CFLAGS"
|
|
||||||
|
|
||||||
dnl Set up the compiler and linker flags for building SDL
|
|
||||||
INCLUDE="-I$srcdir/include"
|
INCLUDE="-I$srcdir/include"
|
||||||
if test x$srcdir != x.; then
|
if test x$srcdir != x.; then
|
||||||
INCLUDE="-Iinclude $INCLUDE"
|
INCLUDE="-Iinclude $INCLUDE"
|
||||||
fi
|
fi
|
||||||
BUILD_CFLAGS="$BASE_CFLAGS \$(INCLUDE)"
|
case "$target" in
|
||||||
BUILD_LIBS="$BASE_LIBS"
|
*-*-cygwin*)
|
||||||
|
# We build SDL on cygwin without the UNIX emulation layer
|
||||||
dnl Set up the compiler and linker flags for SDL applications
|
CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
|
||||||
SDL_CFLAGS="$BASE_CFLAGS"
|
BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
|
||||||
SDL_LIBS="$BASE_LIBS -lSDL"
|
BUILD_LIBS="-mno-cygwin"
|
||||||
|
SDL_CFLAGS="-I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
|
||||||
|
SDL_LIBS="-lSDL -mno-cygwin"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
|
||||||
|
BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
|
||||||
|
BUILD_LIBS=""
|
||||||
|
SDL_CFLAGS=""
|
||||||
|
SDL_LIBS="-lSDL"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
dnl Check for tools
|
dnl Check for tools
|
||||||
#AC_LIBTOOL_DLOPEN
|
|
||||||
AC_LIBTOOL_WIN32_DLL
|
AC_LIBTOOL_WIN32_DLL
|
||||||
AC_PROG_LIBTOOL
|
AC_PROG_LIBTOOL
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
@ -751,9 +747,9 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [default=yes
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if test x$X_LIBS = x; then X_LIBS="-L/usr/lib"; fi
|
if test x$X_LIBS = x; then X_LIBS="-L/usr/lib"; fi
|
||||||
x11_lib_spec=`echo $X_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libX11.so*/'`
|
x11_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libX11.so.[0-9]/'`]
|
||||||
x11_lib=`ls $x11_lib_spec 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`
|
x11_lib=`ls $x11_lib_spec 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`
|
||||||
x11ext_lib_spec=`echo $X_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libXext.so*/'`
|
x11ext_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libXext.so.[0-9]/'`]
|
||||||
x11ext_lib=`ls $x11ext_lib_spec 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`
|
x11ext_lib=`ls $x11ext_lib_spec 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue