namazu-ml(ring)


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

Re: namazu-1.3.1.0-pre-4 and OS/2 (Re: namazu-1.3.1.0-pre-3 (Re: namazu-1.3.1.0-pre-2))



安部です。

Ryuji Abe wrote:

> 結論としてはAC_EXEEXTだけならconfigure.inそのものは共用できるということ
> で、このままで問題ないと思います。

#って、configureが共用できないこと自体、十分問題じゃないか。

で、考えてみたら、AC_CYGWINやAC_MINGW32を直接configure.inに書く代わり
にAC_EXEEXTを使うことの利点って、Makefileを.exeに対応させることだけな
んですよね。それならinstall-shをいじくるという手もあるし、GNU install
自体にパッチをあてるという手もあります。

というわけで、AC_EXEEXTは止めて、その代わり必要に応じてAC_MINGW32や
EMX環境を検出するm4マクロを呼び出すことにしましょう。

ここまでの経過報告として、いくつかのファイルのdiffをつけておきます。


  A A
= . . =
   V
end
Ryuji Abe


diff -ruN namazu-1.3.1.0-pre-4.orig/Makefile.am
namazu-1.3.1.0-pre-4/Makefile.am
--- namazu-1.3.1.0-pre-4.orig/Makefile.am	Thu Feb 04 16:14:18 1999
+++ namazu-1.3.1.0-pre-4/Makefile.am	Mon Feb 08 00:43:30 1999
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-EXTRA_DIST = Makefile.W32 Makefile.OS2 README.ja
+EXTRA_DIST = Makefile.W32 Makefile.OS2 os2.m4 README.ja
 EXTRA_DIRS = contrib doc lib misc
 SUBDIRS = src
 
diff -ruN namazu-1.3.1.0-pre-4.orig/configure.in
namazu-1.3.1.0-pre-4/configure.in
--- namazu-1.3.1.0-pre-4.orig/configure.in	Sat Feb 06 01:02:06 1999
+++ namazu-1.3.1.0-pre-4/configure.in	Mon Feb 08 00:40:00 1999
@@ -24,14 +24,19 @@
     CFLAGS="$CFLAGS -Wall"
 fi
 
+dnl Checks for non-UNIX environment.
+AC_MINGW32
+NMZ_EMX
+
 dnl Checks for libraries.
 dnl Replace `main' with a function in -lm:
+if test -z "$MINGW32"; then
 AC_CHECK_LIB(m, main)
+fi
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h unistd.h string.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -162,19 +167,7 @@
     AC_SUBST(GROFF_OPT)
 fi
 
-dnl set system
-SYSTEM=UNIX
-AC_ARG_WITH(
-	system,
-	[  --with-system=SYSTEM    set system (UNIX or WIN32 or OS2),
[UNIX]],
-	echo "system is set to $with_system"
-	SYSTEM=$with_system,
-)
-AC_SUBST(SYSTEM)
-AC_DEFINE_UNQUOTED(${SYSTEM})
-
-
-if test "$SYSTEM" = "OS2"; then
+if test -n "$EMX"; then
     CFLAGS="-O2 -Zmtd"
     LDFLAGS="-Zexe -Zmtd -Zcrtdll -Zsysv-signals -Zbin-files"
 fi
diff -ruN namazu-1.3.1.0-pre-4.orig/os2.m4 namazu-1.3.1.0-pre-4/os2.m4
--- namazu-1.3.1.0-pre-4.orig/os2.m4	Thu Jan 01 09:00:00 1970
+++ namazu-1.3.1.0-pre-4/os2.m4	Mon Feb 08 01:07:34 1999
@@ -0,0 +1,10 @@
+dnl Check for emx.  This is another way to set the right value for
+dnl EXEEXT.
+AC_DEFUN(NMZ_EMX,
+[AC_CACHE_CHECK(for emx environment, nmz_cv_emx,
+[AC_TRY_COMPILE(,[return __EMX__;],
+nmz_cv_emx=yes, nmz_cv_emx=no)
+rm -f conftest*])
+EMX=
+test "$nmz_cv_emx" = yes && EMX=yes])
+
diff -ruN namazu-1.3.1.0-pre-4.orig/src/cgi.c
namazu-1.3.1.0-pre-4/src/cgi.c
--- namazu-1.3.1.0-pre-4.orig/src/cgi.c	Wed Feb 03 15:56:24 1999
+++ namazu-1.3.1.0-pre-4/src/cgi.c	Sun Feb 07 20:44:58 1999
@@ -37,7 +37,7 @@
 int validate_dbname(uchar * dbname)
 {
     int win32 = 0;
-#if  defined(WIN32) || defined(OS2)
+#if defined(_WIN32) || defined(__EMX__)
     win32 = 1;
 #endif
 
diff -ruN namazu-1.3.1.0-pre-4.orig/src/codeconv.c
namazu-1.3.1.0-pre-4/src/codeconv.c
--- namazu-1.3.1.0-pre-4.orig/src/codeconv.c	Wed Feb 03 15:56:24 1999
+++ namazu-1.3.1.0-pre-4/src/codeconv.c	Sun Feb 07 20:43:34 1999
@@ -169,7 +169,7 @@
     }
 }
 
-#if	defined(WIN32) || defined(OS2)
+#if defined(_WIN32) || defined(__EMX__)
 
 uchar jistojms(uchar c1, uchar c2)
 {
@@ -217,7 +217,7 @@
     }
 }
 
-#endif  /* (WIN32 || OS2) */
+#endif  /* (_WIN32 || __EMX__) */
 
 
 /* Character encoding auto detection (simple approach) */
diff -ruN namazu-1.3.1.0-pre-4.orig/src/messages.c
namazu-1.3.1.0-pre-4/src/messages.c
--- namazu-1.3.1.0-pre-4.orig/src/messages.c	Wed Feb 03 15:56:24 1999
+++ namazu-1.3.1.0-pre-4/src/messages.c	Sun Feb 07 20:39:50 1999
@@ -57,7 +57,7 @@
 void initialize_message(void)
 {
     if (is_lang_ja(Lang)) {
-#if	defined(WIN32) || defined(OS2)
+#if defined(_WIN32) || defined(__EMX__)
         MSG_MIME_HEADER = "Content-type: text/html;
charset=ISO-2022-JP\n\n";
 #else
         MSG_MIME_HEADER = "Content-type: text/html;
charset=ISO-2022-JP\r\n\r\n";
@@ -109,7 +109,7 @@
         MSG_REFERENCE_HEADER = "\xff<STRONG>サイケヘ・メ・テ・ネソ*ク
</STRONG> ";
         MSG_INVALID_DB_NAME = "ノヤタオ、ハ dbname 、ホサリト熙ヌ、ケ
";
     } else {
-#if	defined(WIN32) || defined(OS2)
+#if defined(_WIN32) || defined(__EMX__)
         MSG_MIME_HEADER = "Content-type: text/html\n\n";
 #else
         MSG_MIME_HEADER = "Content-type: text/html\r\n\r\n";
diff -ruN namazu-1.3.1.0-pre-4.orig/src/namazu.c
namazu-1.3.1.0-pre-4/src/namazu.c
--- namazu-1.3.1.0-pre-4.orig/src/namazu.c	Thu Feb 04 16:25:40 1999
+++ namazu-1.3.1.0-pre-4/src/namazu.c	Sun Feb 07 20:40:38 1999
@@ -27,7 +27,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
-#include <sys/wait.h>
 #include <fcntl.h>
 #include <ctype.h>
 #include <string.h>
@@ -72,7 +71,7 @@
 {
     uchar buf[1024];
     strcpy(buf, MSG_USAGE);
-#if	defined(WIN32) || defined(OS2)
+#if defined(_WIN32) || defined(__EMX__)
     euctosjis(buf);
 #endif
     fprintf(stderr, buf, COPYRIGHT, VERSION);
diff -ruN namazu-1.3.1.0-pre-4.orig/src/output.c
namazu-1.3.1.0-pre-4/src/output.c
--- namazu-1.3.1.0-pre-4.orig/src/output.c	Wed Feb 03 15:56:24 1999
+++ namazu-1.3.1.0-pre-4/src/output.c	Sun Feb 07 20:42:06 1999
@@ -78,7 +78,7 @@
     uchar buf[BUFSIZE];
 
     strcpy(buf, s);
-#if	defined(WIN32) || defined(OS2)
+#if defined(_WIN32) || defined(__EMX__)
     if (is_lang_ja(Lang)) { /* Lang == ja*/
         euctosjis(buf);
     }