From 488566d2dd8566fa9c6893d5d2d43a854a3b10b6 Mon Sep 17 00:00:00 2001 From: Allen Webb Date: Fri, 14 Jun 2019 13:06:07 -0700 Subject: [PATCH] configure.ac: Workaround gtest-config not being installed. Upstream googletest is dropping autotools support and the cmake installer does not provide gtest-config. BUG=chromium:940320 TEST=FEATURES=test emerge-lakitu google-breakpad Change-Id: Icd51ffc48b39c24eebc27cc023e74a77e592de3e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1660893 Reviewed-by: Mike Frysinger --- Makefile.in | 3 - configure | 202 +-------------------------------------------------- configure.ac | 12 +-- 3 files changed, 8 insertions(+), 209 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0bb11588..c6552bd1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1978,11 +1978,9 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ -GMOCK_CONFIG = @GMOCK_CONFIG@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ GTEST_CFLAGS = @GTEST_CFLAGS@ -GTEST_CONFIG = @GTEST_CONFIG@ GTEST_LIBS = @GTEST_LIBS@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ @@ -2062,7 +2060,6 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/configure b/configure index d8099cd8..a6577dca 100755 --- a/configure +++ b/configure @@ -634,10 +634,8 @@ SELFTEST_FALSE SELFTEST_TRUE GTEST_LIBS GTEST_CFLAGS -GTEST_CONFIG GMOCK_LIBS GMOCK_CFLAGS -GMOCK_CONFIG SYSTEM_TEST_LIBS_FALSE SYSTEM_TEST_LIBS_TRUE DISABLE_TOOLS_FALSE @@ -795,10 +793,8 @@ CPP CXX CXXFLAGS CCC -GMOCK_CONFIG GMOCK_CFLAGS GMOCK_LIBS -GTEST_CONFIG GTEST_CFLAGS GTEST_LIBS RUST_DEMANGLE_CFLAGS @@ -1464,13 +1460,9 @@ Some influential environment variables: CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags - GMOCK_CONFIG - Path to gmock-config script GMOCK_CFLAGS Compiler flags for gmock GMOCK_LIBS Linker flags for gmock - GTEST_CONFIG - Path to gtest-config script GTEST_CFLAGS Compiler flags for gtest GTEST_LIBS Linker flags for gtest @@ -7632,197 +7624,11 @@ fi - - if test x$system_test_libs = xtrue; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gmock-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}gmock-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GMOCK_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GMOCK_CONFIG"; then - ac_cv_prog_GMOCK_CONFIG="$GMOCK_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GMOCK_CONFIG="${ac_tool_prefix}gmock-config" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -GMOCK_CONFIG=$ac_cv_prog_GMOCK_CONFIG -if test -n "$GMOCK_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMOCK_CONFIG" >&5 -$as_echo "$GMOCK_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_GMOCK_CONFIG"; then - ac_ct_GMOCK_CONFIG=$GMOCK_CONFIG - # Extract the first word of "gmock-config", so it can be a program name with args. -set dummy gmock-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_GMOCK_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_GMOCK_CONFIG"; then - ac_cv_prog_ac_ct_GMOCK_CONFIG="$ac_ct_GMOCK_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GMOCK_CONFIG="gmock-config" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_GMOCK_CONFIG=$ac_cv_prog_ac_ct_GMOCK_CONFIG -if test -n "$ac_ct_GMOCK_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GMOCK_CONFIG" >&5 -$as_echo "$ac_ct_GMOCK_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_GMOCK_CONFIG" = x; then - GMOCK_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - GMOCK_CONFIG=$ac_ct_GMOCK_CONFIG - fi -else - GMOCK_CONFIG="$ac_cv_prog_GMOCK_CONFIG" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gtest-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}gtest-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GTEST_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GTEST_CONFIG"; then - ac_cv_prog_GTEST_CONFIG="$GTEST_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GTEST_CONFIG="${ac_tool_prefix}gtest-config" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -GTEST_CONFIG=$ac_cv_prog_GTEST_CONFIG -if test -n "$GTEST_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTEST_CONFIG" >&5 -$as_echo "$GTEST_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_GTEST_CONFIG"; then - ac_ct_GTEST_CONFIG=$GTEST_CONFIG - # Extract the first word of "gtest-config", so it can be a program name with args. -set dummy gtest-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_GTEST_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_GTEST_CONFIG"; then - ac_cv_prog_ac_ct_GTEST_CONFIG="$ac_ct_GTEST_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GTEST_CONFIG="gtest-config" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_GTEST_CONFIG=$ac_cv_prog_ac_ct_GTEST_CONFIG -if test -n "$ac_ct_GTEST_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GTEST_CONFIG" >&5 -$as_echo "$ac_ct_GTEST_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_GTEST_CONFIG" = x; then - GTEST_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - GTEST_CONFIG=$ac_ct_GTEST_CONFIG - fi -else - GTEST_CONFIG="$ac_cv_prog_GTEST_CONFIG" -fi - - GMOCK_CFLAGS=`$GMOCK_CONFIG --cppflags --cxxflags` - GMOCK_LIBS=`$GMOCK_CONFIG --ldflags --libs` - GTEST_CFLAGS=`$GTEST_CONFIG --cppflags --cxxflags` - GTEST_LIBS=`$GTEST_CONFIG --ldflags --libs` + : "${GMOCK_CFLAGS:=-pthread}" + : "${GMOCK_LIBS:=-lgmock -lgtest -pthread -lpthread}" + : "${GTEST_CFLAGS:=-pthread}" + : "${GTEST_LIBS:=-lgtest -pthread -lpthread}" fi # Check whether --enable-selftest was given. diff --git a/configure.ac b/configure.ac index 9cca5aa0..492d0903 100644 --- a/configure.ac +++ b/configure.ac @@ -187,19 +187,15 @@ AC_ARG_ENABLE(system-test-libs, [system_test_libs=false]) AM_CONDITIONAL(SYSTEM_TEST_LIBS, test x$system_test_libs = xtrue) -AC_ARG_VAR([GMOCK_CONFIG], [Path to gmock-config script]) AC_ARG_VAR([GMOCK_CFLAGS], [Compiler flags for gmock]) AC_ARG_VAR([GMOCK_LIBS], [Linker flags for gmock]) -AC_ARG_VAR([GTEST_CONFIG], [Path to gtest-config script]) AC_ARG_VAR([GTEST_CFLAGS], [Compiler flags for gtest]) AC_ARG_VAR([GTEST_LIBS], [Linker flags for gtest]) if test x$system_test_libs = xtrue; then - AC_CHECK_TOOL([GMOCK_CONFIG], [gmock-config]) - AC_CHECK_TOOL([GTEST_CONFIG], [gtest-config]) - GMOCK_CFLAGS=`$GMOCK_CONFIG --cppflags --cxxflags` - GMOCK_LIBS=`$GMOCK_CONFIG --ldflags --libs` - GTEST_CFLAGS=`$GTEST_CONFIG --cppflags --cxxflags` - GTEST_LIBS=`$GTEST_CONFIG --ldflags --libs` + : "${GMOCK_CFLAGS:=-pthread}" + : "${GMOCK_LIBS:=-lgmock -lgtest -pthread -lpthread}" + : "${GTEST_CFLAGS:=-pthread}" + : "${GTEST_LIBS:=-lgtest -pthread -lpthread}" fi AC_ARG_ENABLE(selftest,