diff options
author | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-03-27 16:36:40 +0000 |
---|---|---|
committer | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-03-27 16:36:40 +0000 |
commit | 897d5c031c7081f704d91631db1143807c55caed (patch) | |
tree | b0f52ef021fec7484b4ce8fa7f85adfc7a50e3fc /Makefile | |
parent | c6b896c619f504caef69eeb03369c1d9e02f8fc2 (diff) | |
download | flashrom-897d5c031c7081f704d91631db1143807c55caed.tar.gz |
Add runtime and build environment info to the flashrom version message.
This patch uses code from Idwer Vollering and Maciej Pijanka.
I've added Makefile support and compiler version printing and
restructured the code heavily.
The code prints runtime system information and buildtime libpci
information (I couldn't find any runtime libpci version function). Due
to our ability to cross-compile flashrom, buildtime system information
from "uname -mrs" doesn't help diagnosing any problems. That's why only
libpci and gcc are buildtime info, and the rest is runtime info.
Examples:
openSUSE 10.3, i686, gcc 4.2.1, with PCI support:
flashrom v0.9.1-r971 on Linux 2.6.22.19-0.2-default (i686), built with
libpci 2.2.6, GCC 4.2.1 (SUSE Linux)
openSUSE 10.3, i686, llvm-clang-2.6.99svn97231, with PCI support:
flashrom v0.9.1-r971 on Linux 2.6.22.19-0.2-default (i686), built with
libpci 2.2.6, LLVM 1/clang 1
openSUSE 11.1, x86_64, gcc 4.3.2, with PCI support:
flashrom v0.9.1-r972 on Linux 2.6.27.29-0.1-default (x86_64), built with
libpci 3.0.1, GCC 4.3.2 [gcc-4_3-branch revision 141291]
openSUSE 10.3, i686, gcc 4.2.1, without PCI support:
flashrom v0.9.1-r971 on Linux 2.6.22.19-0.2-default (i686), built with
GCC 4.2.1 (SUSE Linux)
Windows/cygwin, i686, gcc 4.3.4, without PCI support:
flashrom v0.9.1-r973 on CYGWIN_NT-5.1 1.7.1(0.218/5/3) (i686), built
with GCC 4.3.4 20090804 (release) 1
FreeBSD 8.0, i386, gcc 4.2.1, with PCI support:
flashrom v0.9.1-r973 on FreeBSD 8.0-RELEASE-p2 (i386), built with libpci
3.1.7, GCC 4.2.1 20070719 [FreeBSD]
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Maciej Pijanka <maciej.pijanka@gmail.com>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@987 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -230,6 +230,8 @@ FEATURE_CFLAGS += -D'PRINT_WIKI_SUPPORT=1' CLI_OBJS += print_wiki.o endif +FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "UTSNAME := yes" .features && printf "%s" "-D'HAVE_UTSNAME=1'") + # We could use PULLED_IN_LIBS, but that would be ugly. FEATURE_LIBS += $(shell LC_ALL=C grep -q "NEEDLIBZ := yes" .libdeps && printf "%s" "-lz") @@ -308,12 +310,29 @@ features: compiler @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest $(FTDILIBS) $(LIBS) >/dev/null 2>&1 && \ ( echo "found."; echo "FTDISUPPORT := yes" >> .features.tmp ) || \ ( echo "not found."; echo "FTDISUPPORT := no" >> .features.tmp ) + @printf "Checking for utsname support... " + @$(shell ( echo "#include <sys/utsname.h>"; \ + echo "struct utsname osinfo;"; \ + echo "int main(int argc, char **argv)"; \ + echo "{ uname (&osinfo); return 0; }"; ) > .featuretest.c ) + @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest >/dev/null 2>&1 && \ + ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) || \ + ( echo "not found."; echo "UTSNAME := no" >> .features.tmp ) @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features @rm -f .featuretest.c .featuretest else features: compiler @echo "FEATURES := yes" > .features.tmp + @printf "Checking for utsname support... " + @$(shell ( echo "#include <sys/utsname.h>"; \ + echo "struct utsname osinfo;"; \ + echo "int main(int argc, char **argv)"; \ + echo "{ uname (&osinfo); return 0; }"; ) > .featuretest.c ) + @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest >/dev/null 2>&1 && \ + ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) || \ + ( echo "not found."; echo "UTSNAME := no" >> .features.tmp ) @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features + @rm -f .featuretest.c .featuretest endif install: $(PROGRAM) |