Mercurial > hg > tinycc
comparison 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 |
comparison
equal
deleted
inserted
replaced
564:d89a6822b7e0 | 565:1dadc72cb41f |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Set lots of environment variables to default values. All of these are | 3 # Set lots of environment variables to default values. All of these are |
4 # overridden by existing local variables. | 4 # overridden by existing local variables, if any. |
5 | |
6 # You don't have to run ./configure before running make, since make/make.sh | |
7 # sources this file, but it shouldn't hurt anything if you do. | |
5 | 8 |
6 [ -z "$CC" ] && CC=cc | 9 [ -z "$CC" ] && CC=cc |
7 [ -z "$AR" ] && AR=ar | 10 [ -z "$AR" ] && AR=ar |
8 [ -z "$STRIP" ] && STRIP=strip | 11 [ -z "$STRIP" ] && STRIP=strip |
9 [ -z "$LIBSUF" ] && LIBSUF=.a | 12 [ -z "$LIBSUF" ] && LIBSUF=.a |
11 [ -z "$CFLAGS" ] && CFLAGS="-g -Wall -fsigned-char -Os -fno-strict-aliasing" | 14 [ -z "$CFLAGS" ] && CFLAGS="-g -Wall -fsigned-char -Os -fno-strict-aliasing" |
12 [ -z "$LIBS" ] && LIBS="-lm -ldl" | 15 [ -z "$LIBS" ] && LIBS="-lm -ldl" |
13 [ -z "$HOST" ] && HOST=$(uname -m | sed 's/i.86/i686/') | 16 [ -z "$HOST" ] && HOST=$(uname -m | sed 's/i.86/i686/') |
14 [ -z "$PREFIX" ] && PREFIX=/usr/local | 17 [ -z "$PREFIX" ] && PREFIX=/usr/local |
15 | 18 |
16 | |
17 | |
18 # Set the compiler's search/install paths. | 19 # Set the compiler's search/install paths. |
19 | 20 |
20 # i386 runs on an x86-64 host, but the library paths are abnormal. | 21 # Directory for tinycc's own libraries (such as libtinyccrt-$ARCH.a) |
21 | 22 # and headers (such as stdarg.h) |
22 LIB="lib" | |
23 [ "$HOST" == "x86_64" ] && [ TARGET="i386" ] && LIB="lib32" | |
24 | |
25 # Directory for tinycc libraries (such as libtinycc.a) and headers (stdarg.h) | |
26 [ -z "$TINYCC_INSTALLDIR" ] && TINYCC_INSTALLDIR="$PREFIX"/tinycc | 23 [ -z "$TINYCC_INSTALLDIR" ] && TINYCC_INSTALLDIR="$PREFIX"/tinycc |
27 # Where should the linker look for C runtime files (crt1.o, crti.o, crtn.o) | |
28 [ -z "$CC_CRTDIR" ] && CC_CRTDIR="/usr/$LIB" | |
29 # Path to search for system libraries. | |
30 [ -z "$CC_LIBPATH" ] && CC_LIBPATH="/usr/local/$LIB:/usr/$LIB:/$LIB" | |
31 # Path to search for system #include files. | 24 # Path to search for system #include files. |
32 [ -z "$CC_HEADERPATH" ] && CC_HEADERPATH="/usr/include:/usr/local/include" | 25 [ -z "$CC_HEADERPATH" ] && CC_HEADERPATH="/usr/include:/usr/local/include" |
26 | |
27 # CC_LIBPATH is set in make/make.sh because it varies by target (such as | |
28 # building for i386 on an x86_64 host). You can set CC_LIBPATH here if you | |
29 # want to, but then it won't vary by target because we don't know what the | |
30 # target _is_ yet. | |
31 # | |
32 # # Path to search for system libraries. | |
33 # | |
34 # [ -z "$CC_LIBPATH" ] && CC_LIBPATH="/usr/local/lib:/usr/lib:/lib" | |
33 | 35 |
34 # For ./configure -v display all the variables we just set. | 36 # For ./configure -v display all the variables we just set. |
35 | 37 |
36 if [ "$1" == "-v" ] | 38 if [ "$1" == "-v" ] |
37 then | 39 then |