Merge pull request #16 from kgoger/buildfixes

macos/openbsd fixes
This commit is contained in:
陈豪 | Jacob Chen 2017-11-28 15:42:20 +08:00 committed by GitHub
commit 5b7445d109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -18,4 +18,4 @@ rkdeveloptool_SOURCES = main.cpp \
rkdeveloptool_LDADD = $(LIBUSB1_LIBS) rkdeveloptool_LDADD = $(LIBUSB1_LIBS)
clean-local:: clean-local::
$(RM) -fr log rm -fr log

View File

@ -16,6 +16,18 @@ AC_PROG_MAKE_SET
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_CANONICAL_HOST
case "$host_os" in
openbsd*)
CPPFLAGS="$CFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
*)
;;
esac
AC_SEARCH_LIBS(iconv, iconv)
PKG_CHECK_MODULES(LIBUSB1,libusb-1.0) PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])

View File

@ -832,7 +832,7 @@ int MakeIDBlockData(PBYTE pDDR, PBYTE pLoader, PBYTE lpIDBlock, USHORT usFlashDa
bool check_device_type(STRUCT_RKDEVICE_DESC &dev, UINT uiSupportType) bool check_device_type(STRUCT_RKDEVICE_DESC &dev, UINT uiSupportType)
{ {
if ((dev.emUsbType & uiSupportType) == dev.emUsbType) if (((UINT)dev.emUsbType & uiSupportType) == (UINT)dev.emUsbType)
return true; return true;
else else
{ {
@ -1157,7 +1157,7 @@ static bool parseOpts(void) {
file = fopen(configPath, "r"); file = fopen(configPath, "r");
if (!file) { if (!file) {
fprintf(stderr, "config (%s) not found!\n", configPath); fprintf(stderr, "config (%s) not found!\n", configPath);
if (configPath == (char*)DEF_CONFIG_FILE) { if (strcmp(configPath, (char*)DEF_CONFIG_FILE) == 0) {
file = fopen(DEF_CONFIG_FILE, "w"); file = fopen(DEF_CONFIG_FILE, "w");
if (file) { if (file) {
fprintf(stderr, "creating defconfig\n"); fprintf(stderr, "creating defconfig\n");