[Sofaswitch-svn] [commit] r398 - sofaswitch/trunk/sofa
Author: derek Date: Sun Mar 30 17:37:41 2008 New Revision: 398 Added: sofaswitch/trunk/sofa/Makefile.in sofaswitch/trunk/sofa/configure.ac sofaswitch/trunk/sofa/install-sh (contents, props changed) sofaswitch/trunk/sofa/sofa_inc.mak.in Log: Add these files, and get them to build the library correctly Added: sofaswitch/trunk/sofa/Makefile.in ============================================================================== --- (empty file) +++ sofaswitch/trunk/sofa/Makefile.in Sun Mar 30 17:37:41 2008 @@ -0,0 +1,135 @@ +# +# Makefile +# +# Make file for SofaSwitch +# +# Copyright (c) 2001 Equivalence Pty. Ltd. +# +# The contents of this file are subject to the Mozilla Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# The Original Code is Open Phone Abstraction Library. +# +# The Initial Developer of the Original Code is Equivalence Pty. Ltd. +# +# Contributor(s): ______________________________________. +# +# $Revision: 19747 $ +# $Author: rjongbloed $ +# $Date: 2008-03-14 16:19:22 +1300 (Fri, 14 Mar 2008) $ +# + +export SOFADIR=@SOFADIR@ + +INSTALL=@INSTALL@ +OS_NAME=$(shell uname -s) +ifeq ($(OS_NAME),SunOS) + override SHELL=/usr/bin/bash +endif + +default :: optshared + +all :: bothdepend both + +update: + svn update + $(MAKE) all + + +SUBDIRS := + +LIBRARY_MAKEFILE:=1 + +include $(SOFADIR)/sofa_inc.mak + +PREFIX=@INSTALLPREFIX@/ +exec_prefix = ${PREFIX} + +ifndef PREFIX +PREFIX=/usr/local +endif + +ifeq ($(USE_GCC),yes) +ANSI_FLAG = -ansi +endif + +SOFA_OBJDIR = $(SOFA_LIBDIR)/$(PT_OBJBASE) + +OBJDIR = $(SOFA_OBJDIR) +LIBDIR = $(SOFA_LIBDIR) +TARGET = $(SOFA_LIBDIR)/$(SOFA_FILE) + +STDCCFLAGS += @STDCCFLAGS@ + +ifdef NOTRACE +STDCCFLAGS += -DPASN_NOPRINTON +else +STDCCFLAGS += -DPTRACING +endif + +VPATH_CXX := $(SOFA_SRCDIR) + + +######################################## +# Source files for library + +SOURCES := $(SOFA_SRCDIR)/messages.cxx \ + $(SOFA_SRCDIR)/messlist.cxx + +# +# Files to be cleaned during make clean +# + +CLEAN_FILES = $(SOFA_LIB) + + +#################################################### + +include @PTLIBDIR@/make/common.mak + +LIB_FILENAME=$(SOFA_FILE) +SYSLIBS += -L$(PT_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE) + +include @PTLIBDIR@/make/lib.mak + + +#################################################### + +notrace:: + $(MAKE) NOTRACE=1 opt + + +############################################################################### +#### Subdirectories +$(subst tagbuild,,$(STANDARD_TARGETS)) :: + @set -e; $(foreach dir,$(SUBDIRS),if test -e $(dir) ; then $(MAKE) -C $(dir) $@; fi ;) + + +$(STANDARD_TARGETS) :: Makefile + +Makefile: Makefile.in configure + @echo + @echo "*******************************************************" + @echo Makefile is not up to date, is a ./configure necessary? + @echo "*******************************************************" + @false + + +#### Install targets +install :: + mkdir -p $(DESTDIR)@LIBDIR@ + +docs: FORCE + doxygen sofa_cfg.dxy + +FORCE: + + +# End of file ################################################################# Added: sofaswitch/trunk/sofa/configure.ac ============================================================================== --- (empty file) +++ sofaswitch/trunk/sofa/configure.ac Sun Mar 30 17:37:41 2008 @@ -0,0 +1,160 @@ +dnl ######################################################################## +dnl OPAL configuration +dnl +dnl $Revision: 19674 $ +dnl $Author: dsandras $ +dnl $Date: 2008-03-06 09:37:40 +1300 (Thu, 06 Mar 2008) $ +dnl + +AC_INIT() + +AC_PROG_CC +AC_PROG_CXX +dnl this must be updated for every minor revision, and for +dnl builds when and as necessary +REQUIRED_PTLIB_MAJOR=2 +REQUIRED_PTLIB_MINOR=0 +REQUIRED_PTLIB_BUILD=0 + +dnl ######################################################################## +dnl set the SOFA directory to the current directory + +SOFADIR=`pwd` +AC_SUBST(SOFADIR) + +dnl ######################################################################## +dnl set the PREFIX accordingly +if test "x$prefix" = "xNONE"; then + INSTALLPREFIX="/usr/local" +else + INSTALLPREFIX="${prefix}" +fi + +AC_SUBST(INSTALLPREFIX) + +dnl ######################################################################## +dnl set LIBDIR accordingly +LIBDIR="${libdir}" + +AC_SUBST(LIBDIR) + +dnl ######################################################################## +dnl extract the SOFA version + +dnl MSWIN_DISPLAY version,Version +dnl MSWIN_VERSION version,SOFA_MAJOR=MAJOR_VERSION +dnl MSWIN_VERSION version,SOFA_MINOR=MINOR_VERSION +dnl MSWIN_VERSION version,SOFA_BUILD=BUILD_NUMBER +dnl MSWIN_VERSION version,SOFA_VERSION=VERSION + +MAJOR_VERSION=`cat ${SOFADIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '` +MINOR_VERSION=`cat ${SOFADIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '` +BUILD_NUMBER=`cat ${SOFADIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '` +SOFA_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}" +BUILD_TYPE=`cat ${SOFADIR}/version.h | grep BUILD_TYPE | cut -f 3 -d ' ' | sed 's/BetaCode/-beta/' | sed 's/AlphaCode/-alpha/' | sed 's/ReleaseCode/\./'` + +AC_DEFINE_UNQUOTED(SOFA_MAJOR, ${MAJOR_VERSION}) +AC_DEFINE_UNQUOTED(SOFA_MINOR, ${MINOR_VERSION}) +AC_DEFINE_UNQUOTED(SOFA_BUILD, ${BUILD_NUMBER}) +AC_DEFINE_UNQUOTED(SOFA_VERSION, "$SOFA_VERSION") + +AC_MSG_NOTICE(Sofa version is ${SOFA_VERSION}); + +#use to set the version in sofa.pc +AC_SUBST(SOFA_VERSION) +AC_SUBST(BUILD_TYPE) + +dnl ######################################################################## +dnl look for ptlib, use a preference order of explicit PTLIBDIR, directory +dnl at same level, home directory, /usr/local or /usr. + +if test "${PTLIBDIR:-unset}" = "unset" -a "${PWLIBDIR:-unset}" != "unset" ; then + PTLIBDIR=$PWLIBDIR +fi +if test "${PTLIBDIR:-unset}" = "unset" -o ! -r "${PTLIBDIR}/version.h"; then + if test -r "/home/derek/opalvoip/ptlib/include/ptlib.h"; then + AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /home/derek/opalvoip/ptlib/make) + elif test -r "${PTLIBDIR}/include/ptlib.h"; then + AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${PTLIBDIR}/bin) + elif test -r "${SOFADIR}/../ptlib/version.h"; then + PTLIBDIR="${SOFADIR}/../ptlib" + elif test -r "${HOME}/ptlib/include/ptlib.h"; then + PTLIBDIR="${HOME}/ptlib" + elif test -r /usr/local/include/ptlib.h; then + AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin) + elif test -r /usr/include/ptlib.h; then + AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/ptlib/make/) + elif test -r "${prefix}/include/ptlib.h"; then + AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , ${prefix}/bin) + else + AC_MSG_ERROR("Cannot find PTLib - please install or set PTLIBDIR and try again") + fi +fi + +if test "${PTLIBDIR:-unset}" = "unset" ; then + if test "${PTLIB_CONFIG:-unset}" = "unset" ; then + AC_MSG_ERROR("Cannot find ptlib-config - please install and try again") + fi + PTLIBDIR=`$PTLIB_CONFIG --prefix` +fi + +if test -d "${PTLIBDIR}/share/ptlib/"; then + PTLIBDIR="${PTLIBDIR}/share/ptlib/" +fi +AC_SUBST(PTLIBDIR) + +echo "PTLib prefix set to.... $PTLIBDIR" + +if test "${PTLIBDIR:-unset}" = "unset" ; then + PWVERSION=`$PTLIB_CONFIG --version` + PW_MAJOR_VERSION=`echo $PW_VERSION | cut -d'.' -f1` + PW_MINOR_VERSION=`echo $PW_VERSION | cut -d'.' -f2` + PW_BUILD_NUMBER=`echo $PW_VERSION | cut -d'.' -f3` + +else + PW_MAJOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '` + PW_MINOR_VERSION=`cat ${PTLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '` + PW_BUILD_NUMBER=`cat ${PTLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '` + PWVERSION="${PW_MAJOR_VERSION}.${PW_MINOR_VERSION}.${PW_BUILD_NUMBER}" +fi + + +dnl ######################################################################## +dnl get the gcc version + +if test x$GXX = xyes ; then + USE_GCC=yes + gcc_version=`$CXX -dumpversion` + AC_MSG_NOTICE(gcc version is $gcc_version); + GXX_MAJOR=`echo $gcc_version | sed 's/\..*$//'` + GXX_MINOR=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.//' -e 's/\..*$//'`] + GXX_PATCH=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.//' -e 's/\..*$//'`] + + dnl cannot compile for less than gcc 3 + AC_MSG_CHECKING(checking if gcc version is valid) + if test ${GXX_MAJOR} -lt 3 ; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([SOFA requires gcc version 3 or later]) + else + AC_MSG_RESULT(yes) + fi +fi + + + +dnl ######################################################################## +dnl output make directives + +AC_SUBST(STDCCFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(ENDLDLIBS) +AC_PROG_INSTALL + + +dnl ######################################################################## +dnl output header file + +AC_CONFIG_FILES(sofa_inc.mak) +AC_CONFIG_FILES(Makefile) + +AC_OUTPUT() Added: sofaswitch/trunk/sofa/install-sh ============================================================================== --- (empty file) +++ sofaswitch/trunk/sofa/install-sh Sun Mar 30 17:37:41 2008 @@ -0,0 +1,295 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2003-09-24.23 + +# 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= + +usage="Usage: $0 [OPTION]... SRCFILE DSTFILE + or: $0 -d DIR1 DIR2... + +In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. +In the second, create the directory path DIR. + +Options: +-b=TRANSFORMBASENAME +-c copy source (using $cpprog) instead of moving (using $mvprog). +-d create directories instead of installing files. +-g GROUP $chgrp installed files to GROUP. +-m MODE $chmod installed files to MODE. +-o USER $chown installed files to USER. +-s strip installed files (using $stripprog). +-t=TRANSFORM +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit 0;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + --version) echo "$0 $scriptversion"; exit 0;; + + *) if test -z "$src"; then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if test -z "$src"; then + echo "$0: no input file specified." >&2 + exit 1 +fi + +# Protect names starting with `-'. +case $src in + -*) src=./$src ;; +esac + +if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + instcmd=: + chmodcmd= + else + instcmd=$mkdirprog + 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 test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + dst=$dst/`basename "$src"` + fi +fi + +# This sed command emulates the dirname command. +dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. + +# Skip lots of stat calls in the usual case. +if test ! -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 test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + test -d "$pathcomp" || $mkdirprog "$pathcomp" + pathcomp=$pathcomp/ + done +fi + +if test -n "$dir_arg"; then + $doit $instcmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + +else + # If we're going to rename the final executable, determine the name now. + if test -z "$transformarg"; then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename \ + | sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename. + test -z "$dstfile" && dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Move or copy the file name to the temp name + $doit $instcmd "$src" "$dsttmp" && + + # 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. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now remove or move aside any old file at destination location. We + # try this two ways since rm can't unlink itself on some systems and + # the destination file might be busy for other reasons. In this case, + # the final cleanup might fail but the new file should still install + # successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" +fi && + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Added: sofaswitch/trunk/sofa/sofa_inc.mak.in ============================================================================== --- (empty file) +++ sofaswitch/trunk/sofa/sofa_inc.mak.in Sun Mar 30 17:37:41 2008 @@ -0,0 +1,86 @@ +# +# sofa_inc.mak +# +# Make symbols include file for Open Phone Abstraction library +# +# Copyright (c) 2001 Equivalence Pty. Ltd. +# +# The contents of this file are subject to the Mozilla Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# The Original Code is Open Phone Abstraction library. +# +# The Initial Developer of the Original Code is Equivalence Pty. Ltd. +# +# Contributor(s): ______________________________________. +# +# $Revision: 19674 $ +# $Author: dsandras $ +# $Date: 2008-03-06 09:37:40 +1300 (Thu, 06 Mar 2008) $ +# + +SOFADIR=@SOFADIR@ +PTLIBDIR=@PTLIBDIR@ + +LIBDIRS += $(SOFADIR) + +ifdef LIBRARY_MAKEFILE +include $(PTLIBDIR)/make/unix.mak +else +ifdef NOTRACE +OBJDIR_SUFFIX := n +endif +include $(PTLIBDIR)/make/ptlib.mak +endif + +SOFA_SRCDIR = $(SOFADIR)/src +SOFA_INCDIR = $(SOFADIR)/include +SOFA_LIBDIR = $(SOFADIR)/lib + + +ifdef NOTRACE +STDCCFLAGS += -DPASN_NOPRINTON -DPASN_LEANANDMEAN +SOFA_SUFFIX = n +else +STDCCFLAGS += -DPTRACING +RCFLAGS += -DPTRACING +SOFA_SUFFIX = $(OBJ_SUFFIX) +endif + + +SOFA_BASE = sofa_$(PLATFORM_TYPE)_$(SOFA_SUFFIX) +SOFA_FILE = lib$(SOFA_BASE)$(LIB_TYPE).$(LIB_SUFFIX) + +LDFLAGS += -L$(SOFA_LIBDIR) +LDLIBS := -l$(SOFA_BASE)$(LIB_TYPE) $(LDLIBS) + +STDCCFLAGS += -I$(SOFA_INCDIR) + +$(TARGET) : $(SOFA_LIBDIR)/$(SOFA_FILE) + +ifndef LIBRARY_MAKEFILE + +ifdef DEBUG +$(SOFA_LIBDIR)/$(SOFA_FILE): + echo "make " $(SOFADIR) " and debug" + $(MAKE) -C $(SOFADIR) debug +else +$(SOFA_LIBDIR)/$(SOFA_FILE): + echo "make " $(SOFADIR) " and opt" + $(MAKE) -C $(SOFADIR) opt +endif + +libs :: $(SOFA_LIBDIR)/$(SOFA_FILE) + +endif + + +# End of file +
participants (1)
-
SofaSWITCH SVN