diff --git a/bin/feature_list b/bin/feature_list
index 2dd7926583e2fbb901e855e405a9c5c8cc4b8d6b..e85344ec2cebca9cb601a4881f4ccad375573480 100755
--- a/bin/feature_list
+++ b/bin/feature_list
@@ -1,30 +1,8 @@
 #!/usr/local/bin/pike
 
-// $Id: feature_list,v 1.8 2000/01/19 19:23:24 grubba Exp $
+// $Id: feature_list,v 1.9 2000/09/08 13:31:36 noring Exp $
 
 int main(int argc, string *argv)
 {
-  write("Features: ");
-
-  if(!_static_modules["Regexp"])
-    write("dynamic_modules ");
-
-#if efun(thread_create)
-  write("threads ");
-#endif
-
-  foreach(({ "_Crypto", "CommonLog","Dbm","GL","GTK","Gdbm","Gmp","Gz","_Image_JPEG",
-	     "_Image_TIFF","_Image_TTF","MIME","Msql","Mysql","Odbc","Oracle",
-	     "Perl", "Postgres","Ssleay","WideValues","X","Yp" }),
-	  string modname) {
-    catch {
-      if (sizeof(indices(master()->resolv(modname) || ({})))) {
-	if(modname[0] == '_')
-	  modname = replace(modname[1..], "_", ".");
-	write(modname+" ");
-      }
-    };
-  }
-
-  write("\n");
+  write("Features: "+Tools.Install.features()*" "+"\n");
 }
diff --git a/bin/install.pike b/bin/install.pike
index 0065a48f91c81a69521a3d87347cdab06a501b99..ec5be25bcb5f90169033e18cc23d4715da25e15d 100644
--- a/bin/install.pike
+++ b/bin/install.pike
@@ -409,6 +409,7 @@ string helptext=#"Usage: $TARFILE [options] [variables]
 Options:
   -h, --help            Display this help and exit.
   -v, --version         Display version information and exit.
+  --features            Display features and exit.
   --interactive         Interactive installation (default).
   --new-style           Install in <prefix>/pike/<ver>/{lib,include,bin}.
   --traditional         Install in <prefix>/{lib/pike,include/pike,bin}.
@@ -539,10 +540,11 @@ do
     case \"$1\" in
               -v|\\
        --version) echo \""+version()+
-#" Copyright (C) 1994-2000 Fredrik H�binette and Roxen Internet Software AB
-Pike comes with ABSOLUTELY NO WARRANTY; This is free software and you are
-welcome to redistribute it under certain conditions; Read the files
-COPYING and DISCLAIMER in the Pike distribution for more details.
+#" Copyright (C) 1994-2000 Fredrik H�binette and
+Roxen Internet Software AB Pike comes with ABSOLUTELY NO WARRANTY;
+This is free software and you are welcome to redistribute it under
+certain conditions; Read the files COPYING and DISCLAIMER in the
+Pike distribution for more details.
 \";
                   exit 0 ;;
 
@@ -550,6 +552,9 @@ COPYING and DISCLAIMER in the Pike distribution for more details.
           --help) echo \"" + helptext + #"\"
                   exit 0 ;;
 
+      --features) echo \"" + Tools.Install.features()*"\n" + #"\"
+                  exit 0 ;;
+
               -s|\\
         --script) shift
                   INSTALL_SCRIPT=\"$1\" ;;
diff --git a/bin/mkpackage.pike b/bin/mkpackage.pike
index b8dd37bff1838187fa492a338b9e514bb5cae95c..ee3d5d88fcf05f43488bd94698c795f3117ba46a 100644
--- a/bin/mkpackage.pike
+++ b/bin/mkpackage.pike
@@ -41,6 +41,7 @@ class Package
      "echo '  -h, --help              Display this help and exit.'\n"
      "echo '  -l, --list              Display the contents of the package and exit.'\n"
      "echo '  -v, --version           Display version information and exit.'\n"
+     "echo '  --features              Display feature information and exit.'\n"
      "echo '  -a, --add <component>   Add a component to the package and exit.'\n"
      "echo\n"
      "echo 'When no arguments are given, the installation script will be started.'\n"
@@ -115,6 +116,9 @@ class Package
 			       setup_filename);
 		    
     rmrf("#!", setup_filename);
+
+    string features = Process.popen(pike_filename+" --features");
+    options[({ "--features" })] = "echo \""+(features || "")+"\"\nexit";
     
     if(!Stdio.write_file(setup_filename, setup))
       ERR(("Failed to write setup script %O., ", setup_filename));
diff --git a/lib/modules/Tools.pmod/Install.pmod b/lib/modules/Tools.pmod/Install.pmod
index de5e4178b5b71dc64817494940c88952d285fcfc..d8c657d77be52bc439cb5954ad8682df60fd4425 100644
--- a/lib/modules/Tools.pmod/Install.pmod
+++ b/lib/modules/Tools.pmod/Install.pmod
@@ -2,6 +2,37 @@
 // Common routines which are useful for various install scripts based on Pike.
 //
 
+array(string) features()
+{
+  array a = ({});
+  
+  if(!_static_modules["Regexp"])
+    a += ({ "dynamic_modules" });
+
+#if efun(thread_create)
+  a += ({ "threads" });
+#endif
+
+  foreach(({ "_Crypto", "CommonLog", "Dbm", "GL", "GTK", "Gdbm", "Gmp", "Gz",
+	     "_Image_JPEG", "_Image_TIFF", "_Image_TTF", "Java", "MIME",
+	     "Msql", "Mysql", "Odbc", "Oracle", "Perl", "Postgres", "Ssleay",
+	     "sybase", "WideValues", "X", "Yp" }),
+	  string modname)
+  {
+    catch
+    {
+      if(sizeof(indices(master()->resolv(modname) || ({}))))
+      {
+	if(modname[0] == '_')
+	  modname = replace(modname[1..], "_", ".");
+	a += ({ modname });
+      }
+    };
+  }
+
+  return a;
+}
+
 string make_absolute_path(string path, string|void cwd)
 {
 #if constant(getpwnam)