LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 842|回复: 1

fcitx 3.2.1在tools/目录下的Makefile.am补订+不要include c文件

[复制链接]
发表于 2006-7-15 16:28:17 | 显示全部楼层 |阅读模式
rt,我的修改是:
1、不用每个程序都说明c文件
2、*2fcitx程序都编译
3、加#include <ctype.h>,免去一个关于找不到isalpha()的warning
4、不要include "../... .c",这样不好

  1. --- fcitx-3.2.1/tools/Makefile.am        2006-06-22 22:49:18.000000000 +0800
  2. +++ fcitx-3.2.1/tools/Makefile.am        2006-07-15 15:51:32.000000000 +0800
  3. @@ -1,10 +1,10 @@
  4. toolsdir = $(pkgdatadir)/tools
  5. INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/lib

  6. -bin_PROGRAMS = mb2txt txt2mb createPYMB
  7. -mb2txt_SOURCES = mb2txt.c
  8. -txt2mb_SOURCES = txt2mb.c
  9. -createPYMB_SOURCES = createPYMB.c
  10. +bin_PROGRAMS = mb2txt txt2mb createPYMB jd2fcitx pyjj2fcitx win2fcitx
  11. +
  12. +createPYMB_LDADD = ../src/pyParser.o ../src/pyMapTable.o ../src/PYFA.o ../src/sp.o
  13. +pyjj2fcitx_LDADD = ../src/pyParser.o ../src/pyMapTable.o ../src/PYFA.o ../src/sp.o

  14. all:
  15.         ./txt2mb $(srcdir)/../data/cj.txt ../data/cj.mb
  16. --- fcitx-3.2.1/tools/createPYMB.c        2006-06-06 22:16:37.000000000 +0800
  17. +++ fcitx-3.2.1/tools/createPYMB.c        2006-07-15 15:49:35.000000000 +0800
  18. @@ -20,11 +20,12 @@
  19. #include <stdio.h>
  20. #include <string.h>

  21. -#define PARSE_INPUT_SYSTEM ' '
  22. -#include "../src/pyParser.c"
  23. -#include "../src/pyMapTable.c"
  24. -#include "../src/PYFA.c"
  25. -#include "../src/sp.c"
  26. +#include "pyParser.h"
  27. +#include "pyMapTable.h"
  28. +#include "PYFA.h"
  29. +#include "sp.h"
  30. +
  31. +extern PYTABLE PYTable[];

  32. FILE           *fps, *fpt, *fp1, *fp2;
  33. Bool                bSingleHZMode = False;
  34. @@ -143,7 +144,7 @@
  35.         if (strlen (strPhrase) < 3)
  36.             continue;
  37.        
  38. -        ParsePY (strPY, &strTemp, (PYPARSEINPUTMODE)PARSE_INPUT_SYSTEM);
  39. +        ParsePY (strPY, &strTemp, PY_PARSE_INPUT_SYSTEM);
  40.         s2++;
  41.         kkk = 0;
  42.         //printf("%s  %s  %s   %d\n",strPY,strPhrase,strTemp.strMap,strTemp.iHZCount);
  43. @@ -249,7 +250,7 @@
  44.         fscanf (fps, "%s", strPY);
  45.         fscanf (fps, "%s\n", strHZ);

  46. -        if (MapPY (strPY, strMap, (PYPARSEINPUTMODE)PARSE_INPUT_SYSTEM)) {
  47. +        if (MapPY (strPY, strMap, PY_PARSE_INPUT_SYSTEM)) {
  48.             for (i = 0; i < iBaseCount; i++)
  49.                 if ((!strcmp (PYTable[i].strPY, strPY)) && PYTable[i].pMH == NULL)
  50.                     YY[i] += 1;
  51. --- fcitx-3.2.1/tools/jd2fcitx.c        2006-06-20 20:48:55.000000000 +0800
  52. +++ fcitx-3.2.1/tools/jd2fcitx.c        2006-07-15 15:50:57.000000000 +0800
  53. @@ -1,5 +1,6 @@
  54. #include <stdio.h>
  55. #include <string.h>
  56. +#include <ctype.h>

  57. int main(int argc, char *argv[])
  58. {
  59. @@ -31,7 +32,6 @@
  60.      }
  61.      
  62.      fprintf(stderr,"Total: %d\n",s);
  63. -    fcloseall();
  64.      
  65.      return 0;
  66. }
  67. --- fcitx-3.2.1/tools/pyjj2fcitx.c        2006-06-06 22:16:37.000000000 +0800
  68. +++ fcitx-3.2.1/tools/pyjj2fcitx.c        2006-07-15 15:51:06.000000000 +0800
  69. @@ -21,10 +21,11 @@
  70. #include <stdio.h>
  71. #include <stdlib.h>
  72. #include <string.h>
  73. -#include "../src/pyParser.c"
  74. -#include "../src/pyMapTable.c"
  75. -#include "../src/PYFA.c"
  76. -#include "../src/sp.c"
  77. +#include <ctype.h>
  78. +#include "pyParser.h"
  79. +#include "pyMapTable.h"
  80. +#include "PYFA.h"
  81. +#include "sp.h"

  82. Bool            bSingleHZMode = False;
  83. Bool            bFullPY = False;
  84. --- fcitx-3.2.1/tools/win2fcitx.c        2006-06-06 22:16:37.000000000 +0800
  85. +++ fcitx-3.2.1/tools/win2fcitx.c        2006-07-15 15:51:14.000000000 +0800
  86. @@ -24,6 +24,7 @@
  87. #include <stdio.h>
  88. #include <stdlib.h>
  89. #include <string.h>
  90. +#include <ctype.h>

  91. int main (int argc, char *argv[])
  92. {
复制代码
发表于 2006-7-17 00:59:50 | 显示全部楼层
呵呵,谢谢啦,我是懒才没有增加*2fcitx的编译
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表