Skip to content

Commit fcc88da

Browse files
Sergei Trofimovichnobu
authored andcommitted
configure.ac: fix for upcoming autoconf-2.70
The failure initially noticed on `autoconf-2.69d` (soon to become 2.70): ``` $ ./configure ./configure: line 8720: syntax error near unexpected token `fi' ./configure: line 8720: `fi' ``` Before the change generated `./configure ` snippet looked like: ``` if ! $CC -E -xc - <<SRC >/dev/null then : #if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 #error premature clang #endif SRC as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5 fi ``` Note the newline that breaks here-document syntax. After the change the snippet does not use here-document. Signed-off-by: Sergei Trofimovich <[email protected]>
1 parent ef19fb1 commit fcc88da

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

configure.ac

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,14 @@ AS_CASE(["$host_os:$build_os"],
271271
# clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported)
272272
# Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn)
273273
# Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
274-
AS_IF([! $CC -E -xc - <<SRC >/dev/null], [
275-
@%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
276-
@%:@error premature clang
277-
@%:@endif
278-
SRC
279-
AC_MSG_ERROR([clang version 3.0 or later is required])
280-
])
274+
AC_PREPROC_IFELSE(
275+
[AC_LANG_PROGRAM([
276+
@%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
277+
@%:@error premature clang
278+
@%:@endif
279+
])],
280+
[],
281+
[AC_MSG_ERROR([clang version 3.0 or later is required])])
281282
])
282283

283284
AS_CASE(["$target_os"],

0 commit comments

Comments
 (0)