Reputation: 1
I installed MinGW on my Windows10 system, using mingw-get. I then downloaded libnet (in a ZIP file from github) and tried to compile it. The documentation says to start with "./configure && make", but even after I switch from cmd.exe to the bash that comes with MinGW (bash 3.1, says the prompt), it says "./configure: No such file or directory". That does not surprise me, since there is no file named "configure", only "configure.ac". I try to type "./configure.ac" and get a syntax error. OK, it says in the file "Process this file with autoconf to produce a configure script", so I try "./autoconf configure.ac". That gives me
configure.ac:18: error: Autoconf version 2.69 or higher is required
configure.ac:18: the top level
autom4te-2.68: /bin/m4 failed with exit status 63
How do I move forward? I just installed the whole thing from the MinGW repository. I assume it means that somewhere (where?) there must be a newer version of autoconf; where do I get it? Can I just fetch over the autoconf script from my Fedora Linux system?
In fact, I did this, and it gives me the same error message! Even after I also copied over the autom4te script.
HELP?
Upvotes: 0
Views: 308
Reputation: 7295
I recommend using MinGW-w64 instead of the old MinGW, and MSYS2 instead of the old MSYS.
With this environment I'm able to compile libnet 0.10.11 - both as static and shared library - like this:
# change the next line the install path
INSTALLPREFIX=/usr/local
sed -e 's/-Werror//' makfiles/mingw.mak > port.mak
( make MINGDIR=$MINGWDIR || make MINGDIR=$MINGWDIR ) &&
mkdir -p $INSTALLPREFIX/lib $INSTALLPREFIX/include $INSTALLPREFIX/bin &&
cp lib/libnet.a $INSTALLPREFIX/lib/libnet.a &&
cp include/libnet.h $INSTALLPREFIX/include/libnet.h &&
echo "EXPORTS" > libnet.def &&
sed -n -e "s/^.*\s\**\(net_[^(]*\)\s*(.*$/\t\1/p" include/libnet.h >> libnet.def &&
sed -n -e "s/^.*extern\s*.*\s*\(net_[^;\[]*\)\(\[.*\]\)*;.*$/\t\1 DATA/p" include/libnet.h >> libnet.def &&
gcc -shared -s -mwindows -def libnet.def -o libnet.dll lib/libnet.a -lws2_32 &&
dlltool --dllname $INSTALLPREFIX/bin/libnet.dll --output-lib $INSTALLPREFIX/lib/libnet.dll.a --input-def libnet.def &&
echo Done
Upvotes: 0