[MacPorts] #17558: connection errors when macports libs are used with Tiger X11 headers
MacPorts
noreply at macports.org
Wed Jan 7 08:47:53 PST 2009
#17558: connection errors when macports libs are used with Tiger X11 headers
----------------------------------+-----------------------------------------
Reporter: vinc17@… | Owner: jeremyhu@…
Type: defect | Status: reopened
Priority: High | Milestone: Port Bugs
Component: ports | Version: 1.6.0
Resolution: | Keywords: crash
Port: xorg |
----------------------------------+-----------------------------------------
Comment(by david@…):
Replying to [comment:48 jeremyhu@…]:
> > I configured the /opt/local-test installation to use the modified
ports tree I use for building releases, except that I took out the
--x-includes and --x-libraries stuff. I didn't want to complicate the test
but without the patch cairo doesn't honor important universal flags like
-isysroot and will link against the 10.5 SDK regardless. (To see the patch
I used, run {{{svn cat
svn://svn.insecure.org/zenmap/install_scripts/macosx/macports-1.8.0-universal.diff@11598}}}
and remove the --x-includes and --x-libraries bits.)
>
> Ok, but what's the login and pass that I should use?
Sorry, I always forget that: {{{--username guest --password ""}}}.
> > Finally I ran {{{sudo /opt/local-test/bin/port -d install gtk2}}}.
(Actually I did this twice. The first time I forgot to patch cairo, so had
to remove cairo and build again.) gtk2 quit in a failure I haven't seen
before:
> >
> > {{{
> > libtool: compile: /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../..
-DG_LOG_DOMA
> > IN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk
-DG_DISABLE_CAST_CH
> > ECKS -D_REENTRANT -I/opt/local-test/include/glib-2.0 -I/opt/local-
test/lib/glib-
> > 2.0/include -I/opt/local-test/include -I/opt/local-
test/include/pango-1.0 -I/opt
> > /local-test/include/cairo -I/opt/local-test/include/pixman-1 -I/opt
/local-test/include/freetype2 -I/opt/local-test/include/libpng12
-I/usr/X11/include -I/opt/lo
> > cal-test/include -no-cpp-precomp -DX_LOCALE -isysroot
/Developer/SDKs/MacOSX10.5
> > .sdk -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES
-DGDK_PIXBUF_DISA
> > BLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -I/usr/X11/include
-DGDK_PIXBU
> > F_DISABLE_DEPRECATED -O2 -funroll-loops -fstrict-aliasing -isysroot
/Developer/S
> > DKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4
-Wall -c gdkev
> > ents-x11.c -fno-common -DPIC -o .libs/gdkevents-x11.o
> > gdkevents-x11.c: In function 'gdk_event_translate':
> > gdkevents-x11.c:2110: error: 'RRNotify' undeclared (first use in this
function)
> > gdkevents-x11.c:2110: error: (Each undeclared identifier is reported
only once
> > gdkevents-x11.c:2110: error: for each function it appears in.)
> > ...
> > }}}
>
> That's because the protocol headers in the 10.4u SDK are not as up to
date as gtk needs. Maybe try installing xorg-randrproto first.
I installed xorg-randrproto, cleaned gtk2, and built again. It hit a
different error:
{{{
libtool: compile: /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../..
-DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk
-DG_DISABLE_CAST_CHECKS -D_REENTRANT -I/opt/local-test/include/glib-2.0
-I/opt/local-test/lib/glib-2.0/include -I/opt/local-test/include -I/opt
/local-test/include/pango-1.0 -I/opt/local-test/include/cairo -I/opt
/local-test/include/pixman-1 -I/opt/local-test/include/freetype2 -I/opt
/local-test/include/libpng12 -I/usr/X11/include -I/opt/lo
cal-test/include -no-cpp-precomp -DX_LOCALE -isysroot
/Developer/SDKs/MacOSX10.5
.sdk -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES
-DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES
-I/usr/X11/include -DGDK_PIXBU
F_DISABLE_DEPRECATED -O2 -funroll-loops -fstrict-aliasing -isysroot
/Developer/S
DKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c
gdkev
ents-x11.c -fno-common -DPIC -o .libs/gdkevents-x11.o
gdkevents-x11.c: In function 'gdk_event_translate':
gdkevents-x11.c:2112: error: 'XRRNotifyEvent' undeclared (first use in
this func
tion)gdkevents-x11.c:2112: error: (Each undeclared identifier is reported
only once
gdkevents-x11.c:2112: error: for each function it appears in.)
gdkevents-x11.c:2112: error: 'notify' undeclared (first use in this
function)
gdkevents-x11.c:2112: error: syntax error before ')' token
}}}
I should mention that gtk2 compiles fine using the 10.4u SDK when I use
--x-includes and --x-libraries. Maybe there's some conflict between the
{{{-isysroot /Developer/SDKs/MacOSX10.5.sdk}}} and {{{-mmacosx-version-
min=10.4}}} options gtk2 is using. ({{{universal_sysroot}}} is
/Developer/SDKs/MacOSX10.4u.sdk in macports.conf.)
> > I'll try your suggestion from comment 46. Am I supposed to put that
code in the portfiles in place of --x-includes and --x-libraries?
>
> Yes.
Using the same configuration as before, I started over:
{{{
sudo rm -rf /opt/local-test/
sudo make install
sudo vi /opt/local-test/etc/macports/variants.conf # Add +universal
# Patched cairo, pango, and gtk2. Ran portindex.
sudo vi /opt/local-test/etc/macports/sources.conf # Add
file:///Users/david/macports-sources/ports.test
sudo /opt/local-test/bin/port selfupdate
sudo /opt/local-test/bin/port -d install gtk2
}}}
I attached the patch against the ports tree.
Somehow the --x-include and --x-lib don't get added to the configure args
and the libraries are linked with the wrong X11 dynamic libraries as
before.
{{{
---> Configuring cairo
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (cairo)
configure: WARNING: If you wanted to set the --build type, don't use
--host.
If a cross compiler is detected then cross compile mode will be used.
...
checking for X... libraries /usr/X11/lib, headers
...
configure: WARNING: If you wanted to set the --build type, don't use
--host.
If a cross compiler is detected then cross compile mode will be used.
...
checking for X... libraries /usr/X11/lib, headers
...
../doltcompile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I/opt/local-
test/include/pixman-1 -I/opt/local-test/include/freetype2 -I/opt
/local-test/include -I/opt/local-test/include -I/opt/local-
test/include/libpng12 -I/usr/X11/include -I/usr/X11/include
-Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration
-Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wstrict-
aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-
definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-
long-long -Winline -fno-strict-aliasing -fno-common
-Wp,-D_FORTIFY_SOURCE=2 -I/opt/local-test/include -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -mmacosx-version-min=10.4 -c
-o cairo-ps-surface.lo cairo-ps-surface.c
...
---> Configuring pango
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (pango)
DEBUG: Environment: CFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-arch ppc -arch i386 -mmacosx-version-min=10.4' CPPFLAGS='-I/opt/local-
test/include -no-cpp-precomp -isysroot /Developer/SDKs/MacOSX10.4u.sdk'
CXXFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch
i386 -mmacosx-version-min=10.4' MACOSX_DEPLOYMENT_TARGET='10.4'
CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2'
LDFLAGS='-L/opt/local-test/lib -no-undefined -bind_at_load
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
-arch ppc -arch i386 -mmacosx-version-min=10.4' FCFLAGS='-O2'
OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2'
FFLAGS='-O2' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local-test/var/macports/build
/_Users_david_macports-sources_ports.test_x11_pango/work/pango-1.22.4" &&
./configure --prefix=/opt/local-test --enable-static --disable-dependency-
tracking'
...
checking for X... libraries /usr/X11/lib, headers
...
/usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I../.. -I/opt/local-
test/include/freetype2 -I/opt/local-test/include -I/opt/local-test/include
-I . -I/opt/local-test/include -no-cpp-precomp -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-
min=10.4 -Wall -c harfbuzz.c -o harfbuzz.o >/dev/null 2>&1
...
---> Configuring gtk2
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (gtk2)
DEBUG: Environment: CUPS_CONFIG='/Developer/SDKs/MacOSX10.5.sdk/usr/bin
/cups-config' CFLAGS='-O2 -funroll-loops -fstrict-aliasing -isysroot
/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-
min=10.4' CPPFLAGS='-I/opt/local-test/include -no-cpp-precomp -DX_LOCALE
-isysroot /Developer/SDKs/MacOSX10.5.sdk' CXXFLAGS='-O2 -isysroot
/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-
min=10.4' MACOSX_DEPLOYMENT_TARGET='10.4' CPP='/usr/bin/cpp-4.0'
CXX='/usr/bin/g++-4.0' F90FLAGS='-O2' LDFLAGS='-L/opt/local-test/lib -arch
ppc -arch i386 -mmacosx-version-min=10.4' FCFLAGS='-O2'
OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2'
FFLAGS='-O2' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local-test/var/macports/build
/_Users_david_macports-sources_ports.test_x11_gtk2/work/gtk+-2.14.5" &&
./configure --prefix=/opt/local-test --disable-shm --disable-glibtest
--with-included-loaders --with-xinput --enable-xinerama --disable-
dependency-tracking'
...
}}}
Even though all three ports use the wrong X11, cairo and pango use the
10.4u sysroot while gtk2 does not. It turns out it's that way in my
release builds as well but it doesn't seem to matter. It's because of this
code in gtk2/Portfile, which looks wrong:
{{{
if {[variant_isset universal]} {
if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
set configure.universal_sysroot "/Developer/SDKs/MacOSX10.5.sdk"
} else {
set configure.universal_sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
}
configure.env-append
CUPS_CONFIG="${configure.universal_sysroot}/usr/bin/cups-config"
}
}}}
Looking at the code you gave me, I see the reason it didn't have an effect
is that /usr/X11R6/lib/pkgconfig/x11.pc exists. So maybe I misunderstood
you--did you want me to start over with
x11prefix=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6, not
x11prefix=/usr/X11R6? I'll try that and post another comment.
--
Ticket URL: <http://trac.macports.org/ticket/17558#comment:49>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list