[英]How can I make a configure script using autoconf on MSYS/MINGW?
I'm trying to use IT++ library in Windows 10. To this end, I need to make a "configure" script from "configure.ac.in" file which provided in IT++ library using autoconf on MSYS.我正在尝试在 Windows 10 中使用 IT++ 库。为此,我需要使用 MSYS 上的 autoconf 从 IT++ 库中提供的“configure.ac.in”文件制作一个“配置”脚本。 I encountered these errors:
我遇到了这些错误:
Ahmad@AHMADTANHA /c/itpp-4.3.1 $ autoconf configure.ac.in /c/MinGW/bin/autoconf-2.68: line 501: /mingw/bin/autom4te-2.68: No such file or directory /c/MinGW/bin/autoconf-2.68: line 501: exec: /mingw/bin/autom4te-2.68: cannot execute: No such file or directory Ahmad@AHMADTANHA /c/itpp-4.3.1 $ autoconf configure.ac.in /c/MinGW/bin/autoconf-2.68: line 501: /mingw/bin/autom4te-2.68: 没有那个文件或目录 /c/MinGW /bin/autoconf-2.68: line 501: exec: /mingw/bin/autom4te-2.68: 无法执行: 没有那个文件或目录
MSYS is old and slow, please use MSYS2. MSYS 又旧又慢,请使用 MSYS2。 You can download it here: https://sourceforge.net/projects/msys2/files/Base/
你可以在这里下载: https : //sourceforge.net/projects/msys2/files/Base/
To use use it first extract the file (eg msys2-base-x86_64-20200903.tar.xz
) and then under the msys64
(or msys32
) folder run autorebasebase1st.bat
and reboot.要使用它首先解压缩文件(例如
msys2-base-x86_64-20200903.tar.xz
),然后在msys64
(或msys32
)文件夹下运行autorebasebase1st.bat
并重新启动。
After rebooting start mingw64.exe
(or mingw32.exe
) and run:重启后启动
mingw64.exe
(或mingw32.exe
)并运行:
pacman -Syu --noconfirm
pacman -S --noconfirm git wget tar gzip autoconf automake make libtool patch unzip xz bison flex pkg-config
pacman -S --noconfirm mingw-w64-x86_64-gcc
(for 32-bit the last line should be pacman -S --noconfirm mingw-w64-i686-gcc
) (对于 32 位,最后一行应该是
pacman -S --noconfirm mingw-w64-i686-gcc
)
Exit the shell end open it up again.退出外壳端再次打开它。 Now you should have a working environment.
现在你应该有一个工作环境。
When I look in the source code of IT++ I don't see a file configure.ac
or configure.am
, only configure.ac.in
.当我查看 IT++ 的源代码时,我没有看到文件
configure.ac
或configure.am
,只有configure.ac.in
。 However there is a file CMakeLists.txt
which means the project should probably configured with CMake.但是有一个文件
CMakeLists.txt
这意味着该项目可能应该使用 CMake 进行配置。
As a general rule if you can avoid the configure tools by using a more modern build system like CMake or Ninja, you should do so.作为一般规则,如果您可以通过使用更现代的构建系统(如 CMake 或 Ninja)来避免配置工具,那么您应该这样做。 Also, CMake supports Ninja which is a lot faster than
make
.此外,CMake 支持 Ninja,这比
make
快得多。
So I tried to build IT++ both static and shared with CMake like this and had no problems:因此,我尝试像这样构建静态并与 CMake 共享的 IT ++ 并且没有问题:
INSTALLPREFIX=/usr/local
cmake.exe -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DITPP_SHARED_LIB:BOOL=OFF -DHTML_DOCS:BOOL=OFF -S. -Bbuild_static &&
ninja -Cbuild_static install/strip &&
cmake.exe -Wno-dev -GNinja -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLPREFIX -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DITPP_SHARED_LIB:BOOL=ON -DHTML_DOCS:BOOL=OFF -S. -Bbuild_shared &&
ninja -Cbuild_shared install/strip &&
echo Success
If for some reason you still want to use make
instead of ninja
you can replace -GNinja
with -G"MSYS Makefiles"
.如果由于某种原因你仍然想使用
make
而不是ninja
你可以用-G"MSYS Makefiles"
替换-GNinja
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.