From 4d27b307995881d94219a19f465cda8e435cff0f Mon Sep 17 00:00:00 2001 From: Zac Bentley Date: Fri, 11 Mar 2016 17:14:52 -0500 Subject: [PATCH] Issue 94494; exclude deprecated options from launchd plist on new OSX versions --- bus/org.freedesktop.dbus-session.plist.in | 9 +- configure.ac | 264 ++++++++++++++++-------------- 2 files changed, 146 insertions(+), 127 deletions(-) mode change 100644 => 100755 configure.ac diff --git a/bus/org.freedesktop.dbus-session.plist.in b/bus/org.freedesktop.dbus-session.plist.in index 40ff370..3501440 100644 --- a/bus/org.freedesktop.dbus-session.plist.in +++ b/bus/org.freedesktop.dbus-session.plist.in @@ -5,14 +5,7 @@ Label org.freedesktop.dbus-session - ServiceIPC - - - - + @DBUS_PLIST_SUBST@ ProgramArguments diff --git a/configure.ac b/configure.ac old mode 100644 new mode 100755 index 1d08030..4a29332 --- a/configure.ac +++ b/configure.ac @@ -74,6 +74,7 @@ AC_PROG_MKDIR_P COMPILER_COVERAGE COMPILER_OPTIMISATIONS PKG_PROG_PKG_CONFIG +AC_PROG_SED # TAP test driver support AC_PROG_AWK @@ -444,19 +445,19 @@ AC_SUBST(DBUS_INT16_TYPE) ## byte order case $host_os in - darwin*) - # check at compile-time, so that it is possible to build universal - # (with multiple architectures at once on the compile line) - AH_VERBATIM([WORDS_BIGENDIAN_DARWIN], [ - /* Use the compiler-provided endianness defines to allow universal compiling. */ - #if defined(__BIG_ENDIAN__) - #define WORDS_BIGENDIAN 1 - #endif - ]) - ;; - *) - AC_C_BIGENDIAN - ;; + darwin*) + # check at compile-time, so that it is possible to build universal + # (with multiple architectures at once on the compile line) + AH_VERBATIM([WORDS_BIGENDIAN_DARWIN], [ + /* Use the compiler-provided endianness defines to allow universal compiling. */ + #if defined(__BIG_ENDIAN__) + #define WORDS_BIGENDIAN 1 + #endif + ]) + ;; + *) + AC_C_BIGENDIAN + ;; esac dnl ********************************** @@ -465,40 +466,40 @@ dnl ********************************** dnl we currently check for all three va_copy possibilities, so we get dnl all results in config.log for bug reports. AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[ - AC_LINK_IFELSE([AC_LANG_SOURCE([#include + AC_LINK_IFELSE([AC_LANG_SOURCE([#include #include - static void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - va_copy (args2, args1); - if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) - exit (1); - va_end (args1); va_end (args2); - } - int main() { - f (0, 42); - return 0; - }])], - [dbus_cv_va_copy=yes], - [dbus_cv_va_copy=no]) + static void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + va_copy (args2, args1); + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + }])], + [dbus_cv_va_copy=yes], + [dbus_cv_va_copy=no]) ]) AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[ - AC_LINK_IFELSE([AC_LANG_SOURCE([#include + AC_LINK_IFELSE([AC_LANG_SOURCE([#include #include - static void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - __va_copy (args2, args1); - if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) - exit (1); - va_end (args1); va_end (args2); - } - int main() { - f (0, 42); - return 0; - }])], - [dbus_cv___va_copy=yes], - [dbus_cv___va_copy=no]) + static void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + __va_copy (args2, args1); + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + }])], + [dbus_cv___va_copy=yes], + [dbus_cv___va_copy=no]) ]) if test "x$dbus_cv_va_copy" = "xyes"; then @@ -514,29 +515,29 @@ fi AC_LANG_PUSH(C) AC_CACHE_CHECK([whether va_lists can be copied by value], - dbus_cv_va_val_copy, - [AC_RUN_IFELSE([AC_LANG_PROGRAM( + dbus_cv_va_val_copy, + [AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ - #include - #include + #include + #include ]], [[ - static void f (int i, ...) { - va_list args1, args2; - va_start (args1, i); - args2 = args1; - if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) - exit (1); - va_end (args1); va_end (args2); - } - int main() { - f (0, 42); - return 0; - } + static void f (int i, ...) { + va_list args1, args2; + va_start (args1, i); + args2 = args1; + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); va_end (args2); + } + int main() { + f (0, 42); + return 0; + } ]])], - [dbus_cv_va_val_copy=yes], - [dbus_cv_va_val_copy=no], - [dbus_cv_va_val_copy=yes]) + [dbus_cv_va_val_copy=yes], + [dbus_cv_va_val_copy=no], + [dbus_cv_va_val_copy=yes]) ]) AC_LANG_POP(C) @@ -620,13 +621,13 @@ closedir(dirp); [dbus_have_dirfd=no]) AC_MSG_RESULT($dbus_have_dirfd) if test "$dbus_have_dirfd" = yes; then - AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function]) + AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function]) else - AC_MSG_CHECKING(for DIR *dirp->dd_fd) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + AC_MSG_CHECKING(for DIR *dirp->dd_fd) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include - ]], [[ + ]], [[ DIR *dirp; int fd; dirp = opendir("."); @@ -635,10 +636,10 @@ closedir(dirp); ]])], [dbus_have_ddfd=yes], [dbus_have_ddfd=no]) - AC_MSG_RESULT($dbus_have_ddfd) - if test "$dbus_have_ddfd" = yes; then - AC_DEFINE(HAVE_DDFD,1,[Have the ddfd member of DIR]) - fi + AC_MSG_RESULT($dbus_have_ddfd) + if test "$dbus_have_ddfd" = yes; then + AC_DEFINE(HAVE_DDFD,1,[Have the ddfd member of DIR]) + fi fi AC_CHECK_HEADERS(sys/resource.h) @@ -646,9 +647,9 @@ AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(dirent.h) AC_CHECK_HEADERS([execinfo.h], - [AC_SEARCH_LIBS([backtrace], [execinfo], - [AC_DEFINE([HAVE_BACKTRACE], [1], - [Define to 1 if you have backtrace().])])]) + [AC_SEARCH_LIBS([backtrace], [execinfo], + [AC_DEFINE([HAVE_BACKTRACE], [1], + [Define to 1 if you have backtrace().])])]) AC_CHECK_HEADERS(errno.h) @@ -678,8 +679,8 @@ esac # this behavior if desired AC_LANG_PUSH(C) AC_CACHE_CHECK([for posix getpwnam_r], - ac_cv_func_posix_getpwnam_r, - [AC_RUN_IFELSE([AC_LANG_PROGRAM( + ac_cv_func_posix_getpwnam_r, + [AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include #include @@ -692,10 +693,10 @@ AC_CACHE_CHECK([for posix getpwnam_r], error = getpwnam_r ("", &pwd, buffer, sizeof (buffer), &pwptr); return (error < 0 && errno == ENOSYS) - || error == ENOSYS; + || error == ENOSYS; ]])], - [ac_cv_func_posix_getpwnam_r=yes], - [ac_cv_func_posix_getpwnam_r=no], + [ac_cv_func_posix_getpwnam_r=yes], + [ac_cv_func_posix_getpwnam_r=no], [ac_cv_func_posix_getpwnam_r=yes] )]) AC_LANG_POP(C) @@ -809,8 +810,8 @@ if test x$enable_abstract_sockets = xauto; then AC_LANG_PUSH(C) warn_on_xcompile=no AC_CACHE_CHECK([abstract socket namespace], - ac_cv_have_abstract_sockets, - [AC_RUN_IFELSE([AC_LANG_PROGRAM( + ac_cv_have_abstract_sockets, + [AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include #include @@ -866,7 +867,7 @@ fi if test x$enable_abstract_sockets = xyes; then if test x$ac_cv_have_abstract_sockets = xno; then - AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.]) + AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.]) fi fi @@ -956,10 +957,10 @@ clock_getres (CLOCK_MONOTONIC,&monotonic_timer); [have_clock_monotonic=true], [have_clock_monotonic=false]) AS_IF([test x$have_clock_monotonic = xtrue], - [ + [ AC_MSG_RESULT([found]) AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC]) - ], + ], [AC_MSG_RESULT([not found])]) ]) dnl have pthread_condattr_setclock ]) dnl on Unix @@ -981,12 +982,12 @@ else AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#ifdef DBUS__ACQUIRE_SVC return 0; - #else - #error DBUS__ACQUIRE_SVC not defined - #endif]])], + #else + #error DBUS__ACQUIRE_SVC not defined + #endif]])], [have_selinux=yes], [have_selinux=no]) - AC_MSG_RESULT($have_selinux) + AC_MSG_RESULT($have_selinux) fi if test x$enable_selinux = xauto ; then @@ -1410,7 +1411,7 @@ fi if test x$enable_doxygen_docs = xyes; then if test x$have_doxygen = xno; then - AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found]) + AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found]) fi fi @@ -1472,7 +1473,7 @@ fi if test x$enable_xml_docs = xyes; then if test x$have_xmlto = xno; then - AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found]) + AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found]) fi fi @@ -1497,27 +1498,52 @@ AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir") AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir") #### Check our operating system -operating_system=unknown -if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then - operating_system=redhat -fi -if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then - operating_system=slackware -fi -if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then - operating_system=cygwin -fi +OS_FAMILY=$host_os +OS_TYPE=unknown +OS_VERSION=unknown +case $OS_FAMILY in + darwin*) + # The sw_vers utility on OSX can be used to get release information: + AC_PATH_PROG([SW_VERS], [sw_vers]) + if test -n $sw_vers ; then + OS_TYPE=$($SW_VERS | $SED -n 's/^ProductName:[[:space:]]*//p') + OS_VERSION=$($SW_VERS | $SED -n 's/^ProductVersion:[[:space:]]*//p') + fi + AS_VERSION_COMPARE($OS_VERSION,"10.11.0",[DBUS_PLIST_SUBST="ServiceIPCOnDemand"]) + ;; + linux*) + if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then + OS_TYPE=redhat + elif test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then + OS_TYPE=slackware + fi + # os-release is an attempt at canonicalization. See: https://www.freedesktop.org/software/systemd/man/os-release.html + if test -f /etc/os-release ; then + OS_VERSION=$($SED -n 's/^VERSION_ID="\(.*\)"[[:space:]]*$/\1/p' /etc/os-release) + elif test -f /usr/lib/os-release ; then + OS_VERSION=$($SED -n 's/^VERSION_ID="\(.*\)"[[:space:]]*$/\1/p' /usr/lib/os-release) + elif test -f $EXPANDED_SYSCONFDIR/os-release ; then + OS_VERSION=$($SED -n 's/^VERSION_ID="\(.*\)"[[:space:]]*$/\1/p' $EXPANDED_SYSCONFDIR/os-release) + fi + ;; + *) + if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then + OS_TYPE=cygwin + fi + ;; +esac -#### Sort out init scripts +AC_SUBST(DBUS_PLIST_SUBST) +#### Sort out init scripts if test x$with_init_scripts = x; then - case x$operating_system in - xredhat) with_init_scripts=redhat ;; - xslackware) with_init_scripts=slackware ;; - xcygwin) with_init_scripts=cygwin ;; - *) with_init_scripts=none ;; + case x$OS_TYPE in + xredhat) with_init_scripts=redhat ;; + xslackware) with_init_scripts=slackware ;; + xcygwin) with_init_scripts=cygwin ;; + *) with_init_scripts=none ;; esac fi @@ -1679,7 +1705,7 @@ AC_SUBST([DATADIR_FROM_PKGSYSCONFDIR]) DBUS_PWD=`pwd` # Useful in a cross-compilation environment, where the tests are run on the host system. AC_ARG_WITH(dbus-test-dir, AS_HELP_STRING([--with-dbus-test-dir=[dirname]],[path where the tests tools are available]), - DBUS_PWD=$withval) + DBUS_PWD=$withval) DBUS_TEST_EXEC="$DBUS_PWD/test" DBUS_TEST_DATA="$DBUS_PWD/test/data" @@ -1868,22 +1894,22 @@ echo " D-Bus $VERSION ============== - prefix: ${EXPANDED_PREFIX} - exec_prefix: ${exec_prefix} + prefix: ${EXPANDED_PREFIX} + exec_prefix: ${exec_prefix} libdir: ${EXPANDED_LIBDIR} libexecdir: ${EXPANDED_LIBEXECDIR} bindir: ${EXPANDED_BINDIR} sysconfdir: ${EXPANDED_SYSCONFDIR} localstatedir: ${EXPANDED_LOCALSTATEDIR} - datadir: ${EXPANDED_DATADIR} - source code location: ${srcdir} - compiler: ${CC} - cflags: ${CFLAGS} - cppflags: ${CPPFLAGS} - cxxflags: ${CXXFLAGS} - 64-bit int: ${DBUS_INT64_TYPE} - 32-bit int: ${DBUS_INT32_TYPE} - 16-bit int: ${DBUS_INT16_TYPE} + datadir: ${EXPANDED_DATADIR} + source code location: ${srcdir} + compiler: ${CC} + cflags: ${CFLAGS} + cppflags: ${CPPFLAGS} + cxxflags: ${CXXFLAGS} + 64-bit int: ${DBUS_INT64_TYPE} + 32-bit int: ${DBUS_INT32_TYPE} + 16-bit int: ${DBUS_INT16_TYPE} Doxygen: ${DOXYGEN:-not found} xmlto: ${XMLTO:-not found} ducktype: ${DUCKTYPE:-not found} @@ -1920,8 +1946,8 @@ echo " Console auth dir: ${DBUS_CONSOLE_AUTH_DIR} Console owner file: ${have_console_owner_file} Console owner file path: ${DBUS_CONSOLE_OWNER_FILE} - System bus user: ${DBUS_USER} - Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services + System bus user: ${DBUS_USER} + Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services 'make check' socket dir: ${TEST_SOCKET_DIR} " if test x$have_launchd = xyes; then -- 2.5.4 (Apple Git-61)