mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 05:09:43 +00:00
1252 lines
36 KiB
Bash
Executable File
1252 lines
36 KiB
Bash
Executable File
#!/bin/sh
|
|
# This script was automatically generated by ACR v2.0.1
|
|
# @author: pancake <nopcode.org>
|
|
# @url: http://www.nopcode.org
|
|
# @repo: git clone https://github.com/radare/acr
|
|
|
|
[ -z "${AWK}" ] && AWK=awk
|
|
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
|
|
DEBUGGER=1
|
|
USE_MAGIC=0
|
|
WANT_THREADS=1
|
|
LOADLIBS=1
|
|
R_CRITICAL_ENABLED=0
|
|
WANT_DYLINK=1
|
|
HAVE_FORK=1
|
|
WANT_PTRACE_WRAP=1
|
|
WANT_GPERF=1
|
|
WANT_CAPSTONE=1
|
|
WITH_LIBR=0
|
|
WITH_STATIC_THEMES=0
|
|
USE_CS5=0
|
|
USE_CS4=0
|
|
WITH_CAPSTONE=0
|
|
WITH_SYSLZ4=0
|
|
USE_ZIP=0
|
|
USE_XXHASH=0
|
|
WITH_GPL=1
|
|
WANT_SSL=0
|
|
WANT_SSL_CRYPTO=0
|
|
WANT_LIBUV=0
|
|
USE_RPATH=0
|
|
[ -z "${USERCC}" ] && USERCC="gcc"
|
|
[ -z "${USEROSTYPE}" ] && USEROSTYPE="auto"
|
|
[ -z "${LIBVERSION}" ] && LIBVERSION="xxx"
|
|
HAVE_JEMALLOC=1
|
|
[ -z "${R_CHECKS_LEVEL}" ] && R_CHECKS_LEVEL="2"
|
|
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" | $AWK -F - '{
|
|
if ($2=="unknown"){
|
|
if (NF<3) { print $2; } else { print $3; }
|
|
} else {
|
|
if ($2=="linux") { print $2; } else
|
|
if (NF<3) { print $2; } else { print $3; }
|
|
}
|
|
}'`"
|
|
eval "$1_CPU=\"$SPLIT_CPU\""
|
|
eval "$1_OS=\"$SPLIT_OS\""
|
|
shift
|
|
[ -z "$1" ] && break
|
|
done
|
|
}
|
|
|
|
QUIET=0
|
|
be_quiet() {
|
|
QUIET=1
|
|
}
|
|
|
|
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'|cut -d - -f 1`"
|
|
OS="`uname -s|tr A-Z a-z`"
|
|
uname -r | grep -qE "(Microsoft|WSL)" 2>/dev/null && OS="wsl"
|
|
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}"
|
|
ETCDIR="/etc"
|
|
SYSCONFDIR=""
|
|
|
|
create_environ() {
|
|
: ${EPREFIX:="${PREFIX}"}
|
|
: ${SPREFIX:="${PREFIX}"}
|
|
: ${BINDIR:="${SPREFIX}/bin"}
|
|
: ${SBINDIR:="${PREFIX}/sbin"}
|
|
: ${ETCDIR:="${SPREFIX}/etc"}
|
|
: ${LIBDIR:="${SPREFIX}/lib"}
|
|
: ${PKGCFG_LIBDIR:="\${exec_prefix}/lib"}
|
|
: ${PKGCFG_INCDIR:="\${prefix}/include"}
|
|
: ${LIBEXECDIR:="${SPREFIX}/libexec"}
|
|
: ${INCLUDEDIR:="${SPREFIX}/include"}
|
|
: ${DATADIR:="${SPREFIX}/share"}
|
|
: ${INFODIR:="${DATADIR}/info"}
|
|
: ${MANDIR:="${DATADIR}/man"}
|
|
: ${DOCDIR:="${DATADIR}/doc/radare2"}
|
|
: ${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}
|
|
: ${INSTALL_PROGRAM_STRIP:=${INSTALL} -m 755 -s}
|
|
: ${INSTALL_MAN:=${INSTALL} -m 444}
|
|
: ${INSTALL_LIB:=${INSTALL} -m 755 -c}
|
|
PKGNAME='radare2' ; VERSION='5.8.3' ; VERSION_MAJOR=5; VERSION_MINOR=8; VERSION_PATCH=3; VERSION_NUMBER=50803; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake <pancake@nopcode.org>" ;
|
|
}
|
|
|
|
show_usage() {
|
|
cat <<EOF2
|
|
'configure' configures radare2-5.8.3 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
|
|
-r, --report show what libs/programs require to work
|
|
-q, --quiet be quiet, less verbose (see ./configure -qV)
|
|
-V, --version display version information and exit
|
|
|
|
Installation directories:
|
|
--exec-prefix=EPREFIX install arch-dependent files in EPREFIX [PREFIX]
|
|
--prefix=PREFIX install arch-independent files in PREFIX [/usr/local]
|
|
--sandbox=SPREFIX sandbox prefix directory: SPREFIX [PREFIX]
|
|
|
|
Fine tuning of the installation directories:
|
|
--bindir=DIR user executables [EPREFIX/bin]
|
|
--datadir=DIR read-only architecture-independent data [PREFIX/share]
|
|
--docdir=DIR documentation directory [DATADIR/doc/radare2]
|
|
--includedir=DIR C header files [PREFIX/include]
|
|
--infodir=DIR info documentation [DATADIR/info]
|
|
--libexecdir=DIR program executables [EPREFIX/libexec]
|
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
|
--libpath=DIR set rpath/libname-path to linker
|
|
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
|
--mandir=DIR man documentation [DATADIR/man]
|
|
--sbindir=DIR system admin executables [EPREFIX/sbin]
|
|
--etcdir=DIR same as --sysconfdir (/etc)
|
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
|
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
|
|
|
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:
|
|
--disable-debugger disable native debugger features
|
|
--with-sysmagic force to use system's magic
|
|
--disable-threads disable use of thread apis
|
|
--disable-loadlibs disable loading plugins
|
|
--enable-threadsafety enable mutexes in critical code paths
|
|
--without-dylink disable support for dynamic loading of plugins
|
|
--without-fork disable fork
|
|
--without-ptrace-wrap build ptrace-wrap support needed for the iaito debugger on Linux
|
|
--without-gperf do not statically link the sdb databases even if gperf is found
|
|
--without-capstone dont build the capstone dependency
|
|
--with-libr build libr.a and libr.dylib
|
|
--with-static-themes default themes are compiled and fallback if not available on disk
|
|
--with-capstone5 build next branch of capstone5 (default)
|
|
--with-capstone4 build v4 branch of capstone
|
|
--with-syscapstone force to use system-wide capstone
|
|
--with-syslz4 force to use system's liblz4
|
|
--with-syszip force to use system's libzip and zlib
|
|
--with-sysxxhash force to use system's xxhash
|
|
--without-gpl do not build GPL code (grub, cxx, ... )
|
|
--with-ssl build with (Open|Boring|..)SSL if possible
|
|
--with-ssl-crypto build crypto code with libssl
|
|
--with-libuv disable libuv dependency
|
|
--with-rpath use rpath to build
|
|
--with-compiler Define compiler to use (see mk/) (USERCC=gcc)
|
|
--with-ostype Choose OS ( android windows wsl mingw32 bsd solaris gnulinux darwin haiku ) (USEROSTYPE=auto)
|
|
--with-libversion specify different libversion (LIBVERSION=xxx)
|
|
--without-jemalloc build without jemalloc
|
|
--with-checks-level value between 0 and 3 to enable different level of assert (see R_CHECKS_LEVEL) (R_CHECKS_LEVEL=2)
|
|
"
|
|
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
|
|
"
|
|
printf "
|
|
Report bugs to: pancake <pancake@nopcode.org>"
|
|
echo ""
|
|
exit 0
|
|
}
|
|
|
|
take_environ() {
|
|
: ${SH:=/bin/sh}
|
|
: ${CPP:=cpp}
|
|
: ${CC:=gcc}
|
|
: ${PREFIX:=/usr/local/}
|
|
}
|
|
|
|
ochof() {
|
|
[ "$QUIET" = 1 ] && return
|
|
printf "$*"
|
|
}
|
|
|
|
ocho() {
|
|
[ "$QUIET" = 1 ] && return
|
|
echo "$*"
|
|
}
|
|
|
|
show_version() {
|
|
if [ "$QUIET" = 1 ]; then
|
|
echo "5.8.3"
|
|
exit 0
|
|
fi
|
|
echo "radare2-5.8.3 configuration script done with acr v2.0.1.
|
|
The 'Free Software Foundation' message is only for autodetection.
|
|
Originally written by pancake <nopcode.org>."
|
|
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]'`
|
|
|
|
if [ "${TARGET_OS}" = "darwin" ]; then
|
|
LIBPATH=-Wl,-install_name,
|
|
else
|
|
LIBPATH=-Wl,-R
|
|
fi
|
|
|
|
case $flag in
|
|
-h|--help|--hel|--h|--he|-help)
|
|
show_usage ; ;;
|
|
-qV|-quiet-version|--quiet-version)
|
|
be_quiet
|
|
show_version ; ;;
|
|
-q|-quiet|--quiet)
|
|
be_quiet ; ;;
|
|
-V|-version|--version)
|
|
show_version ; ;;
|
|
-r|--r|--report)
|
|
echo "PKGNAME: radare2"
|
|
echo "VERSION: 5.8.3"
|
|
echo "LANGS: c"
|
|
echo "REQUIRED: libdl"
|
|
echo "OPTIONAL: libmagic libz libzip libxxhash libssl liblibuv>=1.0.0"
|
|
echo "PKG-CONFIG: capstone liblz4 openssl libuv"
|
|
echo "FLAGS: --disable-debugger --with-sysmagic --disable-threads --disable-loadlibs --enable-threadsafety --without-dylink --without-fork --without-ptrace-wrap --without-gperf --without-capstone --with-libr --with-static-themes --with-capstone5 --with-capstone4 --with-syscapstone --with-syslz4 --with-syszip --with-sysxxhash --without-gpl --with-ssl --with-ssl-crypto --with-libuv --with-rpath --with-compiler=gcc --with-ostype=auto --with-libversion=xxx --without-jemalloc --with-checks-level=2"
|
|
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"; ;;
|
|
--docdir)
|
|
DOCDIR="$value"; ;;
|
|
--datadir)
|
|
DATADIR="$value"; ;;
|
|
--sysconfdir)
|
|
SYSCONFDIR="$value"
|
|
ETCDIR="$value"; ;;
|
|
--etcdir)
|
|
SYSCONFDIR="$value"
|
|
ETCDIR="$value"; ;;
|
|
--sharedstatedir)
|
|
SHAREDSTATEDIR="$value"; ;;
|
|
--localstatedir)
|
|
LOCALSTATEDIR="$value"; ;;
|
|
--libdir)
|
|
LIBDIR="$value"
|
|
PKGCFG_LIBDIR="$value"; ;;
|
|
--libpath)
|
|
LDFLAGS="${LDFLAGS} ${LIBPATH}$value"; ;;
|
|
--includedir)
|
|
PKGCFG_INCDIR="$value"
|
|
INCLUDEDIR="$value"; CFLAGS="${CFLAGS} -I$value"; ;;
|
|
--infodir)
|
|
INFODIR="$value"; ;;
|
|
--mandir)
|
|
MANDIR="$value"; ;;
|
|
|
|
"--disable-debugger") DEBUGGER="0"; ;;
|
|
"--with-sysmagic") USE_MAGIC="1"; ;;
|
|
"--disable-threads") WANT_THREADS="0"; ;;
|
|
"--disable-loadlibs") LOADLIBS="0"; ;;
|
|
"--enable-threadsafety") R_CRITICAL_ENABLED="1"; ;;
|
|
"--without-dylink") WANT_DYLINK="0"; ;;
|
|
"--without-fork") HAVE_FORK="0"; ;;
|
|
"--without-ptrace-wrap") WANT_PTRACE_WRAP="0"; ;;
|
|
"--without-gperf") WANT_GPERF="0"; ;;
|
|
"--without-capstone") WANT_CAPSTONE="0"; ;;
|
|
"--with-libr") WITH_LIBR="1"; ;;
|
|
"--with-static-themes") WITH_STATIC_THEMES="1"; ;;
|
|
"--with-capstone5") USE_CS5="1"; ;;
|
|
"--with-capstone4") USE_CS4="1"; ;;
|
|
"--with-syscapstone") WITH_CAPSTONE="1"; ;;
|
|
"--with-syslz4") WITH_SYSLZ4="1"; ;;
|
|
"--with-syszip") USE_ZIP="1"; ;;
|
|
"--with-sysxxhash") USE_XXHASH="1"; ;;
|
|
"--without-gpl") WITH_GPL="0"; ;;
|
|
"--with-ssl") WANT_SSL="1"; ;;
|
|
"--with-ssl-crypto") WANT_SSL_CRYPTO="1"; ;;
|
|
"--with-libuv") WANT_LIBUV="1"; ;;
|
|
"--with-rpath") USE_RPATH="1"; ;;
|
|
--with-compiler) if [ -z "${value}" ]; then USERCC="gcc"; else USERCC="${value}" ; fi ;;
|
|
--with-ostype) if [ -z "${value}" ]; then USEROSTYPE="auto"; else USEROSTYPE="${value}" ; fi ;;
|
|
--with-libversion) if [ -z "${value}" ]; then LIBVERSION="xxx"; else LIBVERSION="${value}" ; fi ;;
|
|
"--without-jemalloc") HAVE_JEMALLOC="0"; ;;
|
|
--with-checks-level) if [ -z "${value}" ]; then R_CHECKS_LEVEL="2"; else R_CHECKS_LEVEL="${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 ETCDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGCFG_LIBDIR PKGCFG_INCDIR PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS PKGCONFIG HAVE_PATCH PATCH HAVE_AR AR HAVE_GIT GIT HAVE_GPERF GPERF HAVE_LIB_MAGIC HAVE_LINUX_CAN_H USE_MAGIC USE_LIB_MAGIC LIBMAGIC WANT_THREADS LOADLIBS R_CRITICAL_ENABLED WANT_DYLINK HAVE_FORK WANT_PTRACE_WRAP WANT_GPERF WANT_CAPSTONE WITH_LIBR WITH_STATIC_THEMES USE_CS5 USE_CS4 WITH_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE LZ4_CFLAGS LZ4_LDFLAGS HAVE_PKGCFG_LIBLZ4 WITH_SYSLZ4 USE_SYSLZ4 HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP HAVE_LIB_XXHASH USE_XXHASH USE_LIB_XXHASH LIBXXHASH WITH_GPL HAVE_DECL_ADDR_NO_RANDOMIZE HAVE_DECL___GLIBC__ HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO HAVE_EXPLICIT_MEMSET HAVE_CLOCK_NANOSLEEP HAVE_SIGACTION HAVE_CLOCK_GETTIME CLOCK_LDFLAGS SUPPORT_GNU99 HAVE_LIB_GMP HAVE_LIB_SSL SSL_CFLAGS SSL_LDFLAGS HAVE_PKGCFG_OPENSSL HAVE_OPENSSL WANT_SSL WANT_SSL_CRYPTO WANT_LIBUV HAVE_LIBUV_VERSION_1_0_0 LIBUV_CFLAGS LIBUV_LDFLAGS HAVE_PKGCFG_LIBUV HAVE_LIBUV USE_RPATH USERCC USEROSTYPE LIBVERSION HAVE_JEMALLOC HAVE_PTRACE USE_PTRACE_WRAP R_CHECKS_LEVEL"
|
|
|
|
create_environ
|
|
|
|
ocho "checking build system type... ${BUILD}"
|
|
ocho "checking host system type... ${HOST}"
|
|
ocho "checking target system type... ${TARGET}"
|
|
[ "${CROSSBUILD}" = 1 ] && echo "using crosscompilation mode."
|
|
|
|
#split_host BUILD HOST TARGET
|
|
[ -n "${prefix}" ] && PREFIX="${prefix}"
|
|
ocho "checking for working directories... ${WODIS}"
|
|
ocho "using prefix '${PREFIX}'"
|
|
ACR_RMFILES=" test.c a.out a.exe"
|
|
|
|
|
|
|
|
|
|
COMPILER=CC
|
|
ochof "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 "int main(int argc, char **argv){return 0;}" > test.c
|
|
(exec ${CC} ${CFLAGS} ${CPPFLAGS} ${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
|
|
ochof "checking for dynamic library... "
|
|
HAVE_LIB_DL=0
|
|
for OS in gnulinux linux gnu/kfreebsd syllable serenityos vinix sunos darwin beos solaris wsl ; 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
|
|
ochof "checking for pkg-config... "
|
|
if [ -n "$PKGCONFIG" ]; then
|
|
if [ -x "$PKGCONFIG" ]; then
|
|
_HAVE_PKGCONFIG="${PKGCONFIG}"
|
|
else
|
|
ocho "PKGCONFIG env is not executable"
|
|
PKGCONFIG=""
|
|
fi
|
|
else
|
|
IFS=:
|
|
for A in ${PATH} ; do
|
|
if [ -x "${A}/pkg-config" ]; then
|
|
PKGCONFIG="${A}/pkg-config"
|
|
elif [ -x "${A}/pkgconf" ]; then
|
|
PKGCONFIG="${A}/pkgconf"
|
|
else
|
|
continue
|
|
fi
|
|
break
|
|
done
|
|
unset IFS
|
|
fi
|
|
if [ -n "${PKGCONFIG}" ]; then
|
|
ocho ${PKGCONFIG}
|
|
else
|
|
ocho no; fi
|
|
ochof "checking for patch... "
|
|
if [ -x "${PATCH}" ]; then
|
|
FIND=${PATCH}
|
|
else
|
|
FIND=""
|
|
IFS=:
|
|
for A in ${PATH} ; do
|
|
if [ -x "${A}/patch" ]; then
|
|
FIND="${A}/patch"
|
|
break;
|
|
fi
|
|
done
|
|
unset IFS
|
|
fi
|
|
if [ -n "${FIND}" ]; then
|
|
ocho ${FIND};
|
|
HAVE_PATCH=1
|
|
PATCH=${FIND}
|
|
else
|
|
HAVE_PATCH=0
|
|
PATCH=patch
|
|
if [ "" = 1 ]; then
|
|
echo "Cannot find patch" >&2
|
|
else
|
|
echo no
|
|
fi
|
|
echo "error: This program is required." >&2
|
|
exit 1 ; fi
|
|
ochof "checking for ar... "
|
|
if [ -x "${AR}" ]; then
|
|
FIND=${AR}
|
|
else
|
|
FIND=""
|
|
IFS=:
|
|
for A in ${PATH} ; do
|
|
if [ -x "${A}/ar" ]; then
|
|
FIND="${A}/ar"
|
|
break;
|
|
fi
|
|
done
|
|
unset IFS
|
|
fi
|
|
if [ -n "${FIND}" ]; then
|
|
ocho ${FIND};
|
|
HAVE_AR=1
|
|
AR=${FIND}
|
|
else
|
|
HAVE_AR=0
|
|
AR=ar
|
|
if [ "" = 1 ]; then
|
|
echo "Cannot find ar" >&2
|
|
else
|
|
echo no
|
|
fi
|
|
echo "error: This program is required." >&2
|
|
exit 1 ; fi
|
|
ochof "checking for git... "
|
|
if [ -x "${GIT}" ]; then
|
|
FIND=${GIT}
|
|
else
|
|
FIND=""
|
|
IFS=:
|
|
for A in ${PATH} ; do
|
|
if [ -x "${A}/git" ]; then
|
|
FIND="${A}/git"
|
|
break;
|
|
fi
|
|
done
|
|
unset IFS
|
|
fi
|
|
if [ -n "${FIND}" ]; then
|
|
ocho ${FIND};
|
|
HAVE_GIT=1
|
|
GIT=${FIND}
|
|
else
|
|
HAVE_GIT=0
|
|
GIT=git
|
|
if [ "" = 1 ]; then
|
|
echo "Cannot find git" >&2
|
|
else
|
|
echo no
|
|
fi ; fi
|
|
ochof "checking for gperf... "
|
|
if [ -x "${GPERF}" ]; then
|
|
FIND=${GPERF}
|
|
else
|
|
FIND=""
|
|
IFS=:
|
|
for A in ${PATH} ; do
|
|
if [ -x "${A}/gperf" ]; then
|
|
FIND="${A}/gperf"
|
|
break;
|
|
fi
|
|
done
|
|
unset IFS
|
|
fi
|
|
if [ -n "${FIND}" ]; then
|
|
ocho ${FIND};
|
|
HAVE_GPERF=1
|
|
GPERF=${FIND}
|
|
else
|
|
HAVE_GPERF=0
|
|
GPERF=gperf
|
|
if [ "" = 1 ]; then
|
|
echo "Cannot find gperf" >&2
|
|
else
|
|
echo no
|
|
fi ; fi
|
|
check_library() {
|
|
VAR=$1
|
|
S="$"
|
|
_REQUIRED=$3
|
|
_CHKLIB_NAME=$2
|
|
_CHKLIB_LIBS=$(echo "-l${_CHKLIB_NAME}" | sed 's,+, -l,g')
|
|
ochof "checking for lib${_CHKLIB_NAME} ... "
|
|
echo "int main(int ac, char **av){return 0;}" > test.c
|
|
eval ${S}${COMPILER} ${CFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} ${_CHKLIB_LIBS} test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
eval ${VAR}=1
|
|
echo yes
|
|
else
|
|
eval ${VAR}=0
|
|
echo no
|
|
if [ "${_REQUIRED}" = 1 ]; then
|
|
echo "this library is required."
|
|
do_remove
|
|
exit 1
|
|
fi
|
|
fi
|
|
}
|
|
|
|
check_library HAVE_LIB_MAGIC magic 0
|
|
check_include() {
|
|
VAR=$1
|
|
INC=$2
|
|
_REQUIRED=$3
|
|
ochof "checking for $2... "
|
|
echo > test.c
|
|
|
|
echo "#include <${INC}>" >>test.c
|
|
echo 'int main(int ac, char **av){return 0;}' >>test.c
|
|
eval \$${COMPILER} ${CFLAGS} ${CPPFLAGS} ${CXXFLAGS} test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
eval ${VAR}=1
|
|
echo yes
|
|
else
|
|
eval ${VAR}=0
|
|
echo no
|
|
if [ 1 = "0" ]; then
|
|
echo 'ERROR: required include not found.' >&2
|
|
do_remove
|
|
exit 1
|
|
fi
|
|
fi
|
|
}
|
|
|
|
check_include HAVE_LINUX_CAN_H linux/can.h 0
|
|
|
|
if [ 11 = "$HAVE_LIB_MAGIC$USE_MAGIC" ]; then
|
|
|
|
USE_LIB_MAGIC="1"
|
|
LIBMAGIC="-lmagic"
|
|
else
|
|
USE_LIB_MAGIC="0"
|
|
LIBMAGIC=""; fi
|
|
if [ "$WANT_GPERF" = "0" ]; then
|
|
HAVE_GPERF="0"; fi
|
|
if [ "$WITH_CAPSTONE" = "1" ]; then
|
|
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
|
|
type ${PKGCONFIG} > /dev/null 2>&1 || echo "ERROR: Cannot find valid PKGCONFIG, pkg-config or pkgconf in PATH"
|
|
echo 'Using PKGCONFIG: '${PKGCONFIG}
|
|
printf 'checking pkg-config flags for capstone... '
|
|
tmp=`${PKGCONFIG} --cflags capstone 2>/dev/null`
|
|
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_CAPSTONE=0;
|
|
CAPSTONE_CFLAGS='';CAPSTONE_LDFLAGS='';
|
|
else
|
|
CAPSTONE_CFLAGS=$tmp;
|
|
tmp=`${PKGCONFIG} --libs capstone 2>/dev/null`
|
|
if [ $? = 0 ]; then
|
|
echo yes; HAVE_PKGCFG_CAPSTONE=1;
|
|
CAPSTONE_LDFLAGS=$tmp; fi; fi; fi
|
|
if [ 11 = "$WITH_CAPSTONE$HAVE_PKGCFG_CAPSTONE" ]; then
|
|
|
|
USE_CAPSTONE="1"
|
|
else
|
|
USE_CAPSTONE="0"; fi
|
|
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
|
|
printf 'checking pkg-config flags for liblz4... '
|
|
tmp=`${PKGCONFIG} --cflags liblz4 2>/dev/null`
|
|
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_LIBLZ4=0;
|
|
LZ4_CFLAGS='';LZ4_LDFLAGS='';
|
|
else
|
|
LZ4_CFLAGS=$tmp;
|
|
tmp=`${PKGCONFIG} --libs liblz4 2>/dev/null`
|
|
if [ $? = 0 ]; then
|
|
echo yes; HAVE_PKGCFG_LIBLZ4=1;
|
|
LZ4_LDFLAGS=$tmp; fi; fi
|
|
if [ 11 = "$WITH_SYSLZ4$LZ4_CFLAGS" ]; then
|
|
|
|
USE_SYSLZ4="1"
|
|
else
|
|
USE_SYSLZ4="0"; fi
|
|
check_library HAVE_LIB_Z z 0
|
|
check_library HAVE_LIB_ZIP zip 0
|
|
if [ 11 = "$HAVE_LIB_Z$USE_ZIP" ]; then
|
|
|
|
if [ "$HAVE_LIB_ZIP" = "1" ]; then
|
|
USE_LIB_ZIP="1"
|
|
LIBZIP="-lz -lzip"
|
|
else
|
|
USE_LIB_ZIP="0"
|
|
LIBZIP=""; fi
|
|
else
|
|
USE_LIB_ZIP="0"
|
|
LIBZIP=""; fi
|
|
check_library HAVE_LIB_XXHASH xxhash 0
|
|
if [ 11 = "$HAVE_LIB_XXHASH$USE_XXHASH" ]; then
|
|
|
|
USE_LIB_XXHASH="1"
|
|
LIBXXHASH="-lxxhash"
|
|
else
|
|
USE_LIB_XXHASH="0"
|
|
LIBXXHASH=""; fi
|
|
printf "checking declaration of ADDR_NO_RANDOMIZE in sys/personality.h... "
|
|
echo "#include <sys/personality.h>" > test.c
|
|
echo "int main(int ac, char **av){ void *a = ADDR_NO_RANDOMIZE; return 0; }" >> test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_DECL_ADDR_NO_RANDOMIZE=1
|
|
else
|
|
HAVE_DECL_ADDR_NO_RANDOMIZE=0 ; echo no ; fi
|
|
printf "checking declaration of __GLIBC__ in features.h... "
|
|
echo "#include <features.h>" > test.c
|
|
echo "int main(int ac, char **av){ void *a = __GLIBC__; return 0; }" >> test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_DECL___GLIBC__=1
|
|
else
|
|
HAVE_DECL___GLIBC__=0 ; echo no ; fi
|
|
printf "checking function arc4random_uniform() in c... "
|
|
echo "int main(int ac, char **av){ arc4random_uniform(0); return 0; }" > test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_ARC4RANDOM_UNIFORM=1
|
|
else
|
|
HAVE_ARC4RANDOM_UNIFORM=0 ; echo no ; fi
|
|
printf "checking function explicit_bzero() in c... "
|
|
echo "int main(int ac, char **av){ explicit_bzero(0); return 0; }" > test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_EXPLICIT_BZERO=1
|
|
else
|
|
HAVE_EXPLICIT_BZERO=0 ; echo no ; fi
|
|
printf "checking function explicit_memset() in c... "
|
|
echo "int main(int ac, char **av){ explicit_memset(0); return 0; }" > test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_EXPLICIT_MEMSET=1
|
|
else
|
|
HAVE_EXPLICIT_MEMSET=0 ; echo no ; fi
|
|
printf "checking function clock_nanosleep() in c... "
|
|
echo "int main(int ac, char **av){ clock_nanosleep(0); return 0; }" > test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_CLOCK_NANOSLEEP=1
|
|
else
|
|
HAVE_CLOCK_NANOSLEEP=0 ; echo no ; fi
|
|
printf "checking function sigaction() in c... "
|
|
echo "int main(int ac, char **av){ sigaction(0); return 0; }" > test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_SIGACTION=1
|
|
else
|
|
HAVE_SIGACTION=0 ; echo no ; fi
|
|
printf "checking function clock_gettime() in c... "
|
|
echo "int main(int ac, char **av){ clock_gettime(0); return 0; }" > test.c
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; HAVE_CLOCK_GETTIME=1
|
|
else
|
|
HAVE_CLOCK_GETTIME=0 ; echo no ; fi
|
|
if [ "$HAVE_CLOCK_GETTIME" = "0" ]; then
|
|
if [ "$HAVE_DECL___GLIBC__" = "1" ]; then
|
|
CLOCK_LDFLAGS="${CLOCK_LDFLAGS} '-lrt'"; fi; fi
|
|
printf "checking cflags -std=gnu99... "
|
|
echo "int main(int ac, char **av){ return 0; }" > .test.c
|
|
${CC} -std=gnu99 ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -std=gnu99 .test.c >/dev/null 2>&1
|
|
if [ $? = 0 ]; then
|
|
echo yes ; SUPPORT_GNU99=1
|
|
else
|
|
SUPPORT_GNU99=0 ; echo no ; fi
|
|
HAVE_LIB_GMP="0"
|
|
check_library HAVE_LIB_SSL ssl 0
|
|
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
|
|
printf 'checking pkg-config flags for openssl... '
|
|
tmp=`${PKGCONFIG} --cflags openssl 2>/dev/null`
|
|
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_OPENSSL=0;
|
|
SSL_CFLAGS='';SSL_LDFLAGS='';
|
|
else
|
|
SSL_CFLAGS=$tmp;
|
|
tmp=`${PKGCONFIG} --libs openssl 2>/dev/null`
|
|
if [ $? = 0 ]; then
|
|
echo yes; HAVE_PKGCFG_OPENSSL=1;
|
|
SSL_LDFLAGS=$tmp; fi; fi
|
|
if [ ! "$SSL_LDFLAGS" = "" ]; then
|
|
HAVE_OPENSSL="1"; fi
|
|
if [ 11 = "$WANT_SSL$HAVE_OPENSSL" ]; then
|
|
|
|
HAVE_OPENSSL="1"
|
|
else
|
|
HAVE_OPENSSL="0"
|
|
SSL_CFLAGS=""
|
|
SSL_LDFLAGS=""; fi
|
|
if [ "$SSL_LDFLAGS" = "" ]; then
|
|
if [ "$HAVE_LIB_SSL" = "0" ]; then
|
|
HAVE_OPENSSL="0"
|
|
else
|
|
SSL_LDFLAGS="-lssl"; fi; fi
|
|
if [ 11 = "$WANT_SSL_CRYPTO$HAVE_OPENSSL" ]; then
|
|
|
|
WANT_SSL_CRYPTO="1"
|
|
else
|
|
WANT_SSL_CRYPTO="0"; fi
|
|
HAVE_LIBUV_VERSION_1_0_0=0
|
|
printf "checking version of library libuv >= 1.0.0... "
|
|
${PKGCONFIG} --atleast-version=1.0.0 libuv >/dev/null 2>&1
|
|
if [ $? = 0 ]; then HAVE_LIBUV_VERSION_1_0_0=1 ; echo ok; else
|
|
echo "no" ; fi
|
|
if [ "$HAVE_LIBUV_VERSION_1_0_0" = "1" ]; then
|
|
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
|
|
printf 'checking pkg-config flags for libuv... '
|
|
tmp=`${PKGCONFIG} --cflags libuv 2>/dev/null`
|
|
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_LIBUV=0;
|
|
LIBUV_CFLAGS='';LIBUV_LDFLAGS='';
|
|
else
|
|
LIBUV_CFLAGS=$tmp;
|
|
tmp=`${PKGCONFIG} --libs libuv 2>/dev/null`
|
|
if [ $? = 0 ]; then
|
|
echo yes; HAVE_PKGCFG_LIBUV=1;
|
|
LIBUV_LDFLAGS=$tmp; fi; fi
|
|
if [ ! "$LIBUV_LDFLAGS" = "" ]; then
|
|
HAVE_LIBUV="1"
|
|
else
|
|
HAVE_LIBUV="0"; fi
|
|
if [ "$WANT_LIBUV" = "0" ]; then
|
|
HAVE_LIBUV="0"; fi
|
|
else
|
|
HAVE_LIBUV="0"; fi
|
|
if [ "$USEROSTYPE" = "auto" ]; then
|
|
if [ "$HOST_OS" = "mingw32_nt-6.2" ]; then
|
|
USEROSTYPE="mingw32"
|
|
else
|
|
if [ "$HOST_OS" = "mingw32_nt" ]; then
|
|
USEROSTYPE="mingw32"
|
|
else
|
|
if [ "$HOST_OS" = "wsl" ]; then
|
|
USEROSTYPE="wsl"
|
|
else
|
|
if [ "$HOST_OS" = "linux" ]; then
|
|
USEROSTYPE="gnulinux"
|
|
else
|
|
if [ "$HOST_OS" = "serenityos" ]; then
|
|
USEROSTYPE="serenityos"
|
|
HAVE_LIB_DL="1"
|
|
DL_LIBS="-ldl"
|
|
else
|
|
if [ "$HOST_OS" = "gnu" ]; then
|
|
USEROSTYPE="gnulinux"
|
|
HAVE_LIB_DL="1"
|
|
DL_LIBS="-ldl"
|
|
else
|
|
if [ "$HOST_OS" = "sunos" ]; then
|
|
USEROSTYPE="solaris"
|
|
else
|
|
if [ "$HOST_OS" = "gnu/kfreebsd" ]; then
|
|
USEROSTYPE="bsd"
|
|
else
|
|
if [ "$HOST_OS" = "netbsd" ]; then
|
|
USEROSTYPE="bsd"
|
|
else
|
|
if [ "$HOST_OS" = "freebsd" ]; then
|
|
USEROSTYPE="bsd"
|
|
else
|
|
if [ "$HOST_OS" = "openbsd" ]; then
|
|
USEROSTYPE="bsd"
|
|
else
|
|
if [ "$HOST_OS" = "darwin" ]; then
|
|
USEROSTYPE="darwin"
|
|
else
|
|
if [ "$HOST_OS" = "haiku" ]; then
|
|
USEROSTYPE="haiku"; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi
|
|
if [ "$LIBVERSION" = "xxx" ]; then
|
|
LIBVERSION="$VERSION"; fi
|
|
if [ "$USEROSTYPE" = "gnulinux" ]; then
|
|
HAVE_PTRACE="1"
|
|
USE_PTRACE_WRAP="1"
|
|
else
|
|
if [ "$USEROSTYPE" = "wsl" ]; then
|
|
BUILD="${SPLIT_CPU}-unknown-linux-gnu"
|
|
HOST="$BUILD"
|
|
TARGET="$HOST"
|
|
USEROSTYPE="gnulinux"
|
|
HAVE_PTRACE="1"
|
|
USE_PTRACE_WRAP="0"
|
|
else
|
|
if [ "$USEROSTYPE" = "android" ]; then
|
|
HAVE_PTRACE="1"
|
|
USE_PTRACE_WRAP="1"
|
|
else
|
|
if [ "$USEROSTYPE" = "mingw32" ]; then
|
|
HAVE_PTRACE="0"
|
|
USE_PTRACE_WRAP="0"
|
|
else
|
|
if [ "$USEROSTYPE" = "solaris" ]; then
|
|
HAVE_PTRACE="0"
|
|
USE_PTRACE_WRAP="0"
|
|
else
|
|
if [ "$USEROSTYPE" = "haiku" ]; then
|
|
HAVE_PTRACE="0"
|
|
USE_PTRACE_WRAP="0"
|
|
else
|
|
HAVE_PTRACE="1"
|
|
USE_PTRACE_WRAP="0"; fi; fi; fi; fi; fi; fi
|
|
if [ "$DEBUGGER" = "0" ]; then
|
|
HAVE_PTRACE="0"; fi
|
|
if [ "$WANT_PTRACE_WRAP" = "0" ]; then
|
|
USE_PTRACE_WRAP="0"; 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-user.mk libr/include/r_userconf.h pkgcfg/r_io.pc pkgcfg/r_magic.pc pkgcfg/r_esil.pc pkgcfg/r_asm.pc pkgcfg/r_bin.pc pkgcfg/r_anal.pc pkgcfg/r_arch.pc pkgcfg/r_cons.pc pkgcfg/r_core.pc pkgcfg/r_lang.pc pkgcfg/r_socket.pc pkgcfg/r_debug.pc pkgcfg/r_reg.pc pkgcfg/r_config.pc pkgcfg/r_flag.pc pkgcfg/r_syscall.pc pkgcfg/r_util.pc pkgcfg/r_search.pc pkgcfg/r_bp.pc pkgcfg/r_fs.pc pkgcfg/r_egg.pc pkgcfg/r_crypto.pc ; 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
|
|
ocho "creating ${SD_TARGET}"
|
|
[ "${VPATH}" != '.' ] && 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 [ ! $? = 0 ]; then echo Cannot write target file ; control_c ; fi
|
|
done
|
|
|
|
do_remove
|
|
if [ "$QUIET" = 0 ]; then
|
|
echo
|
|
echo "Final report:"
|
|
for A in BUILD CC CFLAGS DEBUGGER HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO HAVE_EXPLICIT_MEMSET HAVE_FORK HAVE_GPERF HAVE_LIBUV HAVE_LIB_GMP HAVE_OPENSSL WANT_SSL_CRYPTO HAVE_PTRACE HOST LDFLAGS LIBVERSION PKGCONFIG PREFIX R_CHECKS_LEVEL TARGET USERCC USEROSTYPE USE_CAPSTONE USE_LIB_MAGIC USE_LIB_XXHASH USE_LIB_ZIP USE_PTRACE_WRAP USE_SYSLZ4 VERSION WANT_DYLINK ; do
|
|
eval VAL="\$${A}"
|
|
[ -z "${VAL}" ] && VAL="\"\""
|
|
echo " - ${A} = ${VAL}"
|
|
done
|
|
fi
|
|
#ACR# PKGNAME radare2
|
|
#ACR# VERSION 5.8.3
|
|
#ACR# CONTACT pancake ; pancake@nopcode.org
|
|
#ACR#
|
|
#ACR# LANG_C!
|
|
#ACR#
|
|
#ACR# ARG_DISABLE DEBUGGER debugger disable native debugger features ;
|
|
#ACR#
|
|
#ACR# USE_DL
|
|
#ACR#
|
|
#ACR# USE_PKGCONFIG
|
|
#ACR#
|
|
#ACR# CHKPRG! PATCH patch
|
|
#ACR# CHKPRG! AR ar
|
|
#ACR# CHKPRG GIT git
|
|
#ACR# CHKPRG GPERF gperf
|
|
#ACR# CHKLIB magic
|
|
#ACR# CHKINC linux/can.h
|
|
#ACR# ARG_WITH USE_MAGIC sysmagic force to use system's magic ;
|
|
#ACR# IFAND HAVE_LIB_MAGIC USE_MAGIC {
|
|
#ACR# USE_LIB_MAGIC = 1 ;
|
|
#ACR# LIBMAGIC = -lmagic ;
|
|
#ACR# }{
|
|
#ACR# USE_LIB_MAGIC = 0 ;
|
|
#ACR# LIBMAGIC = '' ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# ARG_DISABLE WANT_THREADS threads disable use of thread apis ;
|
|
#ACR#
|
|
#ACR# (( useful for static builds . see sys/static.sh ))
|
|
#ACR# ARG_DISABLE LOADLIBS loadlibs disable loading plugins ;
|
|
#ACR#
|
|
#ACR# ARG_ENABLE R_CRITICAL_ENABLED threadsafety enable mutexes in critical code paths ;
|
|
#ACR#
|
|
#ACR# ARG_WITHOUT WANT_DYLINK dylink disable support for dynamic loading of plugins ;
|
|
#ACR# ARG_WITHOUT HAVE_FORK fork disable fork ;
|
|
#ACR# ARG_WITHOUT WANT_PTRACE_WRAP ptrace-wrap build ptrace-wrap support needed for the iaito debugger on Linux ;
|
|
#ACR# ARG_WITHOUT WANT_GPERF gperf do not statically link the sdb databases even if gperf is found ;
|
|
#ACR# ARG_WITHOUT WANT_CAPSTONE capstone dont build the capstone dependency ;
|
|
#ACR#
|
|
#ACR# IFNOT WANT_GPERF {
|
|
#ACR# HAVE_GPERF = 0 ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# ARG_WITH WITH_LIBR libr build libr.a and libr.dylib ;
|
|
#ACR# ARG_WITH WITH_STATIC_THEMES static-themes default themes are compiled and fallback if not available on disk ;
|
|
#ACR#
|
|
#ACR# (( CAPSTONE ))
|
|
#ACR# ARG_WITH USE_CS5 capstone5 build next branch of capstone5 (default) ;
|
|
#ACR# ARG_WITH USE_CS4 capstone4 build v4 branch of capstone ;
|
|
#ACR#
|
|
#ACR# ARG_WITH WITH_CAPSTONE syscapstone force to use system-wide capstone ;
|
|
#ACR# IF WITH_CAPSTONE {
|
|
#ACR# PKGCFG CAPSTONE_CFLAGS CAPSTONE_LDFLAGS capstone
|
|
#ACR# }
|
|
#ACR# IFAND WITH_CAPSTONE HAVE_PKGCFG_CAPSTONE {
|
|
#ACR# USE_CAPSTONE = 1 ;
|
|
#ACR# }{
|
|
#ACR# USE_CAPSTONE = 0 ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# (( LZ4 ))
|
|
#ACR# PKGCFG LZ4_CFLAGS LZ4_LDFLAGS liblz4
|
|
#ACR# ARG_WITH WITH_SYSLZ4 syslz4 force to use system's liblz4 ;
|
|
#ACR# IFAND WITH_SYSLZ4 LZ4_CFLAGS {
|
|
#ACR# USE_SYSLZ4 = 1 ;
|
|
#ACR# }{
|
|
#ACR# USE_SYSLZ4 = 0 ;
|
|
#ACR#
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# (( ZIP ))
|
|
#ACR# CHKLIB z
|
|
#ACR# CHKLIB zip
|
|
#ACR# ARG_WITH USE_ZIP syszip force to use system's libzip and zlib ;
|
|
#ACR# IFAND HAVE_LIB_Z USE_ZIP {
|
|
#ACR# IF HAVE_LIB_ZIP {
|
|
#ACR# USE_LIB_ZIP = 1 ;
|
|
#ACR# LIBZIP = -lz -lzip ;
|
|
#ACR# }{
|
|
#ACR# USE_LIB_ZIP = 0 ;
|
|
#ACR# LIBZIP = '' ; (( static linking to shlr/zip ))
|
|
#ACR# }
|
|
#ACR# }{
|
|
#ACR# USE_LIB_ZIP = 0 ;
|
|
#ACR# LIBZIP = '' ; (( static linking to shlr/zip ))
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# CHKLIB xxhash
|
|
#ACR# ARG_WITH USE_XXHASH sysxxhash force to use system's xxhash ;
|
|
#ACR# IFAND HAVE_LIB_XXHASH USE_XXHASH {
|
|
#ACR# USE_LIB_XXHASH = 1 ;
|
|
#ACR# LIBXXHASH = -lxxhash ;
|
|
#ACR# }{
|
|
#ACR# USE_LIB_XXHASH = 0 ;
|
|
#ACR# LIBXXHASH = '' ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# ARG_WITHOUT WITH_GPL gpl do not build GPL code (grub, cxx, ... ) ;
|
|
#ACR#
|
|
#ACR# CHKDECL sys/personality.h ADDR_NO_RANDOMIZE
|
|
#ACR# CHKDECL features.h __GLIBC__
|
|
#ACR# CHKFNC c arc4random_uniform
|
|
#ACR# CHKFNC c explicit_bzero
|
|
#ACR# CHKFNC c explicit_memset
|
|
#ACR# CHKFNC c clock_nanosleep
|
|
#ACR# CHKFNC c sigaction
|
|
#ACR# CHKFNC c clock_gettime
|
|
#ACR#
|
|
#ACR# IFNOT HAVE_CLOCK_GETTIME {
|
|
#ACR# IF HAVE_DECL___GLIBC__ {
|
|
#ACR# CLOCK_LDFLAGS += '-lrt' ;
|
|
#ACR# }
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# CHKFLG SUPPORT_GNU99 -std=gnu99 ;
|
|
#ACR#
|
|
#ACR# (( TODO must deprecate
|
|
#ACR# CHKLIB gmp
|
|
#ACR# ARG_WITHOUT HAVE_GMP gmp disable GMP dependency ;
|
|
#ACR# IFNOT HAVE_GMP { HAVE_LIB_GMP = 0 ; }
|
|
#ACR# HAVE_GMP = 0 ;
|
|
#ACR# ))
|
|
#ACR# HAVE_LIB_GMP = 0 ;
|
|
#ACR#
|
|
#ACR#
|
|
#ACR# (( openssl is used for https:// in rsocket and crypto/hash ))
|
|
#ACR# CHKLIB ssl
|
|
#ACR# PKGCFG SSL_CFLAGS SSL_LDFLAGS openssl
|
|
#ACR# IFNOTNULL SSL_LDFLAGS {
|
|
#ACR# HAVE_OPENSSL = 1 ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# ARG_WITH WANT_SSL ssl build with (Open|Boring|..)SSL if possible ;
|
|
#ACR# IFAND WANT_SSL HAVE_OPENSSL {
|
|
#ACR# HAVE_OPENSSL = 1 ;
|
|
#ACR# }{
|
|
#ACR# HAVE_OPENSSL = 0 ;
|
|
#ACR# SSL_CFLAGS = "" ;
|
|
#ACR# SSL_LDFLAGS = "" ;
|
|
#ACR# }
|
|
#ACR# IFNULL SSL_LDFLAGS {
|
|
#ACR# IFNOT HAVE_LIB_SSL {
|
|
#ACR# HAVE_OPENSSL = 0 ;
|
|
#ACR# }{
|
|
#ACR# SSL_LDFLAGS = -lssl ;
|
|
#ACR# }
|
|
#ACR# }
|
|
#ACR# ARG_WITH WANT_SSL_CRYPTO ssl-crypto build crypto code with libssl ;
|
|
#ACR# IFAND WANT_SSL_CRYPTO HAVE_OPENSSL {
|
|
#ACR# WANT_SSL_CRYPTO = 1 ;
|
|
#ACR# }{
|
|
#ACR# WANT_SSL_CRYPTO = 0 ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# ARG_WITH WANT_LIBUV libuv disable libuv dependency ;
|
|
#ACR# CHKVER libuv 1.0.0
|
|
#ACR# IF HAVE_LIBUV_VERSION_1_0_0 {
|
|
#ACR# PKGCFG LIBUV_CFLAGS LIBUV_LDFLAGS libuv
|
|
#ACR# IFNOTNULL LIBUV_LDFLAGS {
|
|
#ACR# HAVE_LIBUV = 1 ;
|
|
#ACR# }{
|
|
#ACR# HAVE_LIBUV = 0 ;
|
|
#ACR# }
|
|
#ACR# IFNOT WANT_LIBUV {
|
|
#ACR# HAVE_LIBUV = 0 ;
|
|
#ACR# }
|
|
#ACR# }{
|
|
#ACR# HAVE_LIBUV = 0 ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# ARG_WITH USE_RPATH rpath use rpath to build ;
|
|
#ACR#
|
|
#ACR# (( rules for the compiler ))
|
|
#ACR# ARG_WITH USERCC=gcc compiler Define compiler to use (see mk/) ;
|
|
#ACR# ARG_WITH USEROSTYPE=auto ostype Choose OS ( android windows wsl mingw32 bsd solaris gnulinux darwin haiku ) ;
|
|
#ACR#
|
|
#ACR# (( TODO: throw error if unknown ostype ))
|
|
#ACR# (( TODO: handle BSD os as different ostype? ))
|
|
#ACR# IFEQ USEROSTYPE auto ; {
|
|
#ACR# IFEQ HOST_OS mingw32_nt-6.2 ; {
|
|
#ACR# USEROSTYPE = mingw32 ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS mingw32_nt ; {
|
|
#ACR# USEROSTYPE = mingw32 ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS wsl ; {
|
|
#ACR# USEROSTYPE = wsl ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS linux ; {
|
|
#ACR# USEROSTYPE = gnulinux ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS serenityos ; {
|
|
#ACR# USEROSTYPE = serenityos ;
|
|
#ACR# HAVE_LIB_DL = 1 ;
|
|
#ACR# DL_LIBS = -ldl ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS gnu ; {
|
|
#ACR# (( GNU / HURD ))
|
|
#ACR# USEROSTYPE = gnulinux ;
|
|
#ACR# HAVE_LIB_DL = 1 ;
|
|
#ACR# DL_LIBS = -ldl ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS sunos ; {
|
|
#ACR# USEROSTYPE = solaris ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS gnu/kfreebsd ; {
|
|
#ACR# USEROSTYPE = bsd ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS netbsd ; {
|
|
#ACR# USEROSTYPE = bsd ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS freebsd ; {
|
|
#ACR# USEROSTYPE = bsd ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS openbsd ; {
|
|
#ACR# USEROSTYPE = bsd ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS darwin ; {
|
|
#ACR# USEROSTYPE = darwin ;
|
|
#ACR# }{
|
|
#ACR# IFEQ HOST_OS haiku ; {
|
|
#ACR# USEROSTYPE = haiku ;
|
|
#ACR# } } } } } } } } } } } } }
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# (( this hack is required for openbsd ports ))
|
|
#ACR# ARG_WITH LIBVERSION=xxx libversion specify different libversion ;
|
|
#ACR# ARG_WITHOUT HAVE_JEMALLOC jemalloc build without jemalloc ;
|
|
#ACR#
|
|
#ACR# IFEQ LIBVERSION xxx ; {
|
|
#ACR# LIBVERSION = $VERSION ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# IFEQ USEROSTYPE gnulinux ; {
|
|
#ACR# HAVE_PTRACE = 1 ;
|
|
#ACR# USE_PTRACE_WRAP = 1 ;
|
|
#ACR# }{
|
|
#ACR# IFEQ USEROSTYPE wsl ; {
|
|
#ACR# BUILD = ${SPLIT_CPU}-unknown-linux-gnu ;
|
|
#ACR# HOST = $BUILD ;
|
|
#ACR# TARGET = $HOST ;
|
|
#ACR# USEROSTYPE = gnulinux ;
|
|
#ACR# HAVE_PTRACE = 1 ;
|
|
#ACR# USE_PTRACE_WRAP = 0 ;
|
|
#ACR# }{
|
|
#ACR# IFEQ USEROSTYPE android ; {
|
|
#ACR# HAVE_PTRACE = 1 ;
|
|
#ACR# USE_PTRACE_WRAP = 1 ;
|
|
#ACR# }{
|
|
#ACR# IFEQ USEROSTYPE mingw32 ; {
|
|
#ACR# HAVE_PTRACE = 0 ;
|
|
#ACR# USE_PTRACE_WRAP = 0 ;
|
|
#ACR# }{
|
|
#ACR# IFEQ USEROSTYPE solaris ; {
|
|
#ACR# HAVE_PTRACE = 0 ;
|
|
#ACR# USE_PTRACE_WRAP = 0 ;
|
|
#ACR# }{
|
|
#ACR# IFEQ USEROSTYPE haiku ; {
|
|
#ACR# HAVE_PTRACE = 0 ;
|
|
#ACR# USE_PTRACE_WRAP = 0 ;
|
|
#ACR# }{
|
|
#ACR# HAVE_PTRACE = 1 ;
|
|
#ACR# USE_PTRACE_WRAP = 0 ;
|
|
#ACR# } } } } } }
|
|
#ACR#
|
|
#ACR# IFNOT DEBUGGER {
|
|
#ACR# HAVE_PTRACE = 0 ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# IFEQ WANT_PTRACE_WRAP 0 ; {
|
|
#ACR# USE_PTRACE_WRAP = 0 ;
|
|
#ACR# }
|
|
#ACR#
|
|
#ACR# ARG_WITH R_CHECKS_LEVEL=2 checks-level value between 0 and 3 to enable different level of assert (see R_CHECKS_LEVEL) ;
|
|
#ACR#
|
|
#ACR# REPORT
|
|
#ACR# BUILD CC CFLAGS DEBUGGER HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO
|
|
#ACR# HAVE_EXPLICIT_MEMSET HAVE_FORK HAVE_GPERF HAVE_LIBUV HAVE_LIB_GMP
|
|
#ACR# HAVE_OPENSSL WANT_SSL_CRYPTO HAVE_PTRACE HOST LDFLAGS LIBVERSION PKGCONFIG PREFIX
|
|
#ACR# R_CHECKS_LEVEL TARGET USERCC USEROSTYPE USE_CAPSTONE USE_LIB_MAGIC
|
|
#ACR# USE_LIB_XXHASH USE_LIB_ZIP USE_PTRACE_WRAP USE_SYSLZ4 VERSION WANT_DYLINK
|
|
#ACR# ;
|
|
#ACR#
|
|
#ACR# (( TODO: Add the rest of .pc files here.. add a rule for acr? ))
|
|
#ACR# SUBDIRS ./config-user.mk
|
|
#ACR# libr/include/r_userconf.h
|
|
#ACR# pkgcfg/r_io.pc
|
|
#ACR# pkgcfg/r_magic.pc
|
|
#ACR# pkgcfg/r_esil.pc
|
|
#ACR# pkgcfg/r_asm.pc
|
|
#ACR# pkgcfg/r_bin.pc
|
|
#ACR# pkgcfg/r_anal.pc
|
|
#ACR# pkgcfg/r_arch.pc
|
|
#ACR# pkgcfg/r_cons.pc
|
|
#ACR# pkgcfg/r_core.pc
|
|
#ACR# pkgcfg/r_lang.pc
|
|
#ACR# pkgcfg/r_socket.pc
|
|
#ACR# pkgcfg/r_debug.pc
|
|
#ACR# pkgcfg/r_reg.pc
|
|
#ACR# pkgcfg/r_config.pc
|
|
#ACR# pkgcfg/r_flag.pc
|
|
#ACR# pkgcfg/r_syscall.pc
|
|
#ACR# pkgcfg/r_util.pc
|
|
#ACR# pkgcfg/r_search.pc
|
|
#ACR# pkgcfg/r_bp.pc
|
|
#ACR# pkgcfg/r_fs.pc
|
|
#ACR# pkgcfg/r_egg.pc
|
|
#ACR# pkgcfg/r_crypto.pc
|
|
#ACR# ;
|