#!/bin/sh cd "$(dirname "$0")" #******************************************************************************# # Defaults # #******************************************************************************# # Project variables name="$(make -s getname)" version="$(make -s getversion)" maintainer="$(make -s getmaintainer)" # Make options make_full_log= more_warnings= # Build options target= windows= default_zoom=8 default_storage=fls0 # Installation directories root='' prefix='${root}/opt/p7-project' bindir='${prefix}/bin' mandir='${prefix}/share/man' # Installation options install_manpages=yes #******************************************************************************# # Help message # #******************************************************************************# usage() { cat </dev/null ]; then echo "--default-zoom: a number is expected (got \"$zoom\")" >&2 elif [ $zoom -lt 1 ]; then echo "--default-zoom: should be 1 or more (got $zoom)" >&2 elif [ $zoom -gt 16 ]; then echo "--default-zoom: should be 16 or less (got $zoom)" >&2 else default_zoom=$zoom; fi ;; --default-storage=*) storage="${arg#*=}" # check if 4 chars long if [ ! $(echo "$storage" | wc -c ) -eq 5 ]; then echo "$0: --default-storage: must be 4 characters long" continue fi # then set default_storage="$storage" ;; --no-manpages) install_manpages= ;; --root=*) root="${arg#*=}" ;; --prefix=*) prefix="${arg#*=}" ;; --bindir=*) bindir="${arg#*=}" ;; --mandir=*) mandir="${arg#*=}" ;; *) echo "$arg: didn't read" ;; esac; done #******************************************************************************# # Little things # #******************************************************************************# # Cross-compilation things if [ ! $prefix_set ] && [ $target ]; then prefix="$prefix"/"$target" fi # Check MS-Windows targets case "$target" in *-mingw32) windows=y ;; esac # Evaluate variables for var in prefix bindir mandir; do eval $var'='$(eval 'echo $'$var) done # Check if is on Cygwin [ "$(expr substr "$(uname -s)" 1 10)" = "MINGW32_NT" ] && windows=y # If on MS-Windows, do not make the manpages. [ "$windows" ] && install_manpages= #******************************************************************************# # Create Makefile configuration # #******************************************************************************# # Clean before. make mrproper MAKE_FULL_LOG=y 1>/dev/null 2>/dev/null # Do it! exec 3>&1 1>Makefile.cfg cat <&3 3>&- chmod +x Makefile.cfg #******************************************************************************# # Finish # #******************************************************************************# echo "Configuration loaded, you can make now." # End of file.