From 0bffff19302a28a2162c55f8d44ad8d28815c03f Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Wed, 5 Oct 2005 00:17:57 +0000 Subject: [PATCH] correct cygwin detection (issue #5328) handle parallel make better (issue #5328) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6725 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/Makefile | 4 +++- editline/Makefile.in | 5 +++-- editline/configure | 3 +-- editline/configure.in | 3 +-- funcs/Makefile | 10 ++++++---- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/channels/Makefile b/channels/Makefile index 7189416bd8..56cc531f87 100755 --- a/channels/Makefile +++ b/channels/Makefile @@ -158,7 +158,9 @@ busy.h: gentone ringtone.h: gentone ./gentone ringtone 440 480 -chan_oss.o: chan_oss.c busy.h ringtone.h +chan_oss.o: chan_oss.c busy.h ringtone.h + +chan_alsa.o: chan_alsa.c busy.h ringtone.h ifeq (${OSARCH},OpenBSD) chan_oss.so: chan_oss.o diff --git a/editline/Makefile.in b/editline/Makefile.in index c4e5695154..805642281a 100755 --- a/editline/Makefile.in +++ b/editline/Makefile.in @@ -3,9 +3,8 @@ # OSTYPE=$(shell uname -s) -cygx="$(shell uname -s | sed -e c\cygwin | tr [:upper:] [:lower:])" define cyg_subst_sys - if [ $(cygx) = "cygwin" ]; then \ + if uname -s | grep -qi cygwin; then \ cat $@ | sed -e s/"sys\.h"/"config.h"/g > $@.copy; \ mv --force $@.copy $@; \ fi @@ -230,3 +229,5 @@ editline.c : $(ACSRCS) $(BCSRCS) $(AGCSRCS) .c.o_s : $(AGHDRS) $(BGHDRS) $(CC) -c $(S_CFLAGS) $(CFLAGS) $(CPPFLAGS) $< -o $@ + +$(CCSRCS) : $(BGHDRS) diff --git a/editline/configure b/editline/configure index 9dccffd0ff..7265fe0200 100755 --- a/editline/configure +++ b/editline/configure @@ -895,8 +895,7 @@ case "${host}" in ABI="elf" ;; *-*-linux* | *cygwin*) - cyg="$(echo ${host} | sed -e c\cygwin)" - if [ ${cyg} = cygwin ]; then \ + if echo ${host} | grep -q cygwin ; then \ echo "cygwin detected"; \ S_CFLAGS=""; \ echo "/* cygdef.h. Generated automatically by configure. */ diff --git a/editline/configure.in b/editline/configure.in index dcef07a91a..2e37d6b2a8 100755 --- a/editline/configure.in +++ b/editline/configure.in @@ -32,8 +32,7 @@ case "${host}" in ABI="elf" ;; *-*-linux* | *cygwin*) - cyg="$(echo ${host} | sed -e c\cygwin)" - if [ ${cyg} = cygwin ]; then \ + if echo ${host} | grep -q cygwin ; then \ echo "cygwin detected"; \ S_CFLAGS=""; \ echo "/* cygdef.h. Generated automatically by configure. */ diff --git a/funcs/Makefile b/funcs/Makefile index e99cde0053..7ec63b4070 100755 --- a/funcs/Makefile +++ b/funcs/Makefile @@ -29,11 +29,11 @@ STANDALONE_FUNCS=$(filter-out $(BUILTINS),$(patsubst %.c,%.o,$(wildcard func*.c) FUNCS+=$(STANDALONE_FUNCS:.o=.so) -FUNC_STRUCTS=$(shell grep 'struct ast_custom_function' $(BUILTINS:.o=.c) | awk '{print $$3};') +FUNC_SOURCES=$(BUILTINS:.o=.c) -CFLAGS+=-fPIC +FUNC_STRUCTS=$(shell grep 'struct ast_custom_function' $(FUNC_SOURCES) | awk '{print $$3};') -FUNC_SOURCES=$(BUILTINS:.o=.c) +CFLAGS+=-fPIC ifeq ($(findstring BSD,${OSARCH}),BSD) CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib @@ -49,13 +49,15 @@ clean: #$(BUILTINS) : CFLAGS += -DBUILTIN_FUNC -pbx_functions.h: $(BUILTINS:.o=.c) +pbx_functions.h: $(FUNC_SOURCES) @echo "/* Automatically generated - do not edit */" > $@ @for f in $(FUNC_SOURCES); do echo "#include \"$$f\"" >> $@; done @echo "static struct ast_custom_function *builtins[] = {" >> $@ @for f in $(FUNC_STRUCTS); do echo "&$$f," >> $@; done @echo "};" >> $@ +pbx_functions.o: pbx_functions.h + pbx_functions.so: pbx_functions.o #$(BUILTINS) $(CC) $(SOLINK) -o $@ $<