Add constructor to signal_catchpoint
[binutils-gdb.git] / gprofng / configure.ac
index c05e98192f36007893069c7f02e27d1f90127d14..63b505c5e14005a443f7899d9357498436e721a1 100644 (file)
@@ -17,6 +17,7 @@ dnl along with this program; see the file COPYING3.  If not see
 dnl <http://www.gnu.org/licenses/>.
 
 m4_include([../bfd/version.m4])
+m4_include([../config/zlib.m4])
 AC_INIT([gprofng], BFD_VERSION)
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([subdir-objects])
@@ -28,6 +29,10 @@ AC_PROG_CXX
 AC_PROG_INSTALL
 AC_PROG_RANLIB
 AM_PROG_AR
+gl_PROG_BISON([BISON],[3.0.4])
+if test x$BISON = "x:"; then
+  AC_MSG_ERROR([Building gprofng requires bison 3.0.4 or later.])
+fi
 
 AC_DISABLE_SHARED
 LT_INIT
@@ -49,18 +54,13 @@ gprofng_cppflags="-U_ASM"
 build_collector=
 build_src=
 
-# This is annoying: it means we have to pass --enable-shared explicitly to
-# get gprofng, while the configure default is supposed to be that shared libs
-# are on by default.  But as long as libiberty has code like this, so must
-# we...
-
-  case "${target}" in
+  case "${host}" in
     x86_64-*-linux*)
       build_src=true
       build_collector=true
       ;;
     i?86-*-linux*)
-      build_collector=true
+      build_src=true
       build_collector=true
       ;;
     aarch64-*-linux*)
@@ -128,13 +128,30 @@ fi
 if test "x$enable_gprofng_jp" = x; then
   AC_CHECK_HEADER([jni.h], [ enable_gprofng_jp=yes ], [], [] )
 fi
+GPROFNG_BROKEN_JAVAC=no
 if test "x$enable_gprofng_jp" = x; then
     AC_MSG_WARN([ Cannot find the JDK include directory.
       gprofng will be build without support for profiling Java applications.
       Use --with-jdk=PATH to specify directory for the installed JDK])
 else
     AC_DEFINE(GPROFNG_JAVA_PROFILING, 1, [Enable java profiling])
+    if test "x$JAVAC" != x; then
+      cat > configtest.java << EOF
+class Simple{
+  public static void main(String args[]){
+    System.out.println("Hello Java");
+  }
+}
+EOF
+      if AC_TRY_COMMAND($JAVAC conftest.java &AS_MESSAGE_LOG_FD 2>&1); then
+       GPROFNG_BROKEN_JAVAC=no
+      else
+       GPROFNG_BROKEN_JAVAC=yes
+      fi
+      rm -f configtest.*
+    fi
 fi
+AC_SUBST(GPROFNG_BROKEN_JAVAC)
 AC_SUBST(jdk_inc)
 
 DEBUG=
@@ -165,6 +182,7 @@ fi`
 ])
 AM_CONDITIONAL(TCL_TRY, test "${ac_cv_libctf_tcl_try}" = yes)
 
+AM_ZLIB
 
 # Generate manpages, if possible.
 if test $cross_compiling = no; then
@@ -180,11 +198,23 @@ AC_SUBST(GPROFNG_CFLAGS, [${gprofng_cflags}])
 AC_SUBST(GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS)
 AC_SUBST(GPROFNG_NO_SWITCH_CFLAGS)
 AC_SUBST(GPROFNG_CPPFLAGS, [${gprofng_cppflags}])
-AC_SUBST(GPROFNG_LIBDIR, [${libdir}])
 
 AC_CHECK_DECLS([basename])
 AC_CHECK_FUNCS(clock_gettime strsignal)
 
+clock_gettime_link=
+# At least for glibc, clock_gettime is in librt.  But don't
+# pull that in if it still doesn't give us the function we want.  This
+# test is copied from libgomp, and modified to not link in -lrt as
+# we're using this for test timing only.
+if test "$ac_cv_func_clock_gettime" = no; then
+  AC_CHECK_LIB(rt, clock_gettime,
+    [CLOCK_GETTIME_LINK=-lrt
+     AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
+              [Define to 1 if you have the `clock_gettime' function.])])
+fi
+AC_SUBST(CLOCK_GETTIME_LINK)
+
 AC_SUBST(BUILD_SUBDIRS)
 
 AC_CONFIG_FILES([Makefile src/Makefile gp-display-html/Makefile doc/Makefile])