← Back to team overview

maria-developers team mailing list archive

Re: FreeBSD compilation problems and a fix

 

Hi Sergei,


On 01/29/2014 06:22 PM, Sergei Golubchik wrote:
Hi, Alexander!

On Jan 29, Alexander Barkov wrote:
I just tried to compile 10.0 on FreeBSD-9.1 RELEASE
and noticed two problems:

1. It printed this warning for every source file:

/usr/include/sys/timeb.h:42:2: warning: #warning "this file includes
<sys/timeb.h> which is deprecated"

This diff fixes the problem:

-#ifdef HAVE_SYS_TIMEB_H
+#if defined(HAVE_SYS_TIMEB_H) && !defined(__FreeBSD__)

How comes? HAVE_SYS_TIMEB_H is only defined on Windows, there's no test
for <sys/timeb.h> anywhere in the cmake files.


Perhaps this line in config.h.cmake tests:

#cmakedefine HAVE_SYS_TIMEB_H 1

I guess it should be removed as well.


Furthermore, this whole #ifdef HAVE_SYS_TIMEB_H/#include/#endif
in my_global.h was removed in 5.5. It was mistakenly restored in 10.0,
so feel free to remove it again.

Right. And it's not in 10.0-base. But it is in 10.0.


But anyway, HAVE_SYS_TIMEB_H should never be defined on FreeBSD, please
find out why you have it.

2. It failed to compile because of pcre (both libraries and includes)
installed in the system. Compiler used the *system* header pcre.h
together with the *bundled* library libpcre.a.

I had a similar complaint from the MacPorts maintainers.

This diff fixes the problem:

   # Common defines and includes
+SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
   ADD_DEFINITIONS(-DHAVE_CONFIG_H)
   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include

Good idea in general, yes.

Pushed "SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)"
into 10.0-base.

Thanks.


Does this look OK?
If so, which version should I  push it in?

10.0

Regards,
Sergei



Follow ups

References