Skip to content

Commit

Permalink
Remove LIL_ENDIAN macro and configure option
Browse files Browse the repository at this point in the history
TODO: Remove other endian cruft from:
- hashing algs
- judy
- squashfs
- grub
- tms320

Signed-off-by: Damien Zammit <[email protected]>
  • Loading branch information
zamaudio authored and radare committed May 6, 2016
1 parent abf63d0 commit 632dccc
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 75 deletions.
2 changes: 1 addition & 1 deletion binr/blob/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

static int blob_version(const char *program) {
printf ("%s "R2_VERSION" %d @ "
R_SYS_OS"-"R_SYS_ENDIAN"-"
R_SYS_OS"-"
R_SYS_ARCH"-%d git.%s\n",
program, R2_VERSION_COMMIT,
R_SYS_BITS&8?64:32,
Expand Down
1 change: 0 additions & 1 deletion config-user.mk.acr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ DATADIR=@DATADIR@
INCLUDEDIR=@INCLUDEDIR@

HAVE_LIB_GMP=@HAVE_LIB_GMP@
LIL_ENDIAN=@LIL_ENDIAN@
USE_RPATH=@USE_RPATH@

MKPLUGINS=mk/stat.mk mk/sloc.mk
Expand Down
57 changes: 14 additions & 43 deletions configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# This script was automatically generated by ACR v0.10.0
# This script was automatically generated by ACR v0.10.1
# @author: pancake <nopcode.org>
# @url: http://www.nopcode.org
# @repo: git clone https://github.com/radare/acr
Expand All @@ -26,8 +26,6 @@ USE_ZIP=0
WITH_GPL=1
WANT_OPENSSL=0
USE_RPATH=0
HAVE_LILEND=0
HAVE_BIGEND=0
[ -z "${USERCC}" ] && USERCC="gcc"
[ -z "${USEROSTYPE}" ] && USEROSTYPE="auto"
WITHPIC=1
Expand Down Expand Up @@ -160,8 +158,7 @@ System types:
--target=TARGET configure for building compilers for TARGET [HOST]
EOF2

printf "
Optional Features:
printf "\nOptional Features:
--disable-debugger disable native debugger features
--with-sysmagic force to use system's magic
--disable-loadlibs disable loading plugins
Expand All @@ -171,27 +168,21 @@ Optional Features:
--without-gpl do not build GPL code (grub, cxx, ... )
--with-openssl build with openssl if possible
--with-rpath use rpath to build
--with-little-endian force little endian
--with-big-endian force big endian
--with-compiler Define compiler to use (see mk/) (USERCC=gcc)
--with-ostype Choose OS type ( gnulinux windows darwin haiku ) (USEROSTYPE=auto)
--without-pic do not build libr as a program independent location
--with-nonpic build the library archives .a
--with-libversion specify different libversion (LIBVERSION=xxx)
"
printf "
Some influential environment variables:
--with-libversion specify different libversion (LIBVERSION=xxx)\n"
printf "\nSome influential environment variables:
CC C compiler command
CFLAGS C compiler flags
CPPFLAGS C preprocessor 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 <[email protected]>"
CPP C preprocessor\n"
printf "\nReport bugs to: pancake <[email protected]>"
echo ""
exit 0
}
Expand All @@ -204,7 +195,7 @@ take_environ() {
}

show_version() {
echo "radare2-0.10.3-git configuration script done with acr v0.10.0.
echo "radare2-0.10.3-git configuration script done with acr v0.10.1.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <nopcode.org>."
exit 0
Expand Down Expand Up @@ -233,7 +224,7 @@ echo "LANGS: c"
echo "REQUIRED: libdl"
echo "OPTIONAL: libmagic"
echo "PKG-CONFIG: capstone openssl"
echo "FLAGS: --disable-debugger --with-sysmagic --disable-loadlibs --without-fork --with-syscapstone --with-syszip --without-gpl --with-openssl --with-rpath --with-little-endian --with-big-endian --with-compiler=gcc --with-ostype=auto --without-pic --with-nonpic --with-libversion=xxx"
echo "FLAGS: --disable-debugger --with-sysmagic --disable-loadlibs --without-fork --with-syscapstone --with-syszip --without-gpl --with-openssl --with-rpath --with-compiler=gcc --with-ostype=auto --without-pic --with-nonpic --with-libversion=xxx"
exit 0
;;
--cache-file)
Expand Down Expand Up @@ -286,8 +277,6 @@ echo "FLAGS: --disable-debugger --with-sysmagic --disable-loadlibs --without
"--without-gpl") WITH_GPL="0"; ;;
"--with-openssl") WANT_OPENSSL="1"; ;;
"--with-rpath") USE_RPATH="1"; ;;
"--with-little-endian") HAVE_LILEND="1"; ;;
"--with-big-endian") HAVE_BIGEND="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 ;;
"--without-pic") WITHPIC="0"; ;;
Expand All @@ -310,7 +299,7 @@ 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_PROGRAM_STRIP 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 CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS HAVE_PATCH PATCH HAVE_GIT GIT LIL_ENDIAN BIG_ENDIAN BYTEORDER HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC LOADLIBS HAVE_FORK WITH_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP WITH_GPL HAVE_LIB_GMP HAVE_GMP HAVE_LIB_SSL SSL_CFLAGS SSL_LDFLAGS HAVE_PKGCFG_OPENSSL HAVE_OPENSSL WANT_OPENSSL USE_RPATH HAVE_LILEND HAVE_BIGEND HAVE_LIB_LUA5_1 USERCC USEROSTYPE WITHPIC WITHNONPIC LIBVERSION"
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_PROGRAM_STRIP 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 CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS HAVE_PATCH PATCH HAVE_GIT GIT HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC LOADLIBS HAVE_FORK WITH_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP WITH_GPL HAVE_LIB_GMP HAVE_GMP HAVE_LIB_SSL SSL_CFLAGS SSL_LDFLAGS HAVE_PKGCFG_OPENSSL HAVE_OPENSSL WANT_OPENSSL USE_RPATH HAVE_LIB_LUA5_1 USERCC USEROSTYPE WITHPIC WITHNONPIC LIBVERSION"

create_environ

Expand All @@ -325,7 +314,6 @@ echo "checking for working directories... ${WODIS}"
echo "using prefix '${PREFIX}'"
ACR_RMFILES=" test.c a.out a.exe"


:
COMPILER=CC
printf "checking for c compiler... "
Expand Down Expand Up @@ -370,8 +358,8 @@ else
done
unset IFS
fi
if [ -n "${FIND}" ]; then
echo ${FIND};
if [ -n "${FIND}" ]; then
echo ${FIND};
HAVE_PATCH=1
PATCH=${FIND}
else
Expand All @@ -394,27 +382,14 @@ else
done
unset IFS
fi
if [ -n "${FIND}" ]; then
echo ${FIND};
if [ -n "${FIND}" ]; then
echo ${FIND};
HAVE_GIT=1
GIT=${FIND}
else
HAVE_GIT=0
GIT=git
echo no ; fi
printf "checking host endianness... "
LIL_ENDIAN=$(printf I|od|awk '{print substr($2,6,1);exit}')
if [ 0 != 0 -o "${LIL_ENDIAN}" = 1 ]; then
BYTEORDER=1234
BIG_ENDIAN=0
echo little
else
BYTEORDER=4321
BIG_ENDIAN=1
LIL_ENDIAN=0
echo big
fi

check_library() {
VAR=$1
S="$"
Expand Down Expand Up @@ -493,10 +468,6 @@ if [ "$HAVE_LIB_SSL" = "0" ]; then
HAVE_OPENSSL="0"
else
SSL_LDFLAGS="-lssl"; fi; fi
if [ "$HAVE_LILEND" = "1" ]; then
LIL_ENDIAN="1"; fi
if [ "$HAVE_BIGEND" = "1" ]; then
LIL_ENDIAN="0"; fi
check_library HAVE_LIB_LUA5_1 lua5.1 0
if [ "$USEROSTYPE" = "auto" ]; then
if [ "$HOST_OS" = "mingw32_nt-6.2" ]; then
Expand Down Expand Up @@ -575,7 +546,7 @@ done
do_remove
echo
echo "Final report:"
for A in PREFIX HAVE_LIB_GMP HAVE_OPENSSL USE_CAPSTONE HAVE_FORK VERSION USE_LIB_ZIP USE_LIB_MAGIC DEBUGGER CC USERCC USEROSTYPE LIL_ENDIAN LIBVERSION ; do # REPORT
for A in PREFIX HAVE_LIB_GMP HAVE_OPENSSL USE_CAPSTONE HAVE_FORK VERSION USE_LIB_ZIP USE_LIB_MAGIC DEBUGGER CC USERCC USEROSTYPE LIBVERSION ; do # REPORT
eval VAL="\$${A}"
[ -z "${VAL}" ] && VAL="(null)"
echo " - ${A} = ${VAL}"
Expand Down
8 changes: 1 addition & 7 deletions configure.acr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ USE_DL

CHKPRG! PATCH patch
CHKPRG GIT git
CHECK_ENDIAN
CHKLIB magic
ARG_WITH USE_MAGIC sysmagic force to use system's magic ;
IFAND HAVE_LIB_MAGIC USE_MAGIC {
Expand Down Expand Up @@ -83,11 +82,6 @@ IFNULL SSL_LDFLAGS {

ARG_WITH USE_RPATH rpath use rpath to build ;

ARG_WITH HAVE_LILEND little-endian force little endian ;
IF HAVE_LILEND { LIL_ENDIAN = 1 ; }
ARG_WITH HAVE_BIGEND big-endian force big endian ;
IF HAVE_BIGEND { LIL_ENDIAN = 0 ; }

CHKLIB lua5.1

(( rules for the compiler ))
Expand Down Expand Up @@ -140,7 +134,7 @@ IFEQ LIBVERSION xxx ; {

REPORT PREFIX HAVE_LIB_GMP HAVE_OPENSSL USE_CAPSTONE HAVE_FORK
VERSION USE_LIB_ZIP USE_LIB_MAGIC DEBUGGER CC USERCC
USEROSTYPE LIL_ENDIAN LIBVERSION ;
USEROSTYPE LIBVERSION ;

(( TODO: Add the rest of .pc files here.. add a rule for acr? ))
SUBDIRS ./config-user.mk
Expand Down
2 changes: 1 addition & 1 deletion libr/anal/esil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ static int esil_peek_n(RAnalEsil *esil, int bits) {
ret = r_anal_esil_mem_read (esil, addr, a, bytes);
b = r_read_ble64 (a, 0); //esil->anal->big_endian);
if (esil->anal->big_endian) {
r_mem_swapendian ((ut8*)&b, &b, bytes);
r_mem_swapendian ((ut8*)&b, (const ut8*)&b, bytes);
}
snprintf (res, sizeof (res), "0x%" PFMT64x, b & bitmask);
r_anal_esil_push (esil, res);
Expand Down
2 changes: 0 additions & 2 deletions libr/asm/p/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include ../../../mk/platform.mk

CFLAGS+=-I$(TOP)/shlr -I../../include -I../arch/ -I../arch/include
CFLAGS+=-Wall -shared ${PIC_CFLAGS} ${LDFLAGS_LIB} ${LDFLAGS_LINKPATH}..
# XXX
CFLAGS+=-DLIL_ENDIAN=1
LDFLAGS+=-L../../util -L../../lib
LDFLAGS+=${LINK} -lr_util

Expand Down
2 changes: 1 addition & 1 deletion libr/bp/p/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include ../../../mk/platform.mk
ifeq ($(WITHPIC),1)

CFLAGS+=-I../../include -I../arch/ -I../arch/include -Wall ${PIC_CFLAGS} ${LDFLAGS_LIB}
CFLAGS+=-DLIL_ENDIAN=1 -D__UNIX__
CFLAGS+=-D__UNIX__

foo: all

Expand Down
2 changes: 1 addition & 1 deletion libr/core/cmd_help.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static int cmd_help(void *data, const char *input) {
else r_cons_printf ("%s aka %s commit %d\n", R2_VERSION, R2_GITTAP, R2_VERSION_COMMIT);
}
if (input[1] == 'j' && !input[2]){
r_cons_printf ("{\"system\":\"%s-%s-%s\"", R_SYS_OS, R_SYS_ENDIAN, R_SYS_ARCH);
r_cons_printf ("{\"system\":\"%s-%s\"", R_SYS_OS, R_SYS_ARCH);
r_cons_printf (",\"version\":\"%s\"}\n", R2_VERSION);
}
break;
Expand Down
2 changes: 0 additions & 2 deletions libr/core/p/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include ../../../mk/platform.mk
include ../../../shlr/zip/deps.mk

CFLAGS+=-I../../include -Wall -shared ${PIC_CFLAGS} ${LDFLAGS_LIB} ${LDFLAGS_LINKPATH}..
# XXX
CFLAGS+=-DLIL_ENDIAN=1
CFLAGS+=-L../../util -lr_util -L../../reg -lr_reg -L.. -lr_core
CFLAGS+=-L../../db -lr_db -L../../cons -lr_cons -L../../bin -lr_bin
CFLAGS+=-L../../parse -lr_parse -L../../io -lr_io -L../../fs -lr_fs
Expand Down
7 changes: 0 additions & 7 deletions libr/include/r_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,6 @@ enum {
#define R_SYS_OS "unknown"
#endif

/* endian */
#if LIL_ENDIAN
#define R_SYS_ENDIAN "little"
#else
#define R_SYS_ENDIAN "big"
#endif

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 0 additions & 6 deletions libr/include/r_userconf.h.acr
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

#include "r_version.h"

#ifdef LIL_ENDIAN
#undef LIL_ENDIAN
#endif
#define LIL_ENDIAN @LIL_ENDIAN@
#define CPU_ENDIAN @BIG_ENDIAN@

#define DEBUGGER @DEBUGGER@

#if __WIN32__ || __CYGWIN__ || MINGW32
Expand Down
2 changes: 0 additions & 2 deletions libr/parse/p/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include ../../../mk/platform.mk
include ../../util/deps.mk

CFLAGS+=-I../../include -Wall ${PIC_CFLAGS} ${LDFLAGS_LIB} ${LDFLAGS_LINKPATH}..
# XXX
CFLAGS+=-DLIL_ENDIAN=1
# -D__UNIX__
CFLAGS+=-DCORELIB
LDFLAGS+=${LINK}
Expand Down
2 changes: 1 addition & 1 deletion libr/syscall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ NAME=r_syscall
DEPS=r_util r_db

OBJS=syscall.o ioports.o
CFLAGS+=-DLIL_ENDIAN=1 -D__UNIX__ -Wall
CFLAGS+=-D__UNIX__ -Wall

EXTRA_TARGETS+=do
EXTRA_CLEAN=doclean
Expand Down

0 comments on commit 632dccc

Please sign in to comment.