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

[palm-unix-j:00070] POSE 3.0a3 FreeBSD用パッチ



会津@JAISTです。

FreeBSD 3.3R 上で
Palm OS Emulator をコンパイル、実行することに成功しました。

このメールの尻尾にパッチをつけておきます。
emulator_src_30a3.tar.gz に対するパッチです。
(emulator_src_21d29.tar.gz も動いているので、
 リクエストがあればパッチ作ります)

新バージョンの POSEは最初からスキンに
WorkPad c3用 が入っていて嬉しくなりました。

% emulator_src_30a3.tar.gzを展開後
% cd Emulator_Src_3.0a3
% patch -p1 < パッチファイル
% cd BuildUnix
% ./configure --target=i386-freebsd
% gmake

で、いけるはずです。

環境は FreeBSD 3.3-RELEASEで、
WorkPad c3 の ROM image を使って確かめました。
いまのところ、ROM image は Windows版のPOSEを使って抜き取りました。

あと、構築には少なくとも、
gcc-2.95.1
gmake
fltk-1.0.3
が必要です。(他にもいるかもしれない)

まだ、とりあえず動く程度しかテストしてなくて、不安定な気がします。
Linux版やWindows版と比較してないので、移植が不完全なのが原因なのか、
POSE自体が開発版だからなのか不明です。


ここから----- ここから----- ここから----- ここから----- ここから----- 
diff -cr Emulator_Src_3.0a3.old/BuildUnix/configure Emulator_Src_3.0a3/BuildUnix/configure
*** Emulator_Src_3.0a3.old/BuildUnix/configure	Sun Nov 14 13:39:50 1999
--- Emulator_Src_3.0a3/BuildUnix/configure	Sat Dec 18 02:39:44 1999
***************
*** 2839,2844 ****
--- 2839,2854 ----
  	THREAD_LIBS="-lpthread"
  	;;
  
+ *-freebsd*) 
+ 	THREAD_FLAGS="-D_REENTRANT -DNoNanoSleep -DPthreadDraftVersion=10"
+ 	CC="gcc295"
+ 	CXX="g++295"
+ 	THREAD_LIBS=""
+ 	X_LIBS="$X_LIBS -lSM -lXIE -lXmu -lXau -L/usr/X11R6/lib"
+ 	POSER_CFLAGS="-pthread -I/usr/X11R6/include"
+ 	POSER_CXXFLAGS="$POSER_CFLAGS"
+ 	;;
+ 
  *-nto*) 
  	THREAD_FLAGS="-D_REENTRANT -DPthreadDraftVersion=10"
  	THREAD_LIBS=""
***************
*** 2871,2877 ****
  
  
  echo $ac_n "checking for glXMakeCurrent in -lGL""... $ac_c" 1>&6
! echo "configure:2875: checking for glXMakeCurrent in -lGL" >&5
  ac_lib_var=`echo GL'_'glXMakeCurrent | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2881,2887 ----
  
  
  echo $ac_n "checking for glXMakeCurrent in -lGL""... $ac_c" 1>&6
! echo "configure:2885: checking for glXMakeCurrent in -lGL" >&5
  ac_lib_var=`echo GL'_'glXMakeCurrent | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2879,2885 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lGL -L$x_libraries -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2883 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2889,2895 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lGL -L$x_libraries -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2893 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2890,2896 ****
  glXMakeCurrent()
  ; return 0; }
  EOF
! if { (eval echo configure:2894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2900,2906 ----
  glXMakeCurrent()
  ; return 0; }
  EOF
! if { (eval echo configure:2904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 2918,2924 ****
  fi
  
  echo $ac_n "checking for fl_height__Fv in -lfltk""... $ac_c" 1>&6
! echo "configure:2922: checking for fl_height__Fv in -lfltk" >&5
  ac_lib_var=`echo fltk'_'fl_height__Fv | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2928,2934 ----
  fi
  
  echo $ac_n "checking for fl_height__Fv in -lfltk""... $ac_c" 1>&6
! echo "configure:2932: checking for fl_height__Fv in -lfltk" >&5
  ac_lib_var=`echo fltk'_'fl_height__Fv | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2926,2932 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lfltk -L$x_libraries -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2930 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 2936,2942 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lfltk -L$x_libraries -lXext -lX11 -lm $X_EXTRA_LIBS $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2940 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 2937,2943 ****
  fl_height__Fv()
  ; return 0; }
  EOF
! if { (eval echo configure:2941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 2947,2953 ----
  fl_height__Fv()
  ; return 0; }
  EOF
! if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
diff -cr Emulator_Src_3.0a3.old/BuildUnix/configure.in Emulator_Src_3.0a3/BuildUnix/configure.in
*** Emulator_Src_3.0a3.old/BuildUnix/configure.in	Sun Nov 14 13:39:44 1999
--- Emulator_Src_3.0a3/BuildUnix/configure.in	Sat Dec 18 02:39:24 1999
***************
*** 103,108 ****
--- 103,118 ----
  	THREAD_LIBS="-lpthread"
  	;;
  
+ *-freebsd*) 
+ 	THREAD_FLAGS="-D_REENTRANT -DNoNanoSleep -DPthreadDraftVersion=10"
+ 	CC="gcc295"
+ 	CXX="g++295"
+ 	THREAD_LIBS=""
+ 	X_LIBS="$X_LIBS -lSM -lXIE -lXmu -lXau -L/usr/X11R6/lib"
+ 	POSER_CFLAGS="-pthread -I/usr/X11R6/include"
+ 	POSER_CXXFLAGS="$POSER_CFLAGS"
+ 	;;
+ 
  *-nto*) 
  	THREAD_FLAGS="-D_REENTRANT -DPthreadDraftVersion=10"
  	THREAD_LIBS=""
diff -cr Emulator_Src_3.0a3.old/SrcShared/EmulatorTypes.h Emulator_Src_3.0a3/SrcShared/EmulatorTypes.h
*** Emulator_Src_3.0a3.old/SrcShared/EmulatorTypes.h	Sun Nov 14 13:39:47 1999
--- Emulator_Src_3.0a3/SrcShared/EmulatorTypes.h	Sat Dec 18 00:43:29 1999
***************
*** 352,358 ****
  	#endif
  #endif
  
! #if UNIX
  	#include <sys/socket.h>			// socklen_t
  #else
  	typedef int			socklen_t;
--- 352,360 ----
  	#endif
  #endif
  
! #if defined(__FreeBSD__)
! 	typedef int	socklen_t;
! #elif defined(UNIX)
  	#include <sys/socket.h>			// socklen_t
  #else
  	typedef int			socklen_t;
diff -cr Emulator_Src_3.0a3.old/SrcShared/Switches.h Emulator_Src_3.0a3/SrcShared/Switches.h
*** Emulator_Src_3.0a3.old/SrcShared/Switches.h	Sun Nov 14 13:39:49 1999
--- Emulator_Src_3.0a3/SrcShared/Switches.h	Sat Dec 18 00:44:14 1999
***************
*** 17,22 ****
--- 17,24 ----
  
  #if !defined (UNIX) || defined (HAVE_ENDIAN_H)
  	#include <endian.h>
+ #elif defined(__FreeBSD__)
+ 	#include <machine/endian.h>
  #else
  	#error "You need to define __BYTE_ORDER for this platform."
  
diff -cr Emulator_Src_3.0a3.old/SrcShared/omnithread/omnithread.h Emulator_Src_3.0a3/SrcShared/omnithread/omnithread.h
*** Emulator_Src_3.0a3.old/SrcShared/omnithread/omnithread.h	Sun Nov 14 13:39:36 1999
--- Emulator_Src_3.0a3/SrcShared/omnithread/omnithread.h	Sat Dec 18 02:19:54 1999
***************
*** 124,129 ****
--- 124,133 ----
  #elif defined(__linux__)
  #include <omnithread/posix.h>
  
+ #elif defined(__FreeBSD__)
+ #include <omnithread/posix.h>
+ 
+ #elif defined(__nextstep__)
  #elif defined(__nextstep__)
  #include <omnithread/mach.h>
  
diff -cr Emulator_Src_3.0a3.old/SrcShared/omnithread/posix.cpp Emulator_Src_3.0a3/SrcShared/omnithread/posix.cpp
*** Emulator_Src_3.0a3.old/SrcShared/omnithread/posix.cpp	Sun Nov 14 13:39:36 1999
--- Emulator_Src_3.0a3/SrcShared/omnithread/posix.cpp	Sat Dec 18 00:46:03 1999
***************
*** 49,54 ****
--- 49,58 ----
  #include <time.h>
  #include <omnithread.h>
  
+ #if defined(__FreeBSD__)
+ #include <unistd.h>
+ #endif
+ 
  #if (defined(__GLIBC__) && __GLIBC__ >= 2)
  // typedef of struct timeval and gettimeofday();
  #include <sys/time.h>
***************
*** 808,814 ****
      if (pthread_delay_np(&rqts) != 0)
  	throw omni_thread_fatal(errno);
  
! #elif defined(__linux__) || defined(__aix__) || defined(__svr4__)
  
      if (secs > 2000) {
  	::sleep(secs);
--- 812,818 ----
      if (pthread_delay_np(&rqts) != 0)
  	throw omni_thread_fatal(errno);
  
! #elif defined(__linux__) || defined(__aix__) || defined(__svr4__) || defined(__FreeBSD__)
  
      if (secs > 2000) {
  	::sleep(secs);