shaunlebron / blinky

Exploring peripheral vision in games (using Quake)
MIT License
687 stars 26 forks source link

Create binary for Linux #74

Closed shaunlebron closed 9 years ago

shaunlebron commented 9 years ago

Can't seem to create a build on Ubuntu. I get linker errors saying that it can't find dlclose symbol in glibc. I added dl to libs, and still wasn't fixed:

$ ./build.sh 

Building engine...
~/code/blinky/engine ~/code/blinky
Compile Options:
.        DEBUG = N
.    TARGET_OS = UNIX
.  TARGET_UNIX = linux
.  USE_X86_ASM = N
.    CD_TARGET = linux
.   SND_TARGET = oss
.   VID_TARGET = x11
.    IN_TARGET = x11
.  USE_XF86DGA = Y
  LINK     bin/tyr-quake
/usr/bin/ld: /usr/local/lib/liblua.a(loadlib.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [bin/tyr-quake] Error 1
thoemy commented 9 years ago

It builds und runs fine for me on Debian unstable after installing liblua5.2-dev and applying the following changes.

diff --git a/engine/Makefile b/engine/Makefile
index 5b15aa8..9cb9a83 100644
--- a/engine/Makefile
+++ b/engine/Makefile
@@ -825,9 +825,9 @@ endif
 QWSV_LFLAGS += -mconsole
 endif
 ifeq ($(TARGET_OS),UNIX)
-COMMON_CPPFLAGS += -DELF
+COMMON_CPPFLAGS += -DELF $(shell pkg-config --cflags lua5.2)
 COMMON_OBJS += net_udp.o sys_unix.o
-COMMON_LIBS += m lua
+COMMON_LIBS += m lua5.2
 NQCL_OBJS   += net_bsd.o

 # FIXME - stupid hack

Where's your LUA installation coming from? As it's installed in /usr/local so it's not from the official repo.

shaunlebron commented 9 years ago

Thanks @thoemy. I was building Lua from source and using its make install process. details here

Will give this a try and update the Makefile if all goes well. Are there any complications with distributing a binary like this to linux users? I'm not familiar with this space.

SpiritQuaddicted commented 9 years ago

Built out of the box on Archlinux for me, dependencies were 'libxxf86vm' 'libxxf86dga' 'lua>=5.2'.

shaunlebron commented 9 years ago

Thanks @thoemy! I just updated the Makefile to use your parameters if it detects Debian.

I'm going to close this and not create a binary for linux since users are used to building, and I'm not sure how to build a binary for all linux distros.