summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-01-20 23:21:52 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-01-20 23:21:52 +0000
commitd28d2b9e23f5ede57ae3325fcadfac0056af7d57 (patch)
tree6c4654ff5b975aeff3d28e0ac1df68cd18de4488
parente45cadedda467872cc062d52aa6e7170cab89088 (diff)
downloadxine-lib-d28d2b9e23f5ede57ae3325fcadfac0056af7d57.tar.gz
xine-lib-d28d2b9e23f5ede57ae3325fcadfac0056af7d57.tar.bz2
Change SDL checks.
CVS patchset: 1431 CVS date: 2002/01/20 23:21:52
-rw-r--r--acconfig.h3
-rw-r--r--configure.in15
-rwxr-xr-xcvscompile.sh2
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/sdl.m4175
-rw-r--r--misc/xine-lib.spec.in13
-rw-r--r--src/xine-engine/locale.c4
7 files changed, 198 insertions, 16 deletions
diff --git a/acconfig.h b/acconfig.h
index e3282eb08..4ac95a5a3 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -111,6 +111,9 @@
/* this one isn't implemented: */
#undef FPM_M68K
+/* Define this if you have SDL library installed */
+#undef HAVE_SDL
+
@BOTTOM@
/* Disable GCC compiler extensions, if gcc is not in use */
#ifndef __GNUC__
diff --git a/configure.in b/configure.in
index 06918f3a9..323e5df89 100644
--- a/configure.in
+++ b/configure.in
@@ -313,17 +313,8 @@ AM_CONDITIONAL(HAVE_FB, [test x"$have_fb" = "xyes"])
dnl
dnl check for SDL
dnl
-AC_SUBST(SDL_CFLAGS)
-AC_SUBST(SDL_LIBS)
-SDL_CFLAGS=""
-SDL_LIBS=""
-AC_CHECK_PROG([SDLCONFIG],[sdl-config],[yes])
-if test x"$SDLCONFIG" = x"yes"; then
- SDL_CFLAGS="`sdl-config --cflags`"
- SDL_LIBS="`sdl-config --libs`"
-fi
-AM_CONDITIONAL(HAVE_SDL, [test x"$SDLCONFIG" = x"yes"])
-
+AM_PATH_SDL(1.2.0, AC_DEFINE(HAVE_SDL),[])
+AM_CONDITIONAL(HAVE_SDL, [test x"$no_sdl" != x"yes"])
dnl
dnl Check for divx4
@@ -919,7 +910,7 @@ fi
if test x$have_fb = "xyes"; then
echo " - fb (Linux framebuffer device)"
fi
-if test x"$SDLCONFIG" = x"yes"; then
+if test x"$no_sdl" != x"yes"; then
echo " - sdl (Simple DirectMedia Layer)"
fi
if test x"$have_dxr3" = "xyes"; then
diff --git a/cvscompile.sh b/cvscompile.sh
index 9a888fd7a..e4159a9d3 100755
--- a/cvscompile.sh
+++ b/cvscompile.sh
@@ -13,7 +13,7 @@ rm -f config.cache
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
-m4_files="_xine.m4 arts.m4 esd.m4 iconv.m4 lcmessage.m4 vorbis.m4 aa.m4 gettext.m4 irixal.m4 ogg.m4 alsa.m4 codeset.m4 glibc21.m4 isc-posix.m4 progtest.m4"
+m4_files="_xine.m4 arts.m4 esd.m4 iconv.m4 lcmessage.m4 vorbis.m4 aa.m4 gettext.m4 irixal.m4 ogg.m4 alsa.m4 codeset.m4 glibc21.m4 isc-posix.m4 progtest.m4 sdl.m4"
if test -d $srcdir/m4; then
rm -f acinclude.m4
for m4f in $m4_files; do
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 9e60a2bea..6d2c155b7 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -7,7 +7,7 @@ m4data_DATA = xine.m4
endif
EXTRA_DIST = xine.m4 _xine.m4 arts.m4 esd.m4 iconv.m4 lcmessage.m4 vorbis.m4 aa.m4 as.m4 \
- gettext.m4 irixal.m4 ogg.m4 alsa.m4 codeset.m4 glibc21.m4 isc-posix.m4 progtest.m4
+ gettext.m4 irixal.m4 ogg.m4 alsa.m4 codeset.m4 glibc21.m4 isc-posix.m4 progtest.m4 sdl.m4
debug:
diff --git a/m4/sdl.m4 b/m4/sdl.m4
new file mode 100644
index 000000000..5d428933f
--- /dev/null
+++ b/m4/sdl.m4
@@ -0,0 +1,175 @@
+# Configure paths for SDL
+# Sam Lantinga 9/21/99
+# stolen from Manish Singh
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+# Small fix to avoid warnings from Daniel Caujolle-Bert
+
+dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
+dnl
+AC_DEFUN(AM_PATH_SDL,
+ [dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ dnl Get the cflags and libraries from the sdl-config script
+ dnl
+ AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
+ sdl_prefix="$withval", sdl_prefix="")
+ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+ sdl_exec_prefix="$withval", sdl_exec_prefix="")
+ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],, enable_sdltest=yes)
+
+ if test x$sdl_exec_prefix != x ; then
+ sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+ fi
+ fi
+ if test x$sdl_prefix != x ; then
+ sdl_args="$sdl_args --prefix=$sdl_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_prefix/bin/sdl-config
+ fi
+ fi
+
+ AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
+ min_sdl_version=ifelse([$1], ,0.11.0,$1)
+ AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+ no_sdl=""
+ if test "$SDL_CONFIG" = "no" ; then
+ no_sdl=yes
+ else
+ SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
+ SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
+
+ sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_sdltest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"
+dnl
+dnl Now check if the installed SDL is sufficiently new. (Also sanity
+dnl checks the results of sdl-config to some extent
+dnl
+ rm -f conf.sdltest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "SDL.h"
+
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main (int argc, char *argv[])
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ /* This hangs on some systems (?)
+ system ("touch conf.sdltest");
+ */
+ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_sdl_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_sdl_version");
+ exit(1);
+ }
+
+ if (($sdl_major_version > major) ||
+ (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+ (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+ printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+ printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_sdl" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$SDL_CONFIG" = "no" ; then
+ echo "*** The sdl-config script installed by SDL could not be found"
+ echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the SDL_CONFIG environment variable to the"
+ echo "*** full path to sdl-config."
+ else
+ if test -f conf.sdltest ; then
+ :
+ else
+ echo "*** Could not run SDL test program, checking why..."
+ CFLAGS="$CFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{ return 0; }
+#undef main
+#define main K_and_R_C_main
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding SDL or finding the wrong"
+ echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means SDL was incorrectly installed"
+ echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+ echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ SDL_CFLAGS=""
+ SDL_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(SDL_CFLAGS)
+ AC_SUBST(SDL_LIBS)
+ rm -f conf.sdltest
+])
diff --git a/misc/xine-lib.spec.in b/misc/xine-lib.spec.in
index 51e29a2f9..dcafc33c9 100644
--- a/misc/xine-lib.spec.in
+++ b/misc/xine-lib.spec.in
@@ -46,6 +46,11 @@ BuildRoot: /tmp/%{name}-root
@HAVE_XV_TRUE@Group: Development/Libraries
@HAVE_XV_TRUE@Requires: xine-lib >= %{ver}
+@HAVE_SDL_TRUE@%package sdl
+@HAVE_SDL_TRUE@Summary: XINE - SDL (Simple DirectMedia Layer) video support.
+@HAVE_SDL_TRUE@Group: Development/Libraries
+@HAVE_SDL_TRUE@Requires: xine-lib >= %{ver}, libSDL
+
@HAVE_AA_TRUE@%package aa
@HAVE_AA_TRUE@Summary: XINE - Ascii Art support.
@HAVE_AA_TRUE@Group: Development/Libraries
@@ -119,6 +124,9 @@ ler qualquer vídeo com máximo desempenho.
@HAVE_XV_TRUE@%description xv
@HAVE_XV_TRUE@video plugin using XFree XVideo extension.
+@HAVE_SDL_TRUE@%description sdl
+@HAVE_SDL_TRUE@video plugin using SDL (Simple DirectMedia Layer) library.
+
@HAVE_AA_TRUE@%description aa
@HAVE_AA_TRUE@video plugin using Ascii Art library.
@@ -299,6 +307,11 @@ rm -rf $RPM_BUILD_ROOT
@HAVE_XV_TRUE@%{prefix}/lib/xine/plugins/xineplug_vo_out_xv.la
@HAVE_XV_TRUE@%{prefix}/lib/xine/plugins/xineplug_vo_out_xv.so
+@HAVE_SDL_TRUE@%files sdl
+@HAVE_SDL_TRUE@%defattr(-,root,root)
+@HAVE_SDL_TRUE@%{prefix}/lib/xine/plugins/xineplug_vo_out_sdl.la
+@HAVE_SDL_TRUE@%{prefix}/lib/xine/plugins/xineplug_vo_out_sdl.so
+
@HAVE_AA_TRUE@%files aa
@HAVE_AA_TRUE@%defattr(-,root,root)
@HAVE_AA_TRUE@%{prefix}/lib/xine/plugins/xineplug_vo_out_aa.la
diff --git a/src/xine-engine/locale.c b/src/xine-engine/locale.c
index 692ed37fd..7ff9db763 100644
--- a/src/xine-engine/locale.c
+++ b/src/xine-engine/locale.c
@@ -17,9 +17,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: locale.c,v 1.1 2001/12/27 14:34:02 f1rmb Exp $
+ * $Id: locale.c,v 1.2 2002/01/20 23:21:52 f1rmb Exp $
*
- * config file management - implementation
+ * intl init.
*
*/