summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/aclocal.m472
-rw-r--r--source4/build/m4/rewrite.m4117
-rw-r--r--source4/build/smb_build/check_cc.m473
-rw-r--r--source4/build/smb_build/check_ld.m423
-rw-r--r--source4/build/smb_build/check_path.m4189
-rw-r--r--source4/build/smb_build/check_perl.m428
-rw-r--r--source4/build/smb_build/check_shld.m421
-rw-r--r--source4/build/smb_build/check_types.m456
-rw-r--r--source4/build/smb_build/env.m442
-rw-r--r--source4/build/smb_build/public.m412
-rw-r--r--source4/configure.in198
11 files changed, 459 insertions, 372 deletions
diff --git a/source4/aclocal.m4 b/source4/aclocal.m4
index 4f42b50f84..e63ee54d8d 100644
--- a/source4/aclocal.m4
+++ b/source4/aclocal.m4
@@ -3,7 +3,6 @@ dnl if the cache file is inconsistent with the current host,
dnl target and build system types, execute CMD or print a default
dnl error message.
AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
- AC_REQUIRE([AC_CANONICAL_SYSTEM])
AC_MSG_CHECKING([config.cache system type])
if { test x"${ac_cv_host_system_type+set}" = x"set" &&
test x"$ac_cv_host_system_type" != x"$host"; } ||
@@ -560,69 +559,12 @@ if test "$2" != "/usr/lib" ; then
fi
])
-dnl AC_ENABLE_SHARED - implement the --enable-shared flag
-dnl Usage: AC_ENABLE_SHARED[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-dnl `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(shared,
-changequote(<<, >>)dnl
-<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
-
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
-])
-
-dnl AC_ENABLE_STATIC - implement the --enable-static flag
-dnl Usage: AC_ENABLE_STATIC[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-dnl `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(static,
-changequote(<<, >>)dnl
-<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
-])
-
-dnl AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)])
-
sinclude(build/smb_build/public.m4)
sinclude(build/smb_build/core.m4)
+sinclude(build/smb_build/env.m4)
+sinclude(build/smb_build/check_path.m4)
+sinclude(build/smb_build/check_perl.m4)
+sinclude(build/smb_build/check_cc.m4)
+sinclude(build/smb_build/check_ld.m4)
+sinclude(build/smb_build/check_shld.m4)
+sinclude(build/smb_build/check_types.m4)
diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4
index cfe0f71396..03049acc9c 100644
--- a/source4/build/m4/rewrite.m4
+++ b/source4/build/m4/rewrite.m4
@@ -1,94 +1,12 @@
dnl Checks for programs.
-
-AC_PATH_PROG(PERL, perl)
-if test x"$PERL" = x""; then
- AC_MSG_WARN([No version of perl was not found!])
- AC_MSG_ERROR([Please Install perl from http://www.perl.com/])
-fi
-if test x"$debug" = x"yes";then
- PERL="$PERL -W"
-fi
-
-AC_PROG_CC
-AC_PROG_INSTALL
-
-# compile with optimization and without debugging by default, but
-# allow people to set their own preference.
-if test "x$CFLAGS" = x
-then
- CFLAGS="-O ${CFLAGS}"
-fi
-
-dnl Check if we use GNU ld
-LD=ld
-AC_PROG_LD_GNU
-
-dnl needed before AC_TRY_COMPILE
-AC_ISC_POSIX
-
-dnl look for executable suffix
-AC_EXEEXT
-
-dnl Check if C compiler understands -c and -o at the same time
-AC_PROG_CC_C_O
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
- BROKEN_CC=
-else
- BROKEN_CC=#
-fi
-AC_SUBST(BROKEN_CC)
-
-AC_CACHE_CHECK([that the C compiler can precompile header files],samba_cv_precompiled_headers, [
- dnl Check whether the compiler can generate precompiled headers
- touch conftest.h
- if ${CC-cc} conftest.h 2> /dev/null && test -f conftest.h.gch; then
- samba_cv_precompiled_headers=yes
- else
- samba_cv_precompiled_headers=no
- fi])
-PCH_AVAILABLE="#"
-if test x"$samba_cv_precompiled_headers" = x"yes"; then
- PCH_AVAILABLE=""
-fi
-AC_SUBST(PCH_AVAILABLE)
-
-
-dnl Check if the C compiler understands volatile (it should, being ANSI).
-AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
- AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
- samba_cv_volatile=yes,samba_cv_volatile=no)])
-if test x"$samba_cv_volatile" = x"yes"; then
- AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
-fi
-
-
-AC_CANONICAL_SYSTEM
-
-dnl Add #include for broken IRIX header files
- case "$host_os" in
- *irix6*) AC_ADD_INCLUDE(<standards.h>)
- ;;
-esac
-
-AC_VALIDATE_CACHE_SYSTEM_TYPE
+dnl Unique-to-Samba variables we'll be playing with.
DYNEXP=
-AC_HEADER_STDC
-AC_CHECK_HEADERS(stdbool.h)
-
-AC_CHECK_SIZEOF(short,cross)
-AC_CHECK_SIZEOF(int,cross)
-AC_CHECK_SIZEOF(long,cross)
-AC_CHECK_SIZEOF(long long,cross)
-if test x"$ac_cv_type_long_long" != x"yes";then
- AC_MSG_ERROR([Sorry we need type 'long long'])
-fi
-if test $ac_cv_sizeof_long_long -lt 8;then
- AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8])
-fi
-AC_CHECK_TYPE(_Bool)
-
+AC_SUBST(SHLIBEXT)
+AC_SUBST(LDSHFLAGS)
+AC_SUBST(SONAMEFLAG)
+AC_SUBST(PICFLAG)
#
# Config CPPFLAG settings for strange OS's that must be set
# before other tests.
@@ -345,11 +263,6 @@ AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h)
-AC_C_CONST
-AC_C_INLINE
-AC_C_BIGENDIAN
-AC_C_CHAR_UNSIGNED
-
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
@@ -363,15 +276,7 @@ AC_CHECK_TYPE(loff_t,off_t)
AC_CHECK_TYPE(offset_t,loff_t)
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(wchar_t, unsigned short)
-AC_CHECK_TYPE(uint_t, unsigned int)
-AC_CHECK_TYPE(int8_t, signed char)
-AC_CHECK_TYPE(uint8_t, unsigned char)
-AC_CHECK_TYPE(int16_t, short)
-AC_CHECK_TYPE(uint16_t, unsigned short)
-AC_CHECK_TYPE(int32_t, long)
-AC_CHECK_TYPE(uint32_t, unsigned long)
-AC_CHECK_TYPE(int64_t, long long)
-AC_CHECK_TYPE(uint64_t, unsigned long long)
+
############################################
# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
@@ -824,16 +729,6 @@ if test $ac_cv_shlib_works = no; then
fi
fi
-################
-
-AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
-AC_TRY_RUN([#include <stdio.h>
-main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
-samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
-if test x"$samba_cv_have_longlong" = x"yes"; then
- AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's])
-fi
-
#
# Check if the compiler supports the LL prefix on long long integers.
# AIX needs this.
diff --git a/source4/build/smb_build/check_cc.m4 b/source4/build/smb_build/check_cc.m4
new file mode 100644
index 0000000000..0a430a4fcf
--- /dev/null
+++ b/source4/build/smb_build/check_cc.m4
@@ -0,0 +1,73 @@
+dnl SMB Build Environment CC Checks
+dnl -------------------------------------------------------
+dnl Copyright (C) Stefan (metze) Metzmacher 2004
+dnl Released under the GNU GPL
+dnl -------------------------------------------------------
+dnl
+dnl _SMB_BUILD_CHECK_CC(
+dnl 1:dummy
+dnl )
+
+dnl #######################################################
+dnl ### And now the implementation ###
+dnl #######################################################
+
+dnl _SMB_BUILD_CHECK_CC(
+dnl 1:dummy
+dnl )
+AC_DEFUN([_SMB_BUILD_CHECK_CC],
+[
+ AC_PROG_CC
+ if test x"$CC" = x""; then
+ AC_MSG_WARN([No c compiler was not found!])
+ AC_MSG_ERROR([Please Install gcc from http://gcc.gnu.org/])
+ fi
+
+ AC_PROG_CC_STDC
+
+ # compile with optimization and without debugging by default, but
+ # allow people to set their own preference.
+ if test "x$CFLAGS" = x; then
+ CFLAGS="-O ${CFLAGS}"
+ fi
+
+ dnl needed before AC_TRY_COMPILE
+ AC_ISC_POSIX
+
+ dnl Check if C compiler understands -c and -o at the same time
+ AC_PROG_CC_C_O
+ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
+ BROKEN_CC=
+ else
+ BROKEN_CC=#
+ fi
+ AC_SUBST(BROKEN_CC)
+
+ AC_CACHE_CHECK([that the C compiler can precompile header files],samba_cv_precompiled_headers, [
+ dnl Check whether the compiler can generate precompiled headers
+ touch conftest.h
+ if ${CC-cc} conftest.h 2> /dev/null && test -f conftest.h.gch; then
+ samba_cv_precompiled_headers=yes
+ else
+ samba_cv_precompiled_headers=no
+ fi])
+ PCH_AVAILABLE="#"
+ if test x"$samba_cv_precompiled_headers" = x"yes"; then
+ PCH_AVAILABLE=""
+ fi
+ AC_SUBST(PCH_AVAILABLE)
+
+
+ dnl Check if the C compiler understands volatile (it should, being ANSI).
+ AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
+ AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
+ samba_cv_volatile=yes,samba_cv_volatile=no)])
+ if test x"$samba_cv_volatile" = x"yes"; then
+ AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
+ fi
+
+ AC_C_CONST
+ AC_C_INLINE
+
+ AC_PROG_CPP
+])
diff --git a/source4/build/smb_build/check_ld.m4 b/source4/build/smb_build/check_ld.m4
new file mode 100644
index 0000000000..94311e02de
--- /dev/null
+++ b/source4/build/smb_build/check_ld.m4
@@ -0,0 +1,23 @@
+dnl SMB Build Environment LD Checks
+dnl -------------------------------------------------------
+dnl Copyright (C) Stefan (metze) Metzmacher 2004
+dnl Released under the GNU GPL
+dnl -------------------------------------------------------
+dnl
+dnl _SMB_BUILD_CHECK_LD(
+dnl 1:dummy
+dnl )
+
+dnl #######################################################
+dnl ### And now the implementation ###
+dnl #######################################################
+
+dnl _SMB_BUILD_CHECK_LD(
+dnl 1:dummy
+dnl )
+AC_DEFUN([_SMB_BUILD_CHECK_LD],
+[
+ dnl Check if we use GNU ld
+ AC_PATH_PROG(LD, ld)
+ AC_PROG_LD_GNU
+])
diff --git a/source4/build/smb_build/check_path.m4 b/source4/build/smb_build/check_path.m4
new file mode 100644
index 0000000000..316df59f31
--- /dev/null
+++ b/source4/build/smb_build/check_path.m4
@@ -0,0 +1,189 @@
+dnl SMB Build Environment Path Checks
+dnl -------------------------------------------------------
+dnl Copyright (C) Stefan (metze) Metzmacher 2004
+dnl Released under the GNU GPL
+dnl -------------------------------------------------------
+dnl
+dnl _SMB_BUILD_CHECK_PATH(
+dnl 1:dummy
+dnl )
+
+dnl #######################################################
+dnl ### And now the implementation ###
+dnl #######################################################
+
+dnl _SMB_BUILD_CHECK_PATH(
+dnl 1:dummy
+dnl )
+AC_DEFUN([_SMB_BUILD_CHECK_PATH],
+[
+#################################################
+# Directory handling stuff to support both the
+# legacy SAMBA directories and FHS compliant
+# ones...
+AC_PREFIX_DEFAULT(/usr/local/samba)
+
+AC_ARG_WITH(fhs,
+[ --with-fhs Use FHS-compliant paths (default=no)],
+ configdir="${sysconfdir}/samba"
+ lockdir="\${VARDIR}/cache/samba"
+ piddir="\${VARDIR}/run/samba"
+ logfilebase="\${VARDIR}/log/samba"
+ privatedir="\${CONFIGDIR}/private"
+ libdir="\${prefix}/lib/samba"
+ swatdir="\${DATADIR}/samba/swat",
+ configdir="\${LIBDIR}"
+ logfilebase="\${VARDIR}"
+ lockdir="\${VARDIR}/locks"
+ piddir="\${VARDIR}/locks"
+ privatedir="\${prefix}/private"
+ swatdir="\${prefix}/swat")
+
+#################################################
+# set private directory location
+AC_ARG_WITH(privatedir,
+[ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
+[ case "$withval" in
+ yes|no)
+ #
+ # Just in case anybody calls it without argument
+ #
+ AC_MSG_WARN([--with-privatedir called without argument - will use default])
+ ;;
+ * )
+ privatedir="$withval"
+ ;;
+ esac])
+
+#################################################
+# set lock directory location
+AC_ARG_WITH(lockdir,
+[ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
+[ case "$withval" in
+ yes|no)
+ #
+ # Just in case anybody calls it without argument
+ #
+ AC_MSG_WARN([--with-lockdir called without argument - will use default])
+ ;;
+ * )
+ lockdir="$withval"
+ ;;
+ esac])
+
+#################################################
+# set pid directory location
+AC_ARG_WITH(piddir,
+[ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)],
+[ case "$withval" in
+ yes|no)
+ #
+ # Just in case anybody calls it without argument
+ #
+ AC_MSG_WARN([--with-piddir called without argument - will use default])
+ ;;
+ * )
+ piddir="$withval"
+ ;;
+ esac])
+
+#################################################
+# set configuration directory location
+AC_ARG_WITH(configdir,
+[ --with-configdir=DIR Where to put configuration files (\$libdir)],
+[ case "$withval" in
+ yes|no)
+ #
+ # Just in case anybody does it
+ #
+ AC_MSG_WARN([--with-configdir called without argument - will use default])
+ ;;
+ * )
+ configdir="$withval"
+ ;;
+ esac])
+
+#################################################
+# set log directory location
+AC_ARG_WITH(logfilebase,
+[ --with-logfilebase=DIR Where to put log files (\$(VARDIR))],
+[ case "$withval" in
+ yes|no)
+ #
+ # Just in case anybody does it
+ #
+ AC_MSG_WARN([--with-logfilebase called without argument - will use default])
+ ;;
+ * )
+ logfilebase="$withval"
+ ;;
+ esac])
+
+AC_SUBST(configdir)
+AC_SUBST(lockdir)
+AC_SUBST(piddir)
+AC_SUBST(logfilebase)
+AC_SUBST(privatedir)
+AC_SUBST(bindir)
+AC_SUBST(sbindir)
+
+debug=no
+AC_ARG_ENABLE(debug,
+[ --enable-debug Turn on compiler debugging information (default=no)],
+ [if eval "test x$enable_debug = xyes"; then
+ debug=yes
+ CFLAGS="${CFLAGS} -g"
+ fi])
+
+developer=no
+AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
+ [if eval "test x$enable_developer = xyes"; then
+ developer=yes
+ CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
+ fi])
+
+AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
+ [if eval "test x$enable_krb5developer = xyes"; then
+ developer=yes
+ CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
+ fi])
+
+experimental=no
+AC_ARG_ENABLE(experimental, [ --enable-experimental Turn on experimental features (default=no)],
+ [if eval "test x$enable_experimental = xyes"; then
+ experimental=yes
+ fi])
+
+
+
+dnl exclude these modules
+AC_ARG_WITH(exclude-modules,
+[ --with-exclude-modules=MODULES Comma-seperated list of names of modules to exclude from build],
+[ if test $withval; then
+ for i in `echo $withval | sed -e's/,/ /g'`
+ do
+ eval SMB_MODULE_$i=NOT
+ done
+fi ])
+
+dnl Always built these modules shared
+AC_ARG_WITH(shared-modules,
+[ --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared],
+[ if test $withval; then
+ for i in `echo $withval | sed -e's/,/ /g'`
+ do
+ eval SMB_MODULE_$i=SHARED
+ done
+fi ])
+
+dnl Always built these modules static
+AC_ARG_WITH(static-modules,
+[ --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in],
+[ if test $withval; then
+ for i in `echo $withval | sed -e's/,/ /g'`
+ do
+ eval SMB_MODULE_$i=STATIC
+ done
+fi ])
+
+])
diff --git a/source4/build/smb_build/check_perl.m4 b/source4/build/smb_build/check_perl.m4
new file mode 100644
index 0000000000..ff43650b3e
--- /dev/null
+++ b/source4/build/smb_build/check_perl.m4
@@ -0,0 +1,28 @@
+dnl SMB Build Environment Perl Checks
+dnl -------------------------------------------------------
+dnl Copyright (C) Stefan (metze) Metzmacher 2004
+dnl Released under the GNU GPL
+dnl -------------------------------------------------------
+dnl
+dnl _SMB_BUILD_CHECK_PERL(
+dnl 1:dummy
+dnl )
+
+dnl #######################################################
+dnl ### And now the implementation ###
+dnl #######################################################
+
+dnl _SMB_BUILD_CHECK_PERL(
+dnl 1:dummy
+dnl )
+AC_DEFUN([_SMB_BUILD_CHECK_PERL],
+[
+ AC_PATH_PROG(PERL, perl)
+ if test x"$PERL" = x""; then
+ AC_MSG_WARN([No version of perl was not found!])
+ AC_MSG_ERROR([Please Install perl from http://www.perl.com/])
+ fi
+ if test x"$debug" = x"yes";then
+ PERL="$PERL -W"
+ fi
+])
diff --git a/source4/build/smb_build/check_shld.m4 b/source4/build/smb_build/check_shld.m4
new file mode 100644
index 0000000000..ffeb2ca1cf
--- /dev/null
+++ b/source4/build/smb_build/check_shld.m4
@@ -0,0 +1,21 @@
+dnl SMB Build Environment Shared Ld Checks
+dnl -------------------------------------------------------
+dnl Copyright (C) Stefan (metze) Metzmacher 2004
+dnl Released under the GNU GPL
+dnl -------------------------------------------------------
+dnl
+dnl _SMB_BUILD_CHECK_SHLD(
+dnl 1:dummy
+dnl )
+
+dnl #######################################################
+dnl ### And now the implementation ###
+dnl #######################################################
+
+dnl _SMB_BUILD_CHECK_SHLD(
+dnl 1:dummy
+dnl )
+AC_DEFUN([_SMB_BUILD_CHECK_SHLD],
+[
+
+])
diff --git a/source4/build/smb_build/check_types.m4 b/source4/build/smb_build/check_types.m4
new file mode 100644
index 0000000000..40d00fa820
--- /dev/null
+++ b/source4/build/smb_build/check_types.m4
@@ -0,0 +1,56 @@
+dnl SMB Build Environment Types Checks
+dnl -------------------------------------------------------
+dnl Copyright (C) Stefan (metze) Metzmacher 2004
+dnl Released under the GNU GPL
+dnl -------------------------------------------------------
+dnl
+dnl _SMB_BUILD_CHECK_TYPES(
+dnl 1:dummy
+dnl )
+
+dnl #######################################################
+dnl ### And now the implementation ###
+dnl #######################################################
+
+dnl _SMB_BUILD_CHECK_TYPES(
+dnl 1:dummy
+dnl )
+AC_DEFUN([_SMB_BUILD_CHECK_TYPES],
+[
+ dnl Add #include for broken IRIX header files
+ case "$host_os" in
+ *irix6*) AC_ADD_INCLUDE(<standards.h>)
+ ;;
+ esac
+
+ AC_C_BIGENDIAN
+
+ AC_HEADER_STDC
+
+ dnl This should be removed and fixed cleanly --metze
+ _AC_INCLUDES_DEFAULT_REQUIREMENTS
+
+ AC_CHECK_HEADERS(stdbool.h)
+
+ AC_CHECK_SIZEOF(short,cross)
+ AC_CHECK_SIZEOF(int,cross)
+ AC_CHECK_SIZEOF(long,cross)
+ AC_CHECK_SIZEOF(long long,cross)
+ if test x"$ac_cv_type_long_long" != x"yes";then
+ AC_MSG_ERROR([Sorry we need type 'long long'])
+ fi
+ if test $ac_cv_sizeof_long_long -lt 8;then
+ AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8])
+ fi
+ AC_CHECK_TYPE(_Bool)
+ AC_CHECK_TYPE(uint_t, unsigned int)
+ AC_CHECK_TYPE(int8_t, signed char)
+ AC_CHECK_TYPE(uint8_t, unsigned char)
+ AC_CHECK_TYPE(int16_t, short)
+ AC_CHECK_TYPE(uint16_t, unsigned short)
+ AC_CHECK_TYPE(int32_t, long)
+ AC_CHECK_TYPE(uint32_t, unsigned long)
+ AC_CHECK_TYPE(int64_t, long long)
+ AC_CHECK_TYPE(uint64_t, unsigned long long)
+
+])
diff --git a/source4/build/smb_build/env.m4 b/source4/build/smb_build/env.m4
new file mode 100644
index 0000000000..ef9aa5e514
--- /dev/null
+++ b/source4/build/smb_build/env.m4
@@ -0,0 +1,42 @@
+dnl SMB Build Environment Checks
+dnl -------------------------------------------------------
+dnl Copyright (C) Stefan (metze) Metzmacher 2004
+dnl Released under the GNU GPL
+dnl -------------------------------------------------------
+dnl
+dnl _SMB_BUILD_ENV(
+dnl 1:dummy
+dnl )
+
+dnl #######################################################
+dnl ### And now the implementation ###
+dnl #######################################################
+
+dnl _SMB_BUILD_ENV(
+dnl 1:dummy
+dnl )
+AC_DEFUN([_SMB_BUILD_ENV],
+[
+ SMB_VERSION_STRING=`cat include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2`
+ echo "SAMBA VERSION: ${SMB_VERSION_STRING}"
+
+ _SMB_BUILD_CHECK_PATH([])
+
+ _SMB_BUILD_CHECK_PERL([])
+
+ _SMB_BUILD_CHECK_CC([])
+
+ _SMB_BUILD_CHECK_LD([])
+
+ _SMB_BUILD_CHECK_SHLD([])
+
+ AC_CANONICAL_BUILD
+ AC_CANONICAL_HOST
+ AC_CANONICAL_TARGET
+
+ AC_VALIDATE_CACHE_SYSTEM_TYPE
+
+ _SMB_BUILD_CHECK_TYPES([])
+
+ AC_PROG_INSTALL
+])
diff --git a/source4/build/smb_build/public.m4 b/source4/build/smb_build/public.m4
index 0d4be5313d..9da2b4f801 100644
--- a/source4/build/smb_build/public.m4
+++ b/source4/build/smb_build/public.m4
@@ -109,6 +109,10 @@ dnl 1: inputfile
dnl 2: comment
dnl )
dnl
+dnl SMB_ENV_CHECK(
+dnl 1:dummy
+dnl )
+dnl
dnl SMB_AC_OUTPUT(
dnl 1: outputfile
dnl )
@@ -512,6 +516,14 @@ sinclude($1)
###################################
])
+dnl SMB_ENV_CHECK(
+dnl 1:dummy
+dnl )
+AC_DEFUN([SMB_ENV_CHECK],
+[
+ _SMB_BUILD_ENV($1)
+])
+
dnl SMB_AC_OUTPUT(
dnl 1: outputfile
dnl )
diff --git a/source4/configure.in b/source4/configure.in
index 7539da4290..5e4313093c 100644
--- a/source4/configure.in
+++ b/source4/configure.in
@@ -7,203 +7,9 @@ dnl AC_PREREQ(2.53)
AC_INIT(include/includes.h)
AC_CONFIG_HEADER(include/config.h)
-AC_DISABLE_STATIC
-AC_ENABLE_SHARED
+SMB_ENV_CHECK([])
-SMB_VERSION_STRING=`cat include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2`
-echo "SAMBA VERSION: ${SMB_VERSION_STRING}"
-
-#################################################
-# Directory handling stuff to support both the
-# legacy SAMBA directories and FHS compliant
-# ones...
-AC_PREFIX_DEFAULT(/usr/local/samba)
-
-AC_ARG_WITH(fhs,
-[ --with-fhs Use FHS-compliant paths (default=no)],
- configdir="${sysconfdir}/samba"
- lockdir="\${VARDIR}/cache/samba"
- piddir="\${VARDIR}/run/samba"
- logfilebase="\${VARDIR}/log/samba"
- privatedir="\${CONFIGDIR}/private"
- libdir="\${prefix}/lib/samba"
- swatdir="\${DATADIR}/samba/swat",
- configdir="\${LIBDIR}"
- logfilebase="\${VARDIR}"
- lockdir="\${VARDIR}/locks"
- piddir="\${VARDIR}/locks"
- privatedir="\${prefix}/private"
- swatdir="\${prefix}/swat")
-
-#################################################
-# set private directory location
-AC_ARG_WITH(privatedir,
-[ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody calls it without argument
- #
- AC_MSG_WARN([--with-privatedir called without argument - will use default])
- ;;
- * )
- privatedir="$withval"
- ;;
- esac])
-
-#################################################
-# set lock directory location
-AC_ARG_WITH(lockdir,
-[ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody calls it without argument
- #
- AC_MSG_WARN([--with-lockdir called without argument - will use default])
- ;;
- * )
- lockdir="$withval"
- ;;
- esac])
-
-#################################################
-# set pid directory location
-AC_ARG_WITH(piddir,
-[ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody calls it without argument
- #
- AC_MSG_WARN([--with-piddir called without argument - will use default])
- ;;
- * )
- piddir="$withval"
- ;;
- esac])
-
-#################################################
-# set configuration directory location
-AC_ARG_WITH(configdir,
-[ --with-configdir=DIR Where to put configuration files (\$libdir)],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody does it
- #
- AC_MSG_WARN([--with-configdir called without argument - will use default])
- ;;
- * )
- configdir="$withval"
- ;;
- esac])
-
-#################################################
-# set log directory location
-AC_ARG_WITH(logfilebase,
-[ --with-logfilebase=DIR Where to put log files (\$(VARDIR))],
-[ case "$withval" in
- yes|no)
- #
- # Just in case anybody does it
- #
- AC_MSG_WARN([--with-logfilebase called without argument - will use default])
- ;;
- * )
- logfilebase="$withval"
- ;;
- esac])
-
-AC_SUBST(configdir)
-AC_SUBST(lockdir)
-AC_SUBST(piddir)
-AC_SUBST(logfilebase)
-AC_SUBST(privatedir)
-AC_SUBST(bindir)
-AC_SUBST(sbindir)
-
-dnl Unique-to-Samba variables we'll be playing with.
-AC_SUBST(SHELL)
-AC_SUBST(LDSHFLAGS)
-AC_SUBST(SONAMEFLAG)
-AC_SUBST(SHLD)
-AC_SUBST(HOST_OS)
-AC_SUBST(PICFLAG)
-AC_SUBST(PICSUFFIX)
-AC_SUBST(POBAD_CC)
-AC_SUBST(SHLIBEXT)
-AC_SUBST(INSTALLCLIENTCMD_SH)
-AC_SUBST(INSTALLCLIENTCMD_A)
-AC_SUBST(LIBSMBCLIENT_SHARED)
-AC_SUBST(LIBSMBCLIENT)
-AC_SUBST(PRINTLIBS)
-AC_SUBST(AUTHLIBS)
-AC_SUBST(ACLLIBS)
-AC_SUBST(SHLIB_PROGS)
-AC_SUBST(SMBWRAPPER)
-AC_SUBST(EXTRA_BIN_PROGS)
-AC_SUBST(EXTRA_SBIN_PROGS)
-AC_SUBST(EXTRA_ALL_TARGETS)
-
-debug=no
-AC_ARG_ENABLE(debug,
-[ --enable-debug Turn on compiler debugging information (default=no)],
- [if eval "test x$enable_debug = xyes"; then
- debug=yes
- CFLAGS="${CFLAGS} -g"
- fi])
-
-developer=no
-AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)],
- [if eval "test x$enable_developer = xyes"; then
- developer=yes
- CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
- fi])
-
-AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
- [if eval "test x$enable_krb5developer = xyes"; then
- developer=yes
- CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
- fi])
-
-experimental=no
-AC_ARG_ENABLE(experimental, [ --enable-experimental Turn on experimental features (default=no)],
- [if eval "test x$enable_experimental = xyes"; then
- experimental=yes
- fi])
-
-sinclude(build/m4/rewrite.m4)
-
-dnl exclude these modules
-AC_ARG_WITH(exclude-modules,
-[ --with-exclude-modules=MODULES Comma-seperated list of names of modules to exclude from build],
-[ if test $withval; then
- for i in `echo $withval | sed -e's/,/ /g'`
- do
- eval SMB_MODULE_$i=NOT
- done
-fi ])
-
-dnl Always built these modules shared
-AC_ARG_WITH(shared-modules,
-[ --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared],
-[ if test $withval; then
- for i in `echo $withval | sed -e's/,/ /g'`
- do
- eval SMB_MODULE_$i=SHARED
- done
-fi ])
-
-dnl Always built these modules static
-AC_ARG_WITH(static-modules,
-[ --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in],
-[ if test $withval; then
- for i in `echo $withval | sed -e's/,/ /g'`
- do
- eval SMB_MODULE_$i=STATIC
- done
-fi ])
+SMB_INCLUDE_M4(build/m4/rewrite.m4)
SMB_INCLUDE_M4(lib/popt/config.m4)
SMB_INCLUDE_M4(lib/iconv.m4)