LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-24-2015, 08:33 AM   #1
aherrys
Member
 
Registered: Jul 2003
Posts: 85

Rep: Reputation: 15
Avahi from slackbuilds fails with gtk/gtk.h error


Hi All,

I am trying to create avahi slackbuild package on Slackware 14.1 (avah-0.6.31), but I got the following error when the ./avahi-SlackBuild script is running.

make[2]: Entering directory `/tmp/SBo/avahi-0.6.31/avahi-discover-standalone'
CC avahi_discover_standalone-main.o
main.c:31:21: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>

I have installed packages:
gtk+-1.2.10-i486-5
gtk+2-2.24.20-i486-1
gtk+3-3.8.2-i486-2

and they are all have gtk.h file. However the gtk.h files and gtk directory are all located under
/usr/include/gtk-1.2,
/usr/include/gtk-2.0,
and
/usr/include/gtk-3.0

No such thing as /usr/include/gtk/gtk.h

I look at the main.c of the avahi-discover-standalone directory and the #include definition is <gtk/gtk.h>
I can probably modify this to <gtk-1.2/gtk/gtk.h> or something similar, however how do I know which gtk.h header to use (1.2,2.0 or 3.0) ?

The configure statement of avahi.SalckBuild is:

./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--enable-tests \
--disable-static \
--disable-monodoc \
--disable-autoipd \
--enable-python-dbus \
--enable-pygtk\
--enable-glib \
--enable-dbus \
--enable-python \
--enable-gtk \
--enable-gtk3 \
--enable-qt4 \
--disable-qt3 \
--enable-core-docs \
--enable-compat-howl \
--enable-compat-libdns_sd \
--with-dbus-sys=/etc/dbus-1/system.d \
--with-avahi-user=avahi \
--with-avahi-group=avahi \
--with-avahi-priv-access-group=netdev \
--with-distro=slackware \
--program-prefix= \
--program-suffix= \
--build=$ARCH-slackware-linux \
$MONO

What course of action I should take to resolve this ?

Thanks in advanced for any suggestion and help.
 
Old 05-24-2015, 08:58 AM   #2
codeguy
Member
 
Registered: Jan 2004
Distribution: Slackware
Posts: 187

Rep: Reputation: 46
Seems to me the configure script is detecting gtk wrong. It should be using:

PHP Code:
gtk-config --cflags 
to find includes. Well, assuming gtk-config returns something sane. On my system it returns:

PHP Code:
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include 
 
Old 05-24-2015, 09:15 AM   #3
codeguy
Member
 
Registered: Jan 2004
Distribution: Slackware
Posts: 187

Rep: Reputation: 46
Hum.. I just tried to build it on my system, and it compiled fine. Here are a few things to check:

near the end of the configure script it'll dump out a status. Mine looks like:

PHP Code:
---{ avahi 0.6.31 }---

    
prefix:                                    /usr
    sysconfdir
:                                /etc
    localstatedir
:                             /var
    
avahi socket:                              /var/run/avahi-daemon/socket
    dbus
-1 system.d dir:                       /etc/dbus-1/system.d
    dbus
-1 version:                            1.6.12
    dbus
-1 system socket:                      unix:path=/var/run/dbus/system_bus_socket
    C Compiler
:                                gcc -std=gnu99
    CFLAGS
:                                    -O2 -march=i486 -mtune=i686 <SNIP
    
Enable GLIB:                               yes
    Enable GLIB GObject
:                       yes
    Enable GObject Introspection
:              yes
    Enable GTK 2.0
:                            yes
    Enable GTK 3.0
:                            yes
    Enable D
-Bus:                              yes
    With XML
:                                  expat
    Enable GDBM
:                               yes
    Enable DBM
:                                no
    Enable libdaemon
:                          yes
    Enable Python
:                             yes
    Enable pygtk
:                              yes
    Enable python
-dbus:                        yes
    Enable QT3
:                                no
    Enable QT4
:                                yes
    Enable Mono
:                               no
    Enable Monodoc
:                            no
    Distribution
/OS:                           slackware 
You'll have to Ctrl-C it or it'll scroll on by and you'll never see it again.

Another thing you can check is the config.log in the /tmp/SBo/avahi-0.6.31/ directory.

Its huge, be ready. What I'd do is go to the very end, then search up until I see something to do with an error in gtk. There will be errors in there but the script will correct for them, its expected to see some errors. (Things like when it searched for Mono for example)

Last edited by codeguy; 05-24-2015 at 09:18 AM. Reason: Snipped super long CFLAGS to fix formatting
 
Old 05-24-2015, 09:22 AM   #4
gmgf
Senior Member
 
Registered: Jun 2012
Location: Bergerac, France
Distribution: Slackware
Posts: 2,212

Rep: Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998
it compile here with this fedora patch:

http://pkgs.fedoraproject.org/cgit/avahi.git/tree/

'avahi-0.6.31-no-deprecations.patch'
 
Old 05-24-2015, 10:30 AM   #5
aherrys
Member
 
Registered: Jul 2003
Posts: 85

Original Poster
Rep: Reputation: 15
Hi codeguy,

Here is the dump of the status:

PHP Code:
---{ avahi 0.6.31 }---

    
prefix:                                    /usr
    sysconfdir
:                                /etc
    localstatedir
:                             /var
    
avahi socket:                              /var/run/avahi-daemon/socket
    dbus
-1 system.d dir:                       /etc/dbus-1/system.d
    dbus
-1 version:                            1.6.12
    dbus
-1 system socket:                      unix:path=/var/run/dbus/system_bus_socket
    C Compiler
:                                gcc -std=gnu99
    CFLAGS
:                                    -O2 -march=i486 -mtune=i686 -fstack-protector -std=c99 -Wall --Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -fdiagnostics-show-option -Wno-cast-qual -fno-strict-aliasing
    Enable GLIB
:                               yes
    Enable GLIB GObject
:                       yes
    Enable GObject Introspection
:              yes
    Enable GTK 2.0
:                            yes
    Enable GTK 3.0
:                            yes
    Enable D
-Bus:                              yes
    With XML
:                                  expat
    Enable GDBM
:                               yes
    Enable DBM
:                                no
    Enable libdaemon
:                          yes
    Enable Python
:                             yes
    Enable pygtk
:                              yes
    Enable python
-dbus:                        yes
    Enable QT3
:                                no
    Enable QT4
:                                yes
    Enable Mono
:                               no
    Enable Monodoc
:                            no
    Distribution
/OS:                           slackware
    User 
for avahi-daemon:                     avahi
    Group 
for avahi-daemon:                    avahi
    Priviliged access group 
for Avahi clientsnetdev
    User 
for avahi-autoipd:                    avahi-autoipd
    Group 
for avahi-autoipd:                   avahi-autoipd
    Enable chroot
():                           no
    Enable Linux inotify
:                      yes
    Enable stack
-smashing protection:          yes
    systemd unit directory
:                    

    
Building libavahi-core              yes
    Building avahi
-daemon:              yes
    Building avahi
-dnsconfd:            yes
    Building libavahi
-client:           yes
    Building avahi
-utils:               yes
    Building avahi
-python:              yes
    Building libavahi
-glib:             yes
    Building libavahi
-gobject:          yes
    Building avahi
-discover-standaloneyes
    Building libavahi
-qt3:              no
    Building libavahi
-qt4:              yes
    Building avahi
-sharp:               no
    Building avahi
-compat-libdns_sd:    yes
    Building avahi
-compat-howl:         yes
    Building tests
:                     yes
    Building avahi
-core documentation:  yes
    Building avahi
-autoipd:             no
    Building libavahi
-ui:               yes 
And the result of gtk-config --cflags is:

PHP Code:
bash-4.2# gtk-config --cflags
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include 
So looks like my machine has the same setup as yours. Should I change the main.c to use <gtk-1.2/gtk/gtk.h> instead ?

Thanks
 
Old 05-24-2015, 10:56 AM   #6
aherrys
Member
 
Registered: Jul 2003
Posts: 85

Original Poster
Rep: Reputation: 15
Searching on config.log I found this rather suspicious lines, eventhough not outright error:


PHP Code:
pkg_cv_GTK20_CFLAGS=
pkg_cv_GTK20_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0  '
pkg_cv_GTK30_CFLAGS=
pkg_cv_GTK30_LIBS='-lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0  '
GTK20_CFLAGS=''
GTK20_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0  '
GTK30_CFLAGS=''
GTK30_LIBS='-lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0  ' 
Should not be that GTK20_CFLAGS ='-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include' instead of just empty ?

But how do I fix that ?

One question I have, is the main.c on under 'avahi-discover-standalone' directory is hardcoded or is it created on the fly by configure process ?
What your #include looks like ?

Thanks
 
Old 05-24-2015, 11:03 AM   #7
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
sorry aherrys, looking at an (a few days) older post from you, it seems to me that you are trying to do a minimal install and if building fails it can be because you are missing something: consider that avahi from SBo (as any other script from there) has been tested on a full installation of slackware stable and any other platform is just unsupported (as debugging individual problems can become extremely painful).
that said, good luck!

P.S. the best compromise I can suggest is to create a full install in a virtual machine, build what you need there and move the packages on your minimal one.
obviously, you can also use the full install in the virtual machine to be able to do the tests you are asking above and so be able to debug stuff yourself...

Last edited by ponce; 05-24-2015 at 12:57 PM.
 
Old 05-24-2015, 06:49 PM   #8
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by ponce View Post
sorry aherrys, looking at an (a few days) older post from you, it seems to me that you are trying to do a minimal install and if building fails it can be because you are missing something
[snip]
In a minimal install environment, pkg-config can be quite useful because it will fail and describe what is missing if some dependency if not installed. Try running 'pkg-config --cflags-only-I gtk+-2.0'

chris
 
Old 05-24-2015, 09:13 PM   #9
aherrys
Member
 
Registered: Jul 2003
Posts: 85

Original Poster
Rep: Reputation: 15
Chris,

It works ! thank you a million.. learns a lot of stuff in the last few days..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SBo avahi missing python module gtk brooko Slackware 6 02-04-2014 04:06 PM
[SOLVED] error: gtk/gtk.h: No such file or directory Aquarius_Girl Programming 6 03-28-2011 04:17 AM
GTK error when starting gtk-chtheme Dswissmiss Linux - Software 1 10-01-2004 11:53 PM
compiling gaim/ gtk error (two versions of gtk) webazoid Linux - Software 0 07-06-2004 06:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration