Fix flex for building on darwin systems