allow to build psensor-server even if gtk/gconf/x11/xext is not present
[psensor.git] / src / Makefile.am
index c3641a3..da2b590 100644 (file)
@@ -1,6 +1,7 @@
 SUBDIRS = lib glade
 
-AM_LDFLAGS = -Wl,--as-needed 
+# -export-dynamic is need for defining handlers in the glade file.
+AM_LDFLAGS = -Wl,--as-needed -export-dynamic
 
 if LIBMICROHTTPD
 if JSON
@@ -22,11 +23,21 @@ LIBS = \
        lib/libpsensor.a \
        $(GTK_LIBS)\
        $(GCONF_LIBS)\
+       $(PTHREAD_LIBS)\
        $(SENSORS_LIBS)
 
+if GTK
+if X11
+if XEXT
+if GCONF
 bin_PROGRAMS = psensor
+dist_man_MANS = psensor.1
+endif
+endif
+endif
+endif
+
 psensor_SOURCES = \
-       compat.h \
        cfg.h cfg.c \
        graph.h graph.c \
        main.c \
@@ -57,9 +68,11 @@ AM_CPPFLAGS += $(APPINDICATOR_CFLAGS)
 endif
 
 if NVIDIA
+if X11
 AM_CPPFLAGS += $(NVIDIA_CFLAGS)
 LIBS +=  $(NVIDIA_LIBS)
 endif
+endif
 
 if LIBATIADL
 AM_CPPFLAGS += $(LIBATIADL_CFLAGS)
@@ -85,14 +98,13 @@ AM_CPPFLAGS += $(CURL_CFLAGS) $(JSON_CFLAGS)
 endif
 endif
 
-dist_man_MANS = psensor.1
 EXTRA_DIST = description.txt psensor.schemas
 
+
+if GCONF
 schemadir = $(GCONF_SCHEMA_FILE_DIR)
-schema_in_files = psensor.schemas.in
 schema_DATA = psensor.schemas
 
-if GCONF_SCHEMAS_INSTALL
 install-data-local:
        GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_srcdir)/src/$(schema_DATA)
 endif