Made Autodist work without the autodist.conf file.
[autodist.git] / apps / autodist / autodist.in
index bac46d50b4caf483cca4fdc1cf8ca79edae2f66a..8d5c97737d8f7f2310435496413970b4ac01fc56 100755 (executable)
@@ -565,16 +565,17 @@ ad_process_ads()
   for i in $files
   do
     fname=`echo $i | sed s/\.ad//`
+    orig=$i
 
     ad_debug "Processing $i to be $fname"
     ad_log "  $i into $fname"
 
     # Run the distribution processing for this file
     ad_process_file $i $fname false
-    if test -f $fname; then
-      cp -p $i $fname || exit 1
-    fi
 
+    if test '!' -f "$fname"; then
+      cp -p $orig $fname || exit 1
+    fi
   done
   ad_log ""
 
@@ -833,6 +834,9 @@ ad_process_tree()
        \! -name \*\.[cC][pP][pP] -a \
        \! -name \*\.[cC]++ -a \
        \! -name \*\.m -a \
+       \! -name \*\.mm -o \
+       \! -name \*\.M -o \
+       \! -name \*\.S -o \
        \! -name \*\.[hH] -a \
        \! -name \*\.hh -a \
        \! -name \*\.[cC]\.in -a \
@@ -885,10 +889,6 @@ ad_process_source_tree()
        -name \*\.mm -o \
        -name \*\.M -o \
        -name \*\.S -o \
-       -name \*\.F -o \
-       -name \*\.F90 -o \
-       -name \*\.F95 -o \
-       -name \*\.[fF][pP][pP] -o \
        -name \*\.[hH] -o \
        -name \*\.hh -o \
        -name \*\.[cC]\.in -o \
@@ -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