build error when compiling ark libzip plugin

Alexander Neundorf neundorf at kde.org
Sun Feb 1 22:52:12 CET 2009


On Saturday 31 January 2009, Orville Bennett wrote:
> I had some trouble when enabling zip support in ark. Reason seems to
> be "off_t" defined in
> both /usr/include/sys/types.h and kdeutils-4.2.0/ark/plugins/
> libzipplugin/zipplugin.cpp.
>
> zipplugin.cpp block
> #ifdef LIBZIP_COMPILED_WITH_32BIT_OFF_T
> #define __off_t_defined
> typedef quint32 off_t;
> #endif /* LIBZIP_COMPILED_WITH_32BIT_OFF_T */
>
> types.h block
> #ifndef _OFF_T
> typedef __darwin_off_t		off_t;
> #define _OFF_T
> #endif
>
> This thread convinced me the definition in zipplugin.cpp was
> unnecessary http://lists.apple.com/archives/Scitech/2006/Sep/msg00071.html
> which lead to this change in kdeutils-4.2.0/ark/plugins/libzipplugin/
> CMakeLists.txt
>
> @@ -4,11 +4,11 @@
>                        ${CMAKE_CURRENT_BINARY_DIR}/../..
>                      )
>
> -if(WIN32)
> +if(APPLE OR WIN32)
>       set (LIBZIP_COMPILED_WITH_32BIT_OFF_T OFF CACHE BOOL "Whether
> the system libzip library is compiled with 32bits off_t" )
> -else(WIN32)
> +else(APPLE OR WIN32)
>       set (LIBZIP_COMPILED_WITH_32BIT_OFF_T ON CACHE BOOL "Whether the
> system libzip library is compiled with 32bits off_t" )
> -endif(WIN32)
> +endif(APPLE OR WIN32)

If it's a bool value which goes into the cache I'd recommend using OPTION() 
instead of SET().
But, maybe you can come up with some configure check which tests what is 
needed ? Maybe something with check_c_source_compiles() ?

Alex


More information about the Kde-buildsystem mailing list