kconfig/lxdialog/check-lxdialog.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 14 16:21:07 2008 +0000 (2008-09-14)
changeset 850 ef8549b58b6f
parent 1 eeea35fbf182
child 1087 5be36a4b304d
permissions -rwxr-xr-x
Introduce a new EXPERIMENTAL feature: BARE_METAL.
This should ultimately llow to build bare-metal compilers, for targets that have no kernel and no C library.
Move the C library build script to their own sub-directory; introduce an empty build script for bare-metal.
Move the compiler build script to its own sub-directory.
Move the kernel build script to its own sub-directory; introduce an empty build script for bare-metal.
Update the ARM target tuples to enable bare-metal targets.
Add two ARM bare-metal samples.
Add latest Linux kernel versions.

/trunk/scripts/build/kernel/none.sh | 77 6 71 0 +----
/trunk/scripts/build/cc/gcc.sh | 58 41 17 0 ++-
/trunk/scripts/build/libc/none.sh | 513 9 504 0 +-----------------------------
/trunk/scripts/crosstool.sh | 17 9 8 0 +
/trunk/scripts/functions | 6 4 2 0 +
/trunk/scripts/showSamples.sh | 6 3 3 0
/trunk/samples/arm-unknown-elf/crosstool.config | 225 225 0 0 +++++++++++++
/trunk/samples/arm-unknown-eabi/crosstool.config | 223 223 0 0 +++++++++++++
/trunk/config/kernel/linux_headers_install.in | 64 27 37 0 ++--
/trunk/config/kernel.in | 9 8 1 0 +
/trunk/config/toolchain.in | 1 1 0 0 +
/trunk/config/cc/gcc.in | 3 3 0 0 +
/trunk/config/debug/dmalloc.in | 1 1 0 0 +
/trunk/config/debug/gdb.in | 4 3 1 0 +
/trunk/config/debug/strace.in | 1 1 0 0 +
/trunk/config/debug/duma.in | 1 1 0 0 +
/trunk/config/cc.in | 8 8 0 0 +
/trunk/config/target.in | 13 13 0 0 +
/trunk/config/binutils.in | 1 1 0 0 +
/trunk/config/gmp_mpfr.in | 1 1 0 0 +
/trunk/config/libc.in | 17 11 6 0 +
/trunk/arch/arm/functions | 3 1 2 0 -
22 files changed, 600 insertions(+), 652 deletions(-)
     1 #!/bin/sh
     2 # Check ncurses compatibility
     3 
     4 # What library to link
     5 ldflags()
     6 {
     7 	$cc -print-file-name=libncursesw.so | grep -q /
     8 	if [ $? -eq 0 ]; then
     9 		echo '-lncursesw'
    10 		exit
    11 	fi
    12 	$cc -print-file-name=libncurses.so | grep -q /
    13 	if [ $? -eq 0 ]; then
    14 		echo '-lncurses'
    15 		exit
    16 	fi
    17 	$cc -print-file-name=libcurses.so | grep -q /
    18 	if [ $? -eq 0 ]; then
    19 		echo '-lcurses'
    20 		exit
    21 	fi
    22 	exit 1
    23 }
    24 
    25 # Where is ncurses.h?
    26 ccflags()
    27 {
    28 	if [ -f /usr/include/ncurses/ncurses.h ]; then
    29 		echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
    30 	elif [ -f /usr/include/ncurses/curses.h ]; then
    31 		echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
    32 	elif [ -f /usr/include/ncurses.h ]; then
    33 		echo '-DCURSES_LOC="<ncurses.h>"'
    34 	else
    35 		echo '-DCURSES_LOC="<curses.h>"'
    36 	fi
    37 }
    38 
    39 # Temp file, try to clean up after us
    40 tmp=.lxdialog.tmp
    41 trap "rm -f $tmp" 0 1 2 3 15
    42 
    43 # Check if we can link to ncurses
    44 check() {
    45 	echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null
    46 	if [ $? -ne 0 ]; then
    47 		echo " *** Unable to find the ncurses libraries."          1>&2
    48 		echo " *** make menuconfig require the ncurses libraries"  1>&2
    49 		echo " *** "                                               1>&2
    50 		echo " *** Install ncurses (ncurses-devel) and try again"  1>&2
    51 		echo " *** "                                               1>&2
    52 		exit 1
    53 	fi
    54 }
    55 
    56 usage() {
    57 	printf "Usage: $0 [-check compiler options|-header|-library]\n"
    58 }
    59 
    60 if [ $# -eq 0 ]; then
    61 	usage
    62 	exit 1
    63 fi
    64 
    65 cc=""
    66 case "$1" in
    67 	"-check")
    68 		shift
    69 		cc="$@"
    70 		check
    71 		;;
    72 	"-ccflags")
    73 		ccflags
    74 		;;
    75 	"-ldflags")
    76 		shift
    77 		cc="$@"
    78 		ldflags
    79 		;;
    80 	"*")
    81 		usage
    82 		exit 1
    83 		;;
    84 esac