summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2025-01-25 01:26:22 +0100
committerSlávek Banko <[email protected]>2025-01-25 01:26:33 +0100
commit122c229a7d64afe9a39b310cc73a747dc01d8ca1 (patch)
tree133a24a5f5b80740bdab88a68938a4d2b0f5777f
parentb58cfd146047bebabe0d1a045ff8284c23d4f7eb (diff)
downloadamarok-122c229a7d64afe9a39b310cc73a747dc01d8ca1.tar.gz
amarok-122c229a7d64afe9a39b310cc73a747dc01d8ca1.zip
Fix the problem of linking taglib2 on 32 bit architectures
if taglib is not built with large files support. This resolves the last part from issue #60. Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r--ConfigureChecks.cmake23
-rw-r--r--amarok/src/metadata/rmff/rmff.cpp9
-rw-r--r--config.h.cmake1
3 files changed, 33 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 8d0f1fc9..fd362b04 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -109,6 +109,29 @@ else( )
tde_message_fatal( "taglib is required, but not found on your system" )
endif( )
+tde_save_and_set( CMAKE_REQUIRED_DEFINITIONS "${LARGEFILES_DEFINITIONS}" )
+tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TAGLIB_INCLUDE_DIRS}" )
+tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "${TAGLIB_LIBRARIES}" )
+
+check_cxx_source_compiles( "
+ #include <taglib.h>
+ #include <id3v1tag.h>
+
+ int main( int, char** )
+ {
+ off_t tagOffset = 0;
+ TagLib::File *testFile = nullptr;
+ TagLib::ID3v1::Tag *id3tag = new TagLib::ID3v1::Tag(testFile, tagOffset);
+ return 0;
+ }
+ "
+ TAGLIB_LARGE_FILES_SUPPORT
+)
+
+tde_restore( CMAKE_REQUIRED_DEFINITIONS )
+tde_restore( CMAKE_REQUIRED_INCLUDES )
+tde_restore( CMAKE_REQUIRED_LIBRARIES )
+
# libvisual
if( WITH_LIBVISUAL )
diff --git a/amarok/src/metadata/rmff/rmff.cpp b/amarok/src/metadata/rmff/rmff.cpp
index 943e24dd..24181230 100644
--- a/amarok/src/metadata/rmff/rmff.cpp
+++ b/amarok/src/metadata/rmff/rmff.cpp
@@ -26,6 +26,15 @@
* https://common.helixcommunity.org/nonav/2003/HCS_SDK_r5/helixsdk.htm *
* *
***************************************************************************/
+
+#include "config.h"
+
+#if !defined(TAGLIB_LARGE_FILES_SUPPORT)
+ #undef _LARGE_FILES
+ #undef _LARGEFILE_SOURCE
+ #undef _FILE_OFFSET_BITS
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/config.h.cmake b/config.h.cmake
index e8331320..26f9d263 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -26,6 +26,7 @@
#cmakedefine HAVE_TUNEPIMP 1
#cmakedefine TAGLIB_15 1
+#cmakedefine TAGLIB_LARGE_FILES_SUPPORT 1
#cmakedefine HAVE_TQGLWIDGET 1
#cmakedefine HAVE_OLD_RUBY @HAVE_OLD_RUBY@