Add support for SunOS.

This commit is contained in:
jperkin 2016-09-16 14:46:25 +00:00
parent f4cce41621
commit 3d9f28ff9d
9 changed files with 132 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 2016/06/13 12:26:11 wiz Exp $
# $NetBSD: Makefile,v 1.8 2016/09/16 14:46:25 jperkin Exp $
.include "Makefile.common"
@ -16,7 +16,7 @@ CONFIGURE_ARGS+= --with-sysmagic
CONFIGURE_ARGS+= --with-syscapstone
CONFIGURE_ARGS+= --with-syszip
PKGCONFIG_OVERRIDE+= pkgcfg/*.pc*
USE_TOOLS+= gmake pkg-config
USE_TOOLS+= gmake patch pkg-config
# node
CHECK_INTERPRETER_SKIP+= share/radare2/${RADARE2_VERSION}/www/m/fonts/iconjar-map.js

View file

@ -0,0 +1,8 @@
@comment $NetBSD: PLIST.SunOS,v 1.1 2016/09/16 14:46:25 jperkin Exp $
lib/radare2/${PKGVERSION}/asm_RISCV.so
lib/radare2/${PKGVERSION}/asm_cris.so
lib/radare2/${PKGVERSION}/asm_mips.so
lib/radare2/${PKGVERSION}/asm_ppc.so
lib/radare2/${PKGVERSION}/asm_x86.so
lib/radare2/${PKGVERSION}/asm_z80-cr.so
lib/radare2/${PKGVERSION}/lib.so

View file

@ -1,6 +1,12 @@
$NetBSD: distinfo,v 1.5 2016/06/13 12:26:11 wiz Exp $
$NetBSD: distinfo,v 1.6 2016/09/16 14:46:25 jperkin Exp $
SHA1 (radare2-0.10.3.tar.xz) = c8e0ac38725e4ace2c594f2ff5208fd8ad3a85ee
RMD160 (radare2-0.10.3.tar.xz) = 047bb1d183c8c10498d0fc3b586f46334d583903
SHA512 (radare2-0.10.3.tar.xz) = c6cd195b755de8343b584a8d6f28ce1f7afb55f3c4de87d5a9ea5b4c6266b27a96f2546f070d567e142128386b81335462cac829fc765429ce5b1216d8eac736
Size (radare2-0.10.3.tar.xz) = 4954408 bytes
SHA1 (patch-configure) = 5877c20ef721cbf4e86b03fc001eedf1e6851fc8
SHA1 (patch-libr_Makefile) = b91596043e39f181f5cddfacda6f4647400eae0e
SHA1 (patch-libr_config.mk.tail) = 0b547d49839acaed3547c57b2e0db2342d24f9b0
SHA1 (patch-libr_debug_p_debug__native.c) = ada49491a8aa0cdb9a14c61795db011d75858cf7
SHA1 (patch-libr_include_r__types.h) = 49feee975d6cb728b745385777ff0d39c31654e3
SHA1 (patch-libr_socket_run.c) = b756feff8732e8454f3e6083db23f34e46666d93

View file

@ -0,0 +1,25 @@
$NetBSD: patch-configure,v 1.3 2016/09/16 14:46:25 jperkin Exp $
Support SunOS.
--- configure.orig 2016-05-24 23:34:34.000000000 +0000
+++ configure
@@ -488,6 +488,9 @@ 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
@@ -501,7 +504,7 @@ if [ "$HOST_OS" = "openbsd" ]; then
USEROSTYPE="bsd"
else
if [ "$HOST_OS" = "darwin" ]; then
-USEROSTYPE="darwin"; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi
+USEROSTYPE="darwin"; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi
if [ "$LIBVERSION" = "xxx" ]; then
LIBVERSION="$VERSION"; fi
SEDFLAGS=" -e '"

View file

@ -0,0 +1,25 @@
$NetBSD: patch-libr_Makefile,v 1.1 2016/09/16 14:46:25 jperkin Exp $
Use egrep instead of non-portable "grep -e".
--- libr/Makefile.orig 2016-05-24 23:34:34.000000000 +0000
+++ libr/Makefile
@@ -138,15 +138,15 @@ install: install-includes install-pkgcon
# TODO :Use INSTALL_DATA_DIR instead of mkdir
# libraries
@${INSTALL_DIR} "${DESTDIR}${LIBDIR}"
- @$(foreach lib,$(shell find * -type f | grep -e '\.${EXT_SO}$$' | grep -Ev '(lib|parse)/t/' | grep lib | grep -v /bin/ | grep -v /p/), \
+ @$(foreach lib,$(shell find * -type f | egrep '\.${EXT_SO}$$' | egrep -v '(lib|parse)/t/' | grep lib | grep -v /bin/ | grep -v /p/), \
echo " ${DESTDIR}${LIBDIR}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \
rm -f "${DESTDIR}${LIBDIR}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \
${INSTALL_LIB} "$(lib)" "${DESTDIR}${LIBDIR}/$(call libpath-to-name-version,$(lib),${LIBVERSION})"; \
( cd "${DESTDIR}${LIBDIR}" ; ln -fs "$(call libpath-to-name-version,$(lib),${LIBVERSION})" "$(call libpath-to-name,$(lib))" ) ; \
)
# object archives
- @for FILE in `find * -type f | grep -e '\.a$$' | grep -v fs/p` ; do \
- echo " ${DESTDIR}${LIBDIR}/$$FILE"; ${INSTALL_DATA} $$FILE "${DESTDIR}${LIBDIR}" ; done
+ @for FILE in `find * -type f | egrep '\.a$$' | grep -v fs/p` ; do \
+ echo " ${DESTDIR}${LIBDIR}/$$FILE"; ${INSTALL_DATA} $$FILE "${DESTDIR}${LIBDIR}" ; done || true
# plugins
@${INSTALL_DIR} "${DESTDIR}${LIBDIR}/radare2/${VERSION}"
@for FILE in `find */p -perm -u+x -type f | grep -v exe | grep -v dll | grep ${EXT_SO}`; \

View file

@ -0,0 +1,20 @@
$NetBSD: patch-libr_config.mk.tail,v 1.3 2016/09/16 14:46:25 jperkin Exp $
Support SunOS.
--- libr/config.mk.tail.orig 2016-05-24 23:34:34.000000000 +0000
+++ libr/config.mk.tail
@@ -181,6 +181,13 @@ EXT_SO=so
EXT_EXE=
TH_LIBS=
endif
+ifeq (${OSTYPE},solaris)
+CFLAGS+=-D__UNIX__=1
+EXT_AR=a
+EXT_SO=so
+EXT_EXE=
+TH_LIBS=
+endif
ifeq (${EXT_SO},)
main:

View file

@ -0,0 +1,15 @@
$NetBSD: patch-libr_debug_p_debug__native.c,v 1.1 2016/09/16 14:46:25 jperkin Exp $
Support SunOS.
--- libr/debug/p/debug_native.c.orig 2016-05-24 23:34:34.000000000 +0000
+++ libr/debug/p/debug_native.c
@@ -22,7 +22,7 @@ static int r_debug_native_reg_write (RDe
#if __UNIX__ || __CYGWIN__
# include <errno.h>
-# if !defined (__HAIKU__) && !defined (__CYGWIN__)
+# if !defined (__HAIKU__) && !defined (__CYGWIN__) && !defined (__sun)
# include <sys/ptrace.h>
# endif
# include <sys/wait.h>

View file

@ -0,0 +1,15 @@
$NetBSD: patch-libr_include_r__types.h,v 1.1 2016/09/16 14:46:25 jperkin Exp $
Support SunOS.
--- libr/include/r_types.h.orig 2016-05-24 23:34:34.000000000 +0000
+++ libr/include/r_types.h
@@ -50,7 +50,7 @@
#define MINGW32 1
#endif
-#if defined(EMSCRIPTEN) || defined(__linux__) || defined(__APPLE__) || defined(__GNU__) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(EMSCRIPTEN) || defined(__linux__) || defined(__APPLE__) || defined(__GNU__) || defined(__ANDROID__) || defined(__QNX__) || defined(__sun)
#define __BSD__ 0
#define __UNIX__ 1
#endif

View file

@ -0,0 +1,15 @@
$NetBSD: patch-libr_socket_run.c,v 1.1 2016/09/16 14:46:25 jperkin Exp $
Support SunOS.
--- libr/socket/run.c.orig 2016-05-24 23:34:34.000000000 +0000
+++ libr/socket/run.c
@@ -211,7 +211,7 @@ static void setASLR(int enabled) {
}
static int handle_redirection_proc (const char *cmd, bool in, bool out, bool err) {
-#if __UNIX__ && !__ANDROID__ && LIBC_HAVE_FORK
+#if __UNIX__ && !__ANDROID__ && LIBC_HAVE_FORK && !defined(__sun)
// use PTY to redirect I/O because pipes can be problematic in
// case of interactive programs.
int fdm;