MingW

2016-11-29 7 views
7

पर एक gnulib आधारित प्रोजेक्ट को क्रॉस-संकलित करें मैं इस project को MinGW पर क्रॉस-संकलित करने का प्रयास कर रहा हूं।MingW

परियोजना का निर्माण प्रणाली के रूप में autotools का उपयोग करता है, और libcurl, CUnit, Jansson और कुछ gnulib मॉड्यूल पर निर्भर करता है।

मैं सभी dependancies x86_64-w64-mingw32 के लिए संकलित और /home/user/mingw64

के तहत स्थापित किया है मैं चलाएँ:

$ 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 

और मैं इस त्रुटि मिलती है:

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 मॉड्यूल का हिस्सा है । तो मुझे लगता है कि इस समस्या Makefile.am में इस खंड से आता है:

# Find gnulib headers. 
ACLOCAL_AMFLAGS = -I m4 

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

लेकिन मैं समाधान को समझ नहीं सकता। मैंने gnulib manual में वर्णित निर्देशों का पालन किया।

+1

कुछ मेकफ़ाइल में 'all: ... lib/errno.h जैसी एक पंक्ति है ...'(या एक रेखा जो परिवर्तनीय प्रतिस्थापन के बाद उसमें फैली हुई है) जो आपकी समस्या का निकटतम कारण है। –

+0

@RossRidge सभी 'मेकफ़ाइल' ऑटोटूल द्वारा स्वतः उत्पन्न होते हैं, भले ही मुझे त्रुटि मिलती है और इसे ठीक कर दिया जाता है, यह काम नहीं करेगा। 'मेकफ़ाइल' को फिर से बनाया जाएगा और फिक्स ओवरराइड किया जाएगा। –

+0

तो स्रोत को संशोधित करके इसे ठीक करें। –

उत्तर

3

मैं इस मुद्दे के लिए एक समाधान खोजने में कामयाब रहा। स्पष्ट रूप से autotools उतना आसान नहीं है जितना मैंने सोचा था कि वे हैं।

  1. मैं --makefile-name पैरामीटर निर्दिष्ट करने gnulib मॉड्यूल पुनर्जीवित करने के लिए, इस समय था। अर्थात।

    $ gnulib-tool ... --makefile-name=gnulib.mk ... 
    
  2. मैं lib/Makefile हटाया automake configure.ac में उत्पन्न फ़ाइलों से। तो बजाय:

    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.am में lib से निकाल दिए गए 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

    अच्छी तरह से किया गया और स्टैक ओवरफ्लो पर अच्छी शुरुआत! यह बहुत अच्छा है कि आपने यहां दस्तावेज़ के लिए समय निकाला जो आपके लिए काम करता था। इसे जारी रखो! –

     संबंधित मुद्दे