Fix zip linkage (still wip)

This commit is contained in:
pancake 2013-11-14 13:57:01 +01:00
parent 0bc95a2fc4
commit c1dd901413
8 changed files with 35 additions and 22 deletions

View File

@ -9,10 +9,6 @@ LTOP:=$(TOP)/libr
STOP:=$(TOP)/shlr
BTOP:=$(TOP)/binr
# added this so that we can just blast the
# dependency across the entire build -- deeso
LDFLAGS+= -L$(STOP)/zip -lr_zip
ifeq ($(MAKEFLAGS),s)
SILENT=1
else

View File

@ -2,7 +2,6 @@ include ../config.mk
NAME=r_io
DEPS=r_lib r_util r_socket r_cons
LDFLAGS+= -lr_zip
STATIC_OBJS=$(subst ..,p/..,$(subst io_,p/io_,$(STATIC_OBJ)))
OBJS=${STATIC_OBJS}
OBJS+=io.o plugin.o map.o section.o desc.o cache.o undo.o buffer.o

View File

@ -15,11 +15,19 @@ else
LINKFLAGS+=-L../../lib -lr_lib
LINKFLAGS+=-L../../util -lr_util
LINKFLAGS+=-L.. -L../../lib -lr_lib -lr_io
LINKFLAGS+=-L../../../shlr/zip/ -lr_zip
LINKFLAGS+=../../../shlr/zip/libr_zip.a
# XXX libr_zip is not installed so it fails at runtime
#LINKFLAGS+=-L../../../shlr/zip/ -lr_zip
endif
# TODO Merge!
LDFLAGS+=$(LTOP)/../shlr/zip/libr_zip.a
LDFLAGS+=$(LTOP)/../shlr/zip/libr_z.a
ZIPOBJS=${OBJ_ZIP}
# TODO: use make addprefix here
#ZIPFILES=zip_add.o ...
#ZIPOBJS+=$(addprefix ../../../shlr/zip/zip/, $ZIPFILES)
ZIPOBJS+= ../../../shlr/zip/zip/zip_add.o ../../../shlr/zip/zip/zip_add_dir.o
ZIPOBJS+= ../../../shlr/zip/zip/zip_add_entry.o ../../../shlr/zip/zip/zip_close.o
ZIPOBJS+=../../../shlr/zip/zip/zip_delete.o ../../../shlr/zip/zip/zip_dir_add.o
@ -63,9 +71,6 @@ ZIPOBJS+=../../../shlr/zip/zip/zip_unchange.o ../../../shlr/zip/zip/zip_unchange
ZIPOBJS+=../../../shlr/zip/zip/zip_unchange_archive.o ../../../shlr/zip/zip/zip_unchange_data.o
ZIPOBJS+=../../../shlr/zip/zip/zip_utf-8.o
${TARGET_ZIP}: ${OBJ_ZIP}
@echo ${LINKFLAGS}
${CC_LIB} $(call libname,io_zip) ${CFLAGS} -o ${TARGET_ZIP} ${OBJS} ${LINKFLAGS}

View File

@ -94,7 +94,6 @@ fs.ufs
fs.posix
fs.jfs
fs.minix
io.zip
fs.fb
fs.sfs
io.debug
@ -113,6 +112,7 @@ io.ihex
io.ptrace
io.procpid
io.shm
io.zip
parse.mreplace
parse.att2intel
parse.mips_pseudo

View File

@ -10,7 +10,7 @@ SDB_CONFIG=${PWD}/sdb-config.mk
all: sdb/sdb
@for a in ${MODS} ; do \
echo ${MAKE} -C $$a ; \
${MAKE} -C $$a HAVE_VALA= ROOT=${PWD}/../ ; \
${MAKE} -C $$a HAVE_VALA= ROOT=${PWD}/../ CC="${CC}" ; \
done
clean mrproper:
@ -32,7 +32,6 @@ $(SDBLIB) sdb/sdb:
${RANLIB} sdb/src/libsdb.a
cp -f sdb/src/.sdb sdb/sdb
.PHONY: sdb-sync sync-sdb sdbclean
F=README.md config.mk src Makefile
SYNCFILES=$(addprefix sdb.vc/,${F})
@ -86,7 +85,7 @@ D=${DESTDIR}/${PREFIX}
install:
mkdir -p ${D}/lib
cp -f tcc/libr_tcc* ${D}/lib
cp -f zip/libr_z* ${D}/lib
#cp -f zip/libr_z* ${D}/lib
install-symlink symstall:
mkdir -p ${D}/lib
@ -95,4 +94,4 @@ install-symlink symstall:
uninstall deinstall:
rm -f ${D}/lib/libr_tcc*
rm -f ${D}/lib/libr_z*
#rm -f ${D}/lib/libr_z*

12
shlr/zip/Makefile Normal file
View File

@ -0,0 +1,12 @@
include ../../config-user.mk
all: libr_zip.a libr_zip.${SOEXT}
libr_zip.a libr_zip.${SOEXT}:
${MAKE} -C zlib
${MAKE} -C zip
clean:
${MAKE} -C zlib clean
${MAKE} -C zip clean
rm *.a *.${SOEXT}

View File

@ -7,10 +7,10 @@ SOEXT=dylib
SOVER=${SOEXT}
LDFLAGS+=-dynamic
LDFLAGS_SHARED?=-fPIC -shared
ifeq (${ARCH},i386)
#ifeq (${ARCH},i386)
#CC+=-arch i386
CC+=-arch x86_64
endif
# CC+=-arch x86_64
#endif
else
SOVERSION=0
SOEXT=so
@ -52,7 +52,8 @@ OBJS= zip_add.o zip_add_dir.o zip_add_entry.o \
zip_unchange_archive.o zip_unchange_data.o zip_utf-8.o
OFILES=libr_zip.a $(OBJS)
#OFILES=libr_zip.a $(OBJS)
OFILES=$(OBJS)
#CFLAGS+=-g -ggdb -fPIC
CFLAGS+=-fPIC

View File

@ -7,10 +7,10 @@ SOEXT=dylib
SOVER=${SOEXT}
LDFLAGS+=-dynamic
LDFLAGS_SHARED?=-fPIC -shared
ifeq (${ARCH},i386)
# ifeq (${ARCH},i386)
#CC+=-arch i386
CC+=-arch x86_64
endif
# CC+=-arch x86_64
# endif
else
SOVERSION=0
SOEXT=so
@ -24,7 +24,8 @@ OBJS = adler32.o crc32.o deflate.o infback.o \
zutil.o compress.o uncompr.o gzclose.o \
gzlib.o gzread.o gzwrite.o
OFILES= libr_z.a $(OBJS)
#OFILES= libr_z.a $(OBJS)
OFILES= $(OBJS)
CFLAGS+=-fPIC -Wall
CFLAGS+=-I../../libr/include -I../include/