[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [gftp] Getting ready for next gFTP release



On Wed, Mar 17, 2004 at 09:26:09PM -0500, Anthony DiSante wrote:
> I just tried building it, but the make fails:
> 
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/glib-2.0 
> -I/usr/local/lib/glib-2.0/include   -D_REENTRANT -I../intl 
> -DSHARE_DIR=\"/usr/local/share/gftp\" 
> -DLOCALE_DIR=\"/usr/local/share/locale\"    -g -O2 -c local.c
> local.c: In function `local_get_file':
> local.c:120: `O_LARGEFILE' undeclared (first use in this function)
> local.c:120: (Each undeclared identifier is reported only once
> local.c:120: for each function it appears in.)
> local.c: In function `local_put_file':
> local.c:167: `O_LARGEFILE' undeclared (first use in this function)
> make[2]: *** [local.o] Error 1
> make[2]: Leaving directory 
> `/home/falling/adata/downloads/net/gftp/gftp-2.0.17pre0/lib'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory 
> `/home/falling/adata/downloads/net/gftp/gftp-2.0.17pre0'
> make: *** [all-recursive-am] Error 2
> 
> 
> I'm running Slackware 9.1 / 2.4.20 on a P3 850MHz system, and the previous 
> version of gFTP (2.0.16) compiled ok.
> 
> -Anthony
> http://nodivisions.com/

I have attached two patches. You will need to install the patch
gftp-local-largefile.patch.

Oliver, I tested my code under FreeBSD 4.8/axp and I have created the patch
gftp-bsd-largefile-source.patch that makes sure that gftp uses O_LARGEFILE. It
required a change to configure.in, so you will need to regenerate configure. In
case you don't have automake/autoconf, I put the new configure online at
http://www.gftp.org/configure.gz

Brian




Index: configure.in
===================================================================
RCS file: /cvs/gnome/gftp/configure.in,v
retrieving revision 1.54
diff -u -r1.54 configure.in
--- configure.in	21 Feb 2004 23:23:38 -0000	1.54
+++ configure.in	18 Mar 2004 14:24:04 -0000
@@ -61,6 +61,7 @@
 AC_TYPE_SIZE_T
 AC_HEADER_TIME
 AC_STRUCT_TM
+AC_CHECK_SIZEOF(off_t)
 
 AC_FUNC_ALLOCA
 AC_PROG_GCC_TRADITIONAL
Index: lib/gftp.h
===================================================================
RCS file: /cvs/gnome/gftp/lib/gftp.h,v
retrieving revision 1.84
diff -u -r1.84 gftp.h
--- lib/gftp.h	17 Mar 2004 13:03:24 -0000	1.84
+++ lib/gftp.h	18 Mar 2004 14:24:07 -0000
@@ -28,8 +28,7 @@
 
 /* FreeBSD and OpenBSD both include 64bit off_t but _LARGEFILE_SOURCE does not
    get defined. */
-#if defined (_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS > 32 && \
-    !defined (_LARGEFILE_SOURCE)
+#if defined (SIZEOF_OFF_T) && SIZEOF_OFF_T > 4 && !defined (_LARGEFILE_SOURCE)
 #define _LARGEFILE_SOURCE 1
 #endif
 
Index: local.c
===================================================================
RCS file: /cvs/gnome/gftp/lib/local.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 local.c
--- local.c	28 Dec 2003 16:02:01 -0000	1.30
+++ local.c	18 Mar 2004 12:01:57 -0000	1.31
@@ -116,7 +116,7 @@
   if (fd <= 0)
     {
       flags = O_RDONLY;
-#if defined (_LARGEFILE_SOURCE)
+#if defined (_LARGEFILE_SOURCE) && defined (O_LARGEFILE)
       flags |= O_LARGEFILE;
 #endif
 
@@ -163,7 +163,7 @@
       flags = O_WRONLY | O_CREAT;
       if (startsize > 0)
          flags |= O_APPEND;
-#if defined (_LARGEFILE_SOURCE)
+#if defined (_LARGEFILE_SOURCE) && defined (O_LARGEFILE)
       flags |= O_LARGEFILE;
 #endif