81 lines
1.0 KiB
Bash
Executable File
81 lines
1.0 KiB
Bash
Executable File
#! /bin/bash
|
|
|
|
#
|
|
# Basic configuration
|
|
#
|
|
|
|
|
|
|
|
output="Makefile.cfg"
|
|
|
|
#
|
|
# Help screen
|
|
#
|
|
|
|
help()
|
|
{
|
|
cat << EOF
|
|
Configuration script for the fxengine library.
|
|
This is actually very simple... ^^
|
|
|
|
Build option (there is just only one) :
|
|
|
|
--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!"
|