]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
tidy m4 plugin config support
authorAlan Modra <amodra@gmail.com>
Mon, 3 Nov 2025 00:29:50 +0000 (10:59 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 3 Nov 2025 00:29:50 +0000 (10:59 +1030)
In CLANG_PLUGIN_FILE it is possible for plugin_file to be non-NULL
when LLVMgold.so does not exist.

configure output is messy, with results not printed against their
  "checking.." line, eg.
checking for clang... (cached) yes
checking for clang plugin file... checking for x86_64-pc-linux-gnu-ar... (cached) ar --plugin /usr/lib/llvm-20/lib/clang/20/../../LLVMgold.so
/usr/lib/llvm-20/lib/clang/20/../../LLVMgold.so

This patch fixes those problems, and a similar interposition of other
configure output between AC_MSG_CHECKING and AC_MSG_RESULT in
gcc-plugin.m4.  It also tidies some of the message text, and makes
similar code in gcc-plugin.m4 and clang-plugin.m4 a little more
consistent.

config/
* clang-plugin.m4 (CLANG_PLUGIN_FILE): Don't place checks for
tools (llvm-config, ar) inside AC_MSG_CHECKING..AC_MSG_RESULT
for clang plugin file.  Clear plugin_file before loop exit.
(CLANG_PLUGIN_FILE_FOR_TARGET): Similarly.
* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Similarly.
(GCC_PLUGIN_OPTION_FOR_TARGET): Correct AC_MSG_CHECKING.  Tidy
return code.
binutils/
* testsuite/lib/binutils-common.exp <llvm_plug_opt>: Set for
non-native.
* configure: Regenerate.
/
* configure: Regenerate.
bfd/
* configure: Regenerate.
gas/
* configure: Regenerate.
gdb/
* configure: Regenerate.
gprof/
* configure: Regenerate.
gprofng/
* configure: Regenerate.
* libcollector/configure: Regenerate.
ld/
* configure: Regenerate.
libbacktrace/
* configure: Regenerate.
libctf/
* configure: Regenerate.
libiberty/
* configure: Regenerate.
libsframe/
* configure: Regenerate.
opcodes/
* configure: Regenerate.
sim/
* configure: Regenerate.
zlib/
* configure: Regenerate.

19 files changed:
bfd/configure
binutils/configure
binutils/testsuite/lib/binutils-common.exp
config/clang-plugin.m4
config/gcc-plugin.m4
configure
gas/configure
gdb/configure
gprof/configure
gprofng/configure
gprofng/libcollector/configure
ld/configure
libbacktrace/configure
libctf/configure
libiberty/configure
libsframe/configure
opcodes/configure
sim/configure
zlib/configure

index d07f9e926e4d4685ca2266baaa223db5766b2376..d9d77b7004cde2b276d9a0bc0f9f4fd2bfd16b81 100755 (executable)
@@ -6230,15 +6230,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6330,22 +6322,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6437,42 +6438,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6564,25 +6549,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11528,7 +11527,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11531 "configure"
+#line 11530 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11634,7 +11633,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11637 "configure"
+#line 11636 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index b1c38b4a07689125fe15447dc72d6e85f568ecbc..214fddb0340fe2dc97be7cf75e9d44eac635be24 100755 (executable)
@@ -6127,15 +6127,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6227,22 +6219,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6334,42 +6335,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6461,25 +6446,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11456,7 +11455,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11459 "configure"
+#line 11458 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11562,7 +11561,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11565 "configure"
+#line 11564 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index fb12607303f1513b96accba203087436214dc489..edde241024aec051d3f017bd199de0578bcf52e6 100644 (file)
@@ -1824,21 +1824,20 @@ if { [isnative] } then {
            set CLANG_FOR_TARGET clang
        }
     }
-    if [info exists CLANG_FOR_TARGET] then {
-       set llvm_plug_so [string trim [exec $CLANG_FOR_TARGET -print-file-name=LLVMgold.so]]
-       if { $llvm_plug_so ne "LLVMgold.so" } then {
-           set llvm_plug_opt "--plugin $llvm_plug_so"
-       }
-
-       if { $llvm_plug_opt eq "" } then {
-           # If it is still blank, try llvm-config --libdir.  Clang
-           # searches CLANG_INSTALL_LIBDIR_BASENAME which corresponds
-           # to this.
-           catch "exec llvm-config --libdir" got
-           if {[file isdirectory $got] \
-               && [file isfile $got/LLVMgold.so]} then {
-               set llvm_plug_opt "--plugin $got/LLVMgold.so"
-           }
+}
+if [info exists CLANG_FOR_TARGET] then {
+    set llvm_plug_so [string trim [exec $CLANG_FOR_TARGET -print-file-name=LLVMgold.so]]
+    if { $llvm_plug_so ne "LLVMgold.so" } then {
+       set llvm_plug_opt "--plugin $llvm_plug_so"
+    }
+    if { $llvm_plug_opt eq "" && [isnative] } then {
+       # If it is still blank, try llvm-config --libdir.  Clang
+       # searches CLANG_INSTALL_LIBDIR_BASENAME which corresponds
+       # to this.
+       catch "exec llvm-config --libdir" got
+       if {[file isdirectory $got] \
+           && [file isfile $got/LLVMgold.so]} then {
+           set llvm_plug_opt "--plugin $got/LLVMgold.so"
        }
     }
 }
index cc051fe48e32bf05daa2666b989735d6d34a017c..e94c4bbb6be90f9eac660489a71f9824f9702589 100644 (file)
@@ -20,43 +20,42 @@ AC_DEFUN([CLANG_PLUGIN_FILE],[dnl
   yes
 #endif
     ], clang_cv_is_clang=yes, clang_cv_is_clang=no)])
+  AC_CHECK_TOOL(LLVM_CONFIG, llvm-config)
   plugin_file=
   if test $clang_cv_is_clang = yes; then
     AC_MSG_CHECKING([for clang plugin file])
     plugin_names="LLVMgold.so"
     for plugin in $plugin_names; do
       plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       AC_CHECK_TOOL(LLVM_CONFIG, llvm-config)
-       if test "$?" != 0; then
-         AC_MSG_ERROR([Required tool 'llvm-config' not found on PATH.])
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
-    done
-    if test -z $plugin_file; then
-      AC_MSG_ERROR([Couldn't find clang plugin file for $CC.])
-    fi
-    dnl Check if ${AR} $plugin_option rc works.
-    AC_CHECK_TOOL(AR, ar)
-    if test "${AR}" = "" ; then
-      AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      AC_MSG_WARN([Failed: $AR $plugin_option rc])
       plugin_file=
+    done
+    if test -z "$plugin_file"; then
+      AC_MSG_RESULT([no])
+    else
+      AC_MSG_RESULT($plugin_file)
+      dnl Check if ${AR} $plugin_option rc works.
+      AC_CHECK_TOOL(AR, ar)
+      if test -z "${AR}"; then
+       AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       AC_MSG_WARN([Failed: $AR $plugin_option rc])
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    AC_MSG_RESULT($plugin_file)
   fi
   $1="$plugin_file"
 ])
@@ -84,30 +83,26 @@ AC_DEFUN([CLANG_PLUGIN_FILE_FOR_TARGET],[dnl
   CC="$saved_CC"
   plugin_file=
   if test $clang_target_cv_working = yes; then
+    GCC_TARGET_TOOL(llvm-config, LLVM_CONFIG_FOR_TARGET, LLVM_CONFIG)
     AC_MSG_CHECKING([for clang plugin file for target])
     plugin_names="LLVMgold.so"
-    dnl Check if the host compiler is used.
     for plugin in $plugin_names; do
       plugin_file=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       GCC_TARGET_TOOL(llvm-config, LLVM_CONFIG_FOR_TARGET, LLVM_CONFIG)
-       if test "$?" != 0; then
-         AC_MSG_ERROR([Required target tool 'llvm-config' not found.])
-       fi
-       clang_lib_dir=`$LLVM_CONFIG_FOR_TARGET --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-      fi
-      if test x$plugin_file != x$plugin; then
+      if test "$plugin_file" != "$plugin"; then
        break;
       fi
+      if test -n "${LLVM_CONFIG_FOR_TARGET}"; then
+       plugin_file=`${LLVM_CONFIG_FOR_TARGET} --libdir`/$plugin
+       if test -f "$plugin_file"; then
+         break;
+       fi
+      fi
       plugin_file=
     done
-    if test -n $plugin_file; then
-      AC_MSG_RESULT($plugin_file)
-    else
+    if test -z "$plugin_file"; then
       AC_MSG_RESULT([no])
+    else
+      AC_MSG_RESULT($plugin_file)
     fi
   fi
   $1="$plugin_file"
index 0382147b3818aee17f9623a13f5dd75f13576458..fbccba4a4731862a577839210dcba11e3b42fe01 100644 (file)
@@ -136,8 +136,11 @@ dnl GCC_PLUGIN_OPTION
 dnl    (SHELL-CODE_HANDLER)
 dnl
 AC_DEFUN([GCC_PLUGIN_OPTION],[dnl
+AC_CHECK_TOOL(AR, ar)
+if test -z "${AR}"; then
+  AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
+fi
 AC_MSG_CHECKING([for -plugin option])
-
 plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
 plugin_option=
 for plugin in $plugin_names; do
@@ -150,24 +153,20 @@ for plugin in $plugin_names; do
     break
   fi
 done
-dnl Check if ${AR} $plugin_option rc works.
-AC_CHECK_TOOL(AR, ar)
-if test "${AR}" = "" ; then
-  AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
-fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  AC_MSG_WARN([Failed: $AR $plugin_option rc])
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  $1="$plugin_option"
-  AC_MSG_RESULT($plugin_option)
-else
+if test -z "$plugin_option"; then
   AC_MSG_RESULT([no])
+else
+  AC_MSG_RESULT($plugin_option)
+  dnl Check if ${AR} $plugin_option rc works.
+  touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    AC_MSG_WARN([Failed: $AR $plugin_option rc])
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+$1="$plugin_option"
 ])
 
 dnl
@@ -190,7 +189,7 @@ AC_CACHE_CHECK([for gcc for target], gcc_target_cv_working, [
   gcc_target_cv_working=yes,
   gcc_target_cv_working=no)])
 CC="$saved_CC"
-AC_MSG_CHECKING([for -plugin option])
+AC_MSG_CHECKING([for target -plugin option])
 plugin_option=
 if test $gcc_target_cv_working = yes; then
   plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
@@ -205,10 +204,10 @@ if test $gcc_target_cv_working = yes; then
     fi
   done
 fi
-if test -n "$plugin_option"; then
-  $1="$plugin_option"
-  AC_MSG_RESULT($plugin_option)
-else
+if test -z "$plugin_option"; then
   AC_MSG_RESULT([no])
+else
+  AC_MSG_RESULT($plugin_option)
 fi
+$1="$plugin_option"
 ])
index 54b71af5d3bedd6b448f87bd16a7597d28d35792..673c6728604e32b5d0d936237eca30e2471e00c2 100755 (executable)
--- a/configure
+++ b/configure
@@ -14560,15 +14560,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -14660,22 +14652,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -14767,42 +14768,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   PLUGIN_FILE="$plugin_file"
 
 if test -n "$PLUGIN_FILE"; then
   PLUGIN_OPTION="--plugin $PLUGIN_FILE"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -14894,25 +14879,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  PLUGIN_OPTION="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+PLUGIN_OPTION="$plugin_option"
 
 fi
 AR_PLUGIN_OPTION=
@@ -20637,13 +20636,7 @@ $as_echo "$clang_target_cv_working" >&6; }
   CC="$saved_CC"
   plugin_file=
   if test $clang_target_cv_working = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file for target" >&5
-$as_echo_n "checking for clang plugin file for target... " >&6; }
-    plugin_names="LLVMgold.so"
-        for plugin in $plugin_names; do
-      plugin_file=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target llvm-config" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target llvm-config" >&5
 $as_echo_n "checking where to find the target llvm-config... " >&6; }
 if test "x${build}" != "x${host}" ; then
   if expr "x$LLVM_CONFIG_FOR_TARGET" : "x/" > /dev/null; then
@@ -20674,25 +20667,28 @@ $as_echo "pre-installed" >&6; }
   fi
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required target tool 'llvm-config' not found." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG_FOR_TARGET --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-      fi
-      if test x$plugin_file != x$plugin; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file for target" >&5
+$as_echo_n "checking for clang plugin file for target... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
        break;
       fi
+      if test -n "${LLVM_CONFIG_FOR_TARGET}"; then
+       plugin_file=`${LLVM_CONFIG_FOR_TARGET} --libdir`/$plugin
+       if test -f "$plugin_file"; then
+         break;
+       fi
+      fi
       plugin_file=
     done
-    if test -n $plugin_file; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
-    else
+    if test -z "$plugin_file"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
     fi
   fi
   PLUGIN_FILE_FOR_TARGET="$plugin_file"
@@ -20733,8 +20729,8 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_target_cv_working" >&5
 $as_echo "$gcc_target_cv_working" >&6; }
 CC="$saved_CC"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target -plugin option" >&5
+$as_echo_n "checking for target -plugin option... " >&6; }
 plugin_option=
 if test $gcc_target_cv_working = yes; then
   plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
@@ -20749,14 +20745,14 @@ if test $gcc_target_cv_working = yes; then
     fi
   done
 fi
-if test -n "$plugin_option"; then
-  PLUGIN_OPTION_FOR_TARGET="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
 fi
+PLUGIN_OPTION_FOR_TARGET="$plugin_option"
 
 fi
 if test -n "$PLUGIN_OPTION_FOR_TARGET"; then
index f2cdd77b1fbcea6489800a9d111a527f1d56a01c..104fdb109ddad95834e512e98665f9f6b495b082 100755 (executable)
@@ -5825,15 +5825,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5925,22 +5917,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6032,42 +6033,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6159,25 +6144,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11154,7 +11153,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11157 "configure"
+#line 11156 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11260,7 +11259,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11263 "configure"
+#line 11262 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 9993e3fcc66ecb8082e3d55e927f28af8d6c26ee..a565edd5db54367e1ef3cf0c788f61fc1de7dc80 100755 (executable)
@@ -6519,15 +6519,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6619,22 +6611,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6726,42 +6727,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6853,25 +6838,40 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
index 1c70f82bd141227e254eea9a16b0fcf517fbbbe4..885f099f36bcecec285c26d9b00abf61c57b1684 100755 (executable)
@@ -5701,15 +5701,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5801,22 +5793,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5908,42 +5909,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6035,25 +6020,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11030,7 +11029,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11033 "configure"
+#line 11032 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11136,7 +11135,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11139 "configure"
+#line 11138 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 2a8f6bd1ae9615f8591e619b33b8c83537764af9..6739d6486415c4f9242a7f4c02a2872670050b7d 100755 (executable)
@@ -7327,15 +7327,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7427,22 +7419,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7534,42 +7535,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7661,25 +7646,40 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
index 6e2429a815eb2bab39bad5988d737e4474cab694..e018ad43e6633446d07c3d93b49314b7202ce40c 100755 (executable)
@@ -7139,15 +7139,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7239,22 +7231,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7346,42 +7347,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7473,25 +7458,40 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
index 11c17f21ee4f5eaa98bafe4a931edd0e3db75a60..9572955642987350473097df61a41d705b743794 100755 (executable)
@@ -6564,15 +6564,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6664,22 +6656,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6771,42 +6772,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6898,25 +6883,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11894,7 +11893,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11897 "configure"
+#line 11896 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12000,7 +11999,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12003 "configure"
+#line 12002 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 2349bba258b473d4cd659c78bf80d2bb68c6da82..398e16211440dc93f670c4f20b0db33ca4901817 100755 (executable)
@@ -6624,15 +6624,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6724,22 +6716,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6831,42 +6832,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6958,25 +6943,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11953,7 +11952,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11956 "configure"
+#line 11955 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12059,7 +12058,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12062 "configure"
+#line 12061 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index becb131103a1fe505a9d7957006cffdcd005eac3..1b02c399dd9b486f3e1995024c24b3f641c4ee7d 100755 (executable)
@@ -8672,15 +8672,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -8772,22 +8764,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -8879,42 +8880,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -9006,25 +8991,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -13971,7 +13970,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13974 "configure"
+#line 13973 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14077,7 +14076,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 14080 "configure"
+#line 14079 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 0c4a1b0d39109856a21c2cdebd5caa549c008add..4c72b5a92831da97f11562143fe5a8845d521b93 100755 (executable)
@@ -4506,15 +4506,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -4606,22 +4598,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -4713,42 +4714,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   PLUGIN_FILE="$plugin_file"
 
 if test -n "$PLUGIN_FILE"; then
   PLUGIN_OPTION="--plugin $PLUGIN_FILE"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -4840,25 +4825,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  PLUGIN_OPTION="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+PLUGIN_OPTION="$plugin_option"
 
 fi
 if test -n "$PLUGIN_OPTION"; then
index 715ce58f700a705a574e5f7ef1a159b23617025f..5f7604e48d7a929dd75a7b7fa614f3a04026485e 100755 (executable)
@@ -6639,15 +6639,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6739,22 +6731,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6846,42 +6847,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6973,25 +6958,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11938,7 +11937,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11941 "configure"
+#line 11940 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12044,7 +12043,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12047 "configure"
+#line 12046 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index df9f63d1031ec8aa5afd84bad7713f5b3ebc561c..48c53a2ff2b8a1b2bffb67723c3d1297e6086fbc 100755 (executable)
@@ -5979,15 +5979,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6079,22 +6071,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6186,42 +6187,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6313,25 +6298,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11278,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11281 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11384,7 +11383,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11387 "configure"
+#line 11386 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index b6c6d658b7d5f12a39eb2b0c3e9548fef77c8988..da4caa57aa15572f2ee85b510e34ac1a3600bf8a 100755 (executable)
@@ -6893,15 +6893,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6993,22 +6985,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7100,42 +7101,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7227,25 +7212,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -13174,7 +13173,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13177 "configure"
+#line 13176 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13280,7 +13279,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13283 "configure"
+#line 13282 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 6e9b96835b43e86acde56da561e6a26485c9d16e..be8b683b6e87fc2a96d4bb16de0f9bc8946c5663 100755 (executable)
@@ -5687,15 +5687,7 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5
 $as_echo "$clang_cv_is_clang" >&6; }
-  plugin_file=
-  if test $clang_cv_is_clang = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
-$as_echo_n "checking for clang plugin file... " >&6; }
-    plugin_names="LLVMgold.so"
-    for plugin in $plugin_names; do
-      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
-      if test x$plugin_file = x$plugin; then
-       if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}llvm-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5787,22 +5779,31 @@ else
   LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"
 fi
 
-       if test "$?" != 0; then
-         as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5
-       fi
-       clang_lib_dir=`$LLVM_CONFIG --libdir`
-       if test -f $clang_lib_dir/$plugin; then
-         plugin_file=$clang_lib_dir/$plugin
-       fi
-       if test x$plugin_file != x$plugin; then
+  plugin_file=
+  if test $clang_cv_is_clang = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5
+$as_echo_n "checking for clang plugin file... " >&6; }
+    plugin_names="LLVMgold.so"
+    for plugin in $plugin_names; do
+      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin`
+      if test "$plugin_file" != "$plugin"; then
+       break;
+      fi
+      if test -n "${LLVM_CONFIG}"; then
+       plugin_file=`${LLVM_CONFIG} --libdir`/$plugin
+       if test -f "$plugin_file"; then
          break;
        fi
       fi
+      plugin_file=
     done
-    if test -z $plugin_file; then
-      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5
-    fi
-        if test -n "$ac_tool_prefix"; then
+    if test -z "$plugin_file"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
+$as_echo "$plugin_file" >&6; }
+            if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5894,42 +5895,26 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-    if test "${AR}" = "" ; then
-      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
-    fi
-    plugin_option="--plugin $plugin_file"
-    touch conftest.c
-    ${AR} $plugin_option rc conftest.a conftest.c
-    if test "$?" != 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+      if test -z "${AR}"; then
+       as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+      fi
+      plugin_option="--plugin $plugin_file"
+      touch conftest.c
+      ${AR} $plugin_option rc conftest.a conftest.c
+      if test "$?" != 0; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
 $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-      plugin_file=
+       plugin_file=
+      fi
+      rm -f conftest.*
     fi
-    rm -f conftest.*
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5
-$as_echo "$plugin_file" >&6; }
   fi
   plugin_file="$plugin_file"
 
 if test -n "$plugin_file"; then
   plugin_option="--plugin $plugin_file"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
-$as_echo_n "checking for -plugin option... " >&6; }
-
-plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
-plugin_option=
-for plugin in $plugin_names; do
-  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
-  if test x$plugin_so = x$plugin; then
-    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
-  fi
-  if test x$plugin_so != x$plugin; then
-    plugin_option="--plugin $plugin_so"
-    break
-  fi
-done
-if test -n "$ac_tool_prefix"; then
+  if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6021,25 +6006,39 @@ else
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${AR}" = "" ; then
+if test -z "${AR}"; then
   as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
 fi
-touch conftest.c
-${AR} $plugin_option rc conftest.a conftest.c
-if test "$?" != 0; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
-$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
-  plugin_option=
-fi
-rm -f conftest.*
-if test -n "$plugin_option"; then
-  plugin_option="$plugin_option"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
-$as_echo "$plugin_option" >&6; }
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -z "$plugin_option"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+    touch conftest.c
+  ${AR} $plugin_option rc conftest.a conftest.c
+  if test "$?" != 0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    plugin_option=
+  fi
+  rm -f conftest.*
 fi
+plugin_option="$plugin_option"
 
 fi
 if test -n "$ac_tool_prefix"; then
@@ -11178,7 +11177,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11181 "configure"
+#line 11180 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11284,7 +11283,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11287 "configure"
+#line 11286 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H