| 1 | dnl -*- mode: m4-mode -*-
|
|---|
| 2 | dnl Process this file with autoconf to produce a configure script.
|
|---|
| 3 |
|
|---|
| 4 | dnl We must use autotools 2.53 or above
|
|---|
| 5 | AC_PREREQ(2.53)
|
|---|
| 6 | AC_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 |
|
|---|
| 13 | dnl Checks for programs.
|
|---|
| 14 | AC_PROG_CC
|
|---|
| 15 | AC_PROG_INSTALL
|
|---|
| 16 |
|
|---|
| 17 | #################################################
|
|---|
| 18 | # Directory handling stuff to support both the
|
|---|
| 19 | # legacy SAMBA directories and FHS compliant
|
|---|
| 20 | # ones...
|
|---|
| 21 | AC_PREFIX_DEFAULT(/usr/local/samba)
|
|---|
| 22 |
|
|---|
| 23 | AC_ARG_WITH(fhs,
|
|---|
| 24 | [ --with-fhs Use FHS-compliant paths (default=no)],
|
|---|
| 25 | libdir="\${prefix}/lib/samba",
|
|---|
| 26 | libdir="\${prefix}/lib")
|
|---|
| 27 |
|
|---|
| 28 | AC_SUBST(libdir)
|
|---|
| 29 |
|
|---|
| 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)],
|
|---|
| 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 |
|
|---|
| 47 | AC_SUBST(SAMBA_SOURCE)
|
|---|
| 48 |
|
|---|
| 49 | dnl Unique-to-Samba variables we'll be playing with.
|
|---|
| 50 | AC_SUBST(CC)
|
|---|
| 51 | AC_SUBST(SHELL)
|
|---|
| 52 | AC_SUBST(LDSHFLAGS)
|
|---|
| 53 | AC_SUBST(SONAMEFLAG)
|
|---|
| 54 | AC_SUBST(SHLD)
|
|---|
| 55 | AC_SUBST(HOST_OS)
|
|---|
| 56 | AC_SUBST(PICFLAGS)
|
|---|
| 57 | AC_SUBST(PICSUFFIX)
|
|---|
| 58 | AC_SUBST(SHLIBEXT)
|
|---|
| 59 | AC_SUBST(INSTALLCLIENTCMD_SH)
|
|---|
| 60 | AC_SUBST(INSTALLCLIENTCMD_A)
|
|---|
| 61 | AC_SUBST(SHLIB_PROGS)
|
|---|
| 62 | AC_SUBST(EXTRA_BIN_PROGS)
|
|---|
| 63 | AC_SUBST(EXTRA_SBIN_PROGS)
|
|---|
| 64 | AC_SUBST(EXTRA_ALL_TARGETS)
|
|---|
| 65 |
|
|---|
| 66 | AC_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 |
|
|---|
| 72 | AC_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.
|
|---|
| 80 | if test "x$CFLAGS" = x
|
|---|
| 81 | then
|
|---|
| 82 | CFLAGS="-O ${CFLAGS}"
|
|---|
| 83 | fi
|
|---|
| 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 |
|
|---|
| 119 | if test x$FOUND_KRB5 = x"no"; then
|
|---|
| 120 | #################################################
|
|---|
| 121 | # see if this box has the SuSE location for the heimdal kerberos implementation
|
|---|
| 122 | AC_MSG_CHECKING(for /usr/include/heimdal)
|
|---|
| 123 | if 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
|
|---|
| 134 | else
|
|---|
| 135 | AC_MSG_RESULT(no)
|
|---|
| 136 | fi
|
|---|
| 137 | fi
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 | if test x$FOUND_KRB5 = x"no"; then
|
|---|
| 141 | #################################################
|
|---|
| 142 | # see if this box has the RedHat location for kerberos
|
|---|
| 143 | AC_MSG_CHECKING(for /usr/kerberos)
|
|---|
| 144 | if 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)
|
|---|
| 149 | else
|
|---|
| 150 | AC_MSG_RESULT(no)
|
|---|
| 151 | fi
|
|---|
| 152 | fi
|
|---|
| 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 |
|
|---|
| 170 | builddir=`pwd`
|
|---|
| 171 | AC_SUBST(builddir)
|
|---|
| 172 |
|
|---|
| 173 | # Assume non-shared by default and override below
|
|---|
| 174 | BLDSHARED="false"
|
|---|
| 175 |
|
|---|
| 176 | # these are the defaults, good for lots of systems
|
|---|
| 177 | HOST_OS="$host_os"
|
|---|
| 178 | LDSHFLAGS="-shared"
|
|---|
| 179 | SONAMEFLAG="#"
|
|---|
| 180 | SHLD="\${CC}"
|
|---|
| 181 | PICFLAGS=""
|
|---|
| 182 | PICSUFFIX="po"
|
|---|
| 183 | SHLIBEXT="so"
|
|---|
| 184 |
|
|---|
| 185 | # Since we are not embedded in the Samba tree, building shared modules is
|
|---|
| 186 | # really the only option.
|
|---|
| 187 | enable_shared=yes
|
|---|
| 188 |
|
|---|
| 189 | if test "$enable_shared" = "yes"; then
|
|---|
| 190 | # this bit needs to be modified for each OS that is suported by
|
|---|
| 191 | # smbwrapper. You need to specify how to created a shared library and
|
|---|
| 192 | # how to compile C code to produce PIC object files
|
|---|
| 193 |
|
|---|
| 194 | AC_MSG_CHECKING([ability to build shared libraries])
|
|---|
| 195 |
|
|---|
| 196 | # and these are for particular systems
|
|---|
| 197 | case "$host_os" in
|
|---|
| 198 | *linux*)
|
|---|
| 199 | BLDSHARED="true"
|
|---|
| 200 | LDSHFLAGS="-shared"
|
|---|
| 201 | DYNEXP="-Wl,--export-dynamic"
|
|---|
| 202 | PICFLAGS="-fPIC"
|
|---|
| 203 | SONAMEFLAG="-Wl,-soname="
|
|---|
| 204 | ;;
|
|---|
| 205 | *solaris*)
|
|---|
| 206 | BLDSHARED="true"
|
|---|
| 207 | LDSHFLAGS="-G"
|
|---|
| 208 | SONAMEFLAG="-h "
|
|---|
| 209 | if test "${GCC}" = "yes"; then
|
|---|
| 210 | PICFLAGS="-fPIC"
|
|---|
| 211 | if test "${ac_cv_prog_gnu_ld}" = "yes"; then
|
|---|
| 212 | DYNEXP="-Wl,-E"
|
|---|
| 213 | fi
|
|---|
| 214 | else
|
|---|
| 215 | PICFLAGS="-KPIC"
|
|---|
| 216 | ## ${CFLAGS} added for building 64-bit shared
|
|---|
| 217 | ## libs using Sun's Compiler
|
|---|
| 218 | LDSHFLAGS="-G \${CFLAGS}"
|
|---|
| 219 | PICSUFFIX="po.o"
|
|---|
| 220 | fi
|
|---|
| 221 | ;;
|
|---|
| 222 | *sunos*)
|
|---|
| 223 | BLDSHARED="true"
|
|---|
| 224 | LDSHFLAGS="-G"
|
|---|
| 225 | SONAMEFLAG="-Wl,-h,"
|
|---|
| 226 | PICFLAGS="-KPIC" # Is this correct for SunOS
|
|---|
| 227 | ;;
|
|---|
| 228 | *netbsd* | *freebsd*) BLDSHARED="true"
|
|---|
| 229 | LDSHFLAGS="-shared"
|
|---|
| 230 | DYNEXP="-Wl,--export-dynamic"
|
|---|
| 231 | SONAMEFLAG="-Wl,-soname,"
|
|---|
| 232 | PICFLAGS="-fPIC -DPIC"
|
|---|
| 233 | ;;
|
|---|
| 234 | *openbsd*) BLDSHARED="true"
|
|---|
| 235 | LDSHFLAGS="-shared"
|
|---|
| 236 | DYNEXP="-Wl,-Bdynamic"
|
|---|
| 237 | SONAMEFLAG="-Wl,-soname,"
|
|---|
| 238 | PICFLAGS="-fPIC"
|
|---|
| 239 | ;;
|
|---|
| 240 | *irix*)
|
|---|
| 241 | case "$host_os" in
|
|---|
| 242 | *irix6*)
|
|---|
| 243 | ;;
|
|---|
| 244 | esac
|
|---|
| 245 | ATTEMPT_WRAP32_BUILD=yes
|
|---|
| 246 | BLDSHARED="true"
|
|---|
| 247 | LDSHFLAGS="-set_version sgi1.0 -shared"
|
|---|
| 248 | SONAMEFLAG="-soname "
|
|---|
| 249 | SHLD="\${LD}"
|
|---|
| 250 | if test "${GCC}" = "yes"; then
|
|---|
| 251 | PICFLAGS="-fPIC"
|
|---|
| 252 | else
|
|---|
| 253 | PICFLAGS="-KPIC"
|
|---|
| 254 | fi
|
|---|
| 255 | ;;
|
|---|
| 256 | *aix*)
|
|---|
| 257 | BLDSHARED="true"
|
|---|
| 258 | LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry,-berok"
|
|---|
| 259 | DYNEXP="-Wl,-brtl,-bexpall"
|
|---|
| 260 | PICFLAGS="-O2"
|
|---|
| 261 | if test "${GCC}" != "yes"; then
|
|---|
| 262 | ## for funky AIX compiler using strncpy()
|
|---|
| 263 | CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
|
|---|
| 264 | fi
|
|---|
| 265 | ;;
|
|---|
| 266 | *hpux*)
|
|---|
| 267 | SHLIBEXT="sl"
|
|---|
| 268 | # Use special PIC flags for the native HP-UX compiler.
|
|---|
| 269 | if test $ac_cv_prog_cc_Ae = yes; then
|
|---|
| 270 | BLDSHARED="true"
|
|---|
| 271 | SHLD="/usr/bin/ld"
|
|---|
| 272 | LDSHFLAGS="-B symbolic -b -z"
|
|---|
| 273 | SONAMEFLAG="+h "
|
|---|
| 274 | PICFLAGS="+z"
|
|---|
| 275 | fi
|
|---|
| 276 | DYNEXP="-Wl,-E"
|
|---|
| 277 | ;;
|
|---|
| 278 | *qnx*)
|
|---|
| 279 | ;;
|
|---|
| 280 | *osf*)
|
|---|
| 281 | BLDSHARED="true"
|
|---|
| 282 | LDSHFLAGS="-shared"
|
|---|
| 283 | SONAMEFLAG="-Wl,-soname,"
|
|---|
| 284 | PICFLAGS="-fPIC"
|
|---|
| 285 | ;;
|
|---|
| 286 | *sco*)
|
|---|
| 287 | ;;
|
|---|
| 288 | *unixware*)
|
|---|
| 289 | BLDSHARED="true"
|
|---|
| 290 | LDSHFLAGS="-shared"
|
|---|
| 291 | SONAMEFLAG="-Wl,-soname,"
|
|---|
| 292 | PICFLAGS="-KPIC"
|
|---|
| 293 | ;;
|
|---|
| 294 | *next2*)
|
|---|
| 295 | ;;
|
|---|
| 296 | *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
|
|---|
| 297 | ;;
|
|---|
| 298 | *sysv4*)
|
|---|
| 299 | case "$host" in
|
|---|
| 300 | *-univel-*)
|
|---|
| 301 | LDSHFLAGS="-G"
|
|---|
| 302 | DYNEXP="-Bexport"
|
|---|
| 303 | ;;
|
|---|
| 304 | *mips-sni-sysv4*)
|
|---|
| 305 | ;;
|
|---|
| 306 | esac
|
|---|
| 307 | ;;
|
|---|
| 308 |
|
|---|
| 309 | *sysv5*)
|
|---|
| 310 | LDSHFLAGS="-G"
|
|---|
| 311 | ;;
|
|---|
| 312 | *vos*)
|
|---|
| 313 | BLDSHARED="false"
|
|---|
| 314 | LDSHFLAGS=""
|
|---|
| 315 | ;;
|
|---|
| 316 | *)
|
|---|
| 317 | ;;
|
|---|
| 318 | esac
|
|---|
| 319 | AC_SUBST(DYNEXP)
|
|---|
| 320 | AC_MSG_RESULT($BLDSHARED)
|
|---|
| 321 | AC_MSG_CHECKING([linker flags for shared libraries])
|
|---|
| 322 | AC_MSG_RESULT([$LDSHFLAGS])
|
|---|
| 323 | AC_MSG_CHECKING([compiler flags for position-independent code])
|
|---|
| 324 | AC_MSG_RESULT([$PICFLAGS])
|
|---|
| 325 | fi
|
|---|
| 326 |
|
|---|
| 327 | #######################################################
|
|---|
| 328 | # test whether building a shared library actually works
|
|---|
| 329 | if test $BLDSHARED = true; then
|
|---|
| 330 | AC_CACHE_CHECK([whether building shared libraries actually works],
|
|---|
| 331 | [ac_cv_shlib_works],[
|
|---|
| 332 | ac_cv_shlib_works=no
|
|---|
| 333 | # try building a trivial shared library
|
|---|
| 334 | if test "$PICSUFFIX" = "po"; then
|
|---|
| 335 | $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
|
|---|
| 336 | $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
|
|---|
| 337 | ac_cv_shlib_works=yes
|
|---|
| 338 | else
|
|---|
| 339 | $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c &&
|
|---|
| 340 | mv shlib.$PICSUFFIX shlib.po &&
|
|---|
| 341 | $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
|
|---|
| 342 | ac_cv_shlib_works=yes
|
|---|
| 343 | fi
|
|---|
| 344 | rm -f "shlib.$SHLIBEXT" shlib.po
|
|---|
| 345 | ])
|
|---|
| 346 | if test $ac_cv_shlib_works = no; then
|
|---|
| 347 | BLDSHARED=false
|
|---|
| 348 | fi
|
|---|
| 349 | fi
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
|
|---|
| 354 | AC_OUTPUT(Makefile)
|
|---|