#! /bin/sh
### See http://people.gnome.org/~walters/docs/build-api.txt
# buildapi-variable-no-builddir
# Show help if requested.
#
for var in "$@" ; do
if test "${var}" = "--help" ; then
cat <<-EOF
usage: $0 [--options]
Available options:
--help This help message.
--prefix=PATH Installation path prefix [default: /]
--datadir=PATH Path for runtime data files [default: prefix/lib/]
--with-module-name=NAME
Specify an alternate name for the module [default: altfiles]
Also, the following relevant environment variables can be set:
CFLAGS Additional command line flags to be pased to the C compiler
CXXFLAGS Additional command line flags to be pased to the C++ compiler
NOTE: This script tries to mimic the typical usage forconfigure scripts
generated by autotools, hence it will silently ignore unrecognized
command line options.
EOF
exit
fi
done
# Inherit the CFLAGS/CXXFLAGS from the environment, if defined.
#
test -n "${CXXFLAGS}" && EXTRA_CXXFLAGS=${CXXFLAGS}
test -n "${CFLAGS}" && EXTRA_CFLAGS=${CFLAGS}
# Inspect arguments and generate config.mk
#
echo "# autogenerated by: $0 $*" > config.mk
for var in "$@" ; do
case ${var} in
CFLAGS=* | CXXFLAGS=*)
echo "Setting EXTRA_${var}"
echo "EXTRA_${var}" >> config.mk
;;
--prefix=*)
var=`echo "${var}" | sed 's/^--prefix=//'`
echo "Setting PREFIX=${var}"
echo "PREFIX := ${var}" >> config.mk
;;
--libdir=*)
var=`echo "${var}" | sed 's/^--libdir=//'`
echo "Setting LIBDIR=${var}"
echo "LIBDIR := ${var}" >> config.mk
;;
--datadir=*)
var=`echo "${var}" | sed 's/^--datadir=//'`
echo "Setting DATADIR=${var}"
echo "DATADIR := ${var}" >> config.mk
;;
--with-module-name=*)
var=`echo "${var}" | sed 's/^--with-module-name=//'`
echo "Setting MODULE_NAME=${var}"
echo "MODULE_NAME := ${var}" >> config.mk
;;
*)
true
;;
esac
done
echo "config.mk written"