1 dnl -*- mode: m4-mode -*-
2 dnl Process this file with autoconf to produce a configure script.
4 dnl We must use autotools 2.53 or above
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
13 dnl Checks for programs.
17 #################################################
18 # Directory handling stuff to support both the
19 # legacy SAMBA directories and FHS compliant
21 AC_PREFIX_DEFAULT(/usr/local/samba)
24 [ --with-fhs Use FHS-compliant paths (default=no)],
25 libdir="\${prefix}/lib/samba",
26 libdir="\${prefix}/lib")
30 SAMBA_SOURCE="../../source"
31 ####################################################
32 # set the location location of the samba source tree
33 AC_ARG_WITH(samba-source,
34 [ --with-samba-source=DIR Where is the samba source tree (../../source)],
38 # Just in case anybody calls it without argument
40 AC_MSG_WARN([--with-samba-source called without argument - will use default])
43 SAMBA_SOURCE="$withval"
47 AC_SUBST(SAMBA_SOURCE)
49 dnl Unique-to-Samba variables we'll be playing with.
60 AC_SUBST(INSTALLCLIENTCMD_SH)
61 AC_SUBST(INSTALLCLIENTCMD_A)
63 AC_SUBST(EXTRA_BIN_PROGS)
64 AC_SUBST(EXTRA_SBIN_PROGS)
65 AC_SUBST(EXTRA_ALL_TARGETS)
68 [ --enable-debug Turn on compiler debugging information (default=no)],
69 [if eval "test x$enable_debug = xyes"; then
73 AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
74 [if eval "test x$enable_developer = xyes"; then
76 CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
79 # compile with optimization and without debugging by default, but
80 # allow people to set their own preference.
81 if test "x$CFLAGS" = x
86 #dnl Check if we use GNU ld
90 #dnl look for executable suffix
96 # Assume non-shared by default and override below
99 # these are the defaults, good for lots of systems
109 if test "$enable_shared" = "yes"; then
110 # this bit needs to be modified for each OS that is suported by
111 # smbwrapper. You need to specify how to created a shared library and
112 # how to compile C code to produce PIC object files
114 AC_MSG_CHECKING([ability to build shared libraries])
116 # and these are for particular systems
121 DYNEXP="-Wl,--export-dynamic"
123 SONAMEFLAG="-Wl,-soname="
129 if test "${GCC}" = "yes"; then
131 if test "${ac_cv_prog_gnu_ld}" = "yes"; then
136 ## ${CFLAGS} added for building 64-bit shared
137 ## libs using Sun's Compiler
138 LDSHFLAGS="-G \${CFLAGS}"
147 PICFLAG="-KPIC" # Is this correct for SunOS
149 *netbsd* | *freebsd*) BLDSHARED="true"
151 DYNEXP="-Wl,--export-dynamic"
152 SONAMEFLAG="-Wl,-soname,"
153 PICFLAG="-fPIC -DPIC"
155 *openbsd*) BLDSHARED="true"
157 DYNEXP="-Wl,-Bdynamic"
158 SONAMEFLAG="-Wl,-soname,"
166 ATTEMPT_WRAP32_BUILD=yes
168 LDSHFLAGS="-set_version sgi1.0 -shared"
169 SONAMEFLAG="-soname "
171 if test "${GCC}" = "yes"; then
179 LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry,-berok"
180 DYNEXP="-Wl,-brtl,-bexpall"
182 if test "${GCC}" != "yes"; then
183 ## for funky AIX compiler using strncpy()
184 CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
189 # Use special PIC flags for the native HP-UX compiler.
190 if test $ac_cv_prog_cc_Ae = yes; then
193 LDSHFLAGS="-B symbolic -b -z"
204 SONAMEFLAG="-Wl,-soname,"
212 SONAMEFLAG="-Wl,-soname,"
217 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
241 AC_MSG_RESULT($BLDSHARED)
242 AC_MSG_CHECKING([linker flags for shared libraries])
243 AC_MSG_RESULT([$LDSHFLAGS])
244 AC_MSG_CHECKING([compiler flags for position-independent code])
245 AC_MSG_RESULT([$PICFLAGS])
248 #######################################################
249 # test whether building a shared library actually works
250 if test $BLDSHARED = true; then
251 AC_CACHE_CHECK([whether building shared libraries actually works],
252 [ac_cv_shlib_works],[
254 # try building a trivial shared library
255 if test "$PICSUFFIX" = "po"; then
256 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
257 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
258 ac_cv_shlib_works=yes
260 $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c &&
261 mv shlib.$PICSUFFIX shlib.po &&
262 $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
263 ac_cv_shlib_works=yes
265 rm -f "shlib.$SHLIBEXT" shlib.po
267 if test $ac_cv_shlib_works = no; then