Allow the ntp_signd socket to be set from configure.
[kai/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/winbind_pipe"
23 ntp_signd_socket_dir="${localstatedir}/run/ntp_signd"
24
25 AC_ARG_WITH(fhs, 
26 [  --with-fhs              Use FHS-compliant paths (default=no)],
27     lockdir="${localstatedir}/lib/samba"
28     piddir="${localstatedir}/run/samba"
29     logfilebase="${localstatedir}/log/samba"
30     privatedir="${localstatedir}/lib/samba/private"
31     sysconfdir="${sysconfdir}/samba"
32     modulesdir="${libdir}/samba"
33     datadir="${datadir}/samba"
34     includedir="${includedir}/samba-4.0"
35     ntp_signd_socket_dir="${localstatedir}/run/samba/ntp_signd"
36     winbindd_socket_dir="${localstatedir}/run/samba/winbind_pipe"
37 )
38
39 #################################################
40 # set private directory location
41 AC_ARG_WITH(privatedir,
42 [  --with-privatedir=DIR   Where to put sam.ldb and other private files containing key material ($ac_default_prefix/private)],
43 [ case "$withval" in
44   yes|no)
45   #
46   # Just in case anybody calls it without argument
47   #
48     AC_MSG_WARN([--with-privatedir called without argument - will use default])
49   ;;
50   * )
51     privatedir="$withval"
52     ;;
53   esac])
54
55 #################################################
56 # set where the winbindd socket should be put
57 AC_ARG_WITH(winbindd-socket-dir,
58 [  --with-winbindd-socket-dir=DIR   Where to put the winbindd socket ($ac_default_prefix/run/winbind_pipe)],
59 [ case "$withval" in
60   yes|no)
61   #
62   # Just in case anybody calls it without argument
63   #
64     AC_MSG_WARN([--with-winbind-socketdir called without argument - will use default])
65   ;;
66   * )
67     winbindd_socket_dir="$withval"
68     ;;
69   esac])
70
71 #################################################
72 # set where the NTP signing deamon socket should be put
73 AC_ARG_WITH(ntp-signd-socket-dir,
74 [  --with-ntp-signd-socket-dir=DIR   Where to put the NTP signing deamon socket ($ac_default_prefix/run/ntp_signd)],
75 [ case "$withval" in
76   yes|no)
77   #
78   # Just in case anybody calls it without argument
79   #
80     AC_MSG_WARN([--with-ntp-signd-socketdir called without argument - will use default])
81   ;;
82   * )
83     ntp_signd_socket_dir="$withval"
84     ;;
85   esac])
86
87 #################################################
88 # set lock directory location
89 AC_ARG_WITH(lockdir,
90 [  --with-lockdir=DIR      Where to put lock files ($ac_default_prefix/var/locks)],
91 [ case "$withval" in
92   yes|no)
93   #
94   # Just in case anybody calls it without argument
95   #
96     AC_MSG_WARN([--with-lockdir called without argument - will use default])
97   ;;
98   * )
99     lockdir="$withval"
100     ;;
101   esac])
102
103 #################################################
104 # set pid directory location
105 AC_ARG_WITH(piddir,
106 [  --with-piddir=DIR       Where to put pid files ($ac_default_prefix/var/locks)],
107 [ case "$withval" in
108   yes|no)
109   #
110   # Just in case anybody calls it without argument
111   #
112     AC_MSG_WARN([--with-piddir called without argument - will use default])
113   ;;
114   * )
115     piddir="$withval"
116     ;;
117   esac])
118
119 #################################################
120 # set log directory location
121 AC_ARG_WITH(logfilebase,
122 [  --with-logfilebase=DIR  Where to put log files (\$(VARDIR))],
123 [ case "$withval" in
124   yes|no)
125   #
126   # Just in case anybody does it
127   #
128     AC_MSG_WARN([--with-logfilebase called without argument - will use default])
129   ;;
130   * )
131     logfilebase="$withval"
132     ;;
133   esac])
134
135
136 AC_SUBST(lockdir)
137 AC_SUBST(piddir)
138 AC_SUBST(logfilebase)
139 AC_SUBST(privatedir)
140 AC_SUBST(bindir)
141 AC_SUBST(sbindir)
142 AC_SUBST(winbindd_socket_dir)
143 AC_SUBST(ntp_signd_socket_dir)
144 AC_SUBST(modulesdir)
145
146 #################################################
147 # set prefix for 'make test'
148 # this is needed to workarround the 108 char 
149 # unix socket path limitation!
150 #
151 selftest_prefix="./st"
152 AC_SUBST(selftest_prefix)
153 AC_ARG_WITH(selftest-prefix,
154 [  --with-selftest-prefix=DIR    The prefix where make test will be run ($selftest_prefix)],
155 [ case "$withval" in
156   yes|no)
157     AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
158   ;;
159   * )
160     selftest_prefix="$withval"
161     ;;
162   esac])
163
164 debug=no
165 AC_ARG_ENABLE(debug,
166 [  --enable-debug          Turn on compiler debugging information (default=no)],
167     [if test x$enable_debug = xyes; then
168         debug=yes
169     fi])
170
171 developer=no
172 AC_SUBST(developer)
173 AC_ARG_ENABLE(developer,
174 [  --enable-developer      Turn on developer warnings and debugging (default=no)],
175     [if test x$enable_developer = xyes; then
176         debug=yes
177         developer=yes
178     fi])
179
180 dnl disable these external libs 
181 AC_ARG_WITH(disable-ext-lib,
182 [  --with-disable-ext-lib=LIB Comma-seperated list of external libraries],
183 [ if test $withval; then
184         for i in `echo $withval | sed -e's/,/ /g'`
185         do
186                 eval SMB_$i=NO
187         done
188 fi ])