Bug 28442 - Poppler-0.12.4 fails to compile due to _XOPEN_SOURCE on some OSX and Solaris
Summary: Poppler-0.12.4 fails to compile due to _XOPEN_SOURCE on some OSX and Solaris
Status: RESOLVED INVALID
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 05:27 UTC by Fabian Groffen
Modified: 2010-06-08 12:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Fabian Groffen 2010-06-08 05:27:18 UTC
After the fix from bug #27610, poppler no longer compiles on OSX 10.4 and Solaris 10.

The Cmakefiles unconditionally inject _XOPEN_SOURCE now causing all kinds of problems.  Simply sedding this out by e.g.
  sed -i -e '/add_definitions/d' cmake/modules/PopplerMacros.cmake
makes poppler compile on before mentioned platforms.

There is a difference between cmake and configure here, as configure seems to at least only add when some configure flag is given, and cmake just unconditionally adds it (together with some warning flags that make every file emit at least 3 warnings for no good reason to me).

I suggest to see if setting _XOPEN_SOURCE is necessary at all for the general case, and if it is, to build a check that figures out if it is necessary, in what form, and/or doesn't break the build.

I can provide information and/or try fixes if necessary.
Comment 1 Albert Astals Cid 2010-06-08 11:42:29 UTC
I don't know what you are compiling, but:
 * The fix for bug #27610 is not present on 0.12.4 so obviously is not the one at fault
 * _XOPEN_SOURCE is never unconditionally injected, only when you set DEFAULT_COMPILE_WARNINGS_KDE

So i'd appreciate if you are a bit more specific of what you are using.
Comment 2 Fabian Groffen 2010-06-08 11:54:29 UTC
ok, we've got this patch applied:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-text/poppler/files/poppler-0.12.4-xopen_source.patch?revision=1.1&view=markup

Technically, that means indeed we are not on version 0.12.4 exact.  However the patch is already committed, so next release will suffer from this.

If DEFAULT_COMPILE_WARNINGS_KDE must be set, then the original bug (failure to compile on FreeBSD) would not be solved.  I don't understand enough from cmake to judge if _XOPEN_SOURCE is injected based on DEFAULT_COMPILE_WARNINGS_KDE, or not, but since we don't seem to set it, which then means it's enabled by default.

My observations in short:
- FreeBSD needs _XOPEN_SOURCE=600
- OSX 10.4 and Solaris break on setting _XOPEN_SOURCE to any value
- _XOPEN_SOURCE is only added when DEFAULT_COMPILE_WARNINGS_KDE, hence fix or breakage is conditional
Comment 3 Albert Astals Cid 2010-06-08 12:06:58 UTC
_XOPEN_SOURCE to 600 is only set when DEFAULT_COMPILE_WARNINGS_KDE is used, and that is not the default, so do not manually set DEFAULT_COMPILE_WARNINGS_KDE when compiling for some OSX and Solaris and be happy?
Comment 4 Fabian Groffen 2010-06-08 12:12:00 UTC
I see there is another patch, never mind and sorry for the bother.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.