declare
  l_sql        varchar2(32767);
  l_variables  varchar2(1000) := '';
  l_rac varchar2(50) := 'FALSE';
begin
  if dbms_utility.is_cluster_database then
    l_rac := 'TRUE';
  end if;

  l_variables := l_variables || 'RAC:' || l_rac || ',';

  -- other conditional compilation flags goes here

  l_variables := rtrim(l_variables,
                       ',');

  dbms_output.put_line(l_variables);

  l_sql := q'[alter session set PLSQL_CCFLAGS=']' || l_variables || q'[']';
  execute immediate l_sql;
end;
/
