Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / common / m4 / gst-platform.m4
1 dnl AG_GST_PLATFORM
2 dnl Check for platform specific features and define some variables
3 dnl
4 dnl GST_EXTRA_MODULE_SUFFIX: contains a platform specific
5 dnl   extra module suffix additional to G_MODULE_SUFFIX
6 dnl
7 dnl HAVE_OSX: Defined if compiling for OS X
8 dnl
9 dnl GST_HAVE_UNSAFE_FORK: Defined if fork is unsafe (Windows)
10 dnl
11 dnl HAVE_WIN32: Defined if compiling on Win32
12 dnl
13
14 AC_DEFUN([AG_GST_PLATFORM],
15 [
16   AC_REQUIRE([AC_CANONICAL_HOST])
17
18   case $host_os in
19     rhapsody*)
20       AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix])
21       ;;
22     darwin*)
23       AC_DEFINE_UNQUOTED(GST_EXTRA_MODULE_SUFFIX, [".dylib"], [Extra platform specific plugin suffix])
24       AC_DEFINE_UNQUOTED(HAVE_OSX, 1, [Defined if compiling for OSX])
25       ;;
26     cygwin*)
27       AC_DEFINE_UNQUOTED(GST_HAVE_UNSAFE_FORK, 1, [Defined when registry scanning through fork is unsafe])
28       ;;
29     mingw* | msvc* | mks*)
30       dnl HAVE_WIN32 currently means "disable POSIXisms".
31       AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
32
33       dnl define __MSVCRT_VERSION__ version if not set already by the
34       dnl compiler (ie. mostly for mingw). This is needed for things like
35       dnl __stat64 to be available. If set by the compiler, ensure it's
36       dnl new enough - we need at least WinXP SP2.
37       AC_TRY_COMPILE([ ], [ return __MSVCRT_VERSION__; ], [
38           AC_TRY_COMPILE([ ], [
39             #if __MSVCRT_VERSION__ < 0x0601
40             #error "MSVCRT too old"
41             #endif
42           ], [
43             AC_MSG_NOTICE([MSVCRT version looks ok])
44           ], [
45             AC_MSG_ERROR([MSVCRT version too old, need at least WinXP SP2])
46           ])
47       ], [
48         AC_MSG_NOTICE([Setting MSVCRT version to 0x0601])
49         AC_DEFINE_UNQUOTED(__MSVCRT_VERSION__, 0x0601, [We need at least WinXP SP2 for __stat64])
50       ])
51       ;;
52      *)
53       ;;
54   esac
55 ])
56
57 AC_DEFUN([AG_GST_LIBTOOL_PREPARE],
58 [
59   dnl Persuade libtool to also link (-l) a 'pure' (DirectX) static lib,
60   dnl i.e. as opposed to only import lib with dll counterpart.
61   dnl Needs to be tweaked before libtool's checks.
62   case $host_os in
63   cygwin* | mingw*)
64     lt_cv_deplibs_check_method=pass_all
65     ;;
66   esac
67 ])