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