view configure @ 565:1dadc72cb41f

Add a Makefile with some make/* wrappers, for UI reasons. Remove CC_CRTDIR and move CC_LIBPATH to make/make.sh and explain why (it can still be overridden from configure). Only source ./configure once in make/make.sh so "make native" works (on a platform where you can make that target, anyway).
author Rob Landley <rob@landley.net>
date Tue, 11 Mar 2008 23:51:35 -0500
parents 756927e16211
children c42c2145d359
line wrap: on
line source

#!/bin/bash

# Set lots of environment variables to default values.  All of these are
# overridden by existing local variables, if any.

# You don't have to run ./configure before running make, since make/make.sh
# sources this file, but it shouldn't hurt anything if you do.

[ -z "$CC" ] && CC=cc
[ -z "$AR" ] && AR=ar
[ -z "$STRIP" ] && STRIP=strip
[ -z "$LIBSUF" ] && LIBSUF=.a
[ -z "$EXESUF" ] && EXESUF=
[ -z "$CFLAGS" ] && CFLAGS="-g -Wall -fsigned-char -Os -fno-strict-aliasing"
[ -z "$LIBS" ] && LIBS="-lm -ldl"
[ -z "$HOST" ] && HOST=$(uname -m | sed 's/i.86/i686/')
[ -z "$PREFIX" ] && PREFIX=/usr/local

# Set the compiler's search/install paths.

# Directory for tinycc's own libraries (such as libtinyccrt-$ARCH.a)
# and headers (such as stdarg.h)
[ -z "$TINYCC_INSTALLDIR" ] && TINYCC_INSTALLDIR="$PREFIX"/tinycc
# Path to search for system #include files.
[ -z "$CC_HEADERPATH" ] && CC_HEADERPATH="/usr/include:/usr/local/include"

# CC_LIBPATH is set in make/make.sh because it varies by target (such as
# building for i386 on an x86_64 host).  You can set CC_LIBPATH here if you
# want to, but then it won't vary by target because we don't know what the
# target _is_ yet.
#
# # Path to search for system libraries.
#
# [ -z "$CC_LIBPATH" ] && CC_LIBPATH="/usr/local/lib:/usr/lib:/lib"

# For ./configure -v display all the variables we just set.

if [ "$1" == "-v" ]
then
  for i in CC AR STRIP LIBSUF EXESUF CFLAGS LIBS HOST PREFIX TINYCC_INSTALLDIR CC_CRTDIR CC_LIBPATH CC_HEADERPATH TARGET
  do
    echo -n "$i="
    eval 'echo "$'$i'"'
  done
fi