diff --git a/configure b/configure index 25a021368..30c6bc19e 100755 --- a/configure +++ b/configure @@ -12940,22 +12940,7 @@ esac fi - for ac_header in dispatch.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dispatch.h" "ac_cv_header_dispatch_h" "$ac_includes_default" -if test "x$ac_cv_header_dispatch_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DISPATCH_H 1 -_ACEOF - have_dispatch=yes -else - have_dispatch=no -fi - -done - - if test "$have_dispatch" = "no"; then - for ac_header in dispatch/dispatch.h + for ac_header in dispatch/dispatch.h do : ac_fn_c_check_header_mongrel "$LINENO" "dispatch/dispatch.h" "ac_cv_header_dispatch_dispatch_h" "$ac_includes_default" if test "x$ac_cv_header_dispatch_dispatch_h" = xyes; then : @@ -12969,6 +12954,7 @@ fi done + if test "$have_dispatch" = "yes"; then # check for private header which includes runloop integration functions in # the Swift corelibs libdispatch release for ac_header in dispatch/private.h @@ -12981,6 +12967,21 @@ _ACEOF fi +done + + else + for ac_header in dispatch.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dispatch.h" "ac_cv_header_dispatch_h" "$ac_includes_default" +if test "x$ac_cv_header_dispatch_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DISPATCH_H 1 +_ACEOF + have_dispatch=yes +else + have_dispatch=no +fi + done fi diff --git a/configure.ac b/configure.ac index 6dd78ce76..9f9bc5ef6 100644 --- a/configure.ac +++ b/configure.ac @@ -3392,12 +3392,13 @@ if test $enable_libdispatch = yes; then GS_ADD_LIBRARY_PATH([${dispatch_libdir}]) fi - AC_CHECK_HEADERS(dispatch.h, have_dispatch=yes, have_dispatch=no) - if test "$have_dispatch" = "no"; then - AC_CHECK_HEADERS(dispatch/dispatch.h, have_dispatch=yes, have_dispatch=no) + AC_CHECK_HEADERS(dispatch/dispatch.h, have_dispatch=yes, have_dispatch=no) + if test "$have_dispatch" = "yes"; then # check for private header which includes runloop integration functions in # the Swift corelibs libdispatch release AC_CHECK_HEADERS(dispatch/private.h) + else + AC_CHECK_HEADERS(dispatch.h, have_dispatch=yes, have_dispatch=no) fi if test "$have_dispatch" = "yes"; then AC_CHECK_LIB(dispatch, dispatch_queue_create, have_dispatch=yes, have_dispatch=no)