How to install GNU Make Windows - makefile

I downloaded and unzipped the file to folder c:\make-4.2.
The install instructions I have seen suggest that I just type "make install" and the installation will start.
I don't see that "make" file there. I tried it from the directory and got an error that the command is not recognized.
Any tips?

I don't know what install instructions you are referring to, but certainly not the ones that come with GNU make itself. There's no platform where you can simply untar the source code and type "make install" with no other steps, and certainly not on Windows.
If you're trying to build GNU make from downloaded source on Windows, you should read the README.W32 file that comes with the source code and follow the instructions there.

Related

Where is my gcc.exe?

I need to create a simple C application with just a compiler and a text editor. So I installed mingw from here. I was surprised, when I went to the bin folder and there was no gcc.exe.
Given that other people speak about using it, I suppose it should be there. What did I do wrong?
Sounds like I shoul've read a little bit more than I did. Downloading and running the installer is only the very beginning of getting gcc.
After installation, mingw-get.exe appears in the /bin folder. This commands initiates a rather long download process:
mingw-get install gcc
After this, another downloading command is necessary to get C++ compiler and make:
mingw-get install gcc g++ mingw32-make

Cannot install SDL using mingw/msys

I don't know whether this is actually an SDL issue or just me not knowing how to build packages from msys/mingw. What I have done thus far:
downloaded latest mingw-get-inst.exe from sourceforge and ran it. This installed a C:\MinGW\ directory with msys inside. This brought me to my first bit of confusion. When I opened the mingw shell, rather than bringing me to my /home/ directory as I expected ( I have used mingw before and remember this being weird ) it placed me in /c/Users/me/.
I figured that this must be my home directory and put the extracted SDL-1.2.15/ in this location.
I then ran:
cd SDL-1.2.15
./configure --help
but received sh: ./configure: No such file or directory.
I then created a /c/MinGW/msys/1.0/home/ directory, set that as the HOME environment variable, moved the SDL folder into it and tried to configure again with the same result.
There are a few things I really dont understand about installing packages that I hope someone can clear up. I have installed a few before and the ./configure; make; make install; seems to be a common procedure. I know msys provides the functionality for make, but is configure a file that is supposed to be included in each package? If so, why is it not in the SDL package/how do configure it?
I have been following instructions from here and they seem to have worked for others in the comments. The bottom-most comment tells that mingw-get-inst works, though I did try it both ways.
I have a feeling my lack of msys/mingw knowledge is my problem.
I am on windows 7.
I had the same problem as you describe and I got SDL, SDL_image and SDL_ttf working after some research.
It seems that the configure file exists only in the source code packages. I found that out after I downloaded the SDL_image source. So, the problem probably lies in that the configure file comes only in the source packages.
However, I'm having other problems so I'm not sure this has fixed it for me, but it seems like it should.

How to build xmlsec on Windows

I am trying to build xmlsec on Windows... I am not an experienced C/C++ developer and not really familiar with the build process if something along the lines of "make ... make install" doesn't do the trick.
xmlsec comes with a Win32 subdirectory, a nice ECMAScript configure.js that takes an optional bunch of parameters and a readme which explains that after running the configure, "nmake ... nmake install" should do the trick. (Obviously it isn't quite that easy or I wouldn't be posting here!)
xmlsec also depends on a number of other libraries (see here for a graphic). I have downloaded the sources for those libraries.
My problem is that I don't know how to arrange those sources, or what to tell the configure.js script, in order to get a build to work.
For instance, the nmake process complains that it can't find "iconv.h" (iconv is one of the required libraries), which is not surprising because there isn't one. Instead there is an "iconv.h.in" and an "iconv.h.build.in"... which I don't know what to do with to produce the required 'iconv.h".
(I am using MS Visual Studio 2010 at the command prompt (which I think is the recommended approach.)
Does anybody out there know how to do this? Any help at all would be very much appreciated.
TIA
Mike Peat
You don't need to build xmlsec, you can directly download the wheel file from this link
https://github.com/mehcode/python-xmlsec/releases
It has all the dependencies installed with it.
have you tried the Msys with Mingw32 compiler? In Msys, you can do make and make install trick. I have successful with Msys in compile xmlsec. If you want to use Msys and have difficulties, I can help.
Anyway, in general, there must be a iconv.h file in the pre-compile folder provided by Zlatkovic (i.e C:\iconv\include\iconv.h). You may want to download again the folder. After figure out where all the dependencies are, put the path in environment path. For your information, I once tried with the configure.js but not successful. Hope that you are luckier than me :D
Hi Kristine (#Kristine T) - (and thanks for getting back to me!)
I had not been doing "make clean", but have now done so ("make clean", followed by "make" - no change in the result though).
The problem I get with the "make" is that it throws an error on compiling "dl.c" saying that "PACKAGE" is undefined (line 295).
I have also had problems using the compiled version of libxml2 - "configure" always says it can't find it (it is there, but...), so I have been using the --with-libxml-src=... parameter to configure, giving it the full source of libxml2 to work with, getting configure to at least finish OK.
I don't have the same problems with openssl or libxslt where I can either tell configure about the compiled version (using --with-XXX={path-to-dir}, or just omit ={path} bit, in which case it seems to find MinGW's own versions, but that doesn't work with libxml2.
Mike

use MinGW to create exe file in windows from GNU source package

the basic idea was, I wanted to generate the call graph in text format for several c files. After googling around for long time, i found cflow, which can deliver everything I want, but it is only runable in Linux or else. Then I began to search how to compile the cflow source files on the web to a exe file. I found MinGW which should be able to do the cross-platform compilation.
After installing the MinGW and the MSYS and running the usual commands "./configure; make; make install", I simply got an error that "mkdir" was not found. Actually. Actually I was wondering whether this is the correct way to compile the whole package.
Does anyone has an idea how I can build the cflow.exe correctly in Windows? If there is a tutorial or something like this, I will be very thankful.
Song
Solution
Please try this Github repository "MinGW + MSYS build of GNU cflow 1.4" (For Windows).
https://github.com/noahp/cflow-mingw
It contains already compiled "cflow.exe",and an instruction about how to build cflow using mingw and msys.
Test
System Environment:Win 8.1 (x64)
1.I tested the "cflow.exe" downloaded from the github repository , and amazingly it worked!
2.I followed the mingw compiling instruction,and it successfully compiled "cflow 1.5".
Command:
bash configure
make
I was able to do that today. I'm using cygwin, after installing gcc, binutils, make and after downloading the gnu cflow.tar.gz, it was as easy as ./configure ; make ; make install.

How to install pkg config in windows?

I am trying to do it, but all I can get is some source code that I don't know how to do deal with I downloaded from http://pkgconfig.freedesktop.org/releases/.
This is a step-by-step procedure to get pkg-config working on Windows, based on my experience, using the info from Oliver Zendel's comment.
I assume here that MinGW was installed to C:\MinGW. There were multiple versions of the packages available, and in each case I just downloaded the latest version.
go to http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
download the file pkg-config_0.26-1_win32.zip
extract the file bin/pkg-config.exe to C:\MinGW\bin
download the file gettext-runtime_0.18.1.1-2_win32.zip
extract the file bin/intl.dll to C:\MinGW\bin
go to http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28
download the file glib_2.28.8-1_win32.zip
extract the file bin/libglib-2.0-0.dll to C:\MinGW\bin
Now CMake will be able to use pkg-config if it is configured to use MinGW.
Get the precompiled binaries from http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
Download pkg-config and its depend libraries :
pkg-config_0.26-1_win32.zip
glib_2.28.8-1_win32.zip
gettext-runtime_0.18.1.1-2_win32.zip
A alternative without glib dependency is pkg-config-lite.
Extract pkg-config.exe from the archive and put it in your path.
Nowdays this package is available using chocolatey, then it could be installed with
choco install pkgconfiglite
I did this by installing Cygwin64 from this link https://www.cygwin.com/
Then - View Full, Search gcc and scroll down to find pkg-config.
Click on icon to select latest version.
This worked for me well.
I would like to extend the answer of #dzintars about the Cygwin version of pkg-config in that focus how should one use it properly with CMake, because I see various comments about CMake in this topic.
I have experienced many troubles with CMake + Cygwin's pkg-config and I want to share my experience how to avoid them.
1. The symlink C:/Cygwin64/bin/pkg-config -> pkgconf.exe does not work in Windows console.
It is not a native Windows .lnk symlink and it won't be callable in Windows console cmd.exe even if you add ".;" to your %PATHEXT% (see https://www.mail-archive.com/cygwin#cygwin.com/msg104088.html).
It won't work from CMake, because CMake calls pkg-config with the method execute_process() (FindPkgConfig.cmake) which opens a new cmd.exe.
Solution: Add -DPKG_CONFIG_EXECUTABLE=C:/Cygwin64/bin/pkgconf.exe to the CMake command line (or set it in CMakeLists.txt).
2. Cygwin's pkg-config recognizes only Cygwin paths in PKG_CONFIG_PATH (no Windows paths).
For example, on my system the .pc files are located in C:\Cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\lib\pkgconfig. The following three paths are valid, but only path C works in PKG_CONFIG_PATH:
A) c:/Cygwin64/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig -
does not work.
B) /c/cygdrive/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig -
does not work.
C) /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig - works.
Solution: add .pc files location always as a Cygwin path into PKG_CONFIG_PATH.
3) CMake converts forward slashes to backslashes in PKG_CONFIG_PATH on Cygwin.
It happens due to the bug https://gitlab.kitware.com/cmake/cmake/-/issues/21629. It prevents using the workaround described in [2].
Solution: manually update the function _pkg_set_path_internal() in the file C:/Program Files/CMake/share/cmake-3.x/Modules/FindPkgConfig.cmake. Comment/remove the line:
file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
4) CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH have no effect on pkg-config in Cygwin.
Reason: the bug https://gitlab.kitware.com/cmake/cmake/-/issues/21775.
Solution: Use only PKG_CONFIG_PATH as an environment variable if you run CMake builds on Cygwin. Forget about CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH.
Install mingw64 from https://sourceforge.net/projects/mingw-w64/. Avoid program files/(x86) folder for installation. Ex. c:/mingw-w64
Download pkg-config__win64.zip from here
Extract above zip file and copy paste all the files from pkg-config/bin folder to mingw-w64. In my case its 'C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin'
Now set path = C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
taddaaa you are done.
If you find any security issue then follow steps as well
Search for windows defender security center in system
Navigate to apps & browser control> Exploit protection settings> Program setting> Click on '+add program customize'
Select add program by name
Enter program name: pkgconf.exe
OK
Now check all the settings and set it all the settings to off and apply.
Thats DONE!
Another place where you can get more updated binaries can be found at Fedora Build System site. Direct link to mingw-pkg-config package is: http://koji.fedoraproject.org/koji/buildinfo?buildID=354619
for w64-based computers you have to install mingw64. If pkg-config.exe is missing then, you can refer to http://ftp.acc.umu.se/pub/gnome/binaries/win64/dependencies/
Unzip and copy/merge pkg-config.exe into your C:\mingw-w64 installation, eg. into on my pc into C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
In 2022 VS Code works with CMake & pkgconfig out of the box (add pkgconf && vcpkg-pkgconfig-get-modules to your vcpkg.json)
From: https://github.com/JoinMarket-Org/joinmarket/wiki/Installing-JoinMarket-on-Windows
This guide describes how to install JoinMarket and its dependencies (python, libsodium, secp256k1) on Windows.
Some or all of this may or may not work for all versions of Windows. Reports appreciated. It is not claimed to be in any way comprehensive. Verification of downloads are your own responsibility.
Install JoinMarket - go to https://github.com/JoinMarket-Org/joinmarket/releases and download the most recent release. Unzip it into any location you choose.
You will need to install MinGW from here or go to their website. After a few introductory screens, you will be shown a windows with some optional components that you have to choose; this basic setup is sufficient:
From "Basic Setup" in the left menu:
mingw-developer-toolkit
mingw32-base
mingw32-gcc-g++
msys-base
Once you have chosen these, choose "Update" from the main menu first item. These components will be installed into C:\MinGW\bin. Once that is complete, you should have this dll: libgcc_s_dw2-1.dll in that folder C:\MinGW\bin, along with a lot of other files; I'm mentioning this file explicitly, since it's needed specifically for libsecp256k1 to operate in this setup.
Next, you must make sure C:\MinGW\bin is added to your PATH variable. Here's one guide to how to do that; you must append ;C:\MinGW\bin to the end of the path before continuing.
Install Python from https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi. Run the executable. Choose to install the feature Add python.exe to Path (it's the last option in the installer, off by default - switch it on) on local hard drive during installation; Python should then be installed in C:\Python27 (EXTRA NOTE: the most recent 2.7 installation linked here seems to install pip automatically, which is very useful for step 4)
Check that Python runs. Open a new command prompt as administrator by typing cmd.exe into the Start menu and pressing Ctrl+Shift+Enter. Type python and you should see something like:
Python 2.7.11 (default....
....
>>>
Exit the Python console with exit() or by pressing Ctrl+C. Now, make sure your version of pip is up to date: run the command: python -m pip install --upgrade pip.
Go to the directory C:\Python27\Lib\distutils and add a new file, called distutils.cfg. Inside it, put:
[build]
compiler=mingw32
Close and save the file.
Next, you need to install the dll for libnacl. First go to https://download.libsodium.org/libsodium/releases/ and choose the file libsodium-1.0.4-msvc.zip to download. Unzip anywhere, and then copy the file libsodium.dll from the directory \Win32\Release\v120\dynamic (do not use v140), and paste it into root joinmarket directory (the same directory where README.md lives). Then you need to address the Visual C++ 2013 runtime dependency. Do so by going to www.microsoft.com/en-us/download/details.aspx?id=40784 and clicking Download. Choose x86 even on a 64-bit system, and run the executable.
Note that after doing this, you must run pip install -r requirements-windows.txt from the Joinmarket root directory (where the README.md file is) and should not get an error message (this will install/check the python packages libnacl and secp256k1(-transient)).

Resources