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
10 for i
in gcc g
++ cc c
++ c89 c99
; do
11 for dir
in ${PATH}; do
12 if [ -x "$dir/$i" ]; then
17 if [ ! -z "${CC}" ]; then
21 if [ -z "${CC}" ]; then
22 echo "Please set the CC environment variable to your C compiler";
27 STDDEFPATH
=`echo "#include <stddef.h>" | ${CC} -E - | grep stddef.h | head -n 1 | cut -d ' ' -f 3 | cut -d \" -f 2`
28 PRIVATE_INCDIR
=`dirname ${STDDEFPATH}`
29 PRIVATE_DIR
=`dirname ${PRIVATE_INCDIR}`
30 if [ -d "${PRIVATE_DIR}/lib" ]; then
31 PRIVATE_LIBDIR
=${PRIVATE_DIR}/lib
33 PRIVATE_LIBDIR
=${PRIVATE_DIR}
36 if [ ! -z "${PRIVATE_INCDIR}" ]; then
37 PRIVATE_PATHS
="${PRIVATE_PATHS} --gccincludedir=${PRIVATE_INCDIR}"
39 if [ ! -z "${PRIVATE_LIBDIR}" ]; then
40 PRIVATE_PATHS
="${PRIVATE_PATHS} --gcclibdir=${PRIVATE_LIBDIR}"
43 if [ ! -x bsconf
] ||
[ bsconf.c
-nt bsconf
] ||
[ bsconf.h
-nt bsconf
]; then
44 ${CC} -o bsconf bsconf.c
46 if [ -x bsconf
]; then
47 .
/bsconf
${PRIVATE_PATHS} $
*;
49 echo "Build of the configurator program failed. Ensure you have an ANSI C compiler.";