git-svn-id: http://svn.freeswitch.org/svn/local/src/freeswitch@11 d0543943-73ff-0310-b7d9-9358b9ac24b2v1.2.stable
parent
138e8039bf
commit
4da77ea5c5
@ -0,0 +1,20 @@ |
||||
|
||||
SQLITE (> make sqlite) |
||||
It will download and build and install sqlite |
||||
|
||||
APR (> make apr) |
||||
it will and download and build and install apr if needed but remember to make sure |
||||
/usr/local/apr/lib is in the LD_LIBRARY_PATH that's up to you |
||||
|
||||
|
||||
cp modules.conf.in modules.conf and edit to taste |
||||
|
||||
if you want sip: |
||||
make sure mod_exosip is uncommeted in modules.conf |
||||
make common |
||||
make exosip |
||||
|
||||
|
||||
make; make install |
||||
|
||||
|
@ -0,0 +1,93 @@ |
||||
EXTRA_DIST =
|
||||
SUBDIRS =
|
||||
AUTOMAKE_OPTS = gnu
|
||||
MAKE=gmake
|
||||
NAME=freeswitch
|
||||
PREFIX=$(prefix)/${NAME}
|
||||
APR_CONFIG=$(prefix)/bin/apr-1-config
|
||||
AM_CFLAGS = $(shell $(APR_CONFIG) --cflags --cppflags --includes)
|
||||
AM_LDFLAGS = $(shell $(APR_CONFIG) --link-ld --libs ) -Wl,-E -L$(PREFIX)/lib
|
||||
AM_CFLAGS += -fPIC -Wall
|
||||
AM_CFLAGS +=-I$(PWD) -I$(PWD)/include -I$(PREFIX)/include
|
||||
AM_CFLAGS += -DSWITCH_MOD_DIR=\"$(PREFIX)/mod\"
|
||||
AM_CFLAGS += -DSWITCH_PREFIX_DIR=\"$(PREFIX)\"
|
||||
AM_CFLAGS += -DSWITCH_CONF_DIR=\"$(PREFIX)/conf\"
|
||||
|
||||
libfreeswitch_la_SOURCES = \
|
||||
src/include/switch.h \ |
||||
src/include/switch_channel.h \ |
||||
src/include/switch_config.h \ |
||||
src/include/switch_console.h \ |
||||
src/include/switch_core.h \ |
||||
src/include/switch_frame.h \ |
||||
src/include/switch_loadable_module.h \ |
||||
src/include/switch_module_interfaces.h \ |
||||
src/include/switch_mutex.h \ |
||||
src/include/switch_types.h \ |
||||
src/include/switch_utils.h \ |
||||
src/include/switch_caller.h \ |
||||
src/include/switch_buffer.h \ |
||||
src/switch_buffer.c \ |
||||
src/switch_caller.c \ |
||||
src/switch_channel.c \ |
||||
src/switch_config.c \ |
||||
src/switch_console.c \ |
||||
src/switch_core.c \ |
||||
src/switch_loadable_module.c \ |
||||
src/switch_mutex.c \ |
||||
src/switch_utils.c |
||||
|
||||
#bindir = $(PREFIX)/bin
|
||||
#libdir = $(PREFIX)/lib
|
||||
library_includedir = $(PREFIX)/include
|
||||
library_include_HEADERS = src/include/switch.h \
|
||||
src/include/switch_channel.h \
|
||||
src/include/switch_config.h \
|
||||
src/include/switch_console.h \
|
||||
src/include/switch_core.h \
|
||||
src/include/switch_frame.h \
|
||||
src/include/switch_loadable_module.h \
|
||||
src/include/switch_module_interfaces.h \
|
||||
src/include/switch_mutex.h \
|
||||
src/include/switch_types.h \
|
||||
src/include/switch_utils.h \
|
||||
src/include/switch_caller.h \
|
||||
src/include/switch_buffer.h
|
||||
|
||||
lib_LTLIBRARIES = libfreeswitch.la
|
||||
libfreeswitch_la_CFLAGS = $(AM_CFLAGS) -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g
|
||||
libfreeswitch_la_LDFLAGS = -version-info 1:0:0
|
||||
|
||||
bin_PROGRAMS = freeswitch
|
||||
freeswitch_SOURCES = src/switch.c
|
||||
freeswitch_CFLAGS = $(AM_CFLAGS)
|
||||
freeswitch_LDFLAGS = -static -lfreeswitch
|
||||
|
||||
modules: $(NAME) |
||||
@echo making modules
|
||||
@cd src/mod && for i in $(shell cat modules.conf | grep -v \#) ; do echo making $$i ; LDFLAGS="$(AM_LDFLAGS) -lfreeswitch" CFLAGS="$(AM_CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i || exit 1; done
|
||||
|
||||
modclean: |
||||
@cd src/mod && for i in [a-z]* ; do echo making clean $$i ; CFLAGS="$(CFLAGS)" CC="$(CC)" MOD="$$i" make -f $(PWD)/generic_mod.mk -C $$i clean || exit 1; done
|
||||
|
||||
|
||||
install_mod: |
||||
@echo Installing $(NAME)
|
||||
@mkdir -p $(PREFIX) $(PREFIX)/conf $(PREFIX)/mod $(PREFIX)/db
|
||||
@/bin/cp -p ./$(NAME) $(PREFIX)/bin
|
||||
@ln -sf $(PREFIX)/bin/$(NAME) /usr/bin
|
||||
@echo Installing Modules
|
||||
@/bin/cp -f src/mod/*/mod_*.so $(PREFIX)/mod >/dev/null 2<&1 || echo No modules to copy.
|
||||
@echo done
|
||||
|
||||
|
||||
eclean: clean |
||||
rm -f `find . -type f -name \*~`
|
||||
rm -f `find . -type f -name \.*~`
|
||||
rm -f `find . -type f -name \#\*`
|
||||
rm -f `find . -type f -name \.\#\*`
|
||||
rm -f `find . -type f -name core\*`
|
||||
rm -f *.tar *.tgz *.gz
|
||||
|
||||
megaclean: eclean modclean |
||||
rm -fr $(SQLITETAR) $(SQLITE) $(APR) $(APRTAR) $(SOX) $(SOXTAR) $(COMMONTAR)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@ |
||||
1. MOD_PLAYBACK: Convert to use APR files, remove all the WIN32 ifdefs for file stuff. |
||||
2. switch.h: Find a good home for the SWITCH_DECLARE stuff for win32 |
||||
3. MOD_WOOMERACHAN: #if 1==0 sectiton, convert to use switch_now instead of gettimeof day |
||||
SWITCH_SLEEP (should I be using switch_sleep or switch_yield where I changed from sleep and usleep) |
||||
4. all // comented headers and code, cleanup\remove after verifying everything works happy on other platforms |
||||
5. if we don't need the timeval stuff let's get rid of it... it doesn't appear to be used. |
||||
6. Decide if we are going to keep the libraries in tree or if we build a system that downloads (and patches if necessary) |
||||
7. Exclude .ilk files from loading as modules (they are built when building debug builds and greatly increase the speed of re-linking the lib on a recompile)... |
||||
it is necessary if we want to be able to debug from the gui. It can be #ifdef WIN32'd if you like. |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,99 @@ |
||||
#! /bin/sh |
||||
|
||||
# Wrapper for compilers which do not understand `-c -o'. |
||||
|
||||
# Copyright 1999, 2000 Free Software Foundation, Inc. |
||||
# Written by Tom Tromey <tromey@cygnus.com>. |
||||
# |
||||
# This program is free software; you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation; either version 2, or (at your option) |
||||
# any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
||||
|
||||
# As a special exception to the GNU General Public License, if you |
||||
# distribute this file as part of a program that contains a |
||||
# configuration script generated by Autoconf, you may include it under |
||||
# the same distribution terms that you use for the rest of that program. |
||||
|
||||
# Usage: |
||||
# compile PROGRAM [ARGS]... |
||||
# `-o FOO.o' is removed from the args passed to the actual compile. |
||||
|
||||
prog=$1 |
||||
shift |
||||
|
||||
ofile= |
||||
cfile= |
||||
args= |
||||
while test $# -gt 0; do |
||||
case "$1" in |
||||
-o) |
||||
# configure might choose to run compile as `compile cc -o foo foo.c'. |
||||
# So we do something ugly here. |
||||
ofile=$2 |
||||
shift |
||||
case "$ofile" in |
||||
*.o | *.obj) |
||||
;; |
||||
*) |
||||
args="$args -o $ofile" |
||||
ofile= |
||||
;; |
||||
esac |
||||
;; |
||||
*.c) |
||||
cfile=$1 |
||||
args="$args $1" |
||||
;; |
||||
*) |
||||
args="$args $1" |
||||
;; |
||||
esac |
||||
shift |
||||
done |
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then |
||||
# If no `-o' option was seen then we might have been invoked from a |
||||
# pattern rule where we don't need one. That is ok -- this is a |
||||
# normal compilation that the losing compiler can handle. If no |
||||
# `.c' file was seen then we are probably linking. That is also |
||||
# ok. |
||||
exec "$prog" $args |
||||
fi |
||||
|
||||
# Name of file we expect compiler to create. |
||||
cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` |
||||
|
||||
# Create the lock directory. |
||||
# Note: use `[/.-]' here to ensure that we don't use the same name |
||||
# that we are using for the .o file. Also, base the name on the expected |
||||
# object file name, since that is what matters with a parallel build. |
||||
lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d |
||||
while true; do |
||||
if mkdir $lockdir > /dev/null 2>&1; then |
||||
break |
||||
fi |
||||
sleep 1 |
||||
done |
||||
# FIXME: race condition here if user kills between mkdir and trap. |
||||
trap "rmdir $lockdir; exit 1" 1 2 15 |
||||
|
||||
# Run the compile. |
||||
"$prog" $args |
||||
status=$? |
||||
|
||||
if test -f "$cofile"; then |
||||
mv "$cofile" "$ofile" |
||||
fi |
||||
|
||||
rmdir $lockdir |
||||
exit $status |
@ -0,0 +1,4 @@ |
||||
[extensions] |
||||
|
||||
1000 => playback /tmp/siriusraw.raw |
||||
888 => bridge woomera/888@10.200.68.194 |
@ -0,0 +1,8 @@ |
||||
[settings] |
||||
span=1 |
||||
dchan=24 |
||||
node=cpe |
||||
switch=ni2 |
||||
debug=1 |
||||
dialplan=demo |
||||
bpf=160 |
@ -0,0 +1,8 @@ |
||||
[settings] |
||||
debug=2 |
||||
|
||||
[profile] |
||||
host=localhost |
||||
port=42420 |
||||
audio_ip=10.200.10.20 |
||||
dialplan=demo |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,155 @@ |
||||
/* config.h.in. Generated from configure.in by autoheader. */ |
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */ |
||||
#undef HAVE_ARPA_INET_H |
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
||||
*/ |
||||
#undef HAVE_DIRENT_H |
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */ |
||||
#undef HAVE_DLFCN_H |
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */ |
||||
#undef HAVE_FCNTL_H |
||||
|
||||
/* Define to 1 if you have the `gethostname' function. */ |
||||
#undef HAVE_GETHOSTNAME |
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */ |
||||
#undef HAVE_GETTIMEOFDAY |
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */ |
||||
#undef HAVE_INTTYPES_H |
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */ |
||||
#undef HAVE_LOCALTIME_R |
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||
to 0 otherwise. */ |
||||
#undef HAVE_MALLOC |
||||
|
||||
/* Define to 1 if you have the `memmove' function. */ |
||||
#undef HAVE_MEMMOVE |
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */ |
||||
#undef HAVE_MEMORY_H |
||||
|
||||
/* Define to 1 if you have the `memset' function. */ |
||||
#undef HAVE_MEMSET |
||||
|
||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ |
||||
#undef HAVE_NDIR_H |
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */ |
||||
#undef HAVE_NETDB_H |
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */ |
||||
#undef HAVE_NETINET_IN_H |
||||
|
||||
/* Define to 1 if you have the `socket' function. */ |
||||
#undef HAVE_SOCKET |
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */ |
||||
#undef HAVE_STDINT_H |
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */ |
||||
#undef HAVE_STDLIB_H |
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */ |
||||
#undef HAVE_STRCASECMP |
||||
|
||||
/* Define to 1 if you have the `strchr' function. */ |
||||
#undef HAVE_STRCHR |
||||
|
||||
/* Define to 1 if you have the `strdup' function. */ |
||||
#undef HAVE_STRDUP |
||||
|
||||
/* Define to 1 if you have the `strftime' function. */ |
||||
#undef HAVE_STRFTIME |
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */ |
||||
#undef HAVE_STRINGS_H |
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */ |
||||
#undef HAVE_STRING_H |
||||
|
||||
/* Define to 1 if you have the `strncasecmp' function. */ |
||||
#undef HAVE_STRNCASECMP |
||||
|
||||
/* Define to 1 if you have the `strstr' function. */ |
||||
#undef HAVE_STRSTR |
||||
|
||||
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
|
||||
*/ |
||||
#undef HAVE_SYS_DIR_H |
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */ |
||||
#undef HAVE_SYS_IOCTL_H |
||||
|
||||
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
|
||||
*/ |
||||
#undef HAVE_SYS_NDIR_H |
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */ |
||||
#undef HAVE_SYS_SOCKET_H |
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */ |
||||
#undef HAVE_SYS_STAT_H |
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */ |
||||
#undef HAVE_SYS_TIME_H |
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */ |
||||
#undef HAVE_SYS_TYPES_H |
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */ |
||||
#undef HAVE_UNISTD_H |
||||
|
||||
/* Name of package */ |
||||
#undef PACKAGE |
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */ |
||||
#undef PACKAGE_BUGREPORT |
||||
|
||||
/* Define to the full name of this package. */ |
||||
#undef PACKAGE_NAME |
||||
|
||||
/* Define to the full name and version of this package. */ |
||||
#undef PACKAGE_STRING |
||||
|
||||
/* Define to the one symbol short name of this package. */ |
||||
#undef PACKAGE_TARNAME |
||||
|
||||
/* Define to the version of this package. */ |
||||
#undef PACKAGE_VERSION |
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */ |
||||
#undef RETSIGTYPE |
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */ |
||||
#undef STDC_HEADERS |
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ |
||||
#undef TIME_WITH_SYS_TIME |
||||
|
||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ |
||||
#undef TM_IN_SYS_TIME |
||||
|
||||
/* Version number of package */ |
||||
#undef VERSION |
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */ |
||||
#undef const |
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */ |
||||
#ifndef __cplusplus |
||||
#undef inline |
||||
#endif |
||||
|
||||
/* Define to rpl_malloc if the replacement function should be used. */ |
||||
#undef malloc |
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */ |
||||
#undef size_t |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,37 @@ |
||||
# -*- Autoconf -*- |
||||
# Process this file with autoconf to produce a configure script. |
||||
|
||||
AC_PREREQ(2.59) |
||||
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) |
||||
AM_INIT_AUTOMAKE(libfreeswitch,0.1) |
||||
AC_CONFIG_SRCDIR([src/switch.c]) |
||||
AC_CONFIG_HEADER([src/include/config.h]) |
||||
|
||||
# Checks for programs. |
||||
AC_PROG_CC |
||||
AC_PROG_MAKE_SET |
||||
AC_PROG_LIBTOOL |
||||
AC_PROG_INSTALL |
||||
|
||||
# Checks for header files. |
||||
AC_HEADER_DIRENT |
||||
AC_HEADER_STDC |
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h]) |
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics. |
||||
AC_C_CONST |
||||
AC_C_INLINE |
||||
AC_TYPE_SIZE_T |
||||
AC_HEADER_TIME |
||||
AC_STRUCT_TM |
||||
|
||||
# Checks for library functions. |
||||
AC_PROG_GCC_TRADITIONAL |
||||
AC_FUNC_MALLOC |
||||
AC_TYPE_SIGNAL |
||||
AC_FUNC_STRFTIME |
||||
AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset socket strcasecmp strchr strdup strncasecmp strstr]) |
||||
|
||||
AC_CONFIG_FILES([Makefile]) |
||||
|
||||
AC_OUTPUT |
@ -0,0 +1,45 @@ |
||||
# -*- Autoconf -*- |
||||
# Process this file with autoconf to produce a configure script. |
||||
|
||||
AC_PREREQ(2.59) |
||||
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) |
||||
AC_CONFIG_SRCDIR([switch.c]) |
||||
AC_CONFIG_HEADER([config.h]) |
||||
|
||||
# Checks for programs. |
||||
AC_PROG_CC |
||||
AC_PROG_MAKE_SET |
||||
|
||||
# Checks for libraries. |
||||
# FIXME: Replace `main' with a function in `-leXosip2': |
||||
AC_CHECK_LIB([eXosip2], [main]) |
||||
# FIXME: Replace `main' with a function in `-lsangoma': |
||||
AC_CHECK_LIB([sangoma], [main]) |
||||
# FIXME: Replace `main' with a function in `-lspeex': |
||||
AC_CHECK_LIB([speex], [main]) |
||||
|
||||
# Checks for header files. |
||||
AC_HEADER_DIRENT |
||||
AC_HEADER_STDC |
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h]) |
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics. |
||||
AC_C_CONST |
||||
AC_C_INLINE |
||||
AC_TYPE_SIZE_T |
||||
AC_HEADER_TIME |
||||
AC_STRUCT_TM |
||||
|
||||
# Checks for library functions. |
||||
AC_PROG_GCC_TRADITIONAL |
||||
AC_FUNC_MALLOC |
||||
AC_TYPE_SIGNAL |
||||
AC_FUNC_STRFTIME |
||||
AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset socket strcasecmp strchr strdup strncasecmp strstr]) |
||||
|
||||
AC_CONFIG_FILES([Makefile |
||||
mod/mod_exosip/Makefile |
||||
mod/mod_g711codec/Makefile |
||||
mod/mod_speexcodec/Makefile |
||||
mod/mod_wanchan/Makefile]) |
||||
AC_OUTPUT |
@ -0,0 +1,479 @@ |
||||
#! /bin/sh |
||||
|
||||
# depcomp - compile a program generating dependencies as side-effects |
||||
# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. |
||||
|
||||
# This program is free software; you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation; either version 2, or (at your option) |
||||
# any later version. |
||||
|
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
|
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
||||
# 02111-1307, USA. |
||||
|
||||
# As a special exception to the GNU General Public License, if you |
||||
# distribute this file as part of a program that contains a |
||||
# configuration script generated by Autoconf, you may include it under |
||||
# the same distribution terms that you use for the rest of that program. |
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. |
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then |
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2 |
||||
exit 1 |
||||
fi |
||||
# `libtool' can also be set to `yes' or `no'. |
||||
|
||||
if test -z "$depfile"; then |
||||
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` |
||||
dir=`echo "$object" | sed 's,/.*$,/,'` |
||||
if test "$dir" = "$object"; then |
||||
dir= |
||||
fi |
||||
# FIXME: should be _deps on DOS. |
||||
depfile="$dir.deps/$base" |
||||
fi |
||||
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} |
||||
|
||||
rm -f "$tmpdepfile" |
||||
|
||||
# Some modes work just like other modes, but use different flags. We |
||||
# parameterize here, but still list the modes in the big case below, |
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case |
||||
# here, because this file can only contain one case statement. |
||||
if test "$depmode" = hp; then |
||||
# HP compiler uses -M and no extra arg. |
||||
gccflag=-M |
||||
depmode=gcc |
||||
fi |
||||
|
||||
if test "$depmode" = dashXmstdout; then |
||||
# This is just like dashmstdout with a different argument. |
||||
dashmflag=-xM |
||||
depmode=dashmstdout |
||||
fi |
||||
|
||||
case "$depmode" in |
||||
gcc3) |
||||
## gcc 3 implements dependency tracking that does exactly what |
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like |
||||
## it if -MD -MP comes after the -MF stuff. Hmm. |
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile" |
||||
stat=$? |
||||
if test $stat -eq 0; then : |
||||
else |
||||
rm -f "$tmpdepfile" |
||||
exit $stat |
||||
fi |
||||
mv "$tmpdepfile" "$depfile" |
||||
;; |
||||
|
||||
gcc) |
||||
## There are various ways to get dependency output from gcc. Here's |
||||
## why we pick this rather obscure method: |
||||
## - Don't want to use -MD because we'd like the dependencies to end |
||||
## up in a subdir. Having to rename by hand is ugly. |
||||
## (We might end up doing this anyway to support other compilers.) |
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like |
||||
## -MM, not -M (despite what the docs say). |
||||
## - Using -M directly means running the compiler twice (even worse |
||||
## than renaming). |
||||
if test -z "$gccflag"; then |
||||
gccflag=-MD, |
||||
fi |
||||
"$@" -Wp,"$gccflag$tmpdepfile" |
||||
stat=$? |
||||
if test $stat -eq 0; then : |
||||
else |
||||
rm -f "$tmpdepfile" |
||||
exit $stat |
||||
fi |
||||
rm -f "$depfile" |
||||
echo "$object : \\" > "$depfile" |
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz |
||||
## The second -e expression handles DOS-style file names with drive letters. |
||||
sed -e 's/^[^:]*: / /' \ |
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" |
||||
## This next piece of magic avoids the `deleted header file' problem. |
||||
## The problem is that when a header file which appears in a .P file |
||||
## is deleted, the dependency causes make to die (because there is |
||||
## typically no way to rebuild the header). We avoid this by adding |
||||
## dummy dependencies for each header file. Too bad gcc doesn't do |
||||
## this for us directly. |
||||
tr ' ' ' |
||||
' < "$tmpdepfile" | |
||||
## Some versions of gcc put a space before the `:'. On the theory |
||||
## that the space means something, we add a space to the output as |
||||
## well. |
||||
## Some versions of the HPUX 10.20 sed can't process this invocation |
||||
## correctly. Breaking it into two sed invocations is a workaround. |
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
hp) |
||||
# This case exists only to let depend.m4 do its work. It works by |
||||
# looking at the text of this script. This case will never be run, |
||||
# since it is checked for above. |
||||
exit 1 |
||||
;; |
||||
|
||||
sgi) |
||||
if test "$libtool" = yes; then |
||||
"$@" "-Wp,-MDupdate,$tmpdepfile" |
||||
else |
||||
"$@" -MDupdate "$tmpdepfile" |
||||
fi |
||||
stat=$? |
||||
if test $stat -eq 0; then : |
||||
else |
||||
rm -f "$tmpdepfile" |
||||
exit $stat |
||||
fi |
||||
rm -f "$depfile" |
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files |
||||
echo "$object : \\" > "$depfile" |
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be |
||||
# clever and replace this with sed code, as IRIX sed won't handle |
||||
# lines with more than a fixed number of characters (4096 in |
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; |
||||
# the IRIX cc adds comments like `#:fec' to the end of the |
||||
# dependency line. |
||||
tr ' ' ' |
||||
' < "$tmpdepfile" \ |
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ |
||||
tr ' |
||||
' ' ' >> $depfile |
||||
echo >> $depfile |
||||
|
||||
# The second pass generates a dummy entry for each header file. |
||||
tr ' ' ' |
||||
' < "$tmpdepfile" \ |
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ |
||||
>> $depfile |
||||
else |
||||
# The sourcefile does not contain any dependencies, so just |
||||
# store a dummy comment line, to avoid errors with the Makefile |
||||
# "include basename.Plo" scheme. |
||||
echo "#dummy" > "$depfile" |
||||
fi |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
aix) |
||||
# The C for AIX Compiler uses -M and outputs the dependencies |
||||
# in a .u file. In older versions, this file always lives in the |
||||
# current directory. Also, the AIX compiler puts `$object:' at the |
||||
# start of each line; $object doesn't have directory information. |
||||
# Version 6 uses the directory in both cases. |
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` |
||||
tmpdepfile="$stripped.u" |
||||
if test "$libtool" = yes; then |
||||
"$@" -Wc,-M |
||||
else |
||||
"$@" -M |
||||
fi |
||||
stat=$? |
||||
|
||||
if test -f "$tmpdepfile"; then : |
||||
else |
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'` |
||||
tmpdepfile="$stripped.u" |
||||
fi |
||||
|
||||
if test $stat -eq 0; then : |
||||
else |
||||
rm -f "$tmpdepfile" |
||||
exit $stat |
||||
fi |
||||
|
||||
if test -f "$tmpdepfile"; then |
||||
outname="$stripped.o" |
||||
# Each line is of the form `foo.o: dependent.h'. |
||||
# Do two passes, one to just change these to |
||||
# `$object: dependent.h' and one to simply `dependent.h:'. |
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" |
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" |
||||
else |
||||
# The sourcefile does not contain any dependencies, so just |
||||
# store a dummy comment line, to avoid errors with the Makefile |
||||
# "include basename.Plo" scheme. |
||||
echo "#dummy" > "$depfile" |
||||
fi |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
icc) |
||||
# Intel's C compiler understands `-MD -MF file'. However on |
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c |
||||
# ICC 7.0 will fill foo.d with something like |
||||
# foo.o: sub/foo.c |
||||
# foo.o: sub/foo.h |
||||
# which is wrong. We want: |
||||
# sub/foo.o: sub/foo.c |
||||
# sub/foo.o: sub/foo.h |
||||
# sub/foo.c: |
||||
# sub/foo.h: |
||||
# ICC 7.1 will output |
||||
# foo.o: sub/foo.c sub/foo.h |
||||
# and will wrap long lines using \ : |
||||
# foo.o: sub/foo.c ... \ |
||||
# sub/foo.h ... \ |
||||
# ... |
||||
|
||||
"$@" -MD -MF "$tmpdepfile" |
||||
stat=$? |
||||
if test $stat -eq 0; then : |
||||
else |
||||
rm -f "$tmpdepfile" |
||||
exit $stat |
||||
fi |
||||
rm -f "$depfile" |
||||
# Each line is of the form `foo.o: dependent.h', |
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. |
||||
# Do two passes, one to just change these to |
||||
# `$object: dependent.h' and one to simply `dependent.h:'. |
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" |
||||
# Some versions of the HPUX 10.20 sed can't process this invocation |
||||
# correctly. Breaking it into two sed invocations is a workaround. |
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | |
||||
sed -e 's/$/ :/' >> "$depfile" |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
tru64) |
||||
# The Tru64 compiler uses -MD to generate dependencies as a side |
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. |
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put |
||||
# dependencies in `foo.d' instead, so we check for that too. |
||||
# Subdirectories are respected. |
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` |
||||
test "x$dir" = "x$object" && dir= |
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` |
||||
|
||||
if test "$libtool" = yes; then |
||||
tmpdepfile1="$dir.libs/$base.lo.d" |
||||
tmpdepfile2="$dir.libs/$base.d" |
||||
"$@" -Wc,-MD |
||||
else |
||||
tmpdepfile1="$dir$base.o.d" |
||||
tmpdepfile2="$dir$base.d" |
||||
"$@" -MD |
||||
fi |
||||
|
||||
stat=$? |
||||
if test $stat -eq 0; then : |
||||
else |
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" |
||||
exit $stat |
||||
fi |
||||
|
||||
if test -f "$tmpdepfile1"; then |
||||
tmpdepfile="$tmpdepfile1" |
||||
else |
||||
tmpdepfile="$tmpdepfile2" |
||||
fi |
||||
if test -f "$tmpdepfile"; then |
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" |
||||
# That's a tab and a space in the []. |
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" |
||||
else |
||||
echo "#dummy" > "$depfile" |
||||
fi |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
#nosideeffect) |
||||
# This comment above is used by automake to tell side-effect |
||||
# dependency tracking mechanisms from slower ones. |
||||
|
||||
dashmstdout) |
||||
# Important note: in order to support this mode, a compiler *must* |
||||
# always write the preprocessed file to stdout, regardless of -o. |
||||
"$@" || exit $? |
||||
|
||||
# Remove the call to Libtool. |
||||
if test "$libtool" = yes; then |
||||
while test $1 != '--mode=compile'; do |
||||
shift |
||||
done |
||||
shift |
||||
fi |
||||
|
||||
# Remove `-o $object'. |
||||
IFS=" " |
||||
for arg |
||||
do |
||||
case $arg in |
||||
-o) |
||||
shift |
||||
;; |
||||
$object) |
||||
shift |
||||
;; |
||||
*) |
||||
set fnord "$@" "$arg" |
||||
shift # fnord |
||||
shift # $arg |
||||
;; |
||||
esac |
||||
done |
||||
|
||||
test -z "$dashmflag" && dashmflag=-M |
||||
# Require at least two characters before searching for `:' |
||||
# in the target name. This is to cope with DOS-style filenames: |
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. |
||||
"$@" $dashmflag | |
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" |
||||
rm -f "$depfile" |
||||
cat < "$tmpdepfile" > "$depfile" |
||||
tr ' ' ' |
||||
' < "$tmpdepfile" | \ |
||||
## Some versions of the HPUX 10.20 sed can't process this invocation |
||||
## correctly. Breaking it into two sed invocations is a workaround. |
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
dashXmstdout) |
||||
# This case only exists to satisfy depend.m4. It is never actually |
||||
# run, as this mode is specially recognized in the preamble. |
||||
exit 1 |
||||
;; |
||||
|
||||
makedepend) |
||||
"$@" || exit $? |
||||
# Remove any Libtool call |
||||
if test "$libtool" = yes; then |
||||
while test $1 != '--mode=compile'; do |
||||
shift |
||||
done |
||||
shift |
||||
fi |
||||
# X makedepend |
||||
shift |
||||
cleared=no |
||||
for arg in "$@"; do |
||||
case $cleared in |
||||
no) |
||||
set ""; shift |
||||
cleared=yes ;; |
||||
esac |
||||
case "$arg" in |
||||
-D*|-I*) |
||||
set fnord "$@" "$arg"; shift ;; |
||||
# Strip any option that makedepend may not understand. Remove |
||||
# the object too, otherwise makedepend will parse it as a source file. |
||||
-*|$object) |
||||
;; |
||||
*) |
||||
set fnord "$@" "$arg"; shift ;; |
||||
esac |
||||
done |
||||
obj_suffix="`echo $object | sed 's/^.*\././'`" |
||||
touch "$tmpdepfile" |
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" |
||||
rm -f "$depfile" |
||||
cat < "$tmpdepfile" > "$depfile" |
||||
sed '1,2d' "$tmpdepfile" | tr ' ' ' |
||||
' | \ |
||||
## Some versions of the HPUX 10.20 sed can't process this invocation |
||||
## correctly. Breaking it into two sed invocations is a workaround. |
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak |
||||
;; |
||||
|
||||
cpp) |
||||
# Important note: in order to support this mode, a compiler *must* |
||||
# always write the preprocessed file to stdout. |
||||
"$@" || exit $? |
||||
|
||||
# Remove the call to Libtool. |
||||
if test "$libtool" = yes; then |
||||
while test $1 != '--mode=compile'; do |
||||
shift |
||||
done |
||||
shift |
||||
fi |
||||
|
||||
# Remove `-o $object'. |
||||
IFS=" " |
||||
for arg |
||||
do |
||||
case $arg in |
||||
-o) |
||||
shift |
||||
;; |
||||
$object) |
||||
shift |
||||
;; |
||||
*) |
||||
set fnord "$@" "$arg" |
||||
shift # fnord |
||||
shift # $arg |
||||
;; |
||||
esac |
||||
done |
||||
|
||||
"$@" -E | |
||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | |
||||
sed '$ s: \\$::' > "$tmpdepfile" |
||||
rm -f "$depfile" |
||||
echo "$object : \\" > "$depfile" |
||||
cat < "$tmpdepfile" >> "$depfile" |
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
msvisualcpp) |
||||
# Important note: in order to support this mode, a compiler *must* |
||||
# always write the preprocessed file to stdout, regardless of -o, |
||||
# because we must use -o when running libtool. |
||||
"$@" || exit $? |
||||
IFS=" " |
||||
for arg |
||||
do |
||||
case "$arg" in |
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") |
||||
set fnord "$@" |
||||
shift |
||||
shift |
||||
;; |
||||
*) |
||||
set fnord "$@" "$arg" |
||||
shift |
||||
shift |
||||
;; |
||||
esac |
||||
done |
||||
"$@" -E | |
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" |
||||
rm -f "$depfile" |
||||
echo "$object : \\" > "$depfile" |
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" |
||||
echo " " >> "$depfile" |
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" |
||||
rm -f "$tmpdepfile" |
||||
;; |
||||
|
||||
none) |
||||
exec "$@" |
||||
;; |
||||
|
||||
*) |
||||
echo "Unknown depmode $depmode" 1>&2 |
||||
exit 1 |
||||
;; |
||||
esac |
||||
|
||||
exit 0 |
@ -0,0 +1,10 @@ |
||||
|
||||
$(MOD).so: $(MOD).c |
||||
$(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o
|
||||
$(CC) -shared -Xlinker -x $(MOD).o -o $(MOD).so $(LDFLAGS)
|
||||
|
||||
all: $(MOD).so |
||||
|
||||
clean: |
||||
rm -fr *.so *.o *~
|
||||
|
@ -0,0 +1,294 @@ |
||||
#!/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 "$0: no input file specified" >&2 |
||||
exit 1 |
||||
else |
||||
: |
||||
fi |
||||
|
||||
if [ x"$dir_arg" != x ]; then |
||||
dst=$src |
||||
src="" |
||||
|
||||
if [ -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 [ -f "$src" ] || [ -d "$src" ] |
||||
then |
||||
: |
||||
else |
||||
echo "$0: $src does not exist" >&2 |
||||
exit 1 |
||||
fi |
||||
|
||||
if [ x"$dst" = x ] |
||||
then |
||||
echo "$0: no destination specified" >&2 |
||||
exit 1 |
||||
else |
||||
: |
||||
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 |
||||
: |
||||
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 |
||||
: |
||||
fi |
||||
|
||||