~sircmpwn/gmni-discuss

4 3

Re: Compile errors on OpenBSD 6.7

Details
Message ID
<1d74-5fb57d00-23-2fb3ca00@264593703>
DKIM signature
missing
Download raw message
Patch: +5 -3
> A patch

Here is a patchdiff to make the project compile on FreeBSD/CLang. 

diff --git a/config.sh b/config.sh
index 5ada371..f364056 100644
--- a/config.sh
+++ b/config.sh
@@ -114,7 +114,7 @@ docs() { true; }
run_configure() {
	mkdir -p $outdir

	for flag in -g -std=c11 -D_XOPEN_SOURCE=700 -Wall -Wextra -Werror -pedantic
	for flag in -g -std=c11 -Wall -Wextra -Werror -pedantic
	do
		printf "Checking for %s... " "$flag"
		if test_cflags "$flag"
@@ -154,6 +154,7 @@ run_configure() {
	MIMEDB?=${MIMEDB:-${SYSCONFDIR:-/etc}/mime.types}
	CACHE=\$(OUTDIR)/cache
	CFLAGS=${CFLAGS}
	CFLAGS+=-std=c11
	CFLAGS+=-Iinclude -I\$(OUTDIR)
	CFLAGS+=-DPREFIX='"\$(PREFIX)"'
	CFLAGS+=-DLIBDIR='"\$(LIBDIR)"'
diff --git a/include/config.h b/include/config.h
index fc7e9fb..4941b16 100644
--- a/include/config.h
+++ b/include/config.h
@@ -4,6 +4,8 @@
#include <openssl/x509.h>
#include <stdbool.h>
#include "regexp.h"
#include <sys/socket.h>
#include <netinet/in.h>

struct gmnisrv_tls {
	char *store;
diff --git a/src/regexp.c b/src/regexp.c
index 597a908..4d4e96d 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -23,7 +23,6 @@
 * THE SOFTWARE.
 */
#include <assert.h>
#include <alloca.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
@@ -2845,7 +2844,7 @@ int lre_exec(uint8_t **capture,
    for(i = 0; i < s->capture_count * 2; i++)
        capture[i] = NULL;
    alloca_size = s->stack_size_max * sizeof(stack_buf[0]);
    stack_buf = alloca(alloca_size);
    stack_buf = (StackInt *)alloca(alloca_size);
    ret = lre_exec_backtrack(s, capture, stack_buf, 0, bc_buf + RE_HEADER_LEN,
                             cbuf + (cindex << cbuf_type), false);
    lre_realloc(s->opaque, s->state_stack, 0);

Re: Compile errors on OpenBSD 6.7

Details
Message ID
<65e72cd2fded98312fbac329644b4b96d4086353.camel@posteo.de>
In-Reply-To
<1d74-5fb57d00-23-2fb3ca00@264593703> (view parent)
DKIM signature
pass
Download raw message
Hi,

I tried to make this work on my FreeBSD machine. It compiles, but
complains about a mime problem:

[gemini@macharius ~]$ ./gmnisrv -C config.ini 
Unable to open MIME database for reading: No such file or directory
Is /etc/mime.types installed?
Assertion failed: (0), function mime_init, file src/mime.c, line 37.
Abort trap (core dumped)

P.

Re: Compile errors on OpenBSD 6.7

Details
Message ID
<C77JEIIQDSUP.346GBMES7H7GH@taiga>
In-Reply-To
<65e72cd2fded98312fbac329644b4b96d4086353.camel@posteo.de> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Read the error message. It tells you exactly what it's looking for.

Re: Compile errors on OpenBSD 6.7

David Marec
Details
Message ID
<fb879691-c2b2-ebab-7bcf-044252ce6833@lapinbilly.eu>
In-Reply-To
<65e72cd2fded98312fbac329644b4b96d4086353.camel@posteo.de> (view parent)
DKIM signature
missing
Download raw message
On 19/11/2020 21:52, Philipp Stanner wrote:
> Hi,
>
> I tried to make this work on my FreeBSD machine. It compiles, but
> complains about a mime problem:
>
> [gemini@macharius ~]$ ./gmnisrv -C config.ini
> Unable to open MIME database for reading: No such file or directory
> Is /etc/mime.types installed?
> Assertion failed: (0), function mime_init, file src/mime.c, line 37.
> Abort trap (core dumped)
>
> P.
>

Make sure mime.types is available and tell the configuration its correct 
location:


```sh
./configure --with-mimedb=/usr/local/etc/mime.types|

```

You'd probably have to setup "--prefix=/usr/local" too.



-- 

David Marec

https://wiki.fug-fr.org/doku.php?id=start
https://diaspora.lapinbilly.eu/stream
https://reuz.lapinbilly.eu/#/room/#FreeBSD:matrix.org

Re: Compile errors on OpenBSD 6.7

Details
Message ID
<C783IIDBX0CX.3LN2YWO4TBFXW@taiga>
In-Reply-To
<1d74-5fb57d00-23-2fb3ca00@264593703> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks! Can you rephrase this in the form of a patch sent with git
send-email?

https://git-send-email.io
Reply to thread Export thread (mbox)