s3:configure: use the same dynconfig options and default values as the toplevel build
[ira/wip.git] / source3 / m4 / check_path.m4
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 m4_include(../dynconfig/config.m4)
13
14 #################################################
15 # set prefix for 'make test'
16 selftest_prefix="./st"
17 AC_SUBST(selftest_prefix)
18 AC_ARG_WITH(selftest-prefix,
19 [AS_HELP_STRING([--with-selftest-prefix=DIR], [The prefix where make test will be run ($selftest_prefix)])],
20 [ case "$withval" in
21   yes|no)
22     AC_MSG_WARN([--with-selftest-prefix called without argument - will use default])
23   ;;
24   * )
25     selftest_prefix="$withval"
26     ;;
27   esac
28 ])
29
30 #################################################
31 # set shrdir for 'make test'
32 selftest_shrdir=""
33 AC_SUBST(selftest_shrdir)
34 AC_ARG_WITH(selftest-shrdir,
35 [AS_HELP_STRING([--with-selftest-shrdir=DIR], [The share directory that make test will be run against ($selftest_shrdir)])],
36 [ case "$withval" in
37   yes|no)
38     AC_MSG_WARN([--with-selftest-shrdir called without argument - will use default])
39   ;;
40   * )
41     selftest_shrdir="-s $withval"
42     ;;
43   esac
44 ])
45
46 #################################################
47 # set path of samba4's smbtorture
48 smbtorture4_path=""
49 AC_SUBST(smbtorture4_path)
50 smbtorture4_option=""
51 AC_SUBST(smbtorture4_option)
52 AC_ARG_WITH(smbtorture4_path,
53 [AS_HELP_STRING([--with-smbtorture4-path=PATH], [The path to a samba4 smbtorture for make test (none)])],
54 [ case "$withval" in
55   yes|no)
56     AC_MSG_ERROR([--with-smbtorture4-path should take a path])
57   ;;
58   * )
59     smbtorture4_path="$withval"
60     if test -z "$smbtorture4_path" -a ! -f $smbtorture4_path; then
61         AC_MSG_ERROR(['$smbtorture_path' does not  exist!])
62     fi
63     smbtorture4_option="-t $withval"
64   ;;
65  esac
66 ])
67
68 #################################################
69 # set custom conf for make test
70 selftest_custom_conf=""
71 AC_SUBST(selftest_custom_conf)
72 AC_ARG_WITH(selftest_custom_conf,
73 [AS_HELP_STRING([--with-selftest-custom-conf=PATH], [An optional custom smb.conf that is included in the server smb.conf during make test(none)])],
74 [ case "$withval" in
75   yes|no)
76     AC_MSG_ERROR([--with-selftest-custom-conf should take a path])
77   ;;
78   * )
79     selftest_custom_conf="$withval"
80     if test -z "$selftest_custom_conf" -a ! -f $selftest_custom_conf; then
81         AC_MSG_ERROR(['$selftest_custom_conf' does not  exist!])
82     fi
83     selftest_custom_conf="-c $withval"
84   ;;
85  esac
86 ])
87
88 ## check for --enable-debug first before checking CFLAGS before
89 ## so that we don't mix -O and -g
90 debug=no
91 AC_ARG_ENABLE(debug,
92 [AS_HELP_STRING([--enable-debug], [Turn on compiler debugging information (default=no)])],
93     [if eval "test x$enable_debug = xyes"; then
94         debug=yes
95     fi])
96
97 AC_SUBST(developer)
98 developer=no
99 AC_ARG_ENABLE(developer, [AS_HELP_STRING([--enable-developer], [Turn on developer warnings and debugging (default=no)])],
100     [if eval "test x$enable_developer = xyes"; then
101         debug=yes
102         developer=yes
103     fi])
104
105 krb5developer=no
106 AC_ARG_ENABLE(krb5developer, [AS_HELP_STRING([--enable-krb5developer], [Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)])],
107     [if eval "test x$enable_krb5developer = xyes"; then
108         debug=yes
109         developer=yes
110         krb5_developer=yes
111     fi])
112
113 picky_developer=no
114 AC_ARG_ENABLE(picky-developer, [AS_HELP_STRING([--enable-picky-developer], [Halt compilation on warnings])],
115     [if eval "test x$enable_picky_developer = xyes"; then
116         debug=yes
117         developer=yes
118         picky_developer=yes
119     fi])
120
121 AC_ARG_WITH(cfenc,
122 [AS_HELP_STRING([--with-cfenc=HEADERDIR], [Use internal CoreFoundation encoding API for optimization (Mac OS X/Darwin only)])],
123 [
124 # May be in source $withval/CoreFoundation/StringEncodings.subproj.
125 # Should have been in framework $withval/CoreFoundation.framework/Headers.
126 for d in \
127     $withval/CoreFoundation/StringEncodings.subproj \
128     $withval/StringEncodings.subproj \
129     $withval/CoreFoundation.framework/Headers \
130     $withval/Headers \
131     $withval
132 do
133     if test -r $d/CFStringEncodingConverter.h; then
134         ln -sfh $d include/CoreFoundation
135     fi
136 done
137 ])
138