diff options
author | Timo Teräs <timo.teras@iki.fi> | 2017-10-05 10:57:45 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-10-05 16:59:14 +0300 |
commit | 86436fce2fe2364bbc9e705ddc92d7733fc8ed75 (patch) | |
tree | 9193dddcf9217194e1ac2e74ce920ecc1c349853 /libfetch | |
parent | 9dc6278c7b4ef41810b264ca99b597634511bda1 (diff) | |
download | apk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.tar.gz apk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.tar.bz2 apk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.tar.xz apk-tools-86436fce2fe2364bbc9e705ddc92d7733fc8ed75.zip |
build and use bundled libfetch natively
Diffstat (limited to 'libfetch')
-rw-r--r-- | libfetch/Makefile | 51 | ||||
-rw-r--r-- | libfetch/common.c | 15 | ||||
-rw-r--r-- | libfetch/fetch.c | 3 | ||||
-rw-r--r-- | libfetch/file.c | 3 | ||||
-rw-r--r-- | libfetch/ftp.c | 15 | ||||
-rw-r--r-- | libfetch/http.c | 22 |
6 files changed, 9 insertions, 100 deletions
diff --git a/libfetch/Makefile b/libfetch/Makefile index cfcef4b..6b183cb 100644 --- a/libfetch/Makefile +++ b/libfetch/Makefile @@ -1,45 +1,10 @@ -# $NetBSD: Makefile,v 1.8 2016/10/27 10:05:38 joerg Exp $ +CFLAGS_ALL += -DINET6 -DWITH_SSL -DFTP_COMBINE_CWDS +libs-y += libfetch.a +libfetch.a-objs := common.o fetch.o file.o ftp.o http.o +generate-y += ftperr.h httperr.h -LIB= fetch -SRCS= fetch.c common.c ftp.c http.c file.c -DPSRCS= ftperr.h httperr.h -INCS= fetch.h -MAN= fetch.3 -CLEANFILES= ftperr.h httperr.h -MKLINT= no -MKPIC= no -MKPROFILE= no +quiet_cmd_generr = GENERR $@ + cmd_generr = $(obj)/errlist.sh $(basename $(<F))_errlist $(shell echo $(basename $(<F)) | tr a-z A-Z) $< > $@ -.include <bsd.own.mk> - -CPPFLAGS+= -I. -CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 - -FETCH_WITH_INET6?= no -FETCH_WITH_OPENSSL?= no - -.if !empty(FETCH_WITH_INET6:M[yY][eE][sS]) -CPPFLAGS+= -DINET6 -.endif - -.if !empty(FETCH_WITH_OPENSSL:M[yY][eE][sS]) -CPPFLAGS+= -DWITH_SSL -LDADD= -lssl -lcrypto -.endif - -CPPFLAGS+= -DFTP_COMBINE_CWDS - -WARNS?= 4 - -ftp.o: ftperr.h -http.o: httperr.h - -ftperr.h: ${.CURDIR}/ftp.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh - sh ${.CURDIR}/errlist.sh ftp_errlist FTP \ - ${.CURDIR}/ftp.errors > ${.TARGET} - -httperr.h: ${.CURDIR}/http.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh - sh ${.CURDIR}/errlist.sh http_errlist HTTP \ - ${.CURDIR}/http.errors > ${.TARGET} - -.include <bsd.lib.mk> +$(obj)/%err.h: $(obj)/%.errors + @$(call echo-cmd,generr) $(cmd_generr); $(cmd_generr) diff --git a/libfetch/common.c b/libfetch/common.c index c1e1587..1fbd0d4 100644 --- a/libfetch/common.c +++ b/libfetch/common.c @@ -33,32 +33,19 @@ #if HAVE_CONFIG_H #include "config.h" #endif -#ifndef NETBSD -#include <nbcompat.h> -#endif +#include <poll.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <sys/uio.h> -#if HAVE_POLL_H -#include <poll.h> -#elif HAVE_SYS_POLL_H -#include <sys/poll.h> -#endif #include <netinet/in.h> #include <arpa/inet.h> #include <ctype.h> #include <errno.h> -#if defined(HAVE_INTTYPES_H) || defined(NETBSD) #include <inttypes.h> -#endif -#ifndef NETBSD -#include <nbcompat/netdb.h> -#else #include <netdb.h> -#endif #include <pwd.h> #include <stdarg.h> #include <stdlib.h> diff --git a/libfetch/fetch.c b/libfetch/fetch.c index c287097..78cec71 100644 --- a/libfetch/fetch.c +++ b/libfetch/fetch.c @@ -33,9 +33,6 @@ #if HAVE_CONFIG_H #include "config.h" #endif -#ifndef NETBSD -#include <nbcompat.h> -#endif #include <ctype.h> #include <errno.h> diff --git a/libfetch/file.c b/libfetch/file.c index b092fdf..a18d94c 100644 --- a/libfetch/file.c +++ b/libfetch/file.c @@ -33,9 +33,6 @@ #if HAVE_CONFIG_H #include "config.h" #endif -#ifndef NETBSD -#include <nbcompat.h> -#endif #include <sys/stat.h> diff --git a/libfetch/ftp.c b/libfetch/ftp.c index 79dcbbc..af6a964 100644 --- a/libfetch/ftp.c +++ b/libfetch/ftp.c @@ -57,17 +57,9 @@ * */ -#ifdef __linux__ -/* Keep this down to Linux, it can create surprises else where. */ -#define _GNU_SOURCE -#endif - #if HAVE_CONFIG_H #include "config.h" #endif -#ifndef NETBSD -#include <nbcompat.h> -#endif #include <sys/types.h> #include <sys/socket.h> @@ -78,17 +70,10 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> -#if defined(HAVE_INTTYPES_H) || defined(NETBSD) #include <inttypes.h> -#endif #include <stdarg.h> -#ifndef NETBSD -#include <nbcompat/netdb.h> -#include <nbcompat/stdio.h> -#else #include <netdb.h> #include <stdio.h> -#endif #include <stdlib.h> #include <string.h> #include <time.h> diff --git a/libfetch/http.c b/libfetch/http.c index d0882e2..6cf5aac 100644 --- a/libfetch/http.c +++ b/libfetch/http.c @@ -63,24 +63,12 @@ * SUCH DAMAGE. */ -#if defined(__linux__) || defined(__MINT__) || defined(__FreeBSD_kernel__) -/* Keep this down to Linux or MiNT, it can create surprises elsewhere. */ -/* - __FreeBSD_kernel__ is defined for GNU/kFreeBSD. - See http://glibc-bsd.alioth.debian.org/porting/PORTING . -*/ -#define _GNU_SOURCE -#endif - /* Needed for gmtime_r on Interix */ #define _REENTRANT #if HAVE_CONFIG_H #include "config.h" #endif -#ifndef NETBSD -#include <nbcompat.h> -#endif #include <sys/types.h> #include <sys/socket.h> @@ -89,11 +77,7 @@ #include <errno.h> #include <locale.h> #include <stdarg.h> -#ifndef NETBSD -#include <nbcompat/stdio.h> -#else #include <stdio.h> -#endif #include <stdlib.h> #include <string.h> #include <time.h> @@ -101,13 +85,7 @@ #include <netinet/in.h> #include <netinet/tcp.h> - -#ifndef NETBSD -#include <nbcompat/netdb.h> -#else #include <netdb.h> -#endif - #include <arpa/inet.h> #include "fetch.h" |