/[axel]/trunk/configure
ViewVC logotype

Contents of /trunk/configure

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations) (download)
Fri Jan 11 11:57:58 2008 UTC (5 years, 4 months ago) by appaji-guest
File size: 5941 byte(s)
Import 1.0a
1 #!/bin/sh
2
3 ###########################
4 ## Configurer for Axel ##
5 ## ##
6 ## Copyright 2001 Lintux ##
7 ###########################
8
9 prefix='/usr/local'
10 bindir='$prefix/bin'
11 etcdir='$prefix/etc'
12 mandir='$prefix/share/man'
13 locale='$prefix/share/locale'
14
15 i18n=0
16 debug=0
17 strip=1
18
19 arch=`uname -s`
20
21 while [ -n "$1" ]; do
22 e="`expr "$1" : '--\(.*=.*\)'`"
23 if [ -z "$e" ]; then
24 cat<<EOF
25 Axel configure
26
27 Usage: $0 [OPTIONS]
28
29 Option Description Default
30
31 --prefix=... Directories to put files in $prefix
32 --bindir=... $bindir
33 --etcdir=... $etcdir
34 --mandir=... $mandir
35 --locale=... $locale
36
37 --i18n=0/1 Disable/enable internationalization $i18n
38 --debug=0/1 Disable/enable debugging $debug
39 --strip=0/1 Disable/enable binary stripping $strip
40 EOF
41 exit;
42 fi
43 eval "$e"
44 shift;
45 done
46
47 # Expand $prefix
48 bindir=`eval echo $bindir`
49 etcdir=`eval echo $etcdir`
50 mandir=`eval echo $mandir`
51 locale=`eval echo $locale`
52
53 cat<<EOF>Makefile.settings
54 ## Axel settings, generated by configure
55 PREFIX=$prefix
56 BINDIR=$bindir
57 ETCDIR=$etcdir
58 MANDIR=$mandir
59 LOCALE=$locale
60
61 OUTFILE=axel
62 ARCH=$arch
63
64 DESTDIR=
65 LFLAGS=
66
67 EOF
68
69 cat<<EOF>config.h
70 /* Axel settings, generated by configure */
71 #define _REENTRANT
72 #define _THREAD_SAFE
73 #define ETCDIR "$etcdir"
74 #define LOCALE "$locale"
75 #define ARCH "$arch"
76
77 EOF
78
79 if [ "$i18n" = "1" ]; then
80 if type msgfmt > /dev/null 2> /dev/null; then :;else
81 echo 'WARNING: Internationalization disabled, you don'\''t have the necessary files'
82 echo ' installed.'
83 echo ''
84 i18n=0;
85 fi;
86 fi
87
88 if [ "$debug" = "1" ]; then
89 echo 'CFLAGS=-g' >> Makefile.settings
90 echo 'DEBUG=1' >> Makefile.settings
91 echo '#define DEBUG' >> config.h;
92 else
93 echo 'CFLAGS=-O3' >> Makefile.settings;
94 fi
95
96 if [ "$i18n" = "1" ]; then
97 echo 'I18N=1' >> Makefile.settings
98 echo '#define I18N' >> config.h
99 if cat /usr/local/include/libintl.h > /dev/null 2> /dev/null; then
100 echo 'CFLAGS+=-I/usr/local/include' >> Makefile.settings
101 echo 'LFLAGS+=-L/usr/local/lib' >> Makefile.settings;
102 fi;
103 fi
104
105 if type gcc > /dev/null 2> /dev/null; then
106 echo "CC=gcc" >> Makefile.settings;
107 elif type cc > /dev/null 2> /dev/null; then
108 echo "CC=cc" >> Makefile.settings;
109 else
110 echo 'Cannot find a C compiler, aborting.'
111 exit 1;
112 fi
113
114 if [ "$strip" = 0 ]; then
115 echo "STRIP=\# skip strip" >> Makefile.settings;
116 else
117 echo 'The strip option is enabled. This should not be a problem usually, but on some'
118 echo 'systems it breaks stuff.'
119 echo
120 if [ "$debug" = 1 ]; then
121 echo 'Stripping binaries does not make sense when debugging. Stripping disabled.'
122 echo
123 echo 'STRIP=\# skip strip' >> Makefile.settings
124 strip=0;
125 elif type strip > /dev/null 2> /dev/null; then
126 echo "STRIP=strip" >> Makefile.settings;
127 elif /bin/test -x /usr/ccs/bin/strip; then
128 echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
129 else
130 echo 'No strip utility found, cannot remove unnecessary parts from executable.'
131 echo ''
132 echo 'STRIP=\# skip strip' >> Makefile.settings
133 strip=0;
134 fi;
135 fi
136
137 case "$arch" in
138 FreeBSD )
139 echo '#define NOGETOPTLONG' >> config.h
140 echo 'LFLAGS+=-pthread' >> Makefile.settings
141 if [ "$i18n" = "1" ]; then
142 echo 'LFLAGS+=-lintl' >> Makefile.settings;
143 fi
144 echo 'Please keep in mind that you need GNU make to make Axel!'
145 echo ''
146 ;;
147 OpenBSD )
148 echo '#define NOGETOPTLONG' >> config.h
149 echo 'LFLAGS+=-pthread' >> Makefile.settings
150 if [ "$i18n" = "1" ]; then
151 echo 'LFLAGS+=-lintl' >> Makefile.settings;
152 fi
153 echo 'Please keep in mind that you need GNU make to make Axel!'
154 echo ''
155 ;;
156 NetBSD )
157 echo 'WARNING: NetBSD not tested! Using OpenBSD settings.'
158 echo ' Please send me your results so I can update this!'
159 echo ''
160 echo '#define NOGETOPTLONG' >> config.h
161 echo 'LFLAGS+=-lpthread' >> Makefile.settings
162 if [ "$i18n" = "1" ]; then
163 echo 'LFLAGS+=-lintl' >> Makefile.settings;
164 fi
165 echo 'Please keep in mind that you need GNU make to make Axel!'
166 echo ''
167 ;;
168 Darwin )
169 echo '#define NOGETOPTLONG' >> config.h
170 echo 'LFLAGS+=-lpthread' >> Makefile.settings
171 if [ "$i18n" = "1" ]; then
172 echo 'LFLAGS+=-lintl' >> Makefile.settings;
173 fi
174 echo '#define DARWIN' >> config.h
175 echo 'Please keep in mind that you need GNU make to make Axel!'
176 echo ''
177 ;;
178 AtheOS | atheos )
179 echo 'If you want to run Axel on AtheOS, please use an older non-threaded version.'
180 echo 'This version still needs some changes to support the AtheOS threads.'
181 echo ''
182 echo 'Axel 0.96b can be downloaded from http://www.lintux.cx/axel.html'
183 exit 1
184 ;;
185 Linux )
186 echo 'LFLAGS+=-lpthread' >> Makefile.settings
187 ;;
188 SunOS )
189 echo '#define NOGETOPTLONG' >> config.h
190 echo '#define BSD_COMP' >> config.h
191 echo 'LFLAGS+=-lpthread -lsocket -lnsl' >> Makefile.settings
192 if [ "$i18n" = "1" ]; then
193 echo 'LFLAGS+=-lintl' >> Makefile.settings;
194 fi
195 echo 'Please keep in mind that you need GNU make to make Axel!'
196 echo ''
197 ;;
198 CYGWIN_* )
199 echo 'LFLAGS+=-lpthread' >> Makefile.settings
200 if [ "$i18n" = "1" ]; then
201 echo 'LFLAGS+=-lintl' >> Makefile.settings;
202 fi
203 echo 'OUTFILE=axel.exe' >> Makefile.settings
204 ;;
205 * )
206 echo 'LFLAGS+=-lpthread' >> Makefile.settings
207 echo '#define NOGETOPTLONG' >> config.h
208 if [ "$i18n" = "1" ]; then
209 echo 'LFLAGS+=-lintl' >> Makefile.settings;
210 fi
211 echo 'WARNING: This architecture is unknown!'
212 echo ''
213 echo 'That does not mean Axel will not work, it just means I'\''ve never had the chance'
214 echo 'to test Axel on it. It'\''d be a great help if you could send me more information'
215 echo 'about your platform so I can add it to the build tools.'
216 echo 'You can try to build the program now, if you wish, this default setup might'
217 echo 'just work.'
218 echo ''
219 ;;
220 esac
221
222 echo 'Configuration done:'
223 if [ "$i18n" = "1" ]; then
224 echo ' Internationalization enabled.';
225 else
226 echo ' Internationalization disabled.';
227 fi
228 if [ "$debug" = "1" ]; then
229 echo ' Debugging enabled.';
230 else
231 echo ' Debugging disabled.';
232 fi
233 if [ "$strip" = "1" ]; then
234 echo ' Binary stripping enabled.';
235 else
236 echo ' Binary stripping disabled.';
237 fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5