phillbush / xmenu

a x11 menu utility
Other
296 stars 26 forks source link

Remove POSIX def and add missing X11 libs to fix building on macOS #55

Closed fathonix closed 7 months ago

fathonix commented 7 months ago

_POSIX_C_SOURCE=200809L is causing both GCC 13 and Clang 15 throw strcasestr undeclared error.

xmenu.c:801:5: error: call to undeclared function 'strcasestr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                                strcasestr(value, "ENABLED") != NULL
                                ^

Imlib2 is usually not installed in standard library paths but in Homebrew or MacPorts so I think there's no need to add them, just set the necessary CFLAGS and LDFLAGS.

make CFLAGS=-I/opt/homebrew/opt/imlib2/include LDFLAGS=-L/opt/homebrew/opt/imlib2/lib