| 1 |
appaji-guest |
2 |
#!/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 |
phihag-guest |
52 |
echo 'CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -Os' >> Makefile.settings |
| 89 |
appaji-guest |
2 |
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 |
phihag-guest |
52 |
if [ "${CC}" != "" ]; then |
| 104 |
|
|
echo "CC=${CC}" >> Makefile.settings; |
| 105 |
|
|
elif type gcc > /dev/null 2> /dev/null; then |
| 106 |
appaji-guest |
2 |
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 |
appaji-guest |
4 |
echo 'LFLAGS+=-pthread' >> Makefile.settings |
| 162 |
appaji-guest |
2 |
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 |
appaji-guest |
16 |
Linux | GNU/kFreeBSD) |
| 179 |
appaji-guest |
2 |
echo 'LFLAGS+=-lpthread' >> Makefile.settings |
| 180 |
|
|
;; |
| 181 |
|
|
SunOS ) |
| 182 |
|
|
echo '#define NOGETOPTLONG' >> config.h |
| 183 |
|
|
echo '#define BSD_COMP' >> config.h |
| 184 |
|
|
echo 'LFLAGS+=-lpthread -lsocket -lnsl' >> Makefile.settings |
| 185 |
|
|
if [ "$i18n" = "1" ]; then |
| 186 |
|
|
echo 'LFLAGS+=-lintl' >> Makefile.settings; |
| 187 |
|
|
fi |
| 188 |
|
|
echo 'Please keep in mind that you need GNU make to make Axel!' |
| 189 |
|
|
echo '' |
| 190 |
|
|
;; |
| 191 |
|
|
CYGWIN_* ) |
| 192 |
|
|
echo 'LFLAGS+=-lpthread' >> Makefile.settings |
| 193 |
|
|
if [ "$i18n" = "1" ]; then |
| 194 |
|
|
echo 'LFLAGS+=-lintl' >> Makefile.settings; |
| 195 |
|
|
fi |
| 196 |
|
|
echo 'OUTFILE=axel.exe' >> Makefile.settings |
| 197 |
|
|
;; |
| 198 |
|
|
* ) |
| 199 |
|
|
echo 'LFLAGS+=-lpthread' >> Makefile.settings |
| 200 |
|
|
echo '#define NOGETOPTLONG' >> config.h |
| 201 |
|
|
if [ "$i18n" = "1" ]; then |
| 202 |
|
|
echo 'LFLAGS+=-lintl' >> Makefile.settings; |
| 203 |
|
|
fi |
| 204 |
|
|
echo 'WARNING: This architecture is unknown!' |
| 205 |
|
|
echo '' |
| 206 |
|
|
echo 'That does not mean Axel will not work, it just means I'\''ve never had the chance' |
| 207 |
|
|
echo 'to test Axel on it. It'\''d be a great help if you could send me more information' |
| 208 |
|
|
echo 'about your platform so I can add it to the build tools.' |
| 209 |
|
|
echo 'You can try to build the program now, if you wish, this default setup might' |
| 210 |
|
|
echo 'just work.' |
| 211 |
|
|
echo '' |
| 212 |
|
|
;; |
| 213 |
|
|
esac |
| 214 |
|
|
|
| 215 |
|
|
echo 'Configuration done:' |
| 216 |
|
|
if [ "$i18n" = "1" ]; then |
| 217 |
|
|
echo ' Internationalization enabled.'; |
| 218 |
|
|
else |
| 219 |
|
|
echo ' Internationalization disabled.'; |
| 220 |
|
|
fi |
| 221 |
|
|
if [ "$debug" = "1" ]; then |
| 222 |
|
|
echo ' Debugging enabled.'; |
| 223 |
|
|
else |
| 224 |
|
|
echo ' Debugging disabled.'; |
| 225 |
|
|
fi |
| 226 |
|
|
if [ "$strip" = "1" ]; then |
| 227 |
|
|
echo ' Binary stripping enabled.'; |
| 228 |
|
|
else |
| 229 |
|
|
echo ' Binary stripping disabled.'; |
| 230 |
|
|
fi |