Page 1 of 1

Unsetting MAGICKCORE_HAVE_SYS_TIMEB_H

Posted: 2016-12-21T15:44:43-07:00
by webmaster128
I try to compile ImageMagick with an Android/arm64 toolchain from Crystax NDK, that has no <sys/timeb.h>. Now I found MAGICKCORE_HAVE_SYS_TIMEB_H, which should enable me to say this header is not available – I guess.

Greping over the source shows 3 places where MAGICKCORE_HAVE_SYS_TIMEB_H is used:

Code: Select all

./MagickWand/studio.h-# include <sys/types.h>
./MagickWand/studio.h-# include <sys/stat.h>
./MagickWand/studio.h:# if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
./MagickWand/studio.h-# include <sys/timeb.h>
./MagickWand/studio.h-# endif
--
./MagickCore/studio.h-# include <sys/types.h>
./MagickCore/studio.h-# include <sys/stat.h>
./MagickCore/studio.h:# if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
./MagickCore/studio.h-# include <sys/timeb.h>
./MagickCore/studio.h-# endif
--
./MagickCore/magick-baseconfig.h-
./MagickCore/magick-baseconfig.h-/* Define to 1 if you have the <sys/timeb.h> header file. */
./MagickCore/magick-baseconfig.h:#ifndef MAGICKCORE_HAVE_SYS_TIMEB_H
./MagickCore/magick-baseconfig.h:#define MAGICKCORE_HAVE_SYS_TIMEB_H 1
./MagickCore/magick-baseconfig.h-#endif
./MagickCore/magick-baseconfig.h-
Is it true that defining MAGICKCORE_HAVE_SYS_TIMEB_H=0 should disable including <sys/timeb.h>? If so, I think we have the problem that it is still defined because defined(MAGICKCORE_HAVE_SYS_TIMEB_H) is true.

Re: Unsetting MAGICKCORE_HAVE_SYS_TIMEB_H

Posted: 2016-12-21T19:01:23-07:00
by magick
Comment out #define MAGICKCORE_HAVE_SYS_TIMEB_H 1 in MagickCore/magick-baseconfig.h or simply delete that line.

Re: Unsetting MAGICKCORE_HAVE_SYS_TIMEB_H

Posted: 2016-12-22T04:14:25-07:00
by webmaster128
Okay, but what is the proper fix here? Sould not

Code: Select all

# if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
# include <sys/timeb.h>
be changed to

Code: Select all

# if MAGICKCORE_HAVE_SYS_TIMEB_H
# include <sys/timeb.h>
? MAGICKCORE_HAVE_SYS_TIMEB_H is always defined, either by the user or with the default 1. I can send a PR if I know how this is supposed to work.

Re: Unsetting MAGICKCORE_HAVE_SYS_TIMEB_H

Posted: 2016-12-22T09:05:18-07:00
by magick
The automake / autoconf toolchain sets the value for MAGICKCORE_HAVE_SYS_TIMEB_H. It is likely finding it in your local environment rather than in the Android environment suggesting either you have not properly set up the cross-compile configuration or automake / autoconf has a bug when cross-compiling. We have cross-compiled in the past without any problems, we're not sure why its failing for you.

Re: Unsetting MAGICKCORE_HAVE_SYS_TIMEB_H

Posted: 2016-12-22T09:15:40-07:00
by webmaster128
Thanks for pushing me in the right direction! I was using the x86 toolchain for configuration, which is android-16, which has a <sys/timeb.h>. With the correct toolchain, HAVE_SYS_TIMEB_H is not defined.