+ # Log if file was not relicensed
+ if test -f "$1.norelicense"; then
+ ad_log " $1"
+ rm -f $1.norelicense
+ fi
+
+ ad_debug "Ending processing source file: $1 $2"
+}
+
+#
+# Processes a file. This is the -p, --process option.
+#
+# Arguments: ad_process <type> <src> <dst>
+#
+ad_process()
+{
+ ad_debug "Starting process: $1 $2 $3"
+
+ nolog=true
+
+ if test '!' -f autodist.dist; then
+ ad_fatal "Autodist has not been run yet to prepare source tree"
+ fi
+
+ # Parse distribution
+ distribution=`grep "dist:" < autodist.dist | cut -d: -f2` || exit 1
+ dist_version=`grep "ver:" < autodist.dist | cut -d: -f2` || exit 1
+ ad_parse_distribution $distribution false
+ ad_process_distdefs
+
+ # Process file
+ case "$1" in
+ makefile)
+ if test -z $3; then
+ ad_fatal "File type $1 requires <dst> argument"
+ fi
+ ad_make_makefile_am $2 $3
+ exit 0;;
+
+ configure)
+ ad_make_configure_ac $2
+ exit 0;;
+
+ non-source)
+ if test -z $3; then
+ ad_fatal "File type $1 requires <dst> argument"
+ fi
+ ad_process_file $2 $3 false
+ exit 0;;
+
+ source)
+ if test -z $3; then
+ ad_fatal "File type $1 requires <dst> argument"
+ fi
+ ad_process_source_file $2 $3 false
+ exit 0;;
+
+ *)
+ ad_fatal "Unknown file type: $1";
+ ;;
+ esac