/[axel]/tags/2.1/configure
ViewVC logotype

Contents of /tags/2.1/configure

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (show annotations) (download)
Wed Jan 16 08:17:48 2008 UTC (5 years, 4 months ago) by appaji-guest
Original Path: trunk/configure
File size: 5907 byte(s)
Compilation for GNU/kFreeBSD, thanks to Cyril Brulebois
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 echo 'CFLAGS=-g' >> Makefile.settings
89 if [ "$debug" = "1" ]; then
90 echo 'DEBUG=1' >> Makefile.settings
91 echo '#define DEBUG' >> config.h;
92 fi
93
94 if [ "$i18n" = "1" ]; then
95 echo 'I18N=1' >> Makefile.settings
96 echo '#define I18N' >> config.h
97 if cat /usr/local/include/libintl.h > /dev/null 2> /dev/null; then
98 echo 'CFLAGS+=-I/usr/local/include' >> Makefile.settings
99 echo 'LFLAGS+=-L/usr/local/lib' >> Makefile.settings;
100 fi;
101 fi
102
103 if type gcc > /dev/null 2> /dev/null; then
104 echo "CC=gcc" >> Makefile.settings;
105 elif type cc > /dev/null 2> /dev/null; then
106 echo "CC=cc" >> Makefile.settings;
107 else
108 echo 'Cannot find a C compiler, aborting.'
109 exit 1;
110 fi
111
112 if [ "$strip" = 0 ]; then
113 echo "STRIP=\# skip strip" >> Makefile.settings;
114 else
115 echo 'The strip option is enabled. This should not be a problem usually, but on some'
116 echo 'systems it breaks stuff.'
117 echo
118 if [ "$debug" = 1 ]; then
119 echo 'Stripping binaries does not make sense when debugging. Stripping disabled.'
120 echo
121 echo 'STRIP=\# skip strip' >> Makefile.settings
122 strip=0;
123 elif type strip > /dev/null 2> /dev/null; then
124 echo "STRIP=strip" >> Makefile.settings;
125 elif /bin/test -x /usr/ccs/bin/strip; then
126 echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
127 else
128 echo 'No strip utility found, cannot remove unnecessary parts from executable.'
129 echo ''
130 echo 'STRIP=\# skip strip' >> Makefile.settings
131 strip=0;
132 fi;
133 fi
134
135 case "$arch" in
136 FreeBSD )
137 echo '#define NOGETOPTLONG' >> config.h
138 echo 'LFLAGS+=-pthread' >> Makefile.settings
139 if [ "$i18n" = "1" ]; then
140 echo 'LFLAGS+=-lintl' >> Makefile.settings;
141 fi
142 echo 'Please keep in mind that you need GNU make to make Axel!'
143 echo ''
144 ;;
145 OpenBSD )
146 echo '#define NOGETOPTLONG' >> config.h
147 echo 'LFLAGS+=-pthread' >> Makefile.settings
148 if [ "$i18n" = "1" ]; then
149 echo 'LFLAGS+=-lintl' >> Makefile.settings;
150 fi
151 echo 'Please keep in mind that you need GNU make to make Axel!'
152 echo ''
153 ;;
154 NetBSD )
155 echo 'WARNING: NetBSD not tested! Using OpenBSD settings.'
156 echo ' Please send me your results so I can update this!'
157 echo ''
158 echo '#define NOGETOPTLONG' >> config.h
159 echo 'LFLAGS+=-pthread' >> Makefile.settings
160 if [ "$i18n" = "1" ]; then
161 echo 'LFLAGS+=-lintl' >> Makefile.settings;
162 fi
163 echo 'Please keep in mind that you need GNU make to make Axel!'
164 echo ''
165 ;;
166 Darwin )
167 echo '#define NOGETOPTLONG' >> config.h
168 echo 'LFLAGS+=-lpthread' >> Makefile.settings
169 if [ "$i18n" = "1" ]; then
170 echo 'LFLAGS+=-lintl' >> Makefile.settings;
171 fi
172 echo '#define DARWIN' >> config.h
173 echo 'Please keep in mind that you need GNU make to make Axel!'
174 echo ''
175 ;;
176 AtheOS | atheos )
177 echo 'If you want to run Axel on AtheOS, please use an older non-threaded version.'
178 echo 'This version still needs some changes to support the AtheOS threads.'
179 echo ''
180 echo 'Axel 0.96b can be downloaded from http://www.lintux.cx/axel.html'
181 exit 1
182 ;;
183 Linux | GNU/kFreeBSD)
184 echo 'LFLAGS+=-lpthread' >> Makefile.settings
185 ;;
186 SunOS )
187 echo '#define NOGETOPTLONG' >> config.h
188 echo '#define BSD_COMP' >> config.h
189 echo 'LFLAGS+=-lpthread -lsocket -lnsl' >> Makefile.settings
190 if [ "$i18n" = "1" ]; then
191 echo 'LFLAGS+=-lintl' >> Makefile.settings;
192 fi
193 echo 'Please keep in mind that you need GNU make to make Axel!'
194 echo ''
195 ;;
196 CYGWIN_* )
197 echo 'LFLAGS+=-lpthread' >> Makefile.settings
198 if [ "$i18n" = "1" ]; then
199 echo 'LFLAGS+=-lintl' >> Makefile.settings;
200 fi
201 echo 'OUTFILE=axel.exe' >> Makefile.settings
202 ;;
203 * )
204 echo 'LFLAGS+=-lpthread' >> Makefile.settings
205 echo '#define NOGETOPTLONG' >> config.h
206 if [ "$i18n" = "1" ]; then
207 echo 'LFLAGS+=-lintl' >> Makefile.settings;
208 fi
209 echo 'WARNING: This architecture is unknown!'
210 echo ''
211 echo 'That does not mean Axel will not work, it just means I'\''ve never had the chance'
212 echo 'to test Axel on it. It'\''d be a great help if you could send me more information'
213 echo 'about your platform so I can add it to the build tools.'
214 echo 'You can try to build the program now, if you wish, this default setup might'
215 echo 'just work.'
216 echo ''
217 ;;
218 esac
219
220 echo 'Configuration done:'
221 if [ "$i18n" = "1" ]; then
222 echo ' Internationalization enabled.';
223 else
224 echo ' Internationalization disabled.';
225 fi
226 if [ "$debug" = "1" ]; then
227 echo ' Debugging enabled.';
228 else
229 echo ' Debugging disabled.';
230 fi
231 if [ "$strip" = "1" ]; then
232 echo ' Binary stripping enabled.';
233 else
234 echo ' Binary stripping disabled.';
235 fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5