-allow installation even as non-root non-sudo user to succeed with new nss code
authorChristian Grothoff <christian@grothoff.org>
Thu, 31 May 2012 18:04:28 +0000 (18:04 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 31 May 2012 18:04:28 +0000 (18:04 +0000)
configure.ac
src/gns/nss/Makefile.am
src/integration-tests/Makefile.am

index c75b52f4c7bc1145e37b5c88bf10df38b7da3bf3..2cc522bf6ab7af81af8216b84e20156812e49a83 100644 (file)
@@ -766,7 +766,7 @@ AC_ARG_WITH(sudo,
   ],
   [AC_MSG_RESULT([no])])
 AC_SUBST(SUDO_BINARY)
-
+AM_CONDITIONAL([HAVE_SUDO], [test "x$SUDO_BINARY" != "x" -o -w /])
 
 # test for gnunetdns group name
 GNUNETDNS_GROUP=gnunetdns
@@ -1104,6 +1104,11 @@ then
   AC_MSG_NOTICE([NOTICE: Mac OS X framework build enabled.])
 fi
 
+if test "x$SUDO_BINARY" = "x" -a ! -w /
+then
+  AC_MSG_NOTICE([NOTICE: --with-sudo not specified and not running as 'root', will not install GNS NSS library])
+fi
+
 AC_MSG_NOTICE([********************************************
 You can compile GNUnet with
        make
index c5e415dbfde01beb81d867e5deeb235abe3f8fbc..582aa0696118d4396d5f5e1910a2277f04a3c4af 100644 (file)
@@ -21,15 +21,22 @@ EXTRA_DIST = map-file
 
 AM_LDFLAGS=-avoid-version -module -export-dynamic
 
+if HAVE_SUDO
 nssdir = /lib/
+else
+nssdir = $(libdir)
+endif
+
 LIBTOOL = $(SUDO_BINARY) $(SHELL) $(top_builddir)/libtool
 
 if !MINGW
+if HAVE_SUDO
 nss_LTLIBRARIES = \
        libnss_gns.la \
        libnss_gns4.la \
        libnss_gns6.la
 endif
+endif
 
 sources = util.c util.h query.h query.c
 
index 7c1991b9175c4f122f787b3ac6b7a3c38b5a4d00..f9998642d9764d9ab7a3e121c50771309fa70f06 100644 (file)
@@ -12,8 +12,6 @@ endif
 #bin_PROGRAMS = \
 # connection_watchdog
 
-check_PROGRAMS =
-
 noinst_PROGRAMS = connection_watchdog
 
 noinst_SCRIPTS = \
@@ -98,7 +96,7 @@ test_integration_clique.py: test_integration_clique.py.in Makefile
 test_integration_clique_nat.py: test_integration_clique_nat.py.in Makefile
        $(do_subst) < $(srcdir)/test_integration_clique_nat.py.in > test_integration_clique_nat.py
        chmod +x test_integration_clique_nat.py 
-       
+
 test_integration_connect_on_restart.py: test_integration_connect_on_restart.py.in Makefile
        $(do_subst) < $(srcdir)/test_integration_connect_on_restart.py.in > test_integration_connect_on_restart.py
        chmod +x test_integration_connect_on_restart.py