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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Running GIMP under Cygwin (not Win32!)??


Oops! sorry, i forget the patches:(

Good luck;)

Chris Olive wrote:
I posted this question to the cygwin mailing list last week, and someone on that list referred me here and said he cross-posted for me. I didn't hear anything from his "cross-post," so I'm trying again...

It would seem it's at least possible to run The GIMP under Cygwin/XFree. Try as I might, I can't get it to work. Specifically, I can't get some of the necessary pre-requeistes to configure and make properly (glib, GTK+, etc.) Has ANYONE gotten GIMP to work under Cygwin, and if so, specifically what steps did you take to get it to work? I've done a lot of research on this before asking the question, and there is bare mention of this on the web -- I see NO WHERE where anyone claims that this works. Essentially, there is no SOLID information ANYWHERE on getting this to work.

I am interested only in running GIMP under Cygwin/XFree -- I am NOT interested the Win32 version of GIMP! Any help would be GREATLY appreciated.

Thanks,
Chris
-----
Chris Olive
chris[at]technologEase[dot]com

Hi!
I have compiled GIMP on cygwin successfully, using X-Window system, and it works fine.
Of cource, it's easy to get, since native Win32 port works fine.
If you like, please try my little patch, hope helpful.
First you need glib, gtk+, you can build them yourself from sources with patches from
http://homepage.ntlworld.com/steven.obrien2/ (contributed and maintained by Steven O'Brian).
Or, download glib, gtk+ binary packages directly from the Cygwin GNOME project
( http://sourceforge.net/projects/cygnome ), you can find more interesting GNOME
binary packages in cygnome-libs-1.4 (include glib, gtk+).

The build steps i have wrote into a file cygbuild.sh, like:

$ ./configure --prefix=/opt/gnome --enable-shared=yes --enable-static=no --disable-perl
Please disable perl plugin, with little patched you can compile successfully, but running
GIMP hangs when try to load perl plugin script, in my test.

$ mv libtool libtool.old
$ cp /usr/autotool/devel/bin/libtool .
Update libtool to build DLL libs, i use the latest libtool.

$ make
$ make install
if you are luck, you'll get gimp run.
I have to say in my test it's OK, but i can't say it's really OK.

BTW: Please patch lib/glib/include/glibconfig.h,


diff -urN gimp-1.2.3-orig/app/Makefile.in gimp-1.2.3/app/Makefile.in
--- gimp-1.2.3-orig/app/Makefile.in	2002-02-12 05:46:18.000000000 +0800
+++ gimp-1.2.3/app/Makefile.in	2003-02-27 16:21:52.000000000 +0800
@@ -394,6 +394,7 @@
 
 clean-binPROGRAMS:
 	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+	@rm -f gimp.def gimp.base gimp.exp libgimpapp.a
 
 distclean-binPROGRAMS:
 
@@ -416,8 +417,28 @@
 	done
 
 gimp-1.2: $(gimp_1_2_OBJECTS) $(gimp_1_2_DEPENDENCIES)
-	@rm -f gimp-1.2
-	$(LINK) $(gimp_1_2_LDFLAGS) $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+	@rm -f gimp-1.2$(EXEEXT)
+	@rm -f gimp.def gimp.base gimp.exp libgimpapp.a
+# cygwin build
+	$(LINK) -shared $(gimp_1_2_LDFLAGS) -Wl,--out-implib=libgimpapp.a -Wl,--export-all-symbols $(gimp_1_2_OBJECTS) -Wl,--no-whole-archive $(gimp_1_2_LDADD) $(LIBS)
+	$(DLLTOOL) --output-def gimp.def --dllname gimp-1.2$(EXEEXT) --export-all-symbols $(gimp_1_2_OBJECTS)
+	@rm -f gimp-1.2$(EXEEXT)
+	$(LINK) $(gimp_1_2_LDFLAGS) -Wl,--base-file,gimp.base $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+	$(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
+	$(LINK) $(gimp_1_2_LDFLAGS) -Wl,gimp.exp $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+	cp libgimpapp.a .libs/libgimpapp.a
+# or
+#	echo EXPORTS >gimp.def
+#	cat gimp.sym >>gimp.def
+#	$(LINK) $(gimp_1_2_LDFLAGS) -Wl,--base-file,gimp.base $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+#	$(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
+#	$(LINK) $(gimp_1_2_LDFLAGS) -Wl,--base-file,gimp.base,gimp.exp $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+#	$(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
+#	$(LINK) $(gimp_1_2_LDFLAGS) -Wl,gimp.exp $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+#	$(DLLTOOL) --dllname gimp-1.2$(EXEEXT) --def gimp.def --output-lib libgimpapp.a $(gimp_OBJECTS)
+# orig
+#	@rm -f gimp-1.2
+#	$(LINK) $(gimp_1_2_LDFLAGS) $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
 
 tags: TAGS
 
diff -urN gimp-1.2.3-orig/app/plug_in.c gimp-1.2.3/app/plug_in.c
--- gimp-1.2.3-orig/app/plug_in.c	2001-01-16 05:44:02.000000000 +0800
+++ gimp-1.2.3/app/plug_in.c	2002-11-28 18:20:04.000000000 +0800
@@ -57,6 +57,7 @@
 #define _O_TEXT		0x0100	/* text file */
 #define O_BINARY	0x0200	/* binary file */
 #define _O_BINARY	0x0200	/* binary file */
+#define xspawnv spawnv
 #endif
 
 #endif
diff -urN gimp-1.2.3-orig/cygbuild.sh gimp-1.2.3/cygbuild.sh
--- gimp-1.2.3-orig/cygbuild.sh	1970-01-01 08:00:00.000000000 +0800
+++ gimp-1.2.3/cygbuild.sh	2003-02-27 16:27:20.000000000 +0800
@@ -0,0 +1,5 @@
+#!/bin/sh
+./configure --prefix=/opt/gnome --enable-shared=yes --enable-static=no --disable-perl
+mv libtool libtool.old
+cp /usr/autotool/devel/bin/libtool .
+make
diff -urN gimp-1.2.3-orig/libgimp/Makefile.in gimp-1.2.3/libgimp/Makefile.in
--- gimp-1.2.3-orig/libgimp/Makefile.in	2002-02-12 05:46:08.000000000 +0800
+++ gimp-1.2.3/libgimp/Makefile.in	2003-02-27 13:46:18.000000000 +0800
@@ -227,7 +227,7 @@
 
 libgimp_la_LDFLAGS =  	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) 	-release $(LT_RELEASE) 	$(no_undefined) 	$(libgimp_export_symbols)
 
-libgimp_la_LIBADD = $(GLIB_LIBS) -lm
+libgimp_la_LIBADD = $(GLIB_LIBS) -lm -lintl -L/usr/X11R6/lib -lX11
 
 libgimp_la_DEPENDENCIES = $(gimp_def)
 
diff -urN gimp-1.2.3-orig/libgimp/gimp.c gimp-1.2.3/libgimp/gimp.c
--- gimp-1.2.3-orig/libgimp/gimp.c	2001-11-13 13:20:36.000000000 +0800
+++ gimp-1.2.3/libgimp/gimp.c	2003-02-27 21:14:30.000000000 +0800
@@ -21,7 +21,12 @@
 
 #include "config.h"
 
+#ifdef __CYGWIN__
+#define X_LOCALE
+#include <X11/Xlocale.h>
+#else
 #include <locale.h>
+#endif
 #include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -71,10 +76,22 @@
 #include <sys/select.h>
 #endif
 
-#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
+#if defined(G_OS_WIN32) //|| defined(G_WITH_CYGWIN)
+#  define STRICT
+#  include <windows.h>
+#  undef RGB
+#endif
+#if defined(__CYGWIN__)
+# if __GNUC__ >= 3
+# define OLD__GNUC__	__GNUC__
+# define __GNUC__	2
+# endif
 #  define STRICT
 #  include <windows.h>
 #  undef RGB
+# ifdef OLD__GNUC__
+# define __GNUC__	OLD__GNUC__
+# endif
 #endif
 #ifdef __EMX__
 #  include <fcntl.h>
@@ -147,7 +164,7 @@
 
 static GHashTable *temp_proc_ht = NULL;
 
-#ifdef G_OS_WIN32
+#ifdef G_PLATFORM_WIN32
 static GimpPlugInInfo *PLUG_IN_INFO_PTR;
 #define PLUG_IN_INFO (*PLUG_IN_INFO_PTR)
 void
diff -urN gimp-1.2.3-orig/libgimp/gimp.h gimp-1.2.3/libgimp/gimp.h
--- gimp-1.2.3-orig/libgimp/gimp.h	2000-08-28 04:10:12.000000000 +0800
+++ gimp-1.2.3/libgimp/gimp.h	2003-02-27 20:57:34.000000000 +0800
@@ -209,15 +209,17 @@
    {					\
      return win32_gimp_main (argc, argv);	\
    }
-#else
-#ifndef __EMX__
+#elif defined (__CYGWIN__)
+void set_gimp_PLUG_IN_INFO_PTR(GimpPlugInInfo *);
+
 #  define MAIN()			\
    int					\
    main (int argc, char *argv[])	\
    {					\
+     set_gimp_PLUG_IN_INFO_PTR(&PLUG_IN_INFO);	\
      return gimp_main (argc, argv);	\
    }
-#else
+#elif defined (__EMX__)
 #  define MAIN()				\
    int						\
    main (int argc, char *argv[])		\
@@ -225,7 +227,13 @@
      set_gimp_PLUG_IN_INFO(&PLUG_IN_INFO);	\
      return gimp_main (argc, argv);		\
    }
-#endif
+#else
+#  define MAIN()			\
+   int					\
+   main (int argc, char *argv[])	\
+   {					\
+     return gimp_main (argc, argv);	\
+   }
 #endif
 
 
diff -urN gimp-1.2.3-orig/modules/Makefile.in gimp-1.2.3/modules/Makefile.in
--- gimp-1.2.3-orig/modules/Makefile.in	2002-02-12 05:47:40.000000000 +0800
+++ gimp-1.2.3/modules/Makefile.in	2003-03-02 20:25:34.000000000 +0800
@@ -179,8 +179,8 @@
 patterndata = @patterndata@
 prefix = @prefix@
 
- at OS_WIN32_TRUE@no_undefined = -no-undefined
- at OS_WIN32_TRUE@gimp_exe_export_lib = -L../app -lgimpapp
+ at PLATFORM_WIN32_TRUE@no_undefined = -no-undefined
+ at PLATFORM_WIN32_TRUE@gimp_exe_export_lib = -L../app -lgimpapp
 
 libexecdir = $(gimpplugindir)/modules
 
diff -urN gimp-1.2.3-orig/plug-ins/common/Makefile.in gimp-1.2.3/plug-ins/common/Makefile.in
--- gimp-1.2.3-orig/plug-ins/common/Makefile.in	2002-02-12 05:47:38.000000000 +0800
+++ gimp-1.2.3/plug-ins/common/Makefile.in	2003-02-27 15:51:58.000000000 +0800
@@ -1597,6 +1597,11 @@
 
 maintainer-clean-libtool:
 
+# cygwin
+aa: $(aa_OBJECTS) $(aa_DEPENDENCIES)
+	@rm -f aa$(EXEEXT)
+	$(LINK) $(aa_LDFLAGS) $(aa_OBJECTS) $(aa_LDADD) $(LIBS)
+
 aa$(EXEEXT): $(aa_OBJECTS) $(aa_DEPENDENCIES)
 	@rm -f aa$(EXEEXT)
 	$(LINK) $(aa_LDFLAGS) $(aa_OBJECTS) $(aa_LDADD) $(LIBS)
@@ -1613,6 +1618,11 @@
 	@rm -f png$(EXEEXT)
 	$(LINK) $(png_LDFLAGS) $(png_OBJECTS) $(png_LDADD) $(LIBS)
 
+# cygwin
+psp: $(psp_OBJECTS) $(psp_DEPENDENCIES)
+	@rm -f psp$(EXEEXT)
+	$(LINK) $(psp_LDFLAGS) $(psp_OBJECTS) $(psp_LDADD) $(LIBS)
+
 psp$(EXEEXT): $(psp_OBJECTS) $(psp_DEPENDENCIES)
 	@rm -f psp$(EXEEXT)
 	$(LINK) $(psp_LDFLAGS) $(psp_OBJECTS) $(psp_LDADD) $(LIBS)
diff -urN gimp-1.2.3-orig/plug-ins/common/jpeg.c gimp-1.2.3/plug-ins/common/jpeg.c
--- gimp-1.2.3-orig/plug-ins/common/jpeg.c	2002-02-12 05:24:34.000000000 +0800
+++ gimp-1.2.3/plug-ins/common/jpeg.c	2002-11-29 09:51:30.000000000 +0800
@@ -150,6 +150,9 @@
 /* take care yourself if your JPEG library supports progressive mode     */
 /* #undef HAVE_PROGRESSIVE_JPEG   if your library doesn't support it     */
 /* #define HAVE_PROGRESSIVE_JPEG  if your library knows how to handle it */
+#ifdef __CYGWIN__
+#undef HAVE_PROGRESSIVE_JPEG
+#endif
 
 #define DEFAULT_QUALITY     0.75
 #define DEFAULT_SMOOTHING   0.0
diff -urN gimp-1.2.3-orig/plug-ins/gimpressionist/gimpressionist.c gimp-1.2.3/plug-ins/gimpressionist/gimpressionist.c
--- gimp-1.2.3-orig/plug-ins/gimpressionist/gimpressionist.c	2000-12-11 19:34:38.000000000 +0800
+++ gimp-1.2.3/plug-ins/gimpressionist/gimpressionist.c	2003-02-27 22:32:46.000000000 +0800
@@ -537,6 +537,9 @@
 #ifdef __EMX__
     set_gimp_PLUG_IN_INFO(&PLUG_IN_INFO);
 #endif
+#ifdef __CYGWIN__
+    set_gimp_PLUG_IN_INFO_PTR(&PLUG_IN_INFO);
+#endif
 
     return gimp_main(argc, argv);
   }
--- glibconfig.h.orig	2002-09-26 12:11:28.000000000 +0800
+++ glibconfig.h	2003-02-27 21:07:30.000000000 +0800
@@ -63,6 +63,9 @@
 #define GLIB_MINOR_VERSION 2
 #define GLIB_MICRO_VERSION 10
 
+#define G_OS_UNIX
+#define G_PLATFORM_WIN32
+#define G_WITH_CYGWIN
 
 #define G_VA_COPY	__va_copy
 

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