unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] configure: detect version by compiler for build
@ 2020-07-27 15:41 Đoàn Trần Công Danh
  2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-27 15:41 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

We'll need to run the compiled binary to report our current version.

With the same code base, we should have the same version information
regardless of compiler and architecture.

Let's use the compiler for building architecture to build the reporting
binary. Which is usually reported under variable CC_FOR_BUILD,
a convention established by GNU Autotools, and fall back to CC if it's
not defined.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 98f5f1ea..db3538b3 100755
--- a/configure
+++ b/configure
@@ -85,8 +85,10 @@ fi
 BASHCMD=${BASHCMD:-bash}
 PERL=${PERL:-perl}
 CC=${CC:-cc}
+CC_FOR_BUILD=${CC_FOR_BUILD:-$CC}
 CXX=${CXX:-c++}
 CFLAGS=${CFLAGS:--g -O2}
+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-$CFLAGS}
 CPPFLAGS=${CPPFLAGS:-}
 CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
@@ -410,7 +412,7 @@ int main(void) {
     return 0;
 }
 EOF
-if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
+if ${CC_FOR_BUILD} ${CFLAGS_FOR_BUILD} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
        && ./_libversion > _libversion.sh && . ./_libversion.sh
 then
     printf "OK.\n"
-- 
2.28.0.rc2.21.g5c06d60fc5\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-08-08 19:15 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
2020-07-27 17:37   ` Tomi Ollila
2020-07-28  0:28     ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
2020-07-27 15:41 ` [PATCH] configure: drop check for default xapian backend Đoàn Trần Công Danh
2020-07-28 11:17   ` David Bremner
2020-07-28 13:36     ` Đoàn Trần Công Danh
2020-07-30  0:05       ` David Bremner
2020-07-31 13:49         ` Đoàn Trần Công Danh
2020-07-31 14:41           ` David Bremner
2020-07-27 15:41 ` [PATCH] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
2020-07-27 17:00   ` Đoàn Trần Công Danh
2020-07-27 17:40   ` Tomi Ollila
2020-07-27 23:42     ` Đoàn Trần Công Danh
2020-07-27 17:31 ` [PATCH] configure: detect version by compiler for build Tomi Ollila
2020-07-28  0:18   ` Đoàn Trần Công Danh
2020-07-28 11:25     ` David Bremner
2020-07-28 13:43       ` Đoàn Trần Công Danh
2020-08-03 15:40 ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
2020-08-07 17:12   ` Tomi Ollila
2020-08-08 19:14     ` David Bremner
2020-08-03 15:40 ` [PATCH v2] configure: drop check for default xapian backend Đoàn Trần Công Danh
2020-08-03 15:40 ` [PATCH v2] T355: specify hash algorithm explicitly Đoàn Trần Công Danh

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).