xref: /OK3568_Linux_fs/buildroot/package/gumbo-parser/0001-configure.ac-fix-build-without-C.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 968975107af5f4382e3e9410a635e32c14cea75f Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Wed, 21 Jul 2021 23:47:26 +0200
4Subject: [PATCH] configure.ac: fix build without C++
5
6Fix the following build failure raised on toolchains without C++:
7
8checking whether the C++ compiler works... no
9configure: error: in `/home/buildroot/autobuild/run/instance-0/output-1/build/gumbo-parser-0.10.1':
10configure: error: C++ compiler cannot create executables
11
12Fixes:
13 - http://autobuild.buildroot.org/results/a32b5d3b959433fd5c3543661c37f80d27fbd010
14
15Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
16[Upstream status: https://github.com/google/gumbo-parser/pull/426]
17---
18 Makefile.am  | 2 ++
19 configure.ac | 6 +++++-
20 2 files changed, 7 insertions(+), 1 deletion(-)
21
22diff --git a/Makefile.am b/Makefile.am
23index cb62459..5bebd92 100644
24--- a/Makefile.am
25+++ b/Makefile.am
26@@ -105,7 +105,9 @@ gumbo_test_DEPENDENCIES += check-local
27 gumbo_test_LDADD += gtest/lib/libgtest.la gtest/lib/libgtest_main.la
28 endif
29
30+if HAVE_EXAMPLES
31 noinst_PROGRAMS = clean_text find_links get_title positions_of_class benchmark serialize prettyprint
32+endif
33 LDADD = libgumbo.la
34 AM_CPPFLAGS = -I"$(srcdir)/src"
35
36diff --git a/configure.ac b/configure.ac
37index 32dc9b9..172a36b 100644
38--- a/configure.ac
39+++ b/configure.ac
40@@ -9,8 +9,8 @@ AC_CONFIG_SRCDIR([src/parser.c])
41 AC_CONFIG_FILES([Makefile gumbo.pc])
42
43 # Checks for programs.
44-AC_PROG_CXX
45 AC_PROG_CC_C99
46+AC_PROG_CXX
47
48 # Checks for libraries.
49
50@@ -27,6 +27,10 @@ AC_CHECK_LIB([gtest_main],
51              AM_CONDITIONAL(HAVE_SHARED_LIBGTEST, [true]),
52              AM_CONDITIONAL(HAVE_SHARED_LIBGTEST, [false]))
53
54+AC_ARG_ENABLE([examples],
55+              AS_HELP_STRING([--disable-examples], [Disable examples]))
56+AM_CONDITIONAL([HAVE_EXAMPLES], [test "x$enable_examples" != "xno"])
57+
58 # Init Automake & libtool
59 AM_INIT_AUTOMAKE([foreign subdir-objects])
60 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
61--
622.30.2
63
64