]> granicus.if.org Git - libevent/commitdiff
build: fix autotools build under mingw
authorAzat Khuzhin <azat@libevent.org>
Sun, 28 Mar 2021 06:01:58 +0000 (09:01 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sun, 28 Mar 2021 08:51:29 +0000 (11:51 +0300)
autotools that is shipped with mingw (autoconf 2.71-1, automake
1.6-1.16, automake wrapper 11-1), does not allow trailing backslashes
for AC_CHECK_HEADERS() and AC_CHECK_FUNCS(), otherwise it generates
incorrect for loop, and reports:

    ../configure: line 14724: syntax error near unexpected token `as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`'
    ../configure: line 14724: `  as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`'
    Error: Process completed with exit code 1.

Here is a simple analog:

    for VAR in <CR> foo \ <CR> bar \
    do :
        echo $VAR
    done

Trailing slash is not allowed.

Refs:
- https://github.com/libevent/libevent/runs/2171607687
- https://github.com/libevent/libevent/runs/2211365885?check_suite_focus=true

configure.ac

index 305a9d21540e5723ca5efea35a56befb6617f8ee..1f1e8146e140313d0b5f0862ecd48dc71bf148fa 100644 (file)
@@ -219,7 +219,7 @@ AC_CHECK_HEADERS([ \
   sys/wait.h \
   sys/random.h \
   errno.h \
-  afunix.h \
+  afunix.h
 ])
 
 case "${host_os}" in
@@ -359,7 +359,7 @@ AC_CHECK_FUNCS([ \
   umask \
   unsetenv \
   usleep \
-  getrandom \
+  getrandom
 ])
 
 AS_IF([test x$bwin32 = xtrue],