Group :: System/Libraries
RPM: libowfat
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: libowfat-0.32-alt-build-flags.patch
Download
Download
diff --git a/libowfat/GNUmakefile b/libowfat/GNUmakefile
index 3f3193d..99c3a2c 100644
--- a/libowfat/GNUmakefile
+++ b/libowfat/GNUmakefile
@@ -13,7 +13,7 @@ LIBS=byte.a fmt.a scan.a str.a uint.a open.a stralloc.a unix.a socket.a \
buffer.a mmap.a taia.a tai.a dns.a case.a mult.a array.a io.a \
textcode.a cdb.a critbit.a
-all: headers ent $(LIBS) libowfat.a libsocket t
+all: headers ent $(LIBS) libowfat.so libsocket t
pic pie:
$(MAKE) CC="gcc -fPIC" LDFLAGS="-fpie"
@@ -31,13 +31,13 @@ WARN=-W -Wall -Wextra $(WERROR)
NATIVE=
#NATIVE=-march=native -mtune=native
-OPT_REG=-O2
-OPT_PLUS=-O3 $(NATIVE)
+OPT_REG=
+OPT_PLUS=$(NATIVE)
DEFINE=-D_REENTRANT
-CFLAGS=-pipe $(WARN) $(DEFINE) $(OPT_REG)
-CFLAGS_OPT=-pipe $(WARN) $(DEFINE) $(OPT_PLUS)
+CFLAGS_OPT=$(CFLAGS) $(WARN) $(DEFINE) $(OPT_PLUS) -fPIC
+override CFLAGS+=$(WARN) $(DEFINE) $(OPT_REG) -fPIC
#CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall
@@ -168,11 +168,10 @@ $(SOCKET_OBJS) $(BUFFER_OBJS) $(MMAP_OBJS) $(TEXTCODE_OBJS) \
$(TAIA_OBJS) $(TAI_OBJS) $(CASE_OBJS) $(ARRAY_OBJS) $(MULT_OBJS) \
$(IO_OBJS) $(CDB_OBJS) $(CRITBIT_OBJS)
-libowfat.a: $(ALL_OBJS)
- $(CROSS)ar cru $@ $(ALL_OBJS)
- -$(CROSS)ranlib $@
+libowfat.so: $(ALL_OBJS)
+ $(CROSS)gcc -shared -Wl,-soname,libowfat.so.$(MAJOR) -o $@.$(VERSION) $(ALL_OBJS) -lpthread
-CFLAGS+=-I.
+override CFLAGS+=-I.
CFLAGS_OPT+=-I.
%.o: byte/%.c
@@ -191,8 +190,8 @@ t.o: t.c fmt.h scan.h str.h uint16.h uint32.h stralloc.h socket.h \
iarray.h io_internal.h haveepoll.h havekqueue.h havedevpoll.h \
havesigio.h CAS.h
-t: t.o libowfat.a libsocket
- $(DIET) $(CCC) -g -o $@ t.o libowfat.a `cat libsocket` -lpthread
+t: t.o libowfat.so libsocket
+ $(DIET) $(CCC) -g -o $@ t.o libowfat.so.$(VERSION) `cat libsocket` -lpthread
.PHONY: all clean tar install rename
clean:
@@ -206,6 +205,9 @@ uint16.h uint32.h uint64.h open.h textcode.h tai.h taia.h dns.h iopause.h case.h
openreadclose.h readclose.h ndelay.h array.h io.h safemult.h iob.h havealloca.h \
errmsg.h cdb.h cdb_make.h rangecheck.h iarray.h va_narg.h isset.h \
compiletimeassert.h critbit.h
+VERSION=$(shell head -n 1 CHANGES|sed 's/://')
+MAJOR=$(shell echo $(VERSION)|sed 's/\..*//')
+CURNAME=$(notdir $(shell pwd))
libowfat:
-mkdir libowfat
@@ -220,9 +222,9 @@ install-inc:
install -d $(DESTDIR)$(INCLUDEDIR)/libowfat
install -m 644 $(INCLUDES) $(DESTDIR)$(INCLUDEDIR)/libowfat
-install-lib: libowfat.a
+install-lib: libowfat.so
install -d $(DESTDIR)$(LIBDIR)
- install -m 644 libowfat.a $(DESTDIR)$(LIBDIR)
+ install -m 644 libowfat.so.$(VERSION) $(DESTDIR)$(LIBDIR)
install-man:
install -d $(DESTDIR)$(MAN3DIR)
@@ -235,10 +237,7 @@ uninstall:
rm -f $(INCLUDEDIR)/libowfat/*.h
test -d $(INCLUDEDIR)/libowfat && rmdir $(INCLUDEDIR)/libowfat
rm -f $(patsubst %.3,$(MAN3DIR)/%.3,$(notdir $(wildcard */*.3)))
- rm -f $(LIBDIR)/libowfat.a
-
-VERSION=libowfat-$(shell head -n 1 CHANGES|sed 's/://')
-CURNAME=$(notdir $(shell pwd))
+ rm -f $(LIBDIR)/libowfat.so.$(VERSION)
tar: Makefile clean rename
rm -f dep libdep