[m-rev.] for review: change --enable-deep-profiler behaviour

Peter Wang novalazy at gmail.com
Wed Dec 5 17:23:03 AEDT 2007


[Turns out mdprof was already installed into $prefix/bin anyway.]


Estimated hours taken: 2
Branches: main

Change how the configure script treats the `--enable-deep-profiler' option.

By default, deep profiling is enabled if the system can support it, whether
`/usr/lib/cgi-bin' or `/Library/WebServer/CGI-Executables' exists or not.
The installation of `mdprof' to the CGI directory is already silently ignored,
and `mdprof' is also installed into the usual Mercury bin directory anyway.

If the user explicitly passes `--enable-deep-profiler' but without a directory
argument, then behave as in the default case but abort if the system can't
support deep profiling.

If the user passes an explicit directory `--enable-deep-profiler=<dir>' then
configure will check if <dir> exists.

configure.in:
	As above.

.INSTALL.in:
	Don't refer to `/usr/lib/cgi-bin'.

	Mention that mdprof is also available in the Mercury bin directory.

	Don't say that by default the deep profiler will be disabled if the
	CGI directory doesn't exist.

doc/user_guide.texi:
	Don't refer to `/usr/lib/cgi-bin'.


Index: .INSTALL.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/.INSTALL.in,v
retrieving revision 1.14
diff -u -r1.14 .INSTALL.in
--- .INSTALL.in	14 Sep 2007 06:45:30 -0000	1.14
+++ .INSTALL.in	5 Dec 2007 05:56:33 -0000
@@ -70,11 +70,12 @@
 #	   from the DVI files in /usr/local/mercury- at VERSION@/lib/mercury/doc.
 #
 #	   If step #1 enabled deep profiling, then check whether "make install"
-#	   was able to copy scripts/mdprof to your web server's CGI directory
-#	   (usually /usr/lib/cgi-bin). This directory is often writeable only
-#	   by root or by the web server administrator, so you may need more
-#	   than your usual set of privileges to do the copy (i.e. you may
-#	   need to "su" to the appropriate user).
+#	   was able to copy scripts/mdprof to your web server's CGI directory.
+#	   This directory is often writeable only by root or by the web server
+#	   administrator, so you may need more than your usual set of
+#	   privileges to do the copy (i.e. you may need to "su" to the
+#	   appropriate user). mdprof is also installed into the same directory
+#	   as other Mercury executables.
 #
 #	   To use the emacs debugger interface ("M-x mdb"), you also need to
 #	   add the following lines to the `.emacs' file in your home directory:
@@ -147,9 +148,7 @@
 #	   deep profiler's CGI script. The option --disable-deep-profiler
 #	   causes the deep profiler not to be installed, even if the underlying
 #	   system would be able to support it. The default is to enable the
-#	   deep profiler and to install its CGI script in /usr/lib/cgi-bin
-#	   if that directory exists and if the system has the required
-#	   features.
+#	   deep profiler if the system has the required features.
 #
 #	   If you are short on RAM, you can add -DSMALL_CONFIG to the CFLAGS
 #          line in the file boehm_gc/Makefile.  (This tells the garbage
Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.509
diff -u -r1.509 configure.in
--- configure.in	9 Nov 2007 06:32:24 -0000	1.509
+++ configure.in	5 Dec 2007 05:56:34 -0000
@@ -2500,14 +2500,11 @@
         ;;
 esac
 
+mercury_cv_cgi_dir_must_exist=no
 case "$enable_deep_profiler" in
 	default)
-		if test -d $mercury_cv_default_cgi_dir; then
-			mercury_cv_enable_deep_profiler=$mercury_cv_can_enable_deep_profiler
-			mercury_cv_cgi_dir=$mercury_cv_default_cgi_dir
-		else
-			mercury_cv_enable_deep_profiler=no
-		fi
+		mercury_cv_enable_deep_profiler=$mercury_cv_can_enable_deep_profiler
+		mercury_cv_cgi_dir=$mercury_cv_default_cgi_dir
 		;;
 	no)
 		mercury_cv_enable_deep_profiler=no
@@ -2517,6 +2514,7 @@
 			mercury_cv_cgi_dir=$mercury_cv_default_cgi_dir
 		else
 			mercury_cv_cgi_dir=$enable_deep_profiler
+			mercury_cv_cgi_dir_must_exist=yes
 		fi
 
 		if test $mercury_cv_can_enable_deep_profiler = no; then
@@ -2530,16 +2528,22 @@
 		;;
 esac
 
+AC_MSG_RESULT($mercury_cv_enable_deep_profiler)
+
 if test $mercury_cv_enable_deep_profiler = yes; then
+	AC_MSG_CHECKING([where to install deep profiler CGI script])
+	AC_MSG_RESULT([$mercury_cv_cgi_dir])
 	if test -d $mercury_cv_cgi_dir; then
 		true
 	else
-		AC_MSG_RESULT($enable_deep_profiler)
-		AC_MSG_ERROR(CGI script directory $mercury_cv_cgi_dir does not exist)
+		if test $mercury_cv_cgi_dir_must_exist = yes; then
+			AC_MSG_ERROR([$mercury_cv_cgi_dir does not exist.])
+		else
+			AC_MSG_WARN([$mercury_cv_cgi_dir does not exist.])
+		fi
 	fi
 fi
 
-AC_MSG_RESULT($mercury_cv_enable_deep_profiler)
 ENABLE_DEEP_PROFILER=$mercury_cv_enable_deep_profiler
 AC_SUBST(ENABLE_DEEP_PROFILER)
 CGIDIR=$mercury_cv_cgi_dir
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.553
diff -u -r1.553 user_guide.texi
--- doc/user_guide.texi	23 Nov 2007 07:35:53 -0000	1.553
+++ doc/user_guide.texi	5 Dec 2007 05:56:38 -0000
@@ -5969,8 +5969,8 @@
 The @file{server.domain.name} part should be the name of a machine
 with the following qualifications:
 it should have a web server running on it,
-and it should have the @samp{mdprof_cgi} program installed
-in its @file{/usr/lib/cgi-bin} directory.
+and it should have the @samp{mdprof_cgi} program installed in
+the web server's CGI program directory.
 The @file{/full/path/name/Deep.data} part
 should be the full path name of the deep profiling data file
 whose data you wish to explore.

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list