Changeset 13700


Ignore:
Timestamp:
Aug 24, 2005, 11:20:45 PM (15 years ago)
Author:
jberry
Message:

Daemondo relies on CFNotificationCenterGetDarwinNotifyCenter, which is not available til Tiger, so test for it before trying to build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/aclocal.m4

    r13695 r13700  
    5555
    5656        AC_SUBST(HAVE_FRAMEWORK_COREFOUNDATION)
     57])
     58
     59
     60#------------------------------------------------------------------------
     61# OD_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER --
     62#
     63#       Check if if the routine CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
     64#       is available in CoreFoundation.
     65#
     66# Arguments:
     67#       None.
     68#
     69# Requires:
     70#       None.
     71#
     72# Depends:
     73#               AC_LANG_PROGRAM
     74#
     75# Results:
     76#       Result is cached.
     77#
     78#       If function CFNotificationCenterGetDarwinNotifyCenter is in the CoreFoundation framework, defines the following variables:
     79#               HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
     80#
     81#------------------------------------------------------------------------
     82AC_DEFUN(OD_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER, [
     83        FRAMEWORK_LIBS="-framework CoreFoundation"
     84
     85        AC_MSG_CHECKING([for whether function CFNotificationCenterGetDarwinNotifyCenter is available])
     86
     87        AC_CACHE_VAL(od_cv_have_function_cfnotificationcentergetdarwinnotifycenter, [
     88                ac_save_LIBS="$LIBS"
     89                LIBS="$FRAMEWORK_LIBS $LIBS"
     90               
     91                AC_LINK_IFELSE([
     92                        AC_LANG_PROGRAM([
     93                                        #include <CoreFoundation/CoreFoundation.h>
     94                                ], [
     95                                        CFNotificationCenterRef ref = CFNotificationCenterGetDarwinNotifyCenter();
     96                        ])
     97                        ], [
     98                                od_cv_have_function_cfnotificationcentergetdarwinnotifycenter="yes"
     99                        ], [
     100                                od_cv_have_function_cfnotificationcentergetdarwinnotifycenter="no"
     101                        ]
     102                )
     103
     104                LIBS="$ac_save_LIBS"
     105        ])
     106
     107        AC_MSG_RESULT(${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter})
     108
     109        if test x"${od_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" = "xyes"; then
     110                AC_DEFINE([HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER], [], [Define if function CFNotificationCenterGetDarwinNotifyCenter in CoreFoundation framework])
     111        fi
     112
     113        AC_SUBST(HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER)
    57114])
    58115
     
    448505        AC_REQUIRE([OD_CHECK_FRAMEWORK_SYSTEMCONFIGURATION])
    449506        AC_REQUIRE([OD_CHECK_FRAMEWORK_IOKIT])
     507        AC_REQUIRE([OD_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER])
    450508       
    451509    AC_MSG_CHECKING(for whether we will build daemondo)
     
    455513                if test "x$od_cv_have_framework_corefoundation" == "xyes" &&
    456514                   test "x$od_cv_have_framework_systemconfiguration" == "xyes" &&
    457                    test "x$od_cv_have_framework_iokit" == "xyes"; then
     515                   test "x$od_cv_have_framework_iokit" == "xyes" &&
     516                   test "x$od_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
    458517                        result=yes
    459518                        EXTRA_PROGS="$EXTRA_PROGS daemondo"
Note: See TracChangeset for help on using the changeset viewer.