[asterisk-commits] pabelanger: branch pabelanger/non-root r606 - in /asterisk/team/pabelanger/no...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 28 10:56:53 CDT 2010


Author: pabelanger
Date: Wed Jul 28 10:56:50 2010
New Revision: 606

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=606
Log:
First attempt at configure script for asttest

Added:
    asterisk/team/pabelanger/non-root/asttest/autoconf/
    asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4   (with props)
    asterisk/team/pabelanger/non-root/asttest/bootstrap.sh   (with props)
    asterisk/team/pabelanger/non-root/asttest/configure   (with props)
    asterisk/team/pabelanger/non-root/asttest/configure.ac   (with props)
    asterisk/team/pabelanger/non-root/asttest/install-sh   (with props)

Added: asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4?view=auto&rev=606
==============================================================================
--- asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4 (added)
+++ asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4 Wed Jul 28 10:56:50 2010
@@ -1,0 +1,147 @@
+# 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"
+    PBX_$1=0
+    AC_ARG_WITH([$3], AC_HELP_STRING([--with-$3=PATH],[use $2 files in PATH$4]),
+    [
+	case ${withval} in
+	n|no)
+	USE_$1=no
+	# -1 is a magic value used by menuselect to know that the package
+	# was disabled, other than 'not found'
+	PBX_$1=-1
+	;;
+	y|ye|yes)
+	ac_mandatory_list="${ac_mandatory_list} $1"
+	;;
+	*)
+	$1_DIR="${withval}"
+	ac_mandatory_list="${ac_mandatory_list} $1"
+	;;
+	esac
+    ])
+    AH_TEMPLATE(m4_bpatsubst([[HAVE_$1]], [(.*)]), [Define to 1 if you have the $2 library.])
+    AC_SUBST([$1_LIB])
+    AC_SUBST([$1_INCLUDE])
+    AC_SUBST([$1_DIR])
+    AC_SUBST([PBX_$1])
+])
+
+# AST_OPTION_ONLY([option name], [option variable], [option description], [default value])
+AC_DEFUN([AST_OPTION_ONLY],
+[
+AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH], [use $3 in PATH]),
+	[
+	case ${withval} in
+	n|no)
+		unset $2
+		;;
+	*)
+		if test "x${$2}" = "x"; then
+			m4_ifval($4, [$2="$4"], [:])
+		else
+			$2="${withval}"
+		fi
+		;;
+	esac
+	],
+	[m4_ifval($4, [$2="$4"])])
+AC_SUBST($2)
+])
+
+# AST_EXT_LIB_SETUP_DEPENDENT([package symbol name], [package friendly name], [master package symbol name], [master package option name])
+
+AC_DEFUN([AST_EXT_LIB_SETUP_DEPENDENT],
+[
+$1_DESCRIP="$2"
+m4_ifval([$4], [$1_OPTION=$4])
+m4_ifval([$3], [
+for i in ${ac_mandatory_list}; do
+   if test "x$3" = "x$i"; then
+      ac_mandatory_list="${ac_mandatory_list} $1"
+      break
+   fi
+done
+])
+PBX_$1=0
+AH_TEMPLATE(m4_bpatsubst([[HAVE_$1]], [(.*)]), [Define to 1 if you have the $2 library.])
+AC_SUBST([$1_LIB])
+AC_SUBST([$1_INCLUDE])
+AC_SUBST([$1_DIR])
+AC_SUBST([PBX_$1])
+])
+
+# 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 "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"
+      else
+      	 pbxlibdir="-L${$1_DIR}"
+      fi
+   fi
+   pbxfuncname="$3"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_$1_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} $6"
+      AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], [${pbxlibdir} $5])
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_$1_FOUND}" = "yes"; then
+      $1_LIB="${pbxlibdir} -l$2 $5"
+      # if --with-$1=DIR has been specified, use it.
+      if test "x${$1_DIR}" != "x"; then
+         $1_INCLUDE="-I${$1_DIR}/include"
+      fi
+      $1_INCLUDE="${$1_INCLUDE} $6"
+      if test "x$4" = "x" ; then	# no header, assume found
+         $1_HEADER_FOUND="1"
+      else				# check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+         AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${$1_HEADER_FOUND}" = "x0" ; then
+         $1_LIB=""
+         $1_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
+            $1_LIB=""
+         fi
+         PBX_$1=1
+         cat >>confdefs.h <<_ACEOF
+[@%:@define] HAVE_$1 1
+_ACEOF
+         m4_ifval([$7], [
+         cat >>confdefs.h <<_ACEOF
+[@%:@define] HAVE_$1_VERSION $7
+_ACEOF
+            ])
+      fi
+   fi
+fi
+m4_ifval([$7], [AH_TEMPLATE(m4_bpatsubst([[HAVE_$1_VERSION]], [(.*)]), [Define to the version of the $2 library.])])
+])

Propchange: asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/non-root/asttest/autoconf/ast_ext_lib.m4
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/non-root/asttest/bootstrap.sh
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/non-root/asttest/bootstrap.sh?view=auto&rev=606
==============================================================================
--- asterisk/team/pabelanger/non-root/asttest/bootstrap.sh (added)
+++ asterisk/team/pabelanger/non-root/asttest/bootstrap.sh Wed Jul 28 10:56:50 2010
@@ -1,0 +1,50 @@
+#!/bin/sh
+
+check_for_app() {
+	$1 --version 2>&1 >/dev/null
+	if [ $? != 0 ]
+	then
+		echo "Please install $1 and run bootstrap.sh again!"
+		exit 1
+	fi
+}
+
+# On FreeBSD and OpenBSD, multiple autoconf/automake versions have different names.
+# On Linux, environment variables tell which one to use.
+
+case `uname -sr` in
+	'FreeBSD 4'*)	# FreeBSD 4.x has a different naming
+		MY_AC_VER=259
+		MY_AM_VER=19
+		;;
+	*'BSD'*)
+		MY_AC_VER=-2.62
+		MY_AM_VER=-1.9
+		;;
+	*'SunOS '*)
+		MY_AC_VER=
+		MY_AM_VER=-1.9
+		;;
+	*)
+		MY_AC_VER=
+		MY_AM_VER=
+		AUTOCONF_VERSION=2.60
+		AUTOMAKE_VERSION=1.9
+		export AUTOCONF_VERSION
+		export AUTOMAKE_VERSION
+		;;
+esac
+
+check_for_app autoconf${MY_AC_VER}
+check_for_app autoheader${MY_AC_VER}
+check_for_app automake${MY_AM_VER}
+check_for_app aclocal${MY_AM_VER}
+
+echo "Generating the configure script ..."
+
+aclocal${MY_AM_VER} -I autoconf
+autoconf${MY_AC_VER}
+autoheader${MY_AC_VER}
+automake${MY_AM_VER} --add-missing --copy 2>/dev/null
+
+exit 0

Propchange: asterisk/team/pabelanger/non-root/asttest/bootstrap.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/non-root/asttest/bootstrap.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/team/pabelanger/non-root/asttest/bootstrap.sh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/non-root/asttest/bootstrap.sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: asterisk/team/pabelanger/non-root/asttest/configure
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/non-root/asttest/configure
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/team/pabelanger/non-root/asttest/configure
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/non-root/asttest/configure
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/non-root/asttest/configure.ac
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/non-root/asttest/configure.ac?view=auto&rev=606
==============================================================================
--- asterisk/team/pabelanger/non-root/asttest/configure.ac (added)
+++ asterisk/team/pabelanger/non-root/asttest/configure.ac Wed Jul 28 10:56:50 2010
@@ -1,0 +1,32 @@
+AC_PREREQ(2.60)
+
+AC_INIT([testsuite], [trunk], [https://issues.asterisk.org])
+
+# check existence of the package
+AC_CONFIG_SRCDIR([asttest.c])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_CPP
+AC_PROG_CXXCPP
+AC_PROG_AWK
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_RANLIB
+
+AST_EXT_LIB_SETUP([LUA], [Lua], [lua])
+
+AST_EXT_LIB_CHECK([LUA], [lua5.1], [luaL_newstate], [lua5.1/lua.h], [-lm])
+if test "x${PBX_LUA}" = "x1" ; then
+        if test x"${LUA_DIR}" = x; then
+                LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.1"
+        else
+                LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.1"
+        fi
+else
+	AC_MSG_NOTICE([***])
+	AC_MSG_NOTICE([*** It appears you do not have the lua development package installed.])
+	AC_MSG_NOTICE([*** Please install it! ***])
+	exit 1
+fi

Propchange: asterisk/team/pabelanger/non-root/asttest/configure.ac
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/non-root/asttest/configure.ac
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/non-root/asttest/configure.ac
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/pabelanger/non-root/asttest/install-sh
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/non-root/asttest/install-sh?view=auto&rev=606
==============================================================================
--- asterisk/team/pabelanger/non-root/asttest/install-sh (added)
+++ asterisk/team/pabelanger/non-root/asttest/install-sh Wed Jul 28 10:56:50 2010
@@ -1,0 +1,269 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+#
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd="$cpprog"
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd="$stripprog"
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "install:	no input file specified"
+	exit 1
+else
+	true
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+	
+	if [ -d $dst ]; then
+		instcmd=:
+		chmodcmd=""
+	else
+		instcmd=mkdir
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f $src -o -d $src ]
+	then
+		true
+	else
+		echo "install:  $src does not exist"
+		exit 1
+	fi
+	
+	if [ x"$dst" = x ]
+	then
+		echo "install:	no destination specified"
+		exit 1
+	else
+		true
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d $dst ]
+	then
+		dst="$dst"/`basename $src`
+	else
+		true
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS=' 	
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp="${pathcomp}${1}"
+	shift
+
+	if [ ! -d "${pathcomp}" ] ;
+        then
+		$mkdirprog "${pathcomp}"
+	else
+		true
+	fi
+
+	pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd $dst &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		dstfile=`basename $dst $transformbasename | 
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		true
+	fi
+
+# Make a temp file name in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd $src $dsttmp &&
+
+	trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+	$doit $rmcmd -f $dstdir/$dstfile &&
+	$doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0

Propchange: asterisk/team/pabelanger/non-root/asttest/install-sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/pabelanger/non-root/asttest/install-sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/team/pabelanger/non-root/asttest/install-sh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/pabelanger/non-root/asttest/install-sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list