/[axel]/trunk/configure
ViewVC logotype

Contents of /trunk/configure

Parent Directory Parent Directory | Revision Log Revision Log


Revision 114 - (hide annotations) (download)
Mon Jun 22 11:24:55 2009 UTC (3 years, 11 months ago) by phihag-guest
File size: 6082 byte(s)
Use old command quoting style in configure
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 phihag-guest 105 etcdir='$prefix/etc'
12 appaji 109 sharedir='$prefix/share'
13     mandir='$sharedir/man'
14     locale='$sharedir/locale'
15 appaji-guest 2
16 phihag-guest 95 i18n=1
17 appaji-guest 2 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 phihag-guest 104
45 phihag-guest 114 keyname=`expr "$e" : '\(.*\)=.*' | sed 's/[^a-z0-9_]/_/g'`
46     value=`expr "$e" : '.*=\(.*\)' | sed "s/'/_/g"`
47 phihag-guest 104
48 phihag-guest 105 eval "$keyname='$value'"
49 appaji-guest 2 shift;
50     done
51    
52     # Expand $prefix
53     bindir=`eval echo $bindir`
54     etcdir=`eval echo $etcdir`
55 appaji 109 sharedir=`eval echo $sharedir`
56 appaji-guest 2 mandir=`eval echo $mandir`
57     locale=`eval echo $locale`
58 phihag-guest 105 if test "$etcdir" = "/usr/etc"; then
59     # FHS explicitely forbids /usr/etc
60     etcdir='/etc'
61     fi
62 appaji-guest 2
63     cat<<EOF>Makefile.settings
64     ## Axel settings, generated by configure
65     PREFIX=$prefix
66     BINDIR=$bindir
67     ETCDIR=$etcdir
68 appaji 109 SHAREDIR=$sharedir
69 appaji-guest 2 MANDIR=$mandir
70     LOCALE=$locale
71    
72     OUTFILE=axel
73     ARCH=$arch
74    
75     DESTDIR=
76     LFLAGS=
77    
78     EOF
79    
80     cat<<EOF>config.h
81     /* Axel settings, generated by configure */
82     #define _REENTRANT
83     #define _THREAD_SAFE
84     #define ETCDIR "$etcdir"
85     #define LOCALE "$locale"
86     #define ARCH "$arch"
87    
88     EOF
89    
90     if [ "$i18n" = "1" ]; then
91     if type msgfmt > /dev/null 2> /dev/null; then :;else
92     echo 'WARNING: Internationalization disabled, you don'\''t have the necessary files'
93     echo ' installed.'
94     echo ''
95     i18n=0;
96     fi;
97     fi
98    
99 phihag-guest 101 echo "CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os ${CFLAGS}" >> Makefile.settings
100 appaji-guest 2 if [ "$debug" = "1" ]; then
101 phihag-guest 101 echo 'CFLAGS+=-g' >> Makefile.settings
102 appaji-guest 2 echo 'DEBUG=1' >> Makefile.settings
103     echo '#define DEBUG' >> config.h;
104     fi
105    
106     if [ "$i18n" = "1" ]; then
107     echo 'I18N=1' >> Makefile.settings
108     echo '#define I18N' >> config.h
109     if cat /usr/local/include/libintl.h > /dev/null 2> /dev/null; then
110     echo 'CFLAGS+=-I/usr/local/include' >> Makefile.settings
111     echo 'LFLAGS+=-L/usr/local/lib' >> Makefile.settings;
112     fi;
113     fi
114    
115 phihag-guest 52 if [ "${CC}" != "" ]; then
116     echo "CC=${CC}" >> Makefile.settings;
117     elif type gcc > /dev/null 2> /dev/null; then
118 appaji-guest 2 echo "CC=gcc" >> Makefile.settings;
119     elif type cc > /dev/null 2> /dev/null; then
120     echo "CC=cc" >> Makefile.settings;
121     else
122     echo 'Cannot find a C compiler, aborting.'
123     exit 1;
124     fi
125    
126     if [ "$strip" = 0 ]; then
127     echo "STRIP=\# skip strip" >> Makefile.settings;
128     else
129     echo 'The strip option is enabled. This should not be a problem usually, but on some'
130     echo 'systems it breaks stuff.'
131     echo
132     if [ "$debug" = 1 ]; then
133     echo 'Stripping binaries does not make sense when debugging. Stripping disabled.'
134     echo
135     echo 'STRIP=\# skip strip' >> Makefile.settings
136     strip=0;
137     elif type strip > /dev/null 2> /dev/null; then
138     echo "STRIP=strip" >> Makefile.settings;
139     elif /bin/test -x /usr/ccs/bin/strip; then
140     echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
141     else
142     echo 'No strip utility found, cannot remove unnecessary parts from executable.'
143     echo ''
144     echo 'STRIP=\# skip strip' >> Makefile.settings
145     strip=0;
146     fi;
147     fi
148    
149     case "$arch" in
150     FreeBSD )
151     echo '#define NOGETOPTLONG' >> config.h
152     echo 'LFLAGS+=-pthread' >> Makefile.settings
153     if [ "$i18n" = "1" ]; then
154     echo 'LFLAGS+=-lintl' >> Makefile.settings;
155     fi
156     echo 'Please keep in mind that you need GNU make to make Axel!'
157     echo ''
158     ;;
159     OpenBSD )
160     echo '#define NOGETOPTLONG' >> config.h
161     echo 'LFLAGS+=-pthread' >> 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     NetBSD )
169     echo 'WARNING: NetBSD not tested! Using OpenBSD settings.'
170     echo ' Please send me your results so I can update this!'
171     echo ''
172     echo '#define NOGETOPTLONG' >> config.h
173 appaji-guest 4 echo 'LFLAGS+=-pthread' >> Makefile.settings
174 appaji-guest 2 if [ "$i18n" = "1" ]; then
175     echo 'LFLAGS+=-lintl' >> Makefile.settings;
176     fi
177     echo 'Please keep in mind that you need GNU make to make Axel!'
178     echo ''
179     ;;
180     Darwin )
181     echo '#define NOGETOPTLONG' >> config.h
182     echo 'LFLAGS+=-lpthread' >> Makefile.settings
183     if [ "$i18n" = "1" ]; then
184     echo 'LFLAGS+=-lintl' >> Makefile.settings;
185     fi
186     echo '#define DARWIN' >> config.h
187     echo 'Please keep in mind that you need GNU make to make Axel!'
188     echo ''
189     ;;
190 appaji-guest 16 Linux | GNU/kFreeBSD)
191 appaji-guest 2 echo 'LFLAGS+=-lpthread' >> Makefile.settings
192     ;;
193     SunOS )
194     echo '#define NOGETOPTLONG' >> config.h
195     echo '#define BSD_COMP' >> config.h
196     echo 'LFLAGS+=-lpthread -lsocket -lnsl' >> Makefile.settings
197     if [ "$i18n" = "1" ]; then
198     echo 'LFLAGS+=-lintl' >> Makefile.settings;
199     fi
200     echo 'Please keep in mind that you need GNU make to make Axel!'
201     echo ''
202     ;;
203     CYGWIN_* )
204     echo 'LFLAGS+=-lpthread' >> Makefile.settings
205     if [ "$i18n" = "1" ]; then
206     echo 'LFLAGS+=-lintl' >> Makefile.settings;
207     fi
208     echo 'OUTFILE=axel.exe' >> Makefile.settings
209     ;;
210     * )
211     echo 'LFLAGS+=-lpthread' >> Makefile.settings
212     echo '#define NOGETOPTLONG' >> config.h
213     if [ "$i18n" = "1" ]; then
214     echo 'LFLAGS+=-lintl' >> Makefile.settings;
215     fi
216     echo 'WARNING: This architecture is unknown!'
217     echo ''
218     echo 'That does not mean Axel will not work, it just means I'\''ve never had the chance'
219     echo 'to test Axel on it. It'\''d be a great help if you could send me more information'
220     echo 'about your platform so I can add it to the build tools.'
221     echo 'You can try to build the program now, if you wish, this default setup might'
222     echo 'just work.'
223     echo ''
224     ;;
225     esac
226    
227     echo 'Configuration done:'
228     if [ "$i18n" = "1" ]; then
229     echo ' Internationalization enabled.';
230     else
231     echo ' Internationalization disabled.';
232     fi
233     if [ "$debug" = "1" ]; then
234     echo ' Debugging enabled.';
235     else
236     echo ' Debugging disabled.';
237     fi
238     if [ "$strip" = "1" ]; then
239     echo ' Binary stripping enabled.';
240     else
241     echo ' Binary stripping disabled.';
242     fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5