]> sigrok.org Git - libserialport.git/commitdiff
configure summary: Show compiler version and flags.
authorUwe Hermann <redacted>
Sun, 5 Mar 2017 16:01:17 +0000 (17:01 +0100)
committerUwe Hermann <redacted>
Sun, 5 Mar 2017 16:01:17 +0000 (17:01 +0100)
configure.ac

index 90ea1d8f6e519b3086569038e2a86a57303fb58b..8dded7142e087f003c4593dc5a6a552b6f7d9b46 100644 (file)
@@ -50,6 +50,19 @@ AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_LN_S
 
+## SP_PROG_VERSION(program, sh-var)
+## Obtain the version of <program> and store it in <sh-var>.
+AC_DEFUN([SP_PROG_VERSION],
+[dnl
+m4_assert([$# >= 2])[]dnl
+sp_prog_ver=`$1 --version 2>&AS_MESSAGE_LOG_FD | sed 1q 2>&AS_MESSAGE_LOG_FD`
+AS_CASE([[$]?:$sp_prog_ver],
+        [[0:*[0-9].[0-9]*]], [$2=$sp_prog_ver],
+        [$2=unknown])[]dnl
+])
+
+SP_PROG_VERSION([$CC], [sp_cc_version])
+
 # Initialize libtool.
 LT_INIT
 
@@ -145,4 +158,10 @@ libserialport configuration summary:
  - Building for.................... $host
  - Building shared / static........ $enable_shared / $enable_static
 
+Compile configuration:
+ - C compiler...................... $CC
+ - C compiler version.............. $sp_cc_version
+ - C compiler flags................ $CFLAGS
+ - Linker flags.................... $LDFLAGS
+
 _EOF