简体   繁体   中英

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. 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

MSYS is old and slow, please use MSYS2. You can download it here: 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.

After rebooting start mingw64.exe (or mingw32.exe ) and run:

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 )

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 . However there is a file CMakeLists.txt which means the project should probably configured with 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. Also, CMake supports Ninja which is a lot faster than make .

So I tried to build IT++ both static and shared with CMake like this and had no problems:

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" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM