[Lha-users] cross compile on mingw32

Back to archive index

藤原 誠/ Makoto Fujiwara makot****@ki*****
2007年 12月 11日 (火) 21:39:04 JST


>                                           千葉市中央区長洲
>                                                    藤原 誠
こんにちは。実はきょう入会したものです。
ちょっと思いついて mingw32 の実行形式を作って見ました。

実際には NetBSD の上で cross-i386-mingw32 を使っています。
この時に、次のように言われるので、

src/../../src/header.c:1379: undefined reference to `_readlink'
lhext.o: In function `cmd_extract':
src/../../src/lhext.c:474: undefined reference to `_symlink'
collect2: ld returned 1 exit status

添付のような修正をして見ました。あるいは、S_IFLNK の検出時に何
か間違っていて、この修正が必要だったのでしょうか ?

ということで、
lha が autoconf 化されているので、このようなことが簡単に出来ま
す。本当に大変有難うございます。
---
(藤原)

Index: src/header.c
===================================================================
RCS file: /cvsroot/lha/lha/src/header.c,v
retrieving revision 1.91
diff -u -r1.91 header.c
--- src/header.c	24 Feb 2007 14:35:57 -0000	1.91
+++ src/header.c	11 Dec 2007 12:02:15 -0000
@@ -1371,7 +1371,7 @@
         }
     }
 
-#ifdef S_IFLNK
+#if ( defined(S_IFLNK) && (!defined(__MINGW32__)) )
     if (is_symlink(v_stat)) {
         memcpy(hdr->method, LZHDIRS_METHOD, METHOD_TYPE_STORAGE);
         hdr->attribute = GENERIC_DIRECTORY_ATTRIBUTE;
Index: src/lhext.c
===================================================================
RCS file: /cvsroot/lha/lha/src/lhext.c,v
retrieving revision 1.38
diff -u -r1.38 lhext.c
--- src/lhext.c	8 Oct 2006 14:20:14 -0000	1.38
+++ src/lhext.c	11 Dec 2007 12:02:15 -0000
@@ -453,7 +453,7 @@
             if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) == UNIX_FILE_SYMLINK) {
                 int             l_code;
 
-#ifdef S_IFLNK
+#if ( defined(S_IFLNK) && (!defined(__MINGW32__)) )
                 if (skip_flg == FALSE)  {
                     up_flag = inquire_extract(name);
                     if (up_flag == FALSE && force == FALSE) {




Lha-users メーリングリストの案内
Back to archive index