jpcima / ysfx

Hosting library for JSFX
Apache License 2.0
159 stars 25 forks source link

Compatibility with older linuces #37

Closed jcelerier closed 2 years ago

jcelerier commented 2 years ago

On CentOS 7 I'm facing:

target_compile_definitions(ysfx-private
    PRIVATE
        "_FILE_OFFSET_BITS=64")

which makes the build fail with:

[ 98%] Building CXX object CMakeFiles/ysfx-private.dir/sources/ysfx_eel_utils.cpp.o
In file included from /image/ysfx/sources/ysfx_utils.cpp:31:
/usr/include/fts.h:41:3: error: "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
  ^

Do you think I can safely comment that on that platform ? Or I should just update to a system with a more recent fts.h ? (if so, if you know what would be the minimal requirement..)

jcelerier commented 2 years ago

hmm just checked and the 64-bit support appeard in glibc 2.23

This table can be used to determine the linux distros this is compatible with:

https://gist.github.com/wagenet/35adca1a032cec2999d47b6c40aa45b1

jpcima commented 2 years ago

That's sad. It seems, the best is to move visit_directories into a separate file ysfx_utils_fts.cpp. There, make a feature check on glibc's version and undef _FILE_OFFSET_BITS as appropriate. It's fine that visit_directories would receive FTS_NS codes for files, and we dont care about the stat data.

jpcima commented 2 years ago

This is expected to be fixed, haven't checked it. This adds compatibility flag -DYSFX_FTS_LACKS_LFS_SUPPORT. It's set if you use the cmake, otherwise add the flag yourself.