Permalink
Browse files

Fix zip linkage (still wip)

  • Loading branch information...
1 parent 0bc95a2 commit c1dd901413b159ca0e8e182e1eee80e311813a8c @radare committed Nov 14, 2013
Showing with 35 additions and 22 deletions.
  1. +0 −4 global.mk
  2. +0 −1 libr/io/Makefile
  3. +9 −4 libr/io/p/zip.mk
  4. +1 −1 plugins.def.cfg
  5. +3 −4 shlr/Makefile
  6. +12 −0 shlr/zip/Makefile
  7. +5 −4 shlr/zip/zip/Makefile
  8. +5 −4 shlr/zip/zlib/Makefile
View
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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*
View
@@ -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}
@@ -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
@@ -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/

0 comments on commit c1dd901

Please sign in to comment.