After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 590117 - Build failure: local scandir() function collides with system's
Build failure: local scandir() function collides with system's
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: libanjuta
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-29 08:26 UTC by Daniel Macks
Modified: 2009-08-22 19:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
More portable forkpty tests (2.46 KB, patch)
2009-07-31 02:38 UTC, Daniel Macks
none Details | Review

Description Daniel Macks 2009-07-29 08:26:36 UTC
Building anjuta-2.24.2 on OS X 10.4/ppc fails:

/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare   -I/sw/include/libgnomeui-2.0 -I/sw/include/libart-2.0 -I/sw/include/gconf/2 -I/sw/include/gnome-keyring-1 -I/sw/include/libgnome-2.0 -I/sw/include/libbonoboui-2.0 -I/sw/include/libgnomecanvas-2.0 -I/sw/include/gtk-2.0 -I/sw/include/gnome-vfs-2.0 -I/sw/lib/gnome-vfs2.16/gnome-vfs-2.0/include -I/sw/include/orbit-2.0 -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 -I/sw/include/libbonobo-2.0 -I/sw/include/bonobo-activation-2.0 -I/sw/include/libxml2 -I/sw/include/pango-1.0 -I/sw/include/gail-1.0 -I/sw/include/freetype2 -I/sw/include/atk-1.0 -I/sw/lib/gtk-2.0/include -I/sw/include/cairo -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/usr/X11R6/include -I/usr/X11/include -DORBIT2=1 -I/sw/include/libglade-2.0 -I/sw/include/gtk-2.0 -I/sw/include/libxml2 -I/sw/include -I/sw/lib/gtk-2.0/include -I/sw/include/atk-1.0 -I/sw/include/cairo -I/sw/include/pango-1.0 -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/pixman-1 -I/sw/include/freetype2 -I/sw/include/libpng12 -I/usr/X11R6/include -I/usr/X11/include -I/sw/include/libxml2 -I/sw/include  -I.. -DDATADIR="\"/sw/share\"" -DPACKAGE_PIXMAPS_DIR="\"/sw/share/pixmaps/anjuta\"" -DPACKAGE_DATA_DIR="\"/sw/share/anjuta\"" -DPACKAGE_HELP_DIR="\"/sw/share/gnome/help/anjuta\"" -DPACKAGE_DOC_DIR="\"/sw/share/doc/anjuta\"" -DG_LOG_DOMAIN=\"libanjuta\" -I/sw/include -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare  -g -O2 -c -o anjuta-utils.lo anjuta-utils.c

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -I/sw/include/libgnomeui-2.0 -I/sw/include/libart-2.0 -I/sw/include/gconf/2 -I/sw/include/gnome-keyring-1 -I/sw/include/libgnome-2.0 -I/sw/include/libbonoboui-2.0 -I/sw/include/libgnomecanvas-2.0 -I/sw/include/gtk-2.0 -I/sw/include/gnome-vfs-2.0 -I/sw/lib/gnome-vfs2.16/gnome-vfs-2.0/include -I/sw/include/orbit-2.0 -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 -I/sw/include/libbonobo-2.0 -I/sw/include/bonobo-activation-2.0 -I/sw/include/libxml2 -I/sw/include/pango-1.0 -I/sw/include/gail-1.0 -I/sw/include/freetype2 -I/sw/include/atk-1.0 -I/sw/lib/gtk-2.0/include -I/sw/include/cairo -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/usr/X11R6/include -I/usr/X11/include -DORBIT2=1 -I/sw/include/libglade-2.0 -I/sw/include/gtk-2.0 -I/sw/include/libxml2 -I/sw/include -I/sw/lib/gtk-2.0/include -I/sw/include/atk-1.0 -I/sw/include/cairo -I/sw/include/pango-1.0 -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/pixman-1 -I/sw/include/freetype2 -I/sw/include/libpng12 -I/usr/X11R6/include -I/usr/X11/include -I/sw/include/libxml2 -I/sw/include -I.. -DDATADIR=\"/sw/share\" -DPACKAGE_PIXMAPS_DIR=\"/sw/share/pixmaps/anjuta\" -DPACKAGE_DATA_DIR=\"/sw/share/anjuta\" -DPACKAGE_HELP_DIR=\"/sw/share/gnome/help/anjuta\" -DPACKAGE_DOC_DIR=\"/sw/share/doc/anjuta\" -DG_LOG_DOMAIN=\"libanjuta\" -I/sw/include -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -g -O2 -c anjuta-utils.c  -fno-common -DPIC -o .libs/anjuta-utils.o

anjuta-utils.c:1160: warning: no previous prototype for 'login_tty'
anjuta-utils.c: In function 'login_tty':
anjuta-utils.c:1176: warning: implicit declaration of function 'ioctl'
anjuta-utils.c:1176: warning: nested extern declaration of 'ioctl'
anjuta-utils.c: At top level:
anjuta-utils.c:1247: warning: no previous prototype for 'openpty'
anjuta-utils.c:1385: warning: no previous prototype for 'forkpty'
anjuta-utils.c:1412: error: conflicting types for 'scandir'
/usr/include/dirent.h:119: error: previous declaration of 'scandir' was here
anjuta-utils.c: In function 'scandir':
anjuta-utils.c:1439: warning: passing argument 4 of 'qsort' from incompatible pointer type
anjuta-utils.c: In function 'anjuta_util_construct_pathv':
anjuta-utils.c:1644: warning: passing argument 2 of 'g_ptr_array_add' discards qualifiers from pointer target type
anjuta-utils.c:1652: warning: passing argument 1 of 'g_build_filenamev' from incompatible pointer type



I know this is not the current release version, but I'm having problems building dependencies for newer version, but can see that some problems still persist even into git trunk. The main one is clearly the "conflicting types" error. scandir() is a system function on my platform, and anjuta-utils.c is creating its own function of the same name (not necessarily bad...linker should find local one in preference to global) that has a different prototype (hopelessly fatal error).

More fundamentally though, I *think* the error stems from a logical flaw in configure.in:

dnl Check for function forkpty in libutil
AC_CHECK_LIB(util, forkpty)

It's a platform-centric assumtion to think "if have forkpty, it will be in libutil; if don't have libutil, then don't have forkpty". OS X 10.4 has no libutil, but does have forkpty (and related functions) in libSystem (comparable to libc on linux--always automatically linked). And OS X 10.5 has a libutil that is unrelated to forkpty (which remains in libSystem). So the build failure on OS X 10.4 results from misreading "no libutil" and therefore implementing all sorts of local compatibililty fuctions that aren't needed and don't have the proper signatures for my platform. By luck, it will probably work on OS X 10.5 because the libutil test will accidentally pass (test works but not because it actually is functionally testing what you think).

Probable solution: configure should use AC_SEARCH_LIBS (documented as "Search for a library defining FUNC, if it's not already available.") rather than AC_CHECK_LIB.
Comment 1 Johannes Schmid 2009-07-29 09:25:49 UTC
Could you try to create a patch to fix this? Of course I can make some changes here and there but it will get painful as I don't have access to a Mac (and I don't know if anybody of the developers has).

Where do you have dependency problems with the most recent version?
Comment 2 Daniel Macks 2009-07-30 20:49:40 UTC
I can't find my notes from when I had tried 2.26.x weeks ago, but I can no longer find a dep problem...all mandatory external support libs and almost all optional/plugin ones installed via fink and ./configure found them. So setting that aside, I can now reproduce the identical failure (with allowance for changed source line-numbers) using anjuta-2.26.2.2. I'll try to get time to experiment with patching it tonight.
Comment 3 Daniel Macks 2009-07-31 02:38:27 UTC
Created attachment 139603 [details] [review]
More portable forkpty tests

This patch fixes it for me (and also a secondary problem I found along the way: guessing header name/availability based on platform tokens instead of testing directly). Now configure correctly finds that I have util.h and that I don't have pty.h (the previous fallthrough assumption in anjuta-launcher.c) and that I do have forkpty() without needing -lutil. The resulting libanjuta shared library compiles fully and 'nm' says that the lib is using the forkpty symbol defined by libSystem.
Comment 4 Sébastien Granjoux 2009-08-22 19:41:07 UTC
Thanks for your report and your patch without changes.

I have applied it 10 days ago but I have forgotten to add a comment and close this bug.