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 for i
in gcc g
++ cc c
++ c89 c99
; do
9 CC
=`which $i 2> /dev/null` && break;
13 echo "No C compiler found" && exit;
16 PSTDDEF
=`echo "#include <stddef.h>"|$CC -E -|grep stddef.h|head -n1|cut -d' ' -f3|cut -d\" -f2`
17 PINCDIR
=`dirname $PSTDDEF`
18 PLIBDIR
=`dirname $PINCDIR`
19 if [ -d $PLIBDIR/lib
]; then
22 if [ ! -z "$PINCDIR" ]; then
23 PPATHS
="$PPATHS --gccincludedir=$PINCDIR"
25 if [ ! -z "$PLIBDIR" ]; then
26 PPATHS
="$PPATHS --gcclibdir=$PLIBDIR"
28 if [ ! -x bsconf
-o bsconf.c
-nt bsconf
-o bsconf.h
-nt bsconf
]; then
29 $CC -o bsconf bsconf.c
31 if [ -x bsconf
]; then
34 echo "Configurator build failed";