casio_doc/fontcharacter/configure

124 lines
4.0 KiB
Bash
Executable File

#!/bin/sh
cd "$(dirname $0)"
#*****************************************************************************#
# Defaults #
#*****************************************************************************#
# Project variables
[ -f Makefile.cfg ] && mv Makefile.cfg Makefile.cfg.tmp
name="$(make -s getname)"
version="$(make -s getversion)"
maintainer="$(make -s getmaintainer)"
[ -f Makefile.cfg.tmp ] && mv Makefile.cfg.tmp Makefile.cfg
# Make options.
make_full_log=
# Build options.
no_unicode=
# Installation directories.
root=''
prefix='${root}/opt/p7-project'
setdir='${prefix}/share/casio-fontcharacter/'
#*****************************************************************************#
# Help message #
#*****************************************************************************#
usage() {
cat <<EOF
\`configure\` configures the FONTCHARACTER reference to bend it to your will.
Usage: $0 [OPTION...]
Defaults for the options are specified in brackets.
General options:
--help display this help and exit
--version display version information and quit
--make-full-log display full commands while making
Build options:
--no-unicode do not include Unicode translations in the files
Installation options:
--root=ROOT installation root [$root]
--prefix=PREFIX main installation prefix [$prefix]
Fine tuning of the installation directories:
--setdir=SETDIR sets directory [$setdir]
Report bugs to ${maintainer}.
EOF
exit 0
}
#*****************************************************************************#
# Version message #
#*****************************************************************************#
version() {
cat <<EOF
${name} configure script v${version }
Hand-written by Thomas "Cakeisalie5" Touhey.
This configure script is free software.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
EOF
exit 0
}
#*****************************************************************************#
# Check for help and version #
#*****************************************************************************#
put_version=
put_help=
for arg ; do case "$arg" in
--help|-h) put_help=1 ;;
--version|-v) put_version=1 ;;
esac; done
[ $put_version ] && version
[ $put_help ] && usage
#*****************************************************************************#
# Parse arguments #
#*****************************************************************************#
for arg ; do case "$arg" in
--make-full-log) make_full_log=yes ;;
--no-unicode) no_unicode=yes ;;
--root=*) root="${arg#*=}" ;;
--prefix=*) prefix="${arg#*=}" ;;
--setdir=*) setdir="${arg#*=}" ;;
esac; done
# Evaluate variables
vars="prefix setdir"
for var in $vars; do
eval $var'='$(eval 'echo $'$var)
done
#*****************************************************************************#
# Create Makefile configuration #
#*****************************************************************************#
# Clean before.
make clean MAKE_FULL_LOG=y 1>/dev/null 2>/dev/null
# Do it!
exec 3>&1 1>Makefile.cfg
cat <<EOF
#*****************************************************************************#
# Makefile configuration generated by ./configure #
#*****************************************************************************#
# Configuration version and messages configuration
CONFIG_VERSION := $version
MAKE_FULL_LOG := $make_full_log
# Build options.
NO_UNICODE := $no_unicode
# Installation directories
ISETDIR := $setdir
# End of file.
EOF
exec 1>&3 3>&-
chmod +x Makefile.cfg
# Print the end message.
echo "Configuration loaded, you can make now."
# End of file.