Closed h-east closed 10 years ago
https://github.com/vim-jp/ctags/pull/12#issuecomment-38988521
こうかな?
diff --git a/configure.ac b/configure.ac
index 4c3c813..e484b04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ AH_VERBATIM([EXTERNAL_SORT], [
# undef EXTERNAL_SORT
#endif
])
-AH_TEMPLATE([ICONV],
+AH_TEMPLATE([HAVE_ICONV],
[Define this value if support multibyte character encoding.])
AH_TEMPLATE([TMPDIR],
[If you wish to change the directory in which temporary files are stored,
@@ -236,7 +236,6 @@ if test "$enable_iconv" = yes ; then
fi
if test "x$HAVE_ICONV" != "x"; then
AC_DEFINE(HAVE_ICONV)
- AC_DEFINE(MBCS_CODE,[])
fi
fi
これでautoheaderは通るけど、makeするとコンパイルエラーが出ますね:sweat_smile:
gcc -I. -I. -DHAVE_CONFIG_H -c args.c
In file included from /usr/include/stdio.h:33:0,
from args.c:17:
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stddef.h:212:27: エラー: ‘unsigned’ が重複しています
typedef __SIZE_TYPE__ size_t;
^
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stddef.h:212:36: エラー: 宣言指定内に二個またはそれ以上の型があります
typedef __SIZE_TYPE__ size_t;
^
In file included from args.c:17:0:
/usr/include/stdio.h:90:17: エラー: 宣言指定内に二個またはそれ以上の型があります
typedef __off_t off_t;
^
/usr/include/stdio.h:90:22: エラー: 宣言指定内に二個またはそれ以上の型があります
typedef __off_t off_t;
^
make: *** [args.] エラー 1
configure.ac
のiconv関係のif
の所をコメントアウトすると普通にmake通る。
(当然 iconv使わないものが出来上がります)
んー、なんかこのif
のトコ弄ってautoconf
して出来上がったconfigure
がmake通る時のそれと全然違うし、ifのネストとか変な気がするんです。
autoconf職人さん助けて!
diff --git a/configure.ac b/configure.ac
index 4c3c813..32bd741 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ AH_VERBATIM([EXTERNAL_SORT], [
# undef EXTERNAL_SORT
#endif
])
-AH_TEMPLATE([ICONV],
+AH_TEMPLATE([HAVE_ICONV],
[Define this value if support multibyte character encoding.])
AH_TEMPLATE([TMPDIR],
[If you wish to change the directory in which temporary files are stored,
@@ -224,21 +224,20 @@ if test "$enable_macro_patterns" = yes ; then
AC_MSG_RESULT(tag file will use patterns for macros by default)
fi
-if test "$enable_iconv" = yes ; then
- AC_CHECK_LIB([c], [iconv_open], [LDFLAGS="$LDFLAGS -lc" HAVE_ICONV=1], [])
- if test "x$HAVE_ICONV" = "x"; then
- dnl But it's possible this implementation of libiconv doesn't have a libiconv_* define
- AC_CHECK_LIB([iconv], [iconv_open], [LDFLAGS="$LDFLAGS -liconv" HAVE_ICONV=1], [])
- fi
- if test "x$HAVE_ICONV" = "x"; then
- dnl No iconv library was found; issue a warning to the console
- AC_MSG_ERROR([Could not find libiconv. Please install libiconv and libiconv-devel.])
- fi
- if test "x$HAVE_ICONV" != "x"; then
- AC_DEFINE(HAVE_ICONV)
- AC_DEFINE(MBCS_CODE,[])
- fi
-fi
+#if test "$enable_iconv" = yes ; then
+# AC_CHECK_LIB([c], [iconv_open], [LDFLAGS="$LDFLAGS -lc" HAVE_ICONV=1], [])
+# if test "x$HAVE_ICONV" = "x"; then
+# dnl But it's possible this implementation of libiconv doesn't have a libiconv_* define
+# AC_CHECK_LIB([iconv], [iconv_open], [LDFLAGS="$LDFLAGS -liconv" HAVE_ICONV=1], [])
+# fi
+# if test "x$HAVE_ICONV" = "x"; then
+# dnl No iconv library was found; issue a warning to the console
+# AC_MSG_ERROR([Could not find libiconv. Please install libiconv and libiconv-devel.])
+# fi
+# if test "x$HAVE_ICONV" != "x"; then
+# AC_DEFINE(HAVE_ICONV)
+# fi
+#fi
# Checks for programs
# -------------------
makeまでの手順
autoheader
autoconf
./configure
make
@mattn チェックお願いします。
iconv は環境によって必要だったり必要無かったり(glibに含まれるので)なので、そのチェックを入れたつもりでしたが、必要ないという意味ですか?
これでautoheaderは通るけど、makeするとコンパイルエラーが出ますね:sweat_smile:
そのパッチでautoheaderもmakeも通りました。(Ubuntu 12.04)
違います。
まっつんさんのPull RequestをMergeした状態でautoheader
を実行するとエラーになります。
それを直すpatchを https://github.com/vim-jp/ctags/issues/14#issuecomment-40680862 で提案させて貰いました。
そのpatchでautoheader
は成功するんですが、今度は ./configure
→ make
するとコンパイルエラーが出るんです。
その原因を探っていたら configure.ac
のiconvの判定のところが引き金になっているみたいでした。
if test "$enable_iconv" = yes ; then
~
fi
なのでその部分をコメントアウトしたらmakeが通るけどよく分かんないやー。。がhttps://github.com/vim-jp/ctags/issues/14#issuecomment-40682006 です。
私の環境(fedora 19 64bit)が壊れかけているのかな。。
@k-takata
そのパッチでautoheaderもmakeも通りました。(Ubuntu 12.04)
報告ありがとうございます。 他のfedora使いの人の報告が欲しいですね。
これでautoheaderは通るけど、makeするとコンパイルエラーが出ますね:sweat_smile:
そのパッチでautoheaderもmakeも通りました。(Ubuntu 12.04)
https://github.com/vim-jp/ctags/issues/14#issuecomment-40680862 このパッチではmakeするとコンパイルエラーが出ましたよ (Ubuntu 14.04 64bit) (もしかして下のパッチと取り違えてません?)
いや、私のところだと上ので通りました。Ubuntu 14.04でも。
ちょっと違ったパッチも書いてみましたが、効果があるかどうかは不明。 https://gist.github.com/k-takata/11174721
@k-takata OSは何bitです?
12.04: 32bit, 64bit 14.04: 64bit
make
までの手順で, configure
にオプション --enable-iconv
? が必要ではないでしょうか.
configure
に引数なしで make
通りました 12.04 32bit
iconv を有効にするなら --enable-iconv
は当然必要ですね。
ああ、逆に --enable-iconv
を外すとエラーになりました。
AC_CHECK_LIB
はAC_PROG_CC
より後でなければならないみたい?
あれ、私も enable で make 通って, disable でエラーになりました。 ubuntu 12.04 32bit
パッチ更新 https://gist.github.com/k-takata/11174721 "Checks for programs" のブロックをごっそり上に持って行った方がよいのかも。
みなさん情報ありがとうございます。
そうですよねiconv使うなら ./configure
の時--enable-iconv
要りますね。
こちらでも./configure
後のmakeでコンパイルエラーになり、./configure --enable-iconv
後のmakeがOKになるのを確認しました。
@k-takata patchありがとうございます。
このpatchで--enable-iconv
有無に関係なくmake通ることを確認しました!
commitしてもらって良いですか?
@k-takata do it plesae
cygwinで動かない…。iconv.h
をインクルードしないと、iconv_open
が使えないようです。(実体はlibiconv_open
というシンボルになっているようで。)
とりあえず、こうかな?
https://gist.github.com/k-takata/11174721/a6733afee1df55de91b5dee20db3bcf51e687c08
libiconv with iconv.h → libc w/o iconv.h → libiconv w/o iconv.h の検索順になっているはずですが、それでいいのかはよく分かりません。
あと、これをどうするか。
"Checks for programs" のブロックをごっそり上に持って行った方がよいのかも。
"Checks for programs" のブロックをごっそり上に持って行った方がよいのかも。
逆に、libiconvのチェックを他のライブラリのチェックよりも後に移動してしまいました。 ライブラリの検索順序は libiconv with iconv.h → libc w/o iconv.h に簡素化、チェック結果表示を追加。 https://gist.github.com/k-takata/11174721/9aa4b149f5b13c6c65f1d94ff1546a6ddf231b03
autoheaderのエラーは直りましたが、テストで別のエラーが出てしまっていますね。
$ make test CTAGS_TEST=./dctags
Testing tag inclusion...ctags.ref: Warning: ignoring null tag in Test/1878155.js
dctags: Warning: ignoring null tag in Test/1878155.js
Passed
Testing extension fields...ctags.ref: Warning: ignoring null tag in Test/1878155.js
dctags: Warning: ignoring null tag in Test/1878155.js
Passed
Testing extra tags...ctags.ref: Warning: ignoring null tag in Test/1878155.js
dctags: Warning: ignoring null tag in Test/1878155.js
Passed
Testing line directives...Passed
Testing TAGS output...ctags.ref: Unexpected end of file: Test/ocaml_empty.ml
make: *** [test.etags] Error 1
The command "make test CTAGS_TEST=./dctags" exited with 2.
@k-takata コミッツありがとうございます! ocaml_empty.mlのテストがエラーになるのは前からです。 https://github.com/vim-jp/ctags/pull/3#issuecomment-25785018 @crazymaster さんが本家にpatch送付済みです。 https://github.com/vim-jp/ctags/pull/3#issuecomment-26707978
ということでこのIssueはクローズさせて頂きます。Thanks.
Reopen出来なかったので新しくIssue立てました。 from https://github.com/vim-jp/ctags/pull/12#issuecomment-38987724
from https://travis-ci.org/vim-jp/ctags/jobs/21810141