-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure
executable file
·134 lines (107 loc) · 2.54 KB
/
configure
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/sh
####################
# DEFAULTS
####################
PREFIX=/usr
INCDIR=include
BINDIR=bin
LIBDIR=lib
INCOUT=csp.h
LIBOUT=libcsp.so
EXEOUT=ccod
LFLAGS="-shared -Wl,-soname,$LIBOUT"
CFLAGS="-O2 -fPIC"
LIBSTA="*.a"
#echo "stripped down configure script"
####################
# ANTI NEWLINE VAR
####################
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ;;
*c*,* ) ECHO_N=-n ECHO_C= ;;
*) ECHO_N= ECHO_C='\c' ;;
esac
####################
# HOST TYPE
####################
echo $ECHO_N "checking host system type... "
platform=`(uname -s) 2> /dev/null`
echo $platform
####################
# SOFTWARE PACKAGE
####################
echo $ECHO_N "checking package name... "
hdr="ccod.c"
if test ! -r "$hdr"; then
echo "ERROR: '$hdr' does not exist, or is not readable."
exit 1
fi
MAJOR_VERSION="`sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' $hdr`"
MINOR_VERSION="`sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' $hdr`"
MICRO_VERSION="`sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' $hdr`"
PACKAG="ccod-`echo $ECHO_N "$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$ECHO_C"`"
echo $PACKAG
####################
# MAKEFILE
####################
echo "configure: creating Makefile"
echo $ECHO_N "" > Makefile
####################
# for MINGW
####################
if [ "`echo $platform | grep 'MINGW'`" != "" ]
then
PREFIX=/mingw
BINDIR=bin
LIBDIR=bin
LIBOUT=libcsp.dll
EXEOUT=ccod.exe
CFLAGS="-O2 -fPIC"
LFLAGS="-shared -Wl,-soname,$LIBOUT"
fi
####################
# for CYGWIN
####################
if [ "`echo $platform | grep 'CYGWIN'`" != "" ]
then
BINDIR=bin
LIBOUT=libcsp.dll
EXEOUT=ccod.exe
CFLAGS="-O2 -fPIC"
LFLAGS="-shared -Wl,-soname,$LIBOUT"
fi
####################
# for DARWIN
####################
if [ "`echo $platform | grep 'Darwin'`" != "" ]
then
LFLAGS="-dynamiclib"
LIBOUT=libcsp.dylib
CFLAGS="-O2 -fno-common -fPIC"
fi
####################
# for LINUX
####################
if [ "`echo $platform | grep 'Linux'`" != "" ]
then
:
#LFLAGS="-dynamiclib"
#LIBOUT=libcsp.dylib
#CFLAGS="-O2 -fPIC"
fi
####################
# for EVERYONE ELSE
####################
echo "PREFIX = $PREFIX" >> Makefile
echo "INCDIR = $INCDIR" >> Makefile
echo "BINDIR = $BINDIR" >> Makefile
echo "LIBDIR = $LIBDIR" >> Makefile
echo "INCOUT = $INCOUT" >> Makefile
echo "LIBOUT = $LIBOUT" >> Makefile
echo "EXEOUT = $EXEOUT" >> Makefile
echo "PACKAG = $PACKAG" >> Makefile
echo "LFLAGS = $LFLAGS" >> Makefile
echo "CFLAGS = $CFLAGS" >> Makefile
echo "LIBSTA = $LIBSTA" >> Makefile
cat Makefile.in >> Makefile