configure: use AS_HELP_STRING for --with-selftest-prefix.
[tprouty/samba.git] / source4 / build / m4 / check_path.m4
1 dnl SMB Build Environment Path Checks
2 dnl -------------------------------------------------------
3 dnl  Copyright (C) Stefan (metze) Metzmacher 2004
4 dnl  Released under the GNU GPL
5 dnl -------------------------------------------------------
6 dnl
7
8 AC_LIBREPLACE_LOCATION_CHECKS
9
10 #################################################
11 # Directory handling stuff to support both the
12 # legacy SAMBA directories and FHS compliant
13 # ones...
14 AC_PREFIX_DEFAULT(/usr/local/samba)
15
16 # Defaults and --without-fhs
17 logfilebase="${localstatedir}"
18 lockdir="${localstatedir}/locks"
19 piddir="${localstatedir}/run"
20 privatedir="\${prefix}/private"
21 modulesdir="\${prefix}/modules"
22 winbindd_socket_dir="${localstatedir}/run/winbindd"
23 winbindd_privileged_socket_dir="${localstatedir}/lib/winbindd_privileged"
24 ntp_signd_socket_dir="${localstatedir}/run/ntp_signd"
25
26 AC_ARG_WITH(fhs, 
27 [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
28     lockdir="${localstatedir}/lib/samba"
29     piddir="${localstatedir}/run/samba"
30     logfilebase="${localstatedir}/log/samba"
31     privatedir="${localstatedir}/lib/samba/private"
32     sysconfdir="${sysconfdir}/samba"
33     modulesdir="${libdir}/samba"
34     datadir="${datadir}/samba"
35     includedir="${includedir}/samba-4.0"
36     ntp_signd_socket_dir="${localstatedir}/run/samba/ntp_signd"
37     winbindd_socket_dir="${localstatedir}/run/samba/winbindd"
38     winbindd_privileged_socket_dir="${localstatedir}/lib/samba/winbindd_privileged"
39 )
40
41 #################################################
42 # set private directory location
43 AC_ARG_WITH(privatedir,
44 [AS_HELP_STRING([--with-privatedir=DIR],[Where to put sam.ldb and other private files containing key material ($ac_default_prefix/private)])],
45 [ case "$withval" in
46   yes|no)
47   #
48   # Just in case anybody calls it without argument
49   #
50     AC_MSG_WARN([--with-privatedir called without argument - will use default])
51   ;;
52   * )
53     privatedir="$withval"
54     ;;
55   esac])
56
57 #################################################
58 # set where the winbindd socket should be put
59 AC_ARG_WITH(winbindd-socket-dir,
60 [AS_HELP_STRING([--with-winbindd-socket-dir=DIR],[Where to put the winbindd socket ($winbindd_socket_dir)])],
61 [ case "$withval" in
62   yes|no)
63   #
64   # Just in case anybody calls it without argument
65   #
66     AC_MSG_WARN([--with-winbind-socketdir called without argument - will use default])
67   ;;
68   * )
69     winbindd_socket_dir="$withval"
70     ;;
71   esac])
72
73 #################################################
74 # set where the winbindd privilaged socket should be put
75 AC_ARG_WITH(winbindd-privileged-socket-dir,
76 [AS_HELP_STRING([--with-winbindd-privileged-socket-dir=DIR],[Where to put the winbindd socket ($winbindd_privileged_socket_dir)])],
77 [ case "$withval" in
78   yes|no)
79   #
80   # Just in case anybody calls it without argument
81   #
82     AC_MSG_WARN([--with-winbind-privileged-socketdir called without argument - will use default])
83   ;;
84   * )
85     winbindd_privileged_socket_dir="$withval"
86     ;;
87   esac])
88
89 #################################################
90 # set where the NTP signing deamon socket should be put
91 AC_ARG_WITH(ntp-signd-socket-dir,
92 [AS_HELP_STRING([--with-ntp-signd-socket-dir=DIR],[Where to put the NTP signing deamon socket ($ac_default_prefix/run/ntp_signd)])],
93 [ case "$withval" in
94   yes|no)
95   #
96   # Just in case anybody calls it without argument
97   #
98     AC_MSG_WARN([--with-ntp-signd-socketdir called without argument - will use default])
99   ;;
100   * )
101     ntp_signd_socket_dir="$withval"
102     ;;
103   esac])
104
105 #################################################
106 # set lock directory location
107 AC_ARG_WITH(lockdir,
108 [AS_HELP_STRING([--with-lockdir=DIR],[Where to put lock files ($ac_default_prefix/var/locks)])],
109 [ case "$withval" in
110   yes|no)
111   #
112   # Just in case anybody calls it without argument
113   #
114     AC_MSG_WARN([--with-lockdir called without argument - will use default])
115   ;;
116   * )
117     lockdir="$withval"
118     ;;
119   esac])
120
121 #################################################
122 # set pid directory location
123 AC_ARG_WITH(piddir,
124 [AS_HELP_STRING([--with-piddir=DIR],[Where to put pid files ($ac_default_prefix/var/locks)])],
125 [ case "$withval" in
126   yes|no)
127   #
128   # Just in case anybody calls it without argument
129   #
130     AC_MSG_WARN([--with-piddir called without argument - will use default])
131   ;;
132   * )
133     piddir="$withval"
134     ;;
135   esac])
136
137 #################################################
138 # set log directory location
139 AC_ARG_WITH(logfilebase,
140 [AS_HELP_STRING([--with-logfilebase=DIR],[Where to put log files (\$(VARDIR))])],
141 [ case "$withval" in
142   yes|no)
143   #
144   # Just in case anybody does it
145   #
146     AC_MSG_WARN([--with-logfilebase called without argument - will use default])
147   ;;
148   * )
149     logfilebase="$withval"
150     ;;
151   esac])
152
153
154 AC_SUBST(lockdir)
155 AC_SUBST(piddir)
156 AC_SUBST(logfilebase)
157 AC_SUBST(privatedir)
158 AC_SUBST(bindir)
159 AC_SUBST(sbindir)
160 AC_SUBST(winbindd_socket_dir)
161 AC_SUBST(winbindd_privileged_socket_dir)
162 AC_SUBST(ntp_signd_socket_dir)
163 AC_SUBST(modulesdir)
164
165 #################################################
166 # set prefix for 'make test'
167 # this is needed to workarround the 108 char 
168 # unix socket path limitation!
169 #
170 selftest_prefix="./st"
171 AC_SUBST(selftest_prefix)
172 AC_ARG_WITH(selftest-prefix,
173 [AS_HELP_STRING([--with-selftest-prefix=DIR],[The prefix where make test will be run ($selftest_prefix)])],
174 [ case "$withval" in
175   yes|no)
176     AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
177   ;;
178   * )
179     selftest_prefix="$withval"
180     ;;
181   esac])
182
183 debug=no
184 AC_ARG_ENABLE(debug,
185 [  --enable-debug          Turn on compiler debugging information (default=no)],
186     [if test x$enable_debug = xyes; then
187         debug=yes
188     fi])
189
190 developer=no
191 AC_SUBST(developer)
192 AC_ARG_ENABLE(developer,
193 [  --enable-developer      Turn on developer warnings and debugging (default=no)],
194     [if test x$enable_developer = xyes; then
195         debug=yes
196         developer=yes
197     fi])
198
199 dnl disable these external libs 
200 AC_ARG_WITH(disable-ext-lib,
201 [  --with-disable-ext-lib=LIB Comma-seperated list of external libraries],
202 [ if test $withval; then
203         for i in `echo $withval | sed -e's/,/ /g'`
204         do
205                 eval SMB_$i=NO
206         done
207 fi ])