source: trunk/samba-3.0.25pre1/examples/VFS/configure.in@ 1

Last change on this file since 1 was 1, checked in by Paul Smedley, 18 years ago

Initial code import

File size: 8.8 KB
Line 
1dnl -*- mode: m4-mode -*-
2dnl Process this file with autoconf to produce a configure script.
3
4dnl We must use autotools 2.53 or above
5AC_PREREQ(2.53)
6AC_INIT(Makefile.in)
7
8#dnl Uncomment this if you want to use your own define's too
9#AC_CONFIG_HEADER(module_config.h)
10#dnl To make sure that didn't get #define PACKAGE_* in modules_config.h
11#echo "" > confdefs.h
12
13dnl Checks for programs.
14AC_PROG_CC
15AC_PROG_INSTALL
16
17#################################################
18# Directory handling stuff to support both the
19# legacy SAMBA directories and FHS compliant
20# ones...
21AC_PREFIX_DEFAULT(/usr/local/samba)
22
23AC_ARG_WITH(fhs,
24[ --with-fhs Use FHS-compliant paths (default=no)],
25 libdir="\${prefix}/lib/samba",
26 libdir="\${prefix}/lib")
27
28AC_SUBST(libdir)
29
30SAMBA_SOURCE="../../source"
31####################################################
32# set the location location of the samba source tree
33AC_ARG_WITH(samba-source,
34[ --with-samba-source=DIR Where is the samba source tree (../../source)],
35[ case "$withval" in
36 yes|no)
37 #
38 # Just in case anybody calls it without argument
39 #
40 AC_MSG_WARN([--with-samba-source called without argument - will use default])
41 ;;
42 * )
43 SAMBA_SOURCE="$withval"
44 ;;
45 esac])
46
47AC_SUBST(SAMBA_SOURCE)
48
49dnl Unique-to-Samba variables we'll be playing with.
50AC_SUBST(CC)
51AC_SUBST(SHELL)
52AC_SUBST(LDSHFLAGS)
53AC_SUBST(SONAMEFLAG)
54AC_SUBST(SHLD)
55AC_SUBST(HOST_OS)
56AC_SUBST(PICFLAGS)
57AC_SUBST(PICSUFFIX)
58AC_SUBST(SHLIBEXT)
59AC_SUBST(INSTALLCLIENTCMD_SH)
60AC_SUBST(INSTALLCLIENTCMD_A)
61AC_SUBST(SHLIB_PROGS)
62AC_SUBST(EXTRA_BIN_PROGS)
63AC_SUBST(EXTRA_SBIN_PROGS)
64AC_SUBST(EXTRA_ALL_TARGETS)
65
66AC_ARG_ENABLE(debug,
67[ --enable-debug Turn on compiler debugging information (default=no)],
68 [if eval "test x$enable_debug = xyes"; then
69 CFLAGS="${CFLAGS} -g"
70 fi])
71
72AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
73 [if eval "test x$enable_developer = xyes"; then
74 developer=yes
75 CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
76 fi])
77
78# compile with optimization and without debugging by default, but
79# allow people to set their own preference.
80if test "x$CFLAGS" = x
81then
82 CFLAGS="-O ${CFLAGS}"
83fi
84
85 #################################################
86 # check for krb5-config from recent MIT and Heimdal kerberos 5
87 AC_PATH_PROG(KRB5CONFIG, krb5-config)
88 AC_MSG_CHECKING(for working krb5-config)
89 if test -x "$KRB5CONFIG"; then
90 CFLAGS="$CFLAGS `$KRB5CONFIG --cflags | sed s/@INCLUDE_des@//`"
91 CPPFLAGS="$CPPFLAGS `$KRB5CONFIG --cflags | sed s/@INCLUDE_des@//`"
92 FOUND_KRB5=yes
93 AC_MSG_RESULT(yes)
94 else
95 AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
96 fi
97
98 if test x$FOUND_KRB5 = x"no"; then
99 #################################################
100 # check for location of Kerberos 5 install
101 AC_MSG_CHECKING(for kerberos 5 install path)
102 AC_ARG_WITH(krb5,
103 [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)],
104 [ case "$withval" in
105 no)
106 AC_MSG_RESULT(no)
107 ;;
108 *)
109 AC_MSG_RESULT(yes)
110 CFLAGS="$CFLAGS -I$withval/include"
111 CPPFLAGS="$CPPFLAGS -I$withval/include"
112 FOUND_KRB5=yes
113 ;;
114 esac ],
115 AC_MSG_RESULT(no)
116 )
117 fi
118
119if test x$FOUND_KRB5 = x"no"; then
120#################################################
121# see if this box has the SuSE location for the heimdal kerberos implementation
122AC_MSG_CHECKING(for /usr/include/heimdal)
123if test -d /usr/include/heimdal; then
124 if test -f /usr/lib/heimdal/lib/libkrb5.a; then
125 CFLAGS="$CFLAGS -I/usr/include/heimdal"
126 CPPFLAGS="$CPPFLAGS -I/usr/include/heimdal"
127 AC_MSG_RESULT(yes)
128 else
129 CFLAGS="$CFLAGS -I/usr/include/heimdal"
130 CPPFLAGS="$CPPFLAGS -I/usr/include/heimdal"
131 AC_MSG_RESULT(yes)
132
133 fi
134else
135 AC_MSG_RESULT(no)
136fi
137fi
138
139
140if test x$FOUND_KRB5 = x"no"; then
141#################################################
142# see if this box has the RedHat location for kerberos
143AC_MSG_CHECKING(for /usr/kerberos)
144if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then
145 LDFLAGS="$LDFLAGS -L/usr/kerberos/lib"
146 CFLAGS="$CFLAGS -I/usr/kerberos/include"
147 CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
148 AC_MSG_RESULT(yes)
149else
150 AC_MSG_RESULT(no)
151fi
152fi
153
154 # now check for krb5.h. Some systems have the libraries without the headers!
155 # note that this check is done here to allow for different kerberos
156 # include paths
157 AC_CHECK_HEADERS(krb5.h)
158
159 # now check for gssapi headers. This is also done here to allow for
160 # different kerberos include paths
161 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h)
162
163#dnl Check if we use GNU ld
164#LD=ld
165#AC_PROG_LD_GNU
166
167#dnl look for executable suffix
168#AC_EXEEXT
169
170builddir=`pwd`
171AC_SUBST(builddir)
172
173# Assume non-shared by default and override below
174BLDSHARED="false"
175
176# these are the defaults, good for lots of systems
177HOST_OS="$host_os"
178LDSHFLAGS="-shared"
179SONAMEFLAG="#"
180SHLD="\${CC}"
181PICFLAGS=""
182PICSUFFIX="po"
183SHLIBEXT="so"
184
185if test "$enable_shared" = "yes"; then
186 # this bit needs to be modified for each OS that is suported by
187 # smbwrapper. You need to specify how to created a shared library and
188 # how to compile C code to produce PIC object files
189
190 AC_MSG_CHECKING([ability to build shared libraries])
191
192 # and these are for particular systems
193 case "$host_os" in
194 *linux*)
195 BLDSHARED="true"
196 LDSHFLAGS="-shared"
197 DYNEXP="-Wl,--export-dynamic"
198 PICFLAGS="-fPIC"
199 SONAMEFLAG="-Wl,-soname="
200 ;;
201 *solaris*)
202 BLDSHARED="true"
203 LDSHFLAGS="-G"
204 SONAMEFLAG="-h "
205 if test "${GCC}" = "yes"; then
206 PICFLAGS="-fPIC"
207 if test "${ac_cv_prog_gnu_ld}" = "yes"; then
208 DYNEXP="-Wl,-E"
209 fi
210 else
211 PICFLAGS="-KPIC"
212 ## ${CFLAGS} added for building 64-bit shared
213 ## libs using Sun's Compiler
214 LDSHFLAGS="-G \${CFLAGS}"
215 PICSUFFIX="po.o"
216 fi
217 ;;
218 *sunos*)
219 BLDSHARED="true"
220 LDSHFLAGS="-G"
221 SONAMEFLAG="-Wl,-h,"
222 PICFLAGS="-KPIC" # Is this correct for SunOS
223 ;;
224 *netbsd* | *freebsd*) BLDSHARED="true"
225 LDSHFLAGS="-shared"
226 DYNEXP="-Wl,--export-dynamic"
227 SONAMEFLAG="-Wl,-soname,"
228 PICFLAGS="-fPIC -DPIC"
229 ;;
230 *openbsd*) BLDSHARED="true"
231 LDSHFLAGS="-shared"
232 DYNEXP="-Wl,-Bdynamic"
233 SONAMEFLAG="-Wl,-soname,"
234 PICFLAGS="-fPIC"
235 ;;
236 *irix*)
237 case "$host_os" in
238 *irix6*)
239 ;;
240 esac
241 ATTEMPT_WRAP32_BUILD=yes
242 BLDSHARED="true"
243 LDSHFLAGS="-set_version sgi1.0 -shared"
244 SONAMEFLAG="-soname "
245 SHLD="\${LD}"
246 if test "${GCC}" = "yes"; then
247 PICFLAGS="-fPIC"
248 else
249 PICFLAGS="-KPIC"
250 fi
251 ;;
252 *aix*)
253 BLDSHARED="true"
254 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry,-berok"
255 DYNEXP="-Wl,-brtl,-bexpall"
256 PICFLAGS="-O2"
257 if test "${GCC}" != "yes"; then
258 ## for funky AIX compiler using strncpy()
259 CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
260 fi
261 ;;
262 *hpux*)
263 SHLIBEXT="sl"
264 # Use special PIC flags for the native HP-UX compiler.
265 if test $ac_cv_prog_cc_Ae = yes; then
266 BLDSHARED="true"
267 SHLD="/usr/bin/ld"
268 LDSHFLAGS="-B symbolic -b -z"
269 SONAMEFLAG="+h "
270 PICFLAGS="+z"
271 fi
272 DYNEXP="-Wl,-E"
273 ;;
274 *qnx*)
275 ;;
276 *osf*)
277 BLDSHARED="true"
278 LDSHFLAGS="-shared"
279 SONAMEFLAG="-Wl,-soname,"
280 PICFLAGS="-fPIC"
281 ;;
282 *sco*)
283 ;;
284 *unixware*)
285 BLDSHARED="true"
286 LDSHFLAGS="-shared"
287 SONAMEFLAG="-Wl,-soname,"
288 PICFLAGS="-KPIC"
289 ;;
290 *next2*)
291 ;;
292 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
293 ;;
294 *sysv4*)
295 case "$host" in
296 *-univel-*)
297 LDSHFLAGS="-G"
298 DYNEXP="-Bexport"
299 ;;
300 *mips-sni-sysv4*)
301 ;;
302 esac
303 ;;
304
305 *sysv5*)
306 LDSHFLAGS="-G"
307 ;;
308 *vos*)
309 BLDSHARED="false"
310 LDSHFLAGS=""
311 ;;
312 *)
313 ;;
314 esac
315 AC_SUBST(DYNEXP)
316 AC_MSG_RESULT($BLDSHARED)
317 AC_MSG_CHECKING([linker flags for shared libraries])
318 AC_MSG_RESULT([$LDSHFLAGS])
319 AC_MSG_CHECKING([compiler flags for position-independent code])
320 AC_MSG_RESULT([$PICFLAGS])
321fi
322
323#######################################################
324# test whether building a shared library actually works
325if test $BLDSHARED = true; then
326AC_CACHE_CHECK([whether building shared libraries actually works],
327 [ac_cv_shlib_works],[
328 ac_cv_shlib_works=no
329 # try building a trivial shared library
330 if test "$PICSUFFIX" = "po"; then
331 $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
332 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
333 ac_cv_shlib_works=yes
334 else
335 $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c &&
336 mv shlib.$PICSUFFIX shlib.po &&
337 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
338 ac_cv_shlib_works=yes
339 fi
340 rm -f "shlib.$SHLIBEXT" shlib.po
341])
342if test $ac_cv_shlib_works = no; then
343 BLDSHARED=false
344fi
345fi
346
347
348
349
350AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.