From d3e8214a9c0c48714b565973a3350f68d5a9a2e6 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sat, 25 Jun 2022 23:37:08 +1000 Subject: Fix haiku build diff --git a/Makefile.am b/Makefile.am index 1516222..5790814 100644 --- a/Makefile.am +++ b/Makefile.am @@ -62,7 +62,7 @@ avrdude_CFLAGS = @ENABLE_WARNINGS@ libavrdude_a_CFLAGS = @ENABLE_WARNINGS@ libavrdude_la_CFLAGS = $(libavrdude_a_CFLAGS) -avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBHIDAPI@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ @LIBPTHREAD@ -lm +avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBHIDAPI@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ bin_PROGRAMS = avrdude diff --git a/configure.ac b/configure.ac index ae60e3f..f15fec0 100644 --- a/configure.ac +++ b/configure.ac @@ -97,6 +97,7 @@ AC_SUBST(LIBELF, $LIBELF) AC_SEARCH_LIBS([gethostent], [nsl]) AC_SEARCH_LIBS([setsockopt], [socket]) +AC_SEARCH_LIBS(socket, socket network) AH_TEMPLATE([HAVE_LIBUSB], [Define if USB support is enabled via libusb]) AC_CHECK_LIB([usb], [usb_get_string_simple], [have_libusb=yes]) @@ -210,11 +211,7 @@ else fi AC_CHECK_HEADERS([pthread.h]) # as there exits header file only pthread implementations for Windows, check if we have a library -AC_CHECK_LIB([pthread], [pthread_create], [have_pthread=yes]) -if test x$have_pthread = xyes; then - LIBPTHREAD="-lpthread" -fi -AC_SUBST(LIBPTHREAD, $LIBPTHREAD) +AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthread=yes]) # Checks for header files. AC_CHECK_HEADERS([limits.h stdlib.h string.h]) AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h]) -- 2.36.1 From eb2a94e767be8c27a76eef98ab26039ded052e28 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sat, 25 Jun 2022 23:46:10 +1000 Subject: Don't restore termios settings diff --git a/ser_posix.c b/ser_posix.c index 2c5d45b..2aeaad8 100644 --- a/ser_posix.c +++ b/ser_posix.c @@ -395,11 +395,13 @@ static void ser_close(union filedescriptor *fd) * restore original termios settings from ser_open */ if (saved_original_termios) { +#ifndef __HAIKU__ int rc = tcsetattr(fd->ifd, TCSANOW | TCSADRAIN, &original_termios); if (rc) { avrdude_message(MSG_INFO, "%s: ser_close(): can't reset attributes for device: %s\n", progname, strerror(errno)); } +#endif saved_original_termios = 0; } -- 2.36.1 From dc86bbd0a2a3727a92f69c8d66f39069ed6d1cbc Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 26 Jun 2022 16:11:21 +1000 Subject: Add stub function for getExecutablePath diff --git a/whereami.c b/whereami.c index 7bc2392..18479ca 100644 --- a/whereami.c +++ b/whereami.c @@ -785,6 +785,20 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) return length; } +#elif defined(__HAIKU__) + +WAI_FUNCSPEC +int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) +{ + return -1; +} + +WAI_NOINLINE WAI_FUNCSPEC +int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) +{ + return -1; +} + #else #error unsupported platform @@ -793,4 +807,4 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) #ifdef __cplusplus } -#endif \ No newline at end of file +#endif -- 2.36.1