[asterisk-commits] branch group/autoconf_and_menuselect r22124 - /team/group/autoconf_and_menuse...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 21 22:57:14 MST 2006


Author: russell
Date: Sat Apr 22 00:57:13 2006
New Revision: 22124

URL: http://svn.digium.com/view/asterisk?rev=22124&view=rev
Log:
- add support to AST_EXT_LIB for not only checking the presence and usability
  of the library itself, but also to make sure that the necessary headers
  are installed and usable as well
- modify the uses of AST_EXT_LIB to reflect these changes.  For now, the only
  one checking for a header is the check for unixodbc.  However, the rest
  need to be completed as well.
- remove AST_EXT_LIB_SUFFIX as we are not using it right now
- clean up the formatting of AST_CHECK_GNU_MAKE

Modified:
    team/group/autoconf_and_menuselect/acinclude.m4
    team/group/autoconf_and_menuselect/configure.ac

Modified: team/group/autoconf_and_menuselect/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/acinclude.m4?rev=22124&r1=22123&r2=22124&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/acinclude.m4 (original)
+++ team/group/autoconf_and_menuselect/acinclude.m4 Sat Apr 22 00:57:13 2006
@@ -1,8 +1,8 @@
-# AST_EXT_LIB([NAME], [FUNCTION], [package symbol name], [package friendly name], [additional LIB data])
+# AST_EXT_LIB([NAME], [FUNCTION], [package header], [package symbol name], [package friendly name], [additional LIB data])
 
 AC_DEFUN([AST_EXT_LIB],
 [
-AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH],[use $4 files in PATH]),[
+AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH],[use $5 files in PATH]),[
 case ${withval} in
      n|no)
      USE_$1=no
@@ -20,20 +20,35 @@
 PBX_LIB$1=0
 
 if test "${USE_$1}" != "no"; then	
-   AC_CHECK_LIB([$1], [$2], AC_DEFINE_UNQUOTED([HAVE_$3], 1,
-   [Define to indicate the $4 library]), [], -L${$1_DIR}/lib $5)
+   AC_CHECK_LIB([$1], [$2], AC_DEFINE_UNQUOTED([HAVE_$4], 1,
+   [Define to indicate the $5 library]), [], -L${$1_DIR}/lib $6)
 
    if test "${ac_cv_lib_$1_$2}" = "yes"; then
-      $1_LIB="-l$1 $5"
+      $1_LIB="-l$1 $6"
+      $4_HEADER_FOUND="1"
       if test "x${$1_DIR}" != "x"; then
          $1_LIB="-L${$1_DIR}/lib ${$1_LIB}"
 	 $1_INCLUDE="-I${$1_DIR}/include"
+	 if test "x$3" != "x" ; then
+	    AC_CHECK_HEADER([${$1_DIR}/include/$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] )
+	 fi
+      else
+	 if test "x$3" != "x" ; then
+            AC_CHECK_HEADER([$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] )
+	 fi
       fi
-      PBX_LIB$1=1
+      if test "x${$4_HEADER_FOUND}" = "x0" ; then
+        echo " ***"
+        echo " *** It appears that you do not have the $5 development package installed."
+        echo " *** Please install it to include $5 support, or re-run configure"
+        echo " *** with the argument --without-$1"
+        exit 1
+      fi
+      PBX_LIB$1=1 
    elif test ! -z "${$1_MANDATORY}";
    then
       echo "***"
-      echo "*** The $4 installation on this system appears to be broken."
+      echo "*** The $5 installation on this system appears to be broken."
       echo "*** Either correct the installation, or run configure"
       echo "*** including --without-$1"
       exit 1
@@ -44,78 +59,21 @@
 AC_SUBST([PBX_LIB$1])
 ])
 
-# AST_EXT_LIB_SUFFIX([NAME], [FUNCTION], [package symbol name], [package friendly name], [additional LIB data])
-
-AC_DEFUN([AST_EXT_LIB_SUFFIX],
-[
-AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH],[use $4 files in PATH]),[
-case ${withval} in
-     n|no)
-     USE_$1=no
-     ;;
-     y|ye|yes)
-     $1_MANDATORY="yes"
-     ;;
-     *)
-     $1_DIR="${withval}"
-     $1_MANDATORY="yes"
-     ;;
-esac
-])
-AC_ARG_WITH([$1]-suffix, AC_HELP_STRING([--with-$1-suffix=PATH],[add PATH suffix for $4 files]),[
-case ${withval} in
-     *)
-     if test "x${$1_DIR}" != "x"; then
-        $1_SUFFIX="/${withval}"
-        $1_MANDATORY="yes"
-     else
-	echo "--with-$1-suffix ignored because --with-$1 was not specified."
-     fi
-     ;;
-esac
-])
-
-PBX_LIB$1=0
-
-if test "${USE_$1}" != "no"; then	
-   AC_CHECK_LIB([$1], [$2], AC_DEFINE_UNQUOTED([HAVE_$3], 1,
-   [Define to indicate the $4 library]), [], -L${$1_DIR}/lib${$1_SUFFIX} $5)
-
-   if test "${ac_cv_lib_$1_$2}" = "yes"; then
-      $1_LIB="-l$1 $5"
-      if test "x${$1_DIR}" != "x"; then
-         $1_LIB="-L${$1_DIR}/lib${$1_SUFFIX} ${$1_LIB}"
-	 $1_INCLUDE="-I${$1_DIR}/include${$1_SUFFIX}"
-      fi
-      PBX_LIB$1=1
-   elif test ! -z "${$1_MANDATORY}";
-   then
-      echo "***"
-      echo "*** The $4 installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** including --without-$1"
-      exit 1
-   fi
-fi
-AC_SUBST([$1_LIB])
-AC_SUBST([$1_INCLUDE])
-AC_SUBST([PBX_LIB$1])
-])
 
 AC_DEFUN(
-        [AST_CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make, GNU_MAKE,
-                GNU_MAKE='Not Found' ;
-                for a in make gmake gnumake ; do
-                        if test -z "$a" ; then continue ; fi ;
-                        if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
-                                GNU_MAKE=$a ;
-                                break;
-                        fi
-                done ;
-        ) ;
-        if test  "x$GNU_MAKE" = "xNot Found"  ; then
-		echo " *** Please install GNU make.  It is required to build Asterisk!"
-		exit 1
-        fi
-	AC_SUBST([GNU_MAKE])
+[AST_CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make, GNU_MAKE,
+   GNU_MAKE='Not Found' ;
+   for a in make gmake gnumake ; do
+      if test -z "$a" ; then continue ; fi ;
+      if ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
+         GNU_MAKE=$a ;
+         break;
+      fi
+   done ;
+) ;
+if test  "x$GNU_MAKE" = "xNot Found"  ; then
+   echo " *** Please install GNU make.  It is required to build Asterisk!"
+   exit 1
+fi
+AC_SUBST([GNU_MAKE])
 ] )

Modified: team/group/autoconf_and_menuselect/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/configure.ac?rev=22124&r1=22123&r2=22124&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/configure.ac (original)
+++ team/group/autoconf_and_menuselect/configure.ac Sat Apr 22 00:57:13 2006
@@ -157,23 +157,23 @@
 	      *) AC_MSG_ERROR(bad value ${enableval} for --enable-developer-mode)  ;;
 	esac])
 
-AST_EXT_LIB([ogg], [ogg_sync_init], [OGG], [OGG])
-AST_EXT_LIB([vorbis], [vorbis_info_init], [VORBIS], [Vorbis], [-lm -lvorbisenc])
-AST_EXT_LIB([asound], [snd_spcm_init], [ALSA], [Advanced Linux Sound Architecture], [-lm -ldl])
-AST_EXT_LIB([nbs], [nbs_setup], [NBS], [Network Broadcast Sound])
-AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [OSS], [Open Sound System])
-AST_EXT_LIB([speex], [speex_encode], [SPEEX], [Speex], [-lm])
-AST_EXT_LIB([tonezone], [tone_zone_find], [ZAPTEL], [Zaptel])
-AST_EXT_LIB([pri], [pri_call], [LIBPRI], [ISDN PRI])
-AST_EXT_LIB([mfcr2], [mfcr2_MakeCall], [MFCR2], [MFCR2])
-AST_EXT_LIB([osptk], [OSPPCryptoDecrypt], [OSPTK], [OSP Toolkit], [-lcrypto -lssl])
-AST_EXT_LIB([odbc], [SQLConnect], [UNIXODBC], [unixODBC])
-AST_EXT_LIB([sqlite], [sqlite_exec], [SQLITE], [SQLite])
-AST_EXT_LIB([tds], [tds_version], [FREETDS], [FreeTDS])
-AST_EXT_LIB([popt], [poptStrerror], [POPT], [popt])
-AST_EXT_LIB([newt], [newtBell], [NEWT], [newt])
-AST_EXT_LIB([ssl], [ssl2_connect], [OPENSSL], [OpenSSL], [-lcrypto])
-AST_EXT_LIB([z], [compress], [ZLIB], [zlib])
+AST_EXT_LIB([ogg], [ogg_sync_init], [], [OGG], [OGG])
+AST_EXT_LIB([vorbis], [vorbis_info_init], [], [VORBIS], [Vorbis], [-lm -lvorbisenc])
+AST_EXT_LIB([asound], [snd_spcm_init], [], [ALSA], [Advanced Linux Sound Architecture], [-lm -ldl])
+AST_EXT_LIB([nbs], [nbs_setup], [], [NBS], [Network Broadcast Sound])
+AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [], [OSS], [Open Sound System])
+AST_EXT_LIB([speex], [speex_encode], [], [SPEEX], [Speex], [-lm])
+AST_EXT_LIB([tonezone], [tone_zone_find], [], [ZAPTEL], [Zaptel])
+AST_EXT_LIB([pri], [pri_call], [], [LIBPRI], [ISDN PRI])
+AST_EXT_LIB([mfcr2], [mfcr2_MakeCall], [], [MFCR2], [MFCR2])
+AST_EXT_LIB([osptk], [OSPPCryptoDecrypt], [], [OSPTK], [OSP Toolkit], [-lcrypto -lssl])
+AST_EXT_LIB([odbc], [SQLConnect], [sql.h], [UNIXODBC], [unixODBC])
+AST_EXT_LIB([sqlite], [sqlite_exec], [], [SQLITE], [SQLite])
+AST_EXT_LIB([tds], [tds_version], [], [FREETDS], [FreeTDS])
+AST_EXT_LIB([popt], [poptStrerror], [], [POPT], [popt])
+AST_EXT_LIB([newt], [newtBell], [], [NEWT], [newt])
+AST_EXT_LIB([ssl], [ssl2_connect], [], [OPENSSL], [OpenSSL], [-lcrypto])
+AST_EXT_LIB([z], [compress], [], [ZLIB], [zlib])
 
 GSM_INTERNAL="yes"
 GSM_SYSTEM="yes"



More information about the asterisk-commits mailing list