mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-18 00:32:46 +00:00
Add quickbuild.
This commit is contained in:
parent
eca313bf9c
commit
e65d9f349d
13
configure
vendored
Executable file
13
configure
vendored
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo ""
|
||||
|
||||
. qb/config.params.sh
|
||||
|
||||
parse_input "$@"
|
||||
|
||||
. qb/qb.comp.sh
|
||||
. qb/config.libs.sh
|
||||
|
||||
|
||||
|
2
qb/conf.comp.sh
Normal file
2
qb/conf.comp.sh
Normal file
@ -0,0 +1,2 @@
|
||||
USE_LANG_C="yes"
|
||||
USE_LANG_CXX="yes"
|
24
qb/config.libs.sh
Normal file
24
qb/config.libs.sh
Normal file
@ -0,0 +1,24 @@
|
||||
. qb/qb.libs.sh
|
||||
|
||||
check_switch_c C99 -std=gnu99
|
||||
check_critical C99 "Cannot find C99 compatible compiler."
|
||||
|
||||
check_lib_cxx SNES $LIBSNES snes_init -ldl
|
||||
check_critical SNES "Cannot find libsnes."
|
||||
|
||||
check_lib ALSA -lasound snd_pcm_open
|
||||
check_header OSS sys/soundcard.h
|
||||
check_lib AL -lopenal alcOpenDevice
|
||||
check_lib RSOUND -lrsound rsd_init
|
||||
check_lib ROAR -lroar roar_vs_new
|
||||
|
||||
check_lib GLFW -lglfw glfwInit
|
||||
check_critical GLFW "Cannot find GLFW library."
|
||||
|
||||
check_lib SRC -lsamplerate src_callback_new
|
||||
|
||||
# Creates config.mk.
|
||||
VARS="ALSA OSS AL RSOUND ROAR GLFW FILTERS"
|
||||
create_config_make config.mk $VARS
|
||||
create_config_header config.h $VARS
|
||||
|
17
qb/config.params.sh
Normal file
17
qb/config.params.sh
Normal file
@ -0,0 +1,17 @@
|
||||
. qb/qb.params.sh
|
||||
|
||||
PACKAGE_NAME=ssnes
|
||||
PACKAGE_VERSION=0.1
|
||||
|
||||
# Adds a command line opt to ./configure --help
|
||||
# $1: Variable (HAVE_ALSA, HAVE_OSS, etc)
|
||||
# $2: Comment
|
||||
# $3: Default arg. auto implies that HAVE_ALSA will be set according to library checks later on.
|
||||
add_command_line_string LIBSNES "libsnes library used" "-lsnes"
|
||||
add_command_line_enable FILTERS "Disable CPU filter support" yes
|
||||
add_command_line_enable CG "Enable CG shader support" auto
|
||||
add_command_line_enable ALSA "Enable ALSA support" auto
|
||||
add_command_line_enable OSS "Enable OSS support" auto
|
||||
add_command_line_enable RSOUND "Enable RSound support" auto
|
||||
add_command_line_enable ROAR "Enable RoarAudio support" auto
|
||||
add_command_line_enable AL "Enable OpenAL support" auto
|
68
qb/qb.comp.sh
Normal file
68
qb/qb.comp.sh
Normal file
@ -0,0 +1,68 @@
|
||||
. qb/conf.comp.sh
|
||||
|
||||
TEMP_C=.tmp.c
|
||||
TEMP_CXX=.tmp.cxx
|
||||
TEMP_EXE=.tmp
|
||||
|
||||
echo -n "Checking operating system ... "
|
||||
OS="Win32" # whatever ;D
|
||||
unamestr="`uname -o`"
|
||||
if [ ! -z "`echo $unamestr | grep -i Linux`" ]; then
|
||||
OS="Linux"
|
||||
elif [ ! -z "`echo $unamestr | grep -i Darwin`" ]; then
|
||||
OS="Darwin"
|
||||
elif [ ! -z "`echo $unamestr | grep -i BSD`" ]; then
|
||||
OS="BSD"
|
||||
elif [ ! -z "`echo $unamestr | grep -i NT`" ]; then
|
||||
OS="Cygwin"
|
||||
fi
|
||||
|
||||
echo $OS
|
||||
|
||||
|
||||
# Checking for working C compiler
|
||||
if [ "$USE_LANG_C" = yes ]; then
|
||||
echo "Checking for working C compiler ..."
|
||||
if [ -z $CC ]; then
|
||||
CC=`which gcc cc 2> /dev/null | grep ^/ | head -n 1`
|
||||
fi
|
||||
if [ -z $CC ]; then
|
||||
echo "Could not find C compiler in path. Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "Checking if $CC is a suitable compiler ... "
|
||||
answer=no
|
||||
echo "#include <stdio.h>" > $TEMP_C
|
||||
echo "int main(void) { puts(\"Hai world!\"); return 0; }" >> $TEMP_C
|
||||
$CC -o $TEMP_EXE $TEMP_C 2>/dev/null >/dev/null && answer=yes
|
||||
echo $answer
|
||||
|
||||
rm -rf $TEMP_C $TEMP_EXE
|
||||
|
||||
[ $answer = no ] && echo "Can't find suitable C compiler. Exiting ..." && exit 1
|
||||
fi
|
||||
|
||||
# Checking for working C++ compiler
|
||||
if [ "$USE_LANG_CXX" = "yes" ]; then
|
||||
echo "Checking for working C++ compiler ..."
|
||||
if [ -z $CXX ]; then
|
||||
CXX=`which g++ c++ 2> /dev/null | grep ^/ | head -n 1`
|
||||
fi
|
||||
if [ -z $CXX ]; then
|
||||
echo "Could not find C compiler in path. Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "Checking if $CXX is a suitable compiler ... "
|
||||
answer=no
|
||||
echo "#include <iostream>" > $TEMP_CXX
|
||||
echo "int main() { std::cout << \"Hai guise\" << std::endl; return 0; }" >> $TEMP_CXX
|
||||
$CXX -o $TEMP_EXE $TEMP_CXX 2>/dev/null >/dev/null && answer=yes
|
||||
echo $answer
|
||||
|
||||
rm -rf $TEMP_CXX $TEMP_EXE
|
||||
|
||||
[ $answer = no ] && echo "Can't find suitable C++ compiler. Exiting ..." && exit 1
|
||||
fi
|
||||
|
313
qb/qb.libs.sh
Normal file
313
qb/qb.libs.sh
Normal file
@ -0,0 +1,313 @@
|
||||
|
||||
PKG_CONF_PATH=""
|
||||
PKG_CONF_USED=""
|
||||
CONFIG_DEFINES=""
|
||||
MAKEFILE_DEFINES=""
|
||||
INCLUDE_DIRS=""
|
||||
LIBRARY_DIRS=""
|
||||
[ -z "$PREFIX" ] && PREFIX="/usr/local"
|
||||
|
||||
add_define_header()
|
||||
{
|
||||
CONFIG_DEFINES="$CONFIG_DEFINES:@$1@$2@:"
|
||||
}
|
||||
|
||||
add_define_make()
|
||||
{
|
||||
MAKEFILE_DEFINES="$MAKEFILE_DEFINES:@$1@$2@:"
|
||||
}
|
||||
|
||||
add_include_dirs()
|
||||
{
|
||||
while [ ! -z "$1" ]
|
||||
do
|
||||
INCLUDE_DIRS="$INCLUDE_DIRS -I$1"
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
add_library_dirs()
|
||||
{
|
||||
while [ ! -z "$1" ]
|
||||
do
|
||||
LIBRARY_DIRS="$LIBRARY_DIRS -L$1"
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
check_lib()
|
||||
{
|
||||
tmpval="HAVE_$1"
|
||||
eval tmpval=\$$tmpval
|
||||
[ "$tmpval" = "no" ] && return 0
|
||||
|
||||
echo -n "Checking function $3 in $2 ... "
|
||||
echo "void $3(void); int main(void) { $3(); return 0; }" > $TEMP_C
|
||||
|
||||
|
||||
eval HAVE_$1=no
|
||||
answer=no
|
||||
|
||||
extralibs="$4"
|
||||
|
||||
$CC -o $TEMP_EXE $TEMP_C $INCLUDE_DIRS $LIBRARY_DIRS $extralibs $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
|
||||
|
||||
echo $answer
|
||||
|
||||
rm -rf $TEMP_C $TEMP_EXE
|
||||
if [ "$tmpval" = "yes" ] && [ "$answer" = "no" ]; then
|
||||
echo "Forced to build with library $2, but cannot locate. Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_lib_cxx()
|
||||
{
|
||||
tmpval="HAVE_$1"
|
||||
eval tmpval=\$$tmpval
|
||||
[ "$tmpval" = "no" ] && return 0
|
||||
|
||||
echo -n "Checking function $3 in $2 ... "
|
||||
echo "extern \"C\" { void $3(void); } int main() { $3(); }" > $TEMP_CXX
|
||||
|
||||
eval HAVE_$1=no
|
||||
answer=no
|
||||
|
||||
extralibs="$4"
|
||||
|
||||
$CXX -o $TEMP_EXE $TEMP_CXX $INCLUDE_DIRS $LIBRARY_DIRS $extralibs $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
|
||||
|
||||
echo $answer
|
||||
|
||||
rm -rf $TEMP_CXX $TEMP_EXE
|
||||
if [ "$tmpval" = "yes" ] && [ "$answer" = "no" ]; then
|
||||
echo "Forced to build with library $2, but cannot locate. Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
locate_pkg_conf()
|
||||
{
|
||||
echo -n "Checking for pkg-config ... "
|
||||
PKG_CONF_PATH="`which pkg-config | grep ^/ | head -n1`"
|
||||
if [ -z $PKG_CONF_PATH ]; then
|
||||
echo "not found"
|
||||
echo "Cannot locate pkg-config. Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
echo "$PKG_CONF_PATH"
|
||||
}
|
||||
|
||||
check_pkgconf()
|
||||
{
|
||||
[ -z "$PKG_CONF_PATH" ] && locate_pkg_conf
|
||||
|
||||
tmpval="HAVE_$1"
|
||||
eval tmpval=\$$tmpval
|
||||
[ "$tmpval" = "no" ] && return 0
|
||||
|
||||
echo -n "Checking presence of package $2 ... "
|
||||
eval HAVE_$1=no
|
||||
eval $1_CFLAGS=""
|
||||
eval $1_LIBS=""
|
||||
answer=no
|
||||
minver=0.0
|
||||
[ ! -z $3 ] && minver=$3
|
||||
pkg-config --atleast-version=$minver --exists "$2" && eval HAVE_$1=yes && eval $1_CFLAGS='"`pkg-config $2 --cflags`"' && eval $1_LIBS='"`pkg-config $2 --libs`"' && answer=yes
|
||||
echo $answer
|
||||
|
||||
PKG_CONF_USED="$PKG_CONF_USED $1"
|
||||
|
||||
if [ "$tmpval" = "yes" ] && [ "$answer" = "no" ]; then
|
||||
echo "Forced to build with package $2, but cannot locate. Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_header()
|
||||
{
|
||||
tmpval="HAVE_$1"
|
||||
eval tmpval=\$$tmpval
|
||||
[ "$tmpval" = "no" ] && return 0
|
||||
|
||||
echo -n "Checking presence of header file $2 ... "
|
||||
echo "#include<$2>" > $TEMP_C
|
||||
echo "int main(void) { return 0; }" >> $TEMP_C
|
||||
eval HAVE_$1=no
|
||||
answer=no
|
||||
|
||||
$CC -o $TEMP_EXE $TEMP_C $INCLUDE_DIRS 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
|
||||
|
||||
echo $answer
|
||||
|
||||
rm -rf $TEMP_C $TEMP_EXE
|
||||
if [ "$tmpval" = "yes" ] && [ "$answer" = "no" ]; then
|
||||
echo "Build assumed that $2 exists, but cannot locate. Exiting ..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_switch_c()
|
||||
{
|
||||
echo -n "Checking for availability of switch $2 in $CC ... "
|
||||
if [ -z "$CC" ]; then
|
||||
echo "No C compiler, cannot check ..."
|
||||
exit 1
|
||||
fi
|
||||
echo "int main(void) { return 0; }" > $TEMP_C
|
||||
eval HAVE_$1=no
|
||||
answer=no
|
||||
$CC -o $TEMP_EXE $TEMP_C $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
|
||||
|
||||
echo $answer
|
||||
|
||||
rm -rf $TEMP_C $TEMP_EXE
|
||||
}
|
||||
|
||||
check_switch_cxx()
|
||||
{
|
||||
echo -n "Checking for availability of switch $2 in $CXX ... "
|
||||
if [ -z "$CXX" ]; then
|
||||
echo "No C++ compiler, cannot check ..."
|
||||
exit 1
|
||||
fi
|
||||
echo "int main() { return 0; }" > $TEMP_CXX
|
||||
eval HAVE_$1=no
|
||||
answer=no
|
||||
$CXX -o $TEMP_EXE $TEMP_CXX $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
|
||||
|
||||
echo $answer
|
||||
|
||||
rm -rf $TEMP_CXX $TEMP_EXE
|
||||
}
|
||||
|
||||
check_critical()
|
||||
{
|
||||
val=HAVE_$1
|
||||
eval val=\$$val
|
||||
if [ "$val" != "yes" ]; then
|
||||
echo "$2"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
output_define_header()
|
||||
{
|
||||
arg1="`echo $2 | sed 's|^@\([^@]*\)@\([^@]*\)@$|\1|'`"
|
||||
arg2="`echo $2 | sed 's|^@\([^@]*\)@\([^@]*\)@$|\2|'`"
|
||||
|
||||
echo "#define $arg1 $arg2" >> "$outfile"
|
||||
}
|
||||
|
||||
create_config_header()
|
||||
{
|
||||
outfile="$1"
|
||||
shift
|
||||
|
||||
echo "Creating config header: $outfile"
|
||||
|
||||
name="`echo __$outfile | sed 's|[\./]|_|g' | tr '[a-z]' '[A-Z]'`"
|
||||
echo "#ifndef $name" > "$outfile"
|
||||
echo "#define $name" >> "$outfile"
|
||||
echo "" >> "$outfile"
|
||||
echo "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >> "$outfile"
|
||||
echo "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >> "$outfile"
|
||||
|
||||
while [ ! -z "$1" ]
|
||||
do
|
||||
tmpval="HAVE_$1"
|
||||
eval tmpval=\$$tmpval
|
||||
if [ "$tmpval" = "yes" ]; then
|
||||
echo "#define HAVE_$1 1" >> "$outfile"
|
||||
elif [ "$tmpval" = "no" ]; then
|
||||
echo "/* #undef HAVE_$1 */" >> "$outfile"
|
||||
fi
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
echo "" >> "$outfile"
|
||||
|
||||
tmpdefs="$CONFIG_DEFINES"
|
||||
while [ ! -z "$tmpdefs" ]
|
||||
do
|
||||
subdefs="`echo $tmpdefs | sed 's|^:\(@[^@]*@[^@]*@\):.*$|\1|'`"
|
||||
tmpdefs="`echo $tmpdefs | sed 's|^\W*$||'`"
|
||||
tmpdefs="`echo $tmpdefs | sed 's|^:\(@[^@]*@[^@]*@\):||'`"
|
||||
output_define_header "$outfile" "$subdefs"
|
||||
done
|
||||
|
||||
echo "#endif" >> "$outfile"
|
||||
}
|
||||
|
||||
output_define_make()
|
||||
{
|
||||
arg1="`echo $2 | sed 's|^@\([^@]*\)@\([^@]*\)@$|\1|'`"
|
||||
arg2="`echo $2 | sed 's|^@\([^@]*\)@\([^@]*\)@$|\2|'`"
|
||||
|
||||
echo "$arg1 = $arg2" >> "$outfile"
|
||||
}
|
||||
|
||||
create_config_make()
|
||||
{
|
||||
|
||||
outfile="$1"
|
||||
shift
|
||||
|
||||
echo "Creating make config: $outfile"
|
||||
|
||||
rm -rf "$outfile"
|
||||
touch "$outfile"
|
||||
if [ "$USE_LANG_C" = "yes" ]; then
|
||||
echo "CC = $CC" >> "$outfile"
|
||||
echo "CFLAGS = $CFLAGS" >> "$outfile"
|
||||
fi
|
||||
if [ "$USE_LANG_CXX" = "yes" ]; then
|
||||
echo "CXX = $CXX" >> "$outfile"
|
||||
echo "CXXFLAGS = $CXXFLAGS" >> "$outfile"
|
||||
fi
|
||||
echo "LDFLAGS = $LDFLAGS" >> "$outfile"
|
||||
echo "INCLUDE_DIRS = $INCLUDE_DIRS" >> "$outfile"
|
||||
echo "LIBRARY_DIRS = $LIBRARY_DIRS" >> "$outfile"
|
||||
echo "PACKAGE_NAME = $PACKAGE_NAME" >> "$outfile"
|
||||
echo "PACKAGE_VERSION = $PACKAGE_VERSION" >> "$outfile"
|
||||
echo "PREFIX = $PREFIX" >> "$outfile"
|
||||
|
||||
while [ ! -z "$1" ]
|
||||
do
|
||||
tmpval="HAVE_$1"
|
||||
eval tmpval=\$$tmpval
|
||||
if [ $tmpval = yes ]; then
|
||||
echo "HAVE_$1 = 1" >> "$outfile"
|
||||
elif [ $tmpval = no ]; then
|
||||
echo "HAVE_$1 = 0" >> "$outfile"
|
||||
fi
|
||||
|
||||
if [ ! -z "`echo $PKG_CONF_USED | grep $1`" ]; then
|
||||
tmpval="$1_CFLAGS"
|
||||
eval tmpval=\$$tmpval
|
||||
echo "$1_CFLAGS = $tmpval" >> "$outfile"
|
||||
|
||||
tmpval="$1_LIBS"
|
||||
eval tmpval=\$$tmpval
|
||||
echo "$1_LIBS = $tmpval" >> "$outfile"
|
||||
fi
|
||||
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
echo "" >> "$outfile"
|
||||
|
||||
tmpdefs="$MAKEFILE_DEFINES"
|
||||
while [ ! -z "$tmpdefs" ]
|
||||
do
|
||||
subdefs="`echo $tmpdefs | sed 's|^:\(@[^@]*@[^@]*@\):.*$|\1|'`"
|
||||
tmpdefs="`echo $tmpdefs | sed 's|^\W*$||'`"
|
||||
tmpdefs="`echo $tmpdefs | sed 's|^:\(@[^@]*@[^@]*@\):||'`"
|
||||
output_define_make "$outfile" "$subdefs"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
149
qb/qb.params.sh
Normal file
149
qb/qb.params.sh
Normal file
@ -0,0 +1,149 @@
|
||||
COMMAND_LINE_OPTS_ENABLE=""
|
||||
|
||||
add_command_line_enable()
|
||||
{
|
||||
COMMAND_LINE_OPTS_ENABLE="$COMMAND_LINE_OPTS_ENABLE:\"$1\" \"$2\" \"$3\":"
|
||||
eval HAVE_$1=$3
|
||||
}
|
||||
|
||||
add_command_line_string()
|
||||
{
|
||||
COMMAND_LINE_OPTS_STRINGS="$COMMAND_LINE_OPTS_STRINGS:\"$1\" \"$2\" \"$3\":"
|
||||
eval $1=$3
|
||||
}
|
||||
|
||||
## lvl. 43 regex dragon awaits thee.
|
||||
print_help()
|
||||
{
|
||||
echo "===================="
|
||||
echo " Quickbuild script"
|
||||
echo "===================="
|
||||
echo "Package: $PACKAGE_NAME"
|
||||
echo "Version: $PACKAGE_VERSION"
|
||||
echo ""
|
||||
echo "General environment variables:"
|
||||
echo "CC: C compiler"
|
||||
echo "CFLAGS: C compiler flags"
|
||||
echo "CXX: C++ compiler"
|
||||
echo "CXXFLAGS: C++ compiler flags"
|
||||
echo "LDFLAGS: Linker flags"
|
||||
echo ""
|
||||
echo "General options:"
|
||||
echo "--prefix=\$path: Install path prefix"
|
||||
echo "--help: Show this help"
|
||||
echo ""
|
||||
echo "Custom options:"
|
||||
|
||||
tmpopts="$COMMAND_LINE_OPTS_ENABLE"
|
||||
while [ ! -z "$tmpopts" ]
|
||||
do
|
||||
subopts="`echo $tmpopts | sed 's|^:"\([^"]*\)"."\([^"]*\)"."\([^"]*\)":.*$|"\1":"\2":"\3"|'`"
|
||||
tmpopts="`echo $tmpopts | sed 's|^\W*$||'`"
|
||||
tmpopts="`echo $tmpopts | sed 's|^:"[^"]*"."[^"]*"."[^"]*":||'`"
|
||||
print_sub_opt "$subopts"
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
tmpopts="$COMMAND_LINE_OPTS_STRINGS"
|
||||
while [ ! -z "$tmpopts" ]
|
||||
do
|
||||
subopts="`echo $tmpopts | sed 's|^:"\([^"]*\)"."\([^"]*\)"."\([^"]*\)":.*$|"\1":"\2":"\3"|'`"
|
||||
tmpopts="`echo $tmpopts | sed 's|^\W*$||'`"
|
||||
tmpopts="`echo $tmpopts | sed 's|^:"[^"]*"."[^"]*"."[^"]*":||'`"
|
||||
print_sub_str_opt "$subopts"
|
||||
done
|
||||
}
|
||||
|
||||
print_sub_opt()
|
||||
{
|
||||
arg1="`echo $1 | sed 's|^"\([^"]*\)":"\([^"]*\)":"\([^"]*\)"$|\1|'`"
|
||||
arg2="`echo $1 | sed 's|^"\([^"]*\)":"\([^"]*\)":"\([^"]*\)"$|\2|'`"
|
||||
arg3="`echo $1 | sed 's|^"\([^"]*\)":"\([^"]*\)":"\([^"]*\)"$|\3|'`"
|
||||
|
||||
lowertext="`echo $arg1 | tr '[A-Z]' '[a-z]'`"
|
||||
|
||||
if [ "$arg3" = "auto" ]; then
|
||||
echo -n "--enable-$lowertext: "
|
||||
echo $arg2
|
||||
echo "--disable-$lowertext"
|
||||
elif [ "$arg3" = "yes" ]; then
|
||||
echo "--disable-$lowertext: $arg2"
|
||||
elif [ "$arg3" = "no" ]; then
|
||||
echo "--enable-$lowertext: $arg2"
|
||||
fi
|
||||
}
|
||||
|
||||
print_sub_str_opt()
|
||||
{
|
||||
arg1="`echo $1 | sed 's|^"\([^"]*\)":"\([^"]*\)":"\([^"]*\)"$|\1|'`"
|
||||
arg2="`echo $1 | sed 's|^"\([^"]*\)":"\([^"]*\)":"\([^"]*\)"$|\2|'`"
|
||||
arg3="`echo $1 | sed 's|^"\([^"]*\)":"\([^"]*\)":"\([^"]*\)"$|\3|'`"
|
||||
|
||||
lowertext="`echo $arg1 | tr '[A-Z]' '[a-z]'`"
|
||||
|
||||
echo "--with-$lowertext: $arg2 (Defaults: $arg3)"
|
||||
}
|
||||
|
||||
parse_input()
|
||||
{
|
||||
### Parse stuff :V
|
||||
|
||||
while [ ! -z "$1" ]
|
||||
do
|
||||
prefix="`echo $1 | sed -e 's|^--prefix=\(\S\S*\)$|\1|' -e 's|\(\S\S*\)/|\1|'`"
|
||||
|
||||
if [ "$prefix" != "$1" ]; then
|
||||
PREFIX="$prefix"
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
||||
--enable-*)
|
||||
enable=`echo $1 | sed 's|^--enable-||'`
|
||||
if [ -z "`echo $COMMAND_LINE_OPTS_ENABLE | grep -i $enable`" ]; then
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
eval HAVE_`echo $enable | tr '[a-z]' '[A-Z]'`=yes
|
||||
;;
|
||||
|
||||
--disable-*)
|
||||
disable=`echo $1 | sed 's|^--disable-||'`
|
||||
if [ -z "`echo $COMMAND_LINE_OPTS_ENABLE | grep -i $disable`" ]; then
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
eval HAVE_`echo $disable | tr '[a-z]' '[A-Z]'`=no
|
||||
;;
|
||||
|
||||
--with-*)
|
||||
arg="`echo $1 | sed 's|^--with-\S\S*=||'`"
|
||||
with=`echo $1 | sed 's|^--with-\(\S\S*\)=.*$|\1|'`
|
||||
if [ -z "`echo $COMMAND_LINE_OPTS_STRINGS | grep -i $with`" ]; then
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
eval "`echo $with | tr '[a-z]' '[A-Z]'`=\"$arg\""
|
||||
;;
|
||||
|
||||
|
||||
-h|--help)
|
||||
print_help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
shift
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user