Implemented support for working with remote repositories.
libfetch from NetBSD's pkgsrc has been imported into lib/fetch, but the objects are embedded into libxbps. Only a public function to fetch files has been implemented: xbps_fetch_file(). The library now is built with -fvisibility=hidden by default, and exported symbols are the ones that use the SYMEXPORT macro. The code works well enough, but will need many more cleanups. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091027004600-0lq9aao67lisbzxv
This commit is contained in:
78
lib/Makefile
78
lib/Makefile
@@ -1,49 +1,65 @@
|
||||
include ../vars.mk
|
||||
|
||||
# The shared library.
|
||||
MAJOR = 0
|
||||
MINOR = 0
|
||||
MICRO = 0
|
||||
LIBXBPS_SO = $(LIBXBPS).$(MAJOR).$(MINOR).$(MICRO)
|
||||
LIBXBPS = libxbps.so
|
||||
LIBXBPS_STATIC = libxbps.a
|
||||
LIBXBPS_LDFLAGS = -larchive -lprop -shared -Wl,-soname,$(LIBXBPS).$(MAJOR)
|
||||
INET6 ?= yes
|
||||
SSL ?= yes
|
||||
LIBS = -larchive -lprop
|
||||
|
||||
OBJECTS = configure.o cmpver.o depends.o fexec.o findpkg.o
|
||||
OBJECTS += humanize_number.o orphans.o plist.o purge.o register.o remove.o
|
||||
OBJECTS += repository.o requiredby.o sha256.o sortdeps.o state.o unpack.o
|
||||
OBJECTS += util.o
|
||||
ifdef SSL
|
||||
CPPFLAGS += -DWITH_SSL
|
||||
LIBS += -lssl -lcrypto
|
||||
endif
|
||||
|
||||
all: $(LIBXBPS) $(LIBXBPS_STATIC)
|
||||
ifdef INET6
|
||||
CPPFLAGS += -DINET6
|
||||
endif
|
||||
|
||||
ifdef DEBUG
|
||||
CPPFLAGS += -DDEBUG
|
||||
endif
|
||||
|
||||
LIBMAJOR = 0
|
||||
LIBMINOR = 0
|
||||
LIBMICRO = 0
|
||||
LIBXBPS_SHLIB = libxbps.so.$(LIBMAJOR).$(LIBMINOR).$(LIBMICRO)
|
||||
LIBXBPS_LDFLAGS = $(LIBS) -shared -Wl,-soname,libxbps.so.$(LIBMAJOR)
|
||||
|
||||
# libfetch
|
||||
OBJS = fetch/common.o fetch/fetch.o fetch/file.o fetch/ftp.o fetch/http.o
|
||||
|
||||
# libxbps
|
||||
OBJS += configure.o cmpver.o depends.o download.o fexec.o findpkg.o
|
||||
OBJS += humanize_number.o orphans.o plist.o purge.o register.o remove.o
|
||||
OBJS += repository.o requiredby.o sha256.o sortdeps.o state.o unpack.o
|
||||
OBJS += util.o
|
||||
|
||||
all: libfetch libxbps.so libxbps.a
|
||||
.PHONY: all
|
||||
|
||||
$(LIBXBPS): $(OBJECTS)
|
||||
$(CC) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SO)
|
||||
-ln -sf $(LIBXBPS_SO) $(LIBXBPS).$(MAJOR)
|
||||
-ln -sf $(LIBXBPS_SO) $(LIBXBPS)
|
||||
libfetch:
|
||||
$(MAKE) -C fetch
|
||||
|
||||
$(LIBXBPS_STATIC): $(OBJECTS)
|
||||
libxbps.so: $(OBJS)
|
||||
$(CC) $(LIBXBPS_LDFLAGS) $^ -o $(LIBXBPS_SHLIB)
|
||||
-ln -sf $(LIBXBPS_SHLIB) libxbps.so.$(LIBMAJOR)
|
||||
-ln -sf $(LIBXBPS_SHLIB) libxbps.so
|
||||
|
||||
libxbps.a: $(OBJS)
|
||||
$(AR) rcs $@ $^
|
||||
ranlib $@
|
||||
|
||||
.PHONY: install
|
||||
install: $(LIBXBPS) $(LIBXBPS_STATIC)
|
||||
install: all
|
||||
install -d $(LIBDIR)
|
||||
install -m 644 $(LIBXBPS_STATIC) $(LIBDIR)
|
||||
install -m 644 $(LIBXBPS_SO) $(LIBDIR)
|
||||
cp -a $(LIBXBPS) $(LIBDIR)
|
||||
cp -a $(LIBXBPS).$(MAJOR) $(LIBDIR)
|
||||
install -m 644 libxbps.a $(LIBDIR)
|
||||
install -m 644 $(LIBXBPS_SHLIB) $(LIBDIR)
|
||||
cp -a libxbps.so $(LIBDIR)
|
||||
cp -a libxbps.so.$(LIBMAJOR) $(LIBDIR)
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
-rm -f $(LIBDIR)/libxbps.*
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-lib clean-objs
|
||||
|
||||
clean-lib:
|
||||
-rm -f $(LIBXBPS)*
|
||||
-rm -f $(LIBXBPS_STATIC)
|
||||
|
||||
clean-objs:
|
||||
-rm -f *.o
|
||||
clean:
|
||||
-rm -f libxbps* $(OBJS)
|
||||
$(MAKE) -C fetch clean
|
||||
|
||||
Reference in New Issue
Block a user