Karlson2k / libmicrohttpd

GNU libmicrohttpd repository unofficial mirror on GitHub
https://www.gnu.org/software/libmicrohttpd/
Other
101 stars 29 forks source link

missing linker library "-lmicrohttpd_ws" in "libmicrohttpd.pc" when using the experimental WebSocket support #27

Closed jvo203 closed 3 months ago

jvo203 commented 8 months ago

The latest libmicrohttpd v1.0.1 can be compiled with the experimental WebSocket upgrade mechanism by issuing ./configure --enable-experimental. When using WebSockets one needs to link with the extra WebSockets functions by adding the extra library -lmicrohttpd_ws.

Unfortunately, the "pkg-config" files does not include this extra library when compiled with the "--enable--experimental":

pkg-config --libs libmicrohttpd
-L/usr/local/lib -lmicrohttpd

even though the extra library is correctly compiled and placed in the destination lib directory:

 ls -l /usr/local/lib/libmicro*
-rwxr-xr-x@ 1 chris  staff   275368  2 29 15:37 /usr/local/lib/libmicrohttpd.12.dylib
-rw-r--r--@ 1 chris  staff  1016488  2 29 15:37 /usr/local/lib/libmicrohttpd.a
lrwxr-xr-x@ 1 chris  staff       22  2 29 15:37 /usr/local/lib/libmicrohttpd.dylib -> libmicrohttpd.12.dylib
-rwxr-xr-x@ 1 chris  staff     1032  2 29 15:37 /usr/local/lib/libmicrohttpd.la
-rwxr-xr-x@ 1 chris  staff    54440  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.0.dylib
-rw-r--r--@ 1 chris  staff    63000  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.a
lrwxr-xr-x@ 1 chris  staff       24  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.dylib -> libmicrohttpd_ws.0.dylib
-rwxr-xr-x@ 1 chris  staff      997  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.la

The solution: add -lmicrohttpd_ws to the libmicrohttpd.pc file that make install places in the /usr/local/lib/pkgconfig folder.

Karlson2k commented 8 months ago

microhttpd_ws is experimental and not supported directly. The proper solution would be creation of libmicrohttpd_ws.pc. Patches are welcome.

jvo203 commented 8 months ago

Sorry I am unable to submit a patch due to being unfamiliar with the autoconfig process like the "configure.ac", "Makefile.am" files etc.

I've forked the libmicrohttpd repository and opened the "configure.ac, Makefile.am" but learning the auto-configuration process completely from scratch would i) take up too much time away from the daily job duties and ii) likely result in mistakes / broken libmicrohttpd.