Made Autodist work without the autodist.conf file.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 26 Jan 2008 15:00:17 +0000 (17:00 +0200)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 26 Jan 2008 15:00:17 +0000 (17:00 +0200)
In addition of not needing autodist.conf ther DISTDEFS variable
in the configuration file is now optional.  If it doesn't exist
the distdefs file is not created.

Also the 'default' distribution doesn't have to define and distdefs
anymore to still be valid distribution.

apps/autodist/autodist.conf
apps/autodist/autodist.in

index cbf17b5c7b1fca26c125d967f30a1952f8e6abf5..1d6c266d2165bf406896656d156e5d3efed6c6e9 100644 (file)
@@ -12,7 +12,8 @@ DISTPREFIX=""
 
 # The distdef header will be created by the Autodist.  It need to be included
 # in the source code in order for the preprocessor to respect distdef 
-# conditionals in source code.  Example:
+# conditionals in source code.  If your project doesn't need distdefs you
+# can comment this out.  Example:
 #
 # DISTDEFS="include/distdefs.h"
 #
index e3b67b7ab99f1de45ce67145c682c9549283b7de..8d5c97737d8f7f2310435496413970b4ac01fc56 100755 (executable)
@@ -1208,7 +1208,9 @@ ad_parse_distribution()
    | grep "define " | cut -d' ' -f2 | sort | uniq`
 
   if test "$inhs" = "" && test "$defs" = ""; then
-    ad_fatal "Distribution '$1' does not define anything"
+    if test "$1" != "default"; then
+      ad_fatal "Distribution '$1' does not define anything"
+    fi
   fi
 
   # Get undefined distdefs
@@ -1379,7 +1381,9 @@ ad_process_distdefs()
   do
     echo $i >>autodist.tmp.defs
   done
-  distdefs=`sort < autodist.tmp.defs | uniq`
+  if test -f autodist.tmp.defs; then
+    distdefs=`sort < autodist.tmp.defs | uniq`
+  fi
   distdefs=`echo $distdefs`
   rm -f autodist.tmp.defs
 
@@ -1846,7 +1850,7 @@ ad_run_dist_hooks()
 ###############################################################################
 # Autodist code
 
-usage="Usage: autodist [options] [distribution] [version] [params]"
+usage="Usage: autodist [OPTIONS] [DISTRIBUTION] [VERSION] [PARAMS]"
 help="\
 Autodist prepares source tree for configuration, compilation and
 distribution.  Generates Automake.am files from Automake.ad files,
@@ -2007,8 +2011,6 @@ ad_debug "Preparing $distribution distribution version $dist_version"
 #
 if test "$DISTDEFS"; then
   ad_create_distdefs_h
-else
-  ad_fatal "DISTDEFS not defined in $distdir/autodist.conf"
 fi
 
 # Get extra parameters from command line