Changeset 10524


Ignore:
Timestamp:
Jan 21, 2005, 6:50:48 AM (16 years ago)
Author:
landonf (Landon Fuller)
Message:

Add autoconf check for CoreFoundation

Location:
trunk/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Mk/dports.autoconf.mk.in

    r9814 r10524  
    2121
    2222LIBS                    = @LIBS@
     23CFOUNDATION_LIBS        = @CFOUNDATION_LIBS@
    2324MD5_LIBS                = @MD5_LIBS@
    2425INSTALL                 = @INSTALL@
  • trunk/base/aclocal.m4

    r9841 r10524  
    11builtin(include,tcl.m4)
     2
     3#------------------------------------------------------------------------
     4# OD_COREFOUNDATION --
     5#
     6#       Check if CoreFoundation is available, and if so, use it.
     7#
     8# Arguments:
     9#       None.
     10#
     11# Requires:
     12#       None.
     13#
     14# Depends:
     15#       AC_PROG_CC
     16#
     17# Results:
     18#
     19#       Result is cached.
     20#
     21#       If CoreFoundation is available, defines the following variables:
     22#               CFOUNDATION_ENABLED
     23#       Substitutes the following vars:
     24#               CFOUNDATION_LIBS
     25#
     26#------------------------------------------------------------------------
     27
     28dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS
     29dnl
     30
     31AC_DEFUN(OD_COREFOUNDATION, [
     32        CFOUNDATION_LIBS="-framework CoreFoundation"
     33
     34        AC_MSG_CHECKING([for CoreFoundation])
     35
     36        AC_CACHE_VAL(od_cv_cfoundation, [
     37
     38                ac_save_LIBS="$LIBS"
     39
     40                LIBS="$CFOUNDATION_LIBS $LIBS"
     41               
     42                AC_LINK_IFELSE([
     43                        AC_LANG_PROGRAM([
     44                                        #include <CoreFoundation/CoreFoundation.h>
     45                                ], [
     46                                        CFURLRef url = CFURLCreateWithFileSystemPath(NULL, CFSTR("/testing"), kCFURLPOSIXPathStyle, 1);
     47                                        CFArrayRef bundles = CFBundleCreateBundlesFromDirectory(NULL, url, CFSTR("pkg"));
     48                        ])
     49                        ], [
     50                                od_cv_cfoundation="yes"
     51                        ], [
     52                                od_cv_cfoundation="no"
     53                        ]
     54                )
     55
     56                LIBS="$ac_save_LIBS"
     57
     58        ])
     59
     60        AC_MSG_RESULT(${od_cv_cfoundation})
     61
     62        if test x"${od_cv_cfoundation}" = "xyes"; then
     63                AC_DEFINE([CFOUNDATION_ENABLE], [], [Define if the CoreFoundation is available and to be used])
     64        else
     65                CHECK_DIRS=""
     66        fi
     67                       
     68
     69        AC_SUBST(CFOUNDATION_LIBS)
     70])
    271
    372dnl This macro checks if the user specified a dports tree
  • trunk/base/configure

    r9841 r10524  
    313313#endif"
    314314
    315 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE LN_S CURL CVS CFLAGS_QUICHEEATERS MTREE subdirs REPLACEMENT_PROGS DPORTSDIR PORTCONFIGDIR DSTUSR DSTGRP DSTMODE CPP EGREP MD5_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDES TCLSH TCL_PACKAGE_DIR INCLUDES CFLAGS_DEBUG CFLAGS_OPTIMIZE TCL_DEFS STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LDFLAGS SHLIB_SUFFIX TCL_CC prefix_expanded PORTCONFIGDIR_EXPANDED localstatedir_expanded LIBOBJS LTLIBOBJS'
     315ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE LN_S CURL CVS CFLAGS_QUICHEEATERS MTREE subdirs REPLACEMENT_PROGS DPORTSDIR PORTCONFIGDIR DSTUSR DSTGRP DSTMODE CPP EGREP CFOUNDATION_LIBS MD5_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDES TCLSH TCL_PACKAGE_DIR INCLUDES CFLAGS_DEBUG CFLAGS_OPTIMIZE TCL_DEFS STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LDFLAGS SHLIB_SUFFIX TCL_CC prefix_expanded PORTCONFIGDIR_EXPANDED localstatedir_expanded LIBOBJS LTLIBOBJS'
    316316ac_subst_files=''
    317317
     
    47104710fi
    47114711done
     4712
     4713
     4714# Check for CoreFoundation
     4715
     4716        CFOUNDATION_LIBS="-framework CoreFoundation"
     4717
     4718        echo "$as_me:$LINENO: checking for CoreFoundation" >&5
     4719echo $ECHO_N "checking for CoreFoundation... $ECHO_C" >&6
     4720
     4721        if test "${od_cv_cfoundation+set}" = set; then
     4722  echo $ECHO_N "(cached) $ECHO_C" >&6
     4723else
     4724
     4725
     4726                ac_save_LIBS="$LIBS"
     4727
     4728                LIBS="$CFOUNDATION_LIBS $LIBS"
     4729
     4730                cat >conftest.$ac_ext <<_ACEOF
     4731
     4732                        #line $LINENO "configure"
     4733/* confdefs.h.  */
     4734_ACEOF
     4735cat confdefs.h >>conftest.$ac_ext
     4736cat >>conftest.$ac_ext <<_ACEOF
     4737/* end confdefs.h.  */
     4738
     4739                                        #include <CoreFoundation/CoreFoundation.h>
     4740
     4741int
     4742main ()
     4743{
     4744
     4745                                        CFURLRef url = CFURLCreateWithFileSystemPath(NULL, CFSTR("/testing"), kCFURLPOSIXPathStyle, 1);
     4746                                        CFArrayRef bundles = CFBundleCreateBundlesFromDirectory(NULL, url, CFSTR("pkg"));
     4747
     4748  ;
     4749  return 0;
     4750}
     4751
     4752_ACEOF
     4753rm -f conftest.$ac_objext conftest$ac_exeext
     4754if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4755  (eval $ac_link) 2>&5
     4756  ac_status=$?
     4757  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4758  (exit $ac_status); } &&
     4759         { ac_try='test -s conftest$ac_exeext'
     4760  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4761  (eval $ac_try) 2>&5
     4762  ac_status=$?
     4763  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4764  (exit $ac_status); }; }; then
     4765
     4766                                od_cv_cfoundation="yes"
     4767
     4768else
     4769  echo "$as_me: failed program was:" >&5
     4770sed 's/^/| /' conftest.$ac_ext >&5
     4771
     4772
     4773                                od_cv_cfoundation="no"
     4774
     4775
     4776fi
     4777rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
     4778
     4779                LIBS="$ac_save_LIBS"
     4780
     4781
     4782fi
     4783
     4784
     4785        echo "$as_me:$LINENO: result: ${od_cv_cfoundation}" >&5
     4786echo "${ECHO_T}${od_cv_cfoundation}" >&6
     4787
     4788        if test x"${od_cv_cfoundation}" = "xyes"; then
     4789
     4790cat >>confdefs.h <<\_ACEOF
     4791#define CFOUNDATION_ENABLE
     4792_ACEOF
     4793
     4794        else
     4795                CHECK_DIRS=""
     4796        fi
     4797
     4798
     4799
    47124800
    47134801
     
    76567744s,@CPP@,$CPP,;t t
    76577745s,@EGREP@,$EGREP,;t t
     7746s,@CFOUNDATION_LIBS@,$CFOUNDATION_LIBS,;t t
    76587747s,@MD5_LIBS@,$MD5_LIBS,;t t
    76597748s,@X_CFLAGS@,$X_CFLAGS,;t t
  • trunk/base/configure.ac

    r9841 r10524  
    5656AC_FUNC_STRERROR_R
    5757AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp])
     58
     59# Check for CoreFoundation
     60OD_COREFOUNDATION
    5861
    5962# Check for md5 implementation
Note: See TracChangeset for help on using the changeset viewer.