/[axel]/trunk/configure
ViewVC logotype

Contents of /trunk/configure

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (show annotations) (download)
Tue Jan 12 07:02:25 2010 UTC (3 years, 4 months ago) by phihag-guest
File size: 6165 byte(s)
Correct argument order for HP UX
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 sharedir='$prefix/share'
13 mandir='$sharedir/man'
14 locale='$sharedir/locale'
15
16 i18n=1
17 debug=0
18 strip=1
19
20 arch=`uname -s`
21
22 while [ -n "$1" ]; do
23 e="`expr "$1" : '--\(.*=.*\)'`"
24 if [ -z "$e" ]; then
25 cat<<EOF
26 Axel configure
27
28 Usage: $0 [OPTIONS]
29
30 Option Description Default
31
32 --prefix=... Directories to put files in $prefix
33 --bindir=... $bindir
34 --etcdir=... $etcdir
35 --mandir=... $mandir
36 --locale=... $locale
37
38 --i18n=0/1 Disable/enable internationalization $i18n
39 --debug=0/1 Disable/enable debugging $debug
40 --strip=0/1 Disable/enable binary stripping $strip
41 EOF
42 exit;
43 fi
44
45 keyname=`expr "$e" : '\(.*\)=.*' | sed 's/[^a-z0-9_]/_/g'`
46 value=`expr "$e" : '.*=\(.*\)' | sed "s/'/_/g"`
47
48 eval "$keyname='$value'"
49 shift;
50 done
51
52 # Expand $prefix
53 bindir=`eval echo $bindir`
54 etcdir=`eval echo $etcdir`
55 sharedir=`eval echo $sharedir`
56 mandir=`eval echo $mandir`
57 locale=`eval echo $locale`
58 if test "$etcdir" = "/usr/etc"; then
59 # FHS explicitely forbids /usr/etc
60 etcdir='/etc'
61 fi
62
63 cat<<EOF>Makefile.settings
64 ## Axel settings, generated by configure
65 PREFIX=$prefix
66 BINDIR=$bindir
67 ETCDIR=$etcdir
68 SHAREDIR=$sharedir
69 MANDIR=$mandir
70 LOCALE=$locale
71
72 OUTFILE=axel
73 ARCH=$arch
74
75 DESTDIR=
76
77 EOF
78
79 cat<<EOF>config.h
80 /* Axel settings, generated by configure */
81 #define _REENTRANT
82 #define _THREAD_SAFE
83 #define ETCDIR "$etcdir"
84 #define LOCALE "$locale"
85 #define ARCH "$arch"
86
87 EOF
88
89 AXEL_LFLAGS=${LFLAGS}
90
91 if [ "$i18n" = "1" ]; then
92 if type msgfmt > /dev/null 2> /dev/null; then :;else
93 echo 'WARNING: Internationalization disabled, you don'\''t have the necessary files'
94 echo ' installed.'
95 echo ''
96 i18n=0;
97 fi;
98
99 echo "all: i18n-mofiles" >> Makefile.settings
100 echo "install: install-i18n" >> Makefile.settings
101 echo "uninstall: uninstall-i18n" >> Makefile.settings
102 fi
103
104 AXEL_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os ${CFLAGS}"
105 if [ "$debug" = "1" ]; then
106 AXEL_CFLAGS="${AXEL_CFLAGS} -g"
107 echo 'DEBUG=1' >> Makefile.settings
108 echo '#define DEBUG' >> config.h;
109 fi
110
111 if [ "$i18n" = "1" ]; then
112 echo 'I18N=1' >> Makefile.settings
113 echo '#define I18N' >> config.h
114 if [ -f /usr/local/include/libintl.h ]; then
115 AXEL_CFLAGS="${AXEL_CFLAGS} -I/usr/local/include"
116 AXEL_LFLAGS="${AXEL_LFLAGS} -L/usr/local/lib"
117 elif [ -f /opt/csw/include/libintl.h ]; then
118 AXEL_CFLAGS="${AXEL_CFLAGS} -I/opt/csw/include"
119 AXEL_LFLAGS="${AXEL_LFLAGS} -L/opt/csw/lib"
120 elif [ -f "${prefix}/include/libintl.h" ]; then
121 AXEL_CFLAGS="${AXEL_CFLAGS} -I${prefix}/include"
122 AXEL_LFLAGS="${AXEL_LFLAGS} -L${prefix}/lib"
123 fi
124 fi
125
126 if [ "${CC}" != "" ]; then
127 echo "CC=${CC}" >> Makefile.settings;
128 elif type gcc > /dev/null 2> /dev/null; then
129 echo "CC=gcc" >> Makefile.settings;
130 AXEL_CFLAGS="${AXEL_CFLAGS} -Wall"
131 elif type cc > /dev/null 2> /dev/null; then
132 echo "CC=cc" >> Makefile.settings;
133 else
134 echo 'Cannot find a C compiler, aborting.'
135 exit 1;
136 fi
137
138 if [ "$strip" = 0 ]; then
139 echo "STRIP=\# skip strip" >> Makefile.settings;
140 else
141 if [ "$debug" = 1 ]; then
142 echo 'Stripping binaries does not make sense when debugging. Stripping disabled.'
143 echo
144 echo 'STRIP=\# skip strip' >> Makefile.settings
145 strip=0;
146 elif type strip > /dev/null 2> /dev/null; then
147 echo "STRIP=strip" >> Makefile.settings;
148 elif [ -x /usr/ccs/bin/strip ]; then
149 echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
150 else
151 echo 'No strip utility found, cannot remove unnecessary parts from executable.'
152 echo ''
153 echo 'STRIP=\# skip strip' >> Makefile.settings
154 strip=0;
155 fi;
156 fi
157
158 case "$arch" in
159 FreeBSD )
160 echo '#define NOGETOPTLONG' >> config.h
161 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread"
162 if [ "$i18n" = "1" ]; then
163 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl"
164 fi
165 ;;
166 OpenBSD )
167 echo '#define NOGETOPTLONG' >> config.h
168 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread"
169 if [ "$i18n" = "1" ]; then
170 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl"
171 fi
172 ;;
173 NetBSD )
174 echo 'WARNING: NetBSD not tested! Using OpenBSD settings.'
175 echo '#define NOGETOPTLONG' >> config.h
176 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread"
177 if [ "$i18n" = "1" ]; then
178 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl"
179 fi
180 ;;
181 Darwin )
182 echo '#define NOGETOPTLONG' >> config.h
183 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread"
184 if [ "$i18n" = "1" ]; then
185 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl"
186 fi
187 echo '#define DARWIN' >> config.h
188 ;;
189 Linux | GNU/kFreeBSD)
190 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread"
191 ;;
192 SunOS )
193 echo '#define NOGETOPTLONG' >> config.h
194 echo '#define BSD_COMP' >> config.h
195 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread -lsocket -lnsl"
196 if [ "$i18n" = "1" ]; then
197 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl"
198 fi
199 ;;
200 HP-UX )
201 echo '#define NOGETOPTLONG' >> config.h
202 if [ "$i18n" = "1" ]; then
203 if [ -d /usr/local/lib/hpux32 ]; then
204 AXEL_LFLAGS="${AXEL_LFLAGS} -L/usr/local/lib/hpux32"
205 fi
206 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl"
207 fi
208 AXEL_LFLAGS="${AXEL_LFLAGS} -lpthread"
209 ;;
210 CYGWIN_* )
211 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread"
212 if [ "$i18n" = "1" ]; then
213 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl"
214 fi
215 echo 'OUTFILE=axel.exe' >> Makefile.settings
216 ;;
217 * )
218 AXEL_LFLAGS="${AXEL_LFLAGS} -pthread"
219 echo '#define NOGETOPTLONG' >> config.h
220 if [ "$i18n" = "1" ]; then
221 AXEL_LFLAGS="${AXEL_LFLAGS} -lintl";
222 fi
223 echo 'WARNING: This architecture is unknown!'
224 echo ''
225 echo 'That does not mean Axel will not work, it just means Axel is not tested on it.'
226 echo 'It'\''d be a great help if you could send me more information'
227 echo 'about your platform so that it can be addedto the build tools.'
228 echo 'You can try to build the program now, if you wish, this default setup might'
229 echo 'just work.'
230 echo ''
231 ;;
232 esac
233
234 echo "CFLAGS=${AXEL_CFLAGS}" >> Makefile.settings
235 echo "LFLAGS=${AXEL_LFLAGS}" >> Makefile.settings
236
237 echo 'Configuration done:'
238 if [ "$i18n" = "1" ]; then
239 echo ' Internationalization enabled.';
240 else
241 echo ' Internationalization disabled.';
242 fi
243 if [ "$debug" = "1" ]; then
244 echo ' Debugging enabled.';
245 else
246 echo ' Debugging disabled.';
247 fi
248 if [ "$strip" = "1" ]; then
249 echo ' Binary stripping enabled.';
250 else
251 echo ' Binary stripping disabled.';
252 fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5