summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2012-08-18 19:39:15 +0000
committerme_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac>2012-08-18 19:39:15 +0000
commitcc3697470a75eaed71a49b7af4244c4038d738ae (patch)
tree333dc1eea1cfe53a5a2aa72d14b9c1eb8d5fd30b /configure.ac
parent404437db07bbecd9b6343e2e27749258be4d6060 (diff)
downloadpica-pica-cc3697470a75eaed71a49b7af4244c4038d738ae.tar.gz
pica-pica-cc3697470a75eaed71a49b7af4244c4038d738ae.zip
build whole package (pica-node and pica-client) using autoconf and automake
git-svn-id: svn://localhost/project_picapica/trunk@166 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac42
1 files changed, 39 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 4cc9d91..563f891 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([Pica Pica Node], [0.5], [http://picapica.im/bugzilla/], [pica-node], [http://picapica.im])
+AC_INIT([Pica Pica Messenger], [0.5], [http://picapica.im/bugzilla/], [pica-pica], [http://picapica.im])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([PICA_node.c])
@@ -10,9 +10,37 @@ AC_CONFIG_SRCDIR([PICA_node.c])
AC_PROG_CC
AC_PROG_INSTALL
-# Checks for libraries.
+# Checks for common libraries, required by both pica-node and pica-client
AC_CHECK_LIB([crypto], [RAND_add])
AC_CHECK_LIB([ssl], [SSL_library_init])
+
+
+#checking if pica-node is disabled
+AC_ARG_ENABLE([node],
+ AS_HELP_STRING([--disable-node], [Disable build of pica-node]))
+
+AS_IF([test "x$enable_node" != "xno"], [
+ PICA_NODE_ENABLED=yes
+])
+
+#checking if pica-client is disabled
+AC_ARG_ENABLE([client],
+ AS_HELP_STRING([--disable-client], [Disable build of pica-client]))
+
+AS_IF([test "x$enable_client" != "xno"], [
+ PICA_CLIENT_ENABLED=yes
+])
+
+#at least one program must be enabled
+AS_IF([test "x$PICA_NODE_ENABLED" != "xyes" && test "x$PICA_CLIENT_ENABLED" != "xyes" ],
+ AC_MSG_ERROR(["Either pica-node or pica-client must be enabled"])
+)
+
+AM_CONDITIONAL([PICA_NODE], [test "x$PICA_NODE_ENABLED" = "xyes"])
+AM_CONDITIONAL([PICA_CLIENT], [test "x$PICA_CLIENT_ENABLED" = "xyes"])
+
+#pica-node tests
+AS_IF([test "x$PICA_NODE_ENABLED" = "xyes"],[
AC_CHECK_LIB([sqlite3], [sqlite3_open])
AC_CHECK_PROG([SQLITE3], [sqlite3], [yes], [no])
@@ -20,10 +48,18 @@ AC_CHECK_PROG([SQLITE3], [sqlite3], [yes], [no])
if test "x$SQLITE3" != xyes; then
AC_MSG_ERROR(["sqlite3 program not found"])
fi
+])
+#pica-client tests
+AS_IF([test "x$PICA_NODE_ENABLED" = "xyes"],[
+AC_PROG_CXX
+PKG_CHECK_MODULES([QT_DEPENDENCIES], [QtCore QtGui QtSql QtNetwork])
+AC_SUBST([QT_DEPENDENCIES_CFLAGS])
+AC_SUBST([QT_DEPENDENCIES_LIBS])
+])
# Checks for header files.
-AC_CHECK_HEADERS([arpa/inet.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h wchar.h])
+AC_CHECK_HEADERS([arpa/inet.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT16_T