changed how to set flags and defines. WARNING : not backward compatible !