]> mj.ucw.cz Git - libucw.git/commitdiff
Added CONFIG_UCW_THREADS.
authorMartin Mares <mj@ucw.cz>
Sat, 9 Dec 2006 18:47:24 +0000 (19:47 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 9 Dec 2006 18:47:24 +0000 (19:47 +0100)
Finally decided that we need threading support in too many libucw modules,
so the only sane thing is to link all programs with -lpthread. On the other
hand, I would like to keep the possibility of building non-threaded libucw,
so I've introduced a new config switch, which is always set for Sherlock.

lib/Makefile

index d26b9c25d0206aa807e33355e59012214c5888c6..2b380b5e673474dba2ddeba5f182f72b073a1084 100644 (file)
@@ -29,8 +29,7 @@ LIBUCW_MODS= \
        sync \
        qache \
        string \
-       bbuf \
-       workqueue asio
+       bbuf
 
 LIBUCW_INCLUDES= \
        lib.h config.h math.h \
@@ -53,8 +52,14 @@ LIBUCW_INCLUDES= \
        lizard.h \
        md5.h \
        base64.h base224.h \
-       qache.h \
-       workqueue.h asio.h
+       qache.h
+
+ifdef CONFIG_UCW_THREADS
+# Some modules require threading
+LIBS+=-lpthread
+LIBUCW_MODS+=workqueue asio
+LIBUCW_INCLUDES+=workqueue.h asio.h
+endif
 
 ifdef CONFIG_OWN_REGEX
 include $(s)/lib/regex/Makefile
@@ -83,9 +88,6 @@ $(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
 $(o)/lib/kmp-test: $(o)/lib/kmp-test.o $(LIBUCW) $(LIBCHARSET)
 $(o)/lib/ipaccess-test: $(o)/lib/ipaccess-test.o $(LIBUCW)
 
-$(o)/lib/workqueue-t: LIBS+=-lpthread  # FIXME
-$(o)/lib/asio-t: LIBS+=-lpthread  # FIXME
-
 TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test slists.test kmp-test.test bbuf.test asio.test)
 $(o)/lib/regex.test: $(o)/lib/regex-t
 $(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t