[gnio] Make gnio build without gnutls



commit 0174cfcb78235b2af5dc99b53e4ec7e6acaabe7c
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Apr 29 13:19:36 2009 +0200

    Make gnio build without gnutls
---
 configure.ac         |    7 ++++---
 examples/Makefile.am |    9 ++++++++-
 gio/Makefile.am      |   18 +++++++++++++-----
 3 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index af7e877..714de6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,9 +8,10 @@ GTK_DOC_CHECK
 
 
 PKG_CHECK_MODULES(gthread, gthread-2.0)
-PKG_CHECK_MODULES(gnutls, gnutls)
-
-
+PKG_CHECK_MODULES(gnutls, gnutls, [
+		  AM_CONDITIONAL(HAVE_GNUTLS, true)
+		  AC_DEFINE(HAVE_GNUTLS, 1, [Define to enable GNUTLS support])
+		  ], [AM_CONDITIONAL(HAVE_GNUTLS, false)])
 
 PKG_CHECK_MODULES(gio, gio-unix-2.0)
 gnio_saved_libs="$LIBS"
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 94c7b63..b686ac1 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,7 +1,14 @@
-noinst_PROGRAMS = client server
+noinst_PROGRAMS = server
+
+if HAVE_GNUTLS
+noinst_PROGRAMS += client
+endif
 
 AM_CFLAGS = $(gio_CFLAGS) -I$(top_srcdir) -Wall -Wmissing-prototypes
 server_LDADD = ../gio/libgnio.la $(gthread_LIBS)
 server_SOURCES = server.c
+
+if HAVE_GNUTLS
 client_LDADD = ../gio/libgnio.la
 client_SOURCES = client.c
+endif
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 1c7187c..a40dd75 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -6,8 +6,6 @@ AM_CFLAGS = -I$(top_srcdir) $(gio_CFLAGS) -Wall -Wmissing-prototypes -DGIO_COMPI
 
 libgnio_la_LIBADD = $(gio_LIBS) $(gnutls_LIBS)
 
-libgnio_la_SOURCES = $(sources)
-
 sources = \
 	gasynchelper.c			\
 	gasynchelper.h			\
@@ -29,14 +27,19 @@ sources = \
 	gtcpconnection.c		\
 	gtcplistener.c			\
 	gthreadedsocketservice.c	\
-	gtls.c				\
 	gunixclient.c			\
 	gunixconnection.c		\
 	gunixfdmessage.c		\
 	gunixlistener.c
 
+libgnio_la_SOURCES = $(sources)
+
+if HAVE_GNUTLS
+libgnio_la_SOURCES += gtls.c
+endif
+
+
 gioincludedir = $(includedir)/gnio/gio
-gioinclude_HEADERS = $(headers) gnioenums.h
 
 headers = \
 	giostream.h			\
@@ -52,12 +55,17 @@ headers = \
 	gtcpconnection.h		\
 	gtcplistener.h			\
 	gthreadedsocketservice.h	\
-	gtls.h				\
 	gunixclient.h			\
 	gunixfdmessage.h		\
 	gunixconnection.h		\
 	gunixlistener.h
 
+gioinclude_HEADERS = $(headers) gnioenums.h
+
+if HAVE_GNUTLS
+gioinclude_HEADERS += gtls.h
+endif
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gnio.pc
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]