[longomatch] Fix build for OS X



commit b41a505a50dc8ec8a2683541abfd197ee832e474
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Aug 24 19:20:56 2012 +0200

    Fix build for OS X

 configure.ac               |   21 +++++++++++++++------
 libcesarplayer/Makefile.am |    8 +++++++-
 2 files changed, 22 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c7854aa..5a21516 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,17 +87,26 @@ AC_SUBST(CESARPLAYER_LIBS)
 
 #SHAVE_INIT([build/m4/shave], [enable])
 
-AC_MSG_CHECKING([if building for some Win32 platform])
+AC_MSG_CHECKING([for the OS type])
+ostype=""
+
 case "$host" in
   *-*-mingw*|*-*-cygwin*)
-    platform_win32=yes
+    ostype=Windows
+    ;;
+  *-*-darwin*)
+    ostype=OS_X
     ;;
-  *)
-    platform_win32=no
+  *-*-linux*)
+    ostype=Linux
     ;;
 esac
-AC_MSG_RESULT($platform_win32)
-AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
+AM_CONDITIONAL(OSTYPE_WINDOWS, test x$ostype = xWindows)
+AM_CONDITIONAL(OSTYPE_OS_X, test x$ostype = xOS_X)
+AM_CONDITIONAL(OSTYPE_LINUX, test x$ostype = xLinux)
+AC_MSG_RESULT($ostype)
+
+AM_CONDITIONAL(ENABLE_TESTS, False)
 
 dnl package checks, per config
 
diff --git a/libcesarplayer/Makefile.am b/libcesarplayer/Makefile.am
index 6c623a1..4576b6e 100644
--- a/libcesarplayer/Makefile.am
+++ b/libcesarplayer/Makefile.am
@@ -4,8 +4,14 @@
 AM_CPPFLAGS = \
 	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
 	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+	-x objective-c \
 	$(CESARPLAYER_CFLAGS)
 
+if OSTYPE_OS_X
+AM_CPPFLAGS += \
+	-x objective-c
+endif
+
 AM_CFLAGS =\
 	 -Wall\
 	 -g
@@ -43,7 +49,7 @@ libcesarplayer_la_SOURCES = \
 libcesarplayer_la_LDFLAGS = \
 	$(CESARPLAYER_LIBS)
 
-if PLATFORM_WIN32
+if OSTYPE_WINDOWS
 libcesarplayer_la_LDFLAGS += -no-undefined
 endif
 	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]