[gnome-builder] libide: find GNU make via configure instead of hard-coding make



commit 2aba813bf40cdd1b4407a44ef9a716ec2385257d
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Sun Mar 29 02:14:08 2015 +0800

    libide: find GNU make via configure instead of hard-coding make
    
    As nearly all GNOME modules require GNU make to build, we should always
    use GNU make instead of using the default make. Most BSD systems use
    BSD make as their default, so we should use "gmake" instead of "make"
    on these systems. We still fallback to "make" because some GNU/Linux
    distributions don't have an executable called "gmake".
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747187

 build/autotools/autoconf.d/50_progs.post-am |    2 ++
 libide/autotools/ide-autotools-build-task.c |    6 +++++-
 libide/autotools/ide-makecache.c            |    8 ++++++--
 libide/ide-highlight-index.c                |    1 +
 4 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/build/autotools/autoconf.d/50_progs.post-am b/build/autotools/autoconf.d/50_progs.post-am
index 449006f..205eb27 100644
--- a/build/autotools/autoconf.d/50_progs.post-am
+++ b/build/autotools/autoconf.d/50_progs.post-am
@@ -1 +1,3 @@
 AC_PROG_INSTALL
+AC_CHECK_PROG([GMAKE], [gmake], [gmake], [make])
+AC_DEFINE_UNQUOTED([GNU_MAKE_NAME], ["$GMAKE"], [Name of GNU make on this system])
diff --git a/libide/autotools/ide-autotools-build-task.c b/libide/autotools/ide-autotools-build-task.c
index 732a8b7..09412c0 100644
--- a/libide/autotools/ide-autotools-build-task.c
+++ b/libide/autotools/ide-autotools-build-task.c
@@ -16,6 +16,10 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <fcntl.h>
 #include <glib/gi18n.h>
 #include <unistd.h>
@@ -910,7 +914,7 @@ step_make_all  (GTask                 *task,
     {
       const gchar *target = targets [i];
 
-      process = log_and_spawn (self, launcher, &error, "make", target, state->parallel, NULL);
+      process = log_and_spawn (self, launcher, &error, GNU_MAKE_NAME, target, state->parallel, NULL);
 
       if (!process)
         {
diff --git a/libide/autotools/ide-makecache.c b/libide/autotools/ide-makecache.c
index 145ae19..451485a 100644
--- a/libide/autotools/ide-makecache.c
+++ b/libide/autotools/ide-makecache.c
@@ -19,6 +19,10 @@
 
 #define G_LOG_DOMAIN "ide-makecache"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -631,7 +635,7 @@ ide_makecache_new_worker (GTask        *task,
   launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
   g_subprocess_launcher_set_cwd (launcher, workdir);
   g_subprocess_launcher_take_stdout_fd (launcher, fdcopy);
-  subprocess = g_subprocess_launcher_spawn (launcher, &error, "make", "-p", "-n", "-s", NULL);
+  subprocess = g_subprocess_launcher_spawn (launcher, &error, GNU_MAKE_NAME, "-p", "-n", "-s", NULL);
 
   if (!subprocess)
     {
@@ -854,7 +858,7 @@ ide_makecache_get_file_flags_worker (GTask        *task,
         relpath++;
 
       argv = g_ptr_array_new ();
-      g_ptr_array_add (argv, "make");
+      g_ptr_array_add (argv, GNU_MAKE_NAME);
       g_ptr_array_add (argv, "-C");
       g_ptr_array_add (argv, (gchar *)(subdir ?: "."));
       g_ptr_array_add (argv, "-s");
diff --git a/libide/ide-highlight-index.c b/libide/ide-highlight-index.c
index c12d5f5..1c92119 100644
--- a/libide/ide-highlight-index.c
+++ b/libide/ide-highlight-index.c
@@ -19,6 +19,7 @@
 #define G_LOG_DOMAIN "ide-highlight-index"
 
 #include <string.h>
+#include <sys/types.h>
 #include <sys/user.h>
 
 #include "ide-debug.h"


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