From 16bf899447fc1524ffc3c79e1d35380e5285a552 Mon Sep 17 00:00:00 2001 
 | 
From: Jackie Huang <jackie.huang@windriver.com> 
 | 
Date: Thu, 7 Jan 2016 22:37:30 -0800 
 | 
Subject: [PATCH] libtool: do not use jlibtool 
 | 
  
 | 
jlibtool is hardcoded to be used but we need to use 
 | 
our libtool, so fix the makfiles to make it compatible 
 | 
with our libtool. 
 | 
  
 | 
Upstream-Status: Inappropriate [oe specific] 
 | 
  
 | 
Signed-off-by: Jackie Huang <jackie.huang@windriver.com> 
 | 
Signed-off-by: Yi Zhao <yi.zhao@windriver.com> 
 | 
--- 
 | 
 Make.inc.in        |  4 ++-- 
 | 
 scripts/boiler.mk  |  2 ++ 
 | 
 scripts/install.mk | 14 +++++++------- 
 | 
 scripts/libtool.mk | 22 ++++++++++++++++------ 
 | 
 4 files changed, 27 insertions(+), 15 deletions(-) 
 | 
  
 | 
diff --git a/Make.inc.in b/Make.inc.in 
 | 
index 7a77625..fd8aa3e 100644 
 | 
--- a/Make.inc.in 
 | 
+++ b/Make.inc.in 
 | 
@@ -57,7 +57,7 @@ CPPFLAGS    = @CPPFLAGS@ 
 | 
 LIBPREFIX    = @LIBPREFIX@ 
 | 
 EXEEXT        = @EXEEXT@ 
 | 
  
 | 
-LIBTOOL        = JLIBTOOL 
 | 
+LIBTOOL        = @LIBTOOL@ 
 | 
 ACLOCAL        = @ACLOCAL@ 
 | 
 AUTOCONF    = @AUTOCONF@ 
 | 
 AUTOHEADER    = @AUTOHEADER@ 
 | 
@@ -163,7 +163,7 @@ ANALYZE.c       := @clang_path@ 
 | 
 # 
 | 
 ifeq "$(USE_SHARED_LIBS)" "yes" 
 | 
     TESTBINDIR = ./$(BUILD_DIR)/bin/local 
 | 
-    TESTBIN    =  FR_LIBRARY_PATH=./build/lib/.libs $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR) 
 | 
+    TESTBIN    =  FR_LIBRARY_PATH=./build/lib/.libs $(LIBTOOL) --quiet --mode=execute $(TESTBINDIR) 
 | 
 else 
 | 
     TESTBINDIR = ./$(BUILD_DIR)/bin 
 | 
     TESTBIN    = ./$(BUILD_DIR)/bin 
 | 
diff --git a/scripts/boiler.mk b/scripts/boiler.mk 
 | 
index bccec5e..926a13e 100644 
 | 
--- a/scripts/boiler.mk 
 | 
+++ b/scripts/boiler.mk 
 | 
@@ -266,6 +266,7 @@ define COMPILE_C_CMDS 
 | 
     $(Q)$(ECHO) CC $< 
 | 
     $(Q)$(strip ${COMPILE.c} -o $@ -c -MD ${CPPFLAGS} ${CFLAGS} ${SRC_CFLAGS} ${INCDIRS} \ 
 | 
         $(addprefix -I, ${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} $<) 
 | 
+    ${Q}mv $(dir $@)/.libs/$(notdir $*.d) ${BUILD_DIR}/objs/$*.d 
 | 
 endef 
 | 
 else 
 | 
 # 
 | 
@@ -281,6 +282,7 @@ define COMPILE_C_CMDS 
 | 
     $(Q)cppcheck --enable=style -q ${CHECKFLAGS} $(filter -isystem%,${SRC_CFLAGS}) \ 
 | 
          $(filter -I%,${SRC_CFLAGS}) $(filter -D%,${SRC_CFLAGS}) ${INCDIRS} \ 
 | 
          $(addprefix -I,${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} --suppress=variableScope --suppress=invalidscanf $< 
 | 
+    ${Q}mv $(dir $@)/.libs/$(notdir $*.d) ${BUILD_DIR}/objs/$*.d 
 | 
 endef 
 | 
 endif 
 | 
  
 | 
diff --git a/scripts/install.mk b/scripts/install.mk 
 | 
index 9164115..e38c1ed 100644 
 | 
--- a/scripts/install.mk 
 | 
+++ b/scripts/install.mk 
 | 
@@ -46,7 +46,7 @@ define ADD_INSTALL_RULE.exe 
 | 
     install: $${${1}_INSTALLDIR}/$(notdir ${1}) 
 | 
  
 | 
     # Install executable ${1} 
 | 
-    $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR} 
 | 
+    $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR} 
 | 
     @$(ECHO) INSTALL ${1} 
 | 
     $(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/bin/${1} $${${1}_INSTALLDIR}/ 
 | 
     $(Q)$${${1}_POSTINSTALL} 
 | 
@@ -65,7 +65,7 @@ define ADD_INSTALL_RULE.a 
 | 
     install: $${${1}_INSTALLDIR}/$(notdir ${1}) 
 | 
  
 | 
     # Install static library ${1} 
 | 
-    $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} ${1} | $${${1}_INSTALLDIR} 
 | 
+    $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} ${1} | $${${1}_INSTALLDIR} 
 | 
     @$(ECHO) INSTALL ${1} 
 | 
     $(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/ 
 | 
     $(Q)$${${1}_POSTINSTALL} 
 | 
@@ -87,9 +87,9 @@ define ADD_INSTALL_RULE.la 
 | 
     install: $${${1}_INSTALLDIR}/$(notdir ${1}) 
 | 
  
 | 
     # Install libtool library ${1} 
 | 
-    $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR} 
 | 
+    $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR} 
 | 
     @$(ECHO) INSTALL ${1} 
 | 
-    $(Q)$${PROGRAM_INSTALL} -c -m 755 $${LOCAL_FLAGS_MIN} $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/ 
 | 
+    $(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/ 
 | 
     $(Q)$${${1}_POSTINSTALL} 
 | 
  
 | 
 endef 
 | 
@@ -107,7 +107,7 @@ define ADD_INSTALL_RULE.man 
 | 
     install: ${2}/$(notdir ${1}) 
 | 
  
 | 
     # Install manual page ${1} 
 | 
-    ${2}/$(notdir ${1}): ${JLIBTOOL} ${1} | ${2} 
 | 
+    ${2}/$(notdir ${1}): ${LIBTOOL} ${1} | ${2} 
 | 
     @$(ECHO) INSTALL $(notdir ${1}) 
 | 
     $(Q)$${PROGRAM_INSTALL} -c -m 644 ${1} ${2}/ 
 | 
  
 | 
@@ -122,9 +122,9 @@ endef 
 | 
 define ADD_INSTALL_RULE.dir 
 | 
     # Install directory 
 | 
     .PHONY: ${1} 
 | 
-    ${1}: ${JLIBTOOL} 
 | 
+    ${1}: ${LIBTOOL} 
 | 
     @$(ECHO) INSTALL -d -m 755 ${1} 
 | 
-    $(Q)$${PROGRAM_INSTALL} -d -m 755 ${1} 
 | 
+    $(Q)$${INSTALL} -d -m 755 ${1} 
 | 
 endef 
 | 
  
 | 
  
 | 
diff --git a/scripts/libtool.mk b/scripts/libtool.mk 
 | 
index 57915e1..2cb2f7d 100644 
 | 
--- a/scripts/libtool.mk 
 | 
+++ b/scripts/libtool.mk 
 | 
@@ -55,7 +55,9 @@ ifeq "${LIBTOOL}" "JLIBTOOL" 
 | 
     # Tell GNU Make to use this value, rather than anything specified 
 | 
     # on the command line. 
 | 
     override LIBTOOL := ${JLIBTOOL} 
 | 
-endif    # else we're not using jlibtool 
 | 
+else    # else we're not using jlibtool 
 | 
+    all install: ${LIBTOOL} 
 | 
+endif 
 | 
  
 | 
 # When using libtool, it produces a '.libs' directory.  Ensure that it 
 | 
 # is removed on "make clean", too. 
 | 
@@ -69,11 +71,19 @@ clean: .libs_clean 
 | 
 # Re-define compilers and linkers 
 | 
 # 
 | 
 OBJ_EXT = lo 
 | 
-COMPILE.c = ${LIBTOOL} --silent --mode=compile ${CC} 
 | 
-COMPILE.cxx = ${LIBTOOL} --mode=compile ${CXX} 
 | 
-LINK.c = ${LIBTOOL} --silent --mode=link ${CC} 
 | 
-LINK.cxx = ${LIBTOOL} --mode=link ${CXX} 
 | 
-PROGRAM_INSTALL = ${LIBTOOL} --silent --mode=install ${INSTALL} 
 | 
+ifeq "${LIBTOOL}" "JLIBTOOL" 
 | 
+    COMPILE.c = ${LIBTOOL} --silent --mode=compile ${CC} 
 | 
+    COMPILE.cxx = ${LIBTOOL} --mode=compile ${CXX} 
 | 
+    LINK.c = ${LIBTOOL} --silent --mode=link ${CC} 
 | 
+    LINK.cxx = ${LIBTOOL} --mode=link ${CXX} 
 | 
+    PROGRAM_INSTALL = ${LIBTOOL} --silent --mode=install ${INSTALL} 
 | 
+else 
 | 
+    COMPILE.c = ${LIBTOOL} --mode=compile --tag=CC ${CC} 
 | 
+    COMPILE.cxx = ${LIBTOOL} --mode=compile --tag=CC ${CXX} 
 | 
+    LINK.c = ${LIBTOOL} --mode=link --tag=CC ${CC} -module -export-dynamic 
 | 
+    LINK.cxx = ${LIBTOOL} --mode=link --tag=CC ${CXX} -module -export-dynamic 
 | 
+    PROGRAM_INSTALL = ${LIBTOOL} --mode=install ${INSTALL} 
 | 
+endif 
 | 
  
 | 
  
 | 
 # LIBTOOL_ENDINGS - Given a library ending in ".a" or ".so", replace that 
 | 
--  
 | 
2.10.2 
 |