###前提・実現したいこと
- 最終的にはLinuxでbuildするプロジェクトのソースコードを、開発中は簡単のためWindowsでもbuildできるようにしたい。
- このため、msys2上でconfigureを実行したい。
###発生している問題・エラーメッセージ
Windows8.1(64bit)にmsys2(64bit)をインストールし、単純なhello worldプロジェクトを起こしてautconfなどで設定後、configureを実行するとエラーになります。
$ ./configure checking for gcc... gcc checking whether the C compiler works... no configure: error: in `/home/imudak/hello': configure: error: C compiler cannot create executables See `config.log' for more details
###該当のソースコード
src/helloc.c
#include <stdio.h> int main(int argc, char** argv) { printf("Hello, autoconf!\n"); return 0; }
configure.ac
# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([hello], [0.0.1], [BUG-REPORT-ADDRESS]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_SRCDIR([src/hello.c]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. AC_PROG_CC # Checks for libraries. # Checks for header files. # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT
src/Makefile.am
bin_PROGRAMS=hello hello_SOURCES=hello.c
Makefile.am
SUBDIRS=src
###試したこと
- 例えば、gpgdump: https://github.com/kazu-yamamoto/pgpdump
をgit cloneしてconfigureを実行しても同様のエラーになります。
- msys2の再インストールしても状況は変わりません。
- MSYSTEM=MSYS2, MSYSTEM=MINGW64, MSYSTEM=MINGW32 のどれで実行しても、エラーの内容は同じです。
- 直接gccは問題なく実行できます。以下hello worldの例です。
$ gcc src/hello.c $ ./a.exe Hello, autoconf!
-
linux(ubuntu16.04LTS)で同じconfigureを実行すると問題ありません。生成されたMakefileをmsys2側に持ってきてmakeすると問題なく実行できます。
-
gcc -vで表示される引数を与えてconfigureを実行してもダメでした。
$ ./configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-li bgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --with-tune=generic --disable-multilib --enable -__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic - -enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --disabl e-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without -libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compat ible configure: WARNING: unrecognized options: --enable-bootstrap, --enable-shared, --enable-shared-libgcc, --enable-static, --enable-version-specific-runtime-libs, --with-arch, --with-tune, --disable-multilib, --enable-__cxa_atexit, --with-dwarf2, --enable-languages, --enable-graphite, --enable-threads, --enable-libatomic, --enable-libcilkrts, --enable-libgomp, --enable-libitm, --enable-libquadmath, --enable-libquadmath-support, --enable-libssp, --disable-win32-registry, --disable-symvers, --with-gnu-ld, --with-gnu-as, --disable-isl-version-check, --enable-checking, --without-libiconv-prefix, --without-libintl-prefix, --with-system-zlib, --enable-linker-build-id, --with-default-libstdcxx-abi checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... no configure: error: in `/home/imudak/hello': configure: error: C compiler cannot create executables See `config.log' for more details
###補足情報(言語/FW/ツール等のバージョンなど)
config.logの該当箇所を載せておきます。
## ----------- ## ## Core tests. ## ## ----------- ## configure:1832: checking for a BSD-compatible install configure:1900: result: /usr/bin/install -c configure:1911: checking whether build environment is sane configure:1966: result: yes configure:2117: checking for a thread-safe mkdir -p configure:2156: result: /usr/bin/mkdir -p configure:2163: checking for gawk configure:2179: found /usr/bin/gawk configure:2190: result: gawk configure:2201: checking whether make sets $(MAKE) configure:2223: result: yes configure:2252: checking whether make supports nested variables configure:2269: result: yes configure:2448: checking for gcc configure:2464: found /usr/bin/gcc configure:2475: result: gcc configure:2704: checking for C compiler version configure:2713: gcc --version >&5 gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:2724: $? = 0 configure:2713: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-msys/5.3.0/lto-wrapper.exe Target: x86_64-pc-msys Configured with: /msys_scripts/gcc/src/gcc-5.3.0/configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --with-tune=generic --disable-multilib --enable-__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --disable-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible Thread model: posix gcc version 5.3.0 (GCC) configure:2724: $? = 0 configure:2713: gcc -V >&5 gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:2724: $? = 1 configure:2713: gcc -qversion >&5 gcc: error: unrecognized command line option '-qversion' gcc: fatal error: no input files compilation terminated. configure:2724: $? = 1 configure:2744: checking whether the C compiler works configure:2766: configure:2770: $? = 1 configure:2808: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "hello" | #define PACKAGE_TARNAME "hello" | #define PACKAGE_VERSION "0.0.1" | #define PACKAGE_STRING "hello 0.0.1" | #define PACKAGE_BUGREPORT "BUG-REPORT-ADDRESS" | #define PACKAGE_URL "" | #define PACKAGE "hello" | #define VERSION "0.0.1" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:2813: error: in `/home/imudak/hello': configure:2815: error: C compiler cannot create executables See `config.log' for more details
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。