| 1475 | } |
| 1476 | |
| 1477 | static void configure(void) |
| 1478 | { |
| 1479 | char *destconfig; |
| 1480 | |
| 1481 | /* Copy the defconfig to toplevel */ |
| 1482 | |
| 1483 | snprintf(g_buffer, BUFFER_SIZE, "%s%cdefconfig", g_topdir, g_delim); |
| 1484 | copy_file(g_srcdefconfig, g_buffer, 0644); |
| 1485 | |
| 1486 | /* Copy the defconfig file as .config */ |
| 1487 | |
| 1488 | snprintf(g_buffer, BUFFER_SIZE, "%s%c.config", g_topdir, g_delim); |
| 1489 | destconfig = strdup(g_buffer); |
| 1490 | debug("configure: Copying from %s to %s\n", g_srcdefconfig, destconfig); |
| 1491 | copy_file(g_srcdefconfig, destconfig, 0644); |
| 1492 | |
| 1493 | /* Copy the Make.defs file as Make.defs */ |
| 1494 | |
| 1495 | snprintf(g_buffer, BUFFER_SIZE, "%s%cMake.defs", g_topdir, g_delim); |
| 1496 | debug("configure: Copying from %s to %s\n", g_srcmakedefs, g_buffer); |
| 1497 | copy_file(g_srcmakedefs, g_buffer, 0644); |
| 1498 | |
| 1499 | /* Copy optional files */ |
| 1500 | |
| 1501 | copy_optional(); |
| 1502 | |
| 1503 | /* Select the host build development environment */ |
| 1504 | |
| 1505 | set_host(destconfig); |
| 1506 | |
| 1507 | /* If we did not use the CONFIG_APPS_DIR that was in the defconfig config |
| 1508 | * file, then append the correct application information to the tail of the |
| 1509 | * .config file |
| 1510 | */ |
| 1511 | |
| 1512 | if (g_needapppath) |
| 1513 | { |
| 1514 | FILE *stream; |
| 1515 | char *appdir = strdup(g_appdir); |
| 1516 | char *boardcfg = strdup(g_boarddir); |
| 1517 | |
| 1518 | /* One complexity is if we are using Windows paths, but the |
| 1519 | * configuration needs POSIX paths (or vice versa). |
| 1520 | */ |
| 1521 | |
| 1522 | if (g_winpaths != g_winnative) |
| 1523 | { |
| 1524 | /* Not the same */ |
| 1525 | |
| 1526 | if (g_winpaths) |
| 1527 | { |
| 1528 | /* Using Windows paths, but the configuration wants POSIX |
| 1529 | * paths. |
| 1530 | */ |
| 1531 | |
| 1532 | substitute(appdir, '\\', '/'); |
| 1533 | } |
| 1534 | else |
no test coverage detected