summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-12-01 14:06:47 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-12-01 14:07:33 +0100
commit87bf428ac698d707055b66add588604da8c54bab (patch)
treed236708ae61563a74f8b86c0a03949157815a9d6 /m4
parentda4c75cfe0beed21391671e33f3bc99de4992aa2 (diff)
m4: Add gst-platform.m4 for platform specific checks and defines
These are currently copied from core but some/most of them are useful for other modules too.
Diffstat (limited to 'm4')
-rw-r--r--m4/gst-platform.m455
1 files changed, 55 insertions, 0 deletions
diff --git a/m4/gst-platform.m4 b/m4/gst-platform.m4
new file mode 100644
index 0000000..c427c4f
--- /dev/null
+++ b/m4/gst-platform.m4
@@ -0,0 +1,55 @@
+dnl AG_GST_PLATFORM
+dnl Check for platform specific features and define some variables
+dnl
+dnl GST_EXTRA_MODULE_SUFFIX: contains a platform specific
+dnl extra module suffix additional to G_MODULE_SUFFIX
+dnl
+dnl HAVE_OSX: Defined if compiling for OS X
+dnl
+dnl GST_HAVE_UNSAFE_FORK: Defined if fork is unsafe (Windows)
+dnl
+dnl HAVE_WIN32: Defined if compiling on Win32
+dnl
+
+AC_DEFUN([AG_GST_PLATFORM],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ case $host_os in
+ rhapsody*)
+ AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix])
+ ;;
+ darwin*)
+ AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix])
+ AC_DEFINE_UNQUOTED(HAVE_OSX, 1, [Defined if compiling for OSX])
+ ;;
+ cygwin*)
+ AC_DEFINE_UNQUOTED(GST_HAVE_UNSAFE_FORK, 1, [Defined when registry scanning through fork is unsafe])
+ ;;
+ mingw* | msvc* | mks*)
+ dnl HAVE_WIN32 currently means "disable POSIXisms".
+ AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
+
+ dnl define __MSVCRT_VERSION__ version if not set already by the
+ dnl compiler (ie. mostly for mingw). This is needed for things like
+ dnl __stat64 to be available. If set by the compiler, ensure it's
+ dnl new enough - we need at least WinXP SP2.
+ AC_TRY_COMPILE([ ], [ return __MSVCRT_VERSION__; ], [
+ AC_TRY_COMPILE([ ], [
+ #if __MSVCRT_VERSION__ < 0x0601
+ #error "MSVCRT too old"
+ #endif
+ ], [
+ AC_MSG_NOTICE([MSVCRT version looks ok])
+ ], [
+ AC_MSG_ERROR([MSVCRT version too old, need at least WinXP SP2])
+ ])
+ ], [
+ AC_MSG_NOTICE([Setting MSVCRT version to 0x0601])
+ AC_DEFINE_UNQUOTED(__MSVCRT_VERSION__, 0x0601, [We need at least WinXP SP2 for __stat64])
+ ])
+ ;;
+ *)
+ ;;
+ esac
+])