From 55a17051755769cfea9ea4fea50f80be8887734c Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 19 Dec 2015 14:51:01 +0000 Subject: glib_compile_schemas: links against gio, gobject and gmodule. Otherwise build fails on Haiku. diff --git a/gio/Makefile.am b/gio/Makefile.am index b2db995..c82f05c 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -817,7 +817,11 @@ gio_querymodules_LDADD = libgio-2.0.la \ gconstructor_as_data.h: $(top_srcdir)/glib/gconstructor.h data-to-c.pl $(AM_V_GEN) $(srcdir)/data-to-c.pl $(top_srcdir)/glib/gconstructor.h gconstructor_code > $@.tmp && mv $@.tmp $@ -glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la +glib_compile_schemas_LDADD = libgio-2.0.la \ + $(top_builddir)/gobject/libgobject-2.0.la \ + $(top_builddir)/gmodule/libgmodule-2.0.la \ + $(top_builddir)/glib/libglib-2.0.la \ + $(NULL) glib_compile_schemas_SOURCES = \ gconstructor_as_data.h \ gvdb/gvdb-format.h \ -- 2.13.1 From e8cd3bc56e49a31380e516a611b81ddb171c06de Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 19 Dec 2015 14:59:42 +0000 Subject: configure.ac: on Haiku * don't use -pthread * use -lbe -lroot as thread related libs. diff --git a/configure.ac b/configure.ac index 09fa3b4..6f23523 100644 --- a/configure.ac +++ b/configure.ac @@ -154,6 +154,9 @@ case "$host" in ;; esac case $host in + *-*-haiku*) + LIBS="-lnetwork $LIBS" + ;; *-*-linux*) glib_os_linux=yes ;; @@ -1922,8 +1925,8 @@ AS_IF([ test x"$have_threads" = xposix], [ # One of them does for most gcc versions and some other platforms/compilers # too and could be considered as the canonical way to go. case $host in - *-*-cygwin*|*-*-darwin*) - # skip cygwin and darwin -pthread or -pthreads test + *-*-cygwin*|*-*-darwin*|*-*-haiku*) + # skip cygwin, darwin and haiku -pthread or -pthreads test ;; *-solaris*) # These compiler/linker flags work with both Sun Studio and gcc @@ -2088,6 +2091,15 @@ if test "x$G_THREAD_LIBS" = xerror; then AC_MSG_ERROR($LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2) fi +case $host in + *-*-haiku*) + G_THREAD_LIBS="-lbe -lroot" + G_THREAD_LIBS_EXTRA="-L\$(top_builddir_full)/.libs" + ;; + *) + ;; +esac + AC_MSG_CHECKING(thread related libraries) AC_MSG_RESULT($G_THREAD_LIBS) -- 2.13.1 From ebdda5ed9978ae6272df99f6e8cadf42f3a50e27 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 29 Jul 2017 12:13:00 +0200 Subject: g_dbus_message_print: use B_PRIiDEV on Haiku because Haiku doesn't define major() and minor() diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c index e80794f..7c68f57 100644 --- a/gio/gdbusmessage.c +++ b/gio/gdbusmessage.c @@ -33,8 +33,12 @@ #elif MAJOR_IN_SYSMACROS #include #else +#ifdef __HAIKU__ +#include +#else #define MAJOR_MINOR_NOT_FOUND 1 #endif +#endif #include "gdbusutils.h" #include "gdbusmessage.h" @@ -3478,9 +3482,14 @@ g_dbus_message_print (GDBusMessage *message, if (fstat (fds[n], &statbuf) == 0) { #ifndef MAJOR_MINOR_NOT_FOUND +#ifdef __HAIKU__ + g_string_append_printf (fs, "%s" "dev=%" B_PRIiDEV, fs->len > 0 ? "," : "", + statbuf.st_dev); +#else g_string_append_printf (fs, "%s" "dev=%d:%d", fs->len > 0 ? "," : "", major (statbuf.st_dev), minor (statbuf.st_dev)); #endif +#endif g_string_append_printf (fs, "%s" "mode=0%o", fs->len > 0 ? "," : "", statbuf.st_mode); g_string_append_printf (fs, "%s" "ino=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", @@ -3490,9 +3499,14 @@ g_dbus_message_print (GDBusMessage *message, g_string_append_printf (fs, "%s" "gid=%u", fs->len > 0 ? "," : "", (guint) statbuf.st_gid); #ifndef MAJOR_MINOR_NOT_FOUND +#ifdef __HAIKU__ + g_string_append_printf (fs, "%s" "rdev=%" B_PRIiDEV, fs->len > 0 ? "," : "", + statbuf.st_rdev); +#else g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "", major (statbuf.st_rdev), minor (statbuf.st_rdev)); #endif +#endif g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", (guint64) statbuf.st_size); g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "", -- 2.13.1 From bca36b1e71dc29ed71b628f1b87917498a375147 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 29 Jul 2017 12:19:31 +0200 Subject: gunixmounts.c: on Haiku * define get_mtab_minitor_file() and _g_get_unix_mounts() * like Inerix, _g_get_unix_mount_points() calls _g_get_unix_mounts(). diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c index ce6a2fc..dac4c05 100644 --- a/gio/gunixmounts.c +++ b/gio/gunixmounts.c @@ -837,7 +837,18 @@ _g_get_unix_mounts (void) return return_list; } +#elif defined(__HAIKU__) +static char * +get_mtab_monitor_file (void) +{ + return NULL; +} +static GList * +_g_get_unix_mounts (void) +{ + return NULL; +} /* Common code {{{2 */ #else #error No _g_get_unix_mounts() implementation for system @@ -1348,8 +1359,8 @@ _g_get_unix_mount_points (void) return g_list_reverse (return_list); } -/* Interix {{{2 */ -#elif defined(__INTERIX) +/* Interix, Haiku {{{2 */ +#elif defined(__INTERIX) || defined(__HAIKU__) static GList * _g_get_unix_mount_points (void) { -- 2.13.1 From cc4f7378d24f874c0483360b356f0a88f673d5cc Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 29 Jul 2017 12:32:14 +0200 Subject: glib/gutils.c: on Haiku define load_user_special_dirs() use find_directory() from SupportDefs.h diff --git a/glib/gutils.c b/glib/gutils.c index 099bba5..7fbee2d 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -69,6 +69,10 @@ #include "gwin32.h" #endif +#if defined(__HAIKU__) +#include +#include +#endif /** * SECTION:misc_utils @@ -1431,6 +1435,35 @@ load_user_special_dirs (void) g_user_special_dirs[G_USER_DIRECTORY_VIDEOS] = find_folder (kMovieDocumentsFolderType); } +#elif defined(__HAIKU__) +static void +load_user_special_dirs (void) +{ + char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH]; + + dev_t volume = dev_for_path("/boot"); + if (find_directory(B_DESKTOP_DIRECTORY, volume, false, path, sizeof(path)) + == B_OK) { + g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = g_strdup(path); + g_user_special_dirs[G_USER_DIRECTORY_DOWNLOAD] = g_strdup(path); + } else { + g_user_special_dirs[G_USER_DIRECTORY_DOCUMENTS] = NULL; + g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = NULL; + } + + if (find_directory(B_USER_DIRECTORY, volume, false, path, sizeof(path)) + == B_OK) { + g_user_special_dirs[G_USER_DIRECTORY_DOCUMENTS] = g_strdup(path); + } else + g_user_special_dirs[G_USER_DIRECTORY_DOWNLOAD] = NULL; + + g_user_special_dirs[G_USER_DIRECTORY_MUSIC] = NULL; + g_user_special_dirs[G_USER_DIRECTORY_PICTURES] = NULL; + g_user_special_dirs[G_USER_DIRECTORY_PUBLIC_SHARE] = NULL; + g_user_special_dirs[G_USER_DIRECTORY_TEMPLATES] = NULL; + g_user_special_dirs[G_USER_DIRECTORY_VIDEOS] = NULL; +} + #elif defined(G_OS_WIN32) static void -- 2.13.1 From 10bb92c8389573bf0a4b42b42339da4bd75413c5 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Wed, 20 Sep 2017 18:09:43 +0200 Subject: configure.ac: define G_OS_HAIKU diff --git a/configure.ac b/configure.ac index 6f23523..a09db90 100644 --- a/configure.ac +++ b/configure.ac @@ -3231,6 +3231,10 @@ g_pid_format="\"$glib_pid_format\"" g_pollfd_format="\"$glib_pollfd_format\"" case $host in + *-*-haiku*) + glib_os="#define G_OS_UNIX +#define G_OS_HAIKU" + ;; *-*-cygwin*) glib_os="#define G_OS_UNIX #define G_PLATFORM_WIN32 -- 2.13.1