Skip to content

Commit a885b2c

Browse files
asteriskteamsruffell
authored andcommitted
Import menuselect r1110
Menuselect was originally included in the DAHDI-Tools repository with an svn external. Since git does not handle externals so well, menuselect is being brought into the tree directly. This allows menuselect to be present for all the commits on the 2.4, 2.5, and 2.6 releases. The command is: $ svn export http://svn.asterisk.org/svn/menuselect/trunk menuselect Signed-off-by: Shaun Ruffell <[email protected]>
0 parents  commit a885b2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+32719
-0
lines changed

menuselect/Makefile

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#
2+
# Asterisk -- A telephony toolkit for Linux.
3+
#
4+
# Makefile for Menuselect
5+
#
6+
# Copyright (C) 2005-2008, Digium, Inc.
7+
#
8+
# Russell Bryant <[email protected]>
9+
#
10+
# This program is free software, distributed under the terms of
11+
# the GNU General Public License
12+
#
13+
14+
# even though we could use '-include makeopts' here, use a wildcard
15+
# lookup anyway, so that make won't try to build makeopts if it doesn't
16+
# exist (other rules will force it to be built if needed)
17+
ifneq ($(wildcard makeopts),)
18+
include makeopts
19+
endif
20+
21+
.PHONY: clean dist-clean distclean test ntest ctest gtest
22+
23+
# Basic set of sources and flags/libraries/includes
24+
OBJS:=menuselect.o strcompat.o
25+
CFLAGS+=-g -D_GNU_SOURCE -Wall
26+
27+
ifeq ($(MENUSELECT_DEBUG),yes)
28+
CFLAGS += -DMENUSELECT_DEBUG
29+
endif
30+
31+
ifdef NCURSES_LIB
32+
C_OBJS += menuselect_curses.o
33+
C_LIBS +=$(NCURSES_LIB)
34+
C_INCLUDE += $(NCURSES_INCLUDE)
35+
ALL_TGTS += cmenuselect
36+
else
37+
ifdef CURSES_LIB
38+
C_OBJS += menuselect_curses.o
39+
C_LIBS +=$(CURSES_LIB)
40+
C_INCLUDE += $(CURSES_INCLUDE)
41+
ALL_TGTS += cmenuselect
42+
endif
43+
endif
44+
45+
ifdef GTK2_LIB
46+
G_OBJS += menuselect_gtk.o
47+
G_LIBS += $(GTK2_LIB)
48+
G_INCLUDE += $(GTK2_INCLUDE)
49+
ALL_TGTS += gmenuselect
50+
endif
51+
52+
ifdef NEWT_LIB
53+
N_OBJS += menuselect_newt.o
54+
N_LIBS += $(NEWT_LIB)
55+
N_INCLUDE += $(NEWT_INCLUDE)
56+
ALL_TGTS += nmenuselect
57+
endif
58+
59+
M_OBJS += menuselect_stub.o
60+
ALL_TGTS += menuselect
61+
62+
all: $(ALL_TGTS)
63+
64+
$(OBJS) $(C_OBJS) $(N_OBJS) $(G_OBJS) $(M_OBJS): autoconfig.h menuselect.h
65+
66+
makeopts autoconfig.h: autoconfig.h.in makeopts.in
67+
@./configure $(CONFIGURE_SILENT)
68+
69+
$(ALL_TGTS): mxml/libmxml.a
70+
71+
ifdef C_OBJS
72+
menuselect_curses.o: CFLAGS+=$(C_INCLUDE)
73+
cmenuselect: $(OBJS) $(C_OBJS)
74+
$(CC) $(LDFLAGS) -o $@ $^ $(C_LIBS)
75+
else
76+
cmenuselect:
77+
endif
78+
79+
ifdef G_OBJS
80+
menuselect_gtk.o: CFLAGS+=$(G_INCLUDE)
81+
gmenuselect: $(OBJS) $(G_OBJS)
82+
$(CC) $(LDFLAGS) -o $@ $^ $(G_LIBS)
83+
else
84+
gmenuselect:
85+
endif
86+
87+
ifdef N_OBJS
88+
menuselect_newt.o: CFLAGS+=$(N_INCLUDE)
89+
nmenuselect: $(OBJS) $(N_OBJS)
90+
$(CC) $(LDFLAGS) -o $@ $^ $(N_LIBS)
91+
else
92+
nmenuselect:
93+
endif
94+
95+
menuselect: $(OBJS) $(M_OBJS)
96+
$(CC) $(LDFLAGS) -o $@ $^ $(M_LIBS)
97+
98+
mxml/libmxml.a:
99+
@if test ! -f mxml/Makefile ; then cd mxml && ./configure ; fi
100+
@$(MAKE) -C mxml libmxml.a
101+
102+
test: menuselect
103+
(cd test; ../$< menuselect.makeopts)
104+
105+
ctest: cmenuselect
106+
(cd test; ../$< menuselect.makeopts)
107+
108+
gtest: gmenuselect
109+
(cd test; ../$< menuselect.makeopts)
110+
111+
ntest: nmenuselect
112+
(cd test; ../$< menuselect.makeopts)
113+
114+
clean:
115+
rm -f menuselect cmenuselect gmenuselect nmenuselect $(OBJS) $(M_OBJS) $(C_OBJS) $(G_OBJS) $(N_OBJS)
116+
@if test -f mxml/Makefile ; then $(MAKE) -C mxml clean ; fi
117+
118+
dist-clean: distclean
119+
120+
distclean: clean
121+
@if test -f mxml/Makefile ; then $(MAKE) -C mxml distclean ; fi
122+
rm -f autoconfig.h config.status config.log makeopts
123+
rm -rf autom4te.cache

menuselect/README

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
MENUSELECT
2+
Copyright (C) 2005-2006, Digium, Inc.
3+
Russell Bryant <[email protected]>
4+
-------------------------------------------------------------------------------
5+
6+
7+
ABOUT
8+
9+
Menuselect is a tool designed to be used in conjunction with GNU make. It
10+
allows for an XML specification of Makefile variables and optional space
11+
delimited values of these variables. These values can then be used in the
12+
Makefile to make various decisions during the build process.
13+
14+
Menuselect also provides a mechanism for dependency checking for each possible
15+
member (value) of each category (Makefile variable). These dependencies are
16+
generally checked by using autoconf and the results provided to menuselect. If
17+
dependencies for a member are not met, the user will not be allowed to make
18+
that selection. In the same way the menuselect does dependency checking, it
19+
also does conflict checking. If a listed conflict for a member is met, then
20+
the user will not be allowed to select it.
21+
22+
For use with automated builds or when the user has no desire to make selections
23+
different than the defined defaults, menuselect can generate a default output
24+
file for use in the build.
25+
26+
Menuselect can also do a sanity check on existing input files. If any member
27+
has been selected that has conflicts or unmet dependencies, then menuselect
28+
will exit with an error and output to notify the user of the situation. This is
29+
typically done at the beginning of the build process to ensure that given all
30+
of the known information, the build is going to be successful.
31+
32+
33+
MENUSELECT DEPENDENCIES
34+
35+
libncurses -- This is needed for the curses frontend.
36+
libnewt -- This is needed for the newt frontend (optional).
37+
libmxml -- This library, Mini-XML, is used for XML parsing.
38+
(http://www.easysw.com/~mike/mxml/)
39+
(Asterisk uses the code in http://svn.digium.com/svn/mxml/ )
40+
41+
42+
ENVIRONMENT SETUP
43+
44+
The file menuselect.h contains a couple of defines which specify locations for
45+
various files. These locations are relative to the directory from which
46+
menuselect will be executed.
47+
48+
#define OUTPUT_MAKEOPTS_DEFAULT "menuselect.makeopts"
49+
This is the location where the menuselect output will be saved.
50+
51+
#define MENUSELECT_DEPS "build_tools/menuselect-deps"
52+
This is the location where menuselect will expect to find the input file that
53+
provides dependency and conflict information. More information on the format of
54+
this file can be found in the section about dependency and conflict checking.
55+
56+
57+
DEPENDENCY AND CONFLICT CHECKING
58+
59+
Members may have as many conflicts and dependencies specified as needed. An
60+
example of the MENUSELECT_DEPS file would look like this:
61+
62+
DEPENDENCY1=1
63+
DEPENDENCY2=0
64+
CONFLICT1=0
65+
66+
In this case, "DEPENDENCY1" has been met, "DEPENDENCY2" has not been met, and
67+
"CONFLICT1" is not present.
68+
69+
To ask menuselect to do a background sanity check on dependencies and
70+
conflicts, it can be called like this:
71+
72+
./menuselect --check-deps <input_file1> [input_file2] [...]
73+
74+
The format of the input files must be of the same format menuselect uses to
75+
create the OUPUT_MAKEOPTS_DEFAULT.
76+
77+
78+
ENABLING AND DISABLING OPTIONS FROM THE COMMAND LINE
79+
80+
If you would like menuselect to update choices via the command line, it can be
81+
done with the following syntax:
82+
83+
Enable an option:
84+
$ menuselect/menuselect --enable TEST_FRAMEWORK menuselect.makeopts
85+
86+
Enable all options in a category:
87+
$ menuselect/menuselect --enable-category MENUSELECT_TEST menuselect.makeopts
88+
89+
Disable an option:
90+
$ menuselect/menuselect --disable TEST_FRAMEWORK menuselect.makeopts
91+
92+
Disable all options in a category:
93+
$ menuselect/menuselect --disable-category MENUSELECT_TEST menuselect.makeopts
94+
95+
96+
SETTING UP AVAILABLE OPTIONS
97+
98+
The XML specification for the menu lives in the file "menuselect-tree" and should
99+
be in the same directory that menuselect will be executed from. An example
100+
menuselect-tree file as used in the Asterisk project (http://www.asterisk.org) is
101+
provided in example_menuselect-tree
102+
103+
Menu:
104+
The top level tag in menuselect-tree is the <menu> tag. All of the categories
105+
reside inside of the <menu> ... </menu> block.
106+
107+
Menu Attributes:
108+
name="Asterisk Module Selection"
109+
This specifies the title of the menu. It is displayed at the top of the
110+
screen when using the curses frontend
111+
112+
Categories:
113+
A <category> contains members. The category tag can contain a number of
114+
different attributes to specify different behavior.
115+
116+
Category Attributes:
117+
name="MENUSELECT_APPS"
118+
The name attribute is required. This is the name of the variable that will
119+
be in the output from menuselect.
120+
121+
displayname="Applications"
122+
If this is specfied, this is what will be shown in the menu to the user.
123+
124+
positive_output="yes"
125+
The default for menuselect is to output all of the members of a category
126+
that are *not* selected. This is because it is often convenient to be able
127+
to define a full list in the Makefile and then filter out the results from
128+
menuselect. Using GNU make, an example of this would be:
129+
APPS:=$(filter-out $(MENUSELECT_APPS),$(APPS))
130+
131+
remove_on_change=".lastclean"
132+
This attribute can contain a space delimited list of files to be deleted
133+
when it is time to build an output file if any of the members of this
134+
category have changed values from their values for existing input when the
135+
application was started.
136+
137+
Members:
138+
A <member> contains conflicts and dependencies. The member tag can contain a
139+
number of different attributes to specify different behavior.
140+
141+
Member Attributes:
142+
name="app_meetme"
143+
The name attribute is required. This is the value that will be added to the
144+
variable specified by the category when selected (or not selected) depending
145+
on the setting of the positive_output attribute of the category.
146+
147+
displayname="Call Conferencing Application"
148+
If this is specified, this will be provided as a description of this member
149+
when the cursor is on it in the menu.
150+
151+
remove_on_change="apps/app_meetme.o apps/app_meetme.so"
152+
This attribute can contain a space delimeted list of files to be deleted
153+
when it is time to build an output file if the value of this member has
154+
changed from its value in any existing input when the application was
155+
started.
156+
157+
Dependencies:
158+
A dependency for a <member> is specified using a <depend> tag. The name of
159+
the dependency corresponds to names in the MENUSELECT_DEPS file. This is an
160+
example of specifying a dependency for a member:
161+
<member name="app_meetme">
162+
<depend>zaptel</depend>
163+
</member>
164+
165+
Conflicts:
166+
A conflict for a <member> is specified using a <conflict> tag. The name of
167+
the conflict corresponds to names in the MENUSELECT_DEPS file. This is an
168+
example of specifying a dependency for a member:
169+
<member name="res_musiconhold">
170+
<conflict>win32</conflict>
171+
</member>
172+
173+
174+
REPORTING BUGS
175+
176+
Any bug reports or feature enhancement submissions to menuselect should be
177+
submitted at https://issues.asterisk.org/
178+
179+
Thank you!

0 commit comments

Comments
 (0)