r14079: I just found the setproctitle library from alt linux:-)
[jelmer/samba4-debian.git] / source / smbd / process_model.m4
index cbeedd1729555fa7805f09854227a8c7e9915b97..ea7373e4f71ebdb6169ef4fd03825c67fc4d50a2 100644 (file)
@@ -1,7 +1,6 @@
 dnl # Server process model subsystem
 
-SMB_MODULE(process_model_single,PROCESS_MODEL,STATIC,[smbd/process_single.o])
-SMB_MODULE(process_model_standard,PROCESS_MODEL,STATIC,[smbd/process_standard.o])
+SMB_ENABLE(process_model_thread,NO)
 
 #################################################
 # check for pthread support
@@ -14,7 +13,7 @@ AC_ARG_WITH(pthreads,
                if test x"$ac_cv_func_pread" != x"yes" -o x"$ac_cv_func_pwrite" != x"yes";then
                        AC_MSG_ERROR([You cannot enable threads when you don't have pread/pwrite!])
                fi
-               SMB_MODULE_DEFAULT(process_model_thread,STATIC)
+               SMB_ENABLE(process_model_thread,YES)
                SMB_EXT_LIB_ENABLE(PTHREAD,YES)
        ;;
        *)
@@ -26,7 +25,19 @@ AC_MSG_RESULT(no)
 
 SMB_EXT_LIB(PTHREAD,[-lpthread])
 
-SMB_MODULE(process_model_thread,PROCESS_MODEL,NOT,
-               [smbd/process_thread.o],[],[PTHREAD])
+AC_CHECK_HEADERS(setproctitle.h)
+AC_CHECK_LIB_EXT(setproctitle, SETPROCTITLE_LIBS, setproctitle)
+AC_MSG_CHECKING(whether to use setproctitle)
+if test x"$ac_cv_header_setproctitle_h" = x"yes" -a x"$ac_cv_lib_ext_setproctitle_setproctitle" = x"yes"; then
+       AC_MSG_RESULT(yes)
+       SMB_EXT_LIB_ENABLE(SETPROCTITLE,YES)
+       AC_DEFINE(HAVE_SETPROCTITLE,1,[Whether setproctitle() is available])
+else 
+       AC_MSG_RESULT(no)
+fi
 
-SMB_SUBSYSTEM(PROCESS_MODEL,smbd/process_model.o)
+SMB_EXT_LIB(SETPROCTITLE,
+       [${SETPROCTITLE_LIBS}],
+       [${SETPROCTITLE_CFLAGS}],
+       [${SETPROCTITLE_CPPFLAGS}],
+       [${SETPROCTITLE_LDFLAGS}])