PageRenderTime 13ms CodeModel.GetById 10ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/m4/osx.m4

http://github.com/mozy/mordor
m4 | 92 lines | 88 code | 4 blank | 0 comment | 0 complexity | dbcd58dd6ee367521ce318e82923e6ec MD5 | raw file
 1dnl Defines COREFOUNDATION_FRAMEWORK_LIBS.
 2AC_DEFUN([AX_CHECK_COREFOUNDATION_FRAMEWORK],
 3[
 4  AC_CACHE_CHECK([for CFRetain],
 5    gt_cv_func_CFRetain,
 6    [gt_save_LIBS="$LIBS"
 7     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 8     AC_TRY_LINK([#include <CoreFoundation/CFBase.h>],
 9       [CFRetain(NULL)],
10       [gt_cv_func_CFRetain=yes],
11       [gt_cv_func_CFRetain=no])
12     LIBS="$gt_save_LIBS"])
13  if test $gt_cv_func_CFRetain = yes; then
14    AC_DEFINE([HAVE_COREFOUNDATION_FRAMEWORK], 1,
15      [Define to 1 if you have the MacOS X CoreFoundation framework.])
16  fi
17  COREFOUNDATION_FRAMEWORK_LIBS=
18  if test $gt_cv_func_CFRetain = yes; then
19    COREFOUNDATION_FRAMEWORK_LIBS="-Wl,-framework -Wl,CoreFoundation"
20  fi
21  AC_SUBST([COREFOUNDATION_FRAMEWORK_LIBS])
22])
23
24dnl Defines SYSTEMCONFIGURATION_FRAMEWORK_LIBS.
25AC_DEFUN([AX_CHECK_SYSTEMCONFIGURATION_FRAMEWORK],
26[
27  AC_CACHE_CHECK([for SCDynamicStoreCreate],
28    gt_cv_func_SCDynamicStoreCreate,
29    [gt_save_LIBS="$LIBS"
30     LIBS="$LIBS -Wl,-framework -Wl,SystemConfiguration"
31     AC_TRY_LINK([#include <SystemConfiguration/SystemConfiguration.h>],
32       [SCDynamicStoreCreate(NULL, NULL, NULL, NULL)],
33       [gt_cv_func_SCDynamicStoreCreate=yes],
34       [gt_cv_func_SCDynamicStoreCreate=no])
35     LIBS="$gt_save_LIBS"])
36  if test $gt_cv_func_SCDynamicStoreCreate = yes; then
37    AC_DEFINE([HAVE_SYSTEMCONFIGURATION_FRAMEWORK], 1,
38      [Define to 1 if you have the MacOS X SystemConfiguration framework.])
39  fi
40  SYSTEMCONFIGURATION_FRAMEWORK_LIBS=
41  if test $gt_cv_func_SCDynamicStoreCreate = yes; then
42    SYSTEMCONFIGURATION_FRAMEWORK_LIBS="-Wl,-framework -Wl,SystemConfiguration"
43  fi
44  AC_SUBST([SYSTEMCONFIGURATION_FRAMEWORK_LIBS])
45])
46
47dnl Defines CORESERVICES_FRAMEWORK_LIBS.
48AC_DEFUN([AX_CHECK_CORESERVICES_FRAMEWORK],
49[
50  AC_CACHE_CHECK([for CFNetworkCopyProxiesForURL],
51    gt_cv_func_CFNetworkCopyProxiesForURL,
52    [gt_save_LIBS="$LIBS"
53     LIBS="$LIBS -Wl,-framework -Wl,CoreServices"
54     AC_TRY_LINK([#include <CoreServices/CoreServices.h>],
55       [CFNetworkCopyProxiesForURL(NULL, NULL)],
56       [gt_cv_func_CFNetworkCopyProxiesForURL=yes],
57       [gt_cv_func_CFNetworkCopyProxiesForURL=no])
58     LIBS="$gt_save_LIBS"])
59  if test $gt_cv_func_CFNetworkCopyProxiesForURL = yes; then
60    AC_DEFINE([HAVE_CORESERVICES_FRAMEWORK], 1,
61      [Define to 1 if you have the MacOS X CoreServices framework.])
62  fi
63  CORESERVICES_FRAMEWORK_LIBS=
64  if test $gt_cv_func_CFNetworkCopyProxiesForURL = yes; then
65    CORESERVICES_FRAMEWORK_LIBS="-Wl,-framework -Wl,CoreServices"
66  fi
67  AC_SUBST([CORESERVICES_FRAMEWORK_LIBS])
68])
69
70dnl Defines SECURITY_FRAMEWORK_LIBS.
71AC_DEFUN([AX_CHECK_SECURITY_FRAMEWORK],
72[
73  AC_CACHE_CHECK([for SecKeychainItemFreeContent],
74    gt_cv_func_SecKeychainItemFreeContent,
75    [gt_save_LIBS="$LIBS"
76     LIBS="$LIBS -Wl,-framework -Wl,Security"
77     AC_TRY_LINK([#include <Security/SecKeychain.h>],
78       [SecKeychainItemFreeContent(NULL, NULL)],
79       [gt_cv_func_SecKeychainItemFreeContent=yes],
80       [gt_cv_func_SecKeychainItemFreeContent=no])
81     LIBS="$gt_save_LIBS"])
82  if test $gt_cv_func_SecKeychainItemFreeContent = yes; then
83    AC_DEFINE([HAVE_SECURITY_FRAMEWORK], 1,
84      [Define to 1 if you have the MacOS X Security framework.])
85  fi
86  SECURITY_FRAMEWORK_LIBS=
87  if test $gt_cv_func_SecKeychainItemFreeContent = yes; then
88    SECURITY_FRAMEWORK_LIBS="-Wl,-framework -Wl,Security"
89  fi
90  AC_SUBST([SECURITY_FRAMEWORK_LIBS])
91])
92