/[axel]/trunk/configure
ViewVC logotype

Contents of /trunk/configure

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49 - (hide annotations) (download)
Mon Sep 15 21:13:09 2008 UTC (4 years, 9 months ago) by phihag-guest
File size: 5719 byte(s)
Compile with -Os when using gcc
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 appaji-guest 26 echo 'CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g' >> 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     if type gcc > /dev/null 2> /dev/null; then
104 phihag-guest 49 echo "CFLAGS+=-Os" >> Makefile.settings;
105 appaji-guest 2 echo "CC=gcc" >> Makefile.settings;
106     elif type cc > /dev/null 2> /dev/null; then
107     echo "CC=cc" >> Makefile.settings;
108     else
109     echo 'Cannot find a C compiler, aborting.'
110     exit 1;
111     fi
112    
113     if [ "$strip" = 0 ]; then
114     echo "STRIP=\# skip strip" >> Makefile.settings;
115     else
116     echo 'The strip option is enabled. This should not be a problem usually, but on some'
117     echo 'systems it breaks stuff.'
118     echo
119     if [ "$debug" = 1 ]; then
120     echo 'Stripping binaries does not make sense when debugging. Stripping disabled.'
121     echo
122     echo 'STRIP=\# skip strip' >> Makefile.settings
123     strip=0;
124     elif type strip > /dev/null 2> /dev/null; then
125     echo "STRIP=strip" >> Makefile.settings;
126     elif /bin/test -x /usr/ccs/bin/strip; then
127     echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
128     else
129     echo 'No strip utility found, cannot remove unnecessary parts from executable.'
130     echo ''
131     echo 'STRIP=\# skip strip' >> Makefile.settings
132     strip=0;
133     fi;
134     fi
135    
136     case "$arch" in
137     FreeBSD )
138     echo '#define NOGETOPTLONG' >> config.h
139     echo 'LFLAGS+=-pthread' >> Makefile.settings
140     if [ "$i18n" = "1" ]; then
141     echo 'LFLAGS+=-lintl' >> Makefile.settings;
142     fi
143     echo 'Please keep in mind that you need GNU make to make Axel!'
144     echo ''
145     ;;
146     OpenBSD )
147     echo '#define NOGETOPTLONG' >> config.h
148     echo 'LFLAGS+=-pthread' >> Makefile.settings
149     if [ "$i18n" = "1" ]; then
150     echo 'LFLAGS+=-lintl' >> Makefile.settings;
151     fi
152     echo 'Please keep in mind that you need GNU make to make Axel!'
153     echo ''
154     ;;
155     NetBSD )
156     echo 'WARNING: NetBSD not tested! Using OpenBSD settings.'
157     echo ' Please send me your results so I can update this!'
158     echo ''
159     echo '#define NOGETOPTLONG' >> config.h
160 appaji-guest 4 echo 'LFLAGS+=-pthread' >> Makefile.settings
161 appaji-guest 2 if [ "$i18n" = "1" ]; then
162     echo 'LFLAGS+=-lintl' >> Makefile.settings;
163     fi
164     echo 'Please keep in mind that you need GNU make to make Axel!'
165     echo ''
166     ;;
167     Darwin )
168     echo '#define NOGETOPTLONG' >> config.h
169     echo 'LFLAGS+=-lpthread' >> Makefile.settings
170     if [ "$i18n" = "1" ]; then
171     echo 'LFLAGS+=-lintl' >> Makefile.settings;
172     fi
173     echo '#define DARWIN' >> config.h
174     echo 'Please keep in mind that you need GNU make to make Axel!'
175     echo ''
176     ;;
177 appaji-guest 16 Linux | GNU/kFreeBSD)
178 appaji-guest 2 echo 'LFLAGS+=-lpthread' >> Makefile.settings
179     ;;
180     SunOS )
181     echo '#define NOGETOPTLONG' >> config.h
182     echo '#define BSD_COMP' >> config.h
183     echo 'LFLAGS+=-lpthread -lsocket -lnsl' >> Makefile.settings
184     if [ "$i18n" = "1" ]; then
185     echo 'LFLAGS+=-lintl' >> Makefile.settings;
186     fi
187     echo 'Please keep in mind that you need GNU make to make Axel!'
188     echo ''
189     ;;
190     CYGWIN_* )
191     echo 'LFLAGS+=-lpthread' >> Makefile.settings
192     if [ "$i18n" = "1" ]; then
193     echo 'LFLAGS+=-lintl' >> Makefile.settings;
194     fi
195     echo 'OUTFILE=axel.exe' >> Makefile.settings
196     ;;
197     * )
198     echo 'LFLAGS+=-lpthread' >> Makefile.settings
199     echo '#define NOGETOPTLONG' >> config.h
200     if [ "$i18n" = "1" ]; then
201     echo 'LFLAGS+=-lintl' >> Makefile.settings;
202     fi
203     echo 'WARNING: This architecture is unknown!'
204     echo ''
205     echo 'That does not mean Axel will not work, it just means I'\''ve never had the chance'
206     echo 'to test Axel on it. It'\''d be a great help if you could send me more information'
207     echo 'about your platform so I can add it to the build tools.'
208     echo 'You can try to build the program now, if you wish, this default setup might'
209     echo 'just work.'
210     echo ''
211     ;;
212     esac
213    
214     echo 'Configuration done:'
215     if [ "$i18n" = "1" ]; then
216     echo ' Internationalization enabled.';
217     else
218     echo ' Internationalization disabled.';
219     fi
220     if [ "$debug" = "1" ]; then
221     echo ' Debugging enabled.';
222     else
223     echo ' Debugging disabled.';
224     fi
225     if [ "$strip" = "1" ]; then
226     echo ' Binary stripping enabled.';
227     else
228     echo ' Binary stripping disabled.';
229     fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5