1. Laurens Rodriguez
  2. love

Commits

Bart van Strien  committed ca6e0c6

Make it build on linux

- Removed weird #ifdefs
- Enabled optional executable building
- Fixed exclude files, they're regexes after all

  • Participants
  • Parent commits 27da708
  • Branches default

Comments (0)

Files changed (5)

File platform/unix/configure.in

View file
  • Ignore whitespace
 AS_IF([test "x$enable_mpg123" != xno],
 	AC_SEARCH_LIBS([mpg123_seek_64], [mpg123], AC_SUBST([FILE_OFFSET],[-D_FILE_OFFSET_BITS=64]), AC_SUBST([FILE_OFFSET],[])))
 
+AC_ARG_ENABLE([exe], AC_HELP_STRING([--disable-exe], [Disable building of executable launcher]), [], [enable_exe=yes])
+AS_IF([test "x$enable_exe" != xno],
+	  AC_DEFINE([LOVE_BUILD_EXE], [], [Don't build launcher]))
+AM_CONDITIONAL([LOVE_BUILD_EXE], [test "x$enable_exe" != xno])
+
 AC_CONFIG_FILES([
 	Makefile
 	src/Makefile

File platform/unix/exclude

View file
  • Ignore whitespace
-./modules/native/tcc/libtcc/tccelf.c
-./modules/native/tcc/libtcc/x86_64-gen.c
-./modules/native/tcc/libtcc/tccasm.c
-./modules/native/tcc/libtcc/tccpp.c
-./modules/native/tcc/libtcc/il-gen.c
-./modules/native/tcc/libtcc/c67-gen.c
-./modules/native/tcc/libtcc/tcc.c
-./modules/native/tcc/libtcc/elf.h
-./modules/native/tcc/libtcc/tcccoff.c
-./modules/native/tcc/libtcc/config.h
-./modules/native/tcc/libtcc/i386-asm.h
-./modules/native/tcc/libtcc/tccpe.c
-./modules/native/tcc/libtcc/tcctok.h
-./modules/native/tcc/libtcc/arm-gen.c
-./modules/native/tcc/libtcc/i386-asm.c
-./modules/native/tcc/libtcc/i386-gen.c
-./modules/native/tcc/libtcc/tccgen.c
-./modules/native/tcc/libtcc/tcc.h
-./modules/native/tcc/libtcc/il-opcodes.h
-./modules/native/tcc/libtcc/coff.h
-./modules/native/tcc/libtcc/stab.h
-./libraries/luasocket/libluasocket/wsocket.*
-./modules/sound/lullaby/FLACDecoder.*
-./modules/thread/sdl/*
-./modules/thread/win32/*
-./modules/thread/posix/*
-./love.cpp
+\./modules/native/tcc/libtcc/tccelf\.c
+\./modules/native/tcc/libtcc/x86_64-gen\.c
+\./modules/native/tcc/libtcc/tccasm\.c
+\./modules/native/tcc/libtcc/tccpp\.c
+\./modules/native/tcc/libtcc/il-gen\.c
+\./modules/native/tcc/libtcc/c67-gen\.c
+\./modules/native/tcc/libtcc/tcc\.c
+\./modules/native/tcc/libtcc/elf\.h
+\./modules/native/tcc/libtcc/tcccoff\.c
+\./modules/native/tcc/libtcc/config\.h
+\./modules/native/tcc/libtcc/i386-asm\.h
+\./modules/native/tcc/libtcc/tccpe\.c
+\./modules/native/tcc/libtcc/tcctok\.h
+\./modules/native/tcc/libtcc/arm-gen\.c
+\./modules/native/tcc/libtcc/i386-asm\.c
+\./modules/native/tcc/libtcc/i386-gen\.c
+\./modules/native/tcc/libtcc/tccgen\.c
+\./modules/native/tcc/libtcc/tcc\.h
+\./modules/native/tcc/libtcc/il-opcodes\.h
+\./modules/native/tcc/libtcc/coff\.h
+\./modules/native/tcc/libtcc/stab\.h
+\./libraries/luasocket/libluasocket/wsocket\.*
+\./modules/sound/lullaby/FLACDecoder\.*
+\./modules/thread/sdl/*
+\./modules/thread/win32/*
+\./modules/thread/posix/*
+\./love\.cpp

File platform/unix/gen-makefile

View file
  • Ignore whitespace
 AUTOMAKE_OPTIONS = subdir-objects
 SUBDIRS =
 
+if LOVE_BUILD_EXE
 # LÖVE executable
 bin_PROGRAMS = love
 #love_LDFLAGS =
 love_LDADD = liblove.la
 love_SOURCES = love.cpp
+endif
 
 # libLÖVE
 lib_LTLIBRARIES = liblove.la

File src/modules/love/love.cpp

View file
  • Ignore whitespace
 #include <fstream>
 #endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
 
-#ifdef LOVE_BUILD_EXE
-
 // Libraries.
 #include "libraries/luasocket/luasocket.h"
 
 // Scripts
 #include "scripts/boot.lua.h"
 
-#endif // LOVE_BUILD_EXE
-
-#ifdef LOVE_BUILD_STANDALONE
-
 // All modules define a c-accessible luaopen
 // so let's make use of those, instead
 // of addressing implementations directly.
 	{ 0, 0 }
 };
 
-#endif // LOVE_BUILD_STANDALONE
-
 #ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK
 int w__openConsole(lua_State * L);
 #endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
 
-extern "C" LOVE_EXPORT const char *love_version()
+const char *love_version()
 {
 	return love::VERSION;
 }
 
-extern "C" LOVE_EXPORT const char *love_codename()
+const char *love_codename()
 {
 	return love::VERSION_CODENAME;
 }
 
-extern "C" LOVE_EXPORT int luaopen_love(lua_State * L)
+int luaopen_love(lua_State * L)
 {
 	love::luax_insistglobal(L, "love");
 
 #endif
 	lua_setfield(L, -2, "_os");
 
-#ifdef LOVE_BUILD_STANDALONE
-
 	// Preload module loaders.
 	for (int i = 0; modules[i].name != 0; i++)
 	{
 
 	love::luasocket::__open(L);
 
-#endif // LOVE_BUILD_STANDALONE
-
 	return 1;
 }
 
 
 #endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
 
-extern "C" LOVE_EXPORT int luaopen_love_boot(lua_State *L)
+int luaopen_love_boot(lua_State *L)
 {
 	if (luaL_loadbuffer(L, (const char *)love::boot_lua, sizeof(love::boot_lua), "boot.lua") == 0)
 	lua_call(L, 0, 1);

File src/modules/love/love.h

View file
  • Ignore whitespace
 // Forward declare lua_State.
 struct lua_State;
 
-extern "C" LOVE_EXPORT const char *love_version();
-extern "C" LOVE_EXPORT const char *love_codename();
-extern "C" LOVE_EXPORT int luaopen_love(lua_State *L);
-extern "C" LOVE_EXPORT int luaopen_love_boot(lua_State *L);
+extern "C"
+{
+	LOVE_EXPORT const char *love_version();
+	LOVE_EXPORT const char *love_codename();
+	LOVE_EXPORT int luaopen_love(lua_State *L);
+	LOVE_EXPORT int luaopen_love_boot(lua_State *L);
+}