diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-10-04 23:26:55 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-10-04 23:26:55 +0000 |
commit | eb2ecd0b083611bdd07c5352ffc9cfa22e0de711 (patch) | |
tree | 5e61cf2b2ddc07dd19b577b7bfa3f83b81f7de8a | |
parent | 4d6ba4ccf89262743eb2093474a571decb455d27 (diff) |
Fix all the makefiles. Clean up some warnings, cleanup some headers.
-Erik
-rw-r--r-- | Makefile | 86 | ||||
-rw-r--r-- | include/a.out.h | 115 | ||||
-rw-r--r-- | include/alloca.h | 41 | ||||
-rw-r--r-- | include/features.h | 6 | ||||
-rw-r--r-- | include/regex.h | 18 | ||||
-rw-r--r-- | include/stdlib.h | 140 | ||||
-rw-r--r-- | libc/inet/Makefile | 61 | ||||
-rw-r--r-- | libc/inet/rpc/Makefile | 52 | ||||
-rw-r--r-- | libc/misc/regex/Makefile | 37 | ||||
-rw-r--r-- | libc/misc/regex/rx.c | 36 | ||||
-rw-r--r-- | libc/misc/time/Makefile | 37 | ||||
-rw-r--r-- | libc/pwd_grp/Makefile | 30 | ||||
-rw-r--r-- | libc/stdio/Makefile | 66 | ||||
-rw-r--r-- | libc/stdlib/Makefile | 50 | ||||
-rw-r--r-- | libc/stdlib/malloc/Makefile | 32 | ||||
-rw-r--r-- | libc/string/Makefile | 42 | ||||
-rw-r--r-- | libc/sysdeps/Makefile | 47 | ||||
-rw-r--r-- | libc/sysdeps/linux/Makefile | 52 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/Makefile | 37 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/kernel_version.c | 115 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/Makefile | 54 | ||||
-rw-r--r-- | libc/termios/Makefile | 55 | ||||
-rw-r--r-- | libc/termios/termios.c | 4 | ||||
-rw-r--r-- | test/Makefile | 57 |
24 files changed, 678 insertions, 592 deletions
@@ -1,62 +1,54 @@ -DIRS = headers error getent malloc-simple misc regex stdio2 \ +# Makefile for uCLibc +# +# Copyright (C) 2000 by Lineo, inc. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU Library General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA +# +# Derived in part from the Linux-8086 C library, the GNU C Library, and several +# other sundry sources. Files within this library are copyright by their +# respective copyright holders. + +DIRS = error getent malloc misc regex stdio \ string termios time sysdeps #rpc - all: libc.a -libc.a: $(DIRS) dummy +libc.a: subdirs headers @echo @echo Finally finished compiling... @echo $(CROSS)ranlib $@ -headers: dummy - if [ ! -L "include/asm" ]; then ln -s /usr/src/linux/include/asm include/asm ; fi - if [ ! -L "include/net" ]; then ln -s /usr/src/linux/include/net include/net ; fi - if [ ! -L "include/linux" ]; then ln -s /usr/src/linux/include/linux include/linux ; fi - -error: dummy - make -C error - -getent: dummy - make -C getent - -malloc-simple: dummy - make -C malloc-simple - -misc: dummy - make -C misc - -net: dummy - make -C net - -regex: dummy - make -C regex - -rpc: dummy - make -C rpc -stdio2: dummy - make -C stdio2 - -string: dummy - make -C string - -sysdeps: dummy - make -C sysdeps - -termios: dummy - make -C termios - -time: dummy - make -C time +headers: dummy + @if [ ! -L "include/asm" ]; then ln -s /usr/src/linux/include/asm include/asm ; fi + @if [ ! -L "include/net" ]; then ln -s /usr/src/linux/include/net include/net ; fi + @if [ ! -L "include/linux" ]; then ln -s /usr/src/linux/include/linux include/linux ; fi tags: ctags -R -dummy: +clean: subdirs_clean + +subdirs: $(patsubst %, _dir_%, $(DIRS)) +subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS)) + +$(patsubst %, _dir_%, $(DIRS)) : dummy + $(MAKE) -C $(patsubst _dir_%, %, $@) + +$(patsubst %, _dirclean_%, $(DIRS)) : dummy + $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean -clean: - -rm -f `find -name \*.[oa]` `find -name \*~` core - -rm -rf include/asm include/net include/linux - make -C test clean +.PHONY: dummy diff --git a/include/a.out.h b/include/a.out.h deleted file mode 100644 index bd58346c1..000000000 --- a/include/a.out.h +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 1990-1996 - * This file is part of the ld86 command for Linux-86 - * It is distributed under the GNU Library General Public License. - * - * - This may actually be BSD or Minix code, can someone clarify please. -RDB - */ - -#ifndef __AOUT_H -#define __AOUT_H - -struct exec { /* a.out header */ - unsigned char a_magic[2]; /* magic number */ - unsigned char a_flags; /* flags, see below */ - unsigned char a_cpu; /* cpu id */ - unsigned char a_hdrlen; /* length of header */ - unsigned char a_unused; /* reserved for future use */ - unsigned short a_version; /* version stamp (not used at present) */ - long a_text; /* size of text segement in bytes */ - long a_data; /* size of data segment in bytes */ - long a_bss; /* size of bss segment in bytes */ - long a_entry; /* entry point */ - long a_total; /* total memory allocated */ - long a_syms; /* size of symbol table */ - - /* SHORT FORM ENDS HERE */ - long a_trsize; /* text relocation size */ - long a_drsize; /* data relocation size */ - long a_tbase; /* text relocation base */ - long a_dbase; /* data relocation base */ -}; - -#define A_MAGIC0 (unsigned char) 0x01 -#define A_MAGIC1 (unsigned char) 0x03 -#define BADMAG(X) ((X).a_magic[0] != A_MAGIC0 ||(X).a_magic[1] != A_MAGIC1) - -/* CPU Id of TARGET machine (byte order coded in low order two bits) */ -#define A_NONE 0x00 /* unknown */ -#define A_I8086 0x04 /* intel i8086/8088 */ -#define A_M68K 0x0B /* motorola m68000 */ -#define A_NS16K 0x0C /* national semiconductor 16032 */ -#define A_I80386 0x10 /* intel i80386 */ -#define A_SPARC 0x17 /* Sun SPARC */ - -#define A_BLR(cputype) ((cputype&0x01)!=0) /* TRUE if bytes left-to-right */ -#define A_WLR(cputype) ((cputype&0x02)!=0) /* TRUE if words left-to-right */ - -/* Flags. */ -#define A_UZP 0x01 /* unmapped zero page (pages) */ -#define A_PAL 0x02 /* page aligned executable */ -#define A_NSYM 0x04 /* new style symbol table */ -#define A_EXEC 0x10 /* executable */ -#define A_SEP 0x20 /* separate I/D */ -#define A_PURE 0x40 /* pure text */ -#define A_TOVLY 0x80 /* text overlay */ - -/* Offsets of various things. */ -#define A_MINHDR 32 -#define A_TEXTPOS(X) ((long)(X).a_hdrlen) -#define A_DATAPOS(X) (A_TEXTPOS(X) + (X).a_text) -#define A_HASRELS(X) ((X).a_hdrlen > (unsigned char) A_MINHDR) -#define A_HASEXT(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 8)) -#define A_HASLNS(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 16)) -#define A_HASTOFF(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 24)) -#define A_TRELPOS(X) (A_DATAPOS(X) + (X).a_data) -#define A_DRELPOS(X) (A_TRELPOS(X) + (X).a_trsize) -#define A_SYMPOS(X) (A_TRELPOS(X) + (A_HASRELS(X) ? \ - ((X).a_trsize + (X).a_drsize) : 0)) - -struct reloc { - long r_vaddr; /* virtual address of reference */ - unsigned short r_symndx; /* internal segnum or extern symbol num */ - unsigned short r_type; /* relocation type */ -}; - -/* r_tyep values: */ -#define R_ABBS 0 -#define R_RELLBYTE 2 -#define R_PCRBYTE 3 -#define R_RELWORD 4 -#define R_PCRWORD 5 -#define R_RELLONG 6 -#define R_PCRLONG 7 -#define R_REL3BYTE 8 -#define R_KBRANCHE 9 - -/* r_symndx for internal segments */ -#define S_ABS ((unsigned short)-1) -#define S_TEXT ((unsigned short)-2) -#define S_DATA ((unsigned short)-3) -#define S_BSS ((unsigned short)-4) - -struct nlist { /* symbol table entry */ - char n_name[8]; /* symbol name */ - long n_value; /* value */ - unsigned char n_sclass; /* storage class */ - unsigned char n_numaux; /* number of auxiliary entries (not used) */ - unsigned short n_type; /* language base and derived type (not used) */ -}; - -/* Low bits of storage class (section). */ -#define N_SECT 07 /* section mask */ -#define N_UNDF 00 /* undefined */ -#define N_ABS 01 /* absolute */ -#define N_TEXT 02 /* text */ -#define N_DATA 03 /* data */ -#define N_BSS 04 /* bss */ -#define N_COMM 05 /* (common) */ - -/* High bits of storage class. */ -#define N_CLASS 0370 /* storage class mask */ -#define C_NULL -#define C_EXT 0020 /* external symbol */ -#define C_STAT 0030 /* static */ - -#endif /* _AOUT_H */ diff --git a/include/alloca.h b/include/alloca.h deleted file mode 100644 index 741eca743..000000000 --- a/include/alloca.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 1992, 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _ALLOCA_H -#define _ALLOCA_H 1 - -#include <features.h> - -#define __need_size_t -#include <stddef.h> - -__BEGIN_DECLS - -/* Remove any previous definitions. */ -#undef alloca - -/* Allocate a block that will be freed when the calling function exits. */ -extern __ptr_t alloca __P ((size_t __size)); - -#ifdef __GNUC__ -# define alloca(size) __builtin_alloca (size) -#endif /* GCC. */ - -__END_DECLS - -#endif /* alloca.h */ diff --git a/include/features.h b/include/features.h index d97a1aff2..dd2c5ae03 100644 --- a/include/features.h +++ b/include/features.h @@ -9,6 +9,11 @@ #define __UCLIBC_MAJOR__ 9 #define __UCLIBC_MINOR__ 1 +/* Make a half-hearted attempt to accomodate non-gcc compilers */ +#ifndef __GNUC__ +#define __attribute(foo) /* Ignore */ +#endif + /* __restrict is known in EGCS 1.2 and above. */ #if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 92) # define __restrict /* Ignore */ @@ -49,6 +54,7 @@ #define __USE_POSIX2 #define _POSIX_THREAD_SAFE_FUNCTIONS + #include <sys/cdefs.h> diff --git a/include/regex.h b/include/regex.h index 813882c42..64a8de685 100644 --- a/include/regex.h +++ b/include/regex.h @@ -1568,9 +1568,9 @@ typedef void (*rx_hash_freefn) (); #ifdef __STDC__ -RX_DECL int rx_bitset_is_equal (int size, rx_Bitset a, rx_Bitset b); +//RX_DECL int rx_bitset_is_equal (int size, rx_Bitset a, rx_Bitset b); RX_DECL int rx_bitset_is_subset (int size, rx_Bitset a, rx_Bitset b); -RX_DECL int rx_bitset_empty (int size, rx_Bitset set); +//RX_DECL int rx_bitset_empty (int size, rx_Bitset set); RX_DECL void rx_bitset_null (int size, rx_Bitset b); RX_DECL void rx_bitset_universe (int size, rx_Bitset b); RX_DECL void rx_bitset_complement (int size, rx_Bitset b); @@ -1579,9 +1579,9 @@ RX_DECL void rx_bitset_union (int size, rx_Bitset a, rx_Bitset b); RX_DECL void rx_bitset_intersection (int size, rx_Bitset a, rx_Bitset b); RX_DECL void rx_bitset_difference (int size, rx_Bitset a, rx_Bitset b); -RX_DECL void rx_bitset_revdifference (int size, - rx_Bitset a, rx_Bitset b); -RX_DECL void rx_bitset_xor (int size, rx_Bitset a, rx_Bitset b); +//RX_DECL void rx_bitset_revdifference (int size, +// rx_Bitset a, rx_Bitset b); +//RX_DECL void rx_bitset_xor (int size, rx_Bitset a, rx_Bitset b); RX_DECL unsigned long rx_bitset_hash (int size, rx_Bitset b); RX_DECL struct rx_hash_item * rx_hash_find (struct rx_hash * table, unsigned long hash, @@ -1616,8 +1616,8 @@ RX_DECL struct rexp_node * rx_mk_r_2phase_star (struct rx * rx, struct rexp_node * b); RX_DECL struct rexp_node * rx_mk_r_side_effect (struct rx * rx, rx_side_effect a); -RX_DECL struct rexp_node * rx_mk_r_data (struct rx * rx, - void * a); +//RX_DECL struct rexp_node * rx_mk_r_data (struct rx * rx, +// void * a); RX_DECL void rx_free_rexp (struct rx * rx, struct rexp_node * node); RX_DECL struct rexp_node * rx_copy_rexp (struct rx *rx, struct rexp_node *node); @@ -2803,8 +2803,8 @@ rx_search (rxb, startpos, range, stop, total_size, */ { - struct rx_inx * next_tr_table; - struct rx_inx * this_tr_table; + struct rx_inx * next_tr_table = NULL; + struct rx_inx * this_tr_table = NULL; /* The fastest route through the loop is when the instruction * is RX_NEXT_CHAR. This case is detected when SEARCH_STATE.IFR->DATA diff --git a/include/stdlib.h b/include/stdlib.h index d323d099b..b1ae61d06 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,6 +1,7 @@ -/* stdlib.h <ndf@linux.mit.edu> */ +/* stdlib.h */ #include <features.h> #include <sys/types.h> +#include <limits.h> #ifndef __STDLIB_H #define __STDLIB_H @@ -10,102 +11,101 @@ #define NULL ((void *) 0) #endif -/* For program termination */ -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS 0 +/* We define these the same for all machines. + * Changes from this to the outside world should be done in `_exit'. */ +#define EXIT_FAILURE 1 /* Failing exit status. */ +#define EXIT_SUCCESS 0 /* Successful exit status. */ -/* Call all functions registered with `atexit' and `on_exit', - * in the reverse of the order in which they were registered - * perform stdio cleanup, and terminate program execution with STATUS. */ -extern void exit __P ((int __status)) __attribute__ ((__noreturn__)); -/* Register a function to be called when `exit' is called. */ -extern int atexit __P ((void (*__func) (void))); -/* Abort execution and generate a core-dump. */ -extern void abort __P ((void)) __attribute__ ((__noreturn__)); +/* The largest number rand will return */ +#define RAND_MAX INT_MIN -extern void * malloc __P ((size_t)); -extern void * calloc __P ((size_t, size_t)); -extern void free __P ((void *)); -extern void * realloc __P ((void *, size_t)); +/* Maximum length of a multibyte character in the current locale. */ +#define MB_CUR_MAX 1 -#if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC -# include <alloca.h> -#endif /* Use GNU, BSD, or misc. */ +typedef struct +{ + int quot; /* Quotient. */ + int rem; /* Remainder. */ +} div_t; -#ifdef DEBUG_MALLOC +typedef struct +{ + long int quot; /* Quotient. */ + long int rem; /* Remainder. */ +} ldiv_t; -extern void * malloc_dbg __P ((size_t, char* func, char* file, int line)); -extern void * calloc_dbg __P ((size_t, size_t, char* func, char* file, int line)); -extern void free_dbg __P ((void *, char* func, char* file, int line)); -extern void * realloc_dbg __P ((void *, size_t, char* func, char* file, int line)); +/* comparison function used by bsearch() and qsort() */ +typedef int (*__compar_fn_t) __P ((__const __ptr_t, __const __ptr_t)); +typedef __compar_fn_t comparison_fn_t; -#define malloc(x) malloc_dbg((x),__FUNCTION__,__FILE__,__LINE__) -#define calloc(x,y) calloc_dbg((x),(y),__FUNCTION__,__FILE__,__LINE__) -#define free(x) free_dbg((x),__FUNCTION__,__FILE__,__LINE__) -#define realloc(x) realloc((x),__FUNCTION__,__FILE__,__LINE__) +/* String to number conversion functions */ +#define atof(x) strtod((x),(char**)0) +#define atoi(x) (int)strtol((x),(char**)0,10) +#define atol(x) strtol((x),(char**)0,10) +extern long strtol __P ((const char * nptr, char ** endptr, int base)); +extern unsigned long strtoul __P ((const char * nptr, char ** endptr, int base)); +#ifndef __HAS_NO_FLOATS__ +extern char * gcvt __P ((float number, size_t ndigit, char * buf)); +extern float strtod __P ((const char * nptr, char ** endptr)); #endif + + +/* Random number functions */ extern int rand __P ((void)); extern void srand __P ((unsigned int seed)); -extern long strtol __P ((const char * nptr, char ** endptr, int base)); -extern unsigned long strtoul __P ((const char * nptr, - char ** endptr, int base)); -#ifndef __HAS_NO_FLOATS__ -extern float strtod __P ((const char * nptr, char ** endptr)); + +/* Memory management functions */ +extern __ptr_t alloca __P ((size_t __size)); +extern __ptr_t calloc __P ((size_t, size_t)); +extern __ptr_t malloc __P ((size_t)); +extern __ptr_t realloc __P ((__ptr_t, size_t)); +extern void free __P ((__ptr_t)); + +#ifdef DEBUG_MALLOC +extern __ptr_t malloc_dbg __P ((size_t, char* func, char* file, int line)); +extern __ptr_t calloc_dbg __P ((size_t, size_t, char* func, char* file, int line)); +extern void free_dbg __P ((__ptr_t, char* func, char* file, int line)); +extern __ptr_t realloc_dbg __P ((__ptr_t, size_t, char* func, char* file, int line)); +#define malloc(x) malloc_dbg((x),__FUNCTION__,__FILE__,__LINE__) +#define calloc(x,y) calloc_dbg((x),(y),__FUNCTION__,__FILE__,__LINE__) +#define free(x) free_dbg((x),__FUNCTION__,__FILE__,__LINE__) +#define realloc(x) realloc((x),__FUNCTION__,__FILE__,__LINE__) #endif -extern char *getenv __P ((__const char *__name)); -extern int putenv __P ((__const char *__string)); +/* System and environment functions */ +extern void abort __P ((void)) __attribute__ ((__noreturn__)); +extern int atexit __P ((void (*__func) (void))); +extern void exit __P ((int __status)) __attribute__ ((__noreturn__)); +extern void _exit __P ((int __status)) __attribute__ ((__noreturn__)); +extern char *getenv __P ((__const char *__name)); +extern int putenv __P ((__const char *__string)); +extern char *realpath __P ((__const char *__restrict __name, + char *__restrict __resolved)); extern int setenv __P ((__const char *__name, __const char *__value, int __replace)); -extern void unsetenv __P ((__const char *__name)); - extern int system __P ((__const char *__command)); +extern void unsetenv __P ((__const char *__name)); -extern char * gcvt __P ((float number, size_t ndigit, char * buf)); - -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED -/* Return the canonical absolute name of file NAME. The last file name - * component need not exist, and may be a symlink to a nonexistent file. - * If RESOLVED is null, the result is malloc'd; otherwise, if the canonical - * name is PATH_MAX chars or more, returns null with `errno' set to - * ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the - * name in RESOLVED. */ -extern char *realpath __P ((__const char *__restrict __name, - char *__restrict __resolved)); -#endif -/* Shorthand for type of comparison functions. */ -typedef int (*__compar_fn_t) __P ((__const __ptr_t, __const __ptr_t)); -typedef __compar_fn_t comparison_fn_t; -/* Sort NMEMB elements of BASE, of SIZE bytes each, - using COMPAR to perform the comparisons. */ +/* Search and sort functions */ +extern __ptr_t bsearch __P ((__const __ptr_t __key, __const __ptr_t __base, + size_t __nmemb, size_t __size, __compar_fn_t __compar)); extern void qsort __P ((__ptr_t __base, size_t __nmemb, size_t __size, __compar_fn_t __compar)); -#define atof(x) strtod((x),(char**)0) -#define atoi(x) (int)strtol((x),(char**)0,10) -#define atol(x) strtol((x),(char**)0,10) -/* Returned by `div'. */ -typedef struct - { - int quot; /* Quotient. */ - int rem; /* Remainder. */ - } div_t; - -/* Returned by `ldiv'. */ -typedef struct - { - long int quot; /* Quotient. */ - long int rem; /* Remainder. */ - } ldiv_t; +/* Integer math functions */ +extern int abs __P ((int __x)) __attribute__ ((__const__)); +extern div_t div __P ((int __numer, int __denom)) __attribute__ ((__const__)); +extern long int labs __P ((long int __x)) __attribute__ ((__const__)); +extern ldiv_t ldiv __P ((long int __numer, long int __denom)) __attribute__ ((__const__)); diff --git a/libc/inet/Makefile b/libc/inet/Makefile index b73a5499e..519501180 100644 --- a/libc/inet/Makefile +++ b/libc/inet/Makefile @@ -1,37 +1,50 @@ -# Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk> -# Copyright (C) 1998-1999 D. Jeff Dionne <jeff@rt-control.com> -# Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com> -# Copyright (C) 1999 D. Jeff Dionne <jeff@rt-control.com> -# under the GNU Library General Public License. +# Makefile for uCLibc +# +# Copyright (C) 2000 by Lineo, inc. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU Library General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA +# +# Derived in part from the Linux-8086 C library, the GNU C Library, and several +# other sundry sources. Files within this library are copyright by their +# respective copyright holders. TOPDIR=../ include $(TOPDIR)Rules.make +LIBC=$(TOPDIR)libc.a -LIBC=../libc.a +MSRC=addr.c +MOBJ=inet_aton.o inet_addr.o inet_ntoa.o -ASRC=addr.c -AOBJ=inet_aton.o inet_addr.o inet_ntoa.o +MSRC2=resolv.c +MOBJ2=encodeh.o decodeh.o encoded.o decoded.o lengthd.o encodeq.o \ + decodeq.o lengthq.o encodea.o decodea.o encodep.o decodep.o \ + formquery.o dnslookup.o resolveaddress.o resolvemailbox.o \ + opennameservers.o closenameservers.o resolvename.o gethostbyname.o\ + gethostbyaddr.o -RSRC=resolv.c -ROBJ= encodeh.o decodeh.o encoded.o decoded.o lengthd.o encodeq.o \ -decodeq.o lengthq.o encodea.o decodea.o encodep.o decodep.o \ -formquery.o dnslookup.o resolveaddress.o resolvemailbox.o \ -opennameservers.o closenameservers.o resolvename.o gethostbyname.o\ -gethostbyaddr.o +all: $(MOBJ) $(MOBJ2) $(LIBC) -OBJ=$(AOBJ) $(ROBJ) +$(LIBC): $(MOBJ) $(MOBJ2) + $(AR) $(ARFLAGS) $(LIBC) $(MOBJ) $(MOBJ2) -all: $(LIBC) - -$(LIBC): $(LIBC)($(OBJ)) - -$(LIBC)($(AOBJ)): $(ASRC) +$(MOBJ): $(MSRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(AR) $(ARFLAGS) $@ $*.o -$(LIBC)($(ROBJ)): $(RSRC) +$(MOBJ2): $(MSRC2) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(AR) $(ARFLAGS) $@ $*.o clean: - rm -f *.o libc.a + rm -f *.[oa] *~ core + diff --git a/libc/inet/rpc/Makefile b/libc/inet/rpc/Makefile index e2c867703..907d55deb 100644 --- a/libc/inet/rpc/Makefile +++ b/libc/inet/rpc/Makefile @@ -1,25 +1,49 @@ +# Makefile for uCLibc +# +# Copyright (C) 2000 by Lineo, inc. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU Library General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA +# +# Derived in part from the Linux-8086 C library, the GNU C Library, and several +# other sundry sources. Files within this library are copyright by their +# respective copyright holders. + TOPDIR=../ include $(TOPDIR)Rules.make +LIBC=$(TOPDIR)libc.a CFLAGS+=-I$(TOPDIR)include/linux -OBJS = auth_none.o auth_unix.o authunix_prot.o \ - bindresvport.o clnt_generic.o clnt_perror.o \ - clnt_raw.o clnt_simple.o clnt_tcp.o clnt_udp.o \ - get_myaddress.o getrpcent.o getrpcport.o pmap_clnt.o \ - pmap_getmaps.o pmap_getport.o pmap_prot.o pmap_prot2.o \ - pmap_rmt.o rpc_callmsg.o rpc_commondata.o \ - rpc_dtablesize.o rpc_prot.o svc.o svc_auth.o \ - svc_auth_unix.o svc_raw.o svc_run.o svc_simple.o \ - svc_tcp.o svc_udp.o xdr.o xdr_array.o xdr_float.o \ - xdr_mem.o xdr_rec.o xdr_reference.o xdr_stdio.o +CSRC = auth_none.c auth_unix.c authunix_prot.c \ + bindresvport.c clnt_generic.c clnt_perror.c \ + clnt_raw.c clnt_simple.c clnt_tcp.c clnt_udp.c \ + get_myaddress.c getrpcent.c getrpcport.c pmap_clnt.c \ + pmap_getmaps.c pmap_getport.c pmap_prot.c pmap_prot2.c \ + pmap_rmt.c rpc_callmsg.c rpc_commondata.c \ + rpc_dtablesize.c rpc_prot.c svc.c svc_auth.c \ + svc_auth_unix.c svc_raw.c svc_run.c svc_simple.c \ + svc_tcp.c svc_udp.c xdr.c xdr_array.c xdr_float.c \ + xdr_mem.c xdr_rec.c xdr_reference.c xdr_stdio.c +COBJS=$(patsubst %.c,%.o, $(CSRC)) -LIBC = ../libc.a +all: $(COBJS) $(LIBC) -all: $(LIBC) +$(LIBC): $(COBJS) + $(AR) $(ARFLAGS) $(LIBC) $(COBJS) -$(LIBC): $(LIBC)($(OBJS)) +$(COBJS): $(CSRC) clean: rm -f *.[oa] *~ core - diff --git a/libc/misc/regex/Makefile b/libc/misc/regex/Makefile index c6c8d8e52..ad0745020 100644 --- a/libc/misc/regex/Makefile +++ b/libc/misc/regex/Makefile @@ -1,17 +1,36 @@ +# Makefile for uCLibc +# +# Copyright (C) 2000 by Lineo, inc. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU Library General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA +# +# Derived in part from the Linux-8086 C library, the GNU C Library, and several +# other sundry sources. Files within this library are copyright by their +# respective copyright holders. + TOPDIR=../ include $(TOPDIR)Rules.make - -LIBC=../libc.a +LIBC=$(TOPDIR)libc.a OBJ=rx.o -all: $(LIBC) +all: $(OBJ) $(LIBC) -$(LIBC): $(LIBC)($(OBJ)) - -$(LIBC)(rx.o): rx.c - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(AR) $(ARFLAGS) $@ $*.o +$(LIBC): $(OBJ) + $(AR) $(ARFLAGS) $(LIBC) $(OBJ) clean: - rm -f libc.a *.o core mon.out timer.t.h dMakefile dtr try timer + rm -f *.[oa] *~ core + diff --git a/libc/misc/regex/rx.c b/libc/misc/regex/rx.c index 8e85782f2..1abff8cc5 100644 --- a/libc/misc/regex/rx.c +++ b/libc/misc/regex/rx.c @@ -161,8 +161,8 @@ RX_DECL struct rexp_node struct rexp_node *); RX_DECL struct rexp_node *rx_mk_r_side_effect (struct rx *, rx_side_effect); -RX_DECL struct rexp_node - *rx_mk_r_data (struct rx *, void *); +//RX_DECL struct rexp_node +// *rx_mk_r_data (struct rx *, void *); RX_DECL void rx_free_rexp (struct rx *, struct rexp_node *); RX_DECL struct rexp_node *rx_copy_rexp (struct rx *, struct rexp_node *); @@ -486,9 +486,9 @@ print_fastmap (fm) /* This page: Bitsets. Completely unintersting. */ -RX_DECL int rx_bitset_is_equal (int, rx_Bitset, rx_Bitset); +//RX_DECL int rx_bitset_is_equal (int, rx_Bitset, rx_Bitset); RX_DECL int rx_bitset_is_subset (int, rx_Bitset, rx_Bitset); -RX_DECL int rx_bitset_empty (int, rx_Bitset); +//RX_DECL int rx_bitset_empty (int, rx_Bitset); RX_DECL void rx_bitset_null (int, rx_Bitset); RX_DECL void rx_bitset_complement (int, rx_Bitset); RX_DECL void rx_bitset_complement (int, rx_Bitset); @@ -496,11 +496,14 @@ RX_DECL void rx_bitset_assign (int, rx_Bitset, rx_Bitset); RX_DECL void rx_bitset_union (int, rx_Bitset, rx_Bitset); RX_DECL void rx_bitset_intersection (int, rx_Bitset, rx_Bitset); RX_DECL void rx_bitset_difference (int, rx_Bitset, rx_Bitset); -RX_DECL void rx_bitset_revdifference (int, rx_Bitset, rx_Bitset); +//RX_DECL void rx_bitset_revdifference (int, rx_Bitset, rx_Bitset); +#ifdef emacs RX_DECL void rx_bitset_xor (int, rx_Bitset, rx_Bitset); +#endif RX_DECL unsigned long rx_bitset_hash (int, rx_Bitset); +#if 0 #ifdef __STDC__ RX_DECL int rx_bitset_is_equal (int size, rx_Bitset a, rx_Bitset b) @@ -522,6 +525,7 @@ rx_bitset_is_equal (size, a, b) b[0] = s; return !x && s == a[0]; } +#endif #ifdef __STDC__ RX_DECL int @@ -539,7 +543,7 @@ rx_bitset_is_subset (size, a, b) return x == -1; } - +#if 0 #ifdef __STDC__ RX_DECL int rx_bitset_empty (int size, rx_Bitset set) @@ -558,6 +562,7 @@ rx_bitset_empty (size, set) set[0] = s; return !s; } +#endif #ifdef __STDC__ RX_DECL void @@ -676,6 +681,7 @@ rx_bitset_difference (size, a, b) } +#if 0 #ifdef __STDC__ RX_DECL void rx_bitset_revdifference (int size, @@ -692,7 +698,10 @@ rx_bitset_revdifference (size, a, b) for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x) a[x] = ~a[x] & b[x]; } +#endif + +#ifdef emacs #ifdef __STDC__ RX_DECL void rx_bitset_xor (int size, rx_Bitset a, rx_Bitset b) @@ -708,6 +717,7 @@ rx_bitset_xor (size, a, b) for (x = rx_bitset_numb_subsets(size) - 1; x >=0; --x) a[x] ^= b[x]; } +#endif #ifdef __STDC__ @@ -1305,6 +1315,7 @@ rx_mk_r_side_effect (rx, a) } +#if 0 #ifdef __STDC__ RX_DECL struct rexp_node * rx_mk_r_data (struct rx * rx, @@ -1324,6 +1335,7 @@ rx_mk_r_data (rx, a) } return n; } +#endif #ifdef __STDC__ RX_DECL void @@ -5744,11 +5756,13 @@ rx_compile (pattern, size, syntax, rxb) handle_close: /* See similar code for backslashed left paren above. */ - if (COMPILE_STACK_EMPTY) - if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) - goto normal_char; - else - return |