Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -235,13 +235,13 @@ ]) ]) AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCFLAGS="$OBJCFLAGS -pipe"]) AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCFLAGS="$OBJCFLAGS -fno-common"]) -AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings, [ - OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings" - AC_SUBST(NO_CONST_CFSTRINGS, "-fno-constant-cfstrings") +AX_CHECK_COMPILER_FLAGS(-Xclang -fno-constant-cfstrings, [ + OBJCFLAGS="$OBJCFLAGS -Xclang -fno-constant-cfstrings" + AC_SUBST(NO_CONST_CFSTRINGS, "-Xclang -fno-constant-cfstrings") ]) AX_CHECK_COMPILER_FLAGS([-Wsign-compare -Werror], [OBJCFLAGS="$OBJCFLAGS -Wsign-compare"]) AS_IF([test x"$with_nds" != x"yes"], [ AX_CHECK_COMPILER_FLAGS([-Wshadow -Werror], @@ -416,11 +416,11 @@ [Whether we use the ObjFW runtime]) AC_MSG_CHECKING([whether -fobjc-runtime=objfw is supported]) old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -fobjc-runtime=objfw" + OBJCFLAGS="$OBJCFLAGS -Xclang -fobjc-runtime=objfw" AC_TRY_LINK([ #ifdef __has_attribute # if __has_attribute(objc_root_class) __attribute__((__objc_root_class__)) # endif @@ -446,11 +446,11 @@ { } ], [ [Test test]; ], [ - RUNTIME_FLAGS="-fobjc-runtime=objfw" + RUNTIME_FLAGS="-Xclang -fobjc-runtime=objfw" AC_MSG_RESULT(yes) ], [ RUNTIME_FLAGS="-fgnu-runtime" OBJCFLAGS="$old_OBJCFLAGS -fgnu-runtime" AC_MSG_RESULT(no) @@ -900,12 +900,13 @@ AC_MSG_RESULT(WinAPI) ;; *) AC_MSG_RESULT(POSIX) - AX_CHECK_COMPILER_FLAGS(-pthread, [ - CPPFLAGS="$CPPFLAGS -pthread" + dnl Use -Wp, as we only use it for the preprocessor. + AX_CHECK_COMPILER_FLAGS(-Wp,-pthread, [ + CPPFLAGS="$CPPFLAGS -Wp,-pthread" ], [ CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_THREAD_SAFE" ]) AC_CHECK_LIB(pthread, pthread_create, LIBS="$LIBS -lpthread") @@ -1479,16 +1480,16 @@ dnl This needs to be after all other header checks, as they include unistd.h, dnl which in old glibc versions uses __block. This is worked around in the code dnl by providing a wrapper for unistd.h which takes care of this. AC_MSG_CHECKING(whether Objective C compiler supports blocks) old_OBJCFLAGS="$OBJCFLAGS" -OBJCFLAGS="$OBJCFLAGS -fblocks" +OBJCFLAGS="$OBJCFLAGS -Xclang -fblocks" AC_TRY_COMPILE([], [ int (^foo)(int bar); foo = ^ (int bar) { return 0; } ], [ - AC_SUBST(BLOCKS_FLAGS, "-fblocks") + AC_SUBST(BLOCKS_FLAGS, "-Xclang -fblocks") AC_SUBST(OFBLOCKTESTS_M, "OFBlockTests.m") AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS"