Show cursor on exit
[utui.git] / configure
blob0fd3d9d497cc666ac13d14d2eb25346bc84d5a2b
1 #! /bin/bash
3 # This file is part of bsconf - a configure replacement.
4 # Copyright (C) 2005 by Mike Sharov <msharov@users.sourceforge.net>
5 # This file is free software, distributed under the MIT License.
8 if [ -z "$CC" ]; then
9 for i in gcc g++ cc c++ c89 c99; do
10 CC=`which $i 2> /dev/null` && break;
11 done;
12 if [ -z "$CC" ]; then
13 echo "Please set the CC environment variable to your C compiler" && exit;
17 STDDEFPATH=`echo "#include <stddef.h>" | $CC -E - | grep stddef.h | head -n 1 | cut -d ' ' -f 3 | cut -d \" -f 2`
18 PRIVATE_INCDIR=`dirname $STDDEFPATH`
19 PRIVATE_DIR=`dirname $PRIVATE_INCDIR`
20 PRIVATE_LIBDIR=$PRIVATE_DIR
21 if [ -d "$PRIVATE_DIR/lib" ]; then
22 PRIVATE_LIBDIR=${PRIVATE_DIR}/lib
24 if [ ! -z "$PRIVATE_INCDIR" ]; then
25 PRIVATE_PATHS="$PRIVATE_PATHS --gccincludedir=$PRIVATE_INCDIR"
27 if [ ! -z "$PRIVATE_LIBDIR" ]; then
28 PRIVATE_PATHS="$PRIVATE_PATHS --gcclibdir=$PRIVATE_LIBDIR"
30 if [ ! -x bsconf -o bsconf.c -nt bsconf -o bsconf.h -nt bsconf ]; then
31 $CC -o bsconf bsconf.c
33 if [ -x bsconf ]; then
34 ./bsconf $PRIVATE_PATHS $*;
35 else
36 echo "Build of the configurator program failed. Ensure you have an ANSI C compiler.";