Browse Source

menuselect: Remove last bits completely from the repo

menuselect has not been used in dahdi-tools since r10411 (7 months ago). This
patch removes menuselect from the repository completely.

Reported-by: Sean Bright
Internal-Issue-ID: DAHTOOL-61
Patches: kill-menuselect.patch by Sean Bright (license #5060)

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>



git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10721 17933a7a-c749-41c5-a318-cba88f637d49
master
Russ Meyerriecks 9 years ago
parent
commit
b8d8cc4f8d
  1. 6
      README
  2. 7
      build_tools/make_tree
  3. 2
      build_tools/menuselect-deps.in
  4. 2
      configure.ac
  5. 123
      menuselect/Makefile
  6. 179
      menuselect/README
  7. 199
      menuselect/acinclude.m4
  8. 14
      menuselect/aclocal.m4
  9. 128
      menuselect/autoconfig.h.in
  10. 41
      menuselect/bootstrap.sh
  11. 1501
      menuselect/config.guess
  12. 1705
      menuselect/config.sub
  13. 7422
      menuselect/configure
  14. 146
      menuselect/configure.ac
  15. 17
      menuselect/contrib/Makefile-dummy
  16. 741
      menuselect/contrib/menuselect-dummy
  17. 487
      menuselect/example_menuselect-tree
  18. 323
      menuselect/install-sh
  19. 372
      menuselect/linkedlists.h
  20. 56
      menuselect/make_version
  21. 22
      menuselect/makeopts.in
  22. 2096
      menuselect/menuselect.c
  23. 157
      menuselect/menuselect.h
  24. 1034
      menuselect/menuselect_curses.c
  25. 358
      menuselect/menuselect_gtk.c
  26. 427
      menuselect/menuselect_newt.c
  27. 39
      menuselect/menuselect_stub.c
  28. 360
      menuselect/missing
  29. 5
      menuselect/mxml/ANNOUNCEMENT
  30. 213
      menuselect/mxml/CHANGES
  31. 482
      menuselect/mxml/COPYING
  32. 342
      menuselect/mxml/Makefile.in
  33. 204
      menuselect/mxml/README
  34. 69
      menuselect/mxml/config.h.in
  35. 5702
      menuselect/mxml/configure
  36. 343
      menuselect/mxml/configure.in
  37. 251
      menuselect/mxml/install-sh
  38. 181
      menuselect/mxml/mxml-attr.c
  39. 472
      menuselect/mxml/mxml-entity.c
  40. 2844
      menuselect/mxml/mxml-file.c
  41. 649
      menuselect/mxml/mxml-index.c
  42. 664
      menuselect/mxml/mxml-node.c
  43. 128
      menuselect/mxml/mxml-private.c
  44. 199
      menuselect/mxml/mxml-search.c
  45. 257
      menuselect/mxml/mxml-set.c
  46. 377
      menuselect/mxml/mxml-string.c
  47. 254
      menuselect/mxml/mxml.h
  48. 115
      menuselect/mxml/mxml.list.in
  49. 10
      menuselect/mxml/mxml.pc.in
  50. 243
      menuselect/strcompat.c
  51. 52
      menuselect/test/build_tools/menuselect-deps
  52. 716
      menuselect/test/menuselect-tree

6
README

@ -73,9 +73,9 @@ This can be useful for any partial install target from the list above.
Options For ./configure
^^^^^^^^^^^^^^^^^^^^^^^
The configure script various several tests and based on them generates
some files ( build_tools/menuselect-deps and makeopts). You can pass it
--with options and variable settings, for instance:
The configure script executes various tests and based on them generates
makeopts. You can pass it --with options and variable settings, for
instance:
./configure --without-ncurses CC="gcc-4.10"

7
build_tools/make_tree

@ -1,7 +0,0 @@
#!/bin/sh
echo "<?xml version=\"1.0\"?>"
echo
echo "<menu name=\"DAHDI Tools Selection\">"
cat dahdi.xml
echo "</menu>"

2
build_tools/menuselect-deps.in

@ -1,2 +0,0 @@
LIBNEWT=@PBX_NEWT@
HDLC=@PBX_HDLC@

2
configure.ac

@ -211,7 +211,7 @@ fi
AC_SUBST(PPPD_VERSION)
AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
AC_CONFIG_FILES([makeopts])
AC_OUTPUT
AC_MSG_NOTICE(*** dahdi-tools build successfully configured ***)

123
menuselect/Makefile

@ -1,123 +0,0 @@
#
# Asterisk -- A telephony toolkit for Linux.
#
# Makefile for Menuselect
#
# Copyright (C) 2005-2008, Digium, Inc.
#
# Russell Bryant <russell@digium.com>
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
# even though we could use '-include makeopts' here, use a wildcard
# lookup anyway, so that make won't try to build makeopts if it doesn't
# exist (other rules will force it to be built if needed)
ifneq ($(wildcard makeopts),)
include makeopts
endif
.PHONY: clean dist-clean distclean test ntest ctest gtest
# Basic set of sources and flags/libraries/includes
OBJS:=menuselect.o strcompat.o
CFLAGS+=-g -D_GNU_SOURCE -Wall
ifeq ($(MENUSELECT_DEBUG),yes)
CFLAGS += -DMENUSELECT_DEBUG
endif
ifdef NCURSES_LIB
C_OBJS += menuselect_curses.o
C_LIBS +=$(NCURSES_LIB)
C_INCLUDE += $(NCURSES_INCLUDE)
ALL_TGTS += cmenuselect
else
ifdef CURSES_LIB
C_OBJS += menuselect_curses.o
C_LIBS +=$(CURSES_LIB)
C_INCLUDE += $(CURSES_INCLUDE)
ALL_TGTS += cmenuselect
endif
endif
ifdef GTK2_LIB
G_OBJS += menuselect_gtk.o
G_LIBS += $(GTK2_LIB)
G_INCLUDE += $(GTK2_INCLUDE)
ALL_TGTS += gmenuselect
endif
ifdef NEWT_LIB
N_OBJS += menuselect_newt.o
N_LIBS += $(NEWT_LIB)
N_INCLUDE += $(NEWT_INCLUDE)
ALL_TGTS += nmenuselect
endif
M_OBJS += menuselect_stub.o
ALL_TGTS += menuselect
all: $(ALL_TGTS)
$(OBJS) $(C_OBJS) $(N_OBJS) $(G_OBJS) $(M_OBJS): autoconfig.h menuselect.h
makeopts autoconfig.h: autoconfig.h.in makeopts.in
@./configure $(CONFIGURE_SILENT)
$(ALL_TGTS): mxml/libmxml.a
ifdef C_OBJS
menuselect_curses.o: CFLAGS+=$(C_INCLUDE)
cmenuselect: $(OBJS) $(C_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(C_LIBS)
else
cmenuselect:
endif
ifdef G_OBJS
menuselect_gtk.o: CFLAGS+=$(G_INCLUDE)
gmenuselect: $(OBJS) $(G_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(G_LIBS)
else
gmenuselect:
endif
ifdef N_OBJS
menuselect_newt.o: CFLAGS+=$(N_INCLUDE)
nmenuselect: $(OBJS) $(N_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(N_LIBS)
else
nmenuselect:
endif
menuselect: $(OBJS) $(M_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(M_LIBS)
mxml/libmxml.a:
@if test ! -f mxml/Makefile ; then cd mxml && ./configure ; fi
@$(MAKE) -C mxml libmxml.a
test: menuselect
(cd test; ../$< menuselect.makeopts)
ctest: cmenuselect
(cd test; ../$< menuselect.makeopts)
gtest: gmenuselect
(cd test; ../$< menuselect.makeopts)
ntest: nmenuselect
(cd test; ../$< menuselect.makeopts)
clean:
rm -f menuselect cmenuselect gmenuselect nmenuselect $(OBJS) $(M_OBJS) $(C_OBJS) $(G_OBJS) $(N_OBJS)
@if test -f mxml/Makefile ; then $(MAKE) -C mxml clean ; fi
dist-clean: distclean
distclean: clean
@if test -f mxml/Makefile ; then $(MAKE) -C mxml distclean ; fi
rm -f autoconfig.h config.status config.log makeopts
rm -rf autom4te.cache

179
menuselect/README

@ -1,179 +0,0 @@
MENUSELECT
Copyright (C) 2005-2006, Digium, Inc.
Russell Bryant <russell@digium.com>
-------------------------------------------------------------------------------
ABOUT
Menuselect is a tool designed to be used in conjunction with GNU make. It
allows for an XML specification of Makefile variables and optional space
delimited values of these variables. These values can then be used in the
Makefile to make various decisions during the build process.
Menuselect also provides a mechanism for dependency checking for each possible
member (value) of each category (Makefile variable). These dependencies are
generally checked by using autoconf and the results provided to menuselect. If
dependencies for a member are not met, the user will not be allowed to make
that selection. In the same way the menuselect does dependency checking, it
also does conflict checking. If a listed conflict for a member is met, then
the user will not be allowed to select it.
For use with automated builds or when the user has no desire to make selections
different than the defined defaults, menuselect can generate a default output
file for use in the build.
Menuselect can also do a sanity check on existing input files. If any member
has been selected that has conflicts or unmet dependencies, then menuselect
will exit with an error and output to notify the user of the situation. This is
typically done at the beginning of the build process to ensure that given all
of the known information, the build is going to be successful.
MENUSELECT DEPENDENCIES
libncurses -- This is needed for the curses frontend.
libnewt -- This is needed for the newt frontend (optional).
libmxml -- This library, Mini-XML, is used for XML parsing.
(http://www.easysw.com/~mike/mxml/)
(Asterisk uses the code in http://svn.digium.com/svn/mxml/ )
ENVIRONMENT SETUP
The file menuselect.h contains a couple of defines which specify locations for
various files. These locations are relative to the directory from which
menuselect will be executed.
#define OUTPUT_MAKEOPTS_DEFAULT "menuselect.makeopts"
This is the location where the menuselect output will be saved.
#define MENUSELECT_DEPS "build_tools/menuselect-deps"
This is the location where menuselect will expect to find the input file that
provides dependency and conflict information. More information on the format of
this file can be found in the section about dependency and conflict checking.
DEPENDENCY AND CONFLICT CHECKING
Members may have as many conflicts and dependencies specified as needed. An
example of the MENUSELECT_DEPS file would look like this:
DEPENDENCY1=1
DEPENDENCY2=0
CONFLICT1=0
In this case, "DEPENDENCY1" has been met, "DEPENDENCY2" has not been met, and
"CONFLICT1" is not present.
To ask menuselect to do a background sanity check on dependencies and
conflicts, it can be called like this:
./menuselect --check-deps <input_file1> [input_file2] [...]
The format of the input files must be of the same format menuselect uses to
create the OUPUT_MAKEOPTS_DEFAULT.
ENABLING AND DISABLING OPTIONS FROM THE COMMAND LINE
If you would like menuselect to update choices via the command line, it can be
done with the following syntax:
Enable an option:
$ menuselect/menuselect --enable TEST_FRAMEWORK menuselect.makeopts
Enable all options in a category:
$ menuselect/menuselect --enable-category MENUSELECT_TEST menuselect.makeopts
Disable an option:
$ menuselect/menuselect --disable TEST_FRAMEWORK menuselect.makeopts
Disable all options in a category:
$ menuselect/menuselect --disable-category MENUSELECT_TEST menuselect.makeopts
SETTING UP AVAILABLE OPTIONS
The XML specification for the menu lives in the file "menuselect-tree" and should
be in the same directory that menuselect will be executed from. An example
menuselect-tree file as used in the Asterisk project (http://www.asterisk.org) is
provided in example_menuselect-tree
Menu:
The top level tag in menuselect-tree is the <menu> tag. All of the categories
reside inside of the <menu> ... </menu> block.
Menu Attributes:
name="Asterisk Module Selection"
This specifies the title of the menu. It is displayed at the top of the
screen when using the curses frontend
Categories:
A <category> contains members. The category tag can contain a number of
different attributes to specify different behavior.
Category Attributes:
name="MENUSELECT_APPS"
The name attribute is required. This is the name of the variable that will
be in the output from menuselect.
displayname="Applications"
If this is specfied, this is what will be shown in the menu to the user.
positive_output="yes"
The default for menuselect is to output all of the members of a category
that are *not* selected. This is because it is often convenient to be able
to define a full list in the Makefile and then filter out the results from
menuselect. Using GNU make, an example of this would be:
APPS:=$(filter-out $(MENUSELECT_APPS),$(APPS))
remove_on_change=".lastclean"
This attribute can contain a space delimited list of files to be deleted
when it is time to build an output file if any of the members of this
category have changed values from their values for existing input when the
application was started.
Members:
A <member> contains conflicts and dependencies. The member tag can contain a
number of different attributes to specify different behavior.
Member Attributes:
name="app_meetme"
The name attribute is required. This is the value that will be added to the
variable specified by the category when selected (or not selected) depending
on the setting of the positive_output attribute of the category.
displayname="Call Conferencing Application"
If this is specified, this will be provided as a description of this member
when the cursor is on it in the menu.
remove_on_change="apps/app_meetme.o apps/app_meetme.so"
This attribute can contain a space delimeted list of files to be deleted
when it is time to build an output file if the value of this member has
changed from its value in any existing input when the application was
started.
Dependencies:
A dependency for a <member> is specified using a <depend> tag. The name of
the dependency corresponds to names in the MENUSELECT_DEPS file. This is an
example of specifying a dependency for a member:
<member name="app_meetme">
<depend>zaptel</depend>
</member>
Conflicts:
A conflict for a <member> is specified using a <conflict> tag. The name of
the conflict corresponds to names in the MENUSELECT_DEPS file. This is an
example of specifying a dependency for a member:
<member name="res_musiconhold">
<conflict>win32</conflict>
</member>
REPORTING BUGS
Any bug reports or feature enhancement submissions to menuselect should be
submitted at https://issues.asterisk.org/
Thank you!

199
menuselect/acinclude.m4

@ -1,199 +0,0 @@
# Helper function to check for gcc attributes.
# AST_GCC_ATTRIBUTE([attribute name], [attribute syntax], [attribute scope], [makeopts flag])
AC_DEFUN([AST_GCC_ATTRIBUTE],
[
AC_MSG_CHECKING(checking for compiler 'attribute $1' support)
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
m4_ifval([$4],$4=0)
if test "x$2" = "x"
then
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
[]),
AC_MSG_RESULT(yes)
m4_ifval([$4],$4=1)
AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
AC_MSG_RESULT(no)
)
else
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([$3 void __attribute__(($2)) *test(void *muffin, ...) {return (void *) 0;}],
[]),
AC_MSG_RESULT(yes)
m4_ifval([$4],$4=1)
AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
AC_MSG_RESULT(no)
)
fi
m4_ifval([$4],[AC_SUBST($4)])
CFLAGS="$saved_CFLAGS"
])
# AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text])
AC_DEFUN([AST_EXT_LIB_SETUP],
[
$1_DESCRIP="$2"
$1_OPTION="$3"
AC_ARG_WITH([$3], AC_HELP_STRING([--with-$3=PATH],[use $2 files in PATH $4]),[
case ${withval} in
n|no)
USE_$1=no
;;
y|ye|yes)
$1_MANDATORY="yes"
;;
*)
$1_DIR="${withval}"
$1_MANDATORY="yes"
;;
esac
])
PBX_$1=0
AC_SUBST([$1_LIB])
AC_SUBST([$1_INCLUDE])
AC_SUBST([PBX_$1])
])
# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
AC_DEFUN([AST_EXT_LIB_CHECK],
[
if test "${USE_$1}" != "no"; then
pbxlibdir=""
if test "x${$1_DIR}" != "x"; then
if test -d ${$1_DIR}/lib; then
pbxlibdir="-L${$1_DIR}/lib"
else
pbxlibdir="-L${$1_DIR}"
fi
fi
AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
if test "${AST_$1_FOUND}" = "yes"; then
$1_LIB="-l$2 $5"
$1_HEADER_FOUND="1"
if test "x${$1_DIR}" != "x"; then
$1_LIB="${pbxlibdir} ${$1_LIB}"
$1_INCLUDE="-I${$1_DIR}/include"
if test "x$4" != "x" ; then
AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
fi
else
if test "x$4" != "x" ; then
AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
fi
fi
if test "x${$1_HEADER_FOUND}" = "x0" ; then
if test ! -z "${$1_MANDATORY}" ;
then
AC_MSG_NOTICE( ***)
AC_MSG_NOTICE( *** It appears that you do not have the $2 development package installed.)
AC_MSG_NOTICE( *** Please install it to include ${$1_DESCRIP} support, or re-run configure)
AC_MSG_NOTICE( *** without explicitly specifying --with-${$1_OPTION})
exit 1
fi
$1_LIB=""
$1_INCLUDE=""
PBX_$1=0
else
PBX_$1=1
AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
fi
elif test ! -z "${$1_MANDATORY}";
then
AC_MSG_NOTICE(***)
AC_MSG_NOTICE(*** The ${$1_DESCRIP} installation on this system appears to be broken.)
AC_MSG_NOTICE(*** Either correct the installation, or run configure)
AC_MSG_NOTICE(*** without explicitly specifying --with-${$1_OPTION})
exit 1
fi
fi
])
AC_DEFUN(
[AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK([for GNU make], [ac_cv_GNU_MAKE],
ac_cv_GNU_MAKE='Not Found' ;
ac_cv_GNU_MAKE_VERSION_MAJOR=0 ;
ac_cv_GNU_MAKE_VERSION_MINOR=0 ;
for a in make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
ac_cv_GNU_MAKE=$a ;
ac_cv_GNU_MAKE_VERSION_MAJOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
ac_cv_GNU_MAKE_VERSION_MINOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
break;
fi
done ;
) ;
if test "x$ac_cv_GNU_MAKE" = "xNot Found" ; then
AC_MSG_ERROR( *** Please install GNU make. It is required to build Asterisk!)
exit 1
fi
AC_SUBST([GNU_MAKE], [$ac_cv_GNU_MAKE])
])
# AST_FUNC_FORK
# -------------
AN_FUNCTION([fork], [AST_FUNC_FORK])
AN_FUNCTION([vfork], [AST_FUNC_FORK])
AC_DEFUN([AST_FUNC_FORK],
[AC_REQUIRE([AC_TYPE_PID_T])dnl
AC_CHECK_HEADERS(vfork.h)
AC_CHECK_FUNCS(fork vfork)
if test "x$ac_cv_func_fork" = xyes; then
_AST_FUNC_FORK
else
ac_cv_func_fork_works=$ac_cv_func_fork
fi
if test "x$ac_cv_func_fork_works" = xcross; then
case $host in
*-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* | *-*-linux-uclibc* )
# Override, as these systems have only a dummy fork() stub
ac_cv_func_fork_works=no
;;
*)
ac_cv_func_fork_works=yes
;;
esac
AC_MSG_WARN([result $ac_cv_func_fork_works guessed because of cross compilation])
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
if test "x$ac_cv_func_vfork" = xyes; then
_AC_FUNC_VFORK
fi;
if test "x$ac_cv_func_fork_works" = xcross; then
ac_cv_func_vfork_works=$ac_cv_func_vfork
AC_MSG_WARN([result $ac_cv_func_vfork_works guessed because of cross compilation])
fi
if test "x$ac_cv_func_vfork_works" = xyes; then
AC_DEFINE(HAVE_WORKING_VFORK, 1, [Define to 1 if `vfork' works.])
else
AC_DEFINE(vfork, fork, [Define as `fork' if `vfork' does not work.])
fi
if test "x$ac_cv_func_fork_works" = xyes; then
AC_DEFINE(HAVE_WORKING_FORK, 1, [Define to 1 if `fork' works.])
fi
])# AST_FUNC_FORK
# _AST_FUNC_FORK
# -------------
AC_DEFUN([_AST_FUNC_FORK],
[AC_CACHE_CHECK(for working fork, ac_cv_func_fork_works,
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[
/* By Ruediger Kuhlmann. */
return fork () < 0;
])],
[ac_cv_func_fork_works=yes],
[ac_cv_func_fork_works=no],
[ac_cv_func_fork_works=cross])])]
)# _AST_FUNC_FORK

14
menuselect/aclocal.m4

@ -1,14 +0,0 @@
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_include([acinclude.m4])

128
menuselect/autoconfig.h.in

@ -1,128 +0,0 @@
/* autoconfig.h.in. Generated from configure.ac by autoheader. */
#ifndef MENUSELECT_AUTOCONFIG_H
#define MENUSELECT_AUTOCONFIG_H
#ifndef _REENTRANT
#define _REENTRANT
#endif
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* Define to 1 if your GCC C compiler supports the 'weak' attribute. */
#undef HAVE_ATTRIBUTE_weak
/* Define to 1 if your GCC C compiler supports the 'weak_import' attribute. */
#undef HAVE_ATTRIBUTE_weak_import
/* Define to 1 if your GCC C compiler supports the 'weakref' attribute. */
#undef HAVE_ATTRIBUTE_weakref
/* Define to indicate the ${CURSES_DESCRIP} library */
#undef HAVE_CURSES
/* Define to 1 if you have the `getloadavg' function. */
#undef HAVE_GETLOADAVG
/* Define if your system has the GTK2 libraries. */
#undef HAVE_GTK2
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to indicate the ${NCURSES_DESCRIP} library */
#undef HAVE_NCURSES
/* Define to indicate the ${NEWT_DESCRIP} library */
#undef HAVE_NEWT
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasestr' function. */
#undef HAVE_STRCASESTR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the `strnlen' function. */
#undef HAVE_STRNLEN
/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `unsetenv' function. */
#undef HAVE_UNSETENV
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
#endif

41
menuselect/bootstrap.sh

@ -1,41 +0,0 @@
#!/bin/sh
check_for_app() {
$1 --version 2>&1 >/dev/null
if [ $? != 0 ]
then
echo "Please install $1 and run bootstrap.sh again!"
exit 1
fi
}
uname -s | grep -q FreeBSD
if [ $? = 0 ]
then
check_for_app autoconf259
check_for_app autoheader259
check_for_app automake19
check_for_app aclocal19
echo "Generating the configure script ..."
aclocal19 2>/dev/null
autoconf259
autoheader259
automake19 --add-missing --copy 2>/dev/null
else
AUTOCONF_VERSION=2.59
AUTOMAKE_VERSION=1.9
export AUTOCONF_VERSION
export AUTOMAKE_VERSION
check_for_app autoconf
check_for_app autoheader
check_for_app automake
check_for_app aclocal
echo "Generating the configure script ..."
aclocal 2>/dev/null
autoconf
autoheader
automake --add-missing --copy 2>/dev/null
fi
exit 0

1501
menuselect/config.guess
File diff suppressed because it is too large
View File

1705
menuselect/config.sub
File diff suppressed because it is too large
View File

7422
menuselect/configure
File diff suppressed because it is too large
View File

146
menuselect/configure.ac

@ -1,146 +0,0 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
m4_define([MENUSELECT_VERSION],
m4_bpatsubst(m4_esyscmd([./make_version .]),
[\([0-9.]*\)\(\w\|\W\)*],
[\1]))
AC_INIT(menuselect, MENUSELECT_VERSION, www.asterisk.org)
# check existence of the package
AC_CONFIG_SRCDIR([menuselect.c])
# specify output header file
AC_CONFIG_HEADER(autoconfig.h)
AC_COPYRIGHT("Menuselect")
AC_REVISION($Revision: 40837 $)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
HOST_OS=${host_os}
AC_SUBST(HOST_OS)
PBX_WINARCH=0
case "${host_os}" in
freebsd*)
OSARCH=FreeBSD
;;
netbsd*)
OSARCH=NetBSD
;;
openbsd*)
OSARCH=OpenBSD
;;
solaris*)
OSARCH=SunOS
;;
mingw32)
OSARCH=mingw32
PBX_WINARCH=1
;;
cygwin)
OSARCH=cygwin
PBX_WINARCH=1
;;
linux-gnueabi)
OSARCH=linux-gnu
;;
*)
OSARCH=${host_os}
;;
esac
AH_TOP(
#ifndef MENUSELECT_AUTOCONFIG_H
#define MENUSELECT_AUTOCONFIG_H
#ifndef _REENTRANT
#define _REENTRANT
#endif
)
AH_BOTTOM(
#endif
)
# Checks for programs.
AC_PROG_CC
AST_CHECK_GNU_MAKE
AC_LANG(C)
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Turn on debug mode])],
[case "${enableval}" in
y|ye|yes) MENUSELECT_DEBUG=yes ;;
n|no) MENUSELECT_DEBUG=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac])
AC_SUBST(MENUSELECT_DEBUG)
# Support weak symbols on a platform specific basis. The Mac OS X
# (Darwin) support must be isolated from the other platforms because
# it has caused other platforms to fail.
#
case "${OSARCH}" in
darwin*)
# Allow weak symbol support on Darwin platforms only because there
# is active community support for it.
# However, Darwin seems to break weak symbols for each new version.
#
AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)
# Several other platforms including Linux have GCC versions that
# define the weak attribute. However, this attribute is only
# setup for use in the code by Darwin.
AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)
;;
linux-gnu)
# Primarily support weak symbols on Linux platforms.
#
AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
;;
*)
# Allow weak symbols on other platforms. However, any problems
# with this feature on other platforms must be fixed by the
# community.
#
AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
;;
esac
AC_FUNC_ALLOCA
AC_CHECK_FUNCS([asprintf getloadavg setenv strcasestr strndup strnlen strsep unsetenv vasprintf])
# The frontend can use curses, ncurses, newt or GTK2 so check for all of them
AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
PBX_GTK2=0
AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)
if test ! "x${PKGCONFIG}" = xNo; then
GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
PBX_GTK2=1
AC_DEFINE([HAVE_GTK2], 1, [Define if your system has the GTK2 libraries.])
fi
AC_SUBST(PBX_GTK2)
AC_SUBST(GTK2_INCLUDE)
AC_SUBST(GTK2_LIB)
test "$silent"=yes && ac_sub_configure_args="${ac_sub_configure_args} --silent"
AC_CONFIG_FILES([makeopts])
AC_CONFIG_SUBDIRS([mxml])
AC_OUTPUT
AC_MSG_NOTICE(Menuselect build configuration successfully completed)

17
menuselect/contrib/Makefile-dummy

@ -1,17 +0,0 @@
all:
clean:
dist-clean:
makeopts:
menuselect:
./menuselect-dummy
# Generate some dummy files to satifsy dependencies from the main
# Makefile.
dummies:
touch linkedlists.h menuselect.c menuselect_curses.c \
menuselect.h menuselect_stub.c

741
menuselect/contrib/menuselect-dummy

@ -1,741 +0,0 @@
#!/usr/bin/perl -w
# menuselect - a simple drop-in replacement of the batch-mode menuselect
# included with Asterisk.
#
# Copyright (C) 2008 by Tzafrir Cohen <tzafrir.cohen@xorcom.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
# Installation: copy this script to menuselect/menuselect . Copy the
# included Makefile as menuselect/Makefile and run:
#
# make -C makefile dummies
#
# It takes configuration from build_tools/conf . Sample config file:
#
# By default all modules will be built (except those marked not be
# used by default)
#
# # exclude: Don't try to build the following modules.
# #exclude app_test
#
# # You can have multiple items in each line, and multiple lines.
# # Each item is a perl regular expression that must match the whole
# # module name.
# #exclude res_config_.*
#
# # include: syntax is the same as exclude. Overrides exclude and
# # modules that are marked as disabled by defualt:
# #include res_config_sqlite3 app_skel
#
# # If you want to make sure some modules will be conifgured to build,
# # you can require them. If modules that match any of the 'require'
# # pattern are not configured to build, menuselect will panic.
# # Same pattern rules apply here. Why would you want that? I have no
# # idea.
# #require chan_h323 app_directory
#
# # random - the value for this keyword is a number between 1 and
# # 100. The higher it is, more chances not to include each module.
# # Writes the list of modules that got hit to
# # build_tools/mods_removed_random .
# # Note that unlike 'make randomconfig' and such the random
# # configuration changes each time you run 'make', thus if a build
# # failed you should first read build_tools/mods_removed_random
# # before re-running make.
# #random 10
#
# # Anything after a '#' is ignored, and likewise empty lines.
# # Naturally.
use strict;
use Getopt::Long;
# Holds global dependncy information. Keys are module names.
my %ModInfo = ();
# extract configuration from kernel modules:
my $AutoconfDepsFile = "build_tools/menuselect-deps";
my $AutoconfOptsFile = "makeopts";
my %ConfigureOpts = (); #
# configuration file to read for some directives:
my $ConfFile = "build_tools/conf";
my $DumpFile = 'build_tools/dump_deps';
# Modules removed randomely:
my $RandomeModsFile = "build_tools/mods_removed_random";
my $MakedepsFile = "menuselect.makedeps";
my $MakeoptsFile = "menuselect.makeopts";
# If those modules are not present, the build will fail (PCRE patterns)
my @RequiredModules = ();
my @Subdirs = qw/addons apps bridges cdr cel channels codecs formats funcs main pbx res tests utils/;
my @XmlCategories = 'cflags';
# Modules should not bother building (PCRE patterns)
my @ExcludedModules = ();
# Do try building those. Overrides 'exclude' and 'defaultenable: no'
my @IncludedModules = ();
# A chance to rule-out a module randomely.
my $RandomKnockoutFactor = 0;
sub warning($) {
my $msg = shift;
print STDERR "$0: Warning: $msg\n";
}
# Convert XML syntax to mail-header-like syntax:
# <var>value</var> --> Var: value
sub extract_xml_key($) {
my %attr = ();
my $xml_line = shift;
if ($xml_line !~ m{^\s*<([a-z_A-Z0-9]+)(\s+([^>]*))?>([^<]*)</\1>}) {
warning "parsed empty value from XML line $xml_line";
return ('', ''); # warn?
}
my ($var, $val) = ($1, $4);
$var =~ s{^[a-z]}{\u$&};
if (defined $3) {
my $attr_text = $3;
while ($attr_text =~ /^( *([^=]+)="([^"]+)")/) {
my ($var, $val) = ($2, $3);
$attr_text =~ s/^$1//;
$attr{$var} = $val;
}
}
return ($var, $val, %attr);
}
# Get information embedded in source files from a subdirectory.
# First parameter is the subdirectory and further ones are the actual
# source files.
sub get_subdir_module_info {
my $subdir = shift;
my @files = @_;
my $dir = uc($subdir);
foreach my $src (@files) {
open SRC,$src or die "Can't read from source file $src: $!\n";
$src =~ m|.*/([^/]*)\.c|;
my $mod_name = $1;
my %data = (
Type=>'module',
Module=>$mod_name,
Dir=> $dir,
Avail=>1
);
while (<SRC>) {
next unless (m|^/\*\*\* MODULEINFO| .. m|^ *[*]+/|);
next unless (m|^[A-Z]| || m|^\s*<|);
# At this point we can assume we're in the module
# info section.
chomp;
my ($var, $val, %attr) = extract_xml_key($_);
foreach (keys %attr) {
push @{$data{$_}},($attr{$_});
}
if ($var =~ /^(Depend|Use)$/i) {
# use uppercase for dependency names;
$val = uc($val);
}
if ( ! exists $data{$var} ) {
$data{$var} = [$val];
} else {
push @{$data{$var}},($val);
}
}
close SRC;
$ModInfo{uc($mod_name)} = \%data;
}
}
# extract embedded information in all the source tree.
sub extract_subdirs {
for my $subdir(@_) {
get_subdir_module_info($subdir, <$subdir/*.c> , <$subdir/*.cc>);
}
}
# parse a partial XML document that is included as an input
# for menuselect in a few places. Naturally a full-fledged XML parsing
# will not be done here. A line-based parsing that happens to work will
# have to do.
sub parse_menuselect_xml_file($) {
my $file_name = shift;
open XML,$file_name or
die "Failed opening XML file $file_name: $!.\n";
my $header = <XML>;
$header =~ /^\s*<category\s+name="MENUSELECT_([^"]+)"\s/;
my $category = $1;
my $member;
while(<XML>){
next unless (m{^\s*<(/?[a-z]+)[>\s]});
my $tag = $1;
if ($tag eq 'member') {
if (! m{^\s*<member\s+name="([^"]+)" displayname="([^"]+)"\s*>}){
warning "Bad XML member line: $_ ($file_name:$.)\n";
next;
}
my ($name, $display_name) = ($1, $2);
$member = {
Type => 'XML',
Dir => $category,
Module => $1,
DisplayName => $2,
Defaultenabled => ['no'],
Avail => 1,
};
} elsif ($tag eq '/member') {
$ModInfo{$member->{Module}} = $member;
} elsif ($tag eq '/category') {
last;
} else {
if (! m/^\s*<([a-z]+)>([^<]+)</) {
warning "(1) Unknown XML line $_ ($file_name:$.)\n";
next
}
my ($key, $val) = extract_xml_key($_);
if ($key eq '') {
warning "Unknown XML line $_ ($file_name:$.)\n";
next
}
if (! exists $member->{$key}) {
$member->{$key} = [];
}
# Make sure dependencies are upper-case.
# FIXME: this is not the proper place for such a fix
$val = uc($val) if ($key =~ /Depend|Use/);
# Using "unshift' rather than 'push'.
# For a singleton value this makes the action an
# override, as only the first value counts.
# For a list value, however, it means a reversed
# order.
unshift @{$member->{$key}}, ($val);
}
}
close XML;
}
# Dump our data structure to a file.
sub dump_deps($) {
my $file = shift;
open OUTPUT,">$file" or
die "cannot open category file $file for writing: $!\n";
foreach my $mod_name (sort keys %ModInfo) {
print OUTPUT "Key: $mod_name\n";
my $data = $ModInfo{$mod_name};
foreach my $var (sort keys %{$data} ) {
my $val = $$data{$var};
if (ref($val) eq 'ARRAY') {
print OUTPUT $var.": ". (join ", ", @$val)."\n";
} else {
print OUTPUT "$var: $val\n";
}
}
print OUTPUT "\n";
}
close OUTPUT;
}
# Get the available libraries that autoconf generated.
sub get_autoconf_deps() {
open DEPS, $AutoconfDepsFile or
die "Failed to open $AutoconfDepsFile. Aborting: $!\n";
my @deps_list = (<DEPS>);
foreach (@deps_list){
chomp;
my ($lib, $avail_val) = split(/=/);
my ($avail, $avail_old) = split(/:/, $avail_val);
my $disabled = 0;
if ($avail == -1) {
$disabled = 1;
$avail = 0;
}
$ModInfo{$lib} = {
Type=>'lib', Avail=>$avail, Disabled => $disabled
};
if (defined $avail_old) {
$ModInfo{$lib}{AvailOld} = $avail_old;
}
# FIXME:
if (($avail ne "0") && ($avail ne "1")) {
warning "Library $lib has invalid availability ".
"value <$avail> (check $AutoconfDepsFile).\n";
}
}
close DEPS;
}
# Get the available libraries that autoconf generated.
sub get_autoconf_opts() {
open OPTS, $AutoconfOptsFile or
die "Failed to open $AutoconfOptsFile. Aborting: $!\n";
while (<OPTS>) {
chomp;
next if /^(#|$)/;
my ($var, $val) = split /\s*=\s*/, $_, 2;
$ConfigureOpts{$var} = $val;
}
close OPTS;
if (not exists $ConfigureOpts{AST_DEVMODE}) {
$ConfigureOpts{AST_DEVMODE} = 'no';
}
}
# Read our specific config file.
#
# Its format:
#
# keyword values
#
# values are always a spaces-separated list.
sub read_conf() {
open CONF,$ConfFile or return;
while (<CONF>) {
# remove comments and empty lines:
chomp;
s/#.*$//;
next if /^\s*$/;
my ($keyword, @value) = split;
if ($keyword eq 'exclude') {
push @ExcludedModules, @value;
} elsif ($keyword eq 'include') {
push @IncludedModules, @value;
} elsif ($keyword eq 'require') {
push @RequiredModules, @value;
} elsif ($keyword eq 'random') {
$RandomKnockoutFactor = $value[0] / 100;
} else {
warning "unknown keyword $keyword in line $. of $ConfFile.";
}
}
}
# generate menuselect.makedeps.
# In this file menuselect writes dependecies of each module. CFLAGS will
# then automatically include for each module the _INCLUDE and LDFLAGS
# will include the _LIBS from all the depedencies of the module.
sub gen_makedeps() {
open MAKEDEPSS, ">$MakedepsFile" or
die "Failed to open deps file $MakedepsFile for writing. Aborting: $!\n";
for my $mod_name (sort keys %ModInfo) {
next unless ($ModInfo{$mod_name}{Type} eq 'module');
my $mod = $ModInfo{$mod_name};
my @deps = ();
# if we have Depend or Use, put their values into
# @deps . If we have none, move on.
push @deps, @{$mod->{Depend}} if (exists $mod->{Depend});
push @deps, @{$mod->{Use}} if (exists $mod->{Use});
next unless @deps;
# TODO: don't print dependencies that are not external libs.
# Not done yet until I figure out if this is safe.
my $dep = join(' ', @deps);
print MAKEDEPSS "MENUSELECT_DEPENDS_".$mod->{Module}."=$dep\n";
}
close MAKEDEPSS;
}
# Set modules from patterns specified by 'exclude' in the configuration file
# to exclude modules from building (mark them as unavailable).
sub apply_excluded_patterns() {
foreach my $pattern (@ExcludedModules) {
my @excluded = grep {/^$pattern$/i} (keys %ModInfo);
foreach (@excluded) {
$ModInfo{$_}{Avail} = 0;
}
}
}
# Set modules from patterns specified by 'include' in the configuration
# file to exclude from building (mark them as available).
sub apply_included_patterns() {
foreach my $pattern (@IncludedModules) {
my @included = grep {/^$pattern$/i} (keys %ModInfo);
foreach (@included) {
$ModInfo{$_}{Avail} = 1;
}
}
}
# If user set the "random" config to anything > 0, drop some random
# modules. May help expose wrong dependencies.
sub apply_random_drop() {
return if ($RandomKnockoutFactor <= 0);
open MODS_LIST, ">$RandomeModsFile" or
die "Failed to open modules list file $RandomeModsFile for writing. Aborting: $!\n";
for my $mod (keys %ModInfo) {
next unless ($ModInfo{$mod}{Type} eq 'module');
next unless (rand() < $RandomKnockoutFactor);
$ModInfo{$mod}{Avail} = 0;
$ModInfo{$mod}{RandomKill} = 1;
print MODS_LIST $ModInfo{$mod}{Module}."\n";
}
close MODS_LIST;
}
sub check_required_patterns() {
my @failed = ();
foreach my $pattern (@RequiredModules) {
my @required = grep {/^$pattern$/i} (keys %ModInfo);
foreach my $mod (@required) {
if ((! exists $ModInfo{$mod}{Checked}) ||
(! $ModInfo{$mod}{Checked}) )
{
push @failed, $mod;
}
}
}
return unless (@failed);
my $failed_str = join ' ',@failed;
die("Missing dependencies for the following modules: $failed_str\n");
}
# Disable building for modules that were marked in the embedded module
# information as disabled for building by default.
sub apply_default_enabled() {
foreach my $mod (keys %ModInfo) {
if ((exists $ModInfo{$mod}{Defaultenabled}) &&
$ModInfo{$mod}{Defaultenabled}[0] eq 'no')
{
$ModInfo{$mod}{Avail} = 0;
}
}
}
# We found a dependency we don't know about. Warn the user, and add
# information about it:
sub handle_unknown_dep($$) {
my ($dep_mod, $mod) = @_;
my $mod_info = {
Type => 'Unknown',
Avail => 0,
Checked => 0,
};
$ModInfo{$dep_mod} = $mod_info;
warning "Unknown dependency module $dep_mod (for e.g. $mod)\n";
}
# recursively check dependency for a module.
#
# We run a scan for modules. Modules marked as 'Checked' are ones we
# have already fully verified to have proper dependencies.
#
# We can only use a module or library marked as Avail => 1 (library
# available or module not excluded).
sub check_module($);
sub check_module($) {
my $mod = shift;
# we checked it:
if (exists $ModInfo{$mod}{Checked}) {
return $ModInfo{$mod}{Checked};
}
# A library has no dependencies of its own.
if ($ModInfo{$mod}{Type} eq 'lib') {
return ($ModInfo{$mod}{Avail} || 0);
}
# An excluded module.
if ($ModInfo{$mod}{Avail} == 0) {
return 0;
}
if (! exists $ModInfo{$mod}{Depend}) {
$ModInfo{$mod}{Checked} = 1;
return 1;
}
my $deps_checked = 1; # may be reset below on failures:
if (exists $ModInfo{$mod}{Tested}) {
# this probably means a circular dependency of some sort.
warning "Got to module $mod that is already tested.";
}
$ModInfo{$mod}{Tested} = 1;
foreach my $dep_mod (@{$ModInfo{$mod}{Depend}} ) {
if (!exists ${ModInfo}{$dep_mod}) {
handle_unknown_dep($dep_mod, $mod);
return 0;
}
$deps_checked &= check_module($dep_mod);
last if(!$deps_checked) # no point testing further if we failed.
}
$ModInfo{$mod}{Checked} = $deps_checked;
return $deps_checked;
}
# The main dependency resolver function.
sub resolve_deps() {
apply_default_enabled();
apply_excluded_patterns();
apply_included_patterns();
foreach my $mod (keys %ModInfo) {
check_module($mod);
}
}
# generate menuselect.makeopts.
# The values in this file obey to different semantics:
# 1. For modules, a module will be built unles listed here
# 2. For XML values (sounds, CFLAGS) it will be enabled if listed here
sub gen_makeopts() {
open MAKEDEPS, ">$MakeoptsFile" or
die "Failed to open opts file $MakeoptsFile for writing. Aborting: $!\n";
my %Subdirs;
foreach my $mod (sort keys %ModInfo) {
next unless ($ModInfo{$mod}{Type} =~ /^(module|XML)$/);
if ($ModInfo{$mod}{Type} eq 'XML') {
next unless ($ModInfo{$mod}{Checked});
} else {
next if ($ModInfo{$mod}{Checked});
}
my $dir = $ModInfo{$mod}{Dir};
if (! exists $Subdirs{$dir}) {
$Subdirs{$dir} = [];
}
push @{$Subdirs{$dir}},( $ModInfo{$mod}{Module} );
}
foreach my $dir (sort keys %Subdirs) {
my $deps = join(' ', @{$Subdirs{$dir}});
print MAKEDEPS "MENUSELECT_$dir=$deps\n";
}
close MAKEDEPS;
}
# Main function for --check-deps
sub check_dependencies() {
read_conf();
extract_subdirs(@Subdirs);
get_autoconf_opts();
parse_menuselect_xml_file('build_tools/cflags.xml');
if ($ConfigureOpts{AST_DEVMODE} eq 'yes') {
parse_menuselect_xml_file('build_tools/cflags-devmode.xml');
}
parse_menuselect_xml_file('sounds/sounds.xml');
apply_random_drop();
get_autoconf_deps();
#dump_deps('build_tools/dump_deps_before_resolve');
resolve_deps();
# Handy debugging:
dump_deps($DumpFile);
check_required_patterns();
gen_makedeps();
gen_makeopts();
}
#
# The main program start here
#
sub read_dump() {
my %items = ();
my $saved_rs = $/;
$/ = "\n\n";
open DUMP_FILE,$DumpFile or die "Can't read from dump file $DumpFile\n";
while (<DUMP_FILE>) {
my %item = ();
my @item_lines = split /\n\r?/;
foreach (@item_lines) {
my ($var, $value) = split /: /, $_, 2;
$item{$var} = $value;
}
# FIXME: dependencies are a list. This should not be a
# special case.
if (exists $item{Depend}) {
$item{Depend} = [split /\s*,\s*/,$item{Depend}];
}
$items{$item{Key}} = \%item;
}
close DUMP_FILE;
$/ = $saved_rs;
return \%items;
}
# Explain why a module (read from the dump file) was not enabled.
# (We assume here that $item->{Avail} is 0)
sub fail_reason($) {
my $item = shift;
if ($item->{Type} eq 'lib') {
return " Not found: system library";
} elsif ($item->{Type} eq 'XML') {
if ($item->{Defaultenabled} !~ /^y/) {
return "Not enabled";
} else {
return "Missing dependencies";
}
} elsif ($item->{Type} eq 'module') {
if (exists ($item->{Defaultenabled}) &&
$item->{Defaultenabled} =~ /^n/) {
return "Disabled";
} else {
return "Missing dependencies";
}
}
}
sub item_used($) {
my $item = shift;
my $type = $item->{Type};
return $item->{Avail} if ($type eq 'lib');
return $item->{Checked};
}
sub print_module_status {
my $flag_verbose = shift;
my $items = read_dump();
my %items_matched = ();
foreach my $pattern (@_) {
foreach (keys %$items) {
if (/$pattern/i) {
$items_matched{$_} = 1;
}
}
}
my @items_list = sort keys %items_matched;
foreach my $item_name (@items_list) {
my $item = $items->{$item_name};
if ($flag_verbose) {
printf "%s %-8s %-30s\n",
(item_used($item)? 'Y':'n'),
$item->{Type},
$item->{Key};
if (!$item->{Avail}) {
my $reason = fail_reason($item);
print " $reason\n";
}
foreach (@{$item->{Depend}}) {
my $depmod = $items->{$_};
printf(" * %-12s ",$_);
print (item_used($depmod)? '': "un");
print "available\n";
}
} else {
printf "%s %-8s %-30s",
(item_used($item)? 'Y':'n'),
$item->{Type},
$item->{Key};
foreach (@{$item->{Depend}}) {
my $depmod = $items->{$_};
if (item_used($depmod)) {
print "$_ ";
} else {
printf "[%s] ", $_;
}
}
print "\n";
}
}
}
sub usage() {
print "$0: menuselect reimplementation\n";
print "\n";
print "Usage:\n";
print "$0 # menuselect processing\n";
print "$0 -m|--modinfo|--moduls-info PATTERN # Status of modules\n";
print "$0 -v|--verbose # verbose (modinfo)\n";
print "$0 -c|--check-deps # Check for dependencies\n";
print "\n";
print "PATTERN is a partial perl regex. Use '-m .' to list all.\n";
}
my @module_status = ();
my $flag_verbose = 0;
my $action = '';
my $rc = GetOptions(
'modinfo|modules-info|m=s' => \@module_status,
'verbose|v' => \$flag_verbose,
'check-deps|c:s' => sub { $action = 'check_dependencies'},
'help|h' => sub { usage(); exit 0 },
);
if (!$rc) {
usage();
exit $rc;
}
if (@module_status) {
$action = 'module_status';
}
if ($action eq 'module_status') {
print_module_status($flag_verbose, @module_status);
exit 0;
} elsif ( $action eq 'check_dependencies') {
check_dependencies();
} else {
usage(); exit(1);
}

487
menuselect/example_menuselect-tree

@ -1,487 +0,0 @@
<?xml version=1.0?>
<menu name="Asterisk Module Selection">
<category name="MENUSELECT_APPS" displayname="Applications">
<member name="app_adsiprog" displayname="Asterisk ADSI Programming Application" remove_on_change="apps/app_adsiprog.o apps/app_adsiprog.so">
</member>
<member name="app_alarmreceiver" displayname="Alarm Receiver for Asterisk" remove_on_change="apps/app_alarmreceiver.o apps/app_alarmreceiver.so">
</member>
<member name="app_amd" displayname="Answering Machine Detection Application" remove_on_change="apps/app_amd.o apps/app_amd.so">
</member>
<member name="app_authenticate" displayname="Authentication Application" remove_on_change="apps/app_authenticate.o apps/app_authenticate.so">
</member>
<member name="app_cdr" displayname="Tell Asterisk to not maintain a CDR for the current call" remove_on_change="apps/app_cdr.o apps/app_cdr.so">
</member>
<member name="app_chanisavail" displayname="Check channel availability" remove_on_change="apps/app_chanisavail.o apps/app_chanisavail.so">
</member>
<member name="app_channelredirect" displayname="Channel Redirect" remove_on_change="apps/app_channelredirect.o apps/app_channelredirect.so">
</member>
<member name="app_chanspy" displayname="Listen to the audio of an active channel" remove_on_change="apps/app_chanspy.o apps/app_chanspy.so">
</member>
<member name="app_controlplayback" displayname="Control Playback Application" remove_on_change="apps/app_controlplayback.o apps/app_controlplayback.so">
</member>
<member name="app_db" displayname="Database Access Functions" remove_on_change="apps/app_db.o apps/app_db.so">
</member>
<member name="app_dial" displayname="Dialing Application" remove_on_change="apps/app_dial.o apps/app_dial.so">
</member>
<member name="app_dictate" displayname="Virtual Dictation Machine" remove_on_change="apps/app_dictate.o apps/app_dictate.so">
</member>
<member name="app_directed_pickup" displayname="Directed Call Pickup Application" remove_on_change="apps/app_directed_pickup.o apps/app_directed_pickup.so">
</member>
<member name="app_directory" displayname="Extension Directory" remove_on_change="apps/app_directory.o apps/app_directory.so">
</member>
<member name="app_disa" displayname="DISA (Direct Inward System Access) Application" remove_on_change="apps/app_disa.o apps/app_disa.so">
</member>
<member name="app_dumpchan" displayname="Dump Info About The Calling Channel" remove_on_change="apps/app_dumpchan.o apps/app_dumpchan.so">
</member>
<member name="app_echo" displayname="Simple Echo Application" remove_on_change="apps/app_echo.o apps/app_echo.so">
</member>
<member name="app_exec" displayname="Executes dialplan applications" remove_on_change="apps/app_exec.o apps/app_exec.so">
</member>
<member name="app_externalivr" displayname="External IVR Interface Application" remove_on_change="apps/app_externalivr.o apps/app_externalivr.so">
</member>
<member name="app_festival" displayname="Simple Festival Interface" remove_on_change="apps/app_festival.o apps/app_festival.so">
</member>
<member name="app_flash" displayname="Flash zap trunk application" remove_on_change="apps/app_flash.o apps/app_flash.so">
<depend>zaptel</depend>
</member>
<member name="app_followme" displayname="Find-Me/Follow-Me Application" remove_on_change="apps/app_followme.o apps/app_followme.so">
</member>
<member name="app_forkcdr" displayname="Fork The CDR into 2 separate entities." remove_on_change="apps/app_forkcdr.o apps/app_forkcdr.so">
</member>
<member name="app_getcpeid" displayname="Get ADSI CPE ID" remove_on_change="apps/app_getcpeid.o apps/app_getcpeid.so">
</member>
<member name="app_hasnewvoicemail" displayname="Indicator for whether a voice mailbox has messages in a given folder." remove_on_change="apps/app_hasnewvoicemail.o apps/app_hasnewvoicemail.so">
</member>
<member name="app_ices" displayname="Encode and Stream via icecast and ices" remove_on_change="apps/app_ices.o apps/app_ices.so">
</member>
<member name="app_image" displayname="Image Transmission Application" remove_on_change="apps/app_image.o apps/app_image.so">
</member>
<member name="app_ivrdemo" displayname="IVR Demo Application" remove_on_change="apps/app_ivrdemo.o apps/app_ivrdemo.so">
<defaultenabled>no</defaultenabled>
</member>
<member name="app_lookupblacklist" displayname="Look up Caller*ID name/number from blacklist database" remove_on_change="apps/app_lookupblacklist.o apps/app_lookupblacklist.so">
</member>
<member name="app_lookupcidname" displayname="Look up CallerID Name from local database" remove_on_change="apps/app_lookupcidname.o apps/app_lookupcidname.so">
</member>
<member name="app_macro" displayname="Extension Macros" remove_on_change="apps/app_macro.o apps/app_macro.so">
</member>
<member name="app_meetme" displayname="MeetMe conference bridge" remove_on_change="apps/app_meetme.o apps/app_meetme.so">
<depend>zaptel</depend>
</member>
<member name="app_milliwatt" displayname="Digital Milliwatt (mu-law) Test Application" remove_on_change="apps/app_milliwatt.o apps/app_milliwatt.so">
</member>
<member name="app_mixmonitor" displayname="Mixed Audio Monitoring Application" remove_on_change="apps/app_mixmonitor.o apps/app_mixmonitor.so">
</member>
<member name="app_morsecode" displayname="Morse code" remove_on_change="apps/app_morsecode.o apps/app_morsecode.so">
</member>
<member name="app_mp3" displayname="Silly MP3 Application" remove_on_change="apps/app_mp3.o apps/app_mp3.so">
</member>
<member name="app_nbscat" displayname="Silly NBS Stream Application" remove_on_change="apps/app_nbscat.o apps/app_nbscat.so">
</member>
<member name="app_osplookup" displayname="Open Settlement Protocol Applications" remove_on_change="apps/app_osplookup.o apps/app_osplookup.so">
<depend>libosptk</depend>
<depend>ssl</depend>
</member>
<member name="app_page" displayname="Page Multiple Phones" remove_on_change="apps/app_page.o apps/app_page.so">
<depend>zaptel</depend>
</member>
<member name="app_parkandannounce" displayname="Call Parking and Announce Application" remove_on_change="apps/app_parkandannounce.o apps/app_parkandannounce.so">
</member>
<member name="app_playback" displayname="Sound File Playback Application" remove_on_change="apps/app_playback.o apps/app_playback.so">
</member>
<member name="app_privacy" displayname="Require phone number to be entered, if no CallerID sent" remove_on_change="apps/app_privacy.o apps/app_privacy.so">
</member>
<member name="app_queue" displayname="True Call Queueing" remove_on_change="apps/app_queue.o apps/app_queue.so">
</member>
<member name="app_random" displayname="Random goto" remove_on_change="apps/app_random.o apps/app_random.so">
</member>
<member name="app_read" displayname="Read Variable Application" remove_on_change="apps/app_read.o apps/app_read.so">
</member>
<member name="app_readfile" displayname="Stores output of file into a variable" remove_on_change="apps/app_readfile.o apps/app_readfile.so">
</member>
<member name="app_realtime" displayname="Realtime Data Lookup/Rewrite" remove_on_change="apps/app_realtime.o apps/app_realtime.so">
</member>
<member name="app_record" displayname="Trivial Record Application" remove_on_change="apps/app_record.o apps/app_record.so">
</member>
<member name="app_rpt" displayname="Radio Repeater / Remote Base version 0.48 06/13/2006" remove_on_change="apps/app_rpt.o apps/app_rpt.so">
<depend>zaptel</depend>
<defaultenabled>no</defaultenabled>
</member>
<member name="app_sayunixtime" displayname="Say time" remove_on_change="apps/app_sayunixtime.o apps/app_sayunixtime.so">
</member>
<member name="app_senddtmf" displayname="Send DTMF digits Application" remove_on_change="apps/app_senddtmf.o apps/app_senddtmf.so">
</member>
<member name="app_sendtext" displayname="Send Text Applications" remove_on_change="apps/app_sendtext.o apps/app_sendtext.so">
</member>
<member name="app_setcallerid" displayname="Set CallerID Application" remove_on_change="apps/app_setcallerid.o apps/app_setcallerid.so">
</member>
<member name="app_setcdruserfield" displayname="CDR user field apps" remove_on_change="apps/app_setcdruserfield.o apps/app_setcdruserfield.so">
</member>
<member name="app_settransfercapability" displayname="Set ISDN Transfer Capability" remove_on_change="apps/app_settransfercapability.o apps/app_settransfercapability.so">
</member>
<member name="app_skel" displayname="Trivial skeleton Application" remove_on_change="apps/app_skel.o apps/app_skel.so">
<defaultenabled>no</defaultenabled>
</member>
<member name="app_sms" displayname="SMS/PSTN handler" remove_on_change="apps/app_sms.o apps/app_sms.so">
</member>
<member name="app_softhangup" displayname="Hangs up the requested channel" remove_on_change="apps/app_softhangup.o apps/app_softhangup.so">
</member>
<member name="app_speech_utils" displayname="Dialplan Speech Applications" remove_on_change="apps/app_speech_utils.o apps/app_speech_utils.so">
</member>
<member name="app_stack" displayname="Stack Routines" remove_on_change="apps/app_stack.o apps/app_stack.so">
</member>
<member name="app_system" displayname="Generic System() application" remove_on_change="apps/app_system.o apps/app_system.so">
</member>
<member name="app_talkdetect" displayname="Playback with Talk Detection" remove_on_change="apps/app_talkdetect.o apps/app_talkdetect.so">
</member>
<member name="app_test" displayname="Interface Test Application" remove_on_change="apps/app_test.o apps/app_test.so">
</member>
<member name="app_transfer" displayname="Transfer" remove_on_change="apps/app_transfer.o apps/app_transfer.so">
</member>
<member name="app_url" displayname="Send URL Applications" remove_on_change="apps/app_url.o apps/app_url.so">
</member>
<member name="app_userevent" displayname="Custom User Event Application" remove_on_change="apps/app_userevent.o apps/app_userevent.so">
</member>
<member name="app_verbose" displayname="Send verbose output" remove_on_change="apps/app_verbose.o apps/app_verbose.so">
</member>
<member name="app_voicemail" displayname="Comedian Mail (Voicemail System)" remove_on_change="apps/app_voicemail.o apps/app_voicemail.so">
</member>
<member name="app_waitforring" displayname="Waits until first ring after time" remove_on_change="apps/app_waitforring.o apps/app_waitforring.so">
</member>
<member name="app_waitforsilence" displayname="Wait For Silence" remove_on_change="apps/app_waitforsilence.o apps/app_waitforsilence.so">
</member>
<member name="app_while" displayname="While Loops and Conditional Execution" remove_on_change="apps/app_while.o apps/app_while.so">
</member>
<member name="app_zapateller" displayname="Block Telemarketers with Special Information Tone" remove_on_change="apps/app_zapateller.o apps/app_zapateller.so">
</member>
<member name="app_zapbarge" displayname="Barge in on Zap channel application" remove_on_change="apps/app_zapbarge.o apps/app_zapbarge.so">
<depend>zaptel</depend>
</member>
<member name="app_zapras" displayname="Zap RAS Application" remove_on_change="apps/app_zapras.o apps/app_zapras.so">
<depend>zaptel</depend>
</member>
<member name="app_zapscan" displayname="Scan Zap channels application" remove_on_change="apps/app_zapscan.o apps/app_zapscan.so">
<depend>zaptel</depend>
</member>
</category>
<category name="MENUSELECT_CDR" displayname="Call Detail Recording">
<member name="cdr_csv" displayname="Comma Separated Values CDR Backend" remove_on_change="cdr/cdr_csv.o cdr/cdr_csv.so">
</member>
<member name="cdr_custom" displayname="Customizable Comma Separated Values CDR Backend" remove_on_change="cdr/cdr_custom.o cdr/cdr_custom.so">
</member>
<member name="cdr_manager" displayname="Asterisk Call Manager CDR Backend" remove_on_change="cdr/cdr_manager.o cdr/cdr_manager.so">
</member>
<member name="cdr_odbc" displayname="ODBC CDR Backend" remove_on_change="cdr/cdr_odbc.o cdr/cdr_odbc.so">
<depend>unixodbc</depend>
</member>
<member name="cdr_pgsql" displayname="PostgreSQL CDR Backend" remove_on_change="cdr/cdr_pgsql.o cdr/cdr_pgsql.so">
<depend>pgsql</depend>
</member>
<member name="cdr_radius" displayname="RADIUS CDR Backend" remove_on_change="cdr/cdr_radius.o cdr/cdr_radius.so">
<depend>radiusclient</depend>
</member>
<member name="cdr_sqlite" displayname="SQLite CDR Backend" remove_on_change="cdr/cdr_sqlite.o cdr/cdr_sqlite.so">
<depend>sqlite</depend>
</member>
<member name="cdr_tds" displayname="MSSQL CDR Backend" remove_on_change="cdr/cdr_tds.o cdr/cdr_tds.so">
<depend>freetds</depend>
</member>
</category>
<category name="MENUSELECT_CHANNELS" displayname="Channel Drivers">
<member name="chan_agent" displayname="Agent Proxy Channel" remove_on_change="channels/chan_agent.o channels/chan_agent.so">
</member>
<member name="chan_alsa" displayname="ALSA Console Channel Driver" remove_on_change="channels/chan_alsa.o channels/chan_alsa.so">
<depend>asound</depend>
</member>
<member name="chan_features" displayname="Feature Proxy Channel" remove_on_change="channels/chan_features.o channels/chan_features.so">
</member>