summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am118
-rw-r--r--PICA_nodeconfig.h6
-rw-r--r--configure.ac42
-rw-r--r--pica-client/dialogs/addaccountdialog.cpp2
-rw-r--r--pica-client/dialogs/registeraccountdialog.cpp2
-rw-r--r--pica-client/dialogs/registeraccountdialog.h2
-rw-r--r--pica-client/dialogs/viewcertdialog.cpp2
-rw-r--r--pica-client/globals.h2
8 files changed, 157 insertions, 19 deletions
diff --git a/Makefile.am b/Makefile.am
index 11a6441..d622fbb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,16 @@
-bin_PROGRAMS = pica-node
+bin_PROGRAMS =
+CLEANFILES =
+dist_pkgdata_DATA = CA.pem
+
+
+EXTRA_DIST = iniparser/LICENSE \
+ LICENSE \
+ README
+
+#####################################
+if PICA_NODE
+
+bin_PROGRAMS += pica-node
pica_node_SOURCES = PICA_node.c PICA_msgproc.c PICA_nodeaddrlist.c \
PICA_nodejoinskynet.c PICA_nodeconfig.c PICA_log.c \
@@ -10,9 +22,7 @@ pica_node_SOURCES = PICA_node.c PICA_msgproc.c PICA_nodeaddrlist.c \
dist_man_MANS = pica-node.8 pica-node.conf.5
-pica_node_CPPFLAGS = -DPICA_PREFIX=\"$(prefix)\"
-
-dist_pkgdata_DATA = CA.pem
+pica_node_CPPFLAGS = -DPICA_INSTALLPREFIX=\"$(prefix)\"
pkglocalstatedir = $(localstatedir)/pica-node
@@ -22,8 +32,100 @@ nodelist.db: nodelist_db_create.sql
echo "Creating and initializing nodelist database..."
sqlite3 $@ "`cat $<`"
+EXTRA_DIST += nodelist_db_create.sql
-EXTRA_DIST = nodelist_db_create.sql \
- iniparser/LICENSE \
- LICENSE \
- README
+endif
+#####################################
+if PICA_CLIENT
+bin_PROGRAMS += pica-client
+
+pica_client_SOURCES = \
+pica-client/accounts.cpp \
+pica-client/accounts.h \
+pica-client/accountswindow.cpp \
+pica-client/accountswindow.h \
+pica-client/askpassword.cpp \
+pica-client/askpassword.h \
+pica-client/chatwindow.cpp \
+pica-client/chatwindow.h \
+pica-client/contactlistwidget.cpp \
+pica-client/contactlistwidget.h \
+pica-client/contacts.cpp \
+pica-client/contacts.h \
+pica-client/globals.h \
+pica-client/main.cpp \
+pica-client/mainwindow.cpp \
+pica-client/mainwindow.h \
+pica-client/mainwindow.ui \
+pica-client/msguirouter.cpp \
+pica-client/msguirouter.h \
+pica-client/nodes.cpp \
+pica-client/nodes.h \
+pica-client/nodethread.cpp \
+pica-client/nodethread.h \
+pica-client/openssltool.cpp \
+pica-client/openssltool.h \
+pica-client/picaactioncenter.cpp \
+pica-client/picaactioncenter.h \
+pica-client/pica-client.pro \
+pica-client/picasystray.cpp \
+pica-client/picasystray.h \
+pica-client/skynet.cpp \
+pica-client/skynet.h \
+ \
+pica-client/dialogs/addaccountdialog.cpp \
+pica-client/dialogs/addaccountdialog.h \
+pica-client/dialogs/forgedcertdialog.cpp \
+pica-client/dialogs/forgedcertdialog.h \
+pica-client/dialogs/registeraccountdialog.cpp \
+pica-client/dialogs/registeraccountdialog.h \
+pica-client/dialogs/viewcertdialog.cpp \
+pica-client/dialogs/viewcertdialog.h \
+PICA_client.c \
+PICA_client.h \
+PICA_msgproc.c \
+PICA_msgproc.h \
+PICA_common.h PICA_proto.h
+
+nodist_pica_client_SOURCES = \
+moc_accountswindow.cpp \
+moc_addaccountdialog.cpp \
+moc_askpassword.cpp \
+moc_chatwindow.cpp \
+moc_contactlistwidget.cpp \
+moc_forgedcertdialog.cpp \
+moc_mainwindow.cpp \
+moc_msguirouter.cpp \
+moc_nodethread.cpp \
+moc_picaactioncenter.cpp \
+moc_picasystray.cpp \
+moc_registeraccountdialog.cpp \
+moc_skynet.cpp \
+moc_viewcertdialog.cpp \
+ui_mainwindow.h
+
+moc_%.cpp: pica-client/%.h
+ moc $< -o $@
+
+moc_%.cpp: pica-client/dialogs/%.h
+ moc $< -o $@
+
+pica-client/mainwindow.cpp: ui_mainwindow.h
+
+#ui_mainwindow.h: pica-client/mainwindow.ui
+# uic $(CPPFLAGS) $< -o $@
+
+ui_%.h: pica-client/%.ui
+ uic $(CPPFLAGS) $< -o $@
+
+
+pica_client_CPPFLAGS = -DPICA_INSTALLPREFIX=\"$(prefix)\" $(QT_DEPENDENCIES_CFLAGS)
+pica_client_LDADD = $(QT_DEPENDENCIES_LIBS)
+
+dist_pkgdata_DATA += pica-client/picapica-icon-fly.png pica-client/picapica-icon-sit.png
+
+#$(filter moc_%.cpp,$(pica_client_SOURCES))
+CLEANFILES += moc_*.cpp ui_*.h
+
+endif
+#####################################
diff --git a/PICA_nodeconfig.h b/PICA_nodeconfig.h
index 52e00b7..b232d22 100644
--- a/PICA_nodeconfig.h
+++ b/PICA_nodeconfig.h
@@ -2,15 +2,15 @@
#ifndef PICA_NODECONFIG_H
#define PICA_NODECONFIG_H
-#ifndef PICA_PREFIX
-#define PICA_PREFIX "/usr"
+#ifndef PICA_INSTALLPREFIX
+#define PICA_INSTALLPREFIX "/usr"
#endif
#define PICA_NODECONFIG_DEF_ANNOUNCED_ADDR "0.0.0.0"
#define PICA_NODECONFIG_DEF_LISTEN_PORT "2299"
#define PICA_NODECONFIG_DEF_NODES_DB_FILE "/var/lib/pica-node/nodelist.db"
#define PICA_NODECONFIG_DEF_CONFIG_FILE "/etc/pica-node.conf"
-#define PICA_NODECONFIG_DEF_CA_CERT_FILE PICA_PREFIX"/share/pica-node/CA.pem"
+#define PICA_NODECONFIG_DEF_CA_CERT_FILE PICA_INSTALLPREFIX"/share/pica-node/CA.pem"
struct nodeconfig
{
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
diff --git a/pica-client/dialogs/addaccountdialog.cpp b/pica-client/dialogs/addaccountdialog.cpp
index f554caf..97e8851 100644
--- a/pica-client/dialogs/addaccountdialog.cpp
+++ b/pica-client/dialogs/addaccountdialog.cpp
@@ -5,7 +5,7 @@
#include <QFileDialog>
#include <QMessageBox>
#include <QProcess>
-#include "../PICA_client.h"
+#include "../../PICA_client.h"
AddAccountDialog::AddAccountDialog(QWidget *parent) :
QDialog(parent)
diff --git a/pica-client/dialogs/registeraccountdialog.cpp b/pica-client/dialogs/registeraccountdialog.cpp
index 0608e91..b1ef9d2 100644
--- a/pica-client/dialogs/registeraccountdialog.cpp
+++ b/pica-client/dialogs/registeraccountdialog.cpp
@@ -1,5 +1,5 @@
#include "registeraccountdialog.h"
-#include "globals.h"
+#include "../globals.h"
#include <QVBoxLayout>
#include <QDir>
#include <QMessageBox>
diff --git a/pica-client/dialogs/registeraccountdialog.h b/pica-client/dialogs/registeraccountdialog.h
index 38f23c9..82330e1 100644
--- a/pica-client/dialogs/registeraccountdialog.h
+++ b/pica-client/dialogs/registeraccountdialog.h
@@ -8,7 +8,7 @@
#include <QRegExpValidator>
#include <QtNetwork>
#include <QTcpSocket>
-#include "openssltool.h"
+#include "../openssltool.h"
class RegisterAccountDialog : public QDialog
{
diff --git a/pica-client/dialogs/viewcertdialog.cpp b/pica-client/dialogs/viewcertdialog.cpp
index 7f4e24a..7a41401 100644
--- a/pica-client/dialogs/viewcertdialog.cpp
+++ b/pica-client/dialogs/viewcertdialog.cpp
@@ -1,5 +1,5 @@
#include "viewcertdialog.h"
-#include "openssltool.h"
+#include "../openssltool.h"
#include <QVBoxLayout>
#include <QMessageBox>
diff --git a/pica-client/globals.h b/pica-client/globals.h
index b6c2d7d..5202548 100644
--- a/pica-client/globals.h
+++ b/pica-client/globals.h
@@ -6,7 +6,7 @@
#ifndef PICA_INSTALLPREFIX
-#define PICA_INSTALLPREFIX "/usr/"
+#define PICA_INSTALLPREFIX "/usr"
#endif