From 78e1745ef1fb86a584b7ee6f538871a46ee5c299 Mon Sep 17 00:00:00 2001 From: nokturnal Date: Wed, 15 Jun 2011 22:40:43 +0000 Subject: [PATCH] replaced hardcoded lua script and libs paths with defines, Atari build stack adjustments (reduced it's size to 8k) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1800 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 2 +- src/factory.c | 6 +++--- src/readini.c | 2 +- src/setup.c | 1 - src/setup.h | 16 ++++++++++++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index 624d40bf..91e36057 100644 --- a/src/Makefile +++ b/src/Makefile @@ -290,7 +290,7 @@ else STRIP = m68k-atari-mint-strip -s X11LOPT = COPT = -W -Wall -m68020-60 -fomit-frame-pointer -std=c99 -Wdeclaration-after-statement -D__MINT__ -ffast-math -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) - LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) -lm $(LAYERLOPT) -Wl,--stack,32k + LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) -lm $(LAYERLOPT) -Wl,--stack,8k else # Compiles a regular linux executable for the native platform diff --git a/src/factory.c b/src/factory.c index 156f9248..2bf8f503 100644 --- a/src/factory.c +++ b/src/factory.c @@ -45,7 +45,7 @@ #include "graph.h" #include "filesel.h" // Read_list_of_drives() #include "realpath.h" - +#include "setup.h" /// Lua scripts bound to shortcut keys. char * Bound_script[10]; @@ -1491,8 +1491,8 @@ void Run_script(const char *script_subdirectory, const char *script_filename) strcpy(buf, "LUA_PATH="); strcat(buf, Data_directory); - Append_path(buf+9, "scripts", NULL); - Append_path(buf+9, "libs", NULL); + Append_path(buf+9, SCRIPTS_SUBDIRECTORY, NULL); + Append_path(buf+9, LUALIB_SUBDIRECTORY, NULL); Append_path(buf+9, "?.lua", NULL); putenv(buf); diff --git a/src/readini.c b/src/readini.c index 21827b6c..0d5ae57b 100644 --- a/src/readini.c +++ b/src/readini.c @@ -945,7 +945,7 @@ int Load_INI(T_Config * conf) { // Default when empty: Realpath(Data_directory, conf->Scripts_directory); - Append_path(conf->Scripts_directory, "scripts", NULL); + Append_path(conf->Scripts_directory, SCRIPTS_SUBDIRECTORY, NULL); } conf->Allow_multi_shortcuts=0; diff --git a/src/setup.c b/src/setup.c index e1c18dfc..95160b57 100644 --- a/src/setup.c +++ b/src/setup.c @@ -89,7 +89,6 @@ void Set_program_directory(ARG_UNUSED const char * argv0,char * program_dir) #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) strcpy(program_dir,"PROGDIR:"); #elif defined(__MINT__) - static char path[1024]={0}; char currentDrive='A'; currentDrive=currentDrive+Dgetdrv(); diff --git a/src/setup.h b/src/setup.h index 67869512..369ac7ce 100644 --- a/src/setup.h +++ b/src/setup.h @@ -70,6 +70,22 @@ void Set_config_directory(const char * program_dir, char * config_dir); #define SKINS_SUBDIRECTORY "skins" #endif +/// Name of the subdirectory containing scripts +#if defined (__MINT__) + #define SCRIPTS_SUBDIRECTORY "SCRIPTS" +#else + #define SCRIPTS_SUBDIRECTORY "scripts" +#endif + +/// LUA directory prefix +#if defined (__MINT__) + #define LUALIB_SUBDIRECTORY "LIBS" +#else + #define LUALIB_SUBDIRECTORY "libs" +#endif + + + /// Name of the binary file containing some configuration settings. #if defined (__MINT__) #define CONFIG_FILENAME "GFX2.CFG"