mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-04 03:20:33 +00:00
Merge "build_system: Split COMPILE_DOUBLE from DONT_OPTIMIZE" into 13
This commit is contained in:
@@ -103,13 +103,15 @@ CC_LIBS=$(PTHREAD_LIBS) $(LIBS)
|
|||||||
CXX_LIBS=$(PTHREAD_LIBS) $(LIBS)
|
CXX_LIBS=$(PTHREAD_LIBS) $(LIBS)
|
||||||
|
|
||||||
# determine whether to double-compile so that the optimizer can report code path problems
|
# determine whether to double-compile so that the optimizer can report code path problems
|
||||||
# this is only done when developer mode and DONT_OPTIMIZE are both enabled
|
# In this case, we run the preprocessor to produce a .i or .ii file from the source
|
||||||
# in that case, we run the preprocessor to produce a .i or .ii file from the source
|
|
||||||
# code, then compile once with optimizer enabled (and the output to /dev/null),
|
# code, then compile once with optimizer enabled (and the output to /dev/null),
|
||||||
# and if that doesn't fail then compile again with optimizer disabled
|
# and if that doesn't fail then compile again with optimizer disabled
|
||||||
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes)
|
|
||||||
|
ifeq ($(findstring COMPILE_DOUBLE,$(MENUSELECT_CFLAGS)),COMPILE_DOUBLE)
|
||||||
COMPILE_DOUBLE=yes
|
COMPILE_DOUBLE=yes
|
||||||
else
|
endif
|
||||||
|
|
||||||
|
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),)
|
||||||
_ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
|
_ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -1,5 +1,10 @@
|
|||||||
<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" remove_on_change=".lastclean">
|
<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" remove_on_change=".lastclean">
|
||||||
<member name="DONT_OPTIMIZE" displayname="Disable Optimizations by the Compiler">
|
<member name="DONT_OPTIMIZE" displayname="Disable Optimizations by the Compiler">
|
||||||
|
<use autoselect="yes">COMPILE_DOUBLE</use>
|
||||||
|
<support_level>core</support_level>
|
||||||
|
</member>
|
||||||
|
<member name="COMPILE_DOUBLE" displayname="Pre-compile with optimizations to detect errors, then discard and recompile with DONT_OPTIMIZE. Creates intermediate .i files">
|
||||||
|
<depend>DONT_OPTIMIZE</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
</member>
|
</member>
|
||||||
<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
|
<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
|
||||||
|
@@ -357,6 +357,10 @@ static int process_xml_ref_node(xmlNode *node, struct member *mem, struct refere
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((tmp = (const char *) xmlGetProp(node, BAD_CAST "autoselect"))) {
|
||||||
|
ref->autoselect = !strcasecmp(tmp, "yes");
|
||||||
|
}
|
||||||
|
|
||||||
tmp = (const char *) xmlNodeGetContent(node);
|
tmp = (const char *) xmlNodeGetContent(node);
|
||||||
|
|
||||||
if (tmp && !strlen_zero(tmp)) {
|
if (tmp && !strlen_zero(tmp)) {
|
||||||
@@ -1154,8 +1158,16 @@ unsigned int enable_member(struct member *mem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mem->enabled = can_enable)) {
|
if ((mem->enabled = can_enable)) {
|
||||||
|
struct reference *use;
|
||||||
|
|
||||||
print_debug("Just set %s enabled to %d\n", mem->name, mem->enabled);
|
print_debug("Just set %s enabled to %d\n", mem->name, mem->enabled);
|
||||||
while (calc_dep_failures(1, 0) || calc_conflict_failures(1, 0));
|
while (calc_dep_failures(1, 0) || calc_conflict_failures(1, 0));
|
||||||
|
|
||||||
|
AST_LIST_TRAVERSE(&mem->uses, use, list) {
|
||||||
|
if (use->member && use->autoselect && !use->member->enabled) {
|
||||||
|
enable_member(use->member);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return can_enable;
|
return can_enable;
|
||||||
|
@@ -43,6 +43,8 @@ struct reference {
|
|||||||
struct member *member;
|
struct member *member;
|
||||||
/*! if this package was found */
|
/*! if this package was found */
|
||||||
unsigned char met:1;
|
unsigned char met:1;
|
||||||
|
/*! if this package should be autoselected */
|
||||||
|
unsigned char autoselect:1;
|
||||||
/*! for linking */
|
/*! for linking */
|
||||||
AST_LIST_ENTRY(reference) list;
|
AST_LIST_ENTRY(reference) list;
|
||||||
};
|
};
|
||||||
|
@@ -158,6 +158,12 @@ static int really_quit(WINDOW *win)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MENU_HELP_LEFT_ADJ 16
|
||||||
|
#define MAIN_MENU_LEFT_ADJ 20
|
||||||
|
#define CAT_MENU_LEFT_ADJ 20
|
||||||
|
#define SCROLL_DOWN_LEFT_ADJ 15
|
||||||
|
#define MEMBER_INFO_LEFT_ADJ 25
|
||||||
|
|
||||||
static void draw_main_menu(WINDOW *menu, int curopt)
|
static void draw_main_menu(WINDOW *menu, int curopt)
|
||||||
{
|
{
|
||||||
struct category *cat;
|
struct category *cat;
|
||||||
@@ -167,42 +173,67 @@ static void draw_main_menu(WINDOW *menu, int curopt)
|
|||||||
wclear(menu);
|
wclear(menu);
|
||||||
|
|
||||||
AST_LIST_TRAVERSE(&categories, cat, list) {
|
AST_LIST_TRAVERSE(&categories, cat, list) {
|
||||||
wmove(menu, i++, max_x / 2 - 10);
|
wmove(menu, i++, max_x / 2 - MAIN_MENU_LEFT_ADJ);
|
||||||
snprintf(buf, sizeof(buf), " %s", strlen_zero(cat->displayname) ? cat->name : cat->displayname);
|
snprintf(buf, sizeof(buf), "%s", strlen_zero(cat->displayname) ? cat->name : cat->displayname);
|
||||||
waddstr(menu, buf);
|
waddstr(menu, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
wmove(menu, curopt, (max_x / 2) - 15);
|
wmove(menu, curopt, (max_x / 2) - MAIN_MENU_LEFT_ADJ - 5);
|
||||||
waddstr(menu, "--->");
|
waddstr(menu, "--->");
|
||||||
wmove(menu, 0, 0);
|
wmove(menu, curopt, (max_x / 2) - MAIN_MENU_LEFT_ADJ);
|
||||||
|
|
||||||
wrefresh(menu);
|
wrefresh(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void display_mem_info(WINDOW *menu, struct member *mem, int start, int end)
|
static void display_mem_info(WINDOW *menu, struct member *mem, int start_y, int end)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
struct reference *dep;
|
struct reference *dep;
|
||||||
struct reference *con;
|
struct reference *con;
|
||||||
struct reference *use;
|
struct reference *use;
|
||||||
|
int start_x = (max_x / 2 - MEMBER_INFO_LEFT_ADJ);
|
||||||
|
int maxlen = (max_x - start_x);
|
||||||
|
|
||||||
wmove(menu, end - start + 2, max_x / 2 - 16);
|
wmove(menu, end - start_y + 1, start_x);
|
||||||
wclrtoeol(menu);
|
wclrtoeol(menu);
|
||||||
wmove(menu, end - start + 3, max_x / 2 - 16);
|
wmove(menu, end - start_y + 2, start_x);
|
||||||
wclrtoeol(menu);
|
wclrtoeol(menu);
|
||||||
wmove(menu, end - start + 4, max_x / 2 - 16);
|
wmove(menu, end - start_y + 3, start_x);
|
||||||
wclrtoeol(menu);
|
wclrtoeol(menu);
|
||||||
wmove(menu, end - start + 5, max_x / 2 - 16);
|
wmove(menu, end - start_y + 4, start_x);
|
||||||
wclrtoeol(menu);
|
wclrtoeol(menu);
|
||||||
wmove(menu, end - start + 6, max_x / 2 - 16);
|
wmove(menu, end - start_y + 5, start_x);
|
||||||
|
wclrtoeol(menu);
|
||||||
|
wmove(menu, end - start_y + 6, start_x);
|
||||||
wclrtoeol(menu);
|
wclrtoeol(menu);
|
||||||
|
|
||||||
if (mem->displayname) {
|
if (mem->displayname) {
|
||||||
wmove(menu, end - start + 2, max_x / 2 - 16);
|
int name_len = strlen(mem->displayname);
|
||||||
waddstr(menu, (char *) mem->displayname);
|
|
||||||
|
wmove(menu, end - start_y + 1, start_x);
|
||||||
|
if (name_len > maxlen) {
|
||||||
|
char *last_space;
|
||||||
|
char *line_1 = strdup(mem->displayname);
|
||||||
|
|
||||||
|
if (line_1) {
|
||||||
|
line_1[maxlen] = '\0';
|
||||||
|
last_space = strrchr(line_1, ' ');
|
||||||
|
if (last_space) {
|
||||||
|
*last_space = '\0';
|
||||||
|
}
|
||||||
|
waddstr(menu, line_1);
|
||||||
|
wmove(menu, end - start_y + 2, start_x);
|
||||||
|
waddstr(menu, &mem->displayname[last_space - line_1]);
|
||||||
|
free(line_1);
|
||||||
|
} else {
|
||||||
|
waddstr(menu, (char *) mem->displayname);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
waddstr(menu, (char *) mem->displayname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!AST_LIST_EMPTY(&mem->deps)) {
|
if (!AST_LIST_EMPTY(&mem->deps)) {
|
||||||
wmove(menu, end - start + 3, max_x / 2 - 16);
|
wmove(menu, end - start_y + 3, start_x);
|
||||||
strcpy(buf, "Depends on: ");
|
strcpy(buf, "Depends on: ");
|
||||||
AST_LIST_TRAVERSE(&mem->deps, dep, list) {
|
AST_LIST_TRAVERSE(&mem->deps, dep, list) {
|
||||||
strncat(buf, dep->displayname, sizeof(buf) - strlen(buf) - 1);
|
strncat(buf, dep->displayname, sizeof(buf) - strlen(buf) - 1);
|
||||||
@@ -213,7 +244,7 @@ static void display_mem_info(WINDOW *menu, struct member *mem, int start, int en
|
|||||||
waddstr(menu, buf);
|
waddstr(menu, buf);
|
||||||
}
|
}
|
||||||
if (!AST_LIST_EMPTY(&mem->uses)) {
|
if (!AST_LIST_EMPTY(&mem->uses)) {
|
||||||
wmove(menu, end - start + 4, max_x / 2 - 16);
|
wmove(menu, end - start_y + 4, start_x);
|
||||||
strcpy(buf, "Can use: ");
|
strcpy(buf, "Can use: ");
|
||||||
AST_LIST_TRAVERSE(&mem->uses, use, list) {
|
AST_LIST_TRAVERSE(&mem->uses, use, list) {
|
||||||
strncat(buf, use->displayname, sizeof(buf) - strlen(buf) - 1);
|
strncat(buf, use->displayname, sizeof(buf) - strlen(buf) - 1);
|
||||||
@@ -224,7 +255,7 @@ static void display_mem_info(WINDOW *menu, struct member *mem, int start, int en
|
|||||||
waddstr(menu, buf);
|
waddstr(menu, buf);
|
||||||
}
|
}
|
||||||
if (!AST_LIST_EMPTY(&mem->conflicts)) {
|
if (!AST_LIST_EMPTY(&mem->conflicts)) {
|
||||||
wmove(menu, end - start + 5, max_x / 2 - 16);
|
wmove(menu, end - start_y + 5, start_x);
|
||||||
strcpy(buf, "Conflicts with: ");
|
strcpy(buf, "Conflicts with: ");
|
||||||
AST_LIST_TRAVERSE(&mem->conflicts, con, list) {
|
AST_LIST_TRAVERSE(&mem->conflicts, con, list) {
|
||||||
strncat(buf, con->displayname, sizeof(buf) - strlen(buf) - 1);
|
strncat(buf, con->displayname, sizeof(buf) - strlen(buf) - 1);
|
||||||
@@ -237,7 +268,7 @@ static void display_mem_info(WINDOW *menu, struct member *mem, int start, int en
|
|||||||
|
|
||||||
if (!mem->is_separator) { /* Separators lack support levels */
|
if (!mem->is_separator) { /* Separators lack support levels */
|
||||||
{ /* support level */
|
{ /* support level */
|
||||||
wmove(menu, end - start + 6, max_x / 2 - 16);
|
wmove(menu, end - start_y + 6, start_x);
|
||||||
snprintf(buf, sizeof(buf), "Support Level: %s", mem->support_level);
|
snprintf(buf, sizeof(buf), "Support Level: %s", mem->support_level);
|
||||||
if (mem->replacement && *mem->replacement) {
|
if (mem->replacement && *mem->replacement) {
|
||||||
char buf2[64];
|
char buf2[64];
|
||||||
@@ -266,7 +297,7 @@ static void draw_category_menu(WINDOW *menu, struct category *cat, int start, in
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wmove(menu, curopt - start, max_x / 2 - 9);
|
wmove(menu, curopt - start, (max_x / 2) - (CAT_MENU_LEFT_ADJ - 1));
|
||||||
wrefresh(menu);
|
wrefresh(menu);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -279,7 +310,7 @@ static void draw_category_menu(WINDOW *menu, struct category *cat, int start, in
|
|||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
wmove(menu, j++, max_x / 2 - 10);
|
wmove(menu, j++, max_x / 2 - CAT_MENU_LEFT_ADJ);
|
||||||
i++;
|
i++;
|
||||||
if ((mem->depsfailed == HARD_FAILURE) || (mem->conflictsfailed == HARD_FAILURE)) {
|
if ((mem->depsfailed == HARD_FAILURE) || (mem->conflictsfailed == HARD_FAILURE)) {
|
||||||
snprintf(buf, sizeof(buf), "XXX %s", mem->name);
|
snprintf(buf, sizeof(buf), "XXX %s", mem->name);
|
||||||
@@ -302,11 +333,11 @@ static void draw_category_menu(WINDOW *menu, struct category *cat, int start, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & SCROLL_DOWN) {
|
if (flags & SCROLL_DOWN) {
|
||||||
wmove(menu, j, max_x / 2 - sizeof(SCROLL_DOWN_INDICATOR) / 2);
|
wmove(menu, j, max_x / 2 - SCROLL_DOWN_LEFT_ADJ);
|
||||||
waddstr(menu, SCROLL_DOWN_INDICATOR);
|
waddstr(menu, SCROLL_DOWN_INDICATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
wmove(menu, curopt - start, max_x / 2 - 9);
|
wmove(menu, curopt - start, (max_x / 2) - (CAT_MENU_LEFT_ADJ - 1));
|
||||||
wrefresh(menu);
|
wrefresh(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,7 +496,7 @@ static void draw_title_window(WINDOW *title)
|
|||||||
waddstr(title, (char *) menu_name);
|
waddstr(title, (char *) menu_name);
|
||||||
wmove(title, 3, (max_x / 2) - (strlen(titlebar) / 2));
|
wmove(title, 3, (max_x / 2) - (strlen(titlebar) / 2));
|
||||||
waddstr(title, titlebar);
|
waddstr(title, titlebar);
|
||||||
wmove(title, 5, (max_x / 2) - (strlen(MENU_HELP) / 2));
|
wmove(title, 5, (max_x / 2) - MENU_HELP_LEFT_ADJ);
|
||||||
waddstr(title, MENU_HELP);
|
waddstr(title, MENU_HELP);
|
||||||
wrefresh(title);
|
wrefresh(title);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user