Fix bug where C compiler used instead of C++ for autoconf tests
authorStephen Twigg <sdtwigg@eecs.berkeley.edu>
Fri, 9 Jan 2015 23:56:28 +0000 (15:56 -0800)
committerStephen Twigg <sdtwigg@eecs.berkeley.edu>
Fri, 9 Jan 2015 23:56:28 +0000 (15:56 -0800)
configure
riscv/riscv.ac

index e789a138c66b037e77c4bc4bd6c97a75615aab43..7748d5cd55aff3cade5f640b9dd1a8ceafffd545 100755 (executable)
--- a/configure
+++ b/configure
@@ -1562,10 +1562,10 @@ fi
 
 } # ac_fn_c_try_run
 
 
 } # ac_fn_c_try_run
 
-# ac_fn_c_try_link LINENO
-# -----------------------
+# ac_fn_cxx_try_link LINENO
+# -------------------------
 # Try to link conftest.$ac_ext, and return whether this succeeded.
 # Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
+ac_fn_cxx_try_link ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   rm -f conftest.$ac_objext conftest$ac_exeext
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   rm -f conftest.$ac_objext conftest$ac_exeext
@@ -1585,7 +1585,7 @@ $as_echo "$ac_try_echo"; } >&5
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
@@ -1606,7 +1606,7 @@ fi
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
-} # ac_fn_c_try_link
+} # ac_fn_cxx_try_link
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -4037,6 +4037,7 @@ CXXFLAGS="-Wall -Wno-unused -O2 -std=c++11"
 
 
 
 
 
 
+
   # Add command line argument to enable all optional subprojects
 
   # Check whether --enable-optional-subprojects was given.
   # Add command line argument to enable all optional subprojects
 
   # Check whether --enable-optional-subprojects was given.
@@ -4089,6 +4090,13 @@ $as_echo "$as_me: configuring default subproject : riscv" >&6;}
 
 $as_echo "#define RISCV_ENABLED /**/" >>confdefs.h
 
 
 $as_echo "#define RISCV_ENABLED /**/" >>confdefs.h
 
+      ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
 
 # Check whether --with-fesvr was given.
 if test "${with_fesvr+set}" = set; then :
 
 # Check whether --with-fesvr was given.
 if test "${with_fesvr+set}" = set; then :
@@ -4125,7 +4133,7 @@ return libfesvr_is_present ();
   return 0;
 }
 _ACEOF
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_cxx_try_link "$LINENO"; then :
   ac_cv_lib_fesvr_libfesvr_is_present=yes
 else
   ac_cv_lib_fesvr_libfesvr_is_present=no
   ac_cv_lib_fesvr_libfesvr_is_present=yes
 else
   ac_cv_lib_fesvr_libfesvr_is_present=no
@@ -4173,7 +4181,7 @@ return pthread_create ();
   return 0;
 }
 _ACEOF
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_cxx_try_link "$LINENO"; then :
   ac_cv_lib_pthread_pthread_create=yes
 else
   ac_cv_lib_pthread_pthread_create=no
   ac_cv_lib_pthread_pthread_create=yes
 else
   ac_cv_lib_pthread_pthread_create=no
@@ -4458,7 +4466,7 @@ for ac_lib in '' dl dld; do
     ac_res=-l$ac_lib
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
     ac_res=-l$ac_lib
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
-  if ac_fn_c_try_link "$LINENO"; then :
+  if ac_fn_cxx_try_link "$LINENO"; then :
   ac_cv_search_dlopen=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
   ac_cv_search_dlopen=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
index d38a48cdecafd10e745a24fbe989d989ccd4d7f5..10aa1f14115f1a5a8620557d277e41d797258696 100644 (file)
@@ -1,3 +1,5 @@
+AC_LANG_CPLUSPLUS
+
 AC_ARG_WITH([fesvr],
   [AS_HELP_STRING([--with-fesvr],
     [path to your fesvr installation if not in a standard location])],
 AC_ARG_WITH([fesvr],
   [AS_HELP_STRING([--with-fesvr],
     [path to your fesvr installation if not in a standard location])],