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