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@
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
-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
$(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
### 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