diff options
author | Shaun Amott <shaun@FreeBSD.org> | 2006-11-23 16:44:44 +0000 |
---|---|---|
committer | Shaun Amott <shaun@FreeBSD.org> | 2006-11-23 16:44:44 +0000 |
commit | 9fed815c9bd34c4deda915eab1033e4a1a3d2254 (patch) | |
tree | d4dc18ddf0df90d5d895d836b5086264348c1fb6 /devel | |
parent | e762c47cd6ef189a90869c2df094cf3ace028661 (diff) | |
download | ports-9fed815c9bd34c4deda915eab1033e4a1a3d2254.tar.gz ports-9fed815c9bd34c4deda915eab1033e4a1a3d2254.zip |
Notes
Diffstat (limited to 'devel')
-rw-r--r-- | devel/Makefile | 1 | ||||
-rw-r--r-- | devel/make/Makefile | 39 | ||||
-rw-r--r-- | devel/make/distinfo | 3 | ||||
-rw-r--r-- | devel/make/files/freebsd.c | 117 | ||||
-rw-r--r-- | devel/make/files/freebsd.h | 16 | ||||
-rw-r--r-- | devel/make/pkg-descr | 1 |
6 files changed, 177 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index 7dcc7a6c0c99..8c5408a6491b 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -649,6 +649,7 @@ SUBDIR += m68k-rtems-gcc SUBDIR += m68k-rtems-gdb SUBDIR += m68k-rtems-objc + SUBDIR += make SUBDIR += make++ SUBDIR += makedepend SUBDIR += makeplus diff --git a/devel/make/Makefile b/devel/make/Makefile new file mode 100644 index 000000000000..e98006dfe960 --- /dev/null +++ b/devel/make/Makefile @@ -0,0 +1,39 @@ +# New ports collection makefile for: make +# Date Created: 2006-11-23 +# Whom: Shaun Amott <shaun@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= make +PORTVERSION= 20050524 +CATEGORIES= devel sysutils +MASTER_SITES= ${MASTER_SITE_LOCAL} +MASTER_SITE_SUBDIR= shaun +DISTNAME= pmake-${PORTVERSION} + +MAINTAINER= shaun@FreeBSD.org +COMMENT= Berkeley make, back-ported to FreeBSD 4.x + +WRKSRC= ${WRKDIR}/make + +MAN1= make.1 + +PLIST_FILES= bin/make + +.include <bsd.port.pre.mk> + +.if ${OSVERSION} >= 500000 +IGNORE= is already installed in the base system on FreeBSD 5.x and above +.endif + +post-extract: + @${REINPLACE_CMD} -e 's/^\(SRCS= *\)/\1freebsd.o /' ${WRKSRC}/Makefile + @${REINPLACE_CMD} -e 's/<stdint\.h>/"freebsd.h"/' ${WRKSRC}/*.[ch] + @${CP} ${FILESDIR}/freebsd.* ${WRKSRC} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/make ${PREFIX}/bin + ${INSTALL_MAN} ${WRKSRC}/${MAN1} ${MAN1PREFIX}/man/man1 + +.include <bsd.port.post.mk> diff --git a/devel/make/distinfo b/devel/make/distinfo new file mode 100644 index 000000000000..75e1b19ab9f4 --- /dev/null +++ b/devel/make/distinfo @@ -0,0 +1,3 @@ +MD5 (pmake-20050524.tar.gz) = f8d633008736cb48bb3aaaaefea81f68 +SHA256 (pmake-20050524.tar.gz) = eaa0ba23d17f149a1fa415036bc64ab86c25ebff1efe9f6575c88706792d4883 +SIZE (pmake-20050524.tar.gz) = 210701 diff --git a/devel/make/files/freebsd.c b/devel/make/files/freebsd.c new file mode 100644 index 000000000000..357d874e356b --- /dev/null +++ b/devel/make/files/freebsd.c @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <ctype.h> +#include <errno.h> +#include <stdlib.h> +#include <inttypes.h> +#include <freebsd.h> + +/* + * Convert a string to a uintmax_t integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +uintmax_t +strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + const char *s; + uintmax_t acc; + char c; + uintmax_t cutoff; + int neg, any, cutlim; + + /* + * See strtoimax for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace((unsigned char)c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = UINTMAX_MAX / base; + cutlim = UINTMAX_MAX % base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = UINTMAX_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} diff --git a/devel/make/files/freebsd.h b/devel/make/files/freebsd.h new file mode 100644 index 000000000000..275e0b12fea5 --- /dev/null +++ b/devel/make/files/freebsd.h @@ -0,0 +1,16 @@ +#ifndef _FREEBSD_H_ +#define _FREEBSD_H_ + +typedef signed long long intmax_t; +typedef unsigned long long uintmax_t; + +#define INT64_MIN (-0x7fffffffffffffffLL-1) +#define UINT64_MAX 0xffffffffffffffffULL + +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +uintmax_t strtoumax(const char * __restrict, char ** __restrict, int); + +#endif diff --git a/devel/make/pkg-descr b/devel/make/pkg-descr new file mode 100644 index 000000000000..2a470671812b --- /dev/null +++ b/devel/make/pkg-descr @@ -0,0 +1 @@ +This is Berkeley make, taken directly from a modern version of FreeBSD. |