configure

Thu, 23 Mar 2023 15:12:30 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 23 Mar 2023 15:12:30 +0000
changeset 174
662bd8c5ae28
parent 87
bd7888c3745a
permissions
-rwxr-xr-x

Serialize XML in a consistent order by default

This overrides all XML serialization to emit attributes in an ordered form, so
the XML will match across multiple runs. This can be useful for comparing
different runs, or even two stanzas printed in the same run (e.g. if there is
a mismatch).

#!/bin/sh

SQUISH=./buildscripts/squish
PREFIX="/usr/local"

# Help

show_help() {
cat <<EOF
Configure Prosody prior to building.

--help                      This help.
--prefix                    Installation path prefix (used when installing)
                            Default: $PREFIX
--squish                    Path to squish utility (used for building)
                            Default: $SQUISH
EOF
}


while [ "$1" ]
do
   value="`echo $1 | sed 's/[^=]*=\(.*\)/\1/'`"
   if echo "$value" | grep -q "~"
   then
      echo
      echo '*WARNING*: the "~" sign is not expanded in flags.'
      echo 'If you mean the home directory, use $HOME instead.'
      echo
   fi
   case "$1" in
   --help)
      show_help
      exit 0
      ;;
   --with-squish=*)
      SQUISH="$value"
      ;;
   --prefix=*)
      PREFIX="$value"
      ;;
   *)
      echo "Error: Unknown flag: $1"
      exit 1
      ;;
   esac
   shift
done

# Sanity-check options

if ! test -x "$SQUISH"; then
	echo "FATAL: Unable to find/use squish: $SQUISH";
	exit 1;
fi

cat <<EOF >config.unix

# This file was automatically generated by the configure script.
# Run "./configure --help" for details.

SQUISH=./buildscripts/squish
PREFIX=$PREFIX

EOF

echo
echo "Installing scansion to:      $PREFIX/bin"
echo
echo "Configured successfully. Please run 'make' to proceed."

mercurial