Picogui & Cygwin
peng sanit <[email protected]> Sat, 3 Dec 2005 20:00:08 +0800
| Newsgroups | gmane.comp.video.picogui.devel |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_4640_29280255.1133611208551
Content-Type: multipart/alternative;
boundary="----=_Part_4641_3951816.1133611208551"
------=_Part_4641_3951816.1133611208551
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi, maybe you need run picogui in Window, or get a peek for Picogui. Yes,
you did can run Picogui on Windows.
The Main document for Picogui running on Windows, you will find in
http://www.picogui.org/Wiki/BuildingWithMinGW . However, you may also meet
some troubles when you want to compile the Picogui. And there is a mainly
difference between that document and this document is that issues how to
build Picogui with MinGW. And here we will discuss Build Picogui without
MinGW, only with Cygwin.
There are several steps need to do.
1. install Cygwin, and make sure you had installed the gcc tools,
automake, autoconfig, etc. Attention, you need install "patch packet", if
you want to use my patch for picogui. And other librarys should be installe=
d
too, such as jpeg, png.
2. You MUST need install the SDL library by hand, since the cygwin's
packet not include it. You will download it for www.libsdl.org .
3. I use the picogui source from Subversion Repository at
http://navi.picogui.org/svn/picogui/ , you can read the topic "Picogui
Repository" in http://www.picogui.org/links/repository. Though I not use
Picogui-0.46 packet, but the patch is OK for It, when I test this.
4. when you have checked out the source code, then
4.1 cd picogui/server
4.2 patch -p1 < cygwin_picogui.patch
Though the name of this patch seem this is a cygwin patch, but it did
do in Linux,
Changes are :
lxdialog: the old lxdialog has some bugs run in cygwin, I stolen
new lxdialog codes for Linux kernel 2.4.x, that will be OK both in cygwin &
Linux. So you can use "make menuconfig" in Cygwin.
four Makefile.am files: Since those files will be error with
automake version > 1.9 both in Linux & cygwin.
three files sdlfb.c sdlinput.c sdlgl.c : just only change one
place "#include <SDL/SDL.h>" to "#include "SDL.h", Before change it, I read
the SDL document. He says " The portable way of including SDL is #include "
SDL.h" ", so I think that is a good advice. Otherwise there will be some
errors when in Cygwin.
mingw_commandline.c: comment the line "#include getopt.c", since
the getopt.c is not here and no need.
configure.in: change "PKG_CHECK_MODULES(DIRECTFB, directfb >=3D
0.9.19)" to "AC_CHECK_LIB(DIRECTFB, directfb)", this point I am not sure.
maybe you can fixed it.
5.Before you compile it , the MOST IMPORTANT thing is to modify the
sdl-confg files. That file will be in /usr/local/bin, if you according the
advice of the SDL official document. If not, find it . The attached
sdl-config file is mine. When I first build the picogui in Cygwin with
MinGW, using the option -mno-cygwin. there are a lot of strange errors. So =
I
remove all things with MinGW. cflags remove " -Dmain=3DSDL_main
-I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin", libs remove "-lmingw32
-mwindows -mno-cygwin". those options need to remove, if your sdl-config ha=
s
those.
6. Now you can build it.
6.1 ./autogen if system report "required file './ltmain.sh' " ,
run libtoolize, and run ./autogen again, then things will be OK
6.2 mkdir build && cd build && ../configure
6.3 make menuconfig, Remember Video & Input driver will only
support SDL, of course the NULL driver is OK. About the OS, you may choice
POSIX or Windows Compatible now. Because at this moment the codes in Picogu=
i
for MiniGW and for Cygwin almost are same.
6.4 make
OK, things will be OK, Good luck.
En, about the C client, I will do ASAP. but I do not familiar with
other clients libs, And any others can do that ??
------=_Part_4641_3951816.1133611208551
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi, maybe you need run picogui in Window, or get a peek for Picogui. =
Yes, you did can run Picogui on Windows. <br> The Main document=
for Picogui running on Windows, you will find in <a href=3D"http://www.pic=
ogui.org/Wiki/BuildingWithMinGW">
http://www.picogui.org/Wiki/BuildingWithMinGW</a> . However, you may =
also meet some troubles when you want to compile the Picogui. And there is =
a mainly difference between that document and this document is that issues =
how to build Picogui with MinGW. And here we will discuss Build Picog=
ui without MinGW, only with Cygwin.
<br> There are several steps need to do.<br> 1. ins=
tall Cygwin, and make sure you had installed the gcc tools, automake, autoc=
onfig, etc. Attention, you need install "patch packet", if you wa=
nt to use my patch for picogui. And other librarys should be installed too,=
such as jpeg, png.
<br> 2. You MUST need install the SDL library by hand, since th=
e cygwin's packet not include it. You will download it for <a href=3D"http:=
//www.libsdl.org">www.libsdl.org</a> .<br> 3. I use the p=
icogui source from Subversion Repository at=20
<a href=3D"http://navi.picogui.org/svn/picogui/">http://navi.picogui.org/sv=
n/picogui/</a> , you can read the topic "Picogui Repository" =
in <a href=3D"http://www.picogui.org/links/repository">http://www.picogui.o=
rg/links/repository
</a>. Though I not use Picogui-0.46 packet, but the patch is OK for It, whe=
n I test this.<br> 4. when you have checked out the source code=
, then<br> 4.1 cd picogui/server<br> &nb=
sp; 4.2 patch -p1 < cygwin_picogui.patch
<br> Though the name of this patch seem this is a&n=
bsp; cygwin patch, but it did do in Linux, <br> Cha=
nges are :<br> lxdial=
og: the old lxdialog has some bugs run in cygwin, I stolen new lxdialog cod=
es for Linux kernel=20
2.4.x, that will be OK both in cygwin & Linux. So you can use "mak=
e menuconfig" in Cygwin.<br> =
four <a href=3D"http://Makefile.am">Makefile.am</a> files: Sin=
ce those files will be error with automake version >=20
1.9 both in Linux & cygwin.<br> &nbs=
p; three files sdlfb.c sdlinput.c sdlgl.c : just only change on=
e place "#include <SDL/SDL.h>" to "#include "SDL.=
h", Before change it, I read the SDL document. He says " The port=
able way of including SDL is #include "
SDL.h" ", so I think that is a good advice. Otherwise there will =
be some errors when in Cygwin.<br>  =
; mingw_commandline.c: comment the line "#include getopt.c=
", since the getopt.c is not here and no need.
<br> <a href=3D"http:=
//configure.in">configure.in</a>: change "PKG_CHECK_MODULES(DIRE=
CTFB, directfb >=3D 0.9.19)" to "AC_CHECK_LIB(DIRECTFB, =
directfb)", this point I am not sure. maybe you can fixed it.
<br><br> 5.Before you compile it , the MOST IMPORTANT thi=
ng is to modify the sdl-confg files. That file will be in /usr/local/bin, i=
f you according the advice of the SDL official document. If not, find it . =
The attached sdl-config file is mine. When I first build the picogui in Cy=
gwin with MinGW, using the option -mno-cygwin. there are a lot of strange e=
rrors. So I remove all things with MinGW. cflags remove " -Dmain=
=3DSDL_main -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin", libs rem=
ove "-lmingw32 -mwindows -mno-cygwin". those options need t=
o remove, if your sdl-config has those.
<br><br> 6. Now you can build it. <br> &=
nbsp; 6.1 ./autogen if system report "re=
quired file './ltmain.sh' " , run libtoolize, and run ./autogen =
again, then things will be OK<br> =
6.2 mkdir build && cd build && ../configure
<br> 6.3 make menuconfig, &n=
bsp; Remember Video & Input driver will only support SDL, of course the=
NULL driver is OK. About the OS, you may choice POSIX or Windows Compatibl=
e now. Because at this moment the codes in Picogui for MiniGW and for Cygwi=
n almost are same.
<br> 6.4 make<br> &nbs=
p; <br> OK, things will be OK, Good luck.<br>=
<br> En, about the C client, I will do=
ASAP. but I do not familiar with other clients libs, And any others can do=
that ??<br><br>
------=_Part_4641_3951816.1133611208551--
------=_Part_4640_29280255.1133611208551
Content-Type: application/octet-stream; name=cygwin_picogui.patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cygwin_picogui.patch"
diff -r -N -u server/configscript/lxdialog/checklist.c server_svn/configscript/lxdialog/checklist.c
--- server/configscript/lxdialog/checklist.c 2005-11-22 02:07:16.000000000 +0800
+++ server_svn/configscript/lxdialog/checklist.c 2005-12-03 00:05:24.000000000 +0800
@@ -51,6 +51,10 @@
mvwaddch(win, choice, item_x, item[0]);
wattrset (win, selected ? item_selected_attr : item_attr);
waddstr (win, (char *)item+1);
+ if (selected) {
+ wmove (win, choice, check_x+1);
+ wrefresh (win);
+ }
}
/*
@@ -207,13 +211,15 @@
status[i+scroll], i, i == choice);
}
- wnoutrefresh (list);
-
print_arrows(dialog, choice, item_no, scroll,
box_y, box_x + check_x + 5, list_height);
print_buttons(dialog, height, width, 0);
+ wnoutrefresh (list);
+ wnoutrefresh (dialog);
+ doupdate ();
+
while (key != ESC) {
key = wgetch (dialog);
@@ -351,7 +357,11 @@
case ESC:
break;
}
+
+ /* Now, update everything... */
+ doupdate ();
}
+
delwin (dialog);
free (status);
diff -r -N -u server/configscript/lxdialog/lxdialog.c server_svn/configscript/lxdialog/lxdialog.c
--- server/configscript/lxdialog/lxdialog.c 2005-11-22 02:07:16.000000000 +0800
+++ server_svn/configscript/lxdialog/lxdialog.c 2005-12-03 00:05:24.000000000 +0800
@@ -19,7 +19,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <stdlib.h>
#include "dialog.h"
static void Usage (const char *name);
diff -r -N -u server/configscript/lxdialog/menubox.c server_svn/configscript/lxdialog/menubox.c
--- server/configscript/lxdialog/menubox.c 2005-11-22 02:07:16.000000000 +0800
+++ server_svn/configscript/lxdialog/menubox.c 2005-12-03 00:05:24.000000000 +0800
@@ -91,6 +91,10 @@
wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
mvwaddch(win, choice, item_x+j, menu_item[j]);
}
+ if (selected) {
+ wmove (win, choice, item_x+1);
+ wrefresh (win);
+ }
}
/*
@@ -267,9 +271,11 @@
box_y, box_x+item_x+1, menu_height);
print_buttons (dialog, height, width, 0);
+ wmove (menu, choice, item_x+1);
+ wrefresh (menu);
while (key != ESC) {
- key = wgetch(dialog);
+ key = wgetch(menu);
if (key < 256 && isalpha(key)) key = tolower(key);
@@ -372,8 +378,8 @@
print_arrows(dialog, item_no, scroll,
box_y, box_x+item_x+1, menu_height);
- wnoutrefresh (menu);
- wrefresh (dialog);
+ wnoutrefresh (dialog);
+ wrefresh (menu);
continue; /* wait for another key press */
}
@@ -386,7 +392,7 @@
? 2 : (button > 2 ? 0 : button);
print_buttons(dialog, height, width, button);
- wrefresh (dialog);
+ wrefresh (menu);
break;
case ' ':
case 's':
diff -r -N -u server/configscript/lxdialog/util.c server_svn/configscript/lxdialog/util.c
--- server/configscript/lxdialog/util.c 2005-11-22 02:07:16.000000000 +0800
+++ server_svn/configscript/lxdialog/util.c 2005-12-03 00:05:24.000000000 +0800
@@ -20,10 +20,7 @@
*/
#include "dialog.h"
-
-#ifndef index
-#define index strchr
-#endif
+
/* use colors by default? */
bool use_colors = 1;
diff -r -N -u server/configure.in server_svn/configure.in
--- server/configure.in 2005-12-03 00:22:00.000000000 +0800
+++ server_svn/configure.in 2005-12-03 00:35:54.000000000 +0800
@@ -180,7 +180,7 @@
dnl DirectFB
AM_PGUI_CONFIG($CONFIG_FILE, DRIVER_DIRECTFB, [
- PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.19)
+ AC_CHECK_LIB(DIRECTFB, directfb)
DRIVER_CFLAGS="$DRIVER_CFLAGS ${DIRECTFB_CFLAGS}"
DRIVER_LIBS="$DRIVER_LIBS ${DIRECTFB_LIBS}"
])
diff -r -N -u server/input/sdlinput.c server_svn/input/sdlinput.c
--- server/input/sdlinput.c 2005-12-03 00:22:00.000000000 +0800
+++ server_svn/input/sdlinput.c 2005-12-03 00:16:12.000000000 +0800
@@ -36,7 +36,8 @@
#include <string.h>
#include <stdlib.h>
-#include <SDL/SDL.h>
+/* Quote: "The portable way of including SDL is #include "SDL.h" */
+#include "SDL.h" /* This is the SDL video driver */
/* I have tried various methods for this SDL input driver. For quite a
* while it was threaded. This offered fast response and no CPU overhead,
diff -r -N -u server/os/Makefile.am server_svn/os/Makefile.am
--- server/os/Makefile.am 2005-11-29 22:43:42.000000000 +0800
+++ server_svn/os/Makefile.am 2005-12-02 23:44:30.000000000 +0800
@@ -2,8 +2,7 @@
noinst_LTLIBRARIES = libos.la
-libos_la_SOURCES = \
- $(OS)
+libos_la_SOURCES =
EXTRA_libos_la_SOURCES = \
posix.c \
diff -r -N -u server/os/mingw_commandline.c server_svn/os/mingw_commandline.c
--- server/os/mingw_commandline.c 2005-11-22 02:05:42.000000000 +0800
+++ server_svn/os/mingw_commandline.c 2005-12-03 00:12:50.000000000 +0800
@@ -40,7 +40,7 @@
#include <pgserver/font_bdf.h>
#endif
-#include "getopt.c"
+//#include "getopt.c"
g_error commandline_help(void);
g_error commandline_list(void);
diff -r -N -u server/vidbase/Makefile.am server_svn/vidbase/Makefile.am
--- server/vidbase/Makefile.am 2005-11-25 01:13:58.000000000 +0800
+++ server_svn/vidbase/Makefile.am 2005-12-02 23:48:32.000000000 +0800
@@ -10,8 +10,7 @@
dvbl_lgop.c \
dvbl_sprite.c \
dvbl_font.c \
- font_base.c \
- $(VIDBASE)
+ font_base.c
EXTRA_libvidbase_la_SOURCES = \
linear1.c \
diff -r -N -u server/video/Makefile.am server_svn/video/Makefile.am
--- server/video/Makefile.am 2005-11-25 01:14:06.000000000 +0800
+++ server_svn/video/Makefile.am 2005-12-02 23:45:22.000000000 +0800
@@ -5,8 +5,7 @@
noinst_LTLIBRARIES = libvideo.la
libvideo_la_SOURCES = \
- video_drivers.c \
- $(DRIVER)
+ video_drivers.c
EXTRA_libvideo_la_SOURCES = \
ez328.c \
diff -r -N -u server/video/sdlfb.c server_svn/video/sdlfb.c
--- server/video/sdlfb.c 2005-12-03 00:22:00.000000000 +0800
+++ server_svn/video/sdlfb.c 2005-12-03 00:15:42.000000000 +0800
@@ -35,8 +35,8 @@
#include <pgserver/render.h> /* For data types like 'quad' */
#include <pgserver/input.h> /* For loading our corresponding input lib */
#include <pgserver/configfile.h> /* For loading our configuration */
-
-#include <SDL/SDL.h> /* This is the SDL video driver */
+/* Quote: "The portable way of including SDL is #include "SDL.h" */
+#include "SDL.h" /* This is the SDL video driver */
#ifdef DEBUG_VIDEO
#define DEBUG_FILE
diff -r -N -u server/video/sdlgl.c server_svn/video/sdlgl.c
--- server/video/sdlgl.c 2005-12-03 00:22:00.000000000 +0800
+++ server_svn/video/sdlgl.c 2005-12-03 00:16:04.000000000 +0800
@@ -30,7 +30,8 @@
#include <pgserver/input.h>
#include <pgserver/configfile.h>
#include <pgserver/gl.h>
-#include <SDL/SDL.h>
+/* Quote: "The portable way of including SDL is #include "SDL.h" */
+#include "SDL.h" /* This is the SDL video driver */
#ifdef CONFIG_SDLSKIN
extern s16 sdlfb_display_x;
diff -r -N -u server/widget/Makefile.am server_svn/widget/Makefile.am
--- server/widget/Makefile.am 2005-11-25 01:14:02.000000000 +0800
+++ server_svn/widget/Makefile.am 2005-12-02 23:45:02.000000000 +0800
@@ -4,8 +4,7 @@
libwidget_la_SOURCES = \
widget.c \
- widget_table.c \
- $(WIDGET)
+ widget_table.c
EXTRA_libwidget_la_SOURCES = \
terminal_frontend.c \
------=_Part_4640_29280255.1133611208551
Content-Type: application/octet-stream; name=sdl-config
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="sdl-config"
#!/bin/sh
prefix=/usr/local
exec_prefix=${prefix}
exec_prefix_set=no
usage="\
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo 1.2.8
;;
--cflags)
echo -I${prefix}/include/SDL
# The portable way of including SDL is #include "SDL.h"
#if test ${prefix}/include != /usr/include ; then
# # Handle oddities in Win32 path handling (assumes prefix)
# prefix=`echo ${prefix} | sed 's,^//\([A-Z]\),\1:,'`
#
# includes=-I${prefix}/include
#fi
#echo $includes -I${prefix}/include/SDL -Dmain=SDL_main -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin
;;
# --libs)
# libdirs="-L${exec_prefix}/lib "
# echo $libdirs -lmingw32 -lSDLmain -lSDL
# ;;
# --static-libs)
--libs|--static-libs)
libdirs="-L${exec_prefix}/lib "
echo $libdirs -lSDLmain -lSDL -luser32 -lgdi32 -lwinmm
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
------=_Part_4640_29280255.1133611208551--
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click