aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Add-AUTOCONF_HOST_OPT-to-help-cross-c.patch
blob: 539a42a7dca963256a4e10ddd196b141cf6bbe21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From ceb47f37582a055bb7f253f813c435ad55c5b6eb Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 22 Apr 2017 10:02:50 -0700
Subject: [PATCH 1/2] CMakeLists.txt: Add AUTOCONF_HOST_OPT to help cross
 compiling

This helps in doing cross compiles for modules which are using
GNU autoconf for build system

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 CMakeLists.txt | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b093f9a..ebf0cd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -290,6 +290,12 @@ else()
   endif()
 endif()
 
+if("${GNU_HOST}" STREQUAL "")
+    set(AUTOCONF_HOST_OPT "")
+else()
+    set(AUTOCONF_HOST_OPT "--host=${GNU_HOST}")
+endif()
+
 # Memory Allocator
 # ================
 if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -299,7 +305,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   # Link to Jemalloc as an external dependency
   ExternalProject_Add(jemalloc
     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc
-    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
+    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
     CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
     BUILD_COMMAND ${MAKE}
     INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
@@ -317,7 +323,7 @@ endif()
 if(FLB_REGEX)
   ExternalProject_Add(onigmo
     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo
-    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo/configure --with-pic --disable-shared --enable-static --prefix=<INSTALL_DIR>
+    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo/configure ${AUTOCONF_HOST_OPT} --with-pic --disable-shared --enable-static --prefix=<INSTALL_DIR>
     CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
     BUILD_COMMAND ${MAKE}
     INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
-- 
2.12.2