- (setq rlt (replace-regexp-in-string "\\(.*\\)<LANG>\\(.*\\)"
- (mapconcat 'identity '("\\1CXX\\2" "\\1C\\2" "\\1Fortran\\2") "\n")
- rlt))
- (setq rlt (replace-regexp-in-string "\\(.*\\)<CONFIG>\\(.*\\)"
- (mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2" "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2") "\n")
- rlt))
+ (setq rlt (replace-regexp-in-string
+ "\\(.*?\\(IS_GNU\\)?\\)<LANG>\\(.*\\)"
+ (lambda (_match)
+ (mapconcat 'identity
+ (if (match-beginning 2)
+ '("\\1CXX\\3" "\\1C\\3" "\\1G77\\3")
+ '("\\1CXX\\3" "\\1C\\3" "\\1Fortran\\3"))
+ "\n"))
+ rlt t))
+ (setq rlt (replace-regexp-in-string
+ "\\(.*\\)<CONFIG>\\(.*\\)"
+ (mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2"
+ "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2")
+ "\n")
+ rlt))