]> arthur.barton.de Git - netatalk.git/commitdiff
Put admin group check into a separate file, clean it up, fix it:
authorsrittau <srittau>
Mon, 15 Dec 2003 06:56:33 +0000 (06:56 +0000)
committersrittau <srittau>
Mon, 15 Dec 2003 06:56:33 +0000 (06:56 +0000)
use AC_ARG_ENABLE instead of AC_ARG_WITH.

configure.in
macros/admingrp-check.m4 [new file with mode: 0644]

index 21e116288eb5c1b231cf5d91fe0f3d23ea775047..ffa16bf77ff6243a2aee8fa35735634fe443b180 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.200 2003-12-15 06:40:40 srittau Exp $
+dnl $Id: configure.in,v 1.201 2003-12-15 06:56:33 srittau Exp $
 dnl configure.in for netatalk
 
 AC_INIT(etc/afpd/main.c)
@@ -66,34 +66,14 @@ dnl
 
 AC_FUNC_MEMCMP
 AC_CHECK_FUNCS(strcasestr strchr memcpy)
+NETATALK_SNPRINTF_CHECK
 
 dnl
-dnl Checks for (v)snprintf
+dnl Configuration options.
 dnl
 
-NETATALK_SNPRINTF_CHECK
-
-dnl --------------------------------------------------------------------------
-dnl specific configuration comes in here:
-dnl --------------------------------------------------------------------------
-
-AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
-
-AC_MSG_CHECKING([for administrative group support])
-AC_ARG_WITH(admin-group,
-       [  --disable-admin-group   disable admin group], [
-        if test "$enableval" = "no"; then
-               AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
-               AC_MSG_RESULT([no])
-       else
-               AC_MSG_RESULT([yes])
-        fi], [
-               AC_MSG_RESULT([yes])
-       ]
-)
-
+NETATALK_ADMINGRP_CHECK
 NETATALK_AFS_CHECK
-
 NETATALK_CONFIG_DIRS
 
 AC_MSG_CHECKING([for logfile path])
diff --git a/macros/admingrp-check.m4 b/macros/admingrp-check.m4
new file mode 100644 (file)
index 0000000..2c724a5
--- /dev/null
@@ -0,0 +1,26 @@
+dnl $Id: admingrp-check.m4,v 1.1 2003-12-15 06:56:33 srittau Exp $
+dnl Autoconf macro to check whether admin group support should be enabled
+
+AC_DEFUN([NETATALK_ADMINGRP_CHECK], [
+       admingrp=yes
+       AC_MSG_CHECKING([for administrative group support])
+       AC_ARG_ENABLE(admin-group,
+               [  --disable-admin-group   disable admin group], [
+                       if test "x$enableval" = "xno"; then
+                               admingrp=no
+                       fi
+               ]
+       )
+
+       AC_DEFINE_UNQUOTED(ADMIN_GRP,
+               `test "x$admingrp" = "xyes"`,
+       [Define if the admin group should be enabled]
+       )
+
+       if test "x$admingrp" = "xyes"; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+       fi
+])
+