-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·111 lines (99 loc) · 3.27 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#! /bin/sh
### See http://people.gnome.org/~walters/docs/build-api.txt
# buildapi-variable-no-builddir
# Show help if requested.
#
for var in "$@" ; do
if test "${var}" = "--help" ; then
cat <<-EOF
usage: $0 [--options]
Available options:
--help This help message.
--prefix=PATH Installation path prefix [default: /]
--datadir=PATH Path for runtime data files [default: prefix/lib/]
--with-module-name=NAME
Specify an alternate name for the module [default: altfiles]
--with-types=TYPE1,TYPE2,...
Specify the list of NSS types that the module will
handle. Use "all" to support all types.
[default: pwd,grp]
Available NSS types and their corresponding data files:
rpc \$DATADIR/rpc
proto \$DATADIR/protocols
hosts \$DATADIR/hosts
network \$DATADIR/networks
service \$DATADIR/services
pwd \$DATADIR/passwd
grp \$DATADIR/group
spwd \$DATADIR/shadow
sgrp \$DATADIR/gshadow
Also, the following relevant environment variables can be set:
CFLAGS Additional command line flags to be passed to the C compiler
CXXFLAGS Additional command line flags to be passed to the C++ compiler
NOTE: This script tries to mimic the typical usage for configure scripts
generated by autotools, hence it will silently ignore unrecognized
command line options.
EOF
exit
fi
done
# Inspect arguments and generate config.mk
#
echo "# autogenerated by: $0 $*" > config.mk
echo EXTRA_CFLAGS= >> config.mk
echo EXTRA_CXXFLAGS= >> config.mk
for var in "$@" ; do
case ${var} in
CFLAGS=* | CXXFLAGS=*)
echo "Setting EXTRA_${var}"
echo "EXTRA_${var}" >> config.mk
;;
--prefix=*)
var=`echo "${var}" | sed 's/^--prefix=//'`
echo "Setting PREFIX=${var}"
echo "PREFIX := ${var}" >> config.mk
;;
--libdir=*)
var=`echo "${var}" | sed 's/^--libdir=//'`
echo "Setting LIBDIR=${var}"
echo "LIBDIR := ${var}" >> config.mk
;;
--datadir=*)
var=`echo "${var}" | sed 's/^--datadir=//'`
echo "Setting DATADIR=${var}"
echo "DATADIR := ${var}" >> config.mk
;;
--with-module-name=*)
var=`echo "${var}" | sed 's/^--with-module-name=//'`
echo "Setting MODULE_NAME=${var}"
echo "MODULE_NAME := ${var}" >> config.mk
;;
--with-types=*)
var=`echo "${var}" | sed 's/^--with-types=//'`
if [ "${var}" = "all" ] ; then
# Pick all supported types from the conditionals in the Makefile
var=`sed 's/.\+$(HANDLE_\([a-z]\+\)).*/\1/p;d' Makefile | paste -s -d ','`
fi
echo "Setting TYPES=${var}"
# By default pwd and grp are enabled, so clear their values before
# adding the ones passed to --with-types=
echo "HANDLE_pwd :=" >> config.mk
echo "HANDLE_grp :=" >> config.mk
echo ",${var}" | sed 's/,\([^,]\+\)/HANDLE_\1 := 1\n/g' >> config.mk
;;
*)
true
;;
esac
done
# Inherit the CFLAGS/CXXFLAGS from the environment, if defined.
#
if test -n "${CFLAGS}"; then
echo "Setting EXTRA_CFLAGS+=${CFLAGS} (from environment)"
echo "EXTRA_CFLAGS+=${CFLAGS}" >> config.mk
fi
if test -n "${CXXFLAGS}"; then
echo "Setting EXTRA_CXXFLAGS+=${CXXFLAGS} (from environment)"
echo "EXTRA_CXXFLAGS+=${CXXFLAGS}" >> config.mk
fi
echo "config.mk written"