hex2bin.pl: replace spaces with dots for better view
[terpinus.git] / configure
bloba6bd66903687a2e72c987fbf668dc93f947fd7e8
1 #!/bin/sh
3 if test "$1" = "--help" ; then
4 echo usage: $0 [--option=VALUE] [VAR=VALUE] ...
5 echo
6 cat configure.help 2> /dev/null && echo
7 echo "Any options or variables not explicitly set are reset to defaults"
8 elif test "$1" = "--version" ; then
9 cat << EOT
10 micro configure 0.2, Copyright (C) 2005 Dimitar Toshkov Zhekov
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of
15 the License, or (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 Report bugs to jimmy@is-vn.bg
23 EOT
24 elif test -z `printf "\r"` ; then
25 echo "$0: printf failure"
26 false
27 elif test -f Makefile ; then
28 if test -f Makefile.in ; then
29 cp -fp Makefile.in Makefile
30 else
31 cp -p Makefile Makefile.in
33 w=`printf "[\t ]*"`
34 r=`printf "\r"`
35 l="[a-z][a-z0-9-]*[^-]"
36 for i do
37 if test "$i" != "`echo "$i" | sed -e 1q`" ; then
38 echo "$0: `echo "$i" | sed -e "s/$r/^M/" -e 1q`^J...: contains line feed" 1>&2
39 elif echo "$i" | grep "$r" > /dev/null ; then
40 echo "$0: `echo "$i" | sed -e "s/$r.*//"`^M...: contains carriage return" 1>&2
41 elif test -n "$i" ; then
42 i=`echo "$i" | sed -e "s$r^--enable-\($l\)\\$$r--\1=yes$r"`
43 i=`echo "$i" | sed -e "s$r^--disable-\($l\)\\$$r--\1=no$r"`
44 i=`echo "$i" | sed -e "s$r^--enable-\($l\)=\(yes\|no\)\\$$r--\1=\2$r"`
45 i=`echo "$i" | sed -e "s$r^--with-\($l\)=\|^--without-\($l\)\\$$r--\1=$r"`
46 if echo "$i" | grep "^--$l=\|^[A-Z][A-Z0-9_]*[^_]=" > /dev/null ; then
47 n=`echo "$i" | sed -e "s$r^-*$r$r" -e "s$r=.*$r$r" | sed -e "s/-/_/g"`
48 if grep "^$n$w:\?=" Makefile > /dev/null ; then
49 cp -f Makefile Makefile.$$
50 sed -e "s$r^\($n$w:*=$w\).*$r\1`echo "$i" | sed -e "s$r^[^=]*=$r$r"`$r" Makefile.$$ > Makefile
51 grep "^$n$w:\?=" Makefile /dev/null
52 else
53 echo "$0: $n: not found in Makefile" 1>&2
55 unset n
56 else
57 echo "$0: $i: not recognized" 1>&2
60 done
61 unset i l r w
62 if test -f Makefile.$$ ; then
63 rm -f Makefile.$$
64 else
65 rm -f Makefile.in
67 else
68 echo "$0: Makefile: not found" 1>&2
69 false