fixed -pthread
authorJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 10 Sep 2012 11:00:20 +0000 (11:00 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 10 Sep 2012 11:00:20 +0000 (11:00 +0000)
configure.ac
src/Makefile.am
src/server/Makefile.am

index 8088332..e8dc011 100644 (file)
@@ -19,7 +19,6 @@ AC_PROG_RANLIB
 # Checks for header files.
 AC_PATH_X
 AC_CHECK_HEADERS([stdbool.h])
-AC_CHECK_HEADERS(pthread.h,, [AC_MSG_ERROR([pthread.h required])])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_SIZE_T
@@ -45,7 +44,9 @@ AM_GCONF_SOURCE_2
 ############### common 
 
 # Checks pthread
-AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"])
+AC_CHECK_LIB(pthread, pthread_create)
+PTHREAD_LIBS=-pthread
+AC_SUBST(PTHREAD_LIBS)
 
 # Checks sensors, required by psensor and psensor-server
 AC_CHECK_LIB(sensors, sensors_init)
index ee0c83f..9529e64 100644 (file)
@@ -22,6 +22,7 @@ LIBS = \
        lib/libpsensor.a \
        $(GTK_LIBS)\
        $(GCONF_LIBS)\
+       $(PTHREAD_LIBS)\
        $(SENSORS_LIBS)
 
 bin_PROGRAMS = psensor
index d5873f8..0697e58 100644 (file)
@@ -14,7 +14,8 @@ LIBS = \
        ../lib/libpsensor.a \
        $(SENSORS_LIBS) \
        $(JSON_LIBS) \
-       $(LIBMICROHTTPD_LIBS)
+       $(LIBMICROHTTPD_LIBS) \
+       $(PTHREAD_LIBS)
 
 if GTOP
 AM_CPPFLAGS += $(GTOP_CFLAGS)
@@ -32,4 +33,4 @@ dist_man_MANS =  psensor-server.1
 EXTRA_DIST = description.txt
 psensor-server.1: server.c $(top_srcdir)/configure.ac
        $(MAKE) $(AM_MAKEFLAGS) psensor-server$(EXEEXT)
-       help2man --include=description.txt -N --name="Temperature and system monitoring Web server" --output=psensor-server.1 ./psensor-server$(EXEEXT)
\ No newline at end of file
+       help2man --include=description.txt -N --name="Temperature and system monitoring Web server" --output=psensor-server.1 ./psensor-server$(EXEEXT)