From 86436fce2fe2364bbc9e705ddc92d7733fc8ed75 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Thu, 5 Oct 2017 10:57:45 +0300 Subject: build and use bundled libfetch natively --- libfetch/Makefile | 51 ++++++++------------------------------------------- libfetch/common.c | 15 +-------------- libfetch/fetch.c | 3 --- libfetch/file.c | 3 --- libfetch/ftp.c | 15 --------------- libfetch/http.c | 22 ---------------------- 6 files changed, 9 insertions(+), 100 deletions(-) (limited to 'libfetch') 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 $( $@ -.include - -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 +$(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 -#endif +#include #include #include #include #include -#if HAVE_POLL_H -#include -#elif HAVE_SYS_POLL_H -#include -#endif #include #include #include #include -#if defined(HAVE_INTTYPES_H) || defined(NETBSD) #include -#endif -#ifndef NETBSD -#include -#else #include -#endif #include #include #include 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 -#endif #include #include 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 -#endif #include 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 -#endif #include #include @@ -78,17 +70,10 @@ #include #include #include -#if defined(HAVE_INTTYPES_H) || defined(NETBSD) #include -#endif #include -#ifndef NETBSD -#include -#include -#else #include #include -#endif #include #include #include 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 -#endif #include #include @@ -89,11 +77,7 @@ #include #include #include -#ifndef NETBSD -#include -#else #include -#endif #include #include #include @@ -101,13 +85,7 @@ #include #include - -#ifndef NETBSD -#include -#else #include -#endif - #include #include "fetch.h" -- cgit v1.2.3-60-g2f50