-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·50 lines (43 loc) · 960 Bytes
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
usage()
{
echo "Use environment variables to pass values:
CC - compiler (default: cc)
CFLAGS - flags for compiler
LDFLAGS - flags for linker
DESTDIR - path to make install (default: /usr/local)
NOSOCK - set to cut part of libhttpc that works with sockets"
exit 1
}
while test $# -gt 0; do
case "$1" in
-h) usage
;;
--help) usage
;;
esac
shift
done
CC=${CC:-cc}
CFLAGS=${CFLAGS:-}
LDFLAGS=${LDFLAGS:-}
DESTDIR=${DESTDIR:-/usr/local}
echo "Configuration:
Compiler: $CC
CFLAGS: $CFLAGS
LDFLAGS: $LDFLAGS
DESTDIR: $DESTDIR
NOSOCK: ${NOSOCK:-not set}"
echo "
CFLAGS=$CFLAGS
LDFLAGS=$LDFLAGS
DESTDIR=$DESTDIR
" > config.mk
echo "#ifndef __LIBHTTPC_CONFIG_H__
#define __LIBHTTPC_CONFIG_H__
" > include/config.h
if [ -z "$NOSOCK" ]; then
echo "#define LibHTTPC_SOCK" >> include/config.h
fi
echo "
#endif" >> include/config.h