Ubuntu has libiconv
built-in to it’s standard c library and does not require it in LDFLAGS
. OS X does not have it built-in and requires the flag to be set.
My current approach is using ifeq
in my Makefile to conditionally set LDFLAG += -liconv
when on OS X.
I am wondering if there is a better approach? I am heavily influenced by the feature-detection mindset of web development and hope I can use a similar approach to detect whether the flag is required on the current system or not.