use cmake for autoconf, slim down platform.h