Fixed linking on things that need -ldl, and compiler warnings.

This commit is contained in:
Ryan C. Gordon 2017-06-02 01:39:03 -04:00
parent cd4aa2d9a9
commit 063875e89a
2 changed files with 10 additions and 2 deletions

View File

@ -376,6 +376,7 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")
THREAD_LIBS=-lpthread THREAD_LIBS=-lpthread
LIBS=-ldl -lm LIBS=-ldl -lm
AUTOUPDATER_LIBS += -ldl
CLIENT_LIBS=$(SDL_LIBS) CLIENT_LIBS=$(SDL_LIBS)
RENDERER_LIBS = $(SDL_LIBS) -lGL RENDERER_LIBS = $(SDL_LIBS) -lGL
@ -834,6 +835,8 @@ ifeq ($(PLATFORM),irix64)
SHLIBLDFLAGS=-shared SHLIBLDFLAGS=-shared
LIBS=-ldl -lm -lgen LIBS=-ldl -lm -lgen
AUTOUPDATER_LIBS += -ldl
# FIXME: The X libraries probably aren't necessary? # FIXME: The X libraries probably aren't necessary?
CLIENT_LIBS=-L/usr/X11/$(LIB) $(SDL_LIBS) \ CLIENT_LIBS=-L/usr/X11/$(LIB) $(SDL_LIBS) \
-lX11 -lXext -lm -lX11 -lXext -lm
@ -888,6 +891,7 @@ ifeq ($(PLATFORM),sunos)
THREAD_LIBS=-lpthread THREAD_LIBS=-lpthread
LIBS=-lsocket -lnsl -ldl -lm LIBS=-lsocket -lnsl -ldl -lm
AUTOUPDATER_LIBS += -ldl
BOTCFLAGS=-O0 BOTCFLAGS=-O0

View File

@ -59,9 +59,13 @@ void Sys_LaunchAutoupdater(int argc, char **argv)
char *ptr = strrchr(argv[0], '/'); char *ptr = strrchr(argv[0], '/');
if (ptr) if (ptr)
*ptr = '\0'; *ptr = '\0';
chdir(argv[0]); if (chdir(argv[0]) == -1) {
_exit(1); /* oh well. */
}
#ifdef __APPLE__ #ifdef __APPLE__
chdir("../.."); /* put this at base of app bundle so paths make sense later. */ if (chdir("../..") == -1) { /* put this at base of app bundle so paths make sense later. */
_exit(1); /* oh well. */
}
#endif #endif
snprintf(pidstr, sizeof (pidstr), "%lld", (long long) getppid()); snprintf(pidstr, sizeof (pidstr), "%lld", (long long) getppid());
execl(AUTOUPDATER_BIN, AUTOUPDATER_BIN, "--waitpid", pidstr, NULL); execl(AUTOUPDATER_BIN, AUTOUPDATER_BIN, "--waitpid", pidstr, NULL);