From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 6138D6C7D4; Tue, 2 Feb 2021 23:58:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6138D6C7D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612299506; bh=FDrPQqTDf6rMfEuIrMAdExbTxqYbLE6ILaTAy0y5gyY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=AWv6e/TF3GU1gMzTQ2QlYrAmCjaocmiGREYN7yuf0+2P/nbSBteWf/1sxR8YGHdSL rkN8ot9vrwU8sKaXvB27N4DFIYOj4ob6632cU1xzf1iLLg+AaAXN33ke7/QhtWkM/y GHPevMp4Gqz1uepNSLR1CvPVXetxLKRTIP6pYgrU= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1E5F16C7D4 for ; Tue, 2 Feb 2021 23:57:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1E5F16C7D4 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1l72kA-0005mg-2F; Tue, 02 Feb 2021 23:57:50 +0300 To: Sergey Kaplun , Timur Safin Date: Tue, 2 Feb 2021 23:57:41 +0300 Message-Id: X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9C55152E5B36F7009490E3DBC75EBFD4CE182A05F53808504092BDDEF02668A66D36297D8AFE72A9A112BFC4CE585A850403D02DDE2C193677 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CB1634DB9A2F7B99EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063771C846A5973DEE7E8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCDAFBC183B389AD44A0E21BD08DDDD3F62E8402C3A6AAF44E389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C05A64D9A1E9CA65708941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B601F8F2FECC0250C8CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC426E46268278306375ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4931B544F03EFBC4D5789424AA0EF8DE9BAC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C823F58AE0C7795A9532987C32294109AD5D6A857D6A605D49C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF31C0090ACECF247D699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F6110710A6CC527F1AE1D70F83F4800B916F4895B42305E53FA07DCDD77B970C2856D463F98CD4421D7E09C32AA3244C512DA11A6202BE6612B7B240EC2023D335DA7DC5AF9B58C0927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojCSo1BV1mVLbDSszo1Kk6ew== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638224FAD20A9B7F85A5EEE82B543134A9CB0A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 1/5] build: preserve the original build system X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Since the build machinery is going to be ported to CMake there would be Makefile names clashing. This change renames the original build system (and a couple of auxiliary files requiring configuring) to keep all this machinery working. As a result of these changes one need to explicitly specify the Makefile in the build command: | make -f Makefile.original Needed for tarantool/tarantool#4862 Signed-off-by: Igor Munkin --- Makefile => Makefile.original | 44 +++++++++++++-------- etc/{luajit.pc => luajit.pc.in} | 4 +- src/{Makefile.dep => Makefile.dep.original} | 0 src/{Makefile => Makefile.original} | 4 +- tools/luajit-parse-memprof | 9 ----- tools/luajit-parse-memprof.in | 6 +++ 6 files changed, 38 insertions(+), 29 deletions(-) rename Makefile => Makefile.original (85%) rename etc/{luajit.pc => luajit.pc.in} (91%) rename src/{Makefile.dep => Makefile.dep.original} (100%) rename src/{Makefile => Makefile.original} (99%) delete mode 100755 tools/luajit-parse-memprof create mode 100644 tools/luajit-parse-memprof.in diff --git a/Makefile b/Makefile.original similarity index 85% rename from Makefile rename to Makefile.original index 61967df..b85d4bf 100644 --- a/Makefile +++ b/Makefile.original @@ -85,10 +85,10 @@ INSTALL_X= install -m 0755 INSTALL_F= install -m 0644 UNINSTALL= $(RM) LDCONFIG= ldconfig -n -SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \ - -e "s|^multilib=.*|multilib=$(MULTILIB)|" -SED_TMEMPROF= sed -e "s|^TOOL_DIR=.*|TOOL_DIR=$(INSTALL_TOOLSLIB)|" \ - -e "s|^LUAJIT_BIN=.*|LUAJIT_BIN=$(INSTALL_T)|" +SED_PC= sed -e "s|@LUAJIT_PC_PREFIX@|$(PREFIX)|" \ + -e "s|@LUAJIT_PC_MULTILIB@|$(MULTILIB)|" +SED_TMEMPROF= sed -e "s|@LUAJIT_TOOLS_DIR@|$(INSTALL_TOOLSLIB)|" \ + -e "s|@LUAJIT_TOOLS_BIN@|$(INSTALL_T)|" FILE_T= luajit FILE_A= libluajit.a @@ -123,9 +123,9 @@ endif INSTALL_DEP= src/luajit -default all $(INSTALL_DEP): +default all $(INSTALL_DEP): tools @echo "==== Building LuaJIT $(VERSION) ====" - $(MAKE) -C src + $(MAKE) -C src -f Makefile.original @echo "==== Successfully built LuaJIT $(VERSION) ====" install: $(INSTALL_DEP) @@ -140,17 +140,17 @@ install: $(INSTALL_DEP) $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \ $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || : cd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN) - cd etc && $(SED_PC) $(FILE_PC) > $(FILE_PC).tmp && \ - $(INSTALL_F) $(FILE_PC).tmp $(INSTALL_PC) && \ - $(RM) $(FILE_PC).tmp + cd etc && $(SED_PC) $(FILE_PC).in > $(FILE_PC) && \ + $(INSTALL_F) $(FILE_PC) $(INSTALL_PC) && \ + $(RM) $(FILE_PC) cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC) cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB) cd tools/utils && $(INSTALL_F) $(FILES_UTILSLIB) $(INSTALL_UTILSLIB) cd tools/memprof && $(INSTALL_F) $(FILES_MEMPROFLIB) $(INSTALL_MEMPROFLIB) cd tools && $(INSTALL_F) $(FILES_TOOLSLIB) $(INSTALL_TOOLSLIB) - cd tools && $(SED_TMEMPROF) $(FILE_TMEMPROF) > $(FILE_TMEMPROF).tmp && \ - $(INSTALL_X) $(FILE_TMEMPROF).tmp $(INSTALL_TMEMPROF) && \ - $(RM) $(FILE_TMEMPROF).tmp + cd tools && $(SED_TMEMPROF) $(FILE_TMEMPROF).in > $(FILE_TMEMPROF) && \ + $(INSTALL_X) $(FILE_TMEMPROF) $(INSTALL_TMEMPROF) && \ + $(RM) $(FILE_TMEMPROF) @echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ====" @echo "" @echo "Note: the development releases deliberately do NOT install a symlink for luajit" @@ -185,13 +185,25 @@ uninstall: ############################################################################## -amalg: +amalg: tools @echo "Building LuaJIT $(VERSION)" - $(MAKE) -C src amalg + $(MAKE) -C src -f Makefile.original amalg clean: - $(MAKE) -C src clean + $(RM) tools/$(FILE_TMEMPROF) + $(MAKE) -C src -f Makefile.original clean -.PHONY: all install amalg clean +tools: tools/$(FILE_TMEMPROF) + +# FIXME: This is an ugly hack to manually configure an auxiliary +# tools/luajit-parse-memprof. I hope this file will have gone away +# in scope of https://github.com/tarantool/tarantool/issues/5688. +tools/$(FILE_TMEMPROF): + @sed -e "s|@LUAJIT_TOOLS_DIR@|$(realpath tools)|" \ + -e "s|@LUAJIT_TOOLS_BIN@|$(realpath src/luajit)|" \ + $@.in > $@ + @chmod +x $@ + +.PHONY: all install amalg clean tools ############################################################################## diff --git a/etc/luajit.pc b/etc/luajit.pc.in similarity index 91% rename from etc/luajit.pc rename to etc/luajit.pc.in index a78f174..f32385d 100644 --- a/etc/luajit.pc +++ b/etc/luajit.pc.in @@ -5,8 +5,8 @@ relver=0 version=${majver}.${minver}.${relver}-beta3 abiver=5.1 -prefix=/usr/local -multilib=lib +prefix=@LUAJIT_PC_PREFIX@ +multilib=@LUAJIT_PC_MULTILIB@ exec_prefix=${prefix} libdir=${exec_prefix}/${multilib} libname=luajit-${abiver} diff --git a/src/Makefile.dep b/src/Makefile.dep.original similarity index 100% rename from src/Makefile.dep rename to src/Makefile.dep.original diff --git a/src/Makefile b/src/Makefile.original similarity index 99% rename from src/Makefile rename to src/Makefile.original index 825b01c..502504c 100644 --- a/src/Makefile +++ b/src/Makefile.original @@ -624,7 +624,7 @@ depend: -e "s|^\([^l ]\)|host/\1|" \ -e "s| lj_target_\S*\.h| lj_target_*.h|g" \ -e "s| lj_emit_\S*\.h| lj_emit_*.h|g" \ - -e "s| lj_asm_\S*\.h| lj_asm_*.h|g" >Makefile.dep + -e "s| lj_asm_\S*\.h| lj_asm_*.h|g" >Makefile.dep.original @for file in $(ALL_HDRGEN); do \ test -s $$file || $(HOST_RM) $$file; \ done @@ -699,7 +699,7 @@ $(HOST_O): %.o: %.c $(E) "HOSTCC $@" $(Q)$(HOST_CC) $(HOST_ACFLAGS) -c -o $@ $< -include Makefile.dep +include Makefile.dep.original ############################################################################## # Target file rules. diff --git a/tools/luajit-parse-memprof b/tools/luajit-parse-memprof deleted file mode 100755 index c814301..0000000 --- a/tools/luajit-parse-memprof +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# -# Launcher for memprof parser. - -# This two variables are replaced on installing. -TOOL_DIR=$(dirname `readlink -f $0`) -LUAJIT_BIN=$TOOL_DIR/../src/luajit - -LUA_PATH="$TOOL_DIR/?.lua;;" $LUAJIT_BIN $TOOL_DIR/memprof.lua $@ diff --git a/tools/luajit-parse-memprof.in b/tools/luajit-parse-memprof.in new file mode 100644 index 0000000..8867202 --- /dev/null +++ b/tools/luajit-parse-memprof.in @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Launcher for memprof parser. + +LUA_PATH="@LUAJIT_TOOLS_DIR@/?.lua;;" \ + @LUAJIT_TOOLS_BIN@ @LUAJIT_TOOLS_DIR@/memprof.lua $@ -- 2.25.0