Skip to content

Commit

Permalink
More build instructions and fixed linking on Fedora.
Browse files Browse the repository at this point in the history
Fixes #35.
  • Loading branch information
gkdr committed Mar 19, 2017
1 parent df5f959 commit 98bf04c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ sudo pacman -U *.xz
```

### Linux (and MacOS?)
Install the (submodules') dependencies (`libpurple-dev`, `libmxml-dev`, `libxml2-dev`, `libsqlite3-dev`, `libgcrypt20-dev`)
First, install the (submodules') dependencies (`libpurple-dev`, `libmxml-dev`, `libxml2-dev`, `libsqlite3-dev`, `libgcrypt20-dev`).

Unfortunately, _Debian Stable_ comes with an older version of _mxml_ (2.6).
See issues #30 and #35 on some hints how to get a newer version from the _Testing_ repositories (2.7 is required).

For some hints on how to get the required libraries on macOS, see issue #8.

On Arch/Parabola you can install the following packages:

``` bash
sudo pacman -S base-devel git pidgin libpurple mxml sqlite libxml2 libgcrypt
```

Get the source code:
Then, get the source code:

``` bash
git clone https://github.com/gkdr/lurch/
Expand Down
17 changes: 11 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ INSTALL_DIR = $(INSTALL) -d -m 755
RM = rm
RM_RF = $(RM) -rf
CMAKE ?= cmake
CMAKE_FLAGS = -DCMAKE_BUILD_TYPE=Debug

CMAKE_FLAGS = -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-fPIC

### flags
#
Expand All @@ -24,11 +23,17 @@ PKGCFG_L=$(shell $(PKG_CONFIG) --libs purple glib-2.0 sqlite3 mxml) \
$(shell $(XML2_CONFIG) --libs) \
-L$(shell $(PKG_CONFIG) --variable=plugindir purple) \
$(shell $(LIBGCRYPT_CONFIG) --libs)

ifneq ("$(wildcard /etc/redhat-release)","")
LJABBER= -lxmpp
else
LJABBER= -ljabber
endif

HEADERS=-I$(HDIR)/jabber -I$(LOMEMO_SRC) -I$(AXC_SRC) -I$(AX_DIR)/src
CFLAGS += -std=c11 -Wall -g -Wstrict-overflow $(PKGCFG_C) $(HEADERS)
CPPFLAGS += -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
LDFLAGS += -ldl -lm $(PKGCFG_L) -ljabber
LDFLAGS += -ldl -lm $(PKGCFG_L) $(LJABBER)


### directories
Expand All @@ -51,8 +56,8 @@ AXC_SRC=$(AXC_DIR)/src
AXC_BUILD=$(AXC_DIR)/build
AXC_PATH=$(AXC_BUILD)/libaxc-nt.a

AX_DIR=$(AXC_DIR)/lib/libaxolotl-c
AX_PATH=$(AX_DIR)/build/src/libaxolotl-c.a
AX_DIR=$(AXC_DIR)/lib/libsignal-protocol-c
AX_PATH=$(AX_DIR)/build/src/libsignal-protocol-c.a

FILES=$(LOMEMO_PATH) $(AXC_PATH) $(AX_PATH)

Expand All @@ -65,7 +70,7 @@ $(BDIR):
$(MKDIR_P) build

$(AX_PATH):
cd $(AXC_DIR)/lib/libaxolotl-c/ && \
cd $(AX_DIR)/ && \
$(MKDIR_P) build && \
cd build && \
$(CMAKE) $(CMAKE_FLAGS) .. \
Expand Down

0 comments on commit 98bf04c

Please sign in to comment.