| 1 | dnl
|
|---|
| 2 | dnl Samba3 build environment path checks
|
|---|
| 3 | dnl
|
|---|
| 4 | dnl Copyright (C) Michael Adam 2008
|
|---|
| 5 | dnl
|
|---|
| 6 | dnl Released under the GNU General Public License
|
|---|
| 7 | dnl http://www.gnu.org/licenses/
|
|---|
| 8 | dnl
|
|---|
| 9 |
|
|---|
| 10 | AC_LIBREPLACE_LOCATION_CHECKS
|
|---|
| 11 |
|
|---|
| 12 | #################################################
|
|---|
| 13 | # Directory handling stuff to support both the
|
|---|
| 14 | # legacy SAMBA directories and FHS compliant
|
|---|
| 15 | # ones...
|
|---|
| 16 | AC_PREFIX_DEFAULT(/usr/local/samba)
|
|---|
| 17 |
|
|---|
| 18 | rootsbindir="\${SBINDIR}"
|
|---|
| 19 | lockdir="\${VARDIR}/locks"
|
|---|
| 20 | piddir="\${VARDIR}/locks"
|
|---|
| 21 | test "${mandir}" || mandir="\${prefix}/man"
|
|---|
| 22 | logfilebase="\${VARDIR}"
|
|---|
| 23 | privatedir="\${prefix}/private"
|
|---|
| 24 | test "${libdir}" || libdir="\${prefix}/lib"
|
|---|
| 25 | modulesdir="${libdir}"
|
|---|
| 26 | pammodulesdir="${libdir}/security"
|
|---|
| 27 | configdir="${libdir}"
|
|---|
| 28 | swatdir="\${prefix}/swat"
|
|---|
| 29 | codepagedir="\${MODULESDIR}"
|
|---|
| 30 | statedir="\${LOCKDIR}"
|
|---|
| 31 | cachedir="\${LOCKDIR}"
|
|---|
| 32 | localedir="\${prefix}/share/locale"
|
|---|
| 33 |
|
|---|
| 34 | AC_ARG_WITH(fhs,
|
|---|
| 35 | [AS_HELP_STRING([--with-fhs],[Use FHS-compliant paths (default=no)])],
|
|---|
| 36 | [ case "$withval" in
|
|---|
| 37 | yes)
|
|---|
| 38 | lockdir="\${VARDIR}/lib/samba"
|
|---|
| 39 | piddir="\${VARDIR}/run"
|
|---|
| 40 | mandir="\${prefix}/share/man"
|
|---|
| 41 | logfilebase="\${VARDIR}/log/samba"
|
|---|
| 42 | privatedir="\${CONFIGDIR}/private"
|
|---|
| 43 | test "${libdir}" || libdir="\${prefix}/lib"
|
|---|
| 44 | modulesdir="${libdir}/samba"
|
|---|
| 45 | configdir="\${sysconfdir}/samba"
|
|---|
| 46 | swatdir="\${DATADIR}/samba/swat"
|
|---|
| 47 | codepagedir="\${MODULESDIR}"
|
|---|
| 48 | statedir="\${VARDIR}/lib/samba"
|
|---|
| 49 | cachedir="\${VARDIR}/lib/samba"
|
|---|
| 50 | AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
|
|---|
| 51 | ;;
|
|---|
| 52 | esac])
|
|---|
| 53 |
|
|---|
| 54 | #################################################
|
|---|
| 55 | # set private directory location
|
|---|
| 56 | AC_ARG_WITH(privatedir,
|
|---|
| 57 | [AS_HELP_STRING([--with-privatedir=DIR], [Where to put smbpasswd ($ac_default_prefix/private)])],
|
|---|
| 58 | [ case "$withval" in
|
|---|
| 59 | yes|no)
|
|---|
| 60 | #
|
|---|
| 61 | # Just in case anybody calls it without argument
|
|---|
| 62 | #
|
|---|
| 63 | AC_MSG_WARN([--with-privatedir called without argument - will use default])
|
|---|
| 64 | ;;
|
|---|
| 65 | * )
|
|---|
| 66 | privatedir="$withval"
|
|---|
| 67 | ;;
|
|---|
| 68 | esac])
|
|---|
| 69 |
|
|---|
| 70 | #################################################
|
|---|
| 71 | # set root sbin directory location
|
|---|
| 72 | AC_ARG_WITH(rootsbindir,
|
|---|
| 73 | [AS_HELP_STRING([--with-rootsbindir=DIR], [Which directory to use for root sbin ($ac_default_prefix/sbin)])],
|
|---|
| 74 | [ case "$withval" in
|
|---|
| 75 | yes|no)
|
|---|
| 76 | #
|
|---|
| 77 | # Just in case anybody calls it without argument
|
|---|
| 78 | #
|
|---|
| 79 | AC_MSG_WARN([--with-rootsbindir called without argument - will use default])
|
|---|
| 80 | ;;
|
|---|
| 81 | * )
|
|---|
| 82 | rootsbindir="$withval"
|
|---|
| 83 | ;;
|
|---|
| 84 | esac])
|
|---|
| 85 |
|
|---|
| 86 | #################################################
|
|---|
| 87 | # set lock directory location
|
|---|
| 88 | AC_ARG_WITH(lockdir,
|
|---|
| 89 | [AS_HELP_STRING([--with-lockdir=DIR], [Where to put lock files ($ac_default_prefix/var/locks)])],
|
|---|
| 90 | [ case "$withval" in
|
|---|
| 91 | yes|no)
|
|---|
| 92 | #
|
|---|
| 93 | # Just in case anybody calls it without argument
|
|---|
| 94 | #
|
|---|
| 95 | AC_MSG_WARN([--with-lockdir called without argument - will use default])
|
|---|
| 96 | ;;
|
|---|
| 97 | * )
|
|---|
| 98 | lockdir="$withval"
|
|---|
| 99 | ;;
|
|---|
| 100 | esac])
|
|---|
| 101 |
|
|---|
| 102 | #################################################
|
|---|
| 103 | # set pid directory location
|
|---|
| 104 | AC_ARG_WITH(piddir,
|
|---|
| 105 | [AS_HELP_STRING([--with-piddir=DIR], [Where to put pid files ($ac_default_prefix/var/locks)])],
|
|---|
| 106 | [ case "$withval" in
|
|---|
| 107 | yes|no)
|
|---|
| 108 | #
|
|---|
| 109 | # Just in case anybody calls it without argument
|
|---|
| 110 | #
|
|---|
| 111 | AC_MSG_WARN([--with-piddir called without argument - will use default])
|
|---|
| 112 | ;;
|
|---|
| 113 | * )
|
|---|
| 114 | piddir="$withval"
|
|---|
| 115 | ;;
|
|---|
| 116 | esac])
|
|---|
| 117 |
|
|---|
| 118 | #################################################
|
|---|
| 119 | # set SWAT directory location
|
|---|
| 120 | AC_ARG_WITH(swatdir,
|
|---|
| 121 | [AS_HELP_STRING([--with-swatdir=DIR], [Where to put SWAT files ($ac_default_prefix/swat)])],
|
|---|
| 122 | [ case "$withval" in
|
|---|
| 123 | yes|no)
|
|---|
| 124 | #
|
|---|
| 125 | # Just in case anybody does it
|
|---|
| 126 | #
|
|---|
| 127 | AC_MSG_WARN([--with-swatdir called without argument - will use default])
|
|---|
| 128 | ;;
|
|---|
| 129 | * )
|
|---|
| 130 | swatdir="$withval"
|
|---|
| 131 | ;;
|
|---|
| 132 | esac])
|
|---|
| 133 |
|
|---|
| 134 | #################################################
|
|---|
| 135 | # set configuration directory location
|
|---|
| 136 | AC_ARG_WITH(configdir,
|
|---|
| 137 | [AS_HELP_STRING([--with-configdir=DIR], [Where to put configuration files ($libdir)])],
|
|---|
| 138 | [ case "$withval" in
|
|---|
| 139 | yes|no)
|
|---|
| 140 | #
|
|---|
| 141 | # Just in case anybody does it
|
|---|
| 142 | #
|
|---|
| 143 | AC_MSG_WARN([--with-configdir called without argument - will use default])
|
|---|
| 144 | ;;
|
|---|
| 145 | * )
|
|---|
| 146 | configdir="$withval"
|
|---|
| 147 | ;;
|
|---|
| 148 | esac])
|
|---|
| 149 |
|
|---|
| 150 | #################################################
|
|---|
| 151 | # set log directory location
|
|---|
| 152 | AC_ARG_WITH(logfilebase,
|
|---|
| 153 | [AS_HELP_STRING([--with-logfilebase=DIR], [Where to put log files ($VARDIR)])],
|
|---|
| 154 | [ case "$withval" in
|
|---|
| 155 | yes|no)
|
|---|
| 156 | #
|
|---|
| 157 | # Just in case anybody does it
|
|---|
| 158 | #
|
|---|
| 159 | AC_MSG_WARN([--with-logfilebase called without argument - will use default])
|
|---|
| 160 | ;;
|
|---|
| 161 | * )
|
|---|
| 162 | logfilebase="$withval"
|
|---|
| 163 | ;;
|
|---|
| 164 | esac])
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 | #################################################
|
|---|
| 168 |
|
|---|
| 169 | #################################################
|
|---|
| 170 | # set shared modules (internal lib) directory location
|
|---|
| 171 | AC_ARG_WITH(modulesdir,
|
|---|
| 172 | [AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
|
|---|
| 173 | [ case "$withval" in
|
|---|
| 174 | yes|no)
|
|---|
| 175 | #
|
|---|
| 176 | # Just in case anybody does it
|
|---|
| 177 | #
|
|---|
| 178 | AC_MSG_WARN([--with-modulesdir without argument - will use default])
|
|---|
| 179 | ;;
|
|---|
| 180 | * )
|
|---|
| 181 | modulesdir="$withval"
|
|---|
| 182 | ;;
|
|---|
| 183 | esac])
|
|---|
| 184 |
|
|---|
| 185 | #################################################
|
|---|
| 186 | # set PAM modules directory location
|
|---|
| 187 | AC_ARG_WITH(pammodulesdir,
|
|---|
| 188 | [AS_HELP_STRING([--with-pammodulesdir=DIR], [Which directory to use for PAM modules ($ac_default_prefix/$libdir/security)])],
|
|---|
| 189 | [ case "$withval" in
|
|---|
| 190 | yes|no)
|
|---|
| 191 | #
|
|---|
| 192 | # Just in case anybody calls it without argument
|
|---|
| 193 | #
|
|---|
| 194 | AC_MSG_WARN([--with-pammodulesdir called without argument - will use default])
|
|---|
| 195 | ;;
|
|---|
| 196 | * )
|
|---|
| 197 | pammodulesdir="$withval"
|
|---|
| 198 | ;;
|
|---|
| 199 | esac])
|
|---|
| 200 |
|
|---|
| 201 | #################################################
|
|---|
| 202 | # set man directory location
|
|---|
| 203 | AC_ARG_WITH(mandir,
|
|---|
| 204 | [AS_HELP_STRING([--with-mandir=DIR], [Where to put man pages ($mandir)])],
|
|---|
| 205 | [ case "$withval" in
|
|---|
| 206 | yes|no)
|
|---|
| 207 | #
|
|---|
| 208 | # Just in case anybody does it
|
|---|
| 209 | #
|
|---|
| 210 | AC_MSG_WARN([--with-mandir without argument - will use default])
|
|---|
| 211 | ;;
|
|---|
| 212 | * )
|
|---|
| 213 | mandir="$withval"
|
|---|
| 214 | ;;
|
|---|
| 215 | esac])
|
|---|
| 216 |
|
|---|
| 217 | ################################################
|
|---|
| 218 | # set locale directory location
|
|---|
| 219 | AC_ARG_WITH(localedir,
|
|---|
| 220 | [ --with-localedir=DIR Where to put po files ($ac_default_prefix/share/locale)],
|
|---|
| 221 | [ case "$withval" in
|
|---|
| 222 | yes|no)
|
|---|
| 223 | #
|
|---|
| 224 | # Just in case anybody does it
|
|---|
| 225 | #
|
|---|
| 226 | AC_MSG_WARN([--with-localedir called without argument - will use default])
|
|---|
| 227 | ;;
|
|---|
| 228 | *)
|
|---|
| 229 | localedir="$withval"
|
|---|
| 230 | ;;
|
|---|
| 231 | esac])
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 | AC_SUBST(configdir)
|
|---|
| 235 | AC_SUBST(lockdir)
|
|---|
| 236 | AC_SUBST(piddir)
|
|---|
| 237 | AC_SUBST(logfilebase)
|
|---|
| 238 | AC_SUBST(privatedir)
|
|---|
| 239 | AC_SUBST(swatdir)
|
|---|
| 240 | AC_SUBST(bindir)
|
|---|
| 241 | AC_SUBST(sbindir)
|
|---|
| 242 | AC_SUBST(codepagedir)
|
|---|
| 243 | AC_SUBST(statedir)
|
|---|
| 244 | AC_SUBST(cachedir)
|
|---|
| 245 | AC_SUBST(rootsbindir)
|
|---|
| 246 | AC_SUBST(pammodulesdir)
|
|---|
| 247 | AC_SUBST(modulesdir)
|
|---|
| 248 | AC_SUBST(localedir)
|
|---|
| 249 |
|
|---|
| 250 | #################################################
|
|---|
| 251 | # set prefix for 'make test'
|
|---|
| 252 | selftest_prefix="./st"
|
|---|
| 253 | AC_SUBST(selftest_prefix)
|
|---|
| 254 | AC_ARG_WITH(selftest-prefix,
|
|---|
| 255 | [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
|
|---|
| 256 | [ case "$withval" in
|
|---|
| 257 | yes|no)
|
|---|
| 258 | AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
|
|---|
| 259 | ;;
|
|---|
| 260 | * )
|
|---|
| 261 | selftest_prefix="$withval"
|
|---|
| 262 | ;;
|
|---|
| 263 | esac
|
|---|
| 264 | ])
|
|---|
| 265 |
|
|---|
| 266 | #################################################
|
|---|
| 267 | # set path of samba4's smbtorture
|
|---|
| 268 | smbtorture4_path=""
|
|---|
| 269 | AC_SUBST(smbtorture4_path)
|
|---|
| 270 | AC_ARG_WITH(smbtorture4_path,
|
|---|
| 271 | [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
|
|---|
| 272 | [ case "$withval" in
|
|---|
| 273 | yes|no)
|
|---|
| 274 | AC_MSG_ERROR([--with-smbtorture4-path should take a path])
|
|---|
| 275 | ;;
|
|---|
| 276 | * )
|
|---|
| 277 | smbtorture4_path="$withval"
|
|---|
| 278 | if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
|
|---|
| 279 | AC_MSG_ERROR(['$smbtorture_path' does not exist!])
|
|---|
| 280 | fi
|
|---|
| 281 | ;;
|
|---|
| 282 | esac
|
|---|
| 283 | ])
|
|---|
| 284 |
|
|---|
| 285 | ## check for --enable-debug first before checking CFLAGS before
|
|---|
| 286 | ## so that we don't mix -O and -g
|
|---|
| 287 | debug=no
|
|---|
| 288 | AC_ARG_ENABLE(debug,
|
|---|
| 289 | [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
|
|---|
| 290 | [if eval "test x$enable_debug = xyes"; then
|
|---|
| 291 | debug=yes
|
|---|
| 292 | fi])
|
|---|
| 293 |
|
|---|
| 294 | developer=no
|
|---|
| 295 | AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
|
|---|
| 296 | [if eval "test x$enable_developer = xyes"; then
|
|---|
| 297 | debug=yes
|
|---|
| 298 | developer=yes
|
|---|
| 299 | fi])
|
|---|
| 300 |
|
|---|
| 301 | krb5developer=no
|
|---|
| 302 | AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
|
|---|
| 303 | [if eval "test x$enable_krb5developer = xyes"; then
|
|---|
| 304 | debug=yes
|
|---|
| 305 | developer=yes
|
|---|
| 306 | krb5_developer=yes
|
|---|
| 307 | fi])
|
|---|
| 308 |
|
|---|
| 309 | picky_developer=no
|
|---|
| 310 | AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
|
|---|
| 311 | [if eval "test x$enable_picky_developer = xyes"; then
|
|---|
| 312 | debug=yes
|
|---|
| 313 | developer=yes
|
|---|
| 314 | picky_developer=yes
|
|---|
| 315 | fi])
|
|---|
| 316 |
|
|---|
| 317 | AC_ARG_WITH(cfenc,
|
|---|
| 318 | [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
|
|---|
| 319 | [
|
|---|
| 320 | # May be in source $withval/CoreFoundation/StringEncodings.subproj.
|
|---|
| 321 | # Should have been in framework $withval/CoreFoundation.framework/Headers.
|
|---|
| 322 | for d in \
|
|---|
| 323 | $withval/CoreFoundation/StringEncodings.subproj \
|
|---|
| 324 | $withval/StringEncodings.subproj \
|
|---|
| 325 | $withval/CoreFoundation.framework/Headers \
|
|---|
| 326 | $withval/Headers \
|
|---|
| 327 | $withval
|
|---|
| 328 | do
|
|---|
| 329 | if test -r $d/CFStringEncodingConverter.h; then
|
|---|
| 330 | ln -sfh $d include/CoreFoundation
|
|---|
| 331 | fi
|
|---|
| 332 | done
|
|---|
| 333 | ])
|
|---|
| 334 |
|
|---|