-l flags wrongly ordered
|Assignee:||Hiroyuki Yamamoto||% Done:|
I maintain the sylpheed package for the Fink packaging system for OS X. A Fink developer reported that sypheed fails to build if avfs-dev is installed. Terminal output:
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"Sylpheed\" -I/sw/include/pango-1.0 -I/sw/include -I/sw/include/freetype2 -I/sw/include/gtk-2.0 -I/sw/lib/gtk-2.0/include -I/sw/include/atk-1.0 -I/sw/include/cairo -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/usr/X11R6/include -I/usr/X11/include -I/sw/include -I../libsylph -DLOCALEDIR=\""/sw/share/locale"\" -DMANUALDIR=\""/sw/share/sylpheed/manual"\" -DFAQDIR=\""/sw/share/sylpheed/faq"\" -DPLUGINDIR=\""/sw/lib/sylpheed/plugins"\" -DTARGET_ALIAS=\""i386-apple-darwin10.8.0"\" -DSYSCONFDIR=\""/sw/etc"\" -I/sw/lib/system-openssl/include -I/sw/include -g -O2 -no-cpp-precomp -fno-common -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/pango-1.0 -I/sw/include -I/sw/include/freetype2 -I/sw/include/gtkspell-2.0 -I/sw/include/gtk-2.0 -I/sw/lib/gtk-2.0/include -I/sw/include/atk-1.0 -I/sw/include/cairo -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/usr/X11R6/include -I/usr/X11/include -I/sw/include/dbus-1.0 -I/sw/lib/dbus-1.0/include -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -MT folderview.o -MD -MP -MF ".deps/folderview.Tpo" \
-c -o folderview.o `test -f 'folderview.c' || echo './'`folderview.c; \
then mv -f ".deps/folderview.Tpo" ".deps/folderview.Po"; \
else rm -f ".deps/folderview.Tpo"; exit 1; \
[skipping some warnings that aren't relevant to this bug]
folderview.c: In function 'folderview_rename_folder_cb':
folderview.c:2533: error: invalid type argument of '->'
folderview.c: In function 'folderview_delete_folder_cb':
folderview.c:2723: error: invalid type argument of '->'
Happens when avfs-dev is installed, because that package supplies /sw/include/virtual.h but when folderview.c says '#include "plugin.h" it wants the one that is part of the sources being built, not some external library's. The bug is in the ordering of the -I flags: notice that some of the /sw ones come before ../libsylph rather than the universally proper "all local -I before any external/global ones" way.
#1 Updated by Daniel Macks about 4 years ago
(the fink developer, following up)
I misreported the .h to Kevin--it's actually #include "virtual.h"' that leads to the misloading (not sure if plugin.h was part of some #include spaghetti or I just copied that line from the wrong source file).
I see the same flag ordering situation in the INCLUDES of several different Makefile.am (tested on sylpheed-3.1.0 and the makefile templates look the same in the newer stable release version). Moving things like -I$(top_srcdir) -I$(top_srcdir)/src and -I$(top_srcdir)/libsylph to the beginning of that variable fixed the problem for me.