Upstream patches from pkgsrc/devel/radare2 (#6491)

* Upstream patches from pkgsrc/devel/radare2
Switch to using egrep instead of non-portable "grep -e".
Add support for SunOS.

* Add support for SunOS.

* FIONREAD is defined in sys/filio.h on SunOS.

* Ask find(1) to look for files with desired extension rather than searching for
all files & fishing out the desired extension in the pipeline, with grep.
This commit is contained in:
Sevan Janiyan 2017-01-17 23:47:46 +00:00 committed by radare
parent 286ca4d0ed
commit 0e4b401635
7 changed files with 24 additions and 8 deletions

5
configure vendored
View File

@ -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

@ -106,6 +106,9 @@ IFEQ USEROSTYPE auto ; {
HAVE_LIB_DL = 1 ;
DL_LIBS = -ldl ;
}{
IFEQ HOST_OS sunos ; {
USEROSTYPE = solaris ;
}{
IFEQ HOST_OS gnu/kfreebsd ; {
USEROSTYPE = bsd ;
}{
@ -120,7 +123,7 @@ IFEQ USEROSTYPE auto ; {
}{
IFEQ HOST_OS darwin ; {
USEROSTYPE = darwin ;
} } } } } } } } }
} } } } } } } } } }
}
ARG_WITHOUT WITHPIC pic do not build libr as a program independent location ;

View File

@ -151,15 +151,15 @@ install: install-includes install-pkgconfig
# 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 -iname "*.${EXT_SO}" | grep -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 -iname "*.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

@ -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

@ -24,7 +24,7 @@ static void r_debug_native_stop(RDebug *dbg);
#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

@ -73,7 +73,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

@ -37,6 +37,9 @@
#include <signal.h>
#include <grp.h>
#include <errno.h>
#if defined(__sun)
#include <sys/filio.h>
#endif
#if __linux__ && !__ANDROID__
#include <sys/personality.h>
#include <pty.h>
@ -47,7 +50,7 @@
#endif
#endif
#define HAVE_PTY __UNIX__ && !__ANDROID__ && LIBC_HAVE_FORK
#define HAVE_PTY __UNIX__ && !__ANDROID__ && LIBC_HAVE_FORK && !defined(__sun)
R_API RRunProfile *r_run_new(const char *str) {
RRunProfile *p = R_NEW (RRunProfile);