[Asterisk-code-review] build tools: Updates for 14 (repotools[master])

Joshua Colp asteriskteam at digium.com
Wed Jul 27 06:48:40 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: build_tools:  Updates for 14
......................................................................


build_tools:  Updates for 14

Removes the cpu flavors.
Updates commit_to_staging

Change-Id: Ibc9ebba53d2dbb2ae31bb30288c2158e9b73039e
---
M build_tools/Makefile.product_rules
M build_tools/buildfuncs
A build_tools/commit_to_staging
D build_tools/make_cpu_flavors
M build_tools/make_product
D build_tools/make_tag
D build_tools/make_tags
7 files changed, 135 insertions(+), 593 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/build_tools/Makefile.product_rules b/build_tools/Makefile.product_rules
index 2b4ce11..104aa9e 100644
--- a/build_tools/Makefile.product_rules
+++ b/build_tools/Makefile.product_rules
@@ -1,14 +1,23 @@
 
 MODULE_NAME=$(notdir $(PWD))
 
-all: $(MODULE_NAME).so
+all:: $(MODULE_NAME).so $(MODULE_EXTRA_LIBRARIES)
 
 include repotools/build_tools/Makefile.version
 
 export CC
 export OSARCH
 export CFLAGS
+export MAKE_DEPS
+export SOLINK
+export WARN
+export ASTINCDIR
+export ASTLIBDIR
 export OPT
+export ARCH
+export TGTDIR
+export PRODUCT_VERSION
+export FLAVOR_ARCH
 
 CC=gcc
 LD=ld
@@ -20,22 +29,24 @@
 FLAVOR_ARCH?=generic
 WARN=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
 #WARN+=-Wno-pointer-sign #Some versions of gcc (such as the one included with RHEL4) don't like this.
-DEBUG=-g3
 
-CPUARCH?=$(shell uname -m)
+ifeq ($(ARCH),)
+ARCH=$(shell uname -m)
+endif
 
-ifeq ($(CPUARCH),i686)
+ifeq ($(ARCH),i686)
 FLAVOR_LDEMUL?=elf_i386
 FLAVOR_MODE?=-m32
 FLAVOR_ARCH=x86_32
+OPT+=-m32
 ASTLIBDIR:=/usr/lib/asterisk
 endif
 
-ifeq ($(CPUARCH),x86_64)
+ifeq ($(ARCH),x86_64)
 FLAVOR_LDEMUL?=elf_x86_64
 FLAVOR_MODE?=-m64
 FLAVOR_ARCH=x86_64
-OPT+=-fPIC
+OPT+=-fPIC -m64
 CFLAGS+=-fPIC
 ifeq ($(wildcard /usr/lib64),)
 ASTLIBDIR:=/usr/lib/asterisk
@@ -54,44 +65,9 @@
 STATIC:=-static
 WHOLE_OPT:=-fwhole-program
 
-ifneq ($(COPYPROTECT),)
-CFLAGS+=-DCOPYPROTECT
-ifeq ($(COPYPROTECT), FAKE)
-CFLAGS+=-DFAKECOPYPROTECT
-ifneq ($(MAXCALLS),)
-CFLAGS+=-DMAXCALLS=$(MAXCALLS)
-endif # MAXCALLS
-else # COPYPROTECT && COPYPROTECT != FAKE
-CFLAGS+=-Ilibcp
-LIBCP=libcp/cp.o
-
-LIBS+=-Llibcp/$(shell $(MAKE) --no-print-directory -C libcp z_lib) -lz
-LIBS+=-Llibcp/$(shell $(MAKE) --no-print-directory -C libcp ssl_lib) -lssl -lcrypto
-endif # COPYPROTECT=FAKE
-endif # COPYPROTECT
-
-ifneq ($(OSARCH),)
-  ifeq ($(OSARCH),SunOS)
-    SOLINK=-shared -fPIC -mimpure-text
-    INSTALL=ginstall
-    CFLAGS+=-DSOLARIS
-    ASTLIBDIR=/opt/asterisk/lib
-    STATIC=-static
-  else
-    ifeq ($(OSARCH),Darwin)
-      SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
-      STRIP=strip -r -u
-    else
-      ifeq ($(OSARCH),FreeBSD)
-        INSTALL=ginstall
-        ASTLIBDIR=/usr/local/lib/asterisk
-      endif
-    endif
-  endif
-endif
-
-$(LIBCP):
-	$(MAKE) -C libcp OPT="$(OPT)" DEBUG="$(DEBUG)"
+copyprotect_cflags=$(if $(1),-DCOPYPROTECT $(if $(filter FAKE,$(1)),-DFAKECOPYPROTECT) $(if $(MAXCALLS),-DMAXCALLS=$(MAXCALLS)) -Ilibcp)
+copyprotect_libs=$(if $(1:FAKE=),-Llibcp/$(shell $(MAKE) --no-print-directory -C libcp z_lib) -lz -Llibcp/$(shell $(MAKE) --no-print-directory -C libcp ssl_lib) -lssl -lcrypto)
+copyprotect_objs=$(if $(1:FAKE=),libcp/cp.o)
 
 optarch.h: FORCE
 	@echo "#define OPTARCH \" (optimized for $(FLAVOR_ARCH))\"" > $@.tmp
@@ -100,7 +76,7 @@
 
 asterisk/include/asterisk/buildopts.h: | asterisk/configure
 	@echo "Initializing asterisk source directory.  This may take a minute..."
-	@(cd asterisk && $(MAKE) distclean 2>/dev/null ; ./configure && $(MAKE) include/asterisk/buildopts.h) >/dev/null
+	@(cd asterisk && $(MAKE) distclean 2>/dev/null ; ./configure --host=$(ARCH)-linux-gnu && $(MAKE) include/asterisk/buildopts.h) >/dev/null
 	@sed -i -e /GCC_ATOMICS/d asterisk/include/asterisk/autoconfig.h
 
 include repotools/build_tools/Makefile.dependencies
@@ -108,49 +84,58 @@
 CFLAGS+=$(MODULE_SDK_CFLAGS)
 MODULE_OBJS=$(MODULE_NAME).o $(MODULE_EXTRA_OBJS)
 
-$(MODULE_NAME).o:: CFLAGS+=-DAST_MODULE=\"$(MODULE_NAME)\" -DAST_MODULE_SYM=\"$(MODULE_NAME)\" -I$(ASTINCDIR)
+$(MODULE_OBJS): CFLAGS+=-I$(ASTINCDIR) -DAST_MODULE=\"$(MODULE_NAME)\" -DAST_MODULE_SELF_SYM=__internal_$(MODULE_NAME)_self
 
 .c.o::
-	$(CC) $(FLAVOR_MODE) -c $< -o $@ $(CFLAGS) $(OPT) $(DEBUG) $(WARN) $(MAKE_DEPS)
+	$(CC) $(FLAVOR_MODE) -c $< -o $@ $(CFLAGS)  $(OPT) $(DEBUG) $(WARN) $(MAKE_DEPS)
 
 $(MODULE_OBJS): %.o :%.c optarch.h version.h asterisk/include/asterisk/buildopts.h
-	$(CC) $(FLAVOR_MODE) -c $< -o $@ $(CFLAGS) $(OPT) $(DEBUG) $(WARN) $(MAKE_DEPS)
+	$(CC) $(FLAVOR_MODE) -c $< -o $@ $(CFLAGS) $(OPT) $(DEBUG) $(WARN) $(MAKE_DEPS) $(call copyprotect_cflags,$(COPYPROTECT))
 
-$(MODULE_NAME).so: $(MODULE_OBJS) $(MODULE_SDK_LIB) $(MODULE_SDK_OBJS) $(LIBCP)
-	$(LD) -m $(FLAVOR_LDEMUL) -r -o $(MODULE_NAME)_complete.o $^ $(STATIC) $(LDFLAGS) $(LIBS)
-	$(CC) $(FLAVOR_MODE) $(DEBUG) $(SOLINK) -o $@ $(MODULE_NAME)_complete.o $(WHOLE_OPT) $(OPT)
+$(MODULE_NAME).so $(MODULE_EXTRA_LIBRARIES):
+	@if [ -n "$(call copyprotect_objs,$(COPYPROTECT))" ] ; then $(MAKE) -C libcp OPT="$(OPT)" DEBUG="$(DEBUG)" ; fi
+	$(CC) $(DEBUG) $(SOLINK) -o $@ $^ $(call copyprotect_objs,$(COPYPROTECT)) $(WHOLE_OPT) $(OPT) $(LDFLAGS) $(LIBS) $(call copyprotect_libs,$(COPYPROTECT))
+
+$(MODULE_NAME).so: $(MODULE_OBJS) $(MODULE_SDK_LIB) $(MODULE_SDK_OBJS)
 
 clean::
 	rm -f *.o *.so $(MODULE_SDK_OBJS) $(MODULE_SDK_LIB)
 
 distclean:: clean
-	rm -f *.tar.gz
 	if [ -d libcp ] ; then $(MAKE) -C libcp clean ; fi
-	$(MAKE) -C asterisk distclean
 	rm -f optarch.h version.h
 
-install: all
+superclean:: distclean
+	$(MAKE) -C asterisk distclean
+	if [ -d libcp ] ; then $(MAKE) -C libcp clean ; fi
+	rm -f optarch.h version.h
+
+install:: all
 	$(INSTALL) -m 755 $(MODULE_NAME).so $(ASTLIBDIR)/modules/$(MODULE_NAME).so
 
 # ---------------------
 # targets for building CPU-flavor binaries
+TGTDIR=$(MODULE_NAME)-$(PRODUCT_VERSION)-$(FLAVOR_ARCH)
 
-flavors: DEBUG=-g0
-flavors: repotools/build_tools/make_cpu_flavors $(LIBCP)
-	@repotools/build_tools/make_cpu_flavors module DEBUG="$(DEBUG)"
-
-flavor-module-clean:
-	@rm -f $(MODULE_NAME).so
-
-flavor-module: TGTDIR=$(MODULE_NAME)-$(PRODUCT_VERSION)-$(FLAVOR_ARCH)
-flavor-module: $(MODULE_NAME).so
-	@$(STRIP) $(MODULE_NAME).so
+$(TGTDIR).tar.gz:: $(MODULE_NAME).so $(MODULE_EXTRA_LIBRARIES)
+	@if [ "$(NOSTRIP)" != "1" ] ; then $(STRIP) $^ ; fi
+	@-rm -rf $(TGTDIR)
 	@mkdir $(TGTDIR)
-	@mv $(MODULE_NAME).so $(TGTDIR)
+	@mv $^ $(TGTDIR)
 	@cp LICENSE $(TGTDIR)
+	@if [ -f README ] ; then cp README $(TGTDIR) ; fi
+	@if [ -f CHANGES ] ; then cp CHANGES $(TGTDIR) ; fi
+	@if [ -f UPGRADE.txt ] ; then cp UPGRADE.txt $(TGTDIR) ; fi
 	@$(TAR) --create --owner 0 --group 0 --file $(TGTDIR).tar.gz --gzip $(TGTDIR)
 	@rm -rf $(TGTDIR)
 	@echo Build for $(FLAVOR_ARCH) complete.
+
+
+tarball: $(TGTDIR).tar.gz
+
+tarballs:
+	$(MAKE) ARCH=x86_64 tarball
+	$(MAKE) ARCH=i686 tarball
 
 # ---------------------
 
@@ -160,9 +145,4 @@
 .PHONY: buildver
 .PHONY: clean
 .PHONY: install
-.PHONY: flavors
-.PHONY: flavor-module-clean
-.PHONY: flavor-module
-	
-
-
+.PHONY: tarball
diff --git a/build_tools/buildfuncs b/build_tools/buildfuncs
index 8cf7ad5..43f7472 100755
--- a/build_tools/buildfuncs
+++ b/build_tools/buildfuncs
@@ -60,353 +60,3 @@
 	fi
 
 }
-
-# Obtain, build and install a specified version of Asterisk, or the baseline version
-# for that release series
-build_asterisk() {
-    # args are:
-    #
-    # $1: Asterisk version to build
-    # $2: if non-empty, build exact version, not baseline
-    BEBRANCH=be/branches
-    BETAG=be/tags
-
-    case ${2}${1} in
-	(1.2)
-	ASTPATH=1.2.33
-	;;
-	(1.4)
-	ASTPATH=1.4.25
-	;;
-	(1.6.2.0)
-	ASTPATH=1.6.2.8-rc1
-	;;
-	(1.8.0)
-	ASTPATH=1.8.2.3
-	;;
-	(1.8.2)
-	ASTPATH=1.8.2-rc1
-	;;
-	(1.8.4)
-	ASTPATH=1.8.4
-	;;
-	(digiumphones1.8.11)
-	ASTPATH=certified/branches/1.8.11
-	;;
-	(digiumphones10.0)
-	ASTPATH=10-digiumphones
-	;;
-	(10.*)
-	ASTPATH=10
-	;;
-	(digiumphones11.*)
-	ASTPATH=11
-	;;
-	(digiumphones12.*)
-	ASTPATH=12
-	;;
-	(digiumphones13.*)
-	ASTPATH=13
-	;;
-	(digiumphones14.*)
-	ASTPATH=14
-	;;
-	(11.*)
-	ASTPATH=11
-	;;
-	(12.*)
-	ASTPATH=12
-	;;
-	(13.*)
-	ASTPATH=13
-	;;
-	(14.*)
-	ASTPATH=14
-	;;
-	(1.6.[1-9])
-	ASTPATH=${1}.0
-	;;
-	(1.6.[1-9][0-9])
-	ASTPATH=${1}.0
-	;;
-	(C.3)
-	ASTPATH=${BEBRANCH}/C.3
-	;;
-	(*)
-	ASTPATH=${1}
-	;;
-    esac
-
-    echo "Building Asterisk version ${ASTPATH}..."
-
-    git clone -b ${ASTPATH} git://git.asterisk.org/asterisk/asterisk.git asterisk
-    cd asterisk
-    if [[ ${ASTPATH} == ${OSTAG}/1.2.* ]];
-    then
-	apt-get update
-	apt-get install --yes libssl-dev
-	make
-	make install
-	cp include/asterisk.h /usr/include
-	apt-get remove --purge --yes libssl-dev
-    else
-	./configure --disable-xmldoc --libdir=$LIBDIR
-	# ensure that the built modules don't use GCC atomic operations
-	sed -i -e /GCC_ATOMICS/d include/asterisk/autoconfig.h
-	make MOD_SUBDIRS=main OTHER_SUBDIRS=
-	make MOD_SUBDIRS=main OTHER_SUBDIRS= install
-    fi
-    cd ..
-	rm -rf asterisk
-}
-
-# Create a directory in Subversion if it does not exist.
-make_staging_dir() {
-    svn ls ${1} &> /dev/null || svn mkdir ${1} -m "create staging directory"
-}
-
-# Ensure that GCC 4.3.0 or higher is in use
-check_gcc43() {
-    cat <<EOF | gcc -E -o /dev/null - || exit 1
-#if (__GNUC__ < 4) || (__GNUC_MINOR__ < 3)
-#error GCC 4.3.x or higher required (gcc).
-#endif
-EOF
-    cat <<EOF | cc -E -o /dev/null - || exit 1
-#if (__GNUC__ < 4) || (__GNUC_MINOR__ < 3)
-#error GCC 4.3.x or higher required (cc).
-#endif
-EOF
-    cat <<EOF | g++ -E -o /dev/null - || exit 1
-#if (__GNUC__ < 4) || (__GNUC_MINOR__ < 3)
-#error GCC 4.3.x or higher required (g++).
-#endif
-EOF
-    cat <<EOF | c++ -E -o /dev/null - || exit 1
-#if (__GNUC__ < 4) || (__GNUC_MINOR__ < 3)
-#error GCC 4.3.x or higher required (c++).
-#endif
-EOF
-}
-
-# Make a release tag from a product with API-numbered branches
-# e.g.: /svn/<project>/<product>/branches/<API version>/<product version>
-make_branch_tag() {
-    FB="${4%.*}"
-    rm -rf tag-tmp
-    NT=${1}/${2}/tags/${3}_${4}
-    # skip it if it exists already
-    svn ls ${NT} 2> /dev/null 1>&2 && exit
-    svn cp ${1}/${2}/branches/${FB}/asterisk-${3} ${NT} -m 'tag for release'
-    svn co ${NT} tag-tmp
-    pushd tag-tmp
-    make .version
-    svn add .version
-    propset_txt .version
-    autotag_externals .
-    svn commit -m 'add version information'
-    popd
-    rm -rf tag-tmp
-}
-
-# Make release tags from a product with API-numbered branches
-# e.g.: /svn/<project>/<product>/branches/<API version>
-make_branch_tags() {
-    FB="${3%.*}"
-    rm -rf tag-tmp
-    for AB in `svn ls ${1}/${2}/branches/${FB} 2> /dev/null`
-    do
-	AB="${AB%/}"
-	AT="${AB#asterisk-}"
-	NT=${1}/${2}/tags/${AT}_${3}
-	# skip it if it exists already
-	svn ls ${NT} 2> /dev/null 1>&2 && continue
-	svn cp ${1}/${2}/branches/${FB}/${AB} ${NT} -m 'tag for release'
-	svn co ${NT} tag-tmp
-	pushd tag-tmp
-	make .version
-	svn add .version
-	propset_txt .version
-	autotag_externals .
-	svn commit -m 'add version information'
-	popd
-	rm -rf tag-tmp
-    done
-}
-
-# Make release tag from a product without API-numbered branches
-# e.g.: /svn/<project>/<product>/trunk
-make_trunk_tag() {
-    svn ls ${1}/${2}/trunk &> /dev/null && for AB in trunk
-    do
-	NT=${1}/${2}/tags/${3}
-	# skip it if it exists already
-	svn ls ${NT} 2> /dev/null 1>&2 && continue
-	svn cp ${1}/${2}/trunk ${NT} -m 'tag for release'
-	svn co ${NT} tag-tmp
-	pushd tag-tmp
-	make .version
-	svn add .version
-	propset_txt .version
-	autotag_externals .
-	svn commit -m 'add version information'
-	popd
-	rm -rf tag-tmp
-    done
-}
-
-# upload release to the appropriate staging directory
-# takes a base filename and base staging directory i.e.
-# <product> https://origsvn.digium.com/svn/sites/downloads.digium.com/stagin/telephony/<product>
-commit_to_staging() {
-	FN=${1}
-	P=${2}
-	make_staging_dir ${P}
-	if [ "${ASTVERSION}" == "1.2" ]; then
-		P=${P}/unsupported
-		make_staging_dir ${P}
-		P=${P}/asterisk-${ASTVERSION}
-		make_staging_dir ${P}
-		P=${P}/Linux
-		make_staging_dir ${P}
-	else
-		P=${P}/asterisk-${ASTVERSION}
-		make_staging_dir ${P}
-	fi
-	case `uname -m` in
-	(x86_64)
-		A=x86-64
-		;;
-	(i686)
-		A=x86-32
-		;;
-	esac
-	P=${P}/${A}
-	make_staging_dir ${P}
-	svn ls ${P} &> /dev/null || svn mkdir ${P} -m "create staging directory"
-	svn co ${P} staging
-	mv ${FN}*.tar.gz staging
-	cd staging
-	svn add ${FN}*.tar.gz
-	cd ..
-	svn commit staging -m "commit ${1} builds to staging"
-	rm -rf staging
-}
-
-#
-# Parse arguments the fax build scripts are expecting.  Can be used for other
-# build scripts wanting the same parameters as well.
-#
-# usage: parse_fax_args "$@"
-#
-# This function parses the following arguments:
-# --help, -h, -?
-# --asterisk <version>
-#
-# --version <product version>
-# --product-version <product version>
-# --product_version <product version>
-# --prodversion <product version>
-#
-# --commit
-# --svn-path
-#
-# --res_fax <res_fax version>
-# --res-fax <res_fax version>
-#
-# Upon successful parsing the following variables may be set:
-#    ASTVERSION:  the asterisk version
-#    PRODVERSION: the product version (will be written to .version in the
-#                 source dir)
-#    RES_FAX:     the res_fax version
-#    SVN_PATH:    set to '1' if --svn-path is passed
-#    COMMIT:      set to '1' if --commit is passed
-#    ARGS:        an array containing any extra positional arguments
-#
-# Positional arguments can be accessed using the ARGS array.
-#
-#    echo we have ${#ARGS[@]} extra arguments
-#
-#    echo ${ARGS[0]} ${ARGS[1]}
-#
-#    for arg in "${ARGS[@]}"
-#    do
-#       echo $arg
-#    done
-#
-# If errors are encountered an error message is printed and the function
-# returns non zero.  Unrecognized arguments are considered as errors.
-# 
-# If --help, -h, or -? are passed then '2' is returned.
-#
-# In order to read non zero return values for scrips started with 'bash -e',
-# you need to use 'set +e' before calling this function:
-#
-#    set +e
-#    parse_fax_args "$@"
-#    RES=$?
-#    set -e
-#
-#
-parse_fax_args()
-{
-	local argument=""
-	ARGS=()
-
-	for arg in "$@"
-	do
-		case "$arg" in
-		# arguments that do not require parameters
-		--commit)
-			COMMIT=1
-		;;
-
-		--svn-path)
-			SVN_PATH=1
-		;;
-
-		--help|-h|-\?)
-			return 2
-		;;
-
-		# additional arguments are params for args or arguments the
-		# need parameters
-		--*)
-			argument="${arg#--}"
-		;;
-
-		*)
-			case "$argument" in
-			asterisk)
-				ASTVERSION="$arg"
-			;;
-
-			version|product_version|product-version|prodversion)
-				PRODVERSION="$arg"
-			;;
-
-			res_fax|res-fax)
-				RES_FAX="$arg"
-			;;
-
-			"")
-				ARGS=("${ARGS[@]}" "$arg")
-			;;
-
-			*)
-				echo "error: unknown argument '--$argument'"
-				return 1
-			;;
-			esac
-			argument=""
-		;;
-		esac
-	done
-
-	if [ -n "$argument" ]
-	then
-		echo "error: unknown argument '--$argument'"
-		return 1
-	fi
-}
-
diff --git a/build_tools/commit_to_staging b/build_tools/commit_to_staging
new file mode 100755
index 0000000..a2c4528
--- /dev/null
+++ b/build_tools/commit_to_staging
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+. repotools/build_tools/buildfuncs
+
+make_staging_dir() {
+    svn ls ${1} &> /dev/null || svn mkdir --parents ${1} -m "create staging directory"
+}
+
+c2s() {
+	FN=${1}
+	VERSION=${2}
+	ASTVERSION=`extract_astversion ${2}`
+	ARCH=${3}
+	P=${4}
+	make_staging_dir ${P}
+	if [ "${ASTVERSION}" == "1.2" ]; then
+		P=${P}/unsupported
+		make_staging_dir ${P}
+		P=${P}/asterisk-${ASTVERSION}
+		make_staging_dir ${P}
+		P=${P}/Linux
+		make_staging_dir ${P}
+	else
+		P=${P}/asterisk-${ASTVERSION}
+		make_staging_dir ${P}
+	fi
+	case $ARCH in
+	(x86_64)
+		A=x86-64
+		;;
+	(x86_32)
+		A=x86-32
+		;;
+	esac
+	P=${P}/${A}
+	make_staging_dir ${P}
+	svn ls ${P} &> /dev/null || svn mkdir --parents ${P} -m "create staging directory"
+	svn co ${P} staging
+	cp ${FN}-${VERSION}-${ARCH}.tar.gz staging
+	cp ${FN}-${VERSION}-${ARCH}.tar.gz staging/${FN}-current-${ARCH}.tar.gz
+	if [ -f README ] ; then cp README staging/ ; fi
+	if [ -f LICENSE ] ; then cp LICENSE staging/ ; fi
+	cd staging
+	svn add ${FN}-${VERSION}-${ARCH}.tar.gz
+	svn add ${FN}-current-${ARCH}.tar.gz
+	if [ -f README ] ; then svn add README ; fi
+	if [ -f LICENSE ] ; then svn add LICENSE ; fi
+	cd ..
+	svn commit staging -m "commit ${1} builds to staging"
+	rm -rf staging
+}
+
+if [ -z "$1" ] ; then
+	echo "You must supply a staging repository".
+	echo "Example: ${0} https://origsvn.digium.com/svn/sites/downloads.digium.com/staging/telephony/<product>"
+	exit 1
+fi
+
+if [ -n "$(git status --porcelain)" ]; then 
+	echo "The working directory has uncommitted changes."
+	exit 1
+fi
+
+version=`git describe --tags`
+if [ $? -ne 0 ] ; then
+	echo "There isn't a valid tag for the current branch"
+	exit 1
+fi
+
+if [ "${version#*-}" != "$version" ] ; then
+	echo "The latest HEAD doesn't have a tag directly associated with it."
+	echo "The closest found was $version"
+	exit 1
+fi
+
+product=`basename ${PWD}`
+
+if [ -f $product-$version-x86_32.tar.gz ] ; then
+	c2s $product $version x86_32 $1
+fi
+if [ -f $product-$version-x86_64.tar.gz ] ; then
+	c2s $product $version x86_64 $1
+fi
diff --git a/build_tools/make_cpu_flavors b/build_tools/make_cpu_flavors
deleted file mode 100755
index 22a2e84..0000000
--- a/build_tools/make_cpu_flavors
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/bash -e
-
-cat <<EOF | gcc -E -o /dev/null - || exit 1
-#if (__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 3))
-#error GCC 4.3.x or higher required.
-#endif
-EOF
-
-TARGETS_32BIT_X86="generic i686 pentium3m pentium-m pentium4m prescott nocona core2 k6-3 athlon athlon-xp opteron opteron-sse3 barcelona c3 c3-2"
-TARGETS_64BIT_X86="generic nocona core2 opteron opteron-sse3 barcelona"
-TARGETS_32BIT_SPARC="sparcv7 sparcv8 sparcv9"
-TARGETS_64BIT_SPARC="sparcv9 ultrasparc ultrasparc3 niagara niagara2"
-
-SSE_FLAGS="-msse -mfpmath=sse"
-SSE2_FLAGS="-msse2 -mfpmath=sse"
-SSE3_FLAGS="-msse3 -mfpmath=sse"
-
-ARCHMODE_32BIT_X86="-m32"
-ARCHMODE_64BIT_X86="-m64 -fPIC"
-ARCHMODE_32BIT_SPARC="-m32"
-ARCHMODE_64BIT_SPARC="-m64"
-
-LDEMULATION_32BIT_X86="elf_i386"
-LDEMULATION_64BIT_X86="elf_x86_64"
-LDEMULATION_32BIT_SPARC="unknown"
-LDEMULATION_64BIT_SPARC="unknown"
-
-CPUFEATURES_athlon_xp="SSE"
-CPUFEATURES_barcelona="SSE3"
-CPUFEATURES_c3_2="SSE"
-CPUFEATURES_core2="SSE3"
-CPUFEATURES_nocona="SSE3"
-CPUFEATURES_opteron="SSE2"
-CPUFEATURES_opteron_sse3="SSE3"
-CPUFEATURES_pentium3m="SSE"
-CPUFEATURES_pentium4m="SSE2"
-CPUFEATURES_pentium_m="SSE2"
-CPUFEATURES_prescott="SSE3"
-
-GCC_CPU_OPT_X86="-march"
-GCC_CPU_OPT_SPARC="-mcpu"
-
-echo ${MAKE:=make} ${TAR:=tar} ${ARCH:=`uname -m`} ${OS:=`uname -s`} > /dev/null
-
-BUILD_TARGET="$1"
-shift 1
-
-case "$OS" in
-    Linux)
-	OSDIR=linux
-	;;
-    FreeBSD)
-	OSDIR=freebsd
-	MAKE=gmake
-	TAR=gtar
-	;;
-    SunOS)
-	OSDIR=solaris
-	MAKE=gmake
-	TAR=gtar
-	;;
-    *)
-	exit 0
-	;;
-esac
-
-case "$ARCH" in
-    i386 | i686)
-	BITS="32"
-	ARCH="X86"
-	;;
-    x86_64 | amd64)
-	BITS="64"
-	ARCH="X86"
-	;;
-    X86)
-	# nothing to do, the user has specified the ARCH and BITS values
-	;;
-    sun4c | sun4d | sun4m | sun4u)
-	#sun4u can be compiled 64 bit.  Run with ./makeall 64
-	ARCH="SPARC"
-	if [ ! -z "$1" -a "$1" == "64" ]; then
-	    echo "This will only work if you compiled libcp as 64 bit."
-	    BITS="64"
-	else
-	    BITS="32"
-	fi
-	;;
-    *)
-	echo "Unknown architecture found (${ARCH}); aborting."
-	exit 0
-	;;
-esac
-
-MAKE="${MAKE} --no-print-directory"
-
-for bits in ${BITS}
-do
-    arch_mode=$(eval echo \$\{ARCHMODE_${bits}BIT_${ARCH}\})
-    ld_emulation=$(eval echo \$\{LDEMULATION_${bits}BIT_${ARCH}\})
-    if [ "${OS}" = "FreeBSD" ]; then
-        ld_emulation="${ld_emulation}_fbsd"
-    fi
-    default_cpu_opt=$(eval echo \$\{GCC_CPU_OPT_${ARCH}\})
-
-    TARGETS=$(eval echo \$\{TARGETS_${bits}BIT_${ARCH}\})
-
-    for target in ${TARGETS}
-    do
-	target_sym="${target/-/_}"
-	${MAKE} flavor-${BUILD_TARGET}-clean FLAVOR_TARGET="${target}" FLAVOR_ARCH="${target_sym}_${bits}"
-	cpu_features=$(eval echo \$\{CPUFEATURES_${target_sym}\})
-	feature_flags=""
-	for feature in ${cpu_features}
-	do
-	    feature_flags="${feature_flags}$(eval echo \$\{${feature}_FLAGS\})"
-	done
-	if [ "${ARCH}" = "X86" -a "${target}" = "generic" ]; then
-	    cpu_opt="-mtune"
-	else
-	    cpu_opt="${default_cpu_opt}"
-	fi
-	${MAKE} flavor-${BUILD_TARGET} ${@} FLAVOR_TARGET="${target}" FLAVOR_ARCH="${target_sym}_${bits}" FLAVOR_OPT="-O4 ${cpu_opt}=${target} ${feature_flags}" FLAVOR_MODE="${arch_mode}" FLAVOR_LDEMUL="${ld_emulation}" FLAVOR_ARCH_BITS="${ARCH}_${bits}"
-    done
-done
diff --git a/build_tools/make_product b/build_tools/make_product
index 3870af3..50bb2c9 100755
--- a/build_tools/make_product
+++ b/build_tools/make_product
@@ -65,9 +65,7 @@
 
 echo "Building $product version $TAG..."
 
-make PRODUCT_VERSION=$TAG flavors
-
-exit 0
+make PRODUCT_VERSION=$TAG tarballs
 
 if [ $commit_to_staging -eq 1 ]; then
 	commit_to_staging $product https://origsvn.digium.com/svn/sites/downloads.digium.com/staging/telephony/$product
diff --git a/build_tools/make_tag b/build_tools/make_tag
deleted file mode 100755
index f96c8a5..0000000
--- a/build_tools/make_tag
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash -e
-
-# args
-#
-# $1: module to tag
-# $2: version to tag (1.4, 1.6.2.0, 1.8.0, ...)
-# $3: tag to make
-
-. commbuild/buildfuncs
-
-R=https://origsvn.digium.com/svn/codecs
-
-case ${1} in
-(codec_g729a | codec_siren7 | codec_siren14 | codec_silk)
-	make_branch_tag ${R} ${1} ${2} ${3}
-	;;
-(*)
-	echo "Unknown module ${1}."
-	exit 1
-	;;
-esac
diff --git a/build_tools/make_tags b/build_tools/make_tags
deleted file mode 100755
index cfc4f04..0000000
--- a/build_tools/make_tags
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash -e
-
-# args
-#
-# $1: module to tag
-# $2: tag to make
-
-. commbuild/buildfuncs
-
-R=https://origsvn.digium.com/svn/codecs
-
-case ${1} in
-(benchg729 | benchsiren7 | benchsiren14 | benchsilk)
-	make_trunk_tag ${R} ${1} ${2}
-	;;
-(codec_g729a | codec_siren7 | codec_siren14 | codec_silk)
-	make_branch_tags ${R} ${1} ${2}
-	;;
-(*)
-	echo "Unknown module ${1}."
-	exit 1
-	;;
-esac

-- 
To view, visit https://gerrit.asterisk.org/3352
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc9ebba53d2dbb2ae31bb30288c2158e9b73039e
Gerrit-PatchSet: 2
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list