Bug 77034 - No scandir function available
Summary: No scandir function available
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-04 01:03 UTC by Ryan Schmidt
Modified: 2015-04-20 07:22 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Ryan Schmidt 2014-04-04 01:03:24 UTC
I'm the maintainer of fontconfig in MacPorts. I'm trying to update fontconfig to 2.11.1 but it fails at the configure stage with this error:

checking for posix_fadvise in fcntl.h... no
checking for scandir... configure: error: 
*** No scandir function available.

About this problem, the config.log says this:

configure:14021: ccache /usr/bin/clang -arch x86_64 -c -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -Wall -Wpointer-arith -Wstrict-prototypes 	-Wmissing-prototypes -Wmissing-declarations 	-Wnested-externs -fno-strict-aliasing -Werror -I/opt/local/include -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk conftest.c >&5
clang: error: argument unused during compilation: '-I /opt/local/include'

MacPorts is setting various environment variables at configure time, including:

CC='ccache /usr/bin/clang -arch x86_64'
CFLAGS='-pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
CPPFLAGS='-I/opt/local/include -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'

The error is due to a combination of factors:

 * I am using the clang compiler, which is the only compiler available with the Apple developer tools on OS X 10.9 and later
 * the version of ccache I am using, 3.1.9, although it is the latest version available, is not fully compatible with clang, in that it erroneously emits the warning "argument unused during compilation" for any -I flag given (everything works fine; it's just that this incorrect warning is emitted)
 * your configure script is requesting that all warnings be turned into errors, via the -Werror flag

You should not be distributing scripts where your users will end up using the -Werror flag. You can use it yourself during development, but you can't predict what situations every compiler might consider to be an error, especially as compilers continue to be developed and refined. At MacPorts, we often have to remove -Werror from projects' configure scripts because newer versions of clang often consider additional things to be errors.
Comment 1 Akira TAGOH 2014-04-04 03:54:44 UTC
-Werror isn't for debugging purpose. it is required to detect the difference of the implementation in scandir. and the incompatible pointer type thing which is the warning we want to detect here, is enabled by default in gcc for traditional reason. due to that, there seems no options to control it to make it as an error: see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37866

Any suggestions and/or patches are welcome.
Comment 2 Ryan Schmidt 2014-04-05 01:21:24 UTC
Hmm. Well writing autoconf stuff is outside my area of expertise. For now, I've updated MacPorts fontconfig to 2.11.1, disabling ccache if clang is in use.

https://trac.macports.org/changeset/118571

I'll bug the developers of ccache again about finally releasing a clang-compatible version.
Comment 3 Akira TAGOH 2015-02-09 07:54:40 UTC
Recently some tweaks added for Solaris Studio compilers. we could add similar thing for ccache perhaps?

http://cgit.freedesktop.org/fontconfig/commit/?id=694368667a15341ea30b37a36e9540e6b1492680
Comment 4 Akira TAGOH 2015-04-20 07:22:21 UTC
-Werror isn't used anymore. so this should be gone in the latest.


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.