3 # ./configure -- A very simple configure script for v86d.
5 # (c) 2006-2007, Michal Januszewski <spock@gentoo.org>
7 # In time, it will be replaced by a fully-fledged version.
10 copt_klibc
=CONFIG_KLIBC
11 copt_klibc_desc
="Link statically against klibc"
12 copt_klibc_type
="bool"
15 copt_debug
=CONFIG_DEBUG
16 copt_debug_desc
="Use additional debugging features"
17 copt_debug_type
="bool"
20 copt_x86emu
=CONFIG_X86EMU
21 copt_x86emu_desc
="Use x86emu for BIOS calls"
22 copt_x86emu_type
="bool"
27 if [ "$m" = "i686" -o "$m" = "i586" -o "$m" = "i486" -o "$m" = "i386" ]; then
29 elif [ "$m" = "x86_64" ]; then
32 echo "It looks like your architecture '$m' isn't supported by this version of v86d." >&2
37 options
=`set | grep '^copt_' | sed -re 's/copt_([^_=]+)[_=].*/\1/' | uniq`
43 for i
in ${options} ; do
44 eval vval
=\
$copt_$i\_val
45 eval vtype
=\
$copt_$i\_type
48 if [[ "$vtype" == "bool" ]]; then
49 if [[ "$vval" == "y" ]]; then
50 echo "#define $vname" >> config.h
52 echo "#undef $vname" >> config.h
55 echo "#define $vname \"$vval\"" >> config.h
59 echo "config.h successfully created."
60 echo "You can run \`make\` now."
66 v86d configuration script
68 Please use the following options to configure v86d.
70 printf " %-20s %-s\n\n" --default "Use a default v86d configuration"
72 for i
in ${options} ; do
73 eval vtype
=\
$copt_$i\_type
74 eval vdesc
=\
$copt_$i\_desc
75 eval vdef
=\
$copt_$i\_def
77 if [[ ${vtype} == "string" ]]; then
78 with
="--with-${i}=VAL"
83 vdesc
="${vdesc} (default: $vdef)"
85 printf " %-20s %-s\n" ${with} "${vdesc}"
89 if [[ $# == 0 ]]; then
94 for i
in ${options} ; do
95 eval copt_
${i}_val
="\$copt_${i}_def"
96 if [ -n "$(set | grep copt_${i}_test)" ]; then
97 eval copt_
${i}_val
="\$(copt_${i}_test)"
102 if [[ "$i" == "--help" ]]; then
105 elif [[ "$i" == "--default" ]]; then
111 if [[ "$j" != "$i" ]]; then
115 if [[ "$j" != "$i" ]]; then
126 eval t
=\
$copt_${optname}_val
127 if [[ "x$t" == "x" ]]; then
128 echo "Unrecognized setting ${optname}." 1>&2
132 eval vtype
=\
$copt_${optname}_type
133 if [[ "$vtype" == "bool" ]]; then
134 eval copt_
${optname}_val
=${with}
136 eval copt_
${optname}_val
=${optval}