connman: fix basename on musl

musl provides a compatibility basename declaration so applications
expecting GNU basename could still compile even though musl doesn't provide
GNU basename and only POSIX basename.
This commit is contained in:
oreo639 2024-01-26 03:12:05 -08:00
parent 660e6ccff8
commit d0320dcec6
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,16 @@
Add GNU basename macro for code that expects GNU basename
diff -rup src/log.c.orig src/log.c
--- a/src/log.c
+++ b/src/log.c
@@ -34,6 +34,10 @@
#include "connman.h"
+#if !defined(__GLIBC__)
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
static const char *program_exec;
static const char *program_path;

View File

@ -1,7 +1,7 @@
# Template file for 'connman' # Template file for 'connman'
pkgname=connman pkgname=connman
version=1.42 version=1.42
revision=2 revision=3
build_style=gnu-configure build_style=gnu-configure
configure_args="--enable-polkit --enable-client --enable-pie --enable-ethernet configure_args="--enable-polkit --enable-client --enable-pie --enable-ethernet
--enable-wifi --enable-bluetooth --enable-loopback --enable-nmcompat --enable-wifi --enable-bluetooth --enable-loopback --enable-nmcompat