mbornet-hl / hl

Highlight (colorize) text data using regular expressions (efficient C program)
Other
118 stars 9 forks source link

Issue: Cannot compile on macOS #25

Closed gspannu closed 1 year ago

gspannu commented 1 year ago

The source does not compile on macOS. Errors attached in the log file here. Compiling it on macOS 13.2.1 on a M2 MacBook

However, as suggested by j16sdiz I was able to compile on macOS by removing the #define _POSIX_C_SOURCE from cr_main.c ...

Now, The utility works but it does not have any of the included configurations:

Running hl -H returns:

...........
...........
-P  : display configuration(s) matching regexp
-x  : display options count for each config (with -vH options)
Configurations :

Could you please update the code so that it compiles on macOS? Many thanks...

Or is it that I am using the configurations incorrectly? Are these compiled into the hl binary file itself or do I need to place the hl_bin folder in a specific location to get the configurations to work?

mbornet-hl commented 1 year ago

Hello, I fixed compilation problems on macOS. I think it should be fine now :

make clean; make
gcc    -c -o cr_main.o cr_main.c
gcc    -c -o cr_gpri.o cr_gpri.c
lex  -t cr_lex.l > cr_lex.c
gcc    -c -o cr_lex.o cr_lex.c
./hl: version 1.160
gspannu commented 1 year ago

Compilation on macOS now does not throw any errors, however it still does not include any of the configurations. Reported in https://github.com/mbornet-hl/hl/issues/23#issuecomment-1464639792

mbornet-hl commented 1 year ago

In what directory did you copy the configurations files ? What are the values of the HL_CONF and HL_CONF_GLOB environments values ?

mbornet-hl commented 1 year ago

This issue seems to be the same as #23 and the compilation problem on macOS has been solved, so could you please continue posting on issue #23 ? I close this one. Thanks.