Re: -Ix -include does not work with gcc-2.96

Guido Draheim <[email protected]>
Newsgroups gmane.comp.web.galeon.devel
Message-ID <[email protected]>
Guido Draheim wrote:
> the mozilla/Makefile.am does set an unconditional
> -I$(MOZILLA_ROOT_DIR) -include mozilla-config.h
> it does not work with gcc 2.96 but it does for 3.2.2
> 
> Still can't link for that libxpcom thing described
> earlier - cvs still does not work out for me.
> -- guido
> 

The usual "no such file" - it does not look like an
order issue since the -I -i order looks right, it
just seems that gcc-2.96 does not search the -I'path
for some pre'-include file.

Your hint is right however, that could be fixed with a
fully qualified name - I did just try it and modified
mozilla/Makefile to use
    -include $(MOZILLA_INCLUDE_ROOT)/mozilla-config.h
which does seem to work indeed. So, that's it. Anyway,
here's the error screen before the modification just
for reference:

gcc-2.96 -DHAVE_CONFIG_H -I. -I. -I.. -I../utils -I../utils -I../embed -I../bookmarks -I.. 
-I/usr/include/mozilla-1.3/gtkembedmoz -I/usr/include/mozilla-1.3/xpcom -I/usr/include/mozilla-1.3/string 
-I/usr/include/mozilla-1.3/nspr -I/usr/include/mozilla-1.3 -I/usr/include/mozilla-1.3/appcomps 
-I/usr/include/mozilla-1.3/content -I/usr/include/mozilla-1.3/cookie -I/usr/include/mozilla-1.3/docshell 
-I/usr/include/mozilla-1.3/dom -I/usr/include/mozilla-1.3/exthandler -I/usr/include/mozilla-1.3/find 
-I/usr/include/mozilla-1.3/gfx -I/usr/include/mozilla-1.3/helperAppDlg -I/usr/include/mozilla-1.3/java 
-I/usr/include/mozilla-1.3/jsconsole -I/usr/include/mozilla-1.3/layout -I/usr/include/mozilla-1.3/mimetype 
-I/usr/include/mozilla-1.3/mozxfer -I/usr/include/mozilla-1.3/necko -I/usr/include/mozilla-1.3/necko2 
-I/usr/include/mozilla-1.3/nkcache -I/usr/include/mozilla-1.3/oji -I/usr/include/mozilla-1.3/pref 
-I/usr/include/mozilla-1.3/progressDlg -I/usr/include/mozilla-1.3/sidebar -I/usr/include/mozilla-1.3/shistory 
-I/usr/include/mozilla-1.3/typeaheadfind -I/usr/include/mozilla-1.3/uconv -I/usr/include/mozilla-1.3/uriloader 
-I/usr/include/mozilla-1.3/unicharutil -I/usr/include/mozilla-1.3/wallet -I/usr/include/mozilla-1.3/webbrowserpersist 
-I/usr/include/mozilla-1.3/webbrwsr -I/usr/include/mozilla-1.3/webshell -I/usr/include/mozilla-1.3/widget 
-I/usr/include/mozilla-1.3/windowwatcher -DORBIT2=1 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include 
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 
-I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 
-I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include 
-I/usr/include/linc-1.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libglade-2.0 
-I/usr/include/gnome-vfs-module-2.0 -DLIB_DIR=\"/usr/local/lib/galeon\" -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED 
-DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED 
-DSHARE_DIR=\"/usr/local/share/galeon\" -include mozilla-config.h -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes 
-Wsign-compare -MT outputbuffer.lo -MD -MP -MF .deps/outputbuffer.Tpo -c outputbuffer.c  -fPIC -DPIC -o outputbuffer.lo
outputbuffer.c:1:5: mozilla-config.h: No such file or directory
make[2]: *** [outputbuffer.lo] Fehler 1
make[2]: Leaving directory `/vol/7/src/cvs/galeon/mozilla'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/vol/7/src/cvs/galeon'


btw, after changing over in mozilla/*, it proceeds but just
to stop at the next problem in src/*

if gcc-2.96 -DHAVE_CONFIG_H -I. -I. -I.. -I../embed -I../utils -I../utils -I../bookmarks -DORBIT2=1 -pthread 
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/X11R6/include 
-I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 
-I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0 
-I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 
-I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/linc-1.0 -I/usr/include/bonobo-activation-2.0 
-I/usr/include/libglade-2.0 -I/usr/include/gnome-vfs-module-2.0   -DSHARE_DIR=\"/usr/local/share/galeon\" 
-DDATADIR=\""/usr/local/share"\" -DPIXMAP_DIR=\""/usr/local/share/pixmaps"\" -DG_DISABLE_DEPRECATED 
-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED    -g -O2 
-Wall -Wmissing-declarations -Wmissing-prototypes -Wsign-compare -MT galeon-window.o -MD -MP -MF ".deps/galeon-window.Tpo" \
   -c -o galeon-window.o `test -f 'galeon-window.c' || echo './'`galeon-window.c; \
then mv ".deps/galeon-window.Tpo" ".deps/galeon-window.Po"; \
else rm -f ".deps/galeon-window.Tpo"; exit 1; \
fi
galeon-window.c: In function `update_permission_control':
galeon-window.c:1735: parse error before `*'
galeon-window.c:1739: parse error before `result'
galeon-window.c:1742: `result' undeclared (first use in this function)
galeon-window.c:1742: (Each undeclared identifier is reported only once
galeon-window.c:1742: for each function it appears in.)
galeon-window.c:1745: `image_action' undeclared (first use in this function)
galeon-window.c:1757: `cookie_action' undeclared (first use in this function)
make[3]: *** [galeon-window.o] Fehler 1
make[3]: Leaving directory `/vol/7/src/cvs/galeon/src'
make[2]: *** [all] Fehler 2
make[2]: Leaving directory `/vol/7/src/cvs/galeon/src'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/vol/7/src/cvs/galeon'
make: *** [all] Fehler 2

this is quite obvious however: gcc-2.96 does not default into the
C99-compatible mode where you can declare variables at any
place within a procedure. This can be easily fixed I guess.

Uhmmm, just as a side note (perhaps a bit off-topic), in
my  own projects, I have started to use c99-style for
variable declarations as the default and most source carry
a compatibility macro definition that makes the sources to
compile on traditional pre-C99 compilers as well:

#define ___ {
#define ____ }

foo (int c)
{
      if (!c) return;
      ___ int i = 0;
      for (; i < c; i++)
      {
           ...
      }____;
      return;
}



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.