1From 6cfa9f8126c1d6ec26f120d273e714fb19108873 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Sun, 4 Aug 2019 16:32:41 -0700 4Subject: [PATCH] Include config.h 5 6This helps avoid the include conflicts where <stdlib.h> is including 7<math.h> and since -I./lib is used and a local math.h wrapper is 8residing in there, the build breaks since stdlib.h really wants the 9standard system math.h to be included, this ensures that right macros 10are predefined and included before stdlib.h is included 11 12fixes 13In file included from src/libs/libgroff/assert.cpp:20: 14In file included from TOPDIR/build/tmp/work/aarch64-yoe-linux-musl/groff/1.22.4-r0/recipe-sysroot/usr/include/c++/v1/stdlib.h:100: 15./lib/math.h:38:3: error: "Please include config.h first." 16 #error "Please include config.h first." 17 ^ 18./lib/math.h:40:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN' 19 20We delete eqn.cpp and qen.hpp in do_configure 21to ensure they're regenerated and deterministic. 22 23Issue is fixed upstream with similar patches: 24https://git.savannah.gnu.org/cgit/groff.git/commit/?id=979f3f4266151c7681a68a40d2c4913842a7271d 25https://git.savannah.gnu.org/cgit/groff.git/commit/?id=fe121eeacd53c96105f23209b2c205f436f97359 26 27Upstream-Status: Backport [see links above] 28Signed-off-by: Khem Raj <raj.khem@gmail.com> 29--- 30 src/libs/libgroff/assert.cpp | 4 + 31 src/libs/libgroff/curtime.cpp | 4 + 32 src/libs/libgroff/device.cpp | 4 + 33 src/libs/libgroff/error.cpp | 4 + 34 src/libs/libgroff/fatal.cpp | 4 + 35 src/libs/libgroff/string.cpp | 4 + 36 src/libs/libgroff/strsave.cpp | 4 + 37 src/preproc/eqn/eqn.cpp | 450 ++++++++++++++++++---------------- 38 src/preproc/eqn/eqn.hpp | 12 +- 39 src/preproc/eqn/eqn.ypp | 4 + 40 src/preproc/eqn/other.cpp | 4 + 41 src/preproc/eqn/text.cpp | 4 + 42 src/preproc/pic/object.cpp | 4 + 43 13 files changed, 285 insertions(+), 221 deletions(-) 44 45diff --git a/src/libs/libgroff/assert.cpp b/src/libs/libgroff/assert.cpp 46index aceed05..97780d6 100644 47--- a/src/libs/libgroff/assert.cpp 48+++ b/src/libs/libgroff/assert.cpp 49@@ -16,6 +16,10 @@ for more details. 50 You should have received a copy of the GNU General Public License 51 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 52 53+#if HAVE_CONFIG_H 54+# include <config.h> 55+#endif 56+ 57 #include <stdio.h> 58 #include <stdlib.h> 59 #include "assert.h" 60diff --git a/src/libs/libgroff/curtime.cpp b/src/libs/libgroff/curtime.cpp 61index 72fe067..9ddba08 100644 62--- a/src/libs/libgroff/curtime.cpp 63+++ b/src/libs/libgroff/curtime.cpp 64@@ -15,6 +15,10 @@ for more details. 65 The GNU General Public License version 2 (GPL2) is available in the 66 internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */ 67 68+#if HAVE_CONFIG_H 69+# include <config.h> 70+#endif 71+ 72 #include <errno.h> 73 #include <limits.h> 74 #include <stdlib.h> 75diff --git a/src/libs/libgroff/device.cpp b/src/libs/libgroff/device.cpp 76index 0d28b85..c211f85 100644 77--- a/src/libs/libgroff/device.cpp 78+++ b/src/libs/libgroff/device.cpp 79@@ -17,6 +17,10 @@ for more details. 80 You should have received a copy of the GNU General Public License 81 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 82 83+#if HAVE_CONFIG_H 84+# include <config.h> 85+#endif 86+ 87 #include <stdlib.h> 88 #include "device.h" 89 #include "defs.h" 90diff --git a/src/libs/libgroff/error.cpp b/src/libs/libgroff/error.cpp 91index 9a18803..7b63d3d 100644 92--- a/src/libs/libgroff/error.cpp 93+++ b/src/libs/libgroff/error.cpp 94@@ -17,6 +17,10 @@ for more details. 95 You should have received a copy of the GNU General Public License 96 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 97 98+#if HAVE_CONFIG_H 99+# include <config.h> 100+#endif 101+ 102 #include <stdio.h> 103 #include <stdlib.h> 104 #include <string.h> 105diff --git a/src/libs/libgroff/fatal.cpp b/src/libs/libgroff/fatal.cpp 106index c0dcb35..fd6003e 100644 107--- a/src/libs/libgroff/fatal.cpp 108+++ b/src/libs/libgroff/fatal.cpp 109@@ -16,6 +16,10 @@ for more details. 110 You should have received a copy of the GNU General Public License 111 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 112 113+#if HAVE_CONFIG_H 114+# include <config.h> 115+#endif 116+ 117 #include <stdlib.h> 118 119 #define FATAL_ERROR_EXIT_CODE 3 120diff --git a/src/libs/libgroff/string.cpp b/src/libs/libgroff/string.cpp 121index 46c015c..449f3a6 100644 122--- a/src/libs/libgroff/string.cpp 123+++ b/src/libs/libgroff/string.cpp 124@@ -17,6 +17,10 @@ for more details. 125 You should have received a copy of the GNU General Public License 126 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 127 128+#if HAVE_CONFIG_H 129+# include <config.h> 130+#endif 131+ 132 #include <stdlib.h> 133 134 #include "lib.h" 135diff --git a/src/libs/libgroff/strsave.cpp b/src/libs/libgroff/strsave.cpp 136index f95c05e..d875045 100644 137--- a/src/libs/libgroff/strsave.cpp 138+++ b/src/libs/libgroff/strsave.cpp 139@@ -17,6 +17,10 @@ for more details. 140 You should have received a copy of the GNU General Public License 141 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 142 143+#if HAVE_CONFIG_H 144+# include <config.h> 145+#endif 146+ 147 #include <string.h> 148 #include <stdlib.h> 149 150diff --git a/src/preproc/eqn/eqn.ypp b/src/preproc/eqn/eqn.ypp 151index fb318c3..b7b647e 100644 152--- a/src/preproc/eqn/eqn.ypp 153+++ b/src/preproc/eqn/eqn.ypp 154@@ -16,6 +16,10 @@ for more details. 155 You should have received a copy of the GNU General Public License 156 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 157 %{ 158+#if HAVE_CONFIG_H 159+# include <config.h> 160+#endif 161+ 162 #include <stdio.h> 163 #include <string.h> 164 #include <stdlib.h> 165diff --git a/src/preproc/eqn/other.cpp b/src/preproc/eqn/other.cpp 166index 8db993f..38db396 100644 167--- a/src/preproc/eqn/other.cpp 168+++ b/src/preproc/eqn/other.cpp 169@@ -17,6 +17,10 @@ for more details. 170 You should have received a copy of the GNU General Public License 171 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 172 173+#if HAVE_CONFIG_H 174+# include <config.h> 175+#endif 176+ 177 #include <stdlib.h> 178 179 #include "eqn.h" 180diff --git a/src/preproc/eqn/text.cpp b/src/preproc/eqn/text.cpp 181index f3d06f9..3b244d5 100644 182--- a/src/preproc/eqn/text.cpp 183+++ b/src/preproc/eqn/text.cpp 184@@ -17,6 +17,10 @@ for more details. 185 You should have received a copy of the GNU General Public License 186 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 187 188+#if HAVE_CONFIG_H 189+# include <config.h> 190+#endif 191+ 192 #include <ctype.h> 193 #include <stdlib.h> 194 #include "eqn.h" 195diff --git a/src/preproc/pic/object.cpp b/src/preproc/pic/object.cpp 196index d8ba610..f26a831 100644 197--- a/src/preproc/pic/object.cpp 198+++ b/src/preproc/pic/object.cpp 199@@ -17,6 +17,10 @@ for more details. 200 You should have received a copy of the GNU General Public License 201 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 202 203+#if HAVE_CONFIG_H 204+# include <config.h> 205+#endif 206+ 207 #include <stdlib.h> 208 209 #include "pic.h" 210-- 2112.22.0 212 213