[MacPorts] #13166: Gkrellm fails to build on Mac OS X 10.5 Leopard (kvm.h not found)
MacPorts
noreply at macports.org
Thu Aug 7 18:57:51 PDT 2008
#13166: Gkrellm fails to build on Mac OS X 10.5 Leopard (kvm.h not found)
-----------------------------------+----------------------------------------
Reporter: daniel at hulsteijn.net | Owner: markd at macports.org
Type: defect | Status: new
Priority: Normal | Milestone: Port Bugs
Component: ports | Version: 1.5.0
Resolution: | Keywords: gkrellm kvm
-----------------------------------+----------------------------------------
Comment (by syrinx at cfl.rr.com):
Replying to [comment:5 afb at macports.org]:
> Replying to [comment:2 nox at macports.org]:
> > Seems somewhat the same as #13201.
>
> Difference being that this port actually uses kvm, while the other
didn't (just a extra #include)
I was able to get it to compile and work. Here's what I did:
1. Observe 'sudo port install gkrellm' fails with the above message.
2. cd to
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_gkrellm/work/gkrellm-2.3.0/src
3. Attempt to manually compile the one file by including the extra -I for
kvm.h:
sudo cc -Wall -O2 -I.. `pkg-config --cflags gtk+-2.0 gthread-2.0`
-DENABLE_NLS -DLOCALEDIR=\"/opt/local/share/locale\" -DHAVE_GETADDRINFO
-I/opt/local/include -L/opt/local/lib -I/opt/local/include
-I/Developer/SDKs/MacOSX10.4u.sdk/usr/include -c -o sysdeps-unix.o
sysdeps-unix.c
Password:
In file included from sysdeps-unix.c:34:
sysdeps/darwin.c: In function ‘gkrellm_sys_cpu_read_data’:
sysdeps/darwin.c:69: warning: pointer targets in passing argument 3 of
‘host_processor_info’ differ in signedness
sysdeps/darwin.c: In function ‘gkrellm_sys_cpu_init’:
sysdeps/darwin.c:95: warning: pointer targets in passing argument 3 of
‘host_processor_info’ differ in signedness
In file included from
/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:51,
from sysdeps/darwin.c:250,
from sysdeps-unix.c:34:
/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:
At top level:
/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:85:
error: ‘io_user_reference_t’ undeclared here (not in a function)
/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:87:
error: syntax error before ‘OSAsyncReference64’
/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:92:
error: syntax error before ‘OSAsyncReference64’
/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:99:
error: syntax error before ‘}’ token
/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:103:
error: syntax error before ‘io_user_reference_t’
4. sudo vi
/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h'
to edit the file and include this
typedef uint64_t io_user_reference_t;
This should go just before the enum that first references it (search for
the first occurance of io_user_reference_t, and stick the typedef just
before the struct)
5. Retry step 3, it should work.
6. Try again to 'sudo port install gkrellm' - observe another failure
about a missing kvm library:
sudo port install gkrellm
---> Building gkrellm with target darwin
Error: Target org.macports.build returned: shell command " cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_gkrellm/work/gkrellm-2.3.0"
&& gnumake darwin " returned error 2
Command output: (cd po && gnumake all)
gnumake[1]: Nothing to be done for `all'.
(cd src && gnumake GTK_CONFIG=gtk-config STRIP= HAVE_GETADDRINFO=1 \
EXTRAOBJS= SYS_LIBS="-lkvm -framework IOKit" \
LINK_FLAGS="-prebind -Wl,-bind_at_load -framework
CoreFoundation -lX11" \
gkrellm )
cc -Wall -O2 -I.. `pkg-config --cflags gtk+-2.0 gthread-2.0`
-DENABLE_NLS -DLOCALEDIR=\"/opt/local/share/locale\" -DHAVE_GETADDRINFO
main.o alerts.o battery.o base64.o clock.o cpu.o disk.o fs.o hostname.o
inet.o mail.o mem.o net.o proc.o sensors.o uptime.o chart.o panel.o
config.o gui.o krell.o plugins.o pixops.o smbdes.o smbencrypt.o smbmd4.o
smbutil.o client.o utils.o deprecated.o winops-x11.o sysdeps-unix.o -o
gkrellm `pkg-config --libs gtk+-2.0 gthread-2.0` -L/usr/X11R6/lib -lSM
-lICE -lkvm -framework IOKit -lssl -lcrypto -prebind -Wl,-bind_at_load
-framework CoreFoundation -lX11
ld: library not found for -lkvm
collect2: ld returned 1 exit status
gnumake[1]: *** [gkrellm] Error 1
gnumake: *** [darwin] Error 2
Error: Status 1 encountered during processing.
7. Go back to the same directory, and try to manually link the gkrellm
binary and omit the -lkvm:
sudo cc -Wall -O2 -I.. `pkg-config --cflags gtk+-2.0 gthread-2.0`
-DENABLE_NLS -DLOCALEDIR=\"/opt/local/share/locale\" -DHAVE_GETADDRINFO
main.o alerts.o battery.o base64.o clock.o cpu.o disk.o fs.o hostname.o
inet.o mail.o mem.o net.o proc.o sensors.o uptime.o chart.o panel.o
config.o gui.o krell.o plugins.o pixops.o smbdes.o smbencrypt.o smbmd4.o
smbutil.o client.o utils.o deprecated.o winops-x11.o sysdeps-unix.o -o
gkrellm `pkg-config --libs gtk+-2.0 gthread-2.0` -L/usr/X11R6/lib -lSM
-lICE -framework IOKit -lssl -lcrypto -prebind -Wl,-bind_at_load
-framework CoreFoundation -lX11
It works! To quickly try the binary, just type './gkrellm'
8. Copy the binary to your location of choice.
9. Puke in a bucket, wash your hands, and say your hail mary's because
this is a HUGE hack that has unknown consequences to all other apps, and
should only be used to do the 'real' fix.
--
Ticket URL: <http://trac.macports.org/ticket/13166#comment:7>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list