build_docs: Use 'make distclean' instead of 'make clean'.
[sfrench/samba-autobuild/.git] / examples / VFS / configure.in
index 68931ad3d8875f5426e2a49057e65a7aad534a76..b8e10d482b820773c6f1e277cf173f632997d9b0 100644 (file)
@@ -5,14 +5,14 @@ dnl We must use autotools 2.53 or above
 AC_PREREQ(2.53)
 AC_INIT(Makefile.in)
 
-#dnl Uncomment this if you want to use your own define's too
-#AC_CONFIG_HEADER(module_config.h)
+AC_CONFIG_HEADER(module_config.h)
 #dnl To make sure that didn't get #define PACKAGE_* in modules_config.h
 #echo "" > confdefs.h
 
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
+AC_CANONICAL_HOST
 
 #################################################
 # Directory handling stuff to support both the
@@ -55,7 +55,6 @@ AC_SUBST(SHLD)
 AC_SUBST(HOST_OS)
 AC_SUBST(PICFLAGS)
 AC_SUBST(PICSUFFIX)
-AC_SUBST(POBAD_CC)
 AC_SUBST(SHLIBEXT)
 AC_SUBST(INSTALLCLIENTCMD_SH)
 AC_SUBST(INSTALLCLIENTCMD_A)
@@ -85,11 +84,11 @@ fi
 
   #################################################
   # check for krb5-config from recent MIT and Heimdal kerberos 5
-  AC_PATH_PROG(KRB5_CONFIG, krb5-config)
+  AC_PATH_PROG(KRB5CONFIG, krb5-config)
   AC_MSG_CHECKING(for working krb5-config)
-  if test -x "$KRB5_CONFIG"; then
-    CFLAGS="$CFLAGS `$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`" 
-    CPPFLAGS="$CPPFLAGS `$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
+  if test -x "$KRB5CONFIG"; then
+    CFLAGS="$CFLAGS `$KRB5CONFIG --cflags | sed s/@INCLUDE_des@//`" 
+    CPPFLAGS="$CPPFLAGS `$KRB5CONFIG --cflags | sed s/@INCLUDE_des@//`"
     FOUND_KRB5=yes
     AC_MSG_RESULT(yes)
   else
@@ -181,9 +180,12 @@ SONAMEFLAG="#"
 SHLD="\${CC}"
 PICFLAGS=""
 PICSUFFIX="po"
-POBAD_CC="#"
 SHLIBEXT="so"
 
+# Since we are not embedded in the Samba tree, building shared modules is
+# really the only option.
+enable_shared=yes
+
 if test "$enable_shared" = "yes"; then
   # this bit needs to be modified for each OS that is suported by
   # smbwrapper. You need to specify how to created a shared library and
@@ -214,7 +216,6 @@ if test "$enable_shared" = "yes"; then
                                ## ${CFLAGS} added for building 64-bit shared 
                                ## libs using Sun's Compiler
                                LDSHFLAGS="-G \${CFLAGS}"
-                               POBAD_CC=""
                                PICSUFFIX="po.o"
                        fi
                        ;;
@@ -312,6 +313,11 @@ if test "$enable_shared" = "yes"; then
                        BLDSHARED="false"
                        LDSHFLAGS=""
                        ;;
+               *darwin*)
+                       BLDSHARED="true"
+                       LDSHFLAGS="-bundle -flat_namespace -undefined suppress"
+                       SHLIBEXT="dylib"
+                       ;;
                *)
                        ;;
   esac
@@ -331,7 +337,7 @@ AC_CACHE_CHECK([whether building shared libraries actually works],
    ac_cv_shlib_works=no
    # try building a trivial shared library
    if test "$PICSUFFIX" = "po"; then
-     $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/tests/shlib.c &&
+     $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/../../source/tests/shlib.c &&
        $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po &&
        ac_cv_shlib_works=yes
    else