[gst-devel] gstreamer/gst/Makefile.am [PATCH]

Richard Boulton richard at tartarus.org
Wed Feb 6 10:41:03 CET 2002


I have a patch for gstreamer/gst/Makefile.am which fixes a FIXME:
"this only lists the x86 arch file, we really should merge them all"
by doing things the proper automake way.

In more detail, cothreads.c needs to be compiled with -O2: currently
this is done with a custom rule, but the dependencies of the rule are
broken, and very hard to get right.

Automake versions greater than 1.5 support per-target CFLAGS, so the
custom CFLAGS can be applied to cothreads.c without having to hack
around and have broken dependencies.

I've been testing this on my private tree for the last couple of weeks,
and it appears to work perfectly.

I submitted this patch privately, but it seems to have got lost, and
it's becoming a pain keeping it up-to-date, so I'm keen to get approval
to commit this, or get it committed, soon.

Patch is attached.

-- 
Richard

-------------- next part --------------
Index: Makefile.am
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/Makefile.am,v
retrieving revision 1.92
diff -u -r1.92 Makefile.am
--- Makefile.am	2002/02/06 16:35:15	1.92
+++ Makefile.am	2002/02/06 18:38:49
@@ -1,6 +1,6 @@
-# cheap trick to build . first...
 
 lib_LTLIBRARIES = libgst.la
+noinst_LTLIBRARIES = libcothreads.la
 
 if HAVE_CPU_I386
 GSTARCH_SRCS = gstcpuid_i386.s
@@ -44,11 +44,12 @@
 
 EXTRA_libgst_la_SOURCES = gstcpuid_i386.s gstmarshal.list gstxml.c gsttypefind.c gstparse.c gstautoplug.c gsttrace.c
 
+# cheap trick to build . first...
 SUBDIRS = . types elements $(GST_AUTOPLUG_DIRS) schedulers
 DIST_SUBDIRS = types elements autoplug schedulers
 
+libcothreads_la_SOURCES = cothreads.c
 libgst_la_SOURCES =		\
-	cothreads.c		\
 	gst.c			\
 	gstmarshal.c		\
 	gstobject.c		\
@@ -83,16 +84,6 @@
 	$(GST_LOADSAVE_SRC)
 
 
-# FIXME this only lists the x86 arch file, we really should merge them all
-cothreads.lo: $(srcdir)/cothreads.c $(srcdir)/cothreads.h $(srcdir)/gst_private.h \
-  $(top_builddir)/config.h $(srcdir)/gstinfo.c $(srcdir)/gstarch.h
-	$(LIBTOOL) --mode=compile $(COMPILE) -O2 -c $<
-cothreads.o: $(srcdir)/cothreads.c $(srcdir)/cothreads.h $(srcdir)/gst_private.h \
-  $(top_builddir)/config.h $(srcdir)/gstinfo.c $(srcdir)/gstarch.h
-	$(COMPILE) -O2 -c $<
-
-##### Other built sources #####
-
 BUILT_SOURCES = gstmarshal.h gstmarshal.c
 
 # Generate both marshal files together.  Makes dependency work easier.
@@ -164,8 +155,10 @@
 	-DG_LOG_DOMAIN=g_log_domain_gstreamer \
 	-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\"
 
-libgst_la_LIBADD = $(LIBGST_LIBS)
+# the compiler shoots cothreads.c in the head at -O6
+libcothreads_la_CFLAGS = $(libgst_la_CFLAGS) -O2
 
+libgst_la_LIBADD = $(LIBGST_LIBS) libcothreads.la
 libgst_la_LDFLAGS = -version-info $(GST_LIBVERSION) -release $(GST_VERSION)
 
 EXTRA_DIST = ROADMAP


More information about the gstreamer-devel mailing list