r8826: Make configure generate config.mk files (with the external libraries
[Samba/gbeck.git] / source4 / build / m4 / check_path.m4
blob55f04dee9a7045cddf0563a342229723d0650e9b
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
8 #################################################
9 # Directory handling stuff to support both the
10 # legacy SAMBA directories and FHS compliant
11 # ones...
12 AC_PREFIX_DEFAULT(/usr/local/samba)
14 AC_ARG_WITH(fhs, 
15 [  --with-fhs              Use FHS-compliant paths (default=no)],
16     configdir="${sysconfdir}/samba"
17     lockdir="\${localstatedir}/cache/samba"
18     piddir="\${localstatedir}/run/samba"
19     logfilebase="\${localstatedir}/log/samba"
20     privatedir="\${CONFIGDIR}/private"
21     libdir="\${prefix}/lib/samba"
22     swatdir="\${DATADIR}/samba/swat",
23     configdir="\${libdir}"
24     logfilebase="\${localstatedir}"
25     lockdir="\${localstatedir}/locks"
26     piddir="\${localstatedir}/locks"
27     privatedir="\${prefix}/private"
28     swatdir="\${prefix}/swat")
30 #################################################
31 # set private directory location
32 AC_ARG_WITH(privatedir,
33 [  --with-privatedir=DIR   Where to put smbpasswd ($ac_default_prefix/private)],
34 [ case "$withval" in
35   yes|no)
36   #
37   # Just in case anybody calls it without argument
38   #
39     AC_MSG_WARN([--with-privatedir called without argument - will use default])
40   ;;
41   * )
42     privatedir="$withval"
43     ;;
44   esac])
46 #################################################
47 # set lock directory location
48 AC_ARG_WITH(lockdir,
49 [  --with-lockdir=DIR      Where to put lock files ($ac_default_prefix/var/locks)],
50 [ case "$withval" in
51   yes|no)
52   #
53   # Just in case anybody calls it without argument
54   #
55     AC_MSG_WARN([--with-lockdir called without argument - will use default])
56   ;;
57   * )
58     lockdir="$withval"
59     ;;
60   esac])
62 #################################################
63 # set pid directory location
64 AC_ARG_WITH(piddir,
65 [  --with-piddir=DIR       Where to put pid files ($ac_default_prefix/var/locks)],
66 [ case "$withval" in
67   yes|no)
68   #
69   # Just in case anybody calls it without argument
70   #
71     AC_MSG_WARN([--with-piddir called without argument - will use default])
72   ;;
73   * )
74     piddir="$withval"
75     ;;
76   esac])
78 #################################################
79 # set configuration directory location
80 AC_ARG_WITH(configdir,
81 [  --with-configdir=DIR    Where to put configuration files (\$libdir)],
82 [ case "$withval" in
83   yes|no)
84   #
85   # Just in case anybody does it
86   #
87     AC_MSG_WARN([--with-configdir called without argument - will use default])
88   ;;
89   * )
90     configdir="$withval"
91     ;;
92   esac])
94 #################################################
95 # set log directory location
96 AC_ARG_WITH(logfilebase,
97 [  --with-logfilebase=DIR  Where to put log files (\$(VARDIR))],
98 [ case "$withval" in
99   yes|no)
100   #
101   # Just in case anybody does it
102   #
103     AC_MSG_WARN([--with-logfilebase called without argument - will use default])
104   ;;
105   * )
106     logfilebase="$withval"
107     ;;
108   esac])
111 #################################################
112 # set swat directory location
113 AC_ARG_WITH(swatdir,
114 [  --with-swatdir=DIR    Where to put configuration files (\$swatdir)],
115 [ case "$withval" in
116   yes|no)
117     AC_MSG_WARN([--with-swatdir called without argument - will use default])
118   ;;
119   * )
120     swatdir="$withval"
121     ;;
122   esac])
124 AC_SUBST(configdir)
125 AC_SUBST(lockdir)
126 AC_SUBST(piddir)
127 AC_SUBST(logfilebase)
128 AC_SUBST(privatedir)
129 AC_SUBST(bindir)
130 AC_SUBST(sbindir)
131 AC_SUBST(swatdir)
133 #################################################
134 # set prefix for 'make test'
135 selftest_prefix="./"
136 AC_SUBST(selftest_prefix)
137 AC_ARG_WITH(selftest-prefix,
138 [  --with-selftest-prefix=DIR    The prefix where make test will be runned (\$selftest_prefix)],
139 [ case "$withval" in
140   yes|no)
141     AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
142   ;;
143   * )
144     selftest_prefix="$withval"
145     ;;
146   esac])
148 developer=no
149 AC_ARG_ENABLE(developer, [  --enable-developer      Turn on developer warnings and debugging (default=no)],
150     [if test x$enable_developer = xyes; then
151         debug=yes
152         CFLAGS="${CFLAGS} -g -Wall"
153         developer=yes
154         DEVELOPER_CFLAGS="-Wshadow -Werror-implicit-function-declaration -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wdeclaration-after-statement -Wmissing-format-attribute -Wformat=2 -Wno-format-y2k -DDEBUG_PASSWORD -DDEVELOPER"
155     fi])
157 debug=no
158 AC_ARG_ENABLE(debug, 
159 [  --enable-debug          Turn on compiler debugging information (default=no)],
160     [if test x$enable_debug = xyes -a x$enable_developer != xyes; then
161         debug=yes
162         CFLAGS="${CFLAGS} -g"
163     fi])
166 experimental=no
167 AC_ARG_ENABLE(experimental, [  --enable-experimental Turn on experimental features (default=no)],
168     [if eval "test x$enable_experimental = xyes"; then
169         experimental=yes
170     fi])
173 dnl disable these external libs 
174 AC_ARG_WITH(disable-ext-lib,
175 [  --with-disable-ext-lib=LIB Comma-seperated list of external libraries],
176 [ if test $withval; then
177         for i in `echo $withval | sed -e's/,/ /g'`
178         do
179                 eval SMB_EXT_LIB_$i=NO
180         done
181 fi ])
183 dnl exclude these modules 
184 AC_ARG_WITH(exclude-modules,
185 [  --with-exclude-modules=MODULES Comma-seperated list of names of modules to exclude from build],
186 [ if test $withval; then
187         for i in `echo $withval | sed -e's/,/ /g'`
188         do
189                 eval SMB_MODULE_$i=NOT
190         done
191 fi ])
193 dnl Always built these modules shared
194 AC_ARG_WITH(shared-modules,
195 [  --with-shared-modules=MODULES  Comma-seperated list of names of modules to build shared],
196 [ if test $withval; then
197         for i in `echo $withval | sed -e's/,/ /g'`
198         do
199                 eval SMB_MODULE_$i=SHARED
200         done
201 fi ])
203 dnl Always built these modules static
204 AC_ARG_WITH(static-modules,
205 [  --with-static-modules=MODULES  Comma-seperated list of names of modules to statically link in],
206 [ if test $withval; then
207         for i in `echo $withval | sed -e's/,/ /g'`
208         do
209                 eval SMB_MODULE_$i=STATIC
210         done
211 fi ])