File: conf

package info (click to toggle)
sdcc 4.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 100,120 kB
  • sloc: ansic: 935,524; cpp: 75,055; makefile: 57,615; sh: 30,106; asm: 14,243; perl: 12,136; yacc: 7,297; lisp: 1,672; python: 815; lex: 781; awk: 498; sed: 89
file content (117 lines) | stat: -rwxr-xr-x 2,535 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash

[ -f Makefile ] && make distclean

TARGET=linux

PREFIX="${HOME}/local"
DD_HOSTS="p4 anb anb1 render mms box mazsola v3"
PERF_FLAG=""
OPT_FLAG="-O2"
COMP="no"

while [ -n "$1" ]; do
    case "$1" in
	-p)
	    PERF_FLAG="-pg"
	    ;;
	-d)
	    OPT_FLAG="-O0"
	    ;;
	-c)
	    COMP="yes"
	    ;;
	[lLxX]*) TARGET=linux;;
	[mMwW]6*) TARGET=w64;;
	[mMwW]*) TARGET=mingw;;
	*) echo "Unknown target \"${1}\"" >&2; exit 1;;
    esac
    shift
done

#if [ -f devel ]; then
#    export CXXFLAGS="-O0"
#    export CFLAGS="-g -O0"
#fi

export CXXFLAGS="-g $OPT_FLAG $PERF_FLAG"
export CFLAGS="-g $OPT_FLAG $PERF_FLAG"

#if [ -n "$PERF_FLAG" ]; then
#    CXXFLAGS="${CXXFLAGS} ${PERF_FLAG}"
#    CFLAGS="${CFLAGS} ${PERF_FLAG}"
#fi

case $TARGET in
    linux|l)
	if echo $DD_HOSTS|grep $(hostname) >/dev/null 2>&1 ; then
	    export PREFIX='/usr/local'
	fi
	./configure --prefix=${PREFIX} \
	    --disable-dlso \
	    --enable-serio \
	    --enable-avr-port \
	    --enable-z80-port \
	    --enable-xa-port \
	    --enable-stm8-port \
	    --enable-st7-port \
	    "$@"
	#--enable-ucsim
	;;
    mingw|win|w)
	if [ -d	/usr/local/cross-tools/mingw32 ] ; then
	    export CC=/usr/local/cross-tools/mingw32/bin/gcc
	    export CXX=/usr/local/cross-tools/mingw32/bin/g++
	else
	#if echo $DD_HOSTS|grep $(hostname) >/dev/null 2>&1; then
	    export CC=i686-w64-mingw32-gcc
	    export CXX=i686-w64-mingw32-g++
	    export HOST_OPT='--host=i686-w64-mingw32'
	    export LDFLAGS='-static-libgcc -static-libstdc++'
	    export PREFIX='/usr/local'
	fi
	echo CC=$CC CXX=$CXX HOST=$HOST_OPT
	./configure --prefix=${PREFIX} \
	    --disable-dlso \
	    --disable-serio \
	    --enable-avr-port \
	    --enable-z80-port \
	    --enable-xa-port \
	    --enable-stm8-port \
	    --enable-st7-port \
	    $HOST_OPT "$@"
	#--enable-ucsim
	;;
    w64)
	export CC=x86_64-w64-mingw32-gcc
	export CXX=x86_64-w64-mingw32-g++
	export HOST_OPT='--host=x86_64-w64-mingw32'
	export LDFLAGS='-static-libgcc -static-libstdc++'
	export PREFIX='/usr/local'
	echo CC=$CC CXX=$CXX HOST=$HOST_OPT
	./configure --prefix=${PREFIX} \
	    --disable-dlso \
	    --disable-serio \
	    --enable-avr-port \
	    --enable-z80-port \
	    --enable-xa-port \
	    --enable-stm8-port \
	    --enable-st7-port \
	    $HOST_OPT "$@"
	#--enable-ucsim
	;;
    *)
	echo >&2 "Do not know how to configure!"
	;;
esac

if [ "$COMP" = "yes" ]; then
    make clean
    make
    cd s51.src;make;cd ..
    if [ -n "$PERF_FLAG" ]; then
	mv s51.src/s51 s51.src/s51p
    fi
fi

# End of conf