This is the mail archive of the cygwin-xfree@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix for XFree86


Hi, Suhaib.

First of all, thanks to your great job!

I found and fixed three problems in your XFree86 port, including
'gcc -E -' hang.
(I use xfree86-3331.tar.gz single tarball and cf.tar.gz as of May 27.)

Though I finally encountered
'Full build of Release 6.3(4?) of the X Window System complete.'
message, I'm still with many errors.

Anyway, here is the description, followed by the patch attached.

(1) 'gcc -E -' problem

In cygwin.cf, we have,

  #define CcCmd  gcc
  #define CppCmd CcCmd -E -

However, 'gcc -E' isn't fully compatible with direct invocation of cpp.

	Value of CPP:	/lib/cpp   'gcc -E'   'gcc -E -'
	$(CPP) < file:     OK         NG          OK
	$(CPP) file:       OK         OK          NG

Unfortunately, the latter style was used in CPPOnlyAsm macro, which is
defined in xf86.rules.
So, we need to override this in cygwin.rules.


(2) xc/exports/bin/*.exe must run without preinstalled X

When building in program/xkbcomp/SUBDIR, xkbcomp in xc/exports/bin is run.
However, if you don't have preexisting X environment, it fails with
'missing libX11.dll'.
We need *.dll in xc/exports/bin for cleaner compilation.

In addition, we have to avoid symlinking .exe and .dll under xc/exports/bin,
because Win32 can't handle symlinks.

I added LinkBuildDLL and LinkBuildBinary in cygwin.rules.


(3) StdIncDir and PostIncDir settings

In cygwin.cf, you have,

  #define StdIncDir `CcCmd --print-libgcc-file-name | sed ':libgcc.a:../../../../i586-cygwin32/include:/cygnus/cygwin-b20/local/include:/cygnus/cygwin-b20/include:/cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include:'|sed 's,\\\\,/,g'`
  #define PostIncDir `CcCmd --print-libgcc-file-name | sed ':libgcc.a:/include:'|sed 's,\\\\,/,g'`

But I can't understand the above sed command.
Doesn't this suffice?

  #define StdIncDir `CcCmd --print-libgcc-file-name | sed 's,\\\\,/,g' | sed 's,libgcc.a,../../../../i586-cygwin32/include,'`
  #define PostIncDir `CcCmd --print-libgcc-file-name | sed 's,\\\\,/,g' | sed 's,libgcc.a,include,'`


I hope it helps.

Regards,
---------------
Takayuki TAMURA (ttathome@remus.dti.ne.jp)
--- ./cygwin.cf.orig	Wed May 26 05:20:09 1999
+++ ./cygwin.cf	Thu Jun 03 20:21:15 1999
@@ -77,8 +77,8 @@
 #define LexCmd                  flex -l
 #define LexLib                  -lfl
 #define PreProcessCmd           CcCmd -E
-#define StdIncDir               `CcCmd --print-libgcc-file-name | sed ':libgcc.a:../../../../i586-cygwin32/include:/cygnus/cygwin-b20/local/include:/cygnus/cygwin-b20/include:/cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include:'|sed 's,\\\\,/,g'`
-#define PostIncDir              `CcCmd --print-libgcc-file-name | sed ':libgcc.a:/include:'|sed 's,\\\\,/,g'`
+#define StdIncDir               `CcCmd --print-libgcc-file-name | sed 's,\\\\,/,g' | sed 's,libgcc.a,../../../../i586-cygwin32/include,'`
+#define PostIncDir              `CcCmd --print-libgcc-file-name | sed 's,\\\\,/,g' | sed 's,libgcc.a,include,'`
 #define LdCombineFlags          -r
 #define OptimizedCDebugFlags    -O2 -s -mpentium
 #define StandardDefines         -D__i386__ -DX_LOCALE -D_MT -DNO_TCP_H -D__CYGWIN32__ -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -D_SVID_SOURCE
--- ./cygwin.rules.orig	Thu May 13 20:45:56 1999
+++ ./cygwin.rules	Thu Jun 03 21:29:56 1999
@@ -1,6 +1,34 @@
 XCOMM $XConsortium: cygwin.rules /main/12 1996/01/03 14:51:18 kaleb $
 
 /*
+ * Override CPPOnlyAsm - our CppCmd can't take filename as arguments.
+ */
+#define CPPOnlyAsm(basename,options) RemoveFile(basename.i)			@@\
+	$(CPP) AsmDefines $(DEFINES) $(INCLUDES) options <basename.s | \	@@\
+		grep -v '^\#' > basename.i
+
+/*
+ * LinkBuildBinary - export a binary to exports/bin.
+ */
+#define LinkBuildBinary(binary)							@@\
+all:: $(BUILDBINDIR)/ProgramTargetName(binary) ProgramTargetName(binary)	@@\
+										@@\
+$(BUILDBINDIR)/ProgramTargetName(binary): ProgramTargetName(binary)		@@\
+	RemoveFile($@)								@@\
+	cd $(BUILDBINDIR) && $(CP) $(BUILDBINTOP)/$(CURRENT_DIR)/ProgramTargetName(binary) .
+
+/*
+ * LinkBuildDLL - export a .dll to exports/bin.
+ */
+#ifdef UseInstalled
+#define LinkBuildDLL(lib) $(_NULLCMD_)
+#else
+#define LinkBuildDLL(lib) MakeDir($(BUILDBINDIR))			@@\
+	RemoveFile($(BUILDBINDIR)/lib)					@@\
+	cd $(BUILDBINDIR) && $(CP) $(BUILDBINTOP)/$(CURRENT_DIR)/lib .
+#endif
+
+/*
  * Cygwin shared library rules (DLL versions)
  */
 #define HasSharedLibraries YES
@@ -76,6 +104,7 @@
 	RemoveFile(Concat3(lib,libname,.dll))				@@\
 	MakeDLL(libname,solist)						@@\
 	LinkBuildLibrary(Concat3(lib,libname,.a))			@@\
+	LinkBuildDLL(Concat3(lib,libname,.dll))				@@\
 clean::									@@\
 	RemoveFile(LibraryTargetName(libname))				@@\
 	RemoveFile(Concat3(lib,libname,.dll))				@@\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]