#! /bin/bash # # Basic configuration # output="Makefile.cfg" # # Help screen # help() { cat << EOF Configuration script for the fxengine library. Usage: $0 [options...] You should build out-of-tree by creating a build directory and configuring from there. Build option: --enable-profiling 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 EOF exit 0 } if [[ "$@" == "--help" ]]; then help exit 1 fi # # Parsing arguments # add_cflags= fail=false for arg; do case "$arg" in -h | -? | --help) help;; --enable-profiling) add_cflags=-DUSE_LIBPROF;; *) 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 "PROFILING =" echo -n " $(echo $add_cflags)" echo "" } output_config > $output echo "Configuration saved in $output, ready to make!"