Index: server/common/oursrc/lockeradm/configure.in
===================================================================
--- server/common/oursrc/lockeradm/configure.in	(revision 36)
+++ server/common/oursrc/lockeradm/configure.in	(revision 38)
@@ -2,4 +2,16 @@
 
 AC_PROG_CC
+
+AC_DEFUN(REQUIRE_PATH,[
+AC_SUBST($1_path)
+if test "[$]$1_path" = ""; then
+        AC_ERROR(Cannot find $1)
+fi
+])
+
+AC_DEFUN(LOCATE,[
+AC_PATH_PROG($1_path, $1)
+REQUIRE_PATH($1)
+])
 
 dnl Needed by admof.in
@@ -11,8 +23,5 @@
   fi
 ])
-AC_SUBST(fs_path)
-if test "$fs_path" = ""; then
-        AC_ERROR(Cannot find fs)
-fi
+REQUIRE_PATH(fs)
 
 AC_ARG_WITH(pts,
@@ -22,57 +31,19 @@
   fi
 ])
-AC_SUBST(pts_path)
-if test "$pts_path" = ""; then
-        AC_ERROR(Cannot find pts)
-fi
+REQUIRE_PATH(pts)
 
 dnl Needed by signup-scripts-backend.in
 
-AC_PATH_PROG(ls_path, ls)
-AC_SUBST(ls_path)
-if test "$ls_path" = ""; then
-	AC_ERROR(Cannot find ls)
-fi
-AC_PATH_PROG(grep_path, grep)
-AC_SUBST(grep_path)
-if test "$grep_path" = ""; then
-	AC_ERROR(Cannot find grep)
-fi
-
-AC_PATH_PROG(sudo_path, sudo)
-AC_SUBST(sudo_path)
-if test "$sudo_path" = ""; then
-	AC_ERROR(Cannot find sudo)
-fi
-AC_PATH_PROG(useradd_path, useradd)
-AC_SUBST(useradd_path)
-if test "$useradd_path" = ""; then
-	AC_ERROR(Cannot find useradd)
-fi
-AC_PATH_PROG(groupadd_path, groupadd)
-AC_SUBST(groupadd_path)
-if test "$groupadd_path" = ""; then
-	AC_ERROR(Cannot find groupadd)
-fi
-
-AC_PATH_PROG(setquota_path, setquota)
-AC_SUBST(setquota_path)
-if test "$setquota_path" = ""; then
-	AC_ERROR(Cannot find setquota)
-fi
-
-AC_PATH_PROG(hesinfo_path, hesinfo)
-AC_SUBST(hesinfo_path)
-if test "$hesinfo_path" = ""; then
-	AC_ERROR(Cannot find hesinfo)
-fi
+LOCATE(ls)
+LOCATE(grep)
+LOCATE(sudo)
+LOCATE(useradd)
+LOCATE(groupadd)
+LOCATE(setquota)
+LOCATE(hesinfo)
 
 dnl Needed by modbash.in
 
-AC_PATH_PROG(bash_path, bash)
-AC_SUBST(bash_path)
-if test "$bash_path" = ""; then
-	AC_ERROR(Cannot find bash)
-fi
+LOCATE(bash)
 
 AC_OUTPUT(Makefile)
Index: server/common/oursrc/tokensys/configure.in
===================================================================
--- server/common/oursrc/tokensys/configure.in	(revision 36)
+++ server/common/oursrc/tokensys/configure.in	(revision 38)
@@ -1,3 +1,10 @@
 AC_INIT()
+
+AC_DEFUN(REQUIRE_PATH,[
+AC_SUBST($1_path)
+if test "[$]$1_path" = ""; then
+        AC_ERROR(Cannot find $1)
+fi
+])
 
 AC_ARG_WITH(kinit,
@@ -7,8 +14,5 @@
   fi
 ])
-AC_SUBST(kinit_path)
-if test "$kinit_path" = ""; then
-        AC_ERROR(Cannot find kinit)
-fi
+REQUIRE_PATH(kinit)
 
 AC_ARG_WITH(aklog,
@@ -18,8 +22,5 @@
   fi
 ])
-AC_SUBST(aklog_path)
-if test "$aklog_path" = ""; then
-        AC_ERROR(Cannot find aklog)
-fi
+REQUIRE_PATH(aklog)
 
 AC_OUTPUT(Makefile)
