From 05dd30c30d33e770002a353f09096aa5b55cf2fc Mon Sep 17 00:00:00 2001 From: Piloalucard Date: Wed, 17 Sep 2025 17:46:03 -0600 Subject: [PATCH 1/4] Updated build files to support macos with newer tools --- messages/make_message_src.sh | 19 ++++++++++++++++--- src/libltfs/ltfs.h | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/messages/make_message_src.sh b/messages/make_message_src.sh index 82488e81..950daa58 100755 --- a/messages/make_message_src.sh +++ b/messages/make_message_src.sh @@ -4,14 +4,27 @@ set -e KERNEL_NAME=`uname -s` if [ "$KERNEL_NAME" = "Darwin" ]; then - ICU_FRAMEWORK=/Library/Frameworks/ICU.framework + # Compilation with brew help + ICU_FRAMEWORK="$(brew --prefix icu4c)" + if [ -n "$ICU_FRAMEWORK" ]; then + export PATH=${PATH}:${ICU_FRAMEWORK}/bin + export DYLD_LIBRARY_PATH=${ICU_FRAMEWORK}/lib + export PKG_CONFIG_PATH="${ICU_FRAMEWORK}/lib/pkgconfig:$PKG_CONFIG_PATH" + GENRB=${ICU_FRAMEWORK}/bin/genrb + PKGDATA=${ICU_FRAMEWORK}/bin/pkgdata + ICUBREW_INSTALLED=true + else + ICUBREW_INSTALLED=false + ICU_FRAMEWORK=/Library/Frameworks/ICU.framework + fi - if [ -d ${ICU_FRAMEWORK} ]; then + # Old compilation + if [ "$ICUBREW_INSTALLED" = false ] && [ -d ${ICU_FRAMEWORK} ]; then export PATH=${PATH}:${ICU_FRAMEWORK}/Versions/Current/usr/bin export DYLD_LIBRARY_PATH=${ICU_FRAMEWORK}/Versions/Current/usr/lib GENRB=${ICU_FRAMEWORK}/Versions/Current/usr/bin/genrb PKGDATA=${ICU_FRAMEWORK}/Versions/Current/usr/bin/pkgdata - else + elif [ "$ICUBREW_INSTALLED" = false ]; then GENRB=genrb PKGDATA=pkgdata fi diff --git a/src/libltfs/ltfs.h b/src/libltfs/ltfs.h index cdbd9fe1..cb05bf26 100644 --- a/src/libltfs/ltfs.h +++ b/src/libltfs/ltfs.h @@ -94,7 +94,7 @@ extern "C" { #include #include - +#include "ltfs_fuse_version.h" #include "libltfs/arch/signal_internal.h" #include "libltfs/arch/arch_info.h" #include "libltfs/ltfs_error.h" @@ -161,7 +161,7 @@ struct device_data; #define LTFS_NO_BARCODE "NO_BARCODE" -#ifndef __APPLE_MAKEFILE__ +#ifndef __APPLE_CONFIG__ #include "config.h" #endif From 36ca147c676376cf527fc643cbdc2225e9e81484 Mon Sep 17 00:00:00 2001 From: Piloalucard Date: Thu, 6 Nov 2025 16:30:12 -0600 Subject: [PATCH 2/4] set deployment --- messages/make_message_src.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/messages/make_message_src.sh b/messages/make_message_src.sh index 950daa58..7bdf3c63 100755 --- a/messages/make_message_src.sh +++ b/messages/make_message_src.sh @@ -10,7 +10,9 @@ if [ "$KERNEL_NAME" = "Darwin" ]; then export PATH=${PATH}:${ICU_FRAMEWORK}/bin export DYLD_LIBRARY_PATH=${ICU_FRAMEWORK}/lib export PKG_CONFIG_PATH="${ICU_FRAMEWORK}/lib/pkgconfig:$PKG_CONFIG_PATH" - GENRB=${ICU_FRAMEWORK}/bin/genrb + export MACOSX_DEPLOYMENT_TARGET=14.8.1 + + GENRB=${ICU_FRAMEWORK}/bin/genrb PKGDATA=${ICU_FRAMEWORK}/bin/pkgdata ICUBREW_INSTALLED=true else From 6ae5b3afb12c57ef472b7ca4a675cb9f78d482b4 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Mon, 24 Nov 2025 13:58:05 -0800 Subject: [PATCH 3/4] Update readme for macos instructions --- README.md | 42 ++++++++++++++++++++++++------------ messages/make_message_src.sh | 5 ++--- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0fa2a247..d31a4125 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,13 @@ These instructions will get you a copy of the project up and running on your loc - OSX (macOS) + Following packages on homebrew * automake * autoconf * libtool - * osxfuse (brew cask install osxfuse) + * macfuse (brew install --cask macfuse) * ossp-uuid * libxml2 * icu4c @@ -219,7 +220,22 @@ For Ubuntu20.04 and Debian10, dummy `icu-config` is needed in the build machine. ### Build and install on OSX (macOS) -#### Recent Homedrew system setup +#### New Homebrew system setup + +Before build on macOS, you need to configure the environment like below. +``` +export MACOSX_DEPLOYMENT_TARGET={{MACOS_VERSION}} +``` +You can use as an example +``` +export MACOSX_DEPLOYMENT_TARGET=26.0 +# or +export MACOSX_DEPLOYMENT_TARGET=15.0 +# or +export MACOSX_DEPLOYMENT_TARGET=14.0 +``` + +#### Old Homebrew system setup Before build on macOS, you need to configure the environment like below. @@ -230,20 +246,15 @@ export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libxml export PATH="$PATH:$ICU_PATH:$LIBXML2_PATH" ``` -#### Old Homedrew system setup -Before build on OSX (macOS), some include path adjustment is required. - -``` -brew link --force icu4c -brew link --force libxml2 -``` #### Building LTFS -On OSX (macOS), snmp cannot be supported, you need to disable it on configure script. And may be, you need to specify LDFLAGS while running configure script to link some required frameworks, CoreFundation and IOKit. +On macOS, snmp cannot be supported, you need to disable it on configure script. And may be, you need to specify LDFLAGS while running configure script to link some required frameworks, CoreFundation and IOKit. ``` ./autogen.sh -LDFLAGS="-framework CoreFoundation -framework IOKit" ./configure --disable-snmp +CFLAGS="-D__APPLE_MAKEFILE__ -D__APPLE_CONFIG__" \ + LDFLAGS="-framework CoreFoundation -framework IOKit" \ + ./configure --disable-snmp make make install ``` @@ -252,9 +263,12 @@ make install #### Buildable systems - | OS | Xcode | Package system | Status | - |:-: |:-: |:-: |:-: | - | macOS 10.14.6 | 11.3 | Homebrew | Probably OK | +| OS | Xcode | Package system | Status | +|:-: |:-: |:-: |:-: | +| macOS 14 | 15.x | Homebrew | OK - Not checked automatically | +| macOS 15 | 16.x | Homebrew | OK - Not checked automatically | +| macOS 26 | 26.x | Homebrew | OK - Not checked automatically | + ### Build and install on FreeBSD diff --git a/messages/make_message_src.sh b/messages/make_message_src.sh index 7bdf3c63..06a90783 100755 --- a/messages/make_message_src.sh +++ b/messages/make_message_src.sh @@ -8,12 +8,11 @@ if [ "$KERNEL_NAME" = "Darwin" ]; then ICU_FRAMEWORK="$(brew --prefix icu4c)" if [ -n "$ICU_FRAMEWORK" ]; then export PATH=${PATH}:${ICU_FRAMEWORK}/bin - export DYLD_LIBRARY_PATH=${ICU_FRAMEWORK}/lib + export DYLD_LIBRARY_PATH=${ICU_FRAMEWORK}/lib export PKG_CONFIG_PATH="${ICU_FRAMEWORK}/lib/pkgconfig:$PKG_CONFIG_PATH" - export MACOSX_DEPLOYMENT_TARGET=14.8.1 GENRB=${ICU_FRAMEWORK}/bin/genrb - PKGDATA=${ICU_FRAMEWORK}/bin/pkgdata + PKGDATA=${ICU_FRAMEWORK}/bin/pkgdata ICUBREW_INSTALLED=true else ICUBREW_INSTALLED=false From a96ac4bd29447afbd296f45402ca0af5920b92e4 Mon Sep 17 00:00:00 2001 From: Gustavo Padilla Date: Mon, 24 Nov 2025 14:25:56 -0800 Subject: [PATCH 4/4] update readme again and tested --- README.md | 19 ++++++------------- messages/make_message_src.sh | 6 +----- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d31a4125..2e9f5c91 100644 --- a/README.md +++ b/README.md @@ -218,21 +218,16 @@ Currently, automatic build checking is working on GitHub Actions and Travis CI. For Ubuntu20.04 and Debian10, dummy `icu-config` is needed in the build machine. See Issue [#153](https://github.com/LinearTapeFileSystem/ltfs/issues/153). -### Build and install on OSX (macOS) +### Build and install on macOS #### New Homebrew system setup Before build on macOS, you need to configure the environment like below. ``` -export MACOSX_DEPLOYMENT_TARGET={{MACOS_VERSION}} -``` -You can use as an example -``` -export MACOSX_DEPLOYMENT_TARGET=26.0 -# or -export MACOSX_DEPLOYMENT_TARGET=15.0 -# or -export MACOSX_DEPLOYMENT_TARGET=14.0 +ICU_FRAMEWORK="$(brew --prefix icu4c)" +export PATH=${PATH}:${ICU_FRAMEWORK}/bin +export DYLD_LIBRARY_PATH=${ICU_FRAMEWORK}/lib +export PKG_CONFIG_PATH="${ICU_FRAMEWORK}/lib/pkgconfig:$PKG_CONFIG_PATH" ``` #### Old Homebrew system setup @@ -252,9 +247,7 @@ On macOS, snmp cannot be supported, you need to disable it on configure script. ``` ./autogen.sh -CFLAGS="-D__APPLE_MAKEFILE__ -D__APPLE_CONFIG__" \ - LDFLAGS="-framework CoreFoundation -framework IOKit" \ - ./configure --disable-snmp +LDFLAGS="-framework CoreFoundation -framework IOKit" ./configure --disable-snmp make make install ``` diff --git a/messages/make_message_src.sh b/messages/make_message_src.sh index 06a90783..8e3781df 100755 --- a/messages/make_message_src.sh +++ b/messages/make_message_src.sh @@ -7,12 +7,8 @@ if [ "$KERNEL_NAME" = "Darwin" ]; then # Compilation with brew help ICU_FRAMEWORK="$(brew --prefix icu4c)" if [ -n "$ICU_FRAMEWORK" ]; then - export PATH=${PATH}:${ICU_FRAMEWORK}/bin - export DYLD_LIBRARY_PATH=${ICU_FRAMEWORK}/lib - export PKG_CONFIG_PATH="${ICU_FRAMEWORK}/lib/pkgconfig:$PKG_CONFIG_PATH" - GENRB=${ICU_FRAMEWORK}/bin/genrb - PKGDATA=${ICU_FRAMEWORK}/bin/pkgdata + PKGDATA=${ICU_FRAMEWORK}/bin/pkgdata ICUBREW_INSTALLED=true else ICUBREW_INSTALLED=false