Make BUILD_SHARED_LIBS local scope.