Erik Walthinsen <omega@cse.ogi.edu>
Wim Taymans <wim.taymans@tvd.be>
-Richard Boulton <richardb@users.sourceforge.net>
+Richard Boulton <richard@tartarus.org>
#undef PLUGINS_SRCDIR
#undef PLUGINS_USE_SRCDIR
+#undef HAVE_CPU_I386
+#undef HAVE_CPU_PPC
+
#undef HAVE_GDK_PIXBUF
#undef HAVE_LIBGHTTP
#undef HAVE_LIBMMX
+++ /dev/null
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-#undef PLUGINS_DIR
-#undef PLUGINS_SRCDIR
-#undef PLUGINS_USE_SRCDIR
-
-#undef HAVE_GDK_PIXBUF
-#undef HAVE_LIBGHTTP
-#undef HAVE_LIBMMX
-#undef HAVE_XAUDIO
-#undef HAVE_CSSAUTH
-#undef HAVE_NASM
-
-#undef HAVE_ATOMIC_H
-
-#undef DEBUG_ENABLED
-
-/* Name of package */
-#undef PACKAGE
-
-/* Version number of package */
-#undef VERSION
-
AC_INIT(gst/gstobject.h)
+AC_CANONICAL_SYSTEM
+
AM_CONFIG_HEADER(config.h)
STREAMER_MAJOR_VERSION=0
dnl # Do automated configuration #
dnl ##############################
+dnl Set up conditionals for (target) host type:
+dnl ===========================================
+
+case "x${target_cpu}" in
+ xi386) HAVE_CPU_I386=yes ;
+ AC_DEFINE(HAVE_CPU_I386) ;;
+ xpowerpc) HAVE_CPU_PPC=yes ;
+ AC_DEFINE(HAVE_CPU_PPC) ;;
+esac
+
+
dnl Check for tools:
dnl ================
AM_PATH_GTK(1.2.0)
dnl Check for libghttp
+dnl FIXME: need to check for header
AC_CHECK_LIB(ghttp, ghttp_request_new,
[GHTTP_LIBS="-lghttp"
GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
dnl HAVE_ and it is likely to be easier to stick with the old name
+AM_CONDITIONAL(HAVE_CPU_I386, test "x$HAVE_CPU_I386" = "xyes")
+AM_CONDITIONAL(HAVE_CPU_PPC, test "x$HAVE_CPU_PPC" = "xyes")
AM_CONDITIONAL(HAVE_GDK_PIXBUF, test "x$USE_GDK_PIXBUF" = "xyes")
AM_CONDITIONAL(HAVE_LIBGHTTP, test "x$USE_LIBGHTTP" = "xyes")
AM_CONDITIONAL(HAVE_LIBMMX, test "x$USE_LIBMMX" = "xyes")
GSTOBJECT_INCLUDES = \
gstobject.h
+if HAVE_CPU_I386
+GSTARCH_SRCS = gstcpuid_i386.s
+else
+if HAVE_CPU_PPC
+GSTARCH_SRCS = gstppc.c
+else
+GSTARCH_SRCS =
+endif
+endif
+
libgst_la_SOURCES = \
gst.c \
$(GSTOBJECT_SRCS) \
gstbufferpool.c \
gstclock.c \
gstcpu.c \
- gstcpuid_i386.s \
+ $(GSTI386_SRCS) \
+ $(GSTPPC_SRCS) \
gstelement.c \
gstelementfactory.c \
gstbin.c \
#include <sys/mman.h>
#include "cothreads.h"
+#include "gstarch.h"
pthread_key_t _cothread_key = -1;
fprintf(stderr,"about to switch to thread #%d\n",ctx->current);
/* save the current stack pointer, frame pointer, and pc */
- __asm__("movl %%esp, %0" : "=m"(current->sp) : : "esp", "ebp");
+ GET_SP(current->sp);
enter = setjmp(current->jmp);
if (enter != 0)
return;
/* restore stack pointer and other stuff of new cothread */
if (thread->flags & COTHREAD_STARTED) {
fprintf(stderr,"in thread \n");
- __asm__("movl %0, %%esp\n" : "=m"(thread->sp));
+ SET_SP(thread->sp);
// switch to it
longjmp(thread->jmp,1);
} else {
- __asm__("movl %0, %%esp\n" : "=m"(thread->sp));
+ SET_SP(thread->sp);
// start it
- __asm__("jmp " SYMBOL_NAME_STR(cothread_stub));
+ JUMP(cothread_stub);
}
}
--- /dev/null
+#ifndef GST_HGUARD_GSTARCH_H
+#define GST_HGUARD_GSTARCH_H
+
+#ifdef __I386__
+#include "gsti386.h"
+#endif
+
+#ifdef __PPC__
+#include "gstppc.h"
+#endif
+
+#endif /* GST_HGUARD_GSTARCH_H */
--- /dev/null
+#ifndef GST_HGUARD_GSTI386_H
+#define GST_HGUARD_GSTI386_H
+
+/* Hmm - does this work, or do the braces cause other stack manipulation?
+ * XXX
+ */
+#define GET_SP(target) \
+ __asm__("movl %%esp, %0" : "=m"(target) : : "esp", "ebp");
+
+#define SET_SP(source) \
+ __asm__("movl %0, %%esp\n" : "=m"(thread->sp));
+
+#define JUMP(target) \
+ __asm__("jmp " SYMBOL_NAME_STR(cothread_stub))
+
+#endif /* GST_HGUARD_GSTI386_H */
--- /dev/null
+#ifndef GST_HGUARD_GSTPPC_H
+#define GST_HGUARD_GSTPPC_H
+
+/* Hmm - does this work, or do the braces cause other stack manipulation?
+ * XXX
+ */
+#define GET_SP(target) { \
+ register unsigned long r1 __asm__("r1"); \
+ target = r1; \
+}
+
+#define SET_SP(source) { \
+ register unsigned long r1 __asm__("r1"); \
+ r1 = source; \
+}
+
+#define JUMP(target) \
+ __asm__("b " SYMBOL_NAME_STR(cothread_stub))
+
+#endif /* GST_HGUARD_GSTPPC_H */
filter_LTLIBRARIES = libgstgetbits.la
-libgstgetbits_la_SOURCES = gstgetbits.c gstgetbits_inl.h gstgetbits_i386.s
+if HAVE_CPU_I386
+GSTARCH_SRCS = gstgetbits_i386.s
+else
+if HAVE_CPU_PPC
+GSTARCH_SRCS = gstgetbits_generic.c
+else
+GSTARCH_SRCS =
+endif
+endif
+
+libgstgetbits_la_SOURCES = gstgetbits.c gstgetbits_inl.h $(GSTARCH_SRCS)
libgstgetbitsincludedir = $(includedir)/gst/libs/gstgetbits
libgstgetbitsinclude_HEADERS = gstgetbits.h