configure: Add OBJC specific compiler flags
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 30 May 2012 09:09:25 +0000 (11:09 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 30 May 2012 09:28:33 +0000 (11:28 +0200)
See bug #643939.

configure.ac
sys/osxvideo/Makefile.am

index f882956..77ecae5 100644 (file)
@@ -112,7 +112,7 @@ dnl determine c++ preprocessor
 dnl FIXME: do we need this ?
 AC_PROG_CXXCPP
 
-AS_PROG_OBJC
+AC_PROG_OBJC
 
 dnl check if the compiler supports '-c' and '-o' options
 AM_PROG_CC_C_O
@@ -280,22 +280,11 @@ AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
 
 dnl define an ERROR_CFLAGS Makefile variable
 dnl -Wundef: too many broken headers
-if test "x$HAVE_OSX_VIDEO" != "xyes"; then
-  AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
-        -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
-        -Wwrite-strings -Wold-style-definition -Waggregate-return
-        -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
-        -Wnested-externs $NO_WARNINGS])
-else
-  dnl work-around for us passing GST_CFLAGS to the ObjC-compiler, which
-  dnl doesn't understand all warning flags that the C compiler knows about
-  dnl (e.g. -Waddress) or causes problems with some flags (-Waggregate-return)
-  AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
-        -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
-        -Wwrite-strings -Wold-style-definition
-        -Winit-self -Wmissing-include-dirs -Wno-multichar
-        -Wnested-externs $NO_WARNINGS])
-fi
+AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
+      -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
+      -Wwrite-strings -Wold-style-definition -Waggregate-return
+      -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
+      -Wnested-externs $NO_WARNINGS])
 
 dnl define an ERROR_CXXFLAGS Makefile variable
 AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
@@ -304,6 +293,13 @@ AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
         -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
         $NO_WARNINGS])
 
+dnl define an ERROR_OBJCFLAGS Makefile variable
+AG_GST_SET_ERROR_OBJCFLAGS($FATAL_WARNINGS, [
+      -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
+      -Wwrite-strings -Wold-style-definition
+      -Winit-self -Wmissing-include-dirs -Wno-multichar
+      -Wnested-externs $NO_WARNINGS])
+
 dnl define correct level for debugging messages
 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
 
@@ -1011,12 +1007,14 @@ else
 fi
 AC_SUBST(DEPRECATED_CFLAGS)
 
-dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
+dnl every flag in GST_OPTION_CFLAGS, GST_OPTION_CXXFLAGS and GST_OPTION_OBJCFLAGS can be overridden
 dnl at make time with e.g. make ERROR_CFLAGS=""
 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
+GST_OPTION_OBJCFLAGS="\$(WARNING_OBJCFLAGS) \$(ERROR_OBJCFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
 AC_SUBST(GST_OPTION_CFLAGS)
 AC_SUBST(GST_OPTION_CXXFLAGS)
+AC_SUBST(GST_OPTION_OBJCFLAGS)
 
 dnl our libraries need to be versioned correctly
 AC_SUBST(GST_LT_LDFLAGS)
@@ -1027,9 +1025,11 @@ dnl also add builddir include for enumtypes and marshal
 dnl add ERROR_CFLAGS, but overridable
 GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS)"
+GST_OBJCFLAGS="-I\$(top_srcdir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS)"
 GST_CFLAGS="-I\$(top_srcdir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
 AC_SUBST(GST_CFLAGS)
 AC_SUBST(GST_CXXFLAGS)
+AC_SUBST(GST_OBJCFLAGS)
 AC_SUBST(GST_LIBS)
 
 dnl LDFLAGS really should only contain flags, not libs - they get added before
index 9ed8a7f..39ff54d 100644 (file)
@@ -2,18 +2,15 @@
 plugin_LTLIBRARIES = libgstosxvideosink.la
 
 libgstosxvideosink_la_SOURCES = osxvideosink.m cocoawindow.m 
-libgstosxvideosink_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
-       $(GST_PLUGINS_BASE_CFLAGS)
+libgstosxvideosink_la_CFLAGS = $(GST_OBJCFLAGS) $(GST_BASE_CFLAGS) \
+       $(GST_PLUGINS_BASE_CFLAGS) -DRUN_NS_APP_THREAD
 libgstosxvideosink_la_LIBADD =  \
        $(GST_LIBS) \
        $(GST_BASE_LIBS) \
-    $(GST_PLUGINS_BASE_LIBS) \
-    -lgstvideo-$(GST_API_VERSION) \
-       -lgstinterfaces-$(GST_API_VERSION)
+       $(GST_PLUGINS_BASE_LIBS) \
+       -lgstvideo-$(GST_API_VERSION)
 
 libgstosxvideosink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,QuickTime -Wl,-framework -Wl,OpenGL
 libgstosxvideosink_la_LIBTOOLFLAGS = --tag=disable-static
 
-AM_OBJCFLAGS=$(CFLAGS) $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) -Wno-aggregate-return -DRUN_NS_APP_THREAD
-
 noinst_HEADERS = osxvideosink.h cocoawindow.h