Opened 18 years ago

Closed 18 years ago

Last modified 7 years ago

#9937 closed defect (fixed)

glib2: glib-2.0.pc Cflags needs -I${includedir}

Reported by: shochat@… Owned by: mij@…
Priority: Normal Milestone:
Component: ports Version: 1.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: glib2

Description (last modified by ryandesign (Ryan Carsten Schmidt))

This problem was encountered doing a manual build of pan-0.103 against the glib-2.0 brought in by DarwinPorts. The error was:

In file included from e-util.cc:32:
/opt/local/include/glib-2.0/glib/gi18n.h:23:21: error: libintl.h: No such file or directory

The problem was that in the compile command that led to this error, there was no -I/opt/local/include (which is where libintl.h is), causing the include in gi18n.h to fail. This is apparently because the Cflags line in glib-2.0.pc does not have -I${includedir}.

Change History (4)

comment:1 Changed 18 years ago by rhwood@…

Owner: changed from darwinports-bugs@… to mij@…

Assigning to maintainer.

comment:2 Changed 18 years ago by mij@…

Resolution: fixed
Status: newclosed

Committed, thanks!

comment:3 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Description: modified (diff)
Port: glib2 added
Summary: glib-2.0.pc Cflags needs -I${includedir}glib2: glib-2.0.pc Cflags needs -I${includedir}

The developers of Qt have declared that it is broken for us to be making this change to glib2's pkg-config file, so I plan to revert it; see #44395.

comment:4 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

In e302b20bdd71e9e16b142c525d8d809ee56ffd05/macports-ports:

glib2, glib2-devel: No longer add -I/opt/local/include to glib-2.0.pc

This had originally been added so that other software could include
gi18n.h without error, since gi18n.h uses #include <libintl.h> so
the path to libintl.h needs to be among the include paths.

MacPorts already puts -I/opt/local/include into CPPFLAGS during the
configure phase so I expected this change not to affect most ports, and
to merely help the very few ports that either ignore CPPFLAGS or don't
use a configure script but do use pkg-config.

See: #9937

But some build systems do not put the -I flags into the correct order,
and are so complicated that fixing that is nearly impossible (e.g. Qt).
If -I/opt/local/include appears in the compiler flags, such ports may
fail to upgrade to a new version if the previous version is active, as
old include files from the old version are mistakenly used instead of
the new versions. Such ports may clear the automatically-added CPPFLAGS
to avoid the appearance of -I/opt/local/include, but if they depend on
glib2, that flag would reappear.

Therefore, don't add -I/opt/local/include to glib-2.0.pc, and instead
patch the files that #include <libintl.h> to do so by absolute path.

Closes: #44395

Note: See TracTickets for help on using tickets.