summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-05-28 07:15:46 +0000
committerEric Andersen <andersen@codepoet.org>2003-05-28 07:15:46 +0000
commitf947f2b10009e81ddb09a28c6c4ee3a2e9946821 (patch)
tree1b9243957c41aaf119db14ed4950de4ad6b471ef
parent78c6b3eb88f72a00cc4f290d9d5ecc40e905c063 (diff)
Accomodate building under cygwin
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c
index b283ed086..201f0ac20 100644
--- a/extra/gcc-uClibc/gcc-uClibc.c
+++ b/extra/gcc-uClibc/gcc-uClibc.c
@@ -75,7 +75,6 @@
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
-#include <libgen.h>
#include "gcc-uClibc.h"
@@ -90,6 +89,22 @@ static char nostdlib[] = "-nostdlib";
static char nostdinc_plus[] = "-nostdinc++";
#endif
+/* Include a local implementation of basename, since this
+ * uses the host system's C lib, and CYGWIN apparently
+ * doesn't provide an implementation of basename(). */
+char *basename(const char *path)
+{
+ register const char *s;
+ register const char *p;
+ p = s = path;
+ while (*s) {
+ if (*s++ == '/') {
+ p = s;
+ }
+ }
+ return (char *) p;
+}
+
extern void *xmalloc(size_t size)
{