Initial implementation of --without-gpl

This commit is contained in:
pancake 2015-02-07 01:41:54 +01:00
parent b21226b5f4
commit 098d0ec1de
11 changed files with 299 additions and 135 deletions

View file

@ -132,9 +132,9 @@ If you notice any misfeature, issue, error, problem or you just
don't know how to do something which is supposed to be covered
by this framework.
You should report it in our web page in the 'bugs' section.
You should report it into the github issues page.
http://www.radare.org/
https://github.com/radare/radare2/issues
Otherwise, if you are looking for some more feedback I will
encourage you to send an email to any of the emails enumerated
@ -144,6 +144,11 @@ Anyway, if you want to get even more feedback and discuss this
in a public place we have a mailing list where many other
people may help in order to find a solution.
The issues page of Github contains a list of all the bugs that
have been reported classified with labels by difficulty, type,
milestone, etc. it is a good place to start if you are looking
to contribute.
CONTRIBUTING WITH PATCHES
-------------------------
All the development happens in the git repository. It is

View file

@ -1,6 +1,7 @@
# This file should be generated by the ./configure script
DESTDIR=
CC=@CC@
WITH_GPL=@WITH_GPL@
#HOST_CC=@HOST_CC@
PREFIX=@PREFIX@
BINDIR=@BINDIR@

7
configure vendored
View file

@ -22,6 +22,7 @@ DEBUGGER=1
USE_MAGIC=0
USE_CAPSTONE=0
USE_ZIP=0
WITH_GPL=1
WANT_OPENSSL=0
USE_RPATH=0
HAVE_LILEND=0
@ -165,6 +166,7 @@ Optional Features:
--with-sysmagic force to use system's magic
--with-syscapstone force to use system-wide capstone
--with-syszip force to use system's libzip and zlib
--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
@ -229,7 +231,7 @@ echo "LANGS: c"
echo "REQUIRED: libdl"
echo "OPTIONAL: libmagic"
echo "PKG-CONFIG: capstone openssl"
echo "FLAGS: --enable-cparse --disable-debugger --with-sysmagic --with-syscapstone --with-syszip --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: --enable-cparse --disable-debugger --with-sysmagic --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"
exit 0
;;
--cache-file)
@ -278,6 +280,7 @@ echo "FLAGS: --enable-cparse --disable-debugger --with-sysmagic --with-sysca
"--with-sysmagic") USE_MAGIC="1"; ;;
"--with-syscapstone") USE_CAPSTONE="1"; ;;
"--with-syszip") USE_ZIP="1"; ;;
"--without-gpl") WITH_GPL="0"; ;;
"--with-openssl") WANT_OPENSSL="1"; ;;
"--with-rpath") USE_RPATH="1"; ;;
"--with-little-endian") HAVE_LILEND="1"; ;;
@ -304,7 +307,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 CPARSE DEBUGGER HAVE_LIB_DL DL_LIBS LIL_ENDIAN BIG_ENDIAN BYTEORDER HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC USE_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP 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 CPARSE DEBUGGER HAVE_LIB_DL DL_LIBS LIL_ENDIAN BIG_ENDIAN BYTEORDER HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC USE_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_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"
create_environ

View file

@ -29,8 +29,8 @@ load () {
echo "configure-plugins: Loading $cfg .."
. $cfg
else
echo "configure-plugins: Loading plugins.def.cfg .."
. ./plugins.def.cfg
echo "configure-plugins: Loading $1 .."
. "$1" #plugins.def.cfg
fi
}
@ -154,15 +154,17 @@ make_shared () {
make_ () { : ; }
load
MODE=""
DONOTHING=0
DEFCFG=./plugins.def.cfg
while : ; do
[ -z "$1" ] && break
case "$1" in
"--static") MODE=static ; ;;
"--shared") MODE=shared ; ;;
"--without-gpl") DEFCFG=./plugins.nogpl.cfg ;;
"--list") sort_vars ; list ; ;;
"-n") DONOTHING=1 ; ;;
"-h"|"--help") help ; ;;
@ -171,6 +173,7 @@ while : ; do
shift
done
load ${DEFCFG}
sort_vars
[ ${DONOTHING} = 0 ] && generate

View file

@ -45,6 +45,8 @@ IFAND HAVE_LIB_Z USE_ZIP {
LIBZIP = -lrz ; (( static linking to shlr/zip ))
}
ARG_WITHOUT WITH_GPL gpl do not build GPL code (grub, cxx, ... ) ;
(( TODO must deprecate
CHKLIB gmp
ARG_WITHOUT HAVE_GMP gmp disable GMP dependency ;

View file

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2011-2014 - pancake */
/* radare - LGPL - Copyright 2011-2015 - pancake */
#include <r_bin.h>
#include <cxx/demangle.h>
@ -80,7 +80,10 @@ R_API char *r_bin_demangle_cxx(const char *str) {
char *out;
// DMGL_TYPES | DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE
// | DMGL_RET_POSTFIX | DMGL_TYPES;
int i, flags = DMGL_NO_OPTS;
int i;
#if WITH_GPL
int flags = DMGL_NO_OPTS;
#endif
const char *prefixes[] = {
"__symbol_stub1_",
"reloc.",
@ -99,7 +102,12 @@ R_API char *r_bin_demangle_cxx(const char *str) {
}
}
}
#if WITH_GPL
out = cplus_demangle_v3 (str, flags);
#else
/* TODO: implement a non-gpl alternative to c++v3 demangler */
out = NULL;
#endif
if (out) {
r_str_replace_char (out, ' ', 0);

View file

@ -6,9 +6,11 @@
#include <errno.h>
#include "../../shlr/grub/include/grub/msdos_partition.h"
#if WITH_GPL
#ifndef USE_GRUB
#define USE_GRUB 1
#endif
#endif
R_LIB_VERSION(r_fs);
@ -459,11 +461,10 @@ R_API RList *r_fs_partitions (RFS *fs, const char *ptype, ut64 delta) {
}
}
if (cur != -1) {
void *disk = NULL;
RList *list = r_list_new ();
list->free = (RListFree)r_fs_partition_free;
if (partitions[i].iterate == (void*)&grub_parhook) {
RList *list = r_list_newf ((RListFree)r_fs_partition_free);
#if USE_GRUB
void *disk = NULL;
if (partitions[i].iterate == (void*)&grub_parhook) {
struct grub_partition_map *gpt = partitions[i].ptr;
grubfs_bind_io (NULL, 0);
disk = (void*)grubfs_disk (&fs->iob);
@ -472,8 +473,10 @@ R_API RList *r_fs_partitions (RFS *fs, const char *ptype, ut64 delta) {
(void*)partitions[i].iterate, list);
}
grubfs_free (disk);
#endif
} else {
#else
{
#endif
RFSPartitionIterator iterate = partitions[i].ptr;
iterate (fs, partitions[i].iterate, list); //grub_parhook, list);
}

View file

@ -33,6 +33,8 @@
#define HAVE_LIB_EWF @HAVE_LIB_EWF@
#endif
#define WITH_GPL @WITH_GPL@
#define R2_WWWROOT "@DATADIR@/radare2/@VERSION@/www"
#endif

View file

@ -1,177 +1,165 @@
# fs.udf
# fs.iso9660
# fs.hfsplus
# fs.hfs
# fs.jfs
# do not build : asm.x86_as
# do not build : asm.x86_nasm
# MIPS="asm.mips_gnu anal.mips_gnu"
# MIPS_CS="asm.mips_cs anal.mips_cs"
STATIC="
asm.java
asm.bf
STATIC="anal.8051
anal.arc
anal.arm_cs
anal.arm_gnu
anal.avr
anal.bf
anal.cr16
anal.cris
anal.csr
anal.dalvik
anal.ebc
anal.gb
anal.h8300
anal.i8080
anal.java
anal.m68k
anal.malbolge
anal.mips_cs
anal.mips_gnu
anal.msp430
anal.nios2
anal.null
anal.ppc_cs
anal.ppc_gnu
anal.sh
anal.sparc_cs
anal.sparc_gnu
anal.sysz
anal.tms320
anal.v850
anal.ws
anal.x86_cs
anal.x86_udis
anal.xcore_cs
anal.z80
asm.8051
asm.arc
asm.arm_gnu
asm.arm_cs
asm.arm_gnu
asm.arm_winedbg
asm.sh
asm.csr
asm.cris_gnu
asm.avr
asm.bf
asm.cr16
asm.cris_gnu
asm.csr
asm.dalvik
asm.sysz
asm.sparc_gnu
asm.sparc_cs
asm.ppc_gnu
asm.ppc_cs
asm.nios2
asm.dcpu16
asm.ebc
asm.gb
asm.h8300
asm.i4004
asm.i8080
asm.java
asm.m68k
asm.mips_gnu
asm.malbolge
asm.mips_cs
asm.mips_gnu
asm.msil
asm.msp430
asm.nios2
asm.ppc_cs
asm.ppc_gnu
asm.rar
asm.x86_udis
asm.x86_olly
asm.x86_nz
asm.x86_new
asm.sh
asm.sparc_cs
asm.sparc_gnu
asm.spc700
asm.sysz
asm.tms320
asm.v850
asm.ws
asm.x86_cs
asm.x86_new
asm.x86_nz
asm.x86_olly
asm.x86_udis
asm.xcore_cs
asm.z80
asm.z80_cr
asm.i8080
asm.i4004
asm.8051
asm.msil
asm.tms320
asm.gb
asm.ebc
asm.h8300
asm.malbolge
asm.ws
asm.cr16
asm.v850
asm.spc700
anal.null
anal.sh
anal.x86_cs
anal.x86_udis
anal.z80
anal.8051
anal.i8080
anal.arm_gnu
anal.arm_cs
anal.arc
anal.bf
anal.mips_gnu
anal.mips_cs
anal.cris
anal.java
anal.dalvik
anal.csr
anal.nios2
anal.tms320
anal.avr
anal.m68k
anal.ppc_gnu
anal.ppc_cs
anal.sysz
anal.sparc_gnu
anal.sparc_cs
anal.ebc
anal.gb
anal.malbolge
anal.ws
anal.h8300
anal.cr16
anal.v850
anal.xcore_cs
anal.msp430
bin.any
bin.bios
bin.bf
bin.fs
bin.bios
bin.coff
bin.dex
bin.elf
bin.elf64
bin.fs
bin.java
bin.dex
bin.p9
bin.rar
bin.pe
bin.pebble
bin.mz
bin.pe64
bin.te
bin.coff
bin.mach0
bin.mach064
bin.mz
bin.ninds
bin.ningb
bin.ningba
bin.ninds
bin.p9
bin.pe
bin.pe64
bin.pebble
bin.rar
bin.te
bin.xbe
bin_xtr.fatmach0
bin_xtr.dyldcache
bin_xtr.fatmach0
bp.arm
bp.bf
bp.x86
bp.mips
bp.ppc
bp.x86
core.anal
core.java
crypto.aes
debug.native
debug.bf
debug.esil
debug.gdb
debug.native
debug.rap
debug.bf
debug.wind
egg.exec
egg.xor
fs.fat
fs.ntfs
fs.cpio
fs.ext2
fs.fat
fs.fb
fs.hfs
fs.hfsplus
fs.reiserfs
fs.tar
fs.cpio
fs.xfs
fs.iso9660
fs.udf
fs.ufs
fs.posix
fs.jfs
fs.minix
fs.fb
fs.ntfs
fs.posix
fs.reiserfs
fs.sfs
fs.tar
fs.udf
fs.ufs
fs.xfs
io.bfdbg
io.debug
io.rap
io.default
io.gdb
io.gzip
io.http
io.bfdbg
io.gdb
io.mmap
io.default
io.self
io.ihex
io.mach
io.malloc
io.mmap
io.procpid
io.ptrace
io.rap
io.self
io.shm
io.w32
io.w32dbg
io.malloc
io.ihex
io.ptrace
io.procpid
io.shm
io.zip
io.windbg
io.zip
lang.vala
parse.mreplace
parse.arm_pseudo
parse.att2intel
parse.mips_pseudo
parse.dalvik_pseudo
parse.x86_pseudo
parse.arm_pseudo"
SHARED="
parse.mips_pseudo
parse.mreplace
parse.x86_pseudo"
SHARED="asm.6502
asm.snes
asm.6502
io.shm"

146
plugins.nogpl.cfg Normal file
View file

@ -0,0 +1,146 @@
STATIC="anal.8051
anal.arc
anal.arm_cs
anal.bf
anal.cr16
anal.csr
anal.dalvik
anal.ebc
anal.gb
anal.h8300
anal.i8080
anal.java
anal.m68k
anal.malbolge
anal.mips_cs
anal.msp430
anal.null
anal.ppc_cs
anal.sparc_cs
anal.sysz
anal.tms320
anal.v850
anal.ws
anal.x86_cs
anal.x86_udis
anal.xcore_cs
anal.z80
asm.8051
asm.arm_cs
asm.arm_winedbg
asm.bf
asm.cr16
asm.csr
asm.dalvik
asm.dcpu16
asm.ebc
asm.gb
asm.h8300
asm.i4004
asm.i8080
asm.java
asm.m68k
asm.malbolge
asm.mips_cs
asm.msil
asm.msp430
asm.ppc_cs
asm.rar
asm.sparc_cs
asm.spc700
asm.sysz
asm.tms320
asm.v850
asm.ws
asm.x86_cs
asm.x86_new
asm.x86_nz
asm.x86_udis
asm.xcore_cs
asm.z80_cr
bin.any
bin.bf
bin.bios
bin.coff
bin.dex
bin.elf
bin.elf64
bin.fs
bin.java
bin.mach0
bin.mach064
bin.mz
bin.ninds
bin.ningb
bin.ningba
bin.p9
bin.pe
bin.pe64
bin.pebble
bin.rar
bin.te
bin.xbe
bin_xtr.dyldcache
bin_xtr.fatmach0
bp.arm
bp.bf
bp.mips
bp.ppc
bp.x86
core.anal
core.java
crypto.aes
debug.bf
debug.esil
debug.gdb
debug.native
debug.rap
debug.wind
egg.exec
egg.xor
fs.cpio
fs.ext2
fs.fat
fs.fb
fs.hfs
fs.hfsplus
fs.iso9660
fs.jfs
fs.minix
fs.ntfs
fs.posix
fs.reiserfs
fs.sfs
fs.tar
fs.udf
fs.ufs
fs.xfs
io.bfdbg
io.debug
io.default
io.gdb
io.gzip
io.http
io.ihex
io.mach
io.malloc
io.mmap
io.procpid
io.ptrace
io.rap
io.self
io.shm
io.w32
io.w32dbg
io.windbg
io.zip
lang.vala
parse.arm_pseudo
parse.att2intel
parse.dalvik_pseudo
parse.mips_pseudo
parse.mreplace
parse.x86_pseudo"
SHARED="asm.6502
asm.snes
io.shm"

View file

@ -16,7 +16,10 @@ HOST_CC?=gcc
SHLR?=$(shell pwd)
AR?=ar
RANLIB?=ranlib
MODS=sdb udis86 java tcc zip grub
MODS=sdb udis86 java tcc zip
ifeq (1,$(WITH_GPL))
MODS+=grub
endif
SDB_URL=git://github.com/radare/sdb
#SDB_URL=/Users/pancake/prg/sdb
PWD=$(shell pwd)