All pastes #36888 Raw Edit

Stuff

public text v1 · immutable
#36888 ·published 2006-01-15 18:06 UTC
rendered paste body
app_conference.so : $(OBJS)
	$(CC) -pg $(SOLINK) -o $@ $(OBJS)

where SOLINK is -dynamic -bundle -undefined suppress -force_flat_namespace

yields ...

gcc -pg -dynamic -bundle -undefined suppress -force_flat_namespace -o app_conference.so app_conference.o conference.o member.o frame.o cli.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
/usr/bin/ld: app_conference.o has local relocation entries in non-writable section (__TEXT,__text)
collect2: ld returned 1 exit status
make: *** [app_conference.so] Error 1

========================================

app_conference.so : $(OBJS)
ifeq (${OSARCH},Darwin)
	$(CC) -pg -Xlinker -x -o $@ $(OBJS)

yields ...

gcc -pg -Xlinker -x -o app_conference.so app_conference.o conference.o member.o frame.o cli.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
/usr/bin/ld: Undefined symbols:
_main
_ast_log
_ast_register_application
_ast_softhangup
_ast_unregister_application
_ast_update_use_count
___use_ast_pthread_create_instead__
_ast_frdup
_ast_frfree
_ast_frisolate
_ast_translate
_ast_translator_build_path
_ast_translator_free_path
___ast_smoother_feed
_ast_answer
_ast_closestream
_ast_read
_ast_readframe
_ast_set_read_format
_ast_set_write_format
_ast_smoother_free
_ast_smoother_new
_ast_smoother_read
_ast_waitfor
_ast_write
_manager_event
_ast_cli
_ast_cli_register
_ast_cli_unregister
_ast_copy_string
_ast_openstream
collect2: ld returned 1 exit status
make: *** [app_conference.so] Error 1

========================================

app_conference.so : $(OBJS)
ifeq (${OSARCH},Darwin)
	$(CC) -pg -x -o $@ $(OBJS)

yields ...

gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o libspeex/smallft.o libspeex/smallft.c
gcc -pg -x -o app_conference.so app_conference.o conference.o member.o frame.o cli.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
powerpc-apple-darwin8-gcc-4.0.0: app_conference.so: No such file or directory
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
powerpc-apple-darwin8-gcc-4.0.0: language -o not recognized
make: *** [app_conference.so] Error 1


========================================

# $Id: Makefile,v 1.9 2005/10/27 17:53:35 stevek Exp $

#
# Makefile, based on the Asterisk Makefile, Coypright (C) 1999, Mark Spencer
#
# Copyright (C) 2002,2003 Junghanns.NET GmbH
#
# Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
#
# This program is free software and may be modified and 
# distributed under the terms of the GNU Public License.
#

.EXPORT_ALL_VARIABLES:

#
# app_conference defines which can be passed on the command-line
#

INSTALL_PREFIX := /usr
INSTALL_MODULES_DIR := $(INSTALL_PREFIX)/lib/asterisk/modules

#ASTERISK_INCLUDE_DIR := $(HOME)/local/asterisk/asterisk/include

ASTERISK_INCLUDE_DIR := $(HOME)/asterisk-1.0.10/include/asterisk

# turn app_conference debugging on or off ( 0 == OFF, 1 == ON )
APP_CONFERENCE_DEBUG := 1

# 0 = OFF 1 = astdsp 2 = speex
SILDET := 2

#
# app_conference objects to build
#

OBJS = app_conference.o conference.o member.o frame.o cli.o
SHAREDOS = app_conference.so

#
# standard compile settings
#

PROC = $(shell uname -m)
INSTALL = install
CC = gcc

INCLUDE = -I$(ASTERISK_INCLUDE_DIR) 
LIBS = -ldl -lpthread -lm
DEBUG := -g 

CFLAGS = -pipe -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
#CFLAGS += -O2
#CFLAGS += -O3 -march=pentium3 -msse -mfpmath=sse,387 -ffast-math 
# PERF: below is 10% faster than -O2 or -O3 alone.
#CFLAGS += -O3 -ffast-math -funroll-loops
# below is another 5% faster or so.
CFLAGS += -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant

# this is fun for PPC
CFLAGS += -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic

# this is fun for x86
#CFLAGS += -march=pentium3 -msse -mfpmath=sse,387


# adding -msse -mfpmath=sse has little effect.
#CFLAGS += -O3 -msse -mfpmath=sse
#CFLAGS += $(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
CFLAGS += $(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
CFLAGS += -DCRYPTO

ifeq ($(APP_CONFERENCE_DEBUG), 1)
CFLAGS += -DAPP_CONFERENCE_DEBUG
endif

#
# additional flag values for silence detection
#

ifeq ($(SILDET), 2)
OBJS += libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
CFLAGS += -Ilibspeex -DSILDET=2
endif

ifeq ($(SILDET), 1)
CFLAGS += -DSILDET=1
endif

# this is taken from the Asterisk Makefile ...
OSARCH=$(shell uname -s)
ifeq (${OSARCH},Darwin)
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
else
SOLINK=-shared -Xlinker -x
endif

#
# targets
#

all: $(SHAREDOS) 

clean:
	rm -f *.so *.o $(OBJS)

app_conference.so : $(OBJS)
	$(CC) -pg $(SOLINK) -o $@ $(OBJS)

vad_test: vad_test.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
	$(CC) $(PROFILE) -o $@ $^ -lm

install: all
	for x in $(SHAREDOS); do $(INSTALL) -m 755 $$x $(INSTALL_MODULES_DIR) ; done
	/usr/sbin/asterisk -rx "restart now"

# config: all
# 	cp conf.conf /etc/asterisk/
	

========================================

complete output ...

# make clean ; make install
rm -f *.so *.o app_conference.o conference.o member.o frame.o cli.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o app_conference.o app_conference.c
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o conference.o conference.c
conference.c: In function 'create_conf':
conference.c:571: warning: assignment makes pointer from integer without a cast
conference.c:621: warning: implicit declaration of function '__use_ast_pthread_create_instead__'
conference.c:635: warning: assignment makes pointer from integer without a cast
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o member.o member.c
member.c: In function 'process_outgoing':
member.c:286: warning: format '%ld' expects type 'long int', but argument 7 has type 'suseconds_t'
member.c:300: warning: format '%ld' expects type 'long int', but argument 7 has type 'suseconds_t'
member.c:300: warning: format '%ld' expects type 'long int', but argument 9 has type 'suseconds_t'
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o frame.o frame.c
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o cli.o cli.c
cli.c: In function 'conference_play_sound':
cli.c:235: warning: implicit declaration of function 'ast_copy_string'
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o libspeex/preprocess.o libspeex/preprocess.c
libspeex/preprocess.c:46:1: warning: "floor" redefined
In file included from /usr/include/math.h:26,
                 from libspeex/preprocess.c:34:
/usr/include/architecture/ppc/math.h:658:1: warning: this is the location of the previous definition
libspeex/preprocess.c:632: warning: no previous prototype for 'ephraim_malah'
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o libspeex/misc.o libspeex/misc.c
gcc -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -g  -I/Users/benjamin/asterisk-1.0.10/include/asterisk  -D_REENTRANT -D_GNU_SOURCE -O3 -ffast-math -funroll-all-loops -fprefetch-loop-arrays -fsingle-precision-constant -mcpu=7450 -faltivec -mabi=altivec -mdynamic-no-pic  -DCRYPTO -DAPP_CONFERENCE_DEBUG -Ilibspeex -DSILDET=2   -c -o libspeex/smallft.o libspeex/smallft.c
gcc -pg -dynamic -bundle -undefined suppress -force_flat_namespace -o app_conference.so app_conference.o conference.o member.o frame.o cli.o libspeex/preprocess.o libspeex/misc.o libspeex/smallft.o
/usr/bin/ld: app_conference.o has local relocation entries in non-writable section (__TEXT,__text)
collect2: ld returned 1 exit status
make: *** [app_conference.so] Error 1