Clean up autoconfiguration of libraries
Make configure compute three sets of libraries: LIBS_client for the client, LIBS_server for the server, and LIBS for the rest. This replaces termlibs. Unfortunately, LIBS doesn't work with Windows, because src/lib/w32/posixio.c pulls in socket stuff. Temporary workaround: use LIBS_server instead.
This commit is contained in:
parent
55d0d975a5
commit
8b7786340e
3 changed files with 16 additions and 12 deletions
|
@ -43,7 +43,9 @@ CFLAGS := @CFLAGS@
|
|||
CPPFLAGS := @CPPFLAGS@ @DEFS@
|
||||
LDFLAGS := @LDFLAGS@
|
||||
LIBOBJS := @LIBOBJS@
|
||||
LDLIBS := @LIBS@
|
||||
LDLIBS := @LIBS@ -lm
|
||||
LIBS_client := @LIBS_client@ -lm
|
||||
LIBS_server := @LIBS_server@ -lm
|
||||
empthread := @empthread@
|
||||
ifeq ($(empthread),POSIX)
|
||||
CC := @PTHREAD_CC@
|
||||
|
@ -54,7 +56,6 @@ endif
|
|||
ifeq ($(empthread),Windows)
|
||||
CFLAGS := $(CFLAGS) -mthreads
|
||||
endif
|
||||
termlibs := @termlibs@
|
||||
CCDEPMODE := @CCDEPMODE@
|
||||
@am__fastdepCC_TRUE@how_to_dep := fast
|
||||
@am__fastdepCC_FALSE@@AMDEP_TRUE@how_to_dep := depcomp
|
||||
|
|
10
Make.mk
10
Make.mk
|
@ -160,8 +160,12 @@ CFLAGS += -Wall -W -Wno-unused-parameter -Wpointer-arith \
|
|||
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs \
|
||||
-Wredundant-decls
|
||||
endif
|
||||
LDLIBS += -lm
|
||||
$(client): LDLIBS += $(termlibs)
|
||||
ifeq ($(empthread),Windows) # really: W32, regardless of thread package
|
||||
# FIXME split src/lib/w32/posixio.c
|
||||
LDLIBS := $(LIBS_server)
|
||||
endif
|
||||
$(client): LDLIBS := $(LIBS_client)
|
||||
$(server): LDLIBS := $(LIBS_server)
|
||||
|
||||
### Advertized goals
|
||||
|
||||
|
@ -275,7 +279,7 @@ $(server): $(filter src/server/% src/lib/commands/% src/lib/player/% src/lib/sub
|
|||
|
||||
$(client): $(filter src/client/%, $(obj)) src/lib/global/version.o
|
||||
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
|
||||
ifeq ($(empthread),Windows)
|
||||
ifeq ($(empthread),Windows) # really: W32, regardless of thread package
|
||||
$(client): src/lib/w32/getopt.o
|
||||
endif
|
||||
|
||||
|
|
13
configure.ac
13
configure.ac
|
@ -69,16 +69,15 @@ MY_WINDOWS_API
|
|||
|
||||
### Checks for libraries
|
||||
ACX_PTHREAD
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$LIBS_SOCKETS $LIBS"
|
||||
LIB_SOCKET_NSL
|
||||
|
||||
# TODO turn this into a macro?
|
||||
save_LIBS=$LIBS
|
||||
LIBS_server="$LIBS"
|
||||
AC_SEARCH_LIBS([setupterm], [termlib termcap curses ncurses])
|
||||
# FIXME if not found, complain and switch off highlighting
|
||||
termlibs=`echo $LIBS | sed s/\`echo $save_LIBS | sed 's/././g'\`'$//'`
|
||||
AC_SUBST(termlibs)
|
||||
LIBS=$save_LIBS
|
||||
LIBS_client="$LIBS"
|
||||
LIBS="$save_LIBS"
|
||||
AC_SUBST(LIBS_server)
|
||||
AC_SUBST(LIBS_client)
|
||||
|
||||
|
||||
### Checks for header files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue