If the /usr/bin/head program is missing or unusable, or if an unusable head program is listed first in the PATH, fontconfig fails to build with this unintuitive error (here, I'm upgrading a fontconfig installation using MacPorts on Mac OS X, but that's not strictly relevant): $ sudo port upgrade fontconfig ---> Building fontconfig with target all Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_fontconfig/work/fontconfig-2.5.0" && make all " returned error 2 Command output: fcaliastail.h:520:2: error: #endif without #if fcaliastail.h:522: error: only weak aliases are supported in this configuration fcaliastail.h:523:2: error: #endif without #if fcaliastail.h:525: error: only weak aliases are supported in this configuration fcaliastail.h:526:2: error: #endif without #if fcaliastail.h:528: error: only weak aliases are supported in this configuration fcaliastail.h:529:2: error: #endif without #if fcaliastail.h:531: error: only weak aliases are supported in this configuration fcaliastail.h:532:2: error: #endif without #if fcaliastail.h:534: error: only weak aliases are supported in this configuration fcaliastail.h:535:2: error: #endif without #if fcaliastail.h:537: error: only weak aliases are supported in this configuration fcaliastail.h:538:2: error: #endif without #if fcaliastail.h:540: error: only weak aliases are supported in this configuration fcaliastail.h:541:2: error: #endif without #if fcaliastail.h:543: error: only weak aliases are supported in this configuration fcaliastail.h:544:2: error: #endif without #if fcaliastail.h:546: error: only weak aliases are supported in this configuration fcaliastail.h:547:2: error: #endif without #if fcaliastail.h:549: error: only weak aliases are supported in this configuration fcaliastail.h:550:2: error: #endif without #if fcaliastail.h:552: error: only weak aliases are supported in this configuration fcaliastail.h:553:2: error: #endif without #if fcaliastail.h:555: error: only weak aliases are supported in this configuration fcaliastail.h:556:2: error: #endif without #if fcaliastail.h:557:2: error: #endif without #if make[3]: *** [fcatomic.lo] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Error: Unable to upgrade port: 1 $ /usr/bin/head might be unusable if the user manually installed an old version of libwww-perl, which would have tried to install /usr/bin/HEAD, which, on a case-insensitive filesystem like the default Mac HFS+ filesystem, would have collided with and overwritten /usr/bin/head. Another head program might be in the user's PATH if the user installed libwww-perl to another prefix that's in their PATH before /usr/bin. I am the maintainer of the fontconfig port for MacPorts. The 5th time I heard about this problem, I started modifying the portfile to detect this situation and alert the user with a more friendly message. But this will only help users installing fontconfig with MacPorts. Mac users installing fontconfig with fink or compiling manually or users with case-insensitive filesystems on other platforms could still run into the strange error message. Would it be possible to change fontconfig to detect whether head is usable before it tries to use it, and to emit a better error message in that case? I think the only place head is used in fontconfig is in src/makealias; this use was introduced by commit 5e234d9e764d8c52d93b918a5c92b7956c95882b. Maybe a different solution could be found for that issue which doesn't need the head program. (Well, there's one more occurrence in config.guess to detect the alpha processor, but that doesn't apply in my case.)
Perhaps using "sed -n 1p" instead of "head -1" would be a suitable workaround.
Applied as 9ffa2fa7efa7815b8808e744c3601631fe1810d7
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.