Trying to build ruby on visual studio with zlib - ruby

I'm trying to build ruby on visual studio with zlib and I'm having problems with it.
I have prepared everything to build it but I don't know how to specify where the zlib library and headers are.
I have the source code in $(ProjectDir)/..
I am buildin in $(ProjectDir)/$(Platform)/$(Configuration)
I build with command line, and I have it like this
mkdir $(Platform)\$(Configuration)
cd $(Platform)\$(Configuration)\
..\..\..\win32\configure.bat --target=i386-mswin32 --prefix=$(ProjectDir)$(Platform)\$(Configuration)\bin
If I go to ext/zlib, I can execute
extconf.rb --with-zlib-lib=$(ProjectDir)..\..\zlib-1.2.8\zlib-1.2.8\$(Platform)\$(Configuration)\lib --with-zlib-include=$(ProjectDir)..\..\zlib-1.2.8
and creates the makefile correcly, but I don't know how to pass zlib lib
and include paths to the configuration script.
I have tried with
..\..\..\win32\configure.bat --target=i386-mswin32 --prefix=$(ProjectDir)$(Platform)\$(Configuration)\bin --with-zlib-lib=$(ProjectDir)..\..\zlib-1.2.8\zlib-1.2.8\$(Platform)\$(Configuration)\lib --with-zlib-include=$(ProjectDir)..\..\zlib-1.2.8
but that doesn't works
I suppose it has something to do with the '--with-ext="a,b,..."' option or with the "--path" that is specified in the help command, but I don't know how to specify it and the documentation is really bad.
I would be very gratefull if you could help me.

The instructions below are for Ruby 2.2.5 – if you want to build some other version or use different folder paths, change accordingly. I used these to successfully build Ruby 2.2.5 and 2.3.1 from source with zlib using VS2013 Community Update 5 on Windows 8.1 Pro x64.
Create folders:
C:\ruby-2.2.5\build
C:\ruby-2.2.5\src
Untar ruby-2.2.5.tar.gz and put the sources in C:\ruby-2.2.5\src
Unzip the zlib distribution archive (zlib128-dll.zip) into C:\zlib128-dll
Run Developer Command Prompt for VS2013, then run:
SET INCLUDE=%INCLUDE%;C:\zlib128-dll\include
SET LIB=%LIB%;C:\zlib128-dll\lib
SET PATH=%PATH%;C:\zlib128-dll
cd C:\ruby-2.2.5\build
..\src\win32\configure.bat
nmake
nmake DESTDIR=C:/ruby-2.2.5 install
Done. You should now have a fully working, zlib-enabled, Ruby build in C:\ruby-2.2.5\usr.

Related

How can I compile Evince3 on Windows using msys2 from Evince3 Source Codes?

Evince3 Source Code link = http://ftp.gnome.org/pub/GNOME/sources/evince/3.26/
I downloaded the Evince3 pdf reader program source code from the above link. and installed msys2 with gcc and gtk3 librares. Evince3 created using gtk3 module in C. but I don't know how to compile source code of Evince3 for using this program on Windows. Is it possible ?
Thanks.
I was curious to learn how to build Gtk apps on windows, so I did it myself, and it took me around one hour.
I followed this guide, https://blogs.gnome.org/nacho/2014/08/01/how-to-build-your-gtk-application-on-windows.
Note that the author used gedit as example. To install evince, you need to download three files from this directory(get 32 or 64 version of install file), https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-evince.
Modify pkgver to 3.26.0 and sha256sum to the hash value in evince-3.26.0.sha256sum in PKGBUILD file, and follow the rest of instructions.
Other way: It's also possible to install pre-built package from mysys2 repo with compiling the source code. Open the msys2 console and give the following command to install Evince.
pacman -S mingw-w64-x86_64-evince

Is it possible to set up GStreamer for use in MinGW, similar to how it's done in Linux?

Apologies for the tardy title, I'm not quite sure how to phrase this question. At its most basic, I'm attempting to compile a program with GStreamer. When running the configure script for said program I get the following error:
0:20.39 configure: checking for gstreamer-1.0 >= 1.0
0:20.39 gstreamer-app-1.0
0:20.39 gstreamer-plugins-base-1.0
0:20.39 configure: error: gstreamer and gstreamer-plugins-base development pack
ages are needed to build gstreamer backend. Install them or disable gstreamer su
pport with --disable-gstreamer
The build environment I'm compiling in:
Windows 7 (64-Bit)
MINGW & MSYS
Visual C/C++ 2010 SP1 (command line)
Now if this error occurred on a Linux distro, - say Ubuntu - it could be remedied by running the following commands:
apt-get install libgstreamer-plugins-base1.0-dev
apt-get install libgstreamer1.0-dev
What is the equivalent for Windows? I've found two type of versions that can be used: The gstreamer bin from the developer website, which has the following structure:
bin
include
lib
share
And a dynamic library of gstreamer for mingw with the following structure:
bin
lib
How am I supposed to let mingw/msys know that the gstreamer library is installed? Do I place the folders above in the relevant MSYS directories? Then, how does the configure know that it's installed and ready to be used?
I hope what I'm asking makes sense, please let me know if anything is confused. Cheers!
Using the first solution (official binaries from GStreamer), you need to tell the configure script where everything is located.
The simplest way is to set the environment variable PKG_CONFIG_PATH to where the .pc files are located. Generally it's in
$install_directory/lib/pkgconfig/
Replace $install_directory with the actual location, ex if it's installed in /c/GStreamer :
PKG_CONFIG_PATH=/c/GStreamer/lib/pkgconfig ./configure
That should make configure figure out everything

Visual Studio - how to build app with openssl source

How to build app with source of openssl, without compiled openssl.dll and libeay.dll ?
I downloaded openssl-0.9.8h, set include paths to path-to-sources/include/. Files located in include/openssl/ it's links to files ../../{crypto/_algo-name_/algosource.h}, and VS do not understand this links.
Actually, you need to build OpenSSL and that will generate the library and header files in the patch specified in makefile. And you should use that include files. These header files are like template files and used while building OpenSSL. See this question.
And search how to build OpenSSL on Windows.
As the problem mentioned by you after compilation, there should not be any need of OpenSSL, you can do it in the following manner:
Generate static library of OpenSSL and use it in your application. Now, after compilation of your application, OpenSSL dlls will not be required.
If your application is very small, you can compile it with OpenSSL static library.
How to build app with source of openssl, without compiled openssl.dll and libeay.dll
You cannot. You need to build the OpenSSL library first.
I downloaded openssl-0.9.8h, set include paths to path-to-sources/include/....
Your next step is to open INSTALL.W32 and read the instructions. Here's an exceprt with most of the steps. But be sure to execute it using a Visual Studio Command Prompt so the tools like cl.exe and link.exe are on path.
If you want to compile in the assembly language routines with Visual
C++, then you will need already mentioned Netwide Assembler binary,
nasmw.exe or nasm.exe, to be available on your %PATH%.
Firstly you should run Configure with platform VC-WIN32:
> perl Configure VC-WIN32 --prefix=c:\some\openssl\dir
Where the prefix argument specifies where OpenSSL will be installed to.
Next you need to build the Makefiles and optionally the assembly
language files:
- If you are using NASM then run:
> ms\do_nasm
- If you don't want to use the assembly language files at all then run:
> perl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir
> ms\do_ms
If you get errors about things not having numbers assigned then check the
troubleshooting section: you probably won't be able to compile it as it
stands.
Then from the VC++ environment at a prompt do:
> nmake -f ms\ntdll.mak
If all is well it should compile and you will have some DLLs and
executables in out32dll. If you want to try the tests then do:
> nmake -f ms\ntdll.mak test
To install OpenSSL to the specified location do:
> nmake -f ms\ntdll.mak install
Thomas Hruska of Shining Light Productions offers Win32 OpenSSL. Its a pre-built OpenSSL with a Windows installer. He's been providing it for years.
Once installed, just point to it in Visual Studio. There's no fussing with environments like Cygwin, Perl and scripts to modify source code so that Unix and Linux work on Windows. (That's a dumb idea to me. Windows is Windows, and Linux is Linux. Stop trying to make one act like the other).

Build Lua 5.2.2 in Windows

I already have Lua For Windows installed but as I read about the latest version of Lua which is 5.2.2, I noticed that Lua For Windows is using an old version of Lua which is 5.1.
I want to build the latest lua version to my windows 7 pc, but I don't quite get the idea on how I can build it. I already read this too Detailed Instruction for installing Lua. Do i need to remove the Lua For Windows ? please give me links how I can build it? what are the necessary tools to build the last lua source code.
Note: please also tell how can I test a source on it.
Compiling lua on Windows using Visual Studio is as simple as:
Downloading a copy of the lua source code and extracting it
Opening a Visual Studio Developer Command Prompt and navigating to the 'src' directory
Run this command: move luac.c .. & cl *.c -o lua.exe /O1
Lua binaries are hosted on sourceforge. You don't need to remove Lua for Windows. What I do on my installation of LFW is, I overwrite the lua.exe and lua.dll with the respective 5.2.* files from the binaries I downloaded.
PS: Sourceforge hasn't been updated with 5.2.2 release of Lua and is still at version 5.2.1. If you want to build, you'll find the similar question that greatwolf has linked to.

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.

Resources