提交 5b778435 authored 作者: Anthony Minessale's avatar Anthony Minessale

slim down iax build

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8321 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 752b0ff8
...@@ -593,7 +593,6 @@ AC_CONFIG_SUBDIRS(libs/apr-util) ...@@ -593,7 +593,6 @@ AC_CONFIG_SUBDIRS(libs/apr-util)
AC_CONFIG_SUBDIRS(libs/voipcodecs) AC_CONFIG_SUBDIRS(libs/voipcodecs)
AC_CONFIG_SUBDIRS(libs/codec/ilbc) AC_CONFIG_SUBDIRS(libs/codec/ilbc)
AC_CONFIG_SUBDIRS(libs/curl) AC_CONFIG_SUBDIRS(libs/curl)
AC_CONFIG_SUBDIRS(libs/iax)
AC_CONFIG_SUBDIRS(libs/iksemel) AC_CONFIG_SUBDIRS(libs/iksemel)
AC_CONFIG_SUBDIRS(libs/js/nsprpub) AC_CONFIG_SUBDIRS(libs/js/nsprpub)
AC_CONFIG_SUBDIRS(libs/js) AC_CONFIG_SUBDIRS(libs/js)
......
Sat Mar 10 12:59:56 EST 2007
\ No newline at end of file
差异被折叠。
差异被折叠。
libiax
======
version 0.2.3:
* Allow password to be passed in connect
version 0.2.2 (Nov 13th, 2001):
* HTML Unlink requests
* HTML Reject link requests
* Text frames
version 0.2.1 (Oct 20th, 2001):
* More space for challenge in IAX
* Fixed strncpy security bug
* Accept larger packets
* Handle out of order packets better
* Implemented send_url
* Added an iax-config script :-)
version 0.2.0 (Oct 10th, 2001):
* Initial Public Release
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PREFIX', the package will
use PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
SUBDIRS = src
bin_SCRIPTS=iax-config
BUILT_SCOURCES=iax-config
EXTRA_DIST=iax.spec libiax2.vcproj
iax-config: iax-config.in
libiax
======
0.2.3:
0.2.2:
0.2.1:
0.2.0 (Oct 10th, 2001):
Initial Release. Hooray! Rejoice! :)
libiax: An implementation of the Inter-Asterisk eXchange protocol distributed
under the terms of the GNU Lesser General Public License
Written by Mark Spencer <markster@linux-support.net>
m4_include([build/config/ax_compiler_vendor.m4])
m4_include([build/config/ax_cflags_warn_all_ansi.m4])
m4_include([build/config/ax_cc_maxopt.m4])
m4_include([build/config/ax_check_compiler_flags.m4])
m4_include([build/config/ac_gcc_archflag.m4])
m4_include([build/config/ac_gcc_x86_cpuid.m4])
echo If this fails you probably need to download the latest
echo libtool,aclocal,autoconf and automake
libtoolize --copy --force
aclocal --force
autoconf -f
automake -acf
echo configuring automake
./bootstrap.sh
echo configuring libiax2
./configure --enable-newjb
echo building libiax2
make
echo
echo
echo '##################################################################'
echo '# #'
echo '# If all is well, enter "make install" to complete installation. #'
echo '# #'
echo '##################################################################'
AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl -------------------------------------------------------------------------
AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
[AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])])
AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
[AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])])
AC_DEFUN([AX_CFLAGS_SUN_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_sun_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for sun/cc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($2,$2,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_SUN_OPTION_OLD], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_sun_option_$2])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for sun/cc m4_ifval($2,$2,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($2,$2,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl -----------------------------------------------------------------------
AC_DEFUN([AX_CFLAGS_SUN_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_sun_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for sun/cc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($1,$1,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_SUN_OPTION_NEW], [dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_sun_option_$1])dnl
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for sun/cc m4_ifval($1,$1,-option)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "+xstrconst % -xc99=all m4_ifval($1,$1,-option)" dnl Solaris C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
AC_DEFUN([AX_CFLAGS_SUN_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
[AX_CFLAGS_SUN_OPTION_NEW($@)],[AX_CFLAGS_SUN_OPTION_OLD($@)])])
AC_DEFUN([AX_CXXFLAGS_SUN_OPTION],[ifelse(m4_regexp([$2],[-]),-1,
[AX_CXXFLAGS_SUN_OPTION_NEW($@)],[AX_CXXFLAGS_SUN_OPTION_OLD($@)])])
AC_DEFUN([AX_GCC_ARCHFLAG],
[AC_REQUIRE([AC_PROG_CC])
AC_ARG_WITH(gcc-arch, [AC_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])],
ax_gcc_arch=$withval, ax_gcc_arch=yes)
AC_MSG_CHECKING([for gcc architecture flag])
AC_MSG_RESULT([])
AC_CACHE_VAL(ax_cv_gcc_archflag,
[
ax_cv_gcc_archflag="unknown"
if test "$GCC" = yes; then
if test "x$ax_gcc_arch" = xyes; then
ax_gcc_arch=""
if test "$cross_compiling" = no; then
case $host_cpu in
i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones
AX_GCC_X86_CPUID(0)
AX_GCC_X86_CPUID(1)
case $ax_cv_gcc_x86_cpuid_0 in
*:756e6547:*:*) # Intel
case $ax_cv_gcc_x86_cpuid_1 in
*5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
*5??:*:*:*) ax_gcc_arch=pentium ;;
*6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
*6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
*6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
*6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
*6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
*6??:*:*:*) ax_gcc_arch=pentiumpro ;;
*f3[[347]]:*:*:*|*f4[1347]:*:*:*)
case $host_cpu in
x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
*) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
esac ;;
*f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
esac ;;
*:68747541:*:*) # AMD
case $ax_cv_gcc_x86_cpuid_1 in
*5[[67]]?:*:*:*) ax_gcc_arch=k6 ;;
*5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
*5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
*60?:*:*:*) ax_gcc_arch=k7 ;;
*6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;;
*6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
*67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
*6[[68a]]?:*:*:*)
AX_GCC_X86_CPUID(0x80000006) # L2 cache size
case $ax_cv_gcc_x86_cpuid_0x80000006 in
*:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256
ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
*) ax_gcc_arch="athlon-4 athlon k7" ;;
esac ;;
*f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
*f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
*f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
*f??:*:*:*) ax_gcc_arch="k8" ;;
esac ;;
*:746e6543:*:*) # IDT
case $ax_cv_gcc_x86_cpuid_1 in
*54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
*58?:*:*:*) ax_gcc_arch=winchip2 ;;
*6[[78]]?:*:*:*) ax_gcc_arch=c3 ;;
*69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
esac ;;
esac
if test x"$ax_gcc_arch" = x; then # fallback
case $host_cpu in
i586*) ax_gcc_arch=pentium ;;
i686*) ax_gcc_arch=pentiumpro ;;
esac
fi
;;
sparc*)
AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
case $cputype in
*ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
*ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
*ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
*supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;;
*hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;;
*cypress*) ax_gcc_arch=cypress ;;
esac ;;
alphaev5) ax_gcc_arch=ev5 ;;
alphaev56) ax_gcc_arch=ev56 ;;
alphapca56) ax_gcc_arch="pca56 ev56" ;;
alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
alphaev6) ax_gcc_arch=ev6 ;;
alphaev67) ax_gcc_arch=ev67 ;;
alphaev68) ax_gcc_arch="ev68 ev67" ;;
alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
powerpc*)
cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
case $cputype in
*750*) ax_gcc_arch="750 G3" ;;
*740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;;
*74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;;
*74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;;
*970*) ax_gcc_arch="970 G5 power4";;
*POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
*POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
603ev|8240) ax_gcc_arch="$cputype 603e 603";;
*) ax_gcc_arch=$cputype ;;
esac
ax_gcc_arch="$ax_gcc_arch powerpc"
;;
esac
fi # not cross-compiling
fi # guess arch
if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
for arch in $ax_gcc_arch; do
if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code
flags="-mtune=$arch"
# -mcpu=$arch and m$arch generate nonportable code on every arch except
# x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr.
case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
else
flags="-march=$arch -mcpu=$arch -m$arch"
fi
for flag in $flags; do
AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break])
done
test "x$ax_cv_gcc_archflag" = xunknown || break
done
fi
fi # $GCC=yes
])
AC_MSG_CHECKING([for gcc architecture flag])
AC_MSG_RESULT($ax_cv_gcc_archflag)
if test "x$ax_cv_gcc_archflag" = xunknown; then
m4_default([$3],:)
else
m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"])
fi
])
AC_DEFUN([AX_GCC_X86_CPUID],
[AC_REQUIRE([AC_PROG_CC])
AC_LANG_PUSH([C])
AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
int op = $1, eax, ebx, ecx, edx;
FILE *f;
__asm__("cpuid"
: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
: "a" (op));
f = fopen("conftest_cpuid", "w"); if (!f) return 1;
fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
fclose(f);
return 0;
])],
[ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
[ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
[ax_cv_gcc_x86_cpuid_$1=unknown])])
AC_LANG_POP([C])
])
AC_DEFUN([AC_PROG_GZIP],[
AC_CHECK_PROGS(gzip,[gzip],no)
export gzip;
if test $gzip = "no" ;
then
AC_MSG_ERROR([Unable to find the gzip application]);
fi
AC_SUBST(gzip)
])
AC_DEFUN([AC_PROG_WGET],[
AC_CHECK_PROGS(wget,[wget],no)
export wget;
if test $wget = "no" ;
then
AC_MSG_ERROR([Unable to find the wget application]);
fi
AC_SUBST(wget)
])
AC_DEFUN([AX_CC_MAXOPT],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_ARG_ENABLE(portable-binary, [AC_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])],
acx_maxopt_portable=$withval, acx_maxopt_portable=no)
# Try to determine "good" native compiler flags if none specified via CFLAGS
if test "$ac_test_CFLAGS" != "set"; then
CFLAGS=""
case $ax_cv_c_compiler_vendor in
dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
if test "x$acx_maxopt_portable" = xno; then
CFLAGS="$CFLAGS -arch host"
fi;;
sun) CFLAGS="-native -fast -xO5 -dalign -xc99=all"
if test "x$acx_maxopt_portable" = xyes; then
CFLAGS="$CFLAGS -xarch=generic"
fi;;
hp) CFLAGS="+Oall +Optrs_ansi +DSnative"
if test "x$acx_maxopt_portable" = xyes; then
CFLAGS="$CFLAGS +DAportable"
fi;;
ibm) if test "x$acx_maxopt_portable" = xno; then
xlc_opt="-qarch=auto -qtune=auto"
else
xlc_opt="-qtune=auto"
fi
AX_CHECK_COMPILER_FLAGS($xlc_opt,
CFLAGS="-O3 -qansialias -w $xlc_opt",
[CFLAGS="-O3 -qansialias -w"
echo "******************************************************"
echo "* You seem to have the IBM C compiler. It is *"
echo "* recommended for best performance that you use: *"
echo "* *"
echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *"
echo "* ^^^ ^^^ *"
echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *"
echo "* CPU you have. (Set the CFLAGS environment var. *"
echo "* and re-run configure.) For more info, man cc. *"
echo "******************************************************"])
;;
intel) CFLAGS="-O3 -ansi_alias"
if test "x$acx_maxopt_portable" = xno; then
icc_archflag=unknown
icc_flags=""
case $host_cpu in
i686*|x86_64*)
# icc accepts gcc assembly syntax, so these should work:
AX_GCC_X86_CPUID(0)
AX_GCC_X86_CPUID(1)
case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG
*:756e6547:*:*) # Intel
case $ax_cv_gcc_x86_cpuid_1 in
*6a?:*[[234]]:*:*|*6[[789b]]?:*:*:*) icc_flags="-xK";;
*f3[[347]]:*:*:*|*f4[1347]:*:*:*) icc_flags="-xP -xN -xW -xK";;
*f??:*:*:*) icc_flags="-xN -xW -xK";;
esac ;;
esac ;;
esac
if test "x$icc_flags" != x; then
for flag in $icc_flags; do
AX_CHECK_COMPILER_FLAGS($flag, [icc_archflag=$flag; break])
done
fi
AC_MSG_CHECKING([for icc architecture flag])
AC_MSG_RESULT($icc_archflag)
if test "x$icc_archflag" != xunknown; then
CFLAGS="$CFLAGS $icc_archflag"
fi
fi
;;
gnu)
# default optimization flags for gcc on all systems
CFLAGS="-O3 -fomit-frame-pointer"
# -malign-double for x86 systems
AX_CHECK_COMPILER_FLAGS(-malign-double, CFLAGS="$CFLAGS -malign-double")
# -fstrict-aliasing for gcc-2.95+
AX_CHECK_COMPILER_FLAGS(-fstrict-aliasing,
CFLAGS="$CFLAGS -fstrict-aliasing")
# note that we enable "unsafe" fp optimization with other compilers, too
AX_CHECK_COMPILER_FLAGS(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
AX_GCC_ARCHFLAG($acx_maxopt_portable)
;;
esac
if test -z "$CFLAGS"; then
echo ""
echo "********************************************************"
echo "* WARNING: Don't know the best CFLAGS for this system *"
echo "* Use ./configure CFLAGS=... to specify your own flags *"
echo "* (otherwise, a default of CFLAGS=-O3 will be used) *"
echo "********************************************************"
echo ""
CFLAGS="-O3"
fi
AX_CHECK_COMPILER_FLAGS($CFLAGS, [], [
echo ""
echo "********************************************************"
echo "* WARNING: The guessed CFLAGS don't seem to work with *"
echo "* your compiler. *"
echo "* Use ./configure CFLAGS=... to specify your own flags *"
echo "********************************************************"
echo ""
CFLAGS=""
])
fi
])
AC_DEFUN([AX_CFLAGS_WARN_ALL_ANSI],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all_ansi])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
# IRIX C compiler:
# -use_readonly_const is the default for IRIX C,
# puts them into .rodata, but they are copied later.
# need to be "-G0 -rdatashared" for strictmode but
# I am not sure what effect that has really. - guidod
for ac_arg dnl
in "-pedantic % -Wall -std=c99 -pedantic" dnl GCC
"-xstrconst % -v -xc99=all" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos -std1" dnl Digital Unix
" % -qlanglvl=ansi -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
" % -ansi -ansiE -fullwarn" dnl IRIX
"+ESlit % +w1 -Aa" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg -Xc" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2 -h conform" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_WARN_ALL_ANSI],[dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all_ansi])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
# IRIX C compiler:
# -use_readonly_const is the default for IRIX C,
# puts them into .rodata, but they are copied later.
# need to be "-G0 -rdatashared" for strictmode but
# I am not sure what effect that has really. - guidod
for ac_arg dnl
in "-pedantic % -Wall -ansi -pedantic" dnl GCC
"-xstrconst % -v -Xc" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos -std1" dnl Digital Unix
" % -qlanglvl=ansi -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
" % -ansi -ansiE -fullwarn" dnl IRIX
"+ESlit % +w1 -Aa" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg -Xc" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2 -h conform" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
AS_LITERAL_IF([$1],
[AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1), [
ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes,
AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no)
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
[ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes,
eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no)
_AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)
AC_MSG_RESULT($ax_check_compiler_flags)
if test "x$ax_check_compiler_flags" = xyes; then
m4_default([$2], :)
else
m4_default([$3], :)
fi
])dnl AX_CHECK_COMPILER_FLAG
AC_DEFUN([AX_COMPILER_VENDOR],
[
AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
[ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
# note: don't check for gcc first since some other compilers define __GNUC__
for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
#if !($vencpp)
thisisanerror;
#endif
])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
done
])
])
#! /bin/sh
./configure "$@" --enable-newjb --disable-shared
dnl Yo Yo Yo
AC_INIT(src/iax.c)
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE([iax], [0.2.3])
#Set default language
AC_LANG_C
dnl Check for various goodies
AC_PROG_CC
AM_PROG_LIBTOOL
dnl LIBTOOL="$LIBTOOL --silent"
AC_PROG_INSTALL
#Check for compiler vendor
AX_COMPILER_VENDOR
# Optimize
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
if test "${enable_optimizer}" = "yes" ; then
AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
AX_CC_MAXOPT
fi
# Enable debugging
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],[build with debug information])],[enable_debug="$enable_debug"],[enable_debug="yes"])
if test "${enable_debug}" = "yes"; then
AC_DEFINE([DEBUG],[],[Enable extra debugging.])
AX_CFLAGS_WARN_ALL_ANSI
fi
AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
case "$host" in
*-solaris2*)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-R${prefix}/lib"
IN_LINE=""
elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
IN_LINE=inline
fi
DYNAMIC_LIB_EXTEN="so"
;;
*-darwin*)
if test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-dynamic -bundle -force-flat-namespace"
new_AM_CFLAGS="-DMACOSX"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="dylib"
IN_LINE=inline
;;
x86_64-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
IN_LINE=inline
;;
i*6-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fpic"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
IN_LINE=inline
;;
*)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
IN_LINE=inline
;;
esac
# Enable 64 bit build
AC_ARG_ENABLE(64,
[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
if test "${enable_64}" = "yes"; then
new_AM_CFLAGS="$new_AM_CFLAGS -m64"
fi
fi
AC_SUBST(new_AM_CFLAGS)
AC_SUBST(new_AM_LDFLAGS)
AC_SUBST(SOLINK)
AC_SUBST(DYNAMIC_LIB_EXTEN)
AC_DEFINE_UNQUOTED([__inline__],[$IN_LINE],[sunpro is bad at inline])
dnl Check for libraries
dnl None available
dnl Check header files
AC_HEADER_STDC
AC_SUBST(LIBS)
AC_ARG_ENABLE(snomhack, [ --enable-snomhack Use slower memset for SNOM phoneem ],,enable_snomhack=no)
AC_ARG_ENABLE(extreme_debug, [ --enable-extreme-debug Compile with extreme debugging code enabled ],,enable_extreme_debug=no)
AC_ARG_ENABLE(newjb, [ --enable-newjb Use new jitter buffer ], [CFLAGS="$CFLAGS -DNEWJB"])
if test "$enable_snomhack" = yes ; then
AC_DEFINE(SNOM_HACK)
fi
if test "$enable_extreme_debug" = yes ; then
AC_DEFINE(EXTREME_DEBUG)
fi
AC_SUBST(IAX_VERSION)
AC_OUTPUT([
Makefile
src/Makefile
iax.spec
iax-config],[case "$CONFIG_FILES" in
*iax-config*)chmod +x iax-config;;
esac])
#!/bin/sh
iax_libs="-L/usr/lib -liax"
iax_cflags=""
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
usage="\
Usage: iax-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo @VERSION@
;;
--cflags)
# if test ${prefix}/include/iax != /usr/include/iax ; then
includes=-I${prefix}/include/iax
for i in $iax_cflags ; do
if test $i = -I${prefix}/include ; then
includes=""
fi
done
# fi
echo $includes $iax_cflags
;;
--libs)
my_iax_libs=
libdirs=-L${exec_prefix}/lib
for i in $iax_libs ; do
if test $i != -L${exec_prefix}/lib ; then
if test -z "$my_iax_libs" ; then
my_iax_libs="$i"
else
my_iax_libs="$my_iax_libs $i"
fi
fi
done
echo $libdirs $my_iax_libs
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
%define name @PACKAGE@
%define version @VERSION@
%define release 1
%define prefix /usr
Summary: IAX (Inter Asterisk eXchange) Library
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: LGPL
Group: Development/Libraries
Source: %{name}-%{version}.tar.gz
URL: http://www.linux-support.net/
Distribution: RedHat Linux
Vendor: Linux Support Services
Packager: Rob Flynn <rob@linux-support.net>
BuildRoot: /var/tmp/%{name}-%{version}-root
%description
Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the protocol used by the Asterisk PBX
system for inter-asterisk-communication. Other applications may use libiax to communicate with each other
and other asterisk servers. IAX is a high performance, feature rich protocol unrelated
to SIP or H.323. Its single-socket design allows it to interoperate with NAT and PAT
masquerade firewalls. It supports internationalization, remote dialplans,
and voice, HTML, image, DTMF, and video content. For more information see
http://www.gnophone.com.
%package devel
Summary: IAX (Inter Asterisk eXchange) Development Package
Group: Development/Libraries
Requires: iax
%description devel
Inter Asterisk eXchange, lovingly called IAX (pronounced: eeks), is the protocol used by the Asterisk PBX
system for inter-asterisk-communication. Other applications may use libiax to communicate with each other
and other asterisk servers. IAX is a high performance, feature rich protocol unrelated
to SIP or H.323. Its single-socket design allows it to interoperate with NAT and PAT
masquerade firewalls. It supports internationalization, remote dialplans,
and voice, HTML, image, DTMF, and video content. For more information see
http://www.gnophone.com.
This package contains all of the development files that you will need in order to compile IAX applications.
%prep
%setup
%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --enable-autoupdate
make
%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install-strip
%files
%defattr(-,root,root)
%doc NEWS COPYING AUTHORS README
%{prefix}/lib
%files devel
%defattr(-,root,root)
%{prefix}/include/iax
%{prefix}/bin/*
%clean
rm -r $RPM_BUILD_ROOT
%changelog
* Tue Nov 13 2001 Rob Flynn <rob@linux-support.net> (0.2.2 release)
- HTML Unlink requests
- HTML Reject link requests
- Text frames
* Sat Oct 20 2001 Rob Flynn <rob@linux-support.net> (0.2.1 release)
- More space for challenge in IAX
- Fixed strncpy security bug
- Accept larger packets
- Handle out of order packets better
- Implemented send_url
- Added an iax-config script :-)
* Wed Oct 10 2001 Rob Flynn <rob@linux-support.net> (0.2.0 release)
- Initial public release
%post
%preun
%postun
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libiax2"
ProjectGUID="{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}"
RootNamespace="libiax2"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
InlineFunctionExpansion="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LIBIAX;DEBUG_SUPPORT;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NEWJB;WIN32_TIME_GET_TIME"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LIBIAX;DEBUG_SUPPORT;WIN32_TIME_GET_TIME;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\src\iax-mutex.c"
>
</File>
<File
RelativePath=".\src\iax.c"
>
</File>
<File
RelativePath=".\src\iax2-parser.c"
>
</File>
<File
RelativePath=".\src\jitterbuf.c"
>
</File>
<File
RelativePath=".\src\md5.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\src\answer.h"
>
</File>
<File
RelativePath=".\src\busy.h"
>
</File>
<File
RelativePath=".\src\dialtone.h"
>
</File>
<File
RelativePath=".\src\frame.h"
>
</File>
<File
RelativePath=".\src\iax-client.h"
>
</File>
<File
RelativePath=".\src\iax-mutex.h"
>
</File>
<File
RelativePath=".\src\iax.h"
>
</File>
<File
RelativePath=".\src\iax2-parser.h"
>
</File>
<File
RelativePath=".\src\iax2.h"
>
</File>
<File
RelativePath=".\src\jitterbuf.h"
>
</File>
<File
RelativePath=".\src\md5.h"
>
</File>
<File
RelativePath=".\src\miniphone.h"
>
</File>
<File
RelativePath=".\src\options.h"
>
</File>
<File
RelativePath=".\src\ring10.h"
>
</File>
<File
RelativePath=".\src\ringtone.h"
>
</File>
<File
RelativePath=".\src\winpoop.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="libiax2"
ProjectGUID="{5CC054B7-6DAA-46BF-9A08-3B33B83E8D3E}"
RootNamespace="libiax2"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
InlineFunctionExpansion="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LIBIAX;DEBUG_SUPPORT;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NEWJB;WIN32_TIME_GET_TIME"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LIBIAX;DEBUG_SUPPORT;WIN32_TIME_GET_TIME;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\src\iax-mutex.c"
>
</File>
<File
RelativePath=".\src\iax.c"
>
</File>
<File
RelativePath=".\src\iax2-parser.c"
>
</File>
<File
RelativePath=".\src\jitterbuf.c"
>
</File>
<File
RelativePath=".\src\md5.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\src\answer.h"
>
</File>
<File
RelativePath=".\src\busy.h"
>
</File>
<File
RelativePath=".\src\dialtone.h"
>
</File>
<File
RelativePath=".\src\frame.h"
>
</File>
<File
RelativePath=".\src\iax-client.h"
>
</File>
<File
RelativePath=".\src\iax-mutex.h"
>
</File>
<File
RelativePath=".\src\iax.h"
>
</File>
<File
RelativePath=".\src\iax2-parser.h"
>
</File>
<File
RelativePath=".\src\iax2.h"
>
</File>
<File
RelativePath=".\src\jitterbuf.h"
>
</File>
<File
RelativePath=".\src\md5.h"
>
</File>
<File
RelativePath=".\src\miniphone.h"
>
</File>
<File
RelativePath=".\src\options.h"
>
</File>
<File
RelativePath=".\src\ring10.h"
>
</File>
<File
RelativePath=".\src\ringtone.h"
>
</File>
<File
RelativePath=".\src\winpoop.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
Makefile.in
Makefile
.deps
.libs
iax.lo
md5.lo
libiax.la
AM_CFLAGS = $(new_AM_CFLAGS)
AM_CPPFLAGS = $(AM_CFLAGS)
AM_LDFLAGS = $(new_AM_LDFLAGS)
AM_CFLAGS += -DDEBUG_SUPPORT -DLIBIAX
# -DDEBUG_DEFAULT
AM_CFLAGS += $(UCFLAGS)
pkgdir = $(libdir)
pkg_LTLIBRARIES=libiax.la
libiax_la_SOURCES = iax2-parser.c iax.c md5.c jitterbuf.c iax-mutex.c
library_includedir = $(prefix)/include/iax
library_include_HEADERS = md5.h frame.h iax-client.h iax2.h iax2-parser.h iax.h iax-mutex.h
noinst_HEADERS = jitterbuf.h
/* busy.h: Generated from frequencies 480 and 620
by gensound. 400 samples */
static short busy[400] = {
0, 13697, 24766, 31109, 31585, 26222, 16198, 3569,
-9162, -19575, -25812, -26935, -23069, -15322, -5493, 4339,
12277, 16985, 17934, 15440, 10519, 4585, -908, -4827,
-6592, -6269, -4489, -2220, -467, 30, -983, -3203,
-5839, -7844, -8215, -6301, -2035, 3975, 10543, 16141,
19260, 18787, 14322, 6338, -3845, -14296, -22858, -27611,
-27309, -21691, -11585, 1213, 14285, 25068, 31388, 31915,
26457, 16010, 2568, -11282, -22885, -30054, -31509, -27120,
-17908, -5805, 6760, 17379, 24147, 26028, 23020, 16094,
6931, -2478, -10279, -15136, -16474, -14538, -10253, -4949,
0, 3515, 5052, 4688, 3045, 1069, -268, -272,
1269, 3996, 7067, 9381, 9889, 7910, 3365, -3123,
-10320, -16622, -20424, -20510, -16384, -8448, 2006, 13026,
22383, 28040, 28613, 23696, 13996, 1232, -12193, -23670,
-30918, -32459, -27935, -18190, -5103, 8795, 20838, 28764,
31164, 27753, 19395, 7893, -4412, -15136, -22342, -24909,
-22717, -16609, -8143, 780, 8361, 13272, 14909, 13455,
9758, 5067, 678, -2387, -3624, -3133, -1538, 224,
1209, 751, -1315, -4580, -8145, -10848, -11585, -9628,
-4878, 2038, 9844, 16867, 21403, 22124, 18429, 10638,
0, -11524, -21643, -28211, -29702, -25561, -16364, -3737,
9946, 22044, 30180, 32733, 29182, 20210, 7573, -6269,
-18655, -27259, -30558, -28117, -20645, -9807, 2148, 12878,
20426, 23599, 22173, 16865, 9117, 731, -6552, -11426,
-13269, -12216, -9050, -4941, -1118, 1460, 2335, 1635,
0, -1635, -2335, -1460, 1118, 4941, 9050, 12216,
13269, 11426, 6552, -731, -9117, -16865, -22173, -23599,
-20426, -12878, -2148, 9807, 20645, 28117, 30558, 27259,
18655, 6269, -7573, -20210, -29182, -32733, -30180, -22044,
-9946, 3737, 16364, 25561, 29702, 28211, 21643, 11524,
0, -10638, -18429, -22124, -21403, -16867, -9844, -2038,
4878, 9628, 11585, 10848, 8145, 4580, 1315, -751,
-1209, -224, 1538, 3133, 3624, 2387, -678, -5067,
-9758, -13455, -14909, -13272, -8361, -780, 8143, 16609,
22717, 24909, 22342, 15136, 4412, -7893, -19395, -27753,
-31164, -28764, -20838, -8795, 5103, 18190, 27935, 32459,
30918, 23670, 12193, -1232, -13996, -23696, -28613, -28040,
-22383, -13026, -2006, 8448, 16384, 20510, 20424, 16622,
10320, 3123, -3365, -7910, -9889, -9381, -7067, -3996,
-1269, 272, 268, -1069, -3045, -4688, -5052, -3515,
0, 4949, 10253, 14538, 16474, 15136, 10279, 2478,
-6931, -16094, -23020, -26028, -24147, -17379, -6760, 5805,
17908, 27120, 31509, 30054, 22885, 11282, -2568, -16010,
-26457, -31915, -31388, -25068, -14285, -1213, 11585, 21691,
27309, 27611, 22858, 14296, 3845, -6338, -14322, -18787,
-19260, -16141, -10543, -3975, 2035, 6301, 8215, 7844,
5839, 3203, 983, -30, 467, 2220, 4489, 6269,
6592, 4827, 908, -4585, -10519, -15440, -17934, -16985,
-12277, -4339, 5493, 15322, 23069, 26935, 25812, 19575,
9162, -3569, -16198, -26222, -31585, -31109, -24766, -13697,
};
/* dialtone.h: Generated from frequencies 350 and 440
by gensound. 800 samples */
static short dialtone[800] = {
0, 9997, 19004, 26133, 30692, 32251, 30690, 26206,
19286, 10657, 1206, -8116, -16396, -22848, -26895, -28221,
-26797, -22878, -16960, -9723, -1954, 5545, 12044, 16954,
19887, 20687, 19434, 16420, 12107, 7061, 1881, -2866,
-6721, -9365, -10657, -10634, -9491, -7547, -5190, -2822,
-801, 607, 1263, 1168, 454, -633, -1784, -2669,
-2993, -2548, -1247, 855, 3558, 6538, 9388, 11665,
12955, 12933, 11408, 8370, 3996, -1349, -7152, -12797,
-17635, -21060, -22583, -21895, -18914, -13807, -6985, 934,
9180, 16913, 23309, 27654, 29422, 28342, 24429, 17998,
9630, 123, -9589, -18538, -25813, -30667, -32588, -31360,
-27088, -20185, -11332, -1411, 8594, 17694, 24997, 29805,
31675, 30473, 26374, 19844, 11585, 2455, -6618, -14745,
-21156, -25284, -26815, -25713, -22213, -16785, -10073, -2824,
4203, 10318, 14969, 17794, 18653, 17628, 14998, 11197,
6753, 2217, -1899, -5189, -7386, -8388, -8261, -7212,
-5555, -3657, -1881, -536, 169, 157, -515, -1664,
-3009, -4217, -4954, -4940, -3996, -2080, 697, 4081,
7689, 11059, 13710, 15199, 15187, 13489, 10114, 5272,
-630, -7031, -13263, -18632, -22491, -24320, -23794, -20823,
-15582, -8498, -218, 8457, 16651, 23507, 28276, 30407,
29606, 25876, 19524, 11134, 1511, -8401, -17616, -25208,
-30406, -32682, -31800, -27845, -21215, -12576, -2796, 7150,
16278, 23700, 28713, 30868, 30015, 26312, 20199, 12351,
3598, -5164, -13071, -19378, -23531, -25223, -24413, -21318,
-16384, -10218, -3526, 2980, 8655, 12985, 15642, 16505,
15661, 13381, 10073, 6228, 2348, -1110, -3796, -5495,
-6152, -5863, -4853, -3434, -1954, -744, -62, -60,
-757, -2037, -3664, -5317, -6637, -7283, -6985, -5590,
-3096, 334, 4390, 8631, 12544, 15605, 17339, 17393,
15582, 11928, 6672, 258, -6705, -13506, -19403, -23711,
-25879, -25558, -22653, -17341, -10061, -1480, 7570, 16185,
23475, 28661, 31164, 30670, 27167, 20951, 12603, 2930,
-7116, -16540, -24401, -29915, -32533, -32003, -28391, -22075,
-13704, -4128, 5690, 14781, 22262, 27432, 29838, 29319,
26014, 20339, 12940, 4614, -3777, -11401, -17540, -21660,
-23463, -22908, -20199, -15755, -10150, -4044, 1898, 7079,
11030, 13459, 14268, 13555, 11585, 8745, 5487, 2268,
-511, -2559, -3716, -3975, -3468, -2440, -1206, -101,
578, 618, -78, -1470, -3382, -5524, -7531, -9018,
-9630, -9103, -7308, -4280, -226, 4483, 9357, 13829,
17329, 19352, 19524, 17659, 13788, 8177, 1302, -6184,
-13528, -19945, -24710, -27240, -27167, -24381, -19058, -11646,
-2830, 6539, 15528, 23219, 28806, 31685, 31520, 28282,
22254, 14010, 4355, -5759, -15331, -23411, -29203, -32144,
-31966, -28714, -22748, -14695, -5384, 4241, 13228, 20707,
25981, 28600, 28391, 25479, 20256, 13337, 5482, -2482,
-9761, -15668, -19694, -21556, -21215, -18865, -14902, -9864,
-4366, 975, 5614, 9130, 11270, 11967, 11332, 9628,
7223, 4536, 1976, -113, -1495, -2071, -1882, -1102,
0, 1102, 1882, 2071, 1495, 113, -1976, -4536,
-7223, -9628, -11332, -11967, -11270, -9130, -5614, -975,
4366, 9864, 14902, 18865, 21215, 21556, 19694, 15668,
9761, 2482, -5482, -13337, -20256, -25479, -28391, -28600,
-25981, -20707, -13228, -4241, 5384, 14695, 22748, 28714,
31966, 32144, 29203, 23411, 15331, 5759, -4355, -14010,
-22254, -28282, -31520, -31685, -28806, -23219, -15528, -6539,
2830, 11646, 19058, 24381, 27167, 27240, 24710, 19945,
13528, 6184, -1302, -8177, -13788, -17659, -19524, -19352,
-17329, -13829, -9357, -4483, 226, 4280, 7308, 9103,
9630, 9018, 7531, 5524, 3382, 1470, 78, -618,
-578, 101, 1206, 2440, 3468, 3975, 3716, 2559,
511, -2268, -5487, -8745, -11585, -13555, -14268, -13459,
-11030, -7079, -1898, 4044, 10150, 15755, 20199, 22908,
23463, 21660, 17540, 11401, 3777, -4614, -12940, -20339,
-26014, -29319, -29838, -27432, -22262, -14781, -5690, 4128,
13704, 22075, 28391, 32003, 32533, 29915, 24401, 16540,
7116, -2930, -12603, -20951, -27167, -30670, -31164, -28661,
-23475, -16185, -7570, 1480, 10061, 17341, 22653, 25558,
25879, 23711, 19403, 13506, 6705, -258, -6672, -11928,
-15582, -17393, -17339, -15605, -12544, -8631, -4390, -334,
3096, 5590, 6985, 7283, 6637, 5317, 3664, 2037,
757, 60, 62, 744, 1954, 3434, 4853, 5863,
6152, 5495, 3796, 1110, -2348, -6228, -10073, -13381,
-15661, -16505, -15642, -12985, -8655, -2980, 3526, 10218,
16384, 21318, 24413, 25223, 23531, 19378, 13071, 5164,
-3598, -12351, -20199, -26312, -30015, -30868, -28713, -23700,
-16278, -7150, 2796, 12576, 21215, 27845, 31800, 32682,
30406, 25208, 17616, 8401, -1511, -11134, -19524, -25876,
-29606, -30407, -28276, -23507, -16651, -8457, 218, 8498,
15582, 20823, 23794, 24320, 22491, 18632, 13263, 7031,
630, -5272, -10114, -13489, -15187, -15199, -13710, -11059,
-7689, -4081, -697, 2080, 3996, 4940, 4954, 4217,
3009, 1664, 515, -157, -169, 536, 1881, 3657,
5555, 7212, 8261, 8388, 7386, 5189, 1899, -2217,
-6753, -11197, -14998, -17628, -18653, -17794, -14969, -10318,
-4203, 2824, 10073, 16785, 22213, 25713, 26815, 25284,
21156, 14745, 6618, -2455, -11585, -19844, -26374, -30473,
-31675, -29805, -24997, -17694, -8594, 1411, 11332, 20185,
27088, 31360, 32588, 30667, 25813, 18538, 9589, -123,
-9630, -17998, -24429, -28342, -29422, -27654, -23309, -16913,
-9180, -934, 6985, 13807, 18914, 21895, 22583, 21060,
17635, 12797, 7152, 1349, -3996, -8370, -11408, -12933,
-12955, -11665, -9388, -6538, -3558, -855, 1247, 2548,
2993, 2669, 1784, 633, -454, -1168, -1263, -607,
801, 2822, 5190, 7547, 9491, 10634, 10657, 9365,
6721, 2866, -1881, -7061, -12107, -16420, -19434, -20687,
-19887, -16954, -12044, -5545, 1954, 9723, 16960, 22878,
26797, 28221, 26895, 22848, 16396, 8116, -1206, -10657,
-19286, -26206, -30690, -32251, -30692, -26133, -19004, -9997,
};
差异被折叠。
#define RBUFSIZE 256
#define MAXARGS 10
#define MAXARG 256
#define MAX_SESSIONS 4
extern void parse_cmd(FILE *, int, char **);
/*
* Snomphone: IAX software for SNOM 100 Phone
*
* IAX Support for talking to Asterisk and other Gnophone clients
*
* Copyright (C) 1999, Linux Support Services, Inc.
*
* Mark Spencer <markster@linux-support.net>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
*/
#define CONFIG_FILE "/etc/miniphone.conf"
#define USER_FILE "%s/.miniphone-conf"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
char regpeer[256];
char regsecret[256];
char server[256];
int refresh = 60;
char context[256];
char language[256];
#define TYPE_STRING 0
#define TYPE_INT 1
struct opt {
char *name;
void *where;
int len;
int type;
};
static struct opt opts[] = {
{ "regpeer", regpeer, sizeof(regpeer), TYPE_STRING },
{ "regsecret", regsecret, sizeof(regsecret), TYPE_STRING },
{ "server", server, sizeof(server), TYPE_STRING },
{ "context", context, sizeof(context), TYPE_STRING },
{ "language", language, sizeof(language), TYPE_STRING },
{ "refresh", &refresh, sizeof(refresh), TYPE_INT },
};
static int __load_options(char *filename)
{
FILE *f;
int lineno = 0;
char buf[256];
char *var, *value;
int x;
char *c;
f = fopen(filename, "r");
if (!f) {
fprintf(stderr, "Failed to open '%s': %s\n", filename, strerror(errno));
return -1;
}
while(!feof(f)) {
fgets(buf, sizeof(buf), f);
if (!feof(f)) {
/* Ditch comments */
if ((c = strchr(buf, '#')))
*c = 0;
lineno++;
/* Strip CR */
buf[strlen(buf)-1] = '\0';
if (strlen(buf)) {
var = strtok(buf, "=");
value = strtok(NULL, "=");
if (!var || !value) {
fprintf(stderr, "Syntax error line %d\n", lineno);
continue;
}
for (x=0;x<sizeof(opts) / sizeof(opts[0]); x++) {
if (!strcasecmp(var, opts[x].name)) {
switch(opts[x].type) {
case TYPE_STRING:
strncpy((char *)opts[x].where, value, opts[x].len);
break;
case TYPE_INT:
if (sscanf(value, "%i", (int *)opts[x].where) != 1) {
fprintf(stderr, "Not a number at line %d\n", lineno);
}
break;
default:
fprintf(stderr, "Don't know what to do about type %d\n", opts[x].type);
}
break;
}
}
if (!(x < sizeof(opts) / sizeof(opts[0]))) {
fprintf(stderr, "Dunno keyword '%s'\n", var);
continue;
}
}
}
}
fclose(f);
return 0;
}
int load_options(void)
{
char fn[256];
__load_options(CONFIG_FILE);
if (getenv("HOME")) {
snprintf(fn, sizeof(fn), USER_FILE, getenv("HOME"));
__load_options(fn);
}
return 0;
}
static int __save_options(char *filename)
{
FILE *f;
f = fopen(filename, "w");
if (!f) {
fprintf(stderr, "Failed to open '%s': %s\n", filename, strerror(errno));
return -1;
}
fclose(f);
return 0;
}
int save_options(void)
{
char fn[256];
if (getenv("HOME")) {
snprintf(fn, sizeof(fn), USER_FILE, getenv("HOME"));
return __save_options(fn);
} else
return __save_options(CONFIG_FILE);
}
/*
* Snomphone: IAX software for SNOM 100 Phone
*
* IAX Support for talking to Asterisk and other Gnophone clients
*
* Copyright (C) 1999, Linux Support Services, Inc.
*
* Mark Spencer <markster@linux-support.net>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
*/
extern char regpeer[256];
extern char regsecret[256];
extern char regpeer[256];
extern char server[256];
extern int refresh;
extern char context[256];
extern char language[256];
int save_options(void);
int load_options(void);
差异被折叠。
/* ringtone.h: Generated from frequencies 440 and 480
by gensound. 200 samples */
static short ringtone[200] = {
0, 11581, 21659, 28927, 32445, 31764, 26981, 18727,
8084, -3559, -14693, -23875, -29927, -32083, -30088, -24228,
-15290, -4453, 6864, 17195, 25212, 29902, 30693, 27526,
20856, 11585, 944, -9673, -18899, -25560, -28837, -28357,
-24244, -17089, -7868, 2192, 11780, 19667, 24872, 26779,
25212, 20450, 13179, 4396, -4731, -13019, -19421, -23164,
-23839, -21446, -16384, -9384, -1408, 6484, 13281, 18145,
20517, 20182, 17286, 12301, 5951, -887, -7314, -12519,
-15886, -17068, -16017, -12983, -8458, -3109, 2327, 7142,
10750, 12757, 13007, 11585, 8793, 5095, 1044, -2800,
-5951, -8053, -8921, -8560, -7141, -4967, -2421, 104,
2260, 3791, 4567, 4589, 3977, 2941, 1733, 600,
-257, -722, -772, -481, 0, 481, 772, 722,
257, -600, -1733, -2941, -3977, -4589, -4567, -3791,
-2260, -104, 2421, 4967, 7141, 8560, 8921, 8053,
5951, 2800, -1044, -5095, -8793, -11585, -13007, -12757,
-10750, -7142, -2327, 3109, 8458, 12983, 16017, 17068,
15886, 12519, 7314, 887, -5951, -12301, -17286, -20182,
-20517, -18145, -13281, -6484, 1408, 9384, 16384, 21446,
23839, 23164, 19421, 13019, 4731, -4396, -13179, -20450,
-25212, -26779, -24872, -19667, -11780, -2192, 7868, 17089,
24244, 28357, 28837, 25560, 18899, 9673, -944, -11585,
-20856, -27526, -30693, -29902, -25212, -17195, -6864, 4453,
15290, 24228, 30088, 32083, 29927, 23875, 14693, 3559,
-8084, -18727, -26981, -31764, -32445, -28927, -21659, -11581,
};
BASE=../../../.. BASE=../../../..
LOCAL_CFLAGS=-I. -DNEWJB -DLIBIAX
LOCAL_OBJS=iax2-parser.o iax.o md5.o jitterbuf.o iax-mutex.o
IAX_DIR=$(BASE)/libs/iax
IAXLA=$(IAX_DIR)/src/libiax.la
LOCAL_CFLAGS=-I$(IAX_DIR)/src
LOCAL_LIBADD=$(IAXLA)
include $(BASE)/build/modmake.rules include $(BASE)/build/modmake.rules
$(IAXLA): $(IAX_DIR) $(IAX_DIR)/.update
cd $(IAX_DIR) && $(MAKE)
...@@ -306,8 +306,7 @@ static int __debug(char *file, int lineno, const char *func, char *fmt, ...) ...@@ -306,8 +306,7 @@ static int __debug(char *file, int lineno, const char *func, char *fmt, ...)
#ifdef WIN32 #ifdef WIN32
#define DEBU #define DEBU
#else #else
#define DEBU(fmt...) \ #define DEBU(...) (void)(0)
do {} while(0)
#endif #endif
#define G #define G
#endif #endif
...@@ -847,9 +846,9 @@ static int get_sample_cnt(struct iax_event *e) ...@@ -847,9 +846,9 @@ static int get_sample_cnt(struct iax_event *e)
static int iax_xmit_frame(struct iax_frame *f) static int iax_xmit_frame(struct iax_frame *f)
{ {
struct ast_iax2_full_hdr *h = (f->data);
/* Send the frame raw */ /* Send the frame raw */
#ifdef DEBUG_SUPPORT #ifdef DEBUG_SUPPORT
struct ast_iax2_full_hdr *h = (f->data);
if (ntohs(h->scallno) & IAX_FLAG_FULL) if (ntohs(h->scallno) & IAX_FLAG_FULL)
iax_showframe(f, NULL, 0, f->transfer ? iax_showframe(f, NULL, 0, f->transfer ?
&(f->session->transfer) : &(f->session->transfer) :
......
...@@ -111,6 +111,7 @@ static void dump_byte(char *output, int maxlen, void *value, int len) ...@@ -111,6 +111,7 @@ static void dump_byte(char *output, int maxlen, void *value, int len)
snprintf(output, maxlen, "Invalid BYTE"); snprintf(output, maxlen, "Invalid BYTE");
} }
#if 0
static void dump_ipaddr(char *output, int maxlen, void *value, int len) static void dump_ipaddr(char *output, int maxlen, void *value, int len)
{ {
struct sockaddr_in sin; struct sockaddr_in sin;
...@@ -121,7 +122,6 @@ static void dump_ipaddr(char *output, int maxlen, void *value, int len) ...@@ -121,7 +122,6 @@ static void dump_ipaddr(char *output, int maxlen, void *value, int len)
snprintf(output, maxlen, "Invalid IPADDR"); snprintf(output, maxlen, "Invalid IPADDR");
} }
static void dump_prov_flags(char *output, int maxlen, void *value, int len) static void dump_prov_flags(char *output, int maxlen, void *value, int len)
{ {
if (len == (int)sizeof(unsigned int)) if (len == (int)sizeof(unsigned int))
...@@ -130,6 +130,7 @@ static void dump_prov_flags(char *output, int maxlen, void *value, int len) ...@@ -130,6 +130,7 @@ static void dump_prov_flags(char *output, int maxlen, void *value, int len)
else else
snprintf(output, maxlen, "Invalid INT"); snprintf(output, maxlen, "Invalid INT");
} }
#endif
static void dump_samprate(char *output, int maxlen, void *value, int len) static void dump_samprate(char *output, int maxlen, void *value, int len)
{ {
......
...@@ -265,17 +265,17 @@ static void history_calc_maxbuf(jitterbuf *jb) ...@@ -265,17 +265,17 @@ static void history_calc_maxbuf(jitterbuf *jb)
} }
} }
if (0) { #if 0
int k; int k;
fprintf(stderr, "toins = %ld\n", toins); fprintf(stderr, "toins = %ld\n", toins);
fprintf(stderr, "maxbuf ="); fprintf(stderr, "maxbuf =");
for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++) for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
fprintf(stderr, "%ld ", jb->hist_maxbuf[k]); fprintf(stderr, "%ld ", jb->hist_maxbuf[k]);
fprintf(stderr, "\nminbuf ="); fprintf(stderr, "\nminbuf =");
for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++) for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
fprintf(stderr, "%ld ", jb->hist_minbuf[k]); fprintf(stderr, "%ld ", jb->hist_minbuf[k]);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} #endif
} }
jb->hist_maxbuf_valid = 1; jb->hist_maxbuf_valid = 1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论