radare2/r2-bindings/configure
pancake 47357a1b89 * Rename swig/ to r2-bindings
- Avoid confusions with the name :)

--HG--
rename : swig/Makefile => r2-bindings/Makefile
rename : swig/README => r2-bindings/README
rename : swig/autogen.sh => r2-bindings/autogen.sh
rename : swig/check-langs.sh => r2-bindings/check-langs.sh
rename : swig/config.mk.acr => r2-bindings/config.mk.acr
rename : swig/configure => r2-bindings/configure
rename : swig/configure.acr => r2-bindings/configure.acr
rename : swig/cxx/Makefile => r2-bindings/cxx/Makefile
rename : swig/do-swig.sh => r2-bindings/do-swig.sh
rename : swig/do-test.sh => r2-bindings/do-test.sh
rename : swig/go/Makefile => r2-bindings/go/Makefile
rename : swig/go/fixgoswig.sh => r2-bindings/go/fixgoswig.sh
rename : swig/go/test-r_bin.go => r2-bindings/go/test-r_bin.go
rename : swig/guile/Makefile => r2-bindings/guile/Makefile
rename : swig/guile/test-asm.scm => r2-bindings/guile/test-asm.scm
rename : swig/guile/test-util.scm => r2-bindings/guile/test-util.scm
rename : swig/guile/vapi.patch => r2-bindings/guile/vapi.patch
rename : swig/java/Makefile => r2-bindings/java/Makefile
rename : swig/java/TestRBin.java => r2-bindings/java/TestRBin.java
rename : swig/lua/Makefile => r2-bindings/lua/Makefile
rename : swig/lua/test-r_asm.lua => r2-bindings/lua/test-r_asm.lua
rename : swig/lua/test-r_bin.lua => r2-bindings/lua/test-r_bin.lua
rename : swig/lua/test-r_bp.lua => r2-bindings/lua/test-r_bp.lua
rename : swig/lua/test-r_core.lua => r2-bindings/lua/test-r_core.lua
rename : swig/perl/Makefile => r2-bindings/perl/Makefile
rename : swig/perl/test-r_asm.pl => r2-bindings/perl/test-r_asm.pl
rename : swig/perl/test-r_bin.pl => r2-bindings/perl/test-r_bin.pl
rename : swig/perl/test-r_bp.pl => r2-bindings/perl/test-r_bp.pl
rename : swig/python-config-wrapper => r2-bindings/python-config-wrapper
rename : swig/python/Makefile => r2-bindings/python/Makefile
rename : swig/python/r_cons.i.experimental => r2-bindings/python/r_cons.i.experimental
rename : swig/python/remote.py => r2-bindings/python/remote.py
rename : swig/python/test-r2rc.py => r2-bindings/python/test-r2rc.py
rename : swig/python/test-r_asm.py => r2-bindings/python/test-r_asm.py
rename : swig/python/test-r_bin.py => r2-bindings/python/test-r_bin.py
rename : swig/python/test-r_bp.py => r2-bindings/python/test-r_bp.py
rename : swig/python/test-r_bp2.py => r2-bindings/python/test-r_bp2.py
rename : swig/python/test-r_cons.py => r2-bindings/python/test-r_cons.py
rename : swig/python/test-r_core.py => r2-bindings/python/test-r_core.py
rename : swig/python/test-r_flags.py => r2-bindings/python/test-r_flags.py
rename : swig/python/test-r_hash.py => r2-bindings/python/test-r_hash.py
rename : swig/python/test-r_num.py => r2-bindings/python/test-r_num.py
rename : swig/python/test-r_util.py => r2-bindings/python/test-r_util.py
rename : swig/python/test-ragdiff2.py => r2-bindings/python/test-ragdiff2.py
rename : swig/ruby/Makefile => r2-bindings/ruby/Makefile
rename : swig/ruby/test-r_bin.rb => r2-bindings/ruby/test-r_bin.rb
rename : swig/ruby/test-r_bp.rb => r2-bindings/ruby/test-r_bp.rb
rename : swig/ruby/test-r_core.rb => r2-bindings/ruby/test-r_core.rb
rename : swig/rules.mk => r2-bindings/rules.mk
rename : swig/vapi/libr.deps => r2-bindings/vapi/libr.deps
rename : swig/vapi/libr.vapi => r2-bindings/vapi/libr.vapi
rename : swig/vapi/r_anal.deps => r2-bindings/vapi/r_anal.deps
rename : swig/vapi/r_anal.vapi => r2-bindings/vapi/r_anal.vapi
rename : swig/vapi/r_asm.deps => r2-bindings/vapi/r_asm.deps
rename : swig/vapi/r_asm.vapi => r2-bindings/vapi/r_asm.vapi
rename : swig/vapi/r_bin.deps => r2-bindings/vapi/r_bin.deps
rename : swig/vapi/r_bin.vapi => r2-bindings/vapi/r_bin.vapi
rename : swig/vapi/r_bp.deps => r2-bindings/vapi/r_bp.deps
rename : swig/vapi/r_bp.vapi => r2-bindings/vapi/r_bp.vapi
rename : swig/vapi/r_cmd.deps => r2-bindings/vapi/r_cmd.deps
rename : swig/vapi/r_cmd.vapi => r2-bindings/vapi/r_cmd.vapi
rename : swig/vapi/r_config.vapi => r2-bindings/vapi/r_config.vapi
rename : swig/vapi/r_cons.vapi => r2-bindings/vapi/r_cons.vapi
rename : swig/vapi/r_core.deps => r2-bindings/vapi/r_core.deps
rename : swig/vapi/r_core.vapi => r2-bindings/vapi/r_core.vapi
rename : swig/vapi/r_crypto.vapi => r2-bindings/vapi/r_crypto.vapi
rename : swig/vapi/r_db.vapi => r2-bindings/vapi/r_db.vapi
rename : swig/vapi/r_debug.deps => r2-bindings/vapi/r_debug.deps
rename : swig/vapi/r_debug.vapi => r2-bindings/vapi/r_debug.vapi
rename : swig/vapi/r_diff.vapi => r2-bindings/vapi/r_diff.vapi
rename : swig/vapi/r_flags.deps => r2-bindings/vapi/r_flags.deps
rename : swig/vapi/r_flags.vapi => r2-bindings/vapi/r_flags.vapi
rename : swig/vapi/r_fs.deps => r2-bindings/vapi/r_fs.deps
rename : swig/vapi/r_fs.vapi => r2-bindings/vapi/r_fs.vapi
rename : swig/vapi/r_hash.vapi => r2-bindings/vapi/r_hash.vapi
rename : swig/vapi/r_io.deps => r2-bindings/vapi/r_io.deps
rename : swig/vapi/r_io.vapi => r2-bindings/vapi/r_io.vapi
rename : swig/vapi/r_lang.vapi => r2-bindings/vapi/r_lang.vapi
rename : swig/vapi/r_lib.vapi => r2-bindings/vapi/r_lib.vapi
rename : swig/vapi/r_line.vapi => r2-bindings/vapi/r_line.vapi
rename : swig/vapi/r_parse.deps => r2-bindings/vapi/r_parse.deps
rename : swig/vapi/r_parse.vapi => r2-bindings/vapi/r_parse.vapi
rename : swig/vapi/r_print.vapi => r2-bindings/vapi/r_print.vapi
rename : swig/vapi/r_reg.deps => r2-bindings/vapi/r_reg.deps
rename : swig/vapi/r_reg.vapi => r2-bindings/vapi/r_reg.vapi
rename : swig/vapi/r_search.deps => r2-bindings/vapi/r_search.deps
rename : swig/vapi/r_search.vapi => r2-bindings/vapi/r_search.vapi
rename : swig/vapi/r_sign.vapi => r2-bindings/vapi/r_sign.vapi
rename : swig/vapi/r_socket.vapi => r2-bindings/vapi/r_socket.vapi
rename : swig/vapi/r_syscall.vapi => r2-bindings/vapi/r_syscall.vapi
rename : swig/vapi/r_util.vapi => r2-bindings/vapi/r_util.vapi
rename : swig/vapi/t/Makefile => r2-bindings/vapi/t/Makefile
rename : swig/vapi/t/array.vala => r2-bindings/vapi/t/array.vala
rename : swig/vapi/t/asm.gs => r2-bindings/vapi/t/asm.gs
rename : swig/vapi/t/asm.vala => r2-bindings/vapi/t/asm.vala
rename : swig/vapi/t/asmsearch.vala => r2-bindings/vapi/t/asmsearch.vala
rename : swig/vapi/t/bin.vala => r2-bindings/vapi/t/bin.vala
rename : swig/vapi/t/bintest.vala => r2-bindings/vapi/t/bintest.vala
rename : swig/vapi/t/bwdisassemble.vala => r2-bindings/vapi/t/bwdisassemble.vala
rename : swig/vapi/t/core.vala => r2-bindings/vapi/t/core.vala
rename : swig/vapi/t/db.vala => r2-bindings/vapi/t/db.vala
rename : swig/vapi/t/findops.vala => r2-bindings/vapi/t/findops.vala
rename : swig/vapi/t/hash.vala => r2-bindings/vapi/t/hash.vala
rename : swig/vapi/t/io.vala => r2-bindings/vapi/t/io.vala
rename : swig/vapi/t/lang.vala => r2-bindings/vapi/t/lang.vala
rename : swig/vapi/t/list.vala => r2-bindings/vapi/t/list.vala
rename : swig/vapi/t/list.vapi => r2-bindings/vapi/t/list.vapi
rename : swig/vapi/t/plugin.vala => r2-bindings/vapi/t/plugin.vala
rename : swig/vapi/t/pluginwrap.c => r2-bindings/vapi/t/pluginwrap.c
rename : swig/vapi/t/regs.vala => r2-bindings/vapi/t/regs.vala
rename : swig/vapi/t/reloc.vala => r2-bindings/vapi/t/reloc.vala
rename : swig/vapi/t/rgot.vala => r2-bindings/vapi/t/rgot.vala
rename : swig/vapi/t/sc.vala => r2-bindings/vapi/t/sc.vala
rename : swig/vapi/t/search.gs => r2-bindings/vapi/t/search.gs
rename : swig/vapi/t/search.vala => r2-bindings/vapi/t/search.vala
rename : swig/vapi/t/socket.vala => r2-bindings/vapi/t/socket.vala
2011-05-18 01:35:52 +02:00

427 lines
12 KiB
Bash
Executable File

#!/bin/sh
# This script was automatically generated by ACR v0.8.4
# @author: pancake <youterm.com>
# @url: http://www.nopcode.org
# @repo: hg clone http://hg.youterm.com/acr
do_remove() {
if [ "${ACR_RMFILES}" ]; then
printf "cleaning temporally files... "
rm -f ${ACR_RMFILES}
echo "done"
fi
}
control_c() {
printf "\n\n^C control-c : script execution interrupted.\n"
do_remove
exit 1
}
trap control_c 2
DEVEL_MODE=0
[ -z "${USERCC}" ] && USERCC="gcc"
[ -z "${USERCXX}" ] && USERCXX="g++"
[ -z "${USEROSTYPE}" ] && USEROSTYPE="auto"
split_host() {
S="$"
while : ; do
ENVWORDS="${ENVWORDS} $1_CPU $1_OS"
STR=`eval "echo ${S}$1"`
SPLIT_CPU="`echo "$STR" | cut -d - -f 1`"
SPLIT_OS="`echo "$STR" | cut -d - -f 3`"
eval "$1_CPU=\"$SPLIT_CPU\""
eval "$1_OS=\"$SPLIT_OS\""
shift
[ -z "$1" ] && break
done
}
VPATH=`dirname ${0}`
if [ "${VPATH}" = "." ]; then
WODIS=current
else
if [ "${VPATH}" = "${PWD}" ]; then
VPATH=.
WODIS=current
else
WODIS=crosspath
CURDIR=$PWD
cd $VPATH
VPATH="${PWD}/"
cd $CURDIR
fi
fi
guess_os() {
if [ -e "${VPATH}/config.guess" ]; then
sh ${VPATH}/config.guess
return
fi
CPU="`uname -m|sed -e 's, ,,g'`"
OS="`uname -s|tr '[A-Z]' '[a-z]'`"
GNU="`uname --help 2>&1 | grep gnu`"
[ "${GNU}" ] && OS="${OS}-gnu"
[ "${CPU}" = ppc ] && CPU="powerpc"
echo "${CPU}-unknown-${OS}"
}
SEARCHPATH="/usr /usr/local /usr/pkg /sw"
: ${PREFIX:=/usr/local}
CROSSBUILD=0
BUILD=`guess_os`
HOST="${BUILD}"
TARGET="${HOST}"
SYSCONFDIR=""
create_environ() {
: ${EPREFIX:=${PREFIX}}
: ${SPREFIX:=${PREFIX}}
: ${BINDIR:=${SPREFIX}/bin}
: ${SBINDIR:=${PREFIX}/sbin}
: ${SYSCONFDIR:=${SPREFIX}/etc}
: ${LIBDIR:=${SPREFIX}/lib}
: ${LIBEXECDIR:=${SPREFIX}/libexec}
: ${DATADIR:=${SPREFIX}/share}
: ${INCLUDEDIR:=${SPREFIX}/include}
: ${INFODIR:=${SPREFIX}/info}
: ${MANDIR:=${SPREFIX}/man}
: ${LOCALSTATEDIR:=${SPREFIX}/var}
for A in `echo ${PATH} | sed -e 's,:, ,g'` ; do
[ -e $A/ginstall ] && : ${INSTALL:=$A/ginstall} && break
[ -e $A/install ] && : ${INSTALL:=$A/install} && break
done
: ${INSTALL_DIR:=${INSTALL} -d}
: ${INSTALL_DATA:=${INSTALL} -m 644}
: ${INSTALL_SCRIPT:=${INSTALL} -m 755}
: ${INSTALL_PROGRAM:=${INSTALL} -m 755 -s}
: ${INSTALL_MAN:=${INSTALL} -m 444}
: ${INSTALL_LIB:=${INSTALL} -c}
PKGNAME='radare2-bindings' ; VERSION='0.7.1' ; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake <pancake@nopcode.org>" ;
}
show_usage() {
cat <<EOF2
'configure' configures radare2-bindings-0.7.1 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
-V, --version display version information and exit
-r, --report show what libs/programs require to work
Installation directories:
--prefix=PREFIX install arch-independent files in PREFIX [/usr/local]
--exec-prefix=EPREFIX install arch-dependent files in EPREFIX [PREFIX]
--sandbox=SPREFIX sandbox prefix directory: SPREFIX [PREFIX]
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]
EOF2
printf "
Optional Features:
--enable-devel Enable development mode (use valabind and swig)
--with-cc Define C compiler to use (gcc by default) (USERCC=gcc)
--with-cxx Define C++ compiler to use (g++ by default) (USERCXX=g++)
--with-ostype Choose OS type (gnulinux windows darwin) (USEROSTYPE=auto)
"
printf "
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
"
printf "
Report bugs to: pancake <pancake@nopcode.org>"
echo ""
exit 0
}
take_environ() {
: ${SH:=/bin/sh}
: ${CPP:=cpp}
: ${CC:=gcc}
: ${CPP:=cpp}
: ${CXX:=g++}
: ${PREFIX:=/usr/local/}
}
show_version() {
echo "radare2-bindings-0.7.1 configuration script done with acr v0.8.4.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <youterm.com>."
exit 0
}
parse_options() {
flag=`echo $1| cut -d = -f 1`
value=`echo $1| awk 'BEGIN{FS="=";}{print $2}'`
flag2=`echo $flag|cut -f2- -d -| sed -e 's,-,_,g' -e 's,^_,,g'|tr '[a-z]' '[A-Z]'`
case $flag in
"-h"|"--help"|"--hel"|"--h"|"--he"|"-help")
show_usage ; ;;
"-V"|"-version"|"--version")
show_version ; ;;
"-r"|"--r"|"--report")
echo "PKGNAME: radare2-bindings"
echo "VERSION: 0.7.1"
echo "LANGS: c c++"
echo "PKG-CONFIG: r_core"
echo "FLAGS: --enable-devel --with-cc=gcc --with-cxx=g++ --with-ostype=auto"
exit 0
;;
"--cache-file")
# ignored: acr have no cache
;;
"--build")
BUILD="$value"; split_host BUILD ; ;;
"--host")
CROSSBUILD=1 # XXX
HOST="$value"; split_host HOST ; ;;
"--target")
TARGET="$value"; split_host TARGET ; ;;
"--prefix")
PREFIX="$value"; ;;
"--exec-prefix")
EPREFIX="$value"; ;;
"--sandbox"|"--sprefix")
SPREFIX="$value"; ;;
"--bindir")
BINDIR="$value"; ;;
"--sbindir")
SBINDIR="$value"; ;;
"--libexecdir")
LIBEXECDIR="$value"; ;;
"--datadir")
DATADIR="$value"; ;;
"--sysconfdir")
SYSCONFDIR="$value"; ;;
"--sharedstatedir")
SHAREDSTATEDIR="$value"; ;;
"--localstatedir")
LOCALSTATEDIR="$value"; ;;
"--libdir")
LIBDIR="$value"; LDFLAGS="${LDFLAGS} -L$value -Wl,-R$value"; ;;
"--includedir")
INCLUDEDIR="$value"; CFLAGS="${CFLAGS} -I$value"; ;;
"--infodir")
INFODIR="$value"; ;;
"--mandir")
MANDIR="$value"; ;;
"--enable-devel") DEVEL_MODE="1"; ;;
--with-cc) if [ -z "${value}" ]; then USERCC="gcc"; else USERCC="${value}" ; fi ;;
--with-cxx) if [ -z "${value}" ]; then USERCXX="g++"; else USERCXX="${value}" ; fi ;;
--with-ostype) if [ -z "${value}" ]; then USEROSTYPE="auto"; else USEROSTYPE="${value}" ; fi ;;
*) if [ "$value" ]; then eval "`echo $flag2=$value`" ;
else echo ; echo "WARNING: Unknown flag '$flag'." >&2 ; echo ; fi ;;
esac
}
# MAIN #
take_environ
split_host BUILD HOST TARGET
[ -z "$ACRHOOK" ] && ACRHOOK=./configure.hook
[ -e "$ACRHOOK" ] && . ${ACRHOOK}
while : ; do
[ -z "$1" ] && break
parse_options $1
shift
done
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS LDFLAGS HAVE_LANG_C CXX CXXFLAGS HAVE_LANG_CXX HAVE_VALABIND VALABIND HAVE_SWIG SWIG DEVEL_MODE USERCC USERCXX USEROSTYPE FOO HAVE_PKGCFG_R_CORE"
create_environ
echo "checking build system type... ${BUILD}"
echo "checking host system type... ${HOST}"
echo "checking target system type... ${TARGET}"
[ "${CROSSBUILD}" = 1 ] && echo "using crosscompilation mode."
#split_host BUILD HOST TARGET
[ -n "${prefix}" ] && PREFIX=${prefix}
echo "checking for working directories... ${WODIS}"
echo "using prefix '${PREFIX}'"
ACR_RMFILES=" test.c a.out a.exe test.c test.cxx a.out a.exe"
:
COMPILER=CC
printf "checking for c compiler... "
HAVE_LANG_C=1
if [ "${CROSSBUILD}" = 1 ]; then
(command -v ${HOST}-${CC} >/dev/null 2>&1)
if [ $? = 0 ]; then CC="${HOST}-${CC}"; fi
fi
echo "main(){}" > test.c
(exec ${CC} ${CFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1)
if [ $? = 0 ]; then echo ${CC}; else
echo no ; HAVE_LANG_C=0
do_remove
echo "ERROR: ${CC} cannot create executables" >&2 ;
exit 1 ; fi
COMPILER=CXX
HAVE_LANG_CXX=1
printf "checking for c++ compiler... "
if [ "${CROSSBUILD}" = 1 ]; then
(command -v ${HOST}-${CXX} 2>&1 >/dev/null)
if [ "$?" = 0 ]; then CXX="${HOST}-${CXX}"; fi
fi
echo "#include <iostream>" > test.cxx
echo "main(){ std::cout << 1; }" >> test.cxx
(exec ${CXX} ${CXXFLAGS} ${LDFLAGS} test.cxx -lstdc++ >/dev/null 2>&1)
if [ $? = 0 ]; then echo ${CXX}; else
HAVE_LANG_CXX=0
echo no
echo "ERROR: ${CXX} cannot create executables" >&2 ;
do_remove
exit 1
fi
printf "checking for valabind... "
if [ -x "${VALABIND}" ]; then
FIND=${VALABIND}
else
FIND=""
for A in `echo ${PATH} | sed -e 's,:, ,g'`; do
if [ -x "${A}/valabind" ]; then
FIND="${A}/valabind"
break;
fi
done
fi
if [ -n "${FIND}" ]; then
echo ${FIND};
HAVE_VALABIND=1
VALABIND=${FIND}
else
HAVE_VALABIND=0
VALABIND=valabind
echo no ; fi
printf "checking for swig... "
if [ -x "${SWIG}" ]; then
FIND=${SWIG}
else
FIND=""
for A in `echo ${PATH} | sed -e 's,:, ,g'`; do
if [ -x "${A}/swig" ]; then
FIND="${A}/swig"
break;
fi
done
fi
if [ -n "${FIND}" ]; then
echo ${FIND};
HAVE_SWIG=1
SWIG=${FIND}
else
HAVE_SWIG=0
SWIG=swig
echo no ; fi
if [ "$USEROSTYPE" = "auto" ]; then
if [ "$HOST_OS" = "linux" ]; then
USEROSTYPE="gnulinux"
else
if [ "$HOST_OS" = "netbsd" ]; then
USEROSTYPE="gnulinux"
else
if [ "$HOST_OS" = "freebsd" ]; then
USEROSTYPE="gnulinux"
else
if [ "$HOST_OS" = "openbsd" ]; then
USEROSTYPE="gnulinux"
else
if [ "$HOST_OS" = "darwin" ]; then
USEROSTYPE="darwin"; fi; fi; fi; fi; fi; fi
printf 'checking pkg-config flags for r_core... '
tmp=`pkg-config --cflags r_core 2>/dev/null`
if [ $? = 1 ]; then echo no ; HAVE_PKGCFG_R_CORE=0;
echo 'This package is required'
exit 1
else
FOO=$tmp;
tmp=`pkg-config --libs r_core 2>/dev/null`
if [ ! $? = 1 ]; then
echo yes; HAVE_PKGCFG_R_CORE=1;
FOO=$tmp; fi; fi
SEDFLAGS=" -e '"
COUNT=0
for A in ${ENVWORDS} ; do
[ "${A}" = VPATH ] && continue
[ "${A}" = srcdir ] && continue
eval "VAR=\$${A}"
VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`"
[ $COUNT = 10 ] && COUNT=0 && SEDFLAGS="${SEDFLAGS}' -e '"
COUNT=$(($COUNT+1))
SEDFLAGS="${SEDFLAGS}s,@${A}@,${VAR},g;"
done
SEDFLAGS="${SEDFLAGS}'"
for A in ./config.mk ; do # SUBDIRS
if [ -f "${VPATH}/${A}.acr" ]; then
SD_TARGET=${A}
else
if [ -d "${VPATH}/${A}" ]; then
SD_TARGET=${A}/Makefile
mkdir -p ${A}
else
echo "ERROR: Cannot find ${VPATH}/${A}.acr" >&2
exit 1
fi
fi
echo "creating ${SD_TARGET}"
mkdir -p $(echo ${A} | sed -e "s,/`basename ${A}`$,,g")
cat ${VPATH}/${SD_TARGET}.acr | \
eval sed -e "s,@VPATH@,${VPATH}/${A},g" ${SEDFLAGS} > ${SD_TARGET}.tmp
for A in ${ENVWORDS}; do
VALUE=`eval echo "$"${A}`
if [ "$VALUE" = 0 ]; then ## FALSE
MARK="##${A}##"
if [ -n "`grep \"${MARK}\" ${SD_TARGET}.tmp`" ]; then
mv ${SD_TARGET}.tmp ${SD_TARGET}.tmp2
cat ${SD_TARGET}.tmp2 | MARK=$MARK awk 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp
fi
fi
done
mv ${SD_TARGET}.tmp ${SD_TARGET} && rm -f ${SD_TARGET}.tmp2
if [ $? = 1 ]; then echo Cannot write target file ; control_c ; fi
done
do_remove
echo
echo "Final report:"
for A in PREFIX HAVE_SWIG HAVE_VALABIND DEVEL_MODE ; do # REPORT
eval VAL="\$${A}"
[ -z "${VAL}" ] && VAL="(null)"
echo " - ${A} = ${VAL}"
done