Newsgroup: it.comp.os.linux.iniziare
Titolo: Problemi con Make

Salve a tutti,
possiedo un server con CPU Athlon 64 3200 e Fedora Core 2 x86_64. Sul
server gira Asterisk 1.0.6 (
www.asterisk.org
). Ora, non ho assolutamente
avuto problemi a compilare Asterisk, ma quando vado a compilare
asterisk-addons-1.0.6 mi da quest'errore.
[root@server1 asterisk-addons-1.0.6]# make
make -C format_mp3 all
make[1]: Entering directory `/usr/src/asterisk-addons-1.0.6/format_mp3'
gcc -pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations   -D_REENTRANT -D_GNU_SOURCE  -O6 -m64 -shared
-Xlinker -x -o format_mp3.so common.o dct64_i386.o decode_ntom.o
layer3.o tabinit.o interface.o format_mp3.o
/usr/bin/ld: common.o: relocation R_X86_64_32 can not be used when
making a shared object; recompile with -fPIC
common.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [format_mp3.so] Error 1
make[1]: Leaving directory `/usr/src/asterisk-addons-1.0.6/format_mp3'
make: *** [format_mp3/format_mp3.so] Error 2
Qualcuno sa dirmi cosa voglia dire e cosa posso fare per ovviare al
problema???
Grazie,
	The Unf.

The Unforgiven ha scritto:

Modifica il Makefile: dove dice CFLAGS devi aggiungere, fra le altre 
cose, anche l'opzione -fPIC. Ad esempio se dice
CFLAGS=$(bla bla) -opz opz2
tu modifica in
CFLAGS=$(bla bla) -opz opz2 -fPIC
ciao
sergio
-- 
"Two plus two gives five, for extremely large values of two."
..ooOO <sedimico chi@cci@la libero p.u.n.t.o. it> OOoo..
Linux Registered User #366688
on 
http://counter.li.org

 cose, anche l'opzione -fPIC.
Wow, grazie!!!
The Unf.


#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
.EXPORT_ALL_VARIABLES:
MODS=format_mp3/format_mp3.so
CFLAGS+=-fPIC
CFLAGS+=-I../asterisk
CFLAGS+=-D_GNU_SOURCE
INSTALL=install
INSTALL_PREFIX=
ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
MODULES_DIR=$(ASTLIBDIR)/modules
#
# MySQL stuff...  Autoconf anyone??
#
MODS+=$(shell if [ -d /usr/local/mysql/include ] || [ -d
/usr/include/mysql ] || [ -d /usr/local/include/mysql ] || [ -d
/opt/mysql/include ]; then echo "cdr_addon_mysql.so
app_addon_sql_mysql.so"; fi)
CFLAGS+=$(shell if [ -d /usr/local/mysql/include ]; then echo
"-I/usr/local/mysql/include"; fi)
CFLAGS+=$(shell if [ -d /usr/include/mysql ]; then echo
"-I/usr/include/mysql"; fi)
CFLAGS+=$(shell if [ -d /usr/local/include/mysql ]; then echo
"-I/usr/local/include/mysql"; fi)
CFLAGS+=$(shell if [ -d /opt/mysql/include/mysql ]; then echo
"-I/opt/mysql/include/mysql"; fi)
MLFLAGS=
MLFLAGS+=$(shell if [ -d /usr/lib/mysql ]; then echo "-L/usr/lib/mysql"; fi)
MLFLAGS+=$(shell if [ -d /usr/local/mysql/lib ]; then echo
"-L/usr/local/mysql/lib"; fi)
MLFLAGS+=$(shell if [ -d /usr/local/lib/mysql ]; then echo
"-L/usr/local/lib/mysql"; fi)
MLFLAGS+=$(shell if [ -d /opt/mysql/lib/mysql ]; then echo
"-L/opt/mysql/lib/mysql"; fi)
all: depend $(MODS)
format_mp3/format_mp3.so:
        make -C format_mp3 all
install: all
        for x in $(MODS); do $(INSTALL) -m 755 $$x $(MODULES_DIR) ; done
clean:
        rm -f *.so *.o .depend
        make -C format_mp3 clean
%.so : %.o
        $(CC) -shared -Xlinker -x -o $@ $<
ifneq ($(wildcard .depend),)
include .depend
endif
cdr_addon_mysql.so: cdr_addon_mysql.o
        $(CC) -shared -Xlinker -x -o $@ $< -lmysqlclient -lz $(MLFLAGS)
app_addon_sql_mysql.so: app_addon_sql_mysql.o
        $(CC) -shared -Xlinker -x -o $@ $< -lmysqlclient -lz $(MLFLAGS)
depend: .depend
.depend:
        ./mkdep $(CFLAGS) `ls *.c`
Dove capperi devo cambiare???
Grazie della cortesia e della pazienza.
	The Unf.

 CFLAGS+=-D_GNU_SOURCE
Prova con
 
	CFLAGS= -fPIC -I../asterisk -D_GNU_SOURCE
tutto su una riga, invece di queste tre linee.
Ciao
Sergio
