fix build error on osx case sensitive file systems, more work on the c api