diff --git a/GNUmakefile.in b/GNUmakefile.in index 02475541..6c58ab9e 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -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 diff --git a/Make.mk b/Make.mk index ddee0722..7ba5f46a 100644 --- a/Make.mk +++ b/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 diff --git a/configure.ac b/configure.ac index 2faa2427..9157b197 100644 --- a/configure.ac +++ b/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