svn commit: trunk/uClibc/libc/stdio
vapier at uclibc.org
vapier at uclibc.org
Sat Nov 19 09:13:34 UTC 2005
Author: vapier
Date: 2005-11-19 01:13:33 -0800 (Sat, 19 Nov 2005)
New Revision: 12418
Log:
simplify Makefile rules for handling of LFS files by tweaking the way we compile the source files as suggested by psm
Added:
trunk/uClibc/libc/stdio/fgetpos64.c
trunk/uClibc/libc/stdio/fopen64.c
trunk/uClibc/libc/stdio/freopen64.c
trunk/uClibc/libc/stdio/fseeko64.c
trunk/uClibc/libc/stdio/fsetpos64.c
trunk/uClibc/libc/stdio/ftello64.c
Modified:
trunk/uClibc/libc/stdio/Makefile.in
trunk/uClibc/libc/stdio/fgetpos.c
trunk/uClibc/libc/stdio/fopen.c
trunk/uClibc/libc/stdio/freopen.c
trunk/uClibc/libc/stdio/fseeko.c
trunk/uClibc/libc/stdio/fsetpos.c
trunk/uClibc/libc/stdio/ftello.c
Changeset:
Modified: trunk/uClibc/libc/stdio/Makefile.in
===================================================================
--- trunk/uClibc/libc/stdio/Makefile.in 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/Makefile.in 2005-11-19 09:13:33 UTC (rev 12418)
@@ -7,8 +7,6 @@
# Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
#
-# Note: The *64.o objects are empty when compiled without large file support.
-
# SUSv3 functions
CSRC := \
fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \
@@ -19,6 +17,9 @@
asprintf.c sprintf.c vasprintf.c vdprintf.c vsnprintf.c \
tmpfile.c tmpnam.c tmpnam_r.c popen.c tempnam.c ctermid.c
+# Note: The *64.o objects are empty when compiled without large file support
+CSRC += fgetpos64.c fopen64.c freopen64.c fseeko64.c fsetpos64.c ftello64.c
+
# getc -> alias for fgetc
# putc -> alias for fputc
# rename is a syscall
@@ -52,12 +53,6 @@
# getc_unlocked -> alias for fgetc_unlocked
# putc_unlocked -> alias for fputc_unlocked
-# Largefile functions (%64.o)
-CLSRC :=
-ifeq ($(UCLIBC_HAS_LFS),y)
-CLSRC := fgetpos.c fopen.c freopen.c fseeko.c fsetpos.c ftello.c # tmpfile
-endif
-
# vfprintf and support functions
MSRC1 := vfprintf.c
ifneq ($(USE_OLD_VFPRINTF),y)
@@ -104,8 +99,6 @@
STDIO_OBJ := $(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC))
STDIO_CUSRC := $(patsubst %.c,$(STDIO_DIR)/%.c,$(CUSRC))
STDIO_CUOBJ := $(patsubst %.c,$(STDIO_OUT)/%_unlocked.o,$(CUSRC))
-STDIO_CLSRC := $(patsubst %.c,$(STDIO_OUT)/%64.c,$(CLSRC))
-STDIO_CLOBJ := $(patsubst %.c,$(STDIO_OUT)/%64.o,$(CLSRC))
STDIO_MSRC1 := $(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC1))
STDIO_MSRC2 := $(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC2))
@@ -129,16 +122,6 @@
%_unlocked.os: %.c
$(compile.c) -D__DO_UNLOCKED
-# need this, else the other %64 files will get false rules
-$(STDIO_CLSRC): $(STDIO_OUT)/%64.c : $(STDIO_DIR)/%.c
- @cp $< $@
-
-$(STDIO_CLOBJ): %.o : %.c
- $(compile.c) -D__DO_LARGEFILE
-
-$(STDIO_CLOBJ:.o=.os): %.os : %.c
- $(compile.c) -D__DO_LARGEFILE
-
$(STDIO_MOBJ1): $(STDIO_MSRC1)
$(compile.m)
Modified: trunk/uClibc/libc/stdio/fgetpos.c
===================================================================
--- trunk/uClibc/libc/stdio/fgetpos.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fgetpos.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -7,16 +7,6 @@
#include "_stdio.h"
-#ifdef __DO_LARGEFILE
-# ifndef __UCLIBC_HAS_LFS__
-# error large file support is not enabled!
-# endif
-
-# define fgetpos fgetpos64
-# define fpos_t fpos64_t
-# define ftell ftello64
-#endif
-
int fgetpos(FILE * __restrict stream, register fpos_t * __restrict pos)
{
#ifdef __STDIO_MBSTATE
Added: trunk/uClibc/libc/stdio/fgetpos64.c
===================================================================
--- trunk/uClibc/libc/stdio/fgetpos64.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fgetpos64.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -0,0 +1,16 @@
+/* Copyright (C) 2004 Manuel Novoa III <mjn3 at codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#include "_stdio.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+# define __DO_LARGEFILE
+# define fgetpos fgetpos64
+# define fpos_t fpos64_t
+# define ftell ftello64
+# include "fgetpos.c"
+#endif
Modified: trunk/uClibc/libc/stdio/fopen.c
===================================================================
--- trunk/uClibc/libc/stdio/fopen.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fopen.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -7,14 +7,7 @@
#include "_stdio.h"
-#ifdef __DO_LARGEFILE
-# ifndef __UCLIBC_HAS_LFS__
-# error large file support is not enabled!
-# endif
-
-# define fopen fopen64
-# define FILEDES_ARG (-2)
-#else
+#ifndef __DO_LARGEFILE
# define FILEDES_ARG (-1)
#endif
Added: trunk/uClibc/libc/stdio/fopen64.c
===================================================================
--- trunk/uClibc/libc/stdio/fopen64.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fopen64.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -0,0 +1,15 @@
+/* Copyright (C) 2004 Manuel Novoa III <mjn3 at codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#include "_stdio.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+# define __DO_LARGEFILE
+# define fopen fopen64
+# define FILEDES_ARG (-2)
+# include "fopen.c"
+#endif
Modified: trunk/uClibc/libc/stdio/freopen.c
===================================================================
--- trunk/uClibc/libc/stdio/freopen.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/freopen.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -7,14 +7,7 @@
#include "_stdio.h"
-#ifdef __DO_LARGEFILE
-# ifndef __UCLIBC_HAS_LFS__
-# error large file support is not enabled!
-# endif
-
-# define freopen freopen64
-# define FILEDES_ARG (-2)
-#else
+#ifndef __DO_LARGEFILE
# define FILEDES_ARG (-1)
#endif
Added: trunk/uClibc/libc/stdio/freopen64.c
===================================================================
--- trunk/uClibc/libc/stdio/freopen64.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/freopen64.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -0,0 +1,15 @@
+/* Copyright (C) 2004 Manuel Novoa III <mjn3 at codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#include "_stdio.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+# define __DO_LARGEFILE
+# define freopen freopen64
+# define FILEDES_ARG (-2)
+# include "freopen.c"
+#endif
Modified: trunk/uClibc/libc/stdio/fseeko.c
===================================================================
--- trunk/uClibc/libc/stdio/fseeko.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fseeko.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -11,22 +11,11 @@
# error Assumption violated -- values of SEEK_SET, SEEK_CUR, SEEK_END
#endif
-#ifdef __DO_LARGEFILE
-# ifndef __UCLIBC_HAS_LFS__
-# error large file support is not enabled!
-# endif
-
-# define FSEEK __fseeko64
-# define OFFSET_TYPE __off64_t
-
-#else
-
+#ifndef __DO_LARGEFILE
# define FSEEK fseek
# define OFFSET_TYPE long int
-
#endif
-
int FSEEK(register FILE *stream, OFFSET_TYPE offset, int whence)
{
#if defined(__UCLIBC_HAS_LFS__) && !defined(__DO_LARGEFILE)
Added: trunk/uClibc/libc/stdio/fseeko64.c
===================================================================
--- trunk/uClibc/libc/stdio/fseeko64.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fseeko64.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -0,0 +1,15 @@
+/* Copyright (C) 2004 Manuel Novoa III <mjn3 at codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#include "_stdio.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+# define __DO_LARGEFILE
+# define FSEEK __fseeko64
+# define OFFSET_TYPE __off64_t
+# include "fseeko.c"
+#endif
Modified: trunk/uClibc/libc/stdio/fsetpos.c
===================================================================
--- trunk/uClibc/libc/stdio/fsetpos.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fsetpos.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -7,16 +7,6 @@
#include "_stdio.h"
-#ifdef __DO_LARGEFILE
-# ifndef __UCLIBC_HAS_LFS__
-# error large file support is not enabled!
-# endif
-
-# define fsetpos fsetpos64
-# define fpos_t fpos64_t
-# define fseek fseeko64
-#endif
-
int fsetpos(FILE *stream, register const fpos_t *pos)
{
#ifdef __STDIO_MBSTATE
@@ -41,4 +31,3 @@
#endif
}
-
Added: trunk/uClibc/libc/stdio/fsetpos64.c
===================================================================
--- trunk/uClibc/libc/stdio/fsetpos64.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/fsetpos64.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -0,0 +1,16 @@
+/* Copyright (C) 2004 Manuel Novoa III <mjn3 at codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#include "_stdio.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+# define __DO_LARGEFILE
+# define fsetpos fsetpos64
+# define fpos_t fpos64_t
+# define fseek fseeko64
+# include "fsetpos.c"
+#endif
Modified: trunk/uClibc/libc/stdio/ftello.c
===================================================================
--- trunk/uClibc/libc/stdio/ftello.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/ftello.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -7,19 +7,9 @@
#include "_stdio.h"
-#ifdef __DO_LARGEFILE
-# ifndef __UCLIBC_HAS_LFS__
-# error large file support is not enabled!
-# endif
-
-# define FTELL __ftello64
-# define OFFSET_TYPE __off64_t
-
-#else
-
+#ifndef __DO_LARGEFILE
# define FTELL ftell
# define OFFSET_TYPE long int
-
#endif
OFFSET_TYPE FTELL(register FILE *stream)
Added: trunk/uClibc/libc/stdio/ftello64.c
===================================================================
--- trunk/uClibc/libc/stdio/ftello64.c 2005-11-19 09:11:29 UTC (rev 12417)
+++ trunk/uClibc/libc/stdio/ftello64.c 2005-11-19 09:13:33 UTC (rev 12418)
@@ -0,0 +1,15 @@
+/* Copyright (C) 2004 Manuel Novoa III <mjn3 at codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#include "_stdio.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+# define __DO_LARGEFILE
+# define FTELL __ftello64
+# define OFFSET_TYPE __off64_t
+# include "fgetpos.c"
+#endif
More information about the uClibc-cvs
mailing list