[anjuta] bgo #590117 – Build failure: local scandir() function collides with system's



commit 9c498e65db05feebda5a7daa439f9f1244acd9c1
Author: Daniel Macks <dmacks netspace org>
Date:   Tue Aug 11 22:07:38 2009 +0200

    bgo #590117 â?? Build failure: local scandir() function collides with system's

 configure.in                  |    5 +++--
 libanjuta/anjuta-launcher.c   |   10 +++++++---
 libanjuta/anjuta-utils-priv.h |    4 ++--
 libanjuta/anjuta-utils.c      |    4 ++--
 4 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/configure.in b/configure.in
index 64fb322..352af46 100644
--- a/configure.in
+++ b/configure.in
@@ -387,8 +387,9 @@ fi
 dnl Check for bind in libsocket (needed on Solaris)
 AC_CHECK_LIB(socket, bind)
 
-dnl Check for function forkpty in libutil
-AC_CHECK_LIB(util, forkpty)
+dnl Check for function forkpty and related headers
+AC_SEARCH_LIBS(forkpty, util, , AC_DEFINE(EMULATE_FORKPTY, [], [Need  to implement our own forkpty()]))
+AC_CHECK_HEADERS(libutil.h util.h pty.h)
 
 dnl Checks for library functions.
 AC_CHECK_FUNCS(fnmatch)
diff --git a/libanjuta/anjuta-launcher.c b/libanjuta/anjuta-launcher.c
index a79c582..3f4caab 100644
--- a/libanjuta/anjuta-launcher.c
+++ b/libanjuta/anjuta-launcher.c
@@ -36,11 +36,15 @@
 #include <fcntl.h>
 #include <signal.h>
 
-#if defined(__FreeBSD__)
+/* not sure if any platform has more than one of these, so play it
+   safe and use any-and-all-found rather than elif fallback */
+#ifdef HAVE_LIBUTIL_H
 #  include <libutil.h>
-#elif defined(__OpenBSD__) || defined(__NetBSD__)
+#endif
+#ifdef HAVE_UTIL_H
 #  include <util.h>
-#elif !defined(__sun)
+#endif
+#ifdef HAVE_PTY_H
 #  include <pty.h>
 #endif
 
diff --git a/libanjuta/anjuta-utils-priv.h b/libanjuta/anjuta-utils-priv.h
index 9c9fa7a..0325ce0 100644
--- a/libanjuta/anjuta-utils-priv.h
+++ b/libanjuta/anjuta-utils-priv.h
@@ -22,9 +22,9 @@
 
 #include "config.h"
 
-#ifndef HAVE_LIBUTIL
+#ifdef EMULATE_FORKPTY
 #include <grp.h>
 int forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp);
-#endif /* HAVE_LIBUTIL */
+#endif /* EMULATE_FORKPTY */
 
 #endif
diff --git a/libanjuta/anjuta-utils.c b/libanjuta/anjuta-utils.c
index 581a068..03cb663 100644
--- a/libanjuta/anjuta-utils.c
+++ b/libanjuta/anjuta-utils.c
@@ -1358,7 +1358,7 @@ anjuta_util_get_local_path_from_uri (const gchar *uri)
 	return local_path;
 }
 
-#ifndef HAVE_LIBUTIL
+#ifdef EMULATE_FORKPTY
 #include <grp.h>
 
 static int ptym_open (char *pts_name);
@@ -1650,7 +1650,7 @@ int scandir(const char *dir, struct dirent ***namelist,
   return(i);
 }
 
-#endif /* HAVE_LIBUTIL */
+#endif /* EMULATE_FORKPTY */
 
 void
 anjuta_util_help_display (GtkWidget   *parent,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]