+WWWBASE_PREFORMATTED=/www/gcc/htdocs-preformatted
+WWWPREPROCESS='/www/gcc/bin/preprocess -r'
+
+# Process options -rrelease and -ddirectory
+RELEASE=""
+SUBDIR=""
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ -r*)
+ if [ -n "$RELEASE" ]; then
+ echo "Multiple releases specified" >&2
+ exit 1
+ fi
+ RELEASE="${1#-r}"
+ if [ -z "$RELEASE" ]; then
+ shift
+ RELEASE="$1"
+ if [ -z "$RELEASE" ]; then
+ echo "No release specified with -r" >&2
+ exit 1
+ fi
+ fi
+ ;;
+ -d*)
+ if [ -n "$SUBDIR" ]; then
+ echo "Multiple subdirectories specified" >&2
+ exit 1
+ fi
+ SUBDIR="${1#-d}"
+ if [ -z "$SUBDIR" ]; then
+ shift
+ SUBDIR="$1"
+ if [ -z "$SUBDIR" ]; then
+ echo "No subdirectory specified with -d" >&2
+ exit 1
+ fi
+ fi
+ ;;
+ *)
+ echo "Unknown argument \"$1\"" >&2
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+if [ -n "$RELEASE" ] && [ -z "$SUBDIR" ]; then
+ echo "Release specified without subdirectory" >&2
+ exit 1
+fi
+
+if [ -z "$SUBDIR" ]; then
+ DOCSDIR=$WWWBASE/onlinedocs
+else
+ DOCSDIR=$WWWBASE/onlinedocs/$SUBDIR
+fi
+
+if [ ! -d $DOCSDIR ]; then
+ mkdir $DOCSDIR
+fi
+
+if [ -z "$RELEASE" ]; then
+ RELEASE=HEAD
+fi