2009-03-26 03:53:26 +08:00
|
|
|
#!/bin/sh
|
2010-11-26 07:44:47 +08:00
|
|
|
# This script was automatically generated by ACR v0.8.4
|
2009-03-26 03:53:26 +08:00
|
|
|
# @author: pancake <youterm.com>
|
2010-02-22 11:47:19 +08:00
|
|
|
# @url: http://www.nopcode.org
|
|
|
|
# @repo: hg clone http://hg.youterm.com/acr
|
2009-03-26 03:53:26 +08:00
|
|
|
|
|
|
|
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
|
2009-04-20 04:55:25 +08:00
|
|
|
DEBUGGER=1
|
2009-03-31 08:57:39 +08:00
|
|
|
HAVE_EWF=1
|
2010-05-24 17:15:32 +08:00
|
|
|
HAVE_GMP=1
|
2011-03-10 18:36:16 +08:00
|
|
|
HAVE_MAGIC=1
|
2010-07-17 05:13:34 +08:00
|
|
|
HAVE_OPENSSL=1
|
2009-04-03 19:11:17 +08:00
|
|
|
[ -z "${USERCC}" ] && USERCC="gcc"
|
2010-02-22 03:49:39 +08:00
|
|
|
[ -z "${USEROSTYPE}" ] && USEROSTYPE="auto"
|
2010-01-22 04:22:30 +08:00
|
|
|
WITHPIC=1
|
2010-10-29 09:10:10 +08:00
|
|
|
WITHNONPIC=0
|
2009-03-26 03:53:26 +08:00
|
|
|
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'`"
|
2010-10-25 19:20:26 +08:00
|
|
|
OS="`uname -s|tr '[A-Z]' '[a-z]'`"
|
2009-03-26 03:53:26 +08:00
|
|
|
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
|
2010-02-22 03:24:28 +08:00
|
|
|
[ -e $A/ginstall ] && : ${INSTALL:=$A/ginstall} && break
|
|
|
|
[ -e $A/install ] && : ${INSTALL:=$A/install} && break
|
2009-03-26 03:53:26 +08:00
|
|
|
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}
|
2011-03-24 04:49:58 +08:00
|
|
|
PKGNAME='radare2' ; VERSION='0.7.1' ; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake <pancake@nopcode.org>" ;
|
2009-03-26 03:53:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
show_usage() {
|
|
|
|
cat <<EOF2
|
2011-03-24 04:49:58 +08:00
|
|
|
'configure' configures radare2-0.7.1 to adapt to many kinds of systems.
|
2009-03-26 03:53:26 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2011-03-24 04:49:58 +08:00
|
|
|
printf "
|
|
|
|
Optional Features:
|
2009-04-20 04:55:25 +08:00
|
|
|
--without-debugger disable native debugger features
|
2009-03-31 08:57:39 +08:00
|
|
|
--without-ewf disable EWF dependency
|
2010-05-24 17:15:32 +08:00
|
|
|
--without-gmp disable GMP dependency
|
2011-03-10 18:36:16 +08:00
|
|
|
--without-magic disable magic dependency
|
2010-10-25 19:20:26 +08:00
|
|
|
--without-ssl disable openssl dependency
|
2009-04-03 19:11:17 +08:00
|
|
|
--with-compiler Define compiler to use (see mk/) (USERCC=gcc)
|
2010-02-22 03:49:39 +08:00
|
|
|
--with-ostype Choose OS type ( gnulinux windows darwin ) (USEROSTYPE=auto)
|
2010-10-29 09:10:10 +08:00
|
|
|
--without-pic do not build libr as a program independent location
|
2011-03-24 04:49:58 +08:00
|
|
|
--with-nonpic build the library archives .a
|
|
|
|
"
|
|
|
|
printf "
|
|
|
|
Some influential environment variables:
|
2009-03-26 03:53:26 +08:00
|
|
|
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>
|
2011-03-24 04:49:58 +08:00
|
|
|
CPP C preprocessor
|
|
|
|
"
|
|
|
|
printf "
|
|
|
|
Report bugs to: pancake <pancake@nopcode.org>"
|
2009-03-26 03:53:26 +08:00
|
|
|
echo ""
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
take_environ() {
|
|
|
|
: ${SH:=/bin/sh}
|
|
|
|
: ${CPP:=cpp}
|
|
|
|
: ${CC:=gcc}
|
|
|
|
: ${PREFIX:=/usr/local/}
|
|
|
|
}
|
|
|
|
|
|
|
|
show_version() {
|
2011-03-24 04:49:58 +08:00
|
|
|
echo "radare2-0.7.1 configuration script done with acr v0.8.4.
|
2009-03-26 03:53:26 +08:00
|
|
|
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"
|
2011-03-24 04:49:58 +08:00
|
|
|
echo "VERSION: 0.7.1"
|
2009-03-26 03:53:26 +08:00
|
|
|
echo "LANGS: c"
|
2010-03-23 19:30:04 +08:00
|
|
|
echo "REQUIRED: libdl"
|
2009-03-31 08:57:39 +08:00
|
|
|
echo "OPTIONAL: libewf"
|
2011-03-10 18:36:16 +08:00
|
|
|
echo "FLAGS: --without-debugger --without-ewf --without-gmp --without-magic --without-ssl --with-compiler=gcc --with-ostype=auto --without-pic --with-nonpic"
|
2009-03-26 03:53:26 +08:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
"--cache-file")
|
|
|
|
# ignored: acr have no cache
|
|
|
|
;;
|
|
|
|
"--build")
|
2010-01-15 20:02:54 +08:00
|
|
|
BUILD="$value"; split_host BUILD ; ;;
|
2009-03-26 03:53:26 +08:00
|
|
|
"--host")
|
2010-01-15 20:02:54 +08:00
|
|
|
CROSSBUILD=1 # XXX
|
|
|
|
HOST="$value"; split_host HOST ; ;;
|
2009-03-26 03:53:26 +08:00
|
|
|
"--target")
|
2010-01-15 20:02:54 +08:00
|
|
|
TARGET="$value"; split_host TARGET ; ;;
|
2009-03-26 03:53:26 +08:00
|
|
|
"--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"; ;;
|
|
|
|
|
2009-04-20 04:55:25 +08:00
|
|
|
"--without-debugger") DEBUGGER="0"; ;;
|
2009-03-31 08:57:39 +08:00
|
|
|
"--without-ewf") HAVE_EWF="0"; ;;
|
2010-05-24 17:15:32 +08:00
|
|
|
"--without-gmp") HAVE_GMP="0"; ;;
|
2011-03-10 18:36:16 +08:00
|
|
|
"--without-magic") HAVE_MAGIC="0"; ;;
|
2010-10-25 19:20:26 +08:00
|
|
|
"--without-ssl") HAVE_OPENSSL="0"; ;;
|
2009-04-03 19:11:17 +08:00
|
|
|
--with-compiler) if [ -z "${value}" ]; then USERCC="gcc"; else USERCC="${value}" ; fi ;;
|
2010-02-22 03:49:39 +08:00
|
|
|
--with-ostype) if [ -z "${value}" ]; then USEROSTYPE="auto"; else USEROSTYPE="${value}" ; fi ;;
|
2010-01-22 04:22:30 +08:00
|
|
|
"--without-pic") WITHPIC="0"; ;;
|
2010-10-29 09:10:10 +08:00
|
|
|
"--with-nonpic") WITHNONPIC="1"; ;;
|
2009-03-26 03:53:26 +08:00
|
|
|
*) if [ "$value" ]; then eval "`echo $flag2=$value`" ;
|
|
|
|
else echo ; echo "WARNING: Unknown flag '$flag'." >&2 ; echo ; fi ;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
# MAIN #
|
|
|
|
take_environ
|
2009-07-16 08:30:20 +08:00
|
|
|
split_host BUILD HOST TARGET
|
|
|
|
[ -z "$ACRHOOK" ] && ACRHOOK=./configure.hook
|
|
|
|
[ -e "$ACRHOOK" ] && . ${ACRHOOK}
|
2009-03-26 03:53:26 +08:00
|
|
|
|
|
|
|
while : ; do
|
|
|
|
[ -z "$1" ] && break
|
|
|
|
parse_options $1
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2011-03-10 18:36:16 +08:00
|
|
|
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 DEBUGGER HAVE_LIB_DL DL_LIBS LIL_ENDIAN BIG_ENDIAN BYTEORDER HAVE_LIB_EWF HAVE_EWF HAVE_LIB_GMP HAVE_GMP HAVE_LIB_MAGIC HAVE_MAGIC HAVE_LIB_SSL HAVE_OPENSSL HAVE_LIB_LUA5_1 HAVE_LIB_TCC USERCC USEROSTYPE WITHPIC WITHNONPIC"
|
2009-03-26 03:53:26 +08:00
|
|
|
|
|
|
|
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."
|
|
|
|
|
2009-07-16 08:30:20 +08:00
|
|
|
#split_host BUILD HOST TARGET
|
2009-04-22 22:29:30 +08:00
|
|
|
[ -n "${prefix}" ] && PREFIX=${prefix}
|
2009-03-26 03:53:26 +08:00
|
|
|
echo "checking for working directories... ${WODIS}"
|
|
|
|
echo "using prefix '${PREFIX}'"
|
|
|
|
ACR_RMFILES=" test.c a.out a.exe"
|
2009-03-31 08:57:39 +08:00
|
|
|
|
|
|
|
|
2009-03-26 03:53:26 +08:00
|
|
|
:
|
|
|
|
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
|
2010-01-15 20:02:54 +08:00
|
|
|
printf "checking for dynamic library... "
|
|
|
|
HAVE_LIB_DL=0
|
|
|
|
for OS in linux syllable sunos darwin beos solaris ; do
|
|
|
|
if [ "${HOST_OS}" = "${OS}" ]; then
|
|
|
|
HAVE_LIB_DL=1
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ "${HAVE_LIB_DL}" = 1 ]; then
|
|
|
|
DL_LIBS="-ldl"
|
|
|
|
echo "required"
|
|
|
|
else
|
|
|
|
DL_LIBS=""
|
|
|
|
echo "libc"
|
|
|
|
fi
|
2010-01-13 02:57:33 +08:00
|
|
|
printf "checking host endianness... "
|
2010-11-26 07:44:47 +08:00
|
|
|
echo '#include <stdio.h>' > test.c
|
|
|
|
echo 'main(){int a=1;char *b=(char*)&a;printf("%d",b[0]);}' >> test.c
|
|
|
|
eval \$${COMPILER} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} -o a.out test.c >/dev/null 2>&1
|
2010-01-13 02:57:33 +08:00
|
|
|
if [ ! $? = 0 ]; then
|
|
|
|
echo unexpected error
|
|
|
|
do_remove
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
LIL_ENDIAN=$(./a.out)
|
|
|
|
if [ "${LIL_ENDIAN}" = 1 ]; then
|
|
|
|
BYTEORDER=1234
|
|
|
|
BIG_ENDIAN=0
|
|
|
|
echo little
|
|
|
|
else
|
|
|
|
BYTEORDER=4321
|
|
|
|
BIG_ENDIAN=1
|
|
|
|
LIL_ENDIAN=0
|
|
|
|
echo big
|
|
|
|
fi
|
|
|
|
|
2009-03-31 08:57:39 +08:00
|
|
|
check_library() {
|
|
|
|
VAR=$1
|
|
|
|
S="$"
|
|
|
|
_REQUIRED=$3
|
|
|
|
_CHKLIB_NAME=$2
|
|
|
|
_CHKLIB_LIBS=$(echo "-l${_CHKLIB_NAME}" | sed 's,\+, -l,g')
|
|
|
|
printf "checking for lib${_CHKLIB_NAME} ... "
|
|
|
|
echo "main(){ }" > test.c
|
2010-11-26 07:44:47 +08:00
|
|
|
eval ${S}${COMPILER} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} ${_CHKLIB_LIBS} test.c >/dev/null 2>&1
|
2009-03-31 08:57:39 +08:00
|
|
|
if [ $? = 0 ]; then
|
|
|
|
eval ${VAR}=1
|
|
|
|
echo yes
|
|
|
|
else
|
|
|
|
eval ${VAR}=0
|
|
|
|
echo no ; fi }
|
|
|
|
check_library HAVE_LIB_EWF ewf 0
|
2010-05-24 17:15:32 +08:00
|
|
|
if [ "$HAVE_EWF" = "0" ]; then
|
2010-01-13 02:57:33 +08:00
|
|
|
HAVE_LIB_EWF="0"; fi
|
2010-05-24 17:15:32 +08:00
|
|
|
check_library HAVE_LIB_GMP gmp 0
|
|
|
|
if [ "$HAVE_GMP" = "0" ]; then
|
|
|
|
HAVE_LIB_GMP="0"; fi
|
2011-02-24 02:11:39 +08:00
|
|
|
check_library HAVE_LIB_MAGIC magic 0
|
2011-03-10 18:36:16 +08:00
|
|
|
if [ "$HAVE_MAGIC" = "0" ]; then
|
|
|
|
HAVE_LIB_MAGIC="0"; fi
|
2010-10-25 19:20:26 +08:00
|
|
|
check_library HAVE_LIB_SSL ssl 0
|
2010-07-17 05:13:34 +08:00
|
|
|
if [ "$HAVE_OPENSSL" = "0" ]; then
|
2010-10-25 19:20:26 +08:00
|
|
|
HAVE_LIB_SSL="0"; fi
|
2010-02-03 23:57:44 +08:00
|
|
|
check_library HAVE_LIB_LUA5_1 lua5.1 0
|
2009-04-07 06:53:25 +08:00
|
|
|
check_library HAVE_LIB_TCC tcc 0
|
2010-02-22 03:49:39 +08:00
|
|
|
if [ "$USEROSTYPE" = "auto" ]; then
|
2010-02-22 03:24:28 +08:00
|
|
|
if [ "$HOST_OS" = "linux" ]; then
|
|
|
|
USEROSTYPE="gnulinux"
|
|
|
|
else
|
2010-07-03 09:35:26 +08:00
|
|
|
if [ "$HOST_OS" = "netbsd" ]; then
|
|
|
|
USEROSTYPE="gnulinux"
|
|
|
|
else
|
|
|
|
if [ "$HOST_OS" = "freebsd" ]; then
|
|
|
|
USEROSTYPE="gnulinux"
|
|
|
|
else
|
|
|
|
if [ "$HOST_OS" = "openbsd" ]; then
|
|
|
|
USEROSTYPE="gnulinux"
|
|
|
|
else
|
2010-02-22 03:24:28 +08:00
|
|
|
if [ "$HOST_OS" = "darwin" ]; then
|
2010-07-03 09:35:26 +08:00
|
|
|
USEROSTYPE="darwin"; fi; fi; fi; fi; fi; fi
|
2009-03-26 03:53:26 +08:00
|
|
|
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 '"
|
2009-07-16 08:30:20 +08:00
|
|
|
COUNT=$(($COUNT+1))
|
2009-03-26 03:53:26 +08:00
|
|
|
SEDFLAGS="${SEDFLAGS}s,@${A}@,${VAR},g;"
|
|
|
|
done
|
|
|
|
SEDFLAGS="${SEDFLAGS}'"
|
2011-04-04 20:39:42 +08:00
|
|
|
for A in ./config-user.mk libr/include/r_userconf.h pkgcfg/r_io.pc pkgcfg/r_asm.pc pkgcfg/r_bin.pc pkgcfg/r_anal.pc pkgcfg/r_hash.pc pkgcfg/r_cons.pc pkgcfg/r_diff.pc pkgcfg/r_core.pc pkgcfg/r_lang.pc pkgcfg/r_socket.pc pkgcfg/r_debug.pc pkgcfg/r_reg.pc pkgcfg/r_cmd.pc pkgcfg/r_config.pc pkgcfg/r_flags.pc pkgcfg/r_line.pc pkgcfg/r_syscall.pc pkgcfg/r_sign.pc pkgcfg/r_util.pc pkgcfg/r_search.pc pkgcfg/r_bp.pc pkgcfg/r_db.pc pkgcfg/r_lib.pc pkgcfg/r_parse.pc pkgcfg/r_print.pc pkgcfg/r_fs.pc ; do # SUBDIRS
|
2010-01-13 02:57:33 +08:00
|
|
|
if [ -f "${VPATH}/${A}.acr" ]; then
|
2009-03-26 03:53:26 +08:00
|
|
|
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}`
|
2010-01-13 02:57:33 +08:00
|
|
|
if [ "$VALUE" = 0 ]; then ## FALSE
|
2009-03-26 03:53:26 +08:00
|
|
|
MARK="##${A}##"
|
2010-01-13 02:57:33 +08:00
|
|
|
if [ -n "`grep \"${MARK}\" ${SD_TARGET}.tmp`" ]; then
|
2009-03-26 03:53:26 +08:00
|
|
|
mv ${SD_TARGET}.tmp ${SD_TARGET}.tmp2
|
2010-01-13 02:57:33 +08:00
|
|
|
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
|
2009-03-26 03:53:26 +08:00
|
|
|
fi
|
2010-01-13 02:57:33 +08:00
|
|
|
fi
|
2009-03-26 03:53:26 +08:00
|
|
|
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
|
2009-03-31 08:57:39 +08:00
|
|
|
echo
|
|
|
|
echo "Final report:"
|
2010-10-25 19:20:26 +08:00
|
|
|
for A in PREFIX HAVE_LIB_EWF HAVE_LIB_GMP HAVE_LIB_SSL HAVE_LIB_TCC DEBUGGER USERCC USEROSTYPE ; do # REPORT
|
2009-03-31 08:57:39 +08:00
|
|
|
eval VAL="\$${A}"
|
|
|
|
[ -z "${VAL}" ] && VAL="(null)"
|
|
|
|
echo " - ${A} = ${VAL}"
|
|
|
|
done
|