Althttpd

failed to build althttpd on msys2
Login

failed to build althttpd on msys2

(1) By jose i cabrera (jicman) on 2024-11-04 20:55:40 [link] [source]

Greetings.

I am trying to install althttpd on MSYS2 system under windows. I have it installed on cygwin, but I would like to move my setup to msys2. When I run 'make althttpd' I get:

E608313@HOR721242D UCRT64 ~/b/althttpd/althttpd-646adc55f9
$ make althttpd
cc -o mkversion mkversion.c
./mkversion manifest.uuid manifest VERSION >VERSION.h
cc -Os -Wall -Wextra -I. -o althttpd althttpd.c
althttpd.c:325:10: fatal error: syslog.h: No such file or directory
  325 | #include <syslog.h>
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:19: althttpd] Error 1

Any thoughts on how to get this fixed? Thanks.

josé

(2.1) By Stephan Beal (stephan) on 2024-11-05 09:04:29 edited from 2.0 in reply to 1 [source]

Any thoughts on how to get this fixed?

i don't believe syslog is actually used by althttpd. Simply removing that header "works for me" on Linux, and if you can confirm it works for you i'll check that in.

Edit: it's been removed after testing on Linux and OpenBSD.

(3) By jose i cabrera (jicman) on 2024-11-05 18:17:47 in reply to 2.1 [link] [source]

Edit: it's been removed after testing on Linux and OpenBSD.

Thanks. Downloaded the latest version and tried it: New error pops up:

E608313@HOR721242D UCRT64 ~/b/althttpd/althttpd-07d1ade99f
$ make althttpd
cc -Os -Wall -Wextra -I. -o althttpd althttpd.c
althttpd.c:327:10: fatal error: pwd.h: No such file or directory
  327 | #include <pwd.h>
      |          ^~~~~~~
compilation terminated.
make: *** [Makefile:19: althttpd] Error 1

(4) By drh on 2024-11-05 19:13:57 in reply to 3 [link] [source]

pwd.h is required for Linux. What does msys2 want as an alternative?

(5) By jose i cabrera (jicman) on 2024-11-05 20:18:47 in reply to 4 [link] [source]

Good question. What library is pwd.h part of? Maybe I need to install it.

(6) By jose i cabrera (jicman) on 2024-11-05 20:42:00 in reply to 4 [link] [source]

So, I found the pwd.h file in /usr/include:

jcabrera@jicman UCRT64 ~/b/althttpd/althttpd-07d1ade99f
$ ls -l /usr/include/pwd.h
-rw-r--r-- 1 jcabrera None 2.7K Sep  4 14:28 /usr/include/pwd.h

Where is make expecting it?

(7) By Stephan Beal (stephan) on 2024-11-06 01:56:25 in reply to 6 [link] [source]

Where is make expecting it?

In the compiler's default include path, which normally includes (as it were) /usr/include.

(8.1) By jose i cabrera (jicman) on 2024-11-06 13:56:09 edited from 8.0 in reply to 7 [link] [source]

Ignore this. I was using the wrong MSYS2 environment terminal (UCRT64). To get this to compile, use the MSYS terminal environment.

jcabrera@jicman MSYS ~/b/althttpd/althttpd-07d1ade99f
$ make althttpd
cc -Os -Wall -Wextra -I. -o althttpd althttpd.c

worked.