bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] GSWeb Patch for Windows, but...


From: David Ayers
Subject: Re: [PATCH] GSWeb Patch for Windows, but...
Date: Thu, 06 May 2004 11:52:05 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

S.J.Chun wrote:

> Hi, attached file is diff between original and my build. but even with this 
> patch, the build process, especially
> making dll, requires manual process. (I've used a2dl, implib32.exe and other 
> tools) Most important patch is
> for Non blocking socket code, where file descriptor/socket handle difference 
> in Windows platform makes trouble.
> Other parts are for just compilation.
> 

(moved to bug-gnustep@)
Thanks...


> 
> ------------------------------------------------------------------------
> 
> diff -urN gsweb/GSWExtensions.framework/Makefile.preamble 
> gsweb.win/GSWExtensions.framework/Makefile.preamble
> --- gsweb/GSWExtensions.framework/Makefile.preamble   Thu May  6 14:56:46 2004
> +++ gsweb.win/GSWExtensions.framework/Makefile.preamble       Thu May  6 
> 16:02:28 2004
> @@ -101,9 +101,14 @@
>  GSW_FRAMEWORK_SUFFIX = Versions/Current/$(GNUSTEP_TARGET_LDIR)
>  
>  GSWExtensions_LIB_DIRS = \
> -     -L$(GSWEB_LIBRARY_BASE)/$(GSW_FRAMEWORK_SUFFIX)
> +     -L$(GSWEB_LIBRARY_BASE)/$(GSW_FRAMEWORK_SUFFIX) \
> +     -L../GSWeb.framework/GSWeb.framework

This seems strange.  Did you manually create/move the .dll in
$(GSWEB_LIBRARY_BASE) (away from
$GSWEB_LIBRARY_BASE)/$(GSW_FRAMEWORK_SUFFIX))?

Actually could you send me a (/me checks the command...) hmm I guess
there is no recursion flag for 'dir'.  Then just the contents of
../GSWeb.framework/GSWeb.framework and
../GSWeb.framework/GSWeb.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR)

Ahh I guess this is an issue with 'Current' being a symlink?

>  WOExtensions_LIB_DIRS = \
>       -L$(WO_LIBRARY_BASE)/$(GSW_FRAMEWORK_SUFFIX)
> +endif
> +
> +ifeq ($(GNUSTEP_TARGET_OS),mingw32)
> +FRAMEWORK_LIBS += -lGSWeb -lgnustep-db2 -lgnustep-db2control -lgnustep-base 
> -lobjc -lz -lws2_32
>  endif
>  
>  
> diff -urN gsweb/GSWExtensionsGSW.framework/Makefile.preamble 
> gsweb.win/GSWExtensionsGSW.framework/Makefile.preamble
> --- gsweb/GSWExtensionsGSW.framework/Makefile.preamble        Thu May  6 
> 14:56:46 2004
> +++ gsweb.win/GSWExtensionsGSW.framework/Makefile.preamble    Thu May  6 
> 16:02:38 2004
> @@ -78,7 +78,8 @@
>  GSW_FRAMEWORK_SUFFIX = Versions/Current/$(GNUSTEP_TARGET_LDIR)
>  
>  GSWExtensionsGSW_LIB_DIRS = \
> -     -L$(GSWEB_LIBRARY_BASE)/$(GSW_FRAMEWORK_SUFFIX)
> +     -L$(GSWEB_LIBRARY_BASE)/$(GSW_FRAMEWORK_SUFFIX) \
> +     -L../GSWeb.framework/GSWeb.framework
>  WOExtensionsGSW_LIB_DIRS = \
>       -L$(WO_LIBRARY_BASE)/$(GSW_FRAMEWORK_SUFFIX)
>  endif
> @@ -101,6 +102,10 @@
>  else
>  GSWExtensionsGSW_LIBRARIES_DEPEND_UPON += -lGSWeb
>  WOExtensionsGSW_LIBRARIES_DEPEND_UPON += -lWebObjects
> +endif
> +
> +ifeq ($(GNUSTEP_TARGET_OS),mingw32)
> +FRAMEWORK_LIBS += -lGSWeb -lgnustep-db2 -lgnustep-db2control -lgnustep-base 
> -lobjc -lz -lws2_32
>  endif

Hmm... this is actually what xxx_LIBRARIES_DEPEND_UPON was trying to
solve.  I guess it's missing -lobjc, -lz, -lw2_32.


>  
>  #
> diff -urN gsweb/GSWeb.framework/GNUmakefile 
> gsweb.win/GSWeb.framework/GNUmakefile
> --- gsweb/GSWeb.framework/GNUmakefile Thu May  6 14:56:46 2004
> +++ gsweb.win/GSWeb.framework/GNUmakefile     Thu May  6 16:02:42 2004
> @@ -315,6 +315,7 @@
>  GSWRecording.h \
>  GSWInputStreamData.h \
>  GSWActionURL.h \
> +GSWDefs.h \
>  
>  #For next Version:
>  #GSWAdminAction.h \
> diff -urN gsweb/GSWeb.framework/GSWApplication.h 
> gsweb.win/GSWeb.framework/GSWApplication.h
> --- gsweb/GSWeb.framework/GSWApplication.h    Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/GSWApplication.h        Thu May  6 16:03:04 2004
> @@ -33,19 +33,21 @@
>  #ifndef _GSWApplication_h__
>       #define _GSWApplication_h__
>  
> -extern void GSWApplicationSetDebugSetOption(NSString* opt);
> -extern int WOApplicationMain(NSString* applicationClassName,

Careful!!! Was this renaming intentional?  It shouldn't be necessary.
If you want WO names you should try to ./configure --with-gswnames=wo
(Well by default to sets of libraries should be build, one with WO names
the other with GSW names.)  But this may be broken on windows due to the
lack of symlinks.  (But I think we should find a general consensus on
how to deal with symlinks for GNUstep in general.)

> +#include "GSWDefs.h"
> +
> +GSW_EXPORT void GSWApplicationSetDebugSetOption(NSString* opt);
> +GSW_EXPORT int WOApplicationMain(NSString* applicationClassName,
>                               int argc,
>                               const char *argv[]);
> -extern int GSWApplicationMain(NSString* applicationClassName,
> +GSW_EXPORT int GSWApplicationMain(NSString* applicationClassName,
>                                int argc,
>                                const char *argv[]);
> -extern NSString* globalApplicationClassName;
> -extern int GSWebNamingConv;//GSWNAMES_INDEX or WONAMES_INDEX
> +GSW_EXPORT NSString* globalApplicationClassName;
> +GSW_EXPORT int GSWebNamingConv;//GSWNAMES_INDEX or WONAMES_INDEX
>  #define GSWebNamingConvInversed              
> (GSWebNamingConv==GSWNAMES_INDEX ? WONAMES_INDEX : GSWNAMES_INDEX)
>  #define GSWebNamingConvForRound(r)   ((r)==0 ? GSWebNamingConv : 
> (GSWebNamingConv==GSWNAMES_INDEX ? WONAMES_INDEX : GSWNAMES_INDEX))
>  
> -extern BOOL WOStrictFlag;
> +GSW_EXPORT BOOL WOStrictFlag;

[snipped more GSWDefs & s/export/GSW_EXPORT changes] Thanks, I will
incorporate it.

> diff -urN gsweb/GSWeb.framework/GSWMultiKeyDictionary.m 
> gsweb.win/GSWeb.framework/GSWMultiKeyDictionary.m
> --- gsweb/GSWeb.framework/GSWMultiKeyDictionary.m     Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/GSWMultiKeyDictionary.m Thu May  6 16:02:44 2004
> @@ -43,6 +43,8 @@
>  // Copied from NSDate.m. We should find a better solution....
>  static NSTimeInterval GSWTimeNow(void)
>  {
> +  return [NSData timeIntervalSinceReferenceDate];
> +#if 0
>  #if !defined(__MINGW__)
>    NSTimeInterval interval;
>    struct timeval tp;
> @@ -82,6 +84,7 @@
>  #endif
>    return t;
>  #endif /* __MINGW__ */
> +#endif
>  }

I guess you mean NSDate, but I'll have to look into the implementation
of GSWTimeNow a bit further.  Anyway, I consider GSWTimeNow and the
sleeping code a workaround that should probably be solved with locks in
the future.  It's on my TODO list.

> diff -urN gsweb/GSWeb.framework/GSWProcFS.m 
> gsweb.win/GSWeb.framework/GSWProcFS.m
> --- gsweb/GSWeb.framework/GSWProcFS.m Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/GSWProcFS.m     Thu May  6 16:02:54 2004
> @@ -32,6 +32,8 @@
>     </license>
>  **/
>  
> +#if !defined(__WIN32__)
> +
>  #include "config.h"
>  
>  RCS_ID("$Id: GSWProcFS.m,v 1.5 2003/11/24 09:02:57 mguesdon Exp $")
> @@ -422,3 +424,5 @@
>  
>  
>  @end
> +
> +#endif

This is an issue I've also been postponing.  The functionality actually
shouldn't be in GSWeb.  I believe this should be in a utility
library/framework based on -base(add), but probably separate.  I wanted
to see whether Stefan's suggested utility framework progressed.  I'll
post a separate proposition wrt to that though.

> diff -urN gsweb/GSWeb.framework/GSWSession.h 
> gsweb.win/GSWeb.framework/GSWSession.h
> --- gsweb/GSWeb.framework/GSWSession.h        Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/GSWSession.h    Thu May  6 16:02:46 2004
> @@ -131,7 +131,7 @@
>  
>  -(void)savePage:(GSWComponent*)page;
>  -(GSWComponent*)restorePageForContextID:(NSString*)aContextID;
> --(uint)permanentPageCacheSize;
> +-(UINT)permanentPageCacheSize;

these should be unsigned int.  Thanks, I will fix it.

> diff -urN gsweb/GSWeb.framework/GSWStatisticsStore.m 
> gsweb.win/GSWeb.framework/GSWStatisticsStore.m
> --- gsweb/GSWeb.framework/GSWStatisticsStore.m        Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/GSWStatisticsStore.m    Thu May  6 16:02:46 2004
> @@ -33,7 +33,9 @@
>  
>  #include "GSWeb.h"
>  
> +#if !defined(__WIN32__)
>  #include <sys/resource.h>
> +#endif
>  #include <unistd.h>
>  
>  //====================================================================
> @@ -855,6 +857,7 @@
>  //--------------------------------------------------------------------
>  -(NSDictionary*)_memoryUsage
>  {
> +#if !defined(__WIN32__)
>    struct rusage rusageStruct;
>    int i=0;
>    LOGObjectFnStart();
> @@ -897,6 +900,8 @@
>      pidstatm(getpid(),&P);
>    };
>    NSDebugMLog(@"ProcInfo:%@",[GSWProcFSProcInfo filledProcInfo]);
> +
> +#endif

See above...

>    
>    //{Committed = 14184448; Reserved = 19025920; }
>  /*
> @@ -925,7 +930,9 @@
>  
>  
>    LOGObjectFnNotImplemented();       //TODOFN
> +#if !defined(__WIN32__)
>    LOGObjectFnStop();
> +#endif

hmm... why did you need this?  This file includes GSWeb.h which includes
GSWDebug.h which defines LOGObjectFnStop();

>    return nil;
>  };
>  
> diff -urN gsweb/GSWeb.framework/GSWUtils.h 
> gsweb.win/GSWeb.framework/GSWUtils.h
> --- gsweb/GSWeb.framework/GSWUtils.h  Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/GSWUtils.h      Thu May  6 16:02:54 2004
> @@ -33,8 +33,11 @@
>  #define _GSWebUtils_h__
>  
>  #include <sys/time.h>
> +#include "GSWDefs.h"
>  
> +#if !defined(__WIN32__)
>  #define CONST
> +#endif

Thanks, I'll fix this.

>  #ifndef max
>  #define max(a,b) ((a) > (b) ? (a) : (b))
>  #endif
> @@ -51,14 +54,20 @@
>  static void VoidUseRCSId() { rcsId[0]=0; };
>  
>  #ifndef BYTE_DEFINED
> +#if !defined(__WIN32__)
>  typedef unsigned char BYTE;
> +#endif
>  #define BYTE_DEFINED
>  #endif
>  #ifndef UINTs_DEFINED
> +#if !defined(__WIN32__)
>  typedef unsigned int UINT;
> +#endif
>  typedef unsigned char UINT8;
>  typedef unsigned short UINT16;
> +#if !defined(__WIN32__)
>  typedef unsigned int UINT32;
> +#endif
>  #define UINTs_DEFINED
>  #endif
>  

I'll investigate if we really need these (especially in a public header
that always has to be included).  And will try to fix the configury if
it turns out we do...

> diff -urN gsweb/GSWeb.framework/GSWUtils.m 
> gsweb.win/GSWeb.framework/GSWUtils.m
> --- gsweb/GSWeb.framework/GSWUtils.m  Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/GSWUtils.m      Thu May  6 16:02:54 2004
> @@ -209,6 +209,9 @@
>  
>  void NSTimeIntervalSleep(NSTimeInterval ti)
>  {
> +#if defined(__WIN32__)
> +  Sleep((DWORD)ti);
> +#else

See GSWTimeNow() comment above.

> diff -urN gsweb/GSWeb.framework/NSNonBlockingFileHandle.m 
> gsweb.win/GSWeb.framework/NSNonBlockingFileHandle.m
> --- gsweb/GSWeb.framework/NSNonBlockingFileHandle.m   Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/NSNonBlockingFileHandle.m       Thu May  6 
> 16:02:54 2004
> @@ -81,11 +81,23 @@
>  -(unsigned int)_availableByteCountNonBlocking
>  {
>    int numBytes=0;
> +#if defined(__WIN32__)
> +  SOCKET fd = NULL;
> +#else
>    int fd = 0;
> +#endif
>    LOGObjectFnStart();
> +#if defined(__WIN32__)
> +  fd=[self nativeHandle];
> +#else
>    fd=[self fileDescriptor];
> +#endif
>  
> +#if defined(__MINGW__)
> +  if (ioctlsocket(fd, FIONREAD, (char *) &numBytes) == -1)
> +#else
>    if (ioctl(fd, FIONREAD, (char *) &numBytes) == -1)
> +#endif
>      {
>        LOGException0(@"NSFileHandleOperationException ioctl() Err");
>        [NSException raise: NSFileHandleOperationException

This should probably also be "fixed" in the context of -base (it may
already be a non-issue in the sense that we may just need to use the
-base facilities.)  I'll add this to my list.

> diff -urN gsweb/GSWeb.framework/NSString+HTML.m 
> gsweb.win/GSWeb.framework/NSString+HTML.m
> --- gsweb/GSWeb.framework/NSString+HTML.m     Thu May  6 14:56:48 2004
> +++ gsweb.win/GSWeb.framework/NSString+HTML.m Thu May  6 16:02:54 2004
> @@ -34,6 +34,8 @@
>  
>  #include "GSWeb.h"
>  
> +#include <limits.h>
> +
>  static NSArray* normalChars=nil;
>  static NSArray* htmlChars=nil;
>  

Thanks for the feedback.

Cheers,
David

PS: Maybe we should split the replies into separate mails now with
different subjects.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]