Skip to content

Commit b81ef63

Browse files
committed
Fix AC_REQUIRES breakage in LLVM autoconf tests.
Any Autoconf macro that uses AC_REQUIRES -- directly or indirectly -- must not be inside a plain shell "if" test; if it is, whatever code gets pulled in by the AC_REQUIRES will also be inside that "if". Instead of "if" we can use AS_IF, which knows how to get this right (cf commit 01051a9). The only immediate problem from getting this wrong was that AC_PROG_AWK had to be run twice, once inside the "if llvm" block and once in the main line. However, it broke a different patch I'm about to submit more thoroughly.
1 parent bf070ce commit b81ef63

File tree

2 files changed

+4
-48
lines changed

2 files changed

+4
-48
lines changed

configure

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,8 +4765,7 @@ fi
47654765

47664766

47674767

4768-
if test "$with_llvm" = yes ; then
4769-
for ac_prog in gawk mawk nawk awk
4768+
for ac_prog in gawk mawk nawk awk
47704769
do
47714770
# Extract the first word of "$ac_prog", so it can be a program name with args.
47724771
set dummy $ac_prog; ac_word=$2
@@ -4808,6 +4807,7 @@ fi
48084807
test -n "$AWK" && break
48094808
done
48104809

4810+
if test "$with_llvm" = yes; then :
48114811

48124812

48134813

@@ -9175,48 +9175,6 @@ else
91759175
$as_echo "no, using $LN_S" >&6; }
91769176
fi
91779177

9178-
for ac_prog in gawk mawk nawk awk
9179-
do
9180-
# Extract the first word of "$ac_prog", so it can be a program name with args.
9181-
set dummy $ac_prog; ac_word=$2
9182-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9183-
$as_echo_n "checking for $ac_word... " >&6; }
9184-
if ${ac_cv_prog_AWK+:} false; then :
9185-
$as_echo_n "(cached) " >&6
9186-
else
9187-
if test -n "$AWK"; then
9188-
ac_cv_prog_AWK="$AWK" # Let the user override the test.
9189-
else
9190-
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9191-
for as_dir in $PATH
9192-
do
9193-
IFS=$as_save_IFS
9194-
test -z "$as_dir" && as_dir=.
9195-
for ac_exec_ext in '' $ac_executable_extensions; do
9196-
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9197-
ac_cv_prog_AWK="$ac_prog"
9198-
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9199-
break 2
9200-
fi
9201-
done
9202-
done
9203-
IFS=$as_save_IFS
9204-
9205-
fi
9206-
fi
9207-
AWK=$ac_cv_prog_AWK
9208-
if test -n "$AWK"; then
9209-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
9210-
$as_echo "$AWK" >&6; }
9211-
else
9212-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9213-
$as_echo "no" >&6; }
9214-
fi
9215-
9216-
9217-
test -n "$AWK" && break
9218-
done
9219-
92209178
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
92219179
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
92229180
if test -z "$MKDIR_P"; then

configure.in

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,8 @@ AC_SUBST(SUN_STUDIO_CC)
383383
PGAC_ARG_BOOL(with, llvm, no, [build with LLVM based JIT support],
384384
[AC_DEFINE([USE_LLVM], 1, [Define to 1 to build with LLVM based JIT support. (--with-llvm)])])
385385
AC_SUBST(with_llvm)
386-
if test "$with_llvm" = yes ; then
387-
PGAC_LLVM_SUPPORT()
388-
fi
386+
dnl must use AS_IF here, else AC_REQUIRES inside PGAC_LLVM_SUPPORT malfunctions
387+
AS_IF([test "$with_llvm" = yes], [PGAC_LLVM_SUPPORT()])
389388

390389

391390
unset CFLAGS
@@ -1009,7 +1008,6 @@ AC_SUBST(install_bin)
10091008

10101009
PGAC_PATH_PROGS(TAR, tar)
10111010
AC_PROG_LN_S
1012-
AC_PROG_AWK
10131011
AC_PROG_MKDIR_P
10141012
# When Autoconf chooses install-sh as mkdir -p program it tries to generate
10151013
# a relative path to it in each makefile where it substitutes it. This clashes

0 commit comments

Comments
 (0)