#! /bin/bash # # Basic configuration # output="Makefile.cfg" # # Help screen # help() { cat << EOF Configuration script for the fxengine library. Usage: $0 [options...] Specified target : --fxcg50 --fx9680g If you don't send any option, fx9860g is set as default * Note fxcg50 is not really supported now, but maybe someday it would happen ! Optional dependencies : --libprof By default, profiling is disabled, tht means you will not have access to fps. :( This option enables fps count, but you need to have libprof (by Lephenixnoir) installed --liblog If you want more advanced debug options, you can add this to add a virtual stream used for logging debug informations You need tou have liblog (by me) installed EOF exit 0 } if [[ "$@" == "--help" ]]; then help exit 1 fi # # Parsing arguments # target=-DFX9860G libprof= liblog= fail=false for arg; do case "$arg" in -h | -? | --help) help;; --libprof) libprof=-DUSE_LIBPROF;; --liblog) liblog=-DUSE_LIBLOG;; --fx9860g) target=-DFX9860G;; --fxcg50) target=-DFXCG50;; *) echo "error: unrecognized argument '$arg'"; fail=true;; esac; done # # Checking mandatory arguments # if $fail; then echo "Oops ! Maybe a wrong option..." exit 1 fi # # Output config # output_config() { echo -n "FLAGS =" echo -n " $(echo $target)" echo -n " $(echo $libprof)" echo -n " $(echo $liblog)" echo "" } output_config > $output echo "Configuration saved in $output, ready to make!"