Skip to content

Conversation

pinotree
Copy link
Contributor

GNU libc does not have <sys/utime.h> but <utime.h>, so set HAS_FUTIME=0 for it; fixes build on non-Linux platforms using GNU libc.

GNU libc does not have <sys/utime.h> but <utime.h>, so set HAS_FUTIME=0
for it; fixes build on non-Linux platforms using GNU libc.
@danielhjames
Copy link
Contributor

Hi @geoffmcl could you review this please? Seems like the best solution for fixing https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828632 Thanks! Daniel

@AdamMajer
Copy link
Contributor

There should be a better way of doing this than what is currently done.

https://cmake.org/Wiki/CMake:How_To_Write_Platform_Checks

@geoffmcl
Copy link
Contributor

@pinotree, @danielhjames thanks for this PR... adding defined(__GLIBC__) to an already long list looks ok...

Is there a better way to do this, as @AdamMajer suggests?

Well, yes in CMake terms there is, using say -

in CMakeLists.txt
check_include_file(utime.h     HAVE_UTIME_H)
check_include_file(sys/utime.h  HAVE_SYS_UTIME_H)
if (HAVE_SYS_UTIME_H)
add_definitions( -DHAS_FUTIME=1 )
else ()
add_definitions( -DHAS_FUTIME=0 )
endif ()
then maybe in a config.h.in
#cmakedefine HAVE_UTIME_H 1
#cmakedefine HAVE_SYS_UTIME_H 1

This could be add to the tidy cmake build, and thus define HAS_FUTIME before the header tidyplatform.h is used... that would hide any problem in the current tidyplatform.h, but...

But that does not help users of the binary tidy-dev install, while this PR addition does address that user's needs more... Of course they too could also add a HAS_FUTIME define in their build system, and again step over the problem...

Will leave a little more time for any others to comment, but at this stage this looks fine to be merged... thanks...

@geoffmcl geoffmcl added this to the 5.3 milestone Jun 30, 2016
@geoffmcl geoffmcl merged commit f84effb into htacg:master Jul 11, 2016
@geoffmcl
Copy link
Contributor

Now merged to master... thanks...

geoffmcl added a commit that referenced this pull request Jul 11, 2016
This bump also includes merge of #424 - licence fix, and #423 - add
__GLIBC__ to long HAS_FUTIME list.

And coincidentally #427 - an improved french translation!
@pinotree pinotree deleted the glibc branch July 12, 2016 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants