added 64bit check for -fPIC for .so file generation. also removed optimization, better debugging is now more important than speed i would say.

This commit is contained in:
Chrisian Richter 2006-12-21 09:25:23 +00:00
parent 36a08cb135
commit 86d27fe91d
3 changed files with 15 additions and 4 deletions

View File

@ -28,11 +28,13 @@ export INCLUDEDIR
LIBDIR=/usr/lib
export LIBDIR
CFLAGS:= -g -Wall -O2 -I $(INCLUDEDIR) -I $(MISDNINCLUDEDIR)
CFLAGS:= -g -Wall -I $(INCLUDEDIR) -I $(MISDNINCLUDEDIR)
CFLAGS+= -D CLOSE_REPORT=1
#disable this if your system does not support PIC (position independent code)
#CFLAGS+=-fPIC
ifeq ($(shell uname -m),x86_64)
CFLAGS += -fPIC
endif
export CFLAGS

View File

@ -14,6 +14,11 @@ ISDNNET_OBJ = net_if.o isdn_debug.o isdn_msg.o fsm.o net_l2.o tei.o net_l3.o \
manager.o tone.o bchannel.o g711.o
ISDNNET_PICOBJ = $(ISDNNET_OBJ:%.o=%.lo)
ifeq ($(shell uname -m),x86_64)
CFLAGS += -fPIC
endif
libisdnnet_pic.a: $(ISDNNET_PICOBJ)
$(AR) cru $@ $^
$(RANLIB) $@
@ -23,7 +28,7 @@ libisdnnet.a: $(ISDNNET_OBJ)
$(RANLIB) $@
libisdnnet.so: $(ISDNNET_OBJ)
$(CC) -fPIC -shared -Xlinker -x -o $@ $^
$(CC) $(CFLAGS) -shared -Xlinker -x -o $@ $^
.c.o:
$(CC) $(CFLAGS) -o $@ -c $<

View File

@ -12,6 +12,10 @@ install:
LIBMISDN_OBJS = device.o layer.o stack.o status.o
LIBMISDN_PICOBJS = $(LIBMISDN_OBJS:%.o=%.lo)
ifeq ($(shell uname -m),x86_64)
CFLAGS += -fPIC
endif
libmISDN_pic.a: $(LIBMISDN_PICOBJS)
$(AR) cru $@ $^
$(RANLIB) $@
@ -21,7 +25,7 @@ libmISDN.a: $(LIBMISDN_OBJS)
$(RANLIB) $@
libmISDN.so: $(LIBMISDN_OBJS)
$(CC) -fPIC -shared -Xlinker -x -o $@ $^
$(CC) $(CFLAGS) -shared -Xlinker -x -o $@ $^
.c.o:
$(CC) $(CFLAGS) -o $@ -c $<