mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
comment a bit the code in acinclude.m4
There is still a lot of code to clean up there, but hopefully this should clarify what goes on in there. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
52
acinclude.m4
52
acinclude.m4
@@ -1,3 +1,7 @@
|
||||
# Various support functions for configure.ac in asterisk
|
||||
#
|
||||
|
||||
# Helper function to check for gcc attributes.
|
||||
# AST_GCC_ATTRIBUTE([attribute name])
|
||||
|
||||
AC_DEFUN([AST_GCC_ATTRIBUTE],
|
||||
@@ -11,13 +15,20 @@ AC_COMPILE_IFELSE(
|
||||
AC_MSG_RESULT(no))
|
||||
])
|
||||
|
||||
# AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text])
|
||||
# Helper function to setup variables for a package.
|
||||
# $1 -> the package name. Used in configure.ac and also as a prefix
|
||||
# for the variables ($1_DIR, $1_INCLUDE, $1_LIB) in makeopts
|
||||
# $3 -> option name, used in --with-$3 or --without-$3 when calling configure.
|
||||
# $2 and $4 are just text describing the package (short and long form)
|
||||
|
||||
# AST_EXT_LIB_SETUP([package], [short description], [configure option name], [long description])
|
||||
|
||||
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]),[
|
||||
AC_ARG_WITH([$3], AC_HELP_STRING([--with-$3=PATH],[use $2 files in PATH $4]),
|
||||
[
|
||||
case ${withval} in
|
||||
n|no)
|
||||
USE_$1=no
|
||||
@@ -39,7 +50,8 @@ AC_SUBST([PBX_$1])
|
||||
])
|
||||
|
||||
# Check whether any of the mandatory modules are not present, and
|
||||
# print error messages in case.
|
||||
# print error messages in case. The mandatory list is built using
|
||||
# --with-* arguments when invoking configure.
|
||||
|
||||
AC_DEFUN([AST_CHECK_MANDATORY],
|
||||
[
|
||||
@@ -61,16 +73,22 @@ AC_DEFUN([AST_CHECK_MANDATORY],
|
||||
AC_MSG_RESULT(ok)
|
||||
])
|
||||
|
||||
#-- The following two tests are only performed if PBX_$1 != 1,
|
||||
# so you can use multiple tests and stop at the first matching one.
|
||||
# On success, set PBX_$1 = 1, and also #define HAVE_$1 1
|
||||
# and #define HAVE_$1_VERSION ${last_argument} so you can tell which
|
||||
# test succeeded.
|
||||
# The next three functions check for the availability of a given package.
|
||||
# AST_C_DEFINE_CHECK looks for the presence of a #define in a header file,
|
||||
# AST_EXT_LIB_CHECK looks for a symbol in a given library, or at least
|
||||
# for the presence of a header file.
|
||||
# AST_EXT_TOOL_CHECK looks for a symbol in using $1-config to determine CFLAGS and LIBS
|
||||
#
|
||||
# They are only run if PBX_$1 != 1 (where $1 is the package),
|
||||
# so you can call them multiple times and stop at the first matching one.
|
||||
# On success, they both set PBX_$1 = 1, set $1_INCLUDE and $1_LIB as applicable,
|
||||
# and also #define HAVE_$1 1 and #define HAVE_$1_VERSION ${last_argument}
|
||||
# in autoconfig.h so you can tell which test succeeded.
|
||||
# They should be called after AST_EXT_LIB_SETUP($1, ...)
|
||||
|
||||
# Check if a given macro is defined in a certain header.
|
||||
|
||||
# AST_C_DEFINE_CHECK([package symbol name], [macro name], [header file], [version])
|
||||
# AST_C_DEFINE_CHECK([package], [macro name], [header file], [version])
|
||||
AC_DEFUN([AST_C_DEFINE_CHECK],
|
||||
[
|
||||
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
|
||||
@@ -99,7 +117,7 @@ AC_DEFUN([AST_C_DEFINE_CHECK],
|
||||
# in a library, or, if no function is supplied, only check for the
|
||||
# existence of the header files.
|
||||
|
||||
# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data], [version])
|
||||
# AST_EXT_LIB_CHECK([package], [library], [function], [header], [additional LIB data], [version])
|
||||
AC_DEFUN([AST_EXT_LIB_CHECK],
|
||||
[
|
||||
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
|
||||
@@ -152,10 +170,13 @@ fi
|
||||
])
|
||||
|
||||
|
||||
# check for a tool using xxx-config
|
||||
# AST_EXT_TOOL_CHECK([package symbol name], [package library name], [symbol], [version])
|
||||
# Check for a package using $2-config. Similar to AST_EXT_LIB_CHECK,
|
||||
# but use $2-config to determine cflags and libraries to use.
|
||||
|
||||
# AST_EXT_TOOL_CHECK([package], [tool name], [symbol], [version])
|
||||
AC_DEFUN([AST_EXT_TOOL_CHECK],
|
||||
[
|
||||
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
|
||||
PBX_$1=0
|
||||
AC_CHECK_TOOL(CONFIG_$1, $2-config, No)
|
||||
if test ! "x${CONFIG_$1}" = xNo; then
|
||||
@@ -164,9 +185,7 @@ if test ! "x${CONFIG_$1}" = xNo; then
|
||||
PBX_$1=1
|
||||
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
|
||||
fi
|
||||
AC_SUBST(PBX_$1)
|
||||
AC_SUBST($1_INCLUDE)
|
||||
AC_SUBST($1_LIB)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(
|
||||
@@ -830,7 +849,8 @@ dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
dnl @version 2006-05-29
|
||||
dnl @license GPLWithACException
|
||||
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
AC_DEFUN([ACX_PTHREAD],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
|
15
configure
vendored
15
configure
vendored
@@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# From configure.ac Revision: 89394 .
|
||||
# From configure.ac Revision: 89395 .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.61.
|
||||
#
|
||||
@@ -12403,13 +12403,11 @@ _ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <sys/types.h> /* for off_t */
|
||||
#include <stdio.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int (*fp) (FILE *, off_t, int) = fseeko;
|
||||
return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
|
||||
return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
@@ -12449,13 +12447,11 @@ cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#define _LARGEFILE_SOURCE 1
|
||||
#include <sys/types.h> /* for off_t */
|
||||
#include <stdio.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int (*fp) (FILE *, off_t, int) = fseeko;
|
||||
return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
|
||||
return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
@@ -56505,6 +56501,7 @@ fi
|
||||
|
||||
|
||||
|
||||
if test "x${PBX_SDL}" != "x1" -a "${USE_SDL}" != "no"; then
|
||||
PBX_SDL=0
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}sdl-config", so it can be a program name with args.
|
||||
@@ -56612,9 +56609,7 @@ cat >>confdefs.h <<\_ACEOF
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test "x${PBX_SDL_IMAGE}" != "x1" -a "${USE_SDL_IMAGE}" != "no"; then
|
||||
|
Reference in New Issue
Block a user