[svn-commits] kpfleming: trunk r151242 - in /trunk: ./ autoconf/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Oct 19 23:59:05 CDT 2008


Author: kpfleming
Date: Sun Oct 19 23:59:04 2008
New Revision: 151242

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151242
Log:
Merged revisions 151240 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r151240 | kpfleming | 2008-10-20 07:45:56 +0300 (Mon, 20 Oct 2008) | 3 lines
  
  break up acinclude.m4 into individual files, which will make it easier to maintain, easier to add new macros (less patching) and will ease maintenance of these macros across Asterisk branches
........

Added:
    trunk/autoconf/
      - copied from r151240, branches/1.4/autoconf/
    trunk/autoconf/ast_check_mandatory.m4   (with props)
    trunk/autoconf/ast_ext_tool_check.m4   (with props)
Removed:
    trunk/acinclude.m4
Modified:
    trunk/   (props changed)
    trunk/autoconf/acx_pthread.m4   (contents, props changed)
    trunk/autoconf/ast_c_compile_check.m4   (contents, props changed)
    trunk/autoconf/ast_c_define_check.m4   (contents, props changed)
    trunk/autoconf/ast_check_gnu_make.m4   (contents, props changed)
    trunk/autoconf/ast_check_openh323.m4   (contents, props changed)
    trunk/autoconf/ast_check_pwlib.m4   (contents, props changed)
    trunk/autoconf/ast_ext_lib.m4   (contents, props changed)
    trunk/autoconf/ast_func_fork.m4   (contents, props changed)
    trunk/autoconf/ast_gcc_attribute.m4   (contents, props changed)
    trunk/autoconf/ast_prog_egrep.m4   (contents, props changed)
    trunk/autoconf/ast_prog_ld.m4   (contents, props changed)
    trunk/autoconf/ast_prog_ld_gnu.m4   (contents, props changed)
    trunk/autoconf/ast_prog_sed.m4   (contents, props changed)
    trunk/bootstrap.sh
    trunk/configure

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/autoconf/acx_pthread.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/acx_pthread.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
--- trunk/autoconf/acx_pthread.m4 (original)
+++ trunk/autoconf/acx_pthread.m4 Sun Oct 19 23:59:04 2008
@@ -46,7 +46,8 @@
 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

Modified: trunk/autoconf/ast_c_compile_check.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_c_compile_check.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
--- trunk/autoconf/ast_c_compile_check.m4 (original)
+++ trunk/autoconf/ast_c_compile_check.m4 Sun Oct 19 23:59:04 2008
@@ -1,4 +1,4 @@
-# AST_C_COMPILE_CHECK can be used for testing for various items in header files
+# Check if a given expression will compile using a certain header.
 
 # AST_C_COMPILE_CHECK([package], [expression], [header file], [version], [description])
 AC_DEFUN([AST_C_COMPILE_CHECK],

Modified: trunk/autoconf/ast_c_define_check.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_c_define_check.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
--- trunk/autoconf/ast_c_define_check.m4 (original)
+++ trunk/autoconf/ast_c_define_check.m4 Sun Oct 19 23:59:04 2008
@@ -4,30 +4,30 @@
 AC_DEFUN([AST_C_DEFINE_CHECK],
 [
     if test "x${PBX_$1}" != "x1"; then
-    AC_MSG_CHECKING([for $2 in $3])
-    saved_cppflags="${CPPFLAGS}"
-    if test "x${$1_DIR}" != "x"; then
-        $1_INCLUDE="-I${$1_DIR}/include"
-    fi
-    CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+	AC_MSG_CHECKING([for $2 in $3])
+	saved_cppflags="${CPPFLAGS}"
+	if test "x${$1_DIR}" != "x"; then
+	    $1_INCLUDE="-I${$1_DIR}/include"
+	fi
+	CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
 
-    AC_COMPILE_IFELSE(
-        [ AC_LANG_PROGRAM( [#include <$3>],
-                   [#if defined($2)
-                int foo = 0;
-                    #else
-                    int foo = bar;
-                    #endif
-                0
-                   ])],
-        [   AC_MSG_RESULT(yes)
-        PBX_$1=1
-        AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
-        AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
-        ],
-        [   AC_MSG_RESULT(no) ] 
-    )
-    CPPFLAGS="${saved_cppflags}"
+	AC_COMPILE_IFELSE(
+	    [ AC_LANG_PROGRAM( [#include <$3>],
+			       [#if defined($2)
+				int foo = 0;
+			        #else
+			        int foo = bar;
+			        #endif
+				0
+			       ])],
+	    [   AC_MSG_RESULT(yes)
+		PBX_$1=1
+		AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
+		AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
+	    ],
+	    [   AC_MSG_RESULT(no) ] 
+	)
+	CPPFLAGS="${saved_cppflags}"
     fi
     AC_SUBST(PBX_$1)
 ])

Modified: trunk/autoconf/ast_check_gnu_make.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_check_gnu_make.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
    (empty)

Added: trunk/autoconf/ast_check_mandatory.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_check_mandatory.m4?view=auto&rev=151242
==============================================================================
--- trunk/autoconf/ast_check_mandatory.m4 (added)
+++ trunk/autoconf/ast_check_mandatory.m4 Sun Oct 19 23:59:04 2008
@@ -1,0 +1,23 @@
+# Check whether any of the mandatory modules are not present, and
+# print error messages in case. The mandatory list is built using
+# --with-* arguments when invoking configure.
+
+AC_DEFUN([AST_CHECK_MANDATORY],
+[
+	AC_MSG_CHECKING([for mandatory modules: ${ac_mandatory_list}])
+	err=0;
+	for i in ${ac_mandatory_list}; do
+		eval "a=\${PBX_$i}"
+		if test "x${a}" = "x1" ; then continue; fi
+		if test ${err} = "0" ; then AC_MSG_RESULT(fail) ; fi
+		AC_MSG_RESULT()
+		eval "a=\${${i}_OPTION}"
+		AC_MSG_NOTICE([***])
+		AC_MSG_NOTICE([*** The $i installation appears to be missing or broken.])
+		AC_MSG_NOTICE([*** Either correct the installation, or run configure])
+		AC_MSG_NOTICE([*** including --without-${a}.])
+		err=1
+	done
+	if test $err = 1 ; then exit 1; fi
+	AC_MSG_RESULT(ok)
+])

Propchange: trunk/autoconf/ast_check_mandatory.m4
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/autoconf/ast_check_mandatory.m4
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/autoconf/ast_check_mandatory.m4
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: trunk/autoconf/ast_check_openh323.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_check_openh323.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
--- trunk/autoconf/ast_check_openh323.m4 (original)
+++ trunk/autoconf/ast_check_openh323.m4 Sun Oct 19 23:59:04 2008
@@ -155,6 +155,7 @@
 fi
   AC_LANG_POP([C++])
 ])
+
 AC_DEFUN([AST_CHECK_OPENH323_BUILD], [
 	if test "${HAS_OPENH323:-unset}" != "unset"; then
 		AC_MSG_CHECKING(OpenH323 build option)

Modified: trunk/autoconf/ast_check_pwlib.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_check_pwlib.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
--- trunk/autoconf/ast_check_pwlib.m4 (original)
+++ trunk/autoconf/ast_check_pwlib.m4 Sun Oct 19 23:59:04 2008
@@ -121,7 +121,6 @@
 	fi
 ])
 
-
 AC_DEFUN([AST_CHECK_PWLIB_BUILD], [
 	if test "${HAS_$2:-unset}" != "unset"; then
 	   AC_MSG_CHECKING($1 installation validity)

Modified: trunk/autoconf/ast_ext_lib.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_ext_lib.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
--- trunk/autoconf/ast_ext_lib.m4 (original)
+++ trunk/autoconf/ast_ext_lib.m4 Sun Oct 19 23:59:04 2008
@@ -1,36 +1,48 @@
-# 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]),[
-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([$1_DIR])
-AC_SUBST([PBX_$1])
+    $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)
+	ac_mandatory_list="${ac_mandatory_list} $1"
+	;;
+	*)
+	$1_DIR="${withval}"
+	ac_mandatory_list="${ac_mandatory_list} $1"
+	;;
+	esac
+    ])
+    PBX_$1=0
+    AC_SUBST([$1_LIB])
+    AC_SUBST([$1_INCLUDE])
+    AC_SUBST([$1_DIR])
+    AC_SUBST([PBX_$1])
 ])
 
-# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data], [additional INCLUDE data])
+# Check for existence of a given package ($1), either looking up a function
+# in a library, or, if no function is supplied, only check for the
+# existence of the header files.
 
+# AST_EXT_LIB_CHECK([package], [library], [function], [header],
+#	 [extra libs], [extra cflags], [version])
 AC_DEFUN([AST_EXT_LIB_CHECK],
 [
-if test "${USE_$1}" != "no"; then
+if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
    pbxlibdir=""
+   # if --with-$1=DIR has been specified, use it.
    if test "x${$1_DIR}" != "x"; then
       if test -d ${$1_DIR}/lib; then
       	 pbxlibdir="-L${$1_DIR}/lib"
@@ -38,45 +50,41 @@
       	 pbxlibdir="-L${$1_DIR}"
       fi
    fi
-   AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
+   pbxfuncname="$3"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_$1_FOUND=yes
+   else
+      AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
+   fi
 
+   # now check for the header.
    if test "${AST_$1_FOUND}" = "yes"; then
-      $1_LIB="-l$2 $5"
-      $1_HEADER_FOUND="1"
+      $1_LIB="${pbxlibdir} -l$2 $5"
+      # if --with-$1=DIR has been specified, use it.
       if test "x${$1_DIR}" != "x"; then
-         $1_LIB="${pbxlibdir} ${$1_LIB}"
 	 $1_INCLUDE="-I${$1_DIR}/include"
       fi
       $1_INCLUDE="${$1_INCLUDE} $6"
-      saved_cppflags="${CPPFLAGS}"
-      CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
-      if test "x$4" != "x" ; then
-         AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
+      if test "x$4" = "x" ; then	# no header, assume found
+         $1_HEADER_FOUND="1"
+      else				# check for the header
+         saved_cppflags="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+	 AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
+         CPPFLAGS="${saved_cppflags}"
       fi
-      CPPFLAGS="${saved_cppflags}"
       if test "x${$1_HEADER_FOUND}" = "x0" ; then
-         if test -n "${$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
+         if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
+	    $1_LIB=""
+	 fi
          PBX_$1=1
-         AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
+         # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
+         AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define this to indicate the ${$1_DESCRIP} library])
+	 AC_DEFINE_UNQUOTED([HAVE_$1_VERSION], [$7], [Define to indicate the ${$1_DESCRIP} library version])
       fi
-   elif test -n "${$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
 ])

Added: trunk/autoconf/ast_ext_tool_check.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_ext_tool_check.m4?view=auto&rev=151242
==============================================================================
--- trunk/autoconf/ast_ext_tool_check.m4 (added)
+++ trunk/autoconf/ast_ext_tool_check.m4 Sun Oct 19 23:59:04 2008
@@ -1,0 +1,43 @@
+# Check for a package using $2-config. Similar to AST_EXT_LIB_CHECK,
+# but use $2-config to determine cflags and libraries to use.
+# $3 and $4 can be used to replace --cflags and --libs in the request
+
+# AST_EXT_TOOL_CHECK([package], [tool name], [--cflags], [--libs], [includes], [expression])
+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
+	    if test x"$3" = x ; then A=--cflags ; else A="$3" ; fi
+	    $1_INCLUDE=$(${CONFIG_$1} $A)
+	    if test x"$4" = x ; then A=--libs ; else A="$4" ; fi
+	    $1_LIB=$(${CONFIG_$1} $A)
+	    if test x"$5" != x ; then
+		saved_cppflags="${CPPFLAGS}"
+		if test "x${$1_DIR}" != "x"; then
+		    $1_INCLUDE="-I${$1_DIR}/include"
+		fi
+		CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+		saved_ldflags="${LDFLAGS}"
+		LDFLAGS="${$1_LIB}"
+
+		AC_LINK_IFELSE(
+		    [ AC_LANG_PROGRAM( [ $5 ],
+				       [ $6; ]
+				       )],
+		    [   PBX_$1=1
+			AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
+		    ],
+		    []
+		)
+		CPPFLAGS="${saved_cppflags}"
+		LDFLAGS="${saved_ldflags}"
+	    else
+		PBX_$1=1
+		AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
+	    fi
+	fi
+    fi
+])

Propchange: trunk/autoconf/ast_ext_tool_check.m4
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/autoconf/ast_ext_tool_check.m4
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/autoconf/ast_ext_tool_check.m4
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: trunk/autoconf/ast_func_fork.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_func_fork.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
    (empty)

Modified: trunk/autoconf/ast_gcc_attribute.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_gcc_attribute.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
--- trunk/autoconf/ast_gcc_attribute.m4 (original)
+++ trunk/autoconf/ast_gcc_attribute.m4 Sun Oct 19 23:59:04 2008
@@ -1,3 +1,4 @@
+# Helper function to check for gcc attributes.
 # AST_GCC_ATTRIBUTE([attribute name])
 
 AC_DEFUN([AST_GCC_ATTRIBUTE],

Modified: trunk/autoconf/ast_prog_egrep.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_prog_egrep.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
    (empty)

Modified: trunk/autoconf/ast_prog_ld.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_prog_ld.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
    (empty)

Modified: trunk/autoconf/ast_prog_ld_gnu.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_prog_ld_gnu.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
    (empty)

Modified: trunk/autoconf/ast_prog_sed.m4
URL: http://svn.digium.com/view/asterisk/trunk/autoconf/ast_prog_sed.m4?view=diff&rev=151242&r1=151240&r2=151242
==============================================================================
    (empty)

Modified: trunk/bootstrap.sh
URL: http://svn.digium.com/view/asterisk/trunk/bootstrap.sh?view=diff&rev=151242&r1=151241&r2=151242
==============================================================================
--- trunk/bootstrap.sh (original)
+++ trunk/bootstrap.sh Sun Oct 19 23:59:04 2008
@@ -40,7 +40,7 @@
 
 echo "Generating the configure script ..."
 
-aclocal${MY_AM_VER} 2>/dev/null
+aclocal${MY_AM_VER} -Iautoconf
 autoconf${MY_AC_VER}
 autoheader${MY_AC_VER}
 automake${MY_AM_VER} --add-missing --copy 2>/dev/null




More information about the svn-commits mailing list