r25494: Sanity check --with-samba4srcdir argument.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 3 Oct 2007 21:14:20 +0000 (21:14 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:31:09 +0000 (12:31 -0500)
source/configure.in

index 2eb06bdcacc0774b80fe56ddc63b03d929d85df0..1a74583b3bb352639df9858b1fa7bec8b7f521fe 100644 (file)
@@ -427,10 +427,19 @@ AC_ARG_WITH(samba4srcdir,
     AC_MSG_ERROR([--with-samba4srcdir should take a path])
   ;;
   * )
-    samba4srcdir="$withval"
-    if test -z "$samba4srcdir" -a ! -f $samba4srcdir; then
-       AC_MSG_ERROR(['$samba4srcdir' does not  exist!])
+    if test -z "$withval" -a ! -f $withval; then
+       AC_MSG_ERROR(['$withval' does not  exist!])
     fi
+       
+       if test -f "$withval/selftest/selftest.pl"; then
+               samba4srcdir="$withval"
+       else
+               if test -f "$withval/source/selftest/selftest.pl"; then
+                       samba4srcdir="$withval/source"
+               else
+                       AC_MSG_ERROR([unable to find selftest.pl in '$withval'!])
+               fi
+       fi
   ;;
  esac
 ])