detect TK1

Is there a way to detect that a script is running on l4t or that a proc is not x86 or x64 but TK1 ARM based?

I have QtCreator pro scripts and Lua files that I need to add instructions for correct compile instructions on different platforms and I try to figure out how to tell that it’s on TK1 ssytem rather than a normal Linux x86.

uname -p (same with -m and -i)
will return arm7l so it’s a start

Specifically tell its a TK1? No idea on that one, but you can detect its arm7l.
some if statements as simple as this should work… (this is from a makefile, mind you)

uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(uname_S),Linux)
	uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
	ifeq ($(uname_M),x86_64)
		our_target := x86_64-linux
	else ifeq ($(uname_M),i386)
		our_target := i386-linux
	else ifeq ($(uname_M),i486)
		our_target := i386-linux
	else ifeq ($(uname_M),i586)
		our_target := i386-linux
	else ifeq ($(uname_M),i686)
		our_target := i386-linux
	else ifeq ($(uname_M),armv7l)
 		our_target := arm7l-linux
	else
		our_target := unknown
	endif
else
	our_target := unknown
endif

then some case statements to execute the correct compiler code…

i386-linux:
	$(MAKE) recursive_build platform="i386-linux" widgetset="gtk2" platform_flags="-Tlinux -Pi386 -dUseCThreads -dStaticFFI"

-m or -p for uname /should/ return the same. so its your preference.

ubuntu@tegra-ubuntu:~$ cat /proc/cpuinfo | grep Hardware
Hardware : jetson-tk1

ubuntu@tegra-ubuntu:~$ glxinfo | grep renderer
OpenGL renderer string: GK20A/AXI #detect Kepler GPU

ubuntu@tegra-ubuntu:~$ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc0f
CPU revision : 3

processor : 1
model name : ARMv7 Processor rev 3 (v7l)
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc0f
CPU revision : 3

processor : 2
model name : ARMv7 Processor rev 3 (v7l)
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc0f
CPU revision : 3

processor : 3
model name : ARMv7 Processor rev 3 (v7l)
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc0f
CPU revision : 3

Hardware : jetson-tk1
Revision : 0000
Serial : 0177000003450000
Processor : ARMv7 Processor rev 3 (v7l)