diff --git a/Makefile.am b/Makefile.am index 05cb453..1b6385d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,4 +18,4 @@ rkdeveloptool_SOURCES = main.cpp \ rkdeveloptool_LDADD = $(LIBUSB1_LIBS) clean-local:: - $(RM) -fr log + rm -fr log diff --git a/configure.ac b/configure.ac index 03d3007..16f6f9c 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,18 @@ AC_PROG_MAKE_SET AC_PROG_INSTALL 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) AC_CONFIG_FILES([Makefile]) diff --git a/main.cpp b/main.cpp index 477e9be..fea5b7f 100644 --- a/main.cpp +++ b/main.cpp @@ -832,7 +832,7 @@ int MakeIDBlockData(PBYTE pDDR, PBYTE pLoader, PBYTE lpIDBlock, USHORT usFlashDa 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; else { @@ -1157,7 +1157,7 @@ static bool parseOpts(void) { file = fopen(configPath, "r"); if (!file) { 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"); if (file) { fprintf(stderr, "creating defconfig\n");