From: David van Moolenbroek Date: Sat, 6 Jun 2015 12:58:46 +0000 (+0000) Subject: isofs: do not link against libc X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=af4345b097464c1f67eb821ea6f0fba8ea66c952;p=minix.git isofs: do not link against libc This change requires a small patch to libc, in order to avoid that libminc has to pull in a large chunk of libc just for mktime(3). Change-Id: I48e598b3716eff626cac461f78a41e32334e6b28 --- diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c index ef48c93bf..c3824bb9c 100644 --- a/lib/libc/time/localtime.c +++ b/lib/libc/time/localtime.c @@ -1706,6 +1706,7 @@ timesub(const timezone_t sp, const time_t *const timep, return tmp; } +#if !defined(__minix) || !defined(_LIBMINC) char * ctime(const time_t *const timep) { @@ -1742,6 +1743,7 @@ ctime_rz(const timezone_t sp, const time_t * timep, char *buf) return NULL; return asctime_r(rtm, buf); } +#endif /* !defined(__minix) || !defined(_LIBMINC) */ /* ** Adapted from code provided by Robert Elz, who writes: diff --git a/minix/fs/isofs/Makefile b/minix/fs/isofs/Makefile index 17f1cc20b..0b66a7d5b 100644 --- a/minix/fs/isofs/Makefile +++ b/minix/fs/isofs/Makefile @@ -4,7 +4,7 @@ SRCS= main.c table.c mount.c super.c inode.c \ link.c utility.c path.c read.c susp.c susp_rock_ridge.c stadir.c DPADD+= ${LIBFSDRIVER} ${LIBBDEV} ${LIBSYS} ${LIBMINIXFS} -LDADD+= -lfsdriver -lbdev -lsys -lc -lminixfs +LDADD+= -lfsdriver -lbdev -lsys -lminixfs CPPFLAGS+= -DNR_BUFS=100 diff --git a/minix/lib/libminc/Makefile b/minix/lib/libminc/Makefile index db8b093f4..3239fa517 100644 --- a/minix/lib/libminc/Makefile +++ b/minix/lib/libminc/Makefile @@ -248,7 +248,7 @@ CLEANFILES+= ${f:C/\.o/.bc/} .for f in \ abort.o atexit.o _env.o exit.o getenv.o \ - ldiv.o malloc.o \ + ldiv.o malloc.o setenv.o \ _rand48.o lrand48.o srand48.o ${f} ${f:C/\.o/.bc/}: ${LIBCDIR}/stdlib/${f:C/\.o/.c/} OBJS+= ${f} @@ -308,6 +308,18 @@ CLEANFILES+= ${f:C/\.o/.bc/} .endif # ${USE_BITCODE:Uno} == "yes" .endfor +.for f in \ + localtime.o +${f} ${f:C/\.o/.bc/}: ${LIBCDIR}/time/${f:C/\.o/.c/} +OBJS+= ${f} +CLEANFILES+= ${f} + +.if ${USE_BITCODE:Uno} == "yes" +OBJS+= ${f:C/\.o/.bc/} +CLEANFILES+= ${f:C/\.o/.bc/} +.endif # ${USE_BITCODE:Uno} == "yes" +.endfor + ARCHSUBDIR=${MACHINE_CPU} .include "${NETBSDSRCDIR}/minix/lib/libc/arch/${MACHINE_CPU}/Makefile.inc"