msteveb / jimtcl

Official repository of Jim Tcl, an open-source, small footprint implementation of Tcl
http://jim.tcl.tk/
Other
432 stars 123 forks source link

configure does not/wrongly detect missing zlib and openssl with diet libc #272

Closed jorge-leon closed 1 year ago

jorge-leon commented 1 year ago

When configuring jimtcl for diet libc it seems to detect the utilities installed by the OSpackages, e.g. zlib and openssl. However the make fails then with respective errors. See related (shortened) configure and make outputs below.

$ ./configure "CC=diet gcc -pipe -nostdinc" --prefix=/opt/diet 
Host System...x86_64-pc-linux-gnu
Build System...x86_64-pc-linux-gnu
C compiler... diet gcc -pipe -nostdinc  
...
Checking for pkg-config...1.8.1
Checking for openssl ...3.0.9
Enabling SSL (openssl)
Checking libs for TLS_method...no
...
Extension tree...enabled
Checking for zlib ...1.2.13
Extension zlib...enabled
...
$ make
    CC  jim-aio.o
jim-aio.c:75:10: fatal error: openssl/ssl.h: No such file or directory
   75 | #include <openssl/ssl.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:64: jim-aio.o] Error 1
$ ./configure "CC=diet gcc -pipe -nostdinc" --prefix=/opt/diet --disable-ssl
Host System...x86_64-pc-linux-gnu
Build System...x86_64-pc-linux-gnu
C compiler... diet gcc -pipe -nostdinc  
...
$ make
    MKLDEXT _load-static-exts.c
...
    CC  jim-zlib.o
jim-zlib.c:35:10: fatal error: zlib.h: No such file or directory
   35 | #include <zlib.h>
      |          ^~~~~~~~
compilation terminated.
make: *** [Makefile:64: jim-zlib.o] Error 1
msteveb commented 1 year ago

You will need to manually disable pkg-config when building with diet-libc. e.g.

./configure "CC=diet gcc -nostdinc ..." HAVE_PKG_CONFIG=0

There is still a problem with zlib detection though. I will push a fix for that