aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-08-11 05:08:58 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-08-11 05:08:58 +0000
commit1eb16e832fa5e2fb74c1a3cc76c0a83d06cd386e (patch)
tree01ee49f141eb3bdc1c085a56c4f6569b04858946
parent45896bdb0fd200046d267cdb3de8520922e469d3 (diff)
downloadklibc-1eb16e832fa5e2fb74c1a3cc76c0a83d06cd386e.tar.gz
Find the bitsize includes automatically; document new build procedure.klibc-0.17
-rw-r--r--include/bits32/limits.h14
-rw-r--r--include/bits32/stddef.h13
-rw-r--r--include/bits32/stdint.h34
-rw-r--r--include/bits32/stdintconst.h18
-rw-r--r--include/bits32/stdintlimits.h22
-rw-r--r--include/bits64/limits.h14
-rw-r--r--include/bits64/stddef.h13
-rw-r--r--include/bits64/stdint.h36
-rw-r--r--include/bits64/stdintconst.h18
-rw-r--r--include/bits64/stdintlimits.h22
-rw-r--r--klibc/Makefile3
-rw-r--r--klibc/README26
12 files changed, 16 insertions, 217 deletions
diff --git a/include/bits32/limits.h b/include/bits32/limits.h
deleted file mode 100644
index f90e524b2b482..0000000000000
--- a/include/bits32/limits.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * bits32/limits.h
- */
-
-#ifndef _BITSIZE_LIMITS_H
-#define _BITSIZE_LIMITS_H
-
-#define LONG_BIT 32
-
-#define LONG_MIN (-2147483647L-1)
-#define LONG_MAX 2147483647L
-#define ULONG_MAX 4294967295UL
-
-#endif /* _BITSIZE_LIMITS_H */
diff --git a/include/bits32/stddef.h b/include/bits32/stddef.h
deleted file mode 100644
index 36d267c396cc9..0000000000000
--- a/include/bits32/stddef.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * bits32/stddef.h
- */
-
-#ifndef _BITSIZE_STDDEF_H
-#define _BITSIZE_STDDEF_H
-
-#define _SIZE_T
-typedef unsigned int size_t;
-#define _PTRDIFF_T
-typedef signed int ptrdiff_t;
-
-#endif /* _BITSIZE_STDDEF_H */
diff --git a/include/bits32/stdint.h b/include/bits32/stdint.h
deleted file mode 100644
index 40b464961cd58..0000000000000
--- a/include/bits32/stdint.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * bits32/stdint.h
- */
-
-#ifndef _BITSIZE_STDINT_H
-#define _BITSIZE_STDINT_H
-
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-typedef long long int int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long long int uint64_t;
-
-typedef int int_fast16_t;
-typedef int int_fast32_t;
-
-typedef unsigned int uint_fast16_t;
-typedef unsigned int uint_fast32_t;
-
-typedef int intptr_t;
-typedef unsigned int uintptr_t;
-
-#define __INT64_C(c) c ## LL
-#define __UINT64_C(c) c ## ULL
-
-#define __PRI64_RANK "ll"
-#define __PRIFAST_RANK ""
-#define __PRIPTR_RANK ""
-
-#endif /* _BITSIZE_STDINT_H */
diff --git a/include/bits32/stdintconst.h b/include/bits32/stdintconst.h
deleted file mode 100644
index 8157dd06e0079..0000000000000
--- a/include/bits32/stdintconst.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * bits32/stdintconst.h
- */
-
-#ifndef _BITSIZE_STDINTCONST_H
-#define _BITSIZE_STDINTCONST_H
-
-#define INT_FAST16_C(c) INT32_C(c)
-#define INT_FAST32_C(c) INT32_C(c)
-
-#define UINT_FAST16_C(c) UINT32_C(c)
-#define UINT_FAST32_C(c) UINT32_C(c)
-
-#define INTPTR_C(c) INT32_C(c)
-#define UINTPTR_C(c) UINT32_C(c)
-#define PTRDIFF_C(c) INT32_C(c)
-
-#endif /* _BITSIZE_STDINTCONST_H */
diff --git a/include/bits32/stdintlimits.h b/include/bits32/stdintlimits.h
deleted file mode 100644
index b44fe0118657f..0000000000000
--- a/include/bits32/stdintlimits.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * bits32/stdintlimits.h
- */
-
-#ifndef _BITSIZE_STDINTLIMITS_H
-#define _BITSIZE_STDINTLIMITS_H
-
-#define INT_FAST16_MIN INT32_MIN
-#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST16_MAX INT32_MAX
-#define INT_FAST32_MAX INT32_MAX
-#define UINT_FAST16_MAX UINT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-
-#define INTPTR_MIN INT32_MIN
-#define INTPTR_MAX INT32_MAX
-#define UINTPTR_MAX UINT32_MAX
-
-#define PTRDIFF_MIN INT32_MIN
-#define PTRDIFF_MAX INT32_MAX
-
-#endif /* _BITSIZE_STDINTLIMITS_H */
diff --git a/include/bits64/limits.h b/include/bits64/limits.h
deleted file mode 100644
index 7b20da085b1b0..0000000000000
--- a/include/bits64/limits.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * bits64/limits.h
- */
-
-#ifndef _BITSIZE_LIMITS_H
-#define _BITSIZE_LIMITS_H
-
-#define LONG_BIT 64
-
-#define LONG_MIN (-9223372036854775807L-1)
-#define LONG_MAX 9223372036854775807L
-#define ULONG_MAX 18446744073709551615UL
-
-#endif /* _BITSIZE_LIMITS_H */
diff --git a/include/bits64/stddef.h b/include/bits64/stddef.h
deleted file mode 100644
index 3e7262186224e..0000000000000
--- a/include/bits64/stddef.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * bits64/stddef.h
- */
-
-#ifndef _BITSIZE_STDDEF_H
-#define _BITSIZE_STDDEF_H
-
-#define _SIZE_T
-typedef unsigned long size_t;
-#define _PTRDIFF_T
-typedef signed long ptrdiff_t;
-
-#endif /* _BITSIZE_STDDEF_H */
diff --git a/include/bits64/stdint.h b/include/bits64/stdint.h
deleted file mode 100644
index f569f526b6fb6..0000000000000
--- a/include/bits64/stdint.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * bits64/stdint.h
- */
-
-#ifndef _BITSIZE_STDINT_H
-#define _BITSIZE_STDINT_H
-
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-typedef long long int int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long int uint64_t;
-
-typedef long int int_fast16_t;
-typedef long int int_fast32_t;
-
-typedef unsigned long int uint_fast16_t;
-typedef unsigned long int uint_fast32_t;
-
-typedef long int intptr_t;
-typedef unsigned long int uintptr_t;
-
-#define __INT64_C(c) c ## L
-#define __UINT64_C(c) c ## UL
-
-#define __PRI64_RANK "l"
-#define __PRIFAST_RANK "l"
-#define __PRIPTR_RANK "l"
-
-#endif /* _BITSIZE_STDINT_H */
-
-
diff --git a/include/bits64/stdintconst.h b/include/bits64/stdintconst.h
deleted file mode 100644
index 65f2db0501f5f..0000000000000
--- a/include/bits64/stdintconst.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * bits64/stdintconst.h
- */
-
-#ifndef _BITSIZE_STDINTCONST_H
-#define _BITSIZE_STDINTCONST_H
-
-#define INT_FAST16_C(c) INT64_C(c)
-#define INT_FAST32_C(c) INT64_C(c)
-
-#define UINT_FAST16_C(c) UINT64_C(c)
-#define UINT_FAST32_C(c) UINT64_C(c)
-
-#define INTPTR_C(c) INT64_C(c)
-#define UINTPTR_C(c) UINT64_C(c)
-#define PTRDIFF_C(c) INT64_C(c)
-
-#endif /* _BITSIZE_STDINTCONST_H */
diff --git a/include/bits64/stdintlimits.h b/include/bits64/stdintlimits.h
deleted file mode 100644
index d110d17d2d193..0000000000000
--- a/include/bits64/stdintlimits.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * bits64/stdintlimits.h
- */
-
-#ifndef _BITSIZE_STDINTLIMITS_H
-#define _BITSIZE_STDINTLIMITS_H
-
-#define INT_FAST16_MIN INT64_MIN
-#define INT_FAST32_MIN INT64_MIN
-#define INT_FAST16_MAX INT64_MAX
-#define INT_FAST32_MAX INT64_MAX
-#define UINT_FAST16_MAX UINT64_MAX
-#define UINT_FAST32_MAX UINT64_MAX
-
-#define INTPTR_MIN INT64_MIN
-#define INTPTR_MAX INT64_MAX
-#define UINTPTR_MAX UINT64_MAX
-
-#define PTRDIFF_MIN INT64_MIN
-#define PTRDIFF_MAX INT64_MAX
-
-#endif /* _BITSIZE_STDINTLIMITS_H */
diff --git a/klibc/Makefile b/klibc/Makefile
index 86518c245cdb3..efb86a912e29c 100644
--- a/klibc/Makefile
+++ b/klibc/Makefile
@@ -3,7 +3,8 @@ CROSS =
CC = $(CROSS)gcc
LD = $(CROSS)ld
REQFLAGS = -nostdinc -iwithprefix include -I. \
- -I./arch/$(ARCH)/include -I./include -I./linux/include \
+ -I./arch/$(ARCH)/include -I./include/bits$(BITSIZE) \
+ -I./include -I./linux/include \
-Wall
CFLAGS = $(OPTFLAGS) $(REQFLAGS)
LDFLAGS =
diff --git a/klibc/README b/klibc/README
index 4032f55bcbfa2..8942aba9f23bb 100644
--- a/klibc/README
+++ b/klibc/README
@@ -12,18 +12,20 @@ a) Create a symlink called "linux" pointing to a reasonably recent
the include/asm symlink set up for the architecture you're
compiling for, and include/linux/autoconf.h must exist.
-b) Create a symlink in the include directory called "bitsize" pointing
- either to the "bits32" or the "bits64" directory, depending on the
- architecture you're compiling for.
-
-c) Change ARCH and OPTFLAGS in the main Makefile to match your
- architecture. If you're cross-compiling, set CROSS to your
- toolchain prefix.
-
-d) Type "make" and pray...
-
-e) Try the "hello", "minihello" and "testvsnp" programs... they should
- run.
+b) Change ARCH in the main Makefile to match your architecture.
+ If you're cross-compiling, set CROSS to your toolchain prefix.
+
+c) Type "make" and pray...
+
+d) Try the test programs:
+ microhello
+ minihello
+ hello
+ testvsnp
+ getenvtest
+ getopttest
+ malloctest
+ minips
Contact me at <hpa@zytor.com> for more info.