From 07f70d21b40e1de2c2d5295e3796af43996a3dd6 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 26 Jan 2008 17:00:17 +0200 Subject: [PATCH] Made Autodist work without the autodist.conf file. 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 | 3 ++- apps/autodist/autodist.in | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/autodist/autodist.conf b/apps/autodist/autodist.conf index cbf17b5..1d6c266 100644 --- a/apps/autodist/autodist.conf +++ b/apps/autodist/autodist.conf @@ -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" # diff --git a/apps/autodist/autodist.in b/apps/autodist/autodist.in index e3b67b7..8d5c977 100755 --- a/apps/autodist/autodist.in +++ b/apps/autodist/autodist.in @@ -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 -- 2.24.0