2016-11-29 3 views
7

MinGW에이 project을 크로스 컴파일하려고합니다.gnulib 기반 프로젝트를 MinGW로 크로스 컴파일

프로젝트는 빌드 시스템으로 autotools를 사용하며 libcurl, CUnit, Jansson 및 일부 gnulib 모듈에 의존합니다.

$ gnulib-tool --update 
$ autoreconf -fi 
$ CURL_CFLAGS="-I/home/user/mingw64/usr/local/include" \ 
CURL_LIBS="-L/home/user/mingw64/usr/local/lib -lcurl" \ 
JANSSON_CFLAGS="-I/home/user/mingw64/usr/local/include" \ 
JANSSON_LIBS="-L/home/user/mingw64/usr/local/lib -ljansson" \ 
CUNIT_CFLAGS="-I/home/user/mingw64/usr/local/include" \ 
CUNIT_LIBS="-L/home/user/mingw64/usr/local/lib -lcunit" \ 
./configure --host=x86_64-w64-mingw32 
$ make 

그리고이 오류가 얻을 :

나는 모든 의존성이 /home/user/mingw64

에서 x86_64-w64-mingw32 컴파일 및 설치 한 나는 실행

make all-recursive 
make[1]: Entering directory '/home/user/projects/shill' 
Making all in po 
make[2]: Entering directory '/home/user/projects/shill/po' 
make[2]: Nothing to be done for 'all'. 
make[2]: Leaving directory '/home/user/projects/shill/po' 
Making all in lib 
make[2]: Entering directory '/home/user/projects/shill/lib' 
make[2]: *** No rule to make target 'lib/errno.h', needed by 'all'. Stop. 
make[2]: Leaving directory '/home/user/projects/shill/lib' 
Makefile:1897: recipe for target 'all-recursive' failed 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory '/home/user/projects/shill' 
Makefile:1429: recipe for target 'all' failed 
make: *** [all] Error 2 

errno.h가 gnulib 모듈의 일부를 .

# Find gnulib headers. 
ACLOCAL_AMFLAGS = -I m4 

AM_CPPFLAGS = \ 
    -DLOCALEDIR='"$(localedir)"' \ 
    -Ilib -I$(top_srcdir)/lib \ 
    -Isrc -I$(top_srcdir)/src \ 

을하지만 해결책을 알아낼 수 없습니다 : 그래서 문제가 Makefile.am이 부분에서 오는 것이라고 생각합니다. 나는 정확히 gnulib manual에 설명 된 지침을 따랐다.

+1

일부 Makefile에는'all : ... lib/errno.h ... '와 같은 줄이 있습니다.'(또는 변수 대체 후 확장되는 행)이 문제의 근본 원인입니다. –

+0

@RossRidge 모든 Makefile은 autotools에 의해 자동 생성되므로 오류를 찾아서 고칠 수 있더라도 작동하지 않습니다. 'Makefile'은 재생성되고 수정 사항을 덮어 씁니다. –

+0

소스를 수정하여 문제를 해결하십시오. –

답변

3

이 문제의 해결 방법을 찾을 수있었습니다. 외관상으로는 autotools는 나가 생각한 것처럼 쉽지 않다.

  1. 은 내가 --makefile-name 매개 변수를 지정,이 시간을 gnulib 모듈을 재생했다. 즉. automake는이 configure.ac 파일을 생성에서
    $ gnulib-tool ... --makefile-name=gnulib.mk ... 
    
  2. 나는 lib/Makefile를 제거했습니다. 그래서 대신 :
    dnl Put automake generated files results here 
    AC_CONFIG_FILES([Makefile 
         po/Makefile.in 
         lib/Makefile]) 
    

    지금 내가 가진 :
    dnl Put automake generated files results here 
    AC_CONFIG_FILES([Makefile 
          po/Makefile.in]) 
    
  3. 내가 Makefile.amlib 형태를 SUBDIRS를 제거했습니다. 즉. 대신에 :

    # Subdirectories to descend into. 
    SUBDIRS = po lib 
    

    내가 가진 :

    # Subdirectories to descend into. 
    SUBDIRS = po 
    
  4. 내가이 콘텐츠와 local.mk라는 lib 디렉토리에 새로운 파일을 생성 :

    include lib/gnulib.mk 
    
    # Allow "make distdir" to succeed before "make all" has run. 
    dist-hook: $(noinst_LIBRARIES) 
    .PHONY: dist-hook 
    
  5. 을 그리고 Makefile.am에 포함되어 있습니다.

    $ ./build-aux/prefix-gnulib-mk --lib-name=libshill lib/gnulib.mk 
    

을했다 :

include $(top_srcdir)/lib/local.mk 
  • 마지막으로 내가이 명령을 실행했다.

  • +0

    Stackoverflow에서 좋은 결과를 얻었습니다! 시간을내어 문서를 작성하는 것이 좋습니다. 계속하십시오. –