From 9045675625d6ca5bc0c56bbd2be5498ab99776b9 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Mon, 5 Jan 2015 17:41:59 +0100 Subject: [PATCH 1/3] Apply original lmarbles patch --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 543fb95..b012313 100755 --- a/configure +++ b/configure @@ -5154,7 +5154,7 @@ if test "${ac_cv_lib_m_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" +LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5208,7 +5208,7 @@ if test $ac_cv_lib_m_main = yes; then #define HAVE_LIBM 1 _ACEOF - LIBS="-lm $LIBS" + LIBS="$LIBS" else { { echo "$as_me:$LINENO: error: lib math is needed" >&5 -- 1.8.3.4 From a5a1d08c9a5754c3f790088cec87de41a6ac84c5 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Mon, 5 Jan 2015 17:54:53 +0100 Subject: [PATCH 2/3] Have lmarbles use find_directory for config --- src/cfg.c | 10 ++++++++-- src/profile.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index 2831c1b..4d713f5 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -25,6 +25,10 @@ #include #include +#ifdef __HAIKU__ +#include +#endif + #ifdef _WIN32 #define MKDIR(d, p) mkdir(d) #else @@ -40,14 +44,16 @@ Cfg cfg; void C_StPth() { DIR *dir; -#ifdef _WIN32 +#if defined(__HAIKU__) + find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, c_pth, sizeof(c_pth) - 1); +#elif defined(_WIN32) snprintf( c_pth, sizeof(c_pth)-1, "%s/lgames", (getenv( "HOME" )?getenv( "HOME" ):".") ); #else snprintf( c_pth, sizeof(c_pth)-1, "%s/.lgames", getenv( "HOME" ) ); #endif /* create .lgames directory if not found */ if ( (dir = opendir( c_pth )) == 0 ) { - fprintf( stderr, "Config directory ~/.lgames not found. Creating it.\n" ); + fprintf( stderr, "Config directory %s not found. Creating it.\n", c_pth ); MKDIR( c_pth, S_IRWXU ); } else diff --git a/src/profile.c b/src/profile.c index 218c856..9ebf47b 100644 --- a/src/profile.c +++ b/src/profile.c @@ -22,6 +22,10 @@ #include "cfg.h" #include "file.h" +#ifdef __HAIKU__ +#include +#endif + // profiles // DLst prfs; // string list for the menu // @@ -38,8 +42,13 @@ void Prf_Ini() DL_Ini(&prfs); prfs.flgs = DL_AUTODEL; prfs.cb = Prf_Del; - +#ifdef __HAIKU__ + find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, prf_pth, + sizeof(prf_pth) - 1); + strcat(prf_pth, "/lmarbles.prfs"); +#else sprintf(prf_pth, "%s/lmarbles.prfs", PRF_DIR); +#endif } /* terminate profiles; must be saved first */ -- 1.8.3.4 From b956be01acbcbf76175ee3a2303f87a99e501320 Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Wed, 14 Jan 2015 18:38:13 +0000 Subject: [PATCH 3/3] Move lmarbles config to LGames folder --- src/cfg.c | 6 +++++- src/profile.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index 4d713f5..d9ec8f0 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -27,6 +27,7 @@ #ifdef __HAIKU__ #include +#include #endif #ifdef _WIN32 @@ -45,7 +46,10 @@ void C_StPth() { DIR *dir; #if defined(__HAIKU__) - find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, c_pth, sizeof(c_pth) - 1); + size_t length; + find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, c_pth, sizeof(c_pth) - 1); + length = strlen(c_pth); + snprintf( c_pth+length, sizeof(c_pth)-(1+length), "/LGames" ); #elif defined(_WIN32) snprintf( c_pth, sizeof(c_pth)-1, "%s/lgames", (getenv( "HOME" )?getenv( "HOME" ):".") ); #else diff --git a/src/profile.c b/src/profile.c index 9ebf47b..927f217 100644 --- a/src/profile.c +++ b/src/profile.c @@ -24,6 +24,7 @@ #ifdef __HAIKU__ #include +#include #endif // profiles // @@ -39,13 +40,16 @@ extern Cfg cfg; /* initialize dyn list and source path */ void Prf_Ini() { + size_t length; DL_Ini(&prfs); prfs.flgs = DL_AUTODEL; prfs.cb = Prf_Del; #ifdef __HAIKU__ find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, prf_pth, sizeof(prf_pth) - 1); - strcat(prf_pth, "/lmarbles.prfs"); + length = strlen(prf_pth); + snprintf(prf_pth + length, sizeof(prf_pth)-(1+length), + "/LGames/lmarbles.prfs"); #else sprintf(prf_pth, "%s/lmarbles.prfs", PRF_DIR); #endif -- 1.8.3.4