--- autogen.sh.orig	2004-07-26 18:21:27.000000000 +0800
+++ autogen.sh	2023-04-25 00:33:13.000000000 +0800
@@ -14,7 +14,7 @@
     exit 1
 }
 
-echo "Running libtoolize --copy --force --ltdl"
-libtoolize --copy --force --ltdl
+echo "Running glibtoolize --copy --force --ltdl"
+glibtoolize --copy --force --ltdl
 NOCONFIGURE=1
 . $srcdir/macros/autogen.sh


--- configure.in.orig	2004-07-26 18:21:28.000000000 +0800
+++ configure.in	2023-04-25 00:28:16.000000000 +0800
@@ -764,11 +764,11 @@
 if test "$ac_cv_coreservices" = "yes"; then
 	AC_DEFINE(HAVE_CORESERVICES, 1, [Define if you have Apple CoreServices (OSX)])
 	APPLELDADD="$APPLELDADD ../apple/libapple.a"
-	HXDLDFLAGS="$HXDLDFLAGS -framework coreservices"
-	HXLDFLAGS="$HXLDFLAGS -framework coreservices"
+	HXDLDFLAGS="$HXDLDFLAGS -framework CoreServices"
+	HXLDFLAGS="$HXLDFLAGS -framework CoreServices"
 fi
 
-AC_CHECK_FUNC(strlcpy, , aclo_strlcpy=yes;
+AC_CHECK_FUNC(strlcpy, AC_DEFINE(HAVE_STRLCPY, 1, [strlcpy]), aclo_strlcpy=yes;
 		 HXDLIBLDADD="$HXDLIBLDADD ../lib/strlcpy.o";
 		 HXTRACKDLIBLDADD="$HXTRACKDLIBLDADD ../lib/strlcpy.o";
 		 HXLIBLDADD="$HXLIBLDADD ../lib/strlcpy.o")


--- src/hxd/htxf.c.orig	2004-07-26 18:21:28.000000000 +0800
+++ src/hxd/htxf.c	2023-04-25 00:24:38.000000000 +0800
@@ -38,6 +38,11 @@
 #define t_watch_delete(x) watch_delete(x)
 #endif
 
+#if defined(HAVE_CORESERVICES)
+#include "apple/alias.h"
+#include "apple/files.h"
+#endif
+
 static inline struct watch *
 watch_new (void)
 {

--- src/common/hfs.c.orig	2004-07-26 18:21:27.000000000 +0800
+++ src/common/hfs.c	2023-05-26 08:27:21.000000000 +0800
@@ -1,4 +1,3 @@
-#include "hfs.h"
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
@@ -11,6 +10,7 @@
 #include "apple/alias.h"
 #include "apple/files.h"
 #endif
+#include "hfs.h"
 
 #define DIRCHAR			'/'
 #define UNKNOWN_TYPECREA	"TEXTR*ch"

--- src/hxd/files.c.orig	2004-07-26 18:21:28.000000000 +0800
+++ src/hxd/files.c	2023-05-26 08:45:39.000000000 +0800
@@ -10,7 +10,6 @@
 #include "sys_net.h"
 #include <errno.h>
 #include <fcntl.h>
-#include "hlserver.h"
 #include "xmalloc.h"
 
 #if defined(HAVE_CORESERVICES)
@@ -18,6 +17,8 @@
 #include "apple/files.h"
 #endif
 
+#include "hlserver.h"
+
 #if defined(CONFIG_ICONV)
 #include "conv.h"
 #endif

--- src/hxd/htxf.c.orig	2004-07-26 18:21:28.000000000 +0800
+++ src/hxd/htxf.c	2023-05-26 09:29:25.000000000 +0800
@@ -11,11 +11,15 @@
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
-#include "hlserver.h"
 #include "xmalloc.h"
+#if defined(HAVE_CORESERVICES)
+#include "apple/alias.h"
+#include "apple/files.h"
+#endif
 #if defined(CONFIG_HFS)
 #include "hfs.h"
 #endif
+#include "hlserver.h"
 #include "threads.h"
 
 #define HTXF_BUFSIZE		0xf000

--- src/hx/files.c.orig	2006-09-20 22:49:47.000000000 +0800
+++ src/hx/files.c	2023-05-26 09:24:52.000000000 +0800
@@ -1,5 +1,4 @@
 #include "hx.h"
-#include "hxd.h"
 #include "xmalloc.h"
 #include <string.h>
 #include <unistd.h>
@@ -8,6 +7,12 @@
 #include "sys_net.h"
 #include <sys/stat.h>
 #include <sys/types.h>
+
+#if defined(CONFIG_HFS)
+#include "hfs.h"
+#endif
+
+#include "hxd.h"
 #if !defined(__WIN32__)
 #include <sys/wait.h>
 #include <signal.h>
@@ -23,10 +28,6 @@
 #include "conv.h"
 #endif
 
-#if defined(CONFIG_HFS)
-#include "hfs.h"
-#endif
-
 #if defined(CONFIG_SOUND)
 #include "sound.h"
 #endif