.. index:: 
	single: Building From Source Code; Introduction

=========================
Building From Source Code
=========================

The Ring programming language is a free open source product (MIT License).

You can build Ring using CMake or using Scripts (Batch Files or Shell Scripts).

The next steps explains building using scripts.

.. index:: 
	pair: Building From Source Code; Building using Microsoft Windows

Building using Microsoft Windows
================================

Get the source code

.. code-block:: none

	git clone http://github.com/ring-lang/ring.git

Build Ring (Compiler/VM)

.. code-block:: none

	cd ring/language/src
	buildvc.bat
	buildvcw.bat

Build Ring2EXE

.. code-block:: none

	cd ring/tools/ring2exe
	buildring2exe.bat

Generate RingConsoleColors Source Code and Build

.. code-block:: none

	cd ring/extensions/ringconsolecolors
	gencode.bat
	buildvc.bat

Build RingInternet

.. code-block:: none
	
	cd ring/extensions/ringinternet
	buildvc.bat

Generate RingLibCurl Source Code and Build

.. code-block:: none

	cd ring/extensions/ringcurl
	gencode.bat
	buildvc.bat

Generate RingZip Source Code and Build

.. code-block:: none

	cd ring/extensions/ringzip
	gencode.bat
	buildvc.bat


Build RingPM

.. code-block:: none

	cd ring/tools/ringpm
	buildringpm.bat

Build RingODBC

.. code-block:: none
	
	cd ring/extensions/ringodbc
	buildvc.bat

Build RingMySQL

.. code-block:: none
	
	cd ring/extensions/ringmysql
	buildvc.bat

Build RingSQLite

.. code-block:: none
	
	cd ring/extensions/ringsqlite
	buildvc.bat

Build RingPostgreSQL

.. code-block:: none
	
	cd ring/extensions/ringpostgresql
	gencode.bat
	buildvc.bat

Build RingOpenSSL

.. code-block:: none
	
	cd ring/extensions/ringopenssl
	buildvc.bat

Build RingMurmurHash

.. code-block:: none
	
	cd ring/extensions/ringmurmurhash
	buildvc.bat

Generate RingAllegro Source Code and Build

.. code-block:: none

	cd ring/extensions/ringallegro
	gencode.bat
	buildvc.bat

Generate RingLibuv Source Code and Build

.. code-block:: none

	cd ring/extensions/ringlibuv
	gencode.bat
	buildvc.bat

Generate RingFreeGLUT Source Code and Build 

.. code-block:: none
	
	cd ring/extensions/ringfreeglut
	gencode.bat
	buildvc.bat

Generate RingOpenGL Source Code and Build 

The ringopengl folder contains many sub folders for different OpenGL versions

Starting from OpenGL 1.1 to OpenGL 4.6

.. code-block:: none
	
	cd ring/extensions/ringopengl/opengl21
	gencode.bat
	buildvc.bat

Generate RingPostgreSQL Source Code and Build 

.. code-block:: none
	
	cd ring/extensions/ringpostgresql
	gencode.bat
	buildvc.bat

Generate RingQt Source Code and Build

Tested using Qt 5.12 and Qt 5.15

For Qt 5.12 ( Install Qt 5.12 : https://download.qt.io/archive/qt/5.12/5.12.6/ )

.. code-block:: none

	cd ring/extensions/ringqt
	gencodeqt512_nobluetooth.bat
	buildqt512_nobluetooth.bat

To Copy the Qt runtime files to ring/bin folder

.. code-block:: none

	cd ring/extensions/ringqt/binupdate
	installqt512.bat

For Qt 5.15 ( Install Qt 5.15 : https://www.qt.io/blog/qt-5.15-released )

.. code-block:: none

	cd ring/extensions/ringqt
	gencodeqt515_nobluetooth.bat
	buildqt515_nobluetooth.bat

To Copy the Qt runtime files to ring/bin folder

.. code-block:: none

	cd ring/extensions/ringqt/binupdate
	installqt515.bat

To be able to call ring from any folder

.. code-block:: none

	cd ring/bin
	install.bat

Add Ring/bin to System path

.. code-block:: none

	Hit "windows key".
	Type "Edit the System environment variables"
	Select "Advanced" tab.
	Click on "Enviroment Variables..."
	Double click on "Path"
	Add at the end the new path separated by semicolon. 
	    ;C:\Ring\Bin

Run Ring Notepad

.. code-block:: none

	cd ring/tools/ringnotepad
	ring rnote.ring

.. index:: 
	pair: Building From Source Code; Building using Ubuntu Linux

Building using Ubuntu Linux
===========================

Get the source code

.. code-block:: none

	git clone http://github.com/ring-lang/ring.git

Install Libraries

.. code-block:: none

	cd ring/language/src
	./installdep.sh 

Build Ring (Compiler/VM)

.. code-block:: none

	sudo ./buildgcc.sh

Build Ring2EXE

.. code-block:: none

	cd ring/tools/ring2exe
	sudo ./buildring2exe.sh

Generate RingConsoleColors Source Code and Build

.. code-block:: none

	cd ring/extensions/ringconsolecolors
	./gencode.sh
	./buildgcc.sh

Build RingInternet

.. code-block:: none
	
	cd ring/extensions/ringinternet
	./buildgcc.sh

Generate RingLibCurl Source Code and Build

.. code-block:: none

	cd ring/extensions/ringcurl
	./gencode.sh
	./buildgcc.sh

Generate RingZip Source Code and Build

.. code-block:: none

	cd ring/extensions/ringzip
	./gencode.sh
	./buildgcc.sh

Build RingPM

.. code-block:: none

	cd ring/tools/ringpm
	sudo ./buildringpm.sh

Build RingODBC

.. code-block:: none
	
	cd ring/extensions/ringodbc
	./buildgcc.sh

Build RingMySQL

.. code-block:: none
	
	cd ring/extensions/ringmysql
	./buildgcc.sh

Build RingSQLite

.. code-block:: none
	
	cd ring/extensions/ringsqlite
	./buildgcc.sh

Build RingPostgreSQL

.. code-block:: none
	
	cd ring/extensions/ringpostgresql
	gencode.sh
	buildgcc.sh

Build RingOpenSSL

.. code-block:: none
	
	cd ring/extensions/ringopenssl
	./buildgcc.sh

Build RingMurmurHash

.. code-block:: none
	
	cd ring/extensions/ringmurmurhash
	./buildgcc.sh

Generate RingAllegro Source Code and Build

.. code-block:: none

	cd ring/extensions/ringallegro
	./gencode.sh
	./buildgcc.sh

Generate RingLibuv Source Code and Build

We will build Libuv first

.. code-block:: none

	cd ring/extensions/ringlibuv/libuv
	sudo apt-get install libtool m4 automake
	sh autogen.sh
	./configure
	make
	make check
	sudo make install

Then we will build RingLibuv

.. code-block:: none
	
	cd ring/extensions/ringlibuv
	./gencode.sh
	./buildgcc.sh

Generate RingFreeGLUT Source Code and Build 

.. code-block:: none
	
	cd ring/extensions/ringfreeglut
	./gencode.sh
	./buildgcc.sh

Generate RingOpenGL Source Code and Build 

The ringopengl folder contains many sub folders for different OpenGL versions

Starting from OpenGL 1.1 to OpenGL 4.6

.. code-block:: none
	
	cd ring/extensions/ringopengl/opengl21
	gencode.sh
	buildgcc.sh

Generate RingPostgreSQL Source Code and Build

.. code-block:: none

	cd ring/extensions/ringpostgresql
	./gencode.sh
	./buildgcc.sh

Generate RingQt Source Code and Build

.. code-block:: none

	cd ring/extensions/ringqt
	./gencode.sh
	./buildgcc.sh

To be able to call ring from any folder

.. code-block:: none

	cd ring/bin
	sudo ./install.sh

Run Ring Notepad

.. code-block:: none

	cd ring/tools/ringnotepad
	ring rnote.ring

.. index:: 
	pair: Building From Source Code; Building using Fedora Linux

Building using Fedora Linux
===========================

Get the source code

.. code-block:: none

	git clone http://github.com/ring-lang/ring.git

Install Libraries

.. code-block:: none

	cd ring/language/src
	./installdepfedora.sh 

Build Ring (Compiler/VM)

.. code-block:: none

	sudo ./buildgcc.sh

Build Ring2EXE

.. code-block:: none

	cd ring/tools/ring2exe
	sudo ./buildring2exe.sh

Generate RingConsoleColors Source Code and Build

.. code-block:: none

	cd ring/extensions/ringconsolecolors
	./gencode.sh
	./buildgcc.sh

Build RingInternet

.. code-block:: none
	
	cd ring/extensions/ringinternet
	./buildgcc.sh

Generate RingLibCurl Source Code and Build

.. code-block:: none

	cd ring/extensions/ringcurl
	./gencode.sh
	./buildgcc.sh

Generate RingZip Source Code and Build

.. code-block:: none

	cd ring/extensions/ringzip
	./gencode.sh
	./buildgcc.sh

Build RingPM

.. code-block:: none

	cd ring/tools/ringpm
	sudo ./buildringpm.sh

Build RingODBC

.. code-block:: none
	
	cd ring/extensions/ringodbc
	./buildgcc.sh

Build RingMySQL

.. code-block:: none
	
	cd ring/extensions/ringmysql
	./buildgccfedora.sh

Build RingSQLite

.. code-block:: none
	
	cd ring/extensions/ringsqlite
	./buildgcc.sh

Build RingPostgreSQL

.. code-block:: none
	
	cd ring/extensions/ringpostgresql
	gencode.sh
	buildgcc.sh

Build RingOpenSSL

.. code-block:: none
	
	cd ring/extensions/ringopenssl
	./buildgcc.sh

Build RingMurmurHash

.. code-block:: none
	
	cd ring/extensions/ringmurmurhash
	./buildgcc.sh

Generate RingAllegro Source Code and Build

.. code-block:: none

	cd ring/extensions/ringallegro
	./gencode.sh
	./buildgcc.sh

Generate RingLibuv Source Code and Build

We will build Libuv first

.. code-block:: none

	cd ring/extensions/ringlibuv/libuv
	sudo dnf install libtool m4 autoconf automake
	sh autogen.sh
	./configure
	make
	make check
	sudo make install

Then we will build RingLibuv

.. code-block:: none
	
	cd ring/extensions/ringlibuv
	./gencode.sh
	./buildgcc.sh

Generate RingFreeGLUT Source Code and Build 

.. code-block:: none
	
	cd ring/extensions/ringfreeglut
	./gencode.sh
	./buildgcc.sh

Generate RingOpenGL Source Code and Build 

The ringopengl folder contains many sub folders for different OpenGL versions

Starting from OpenGL 1.1 to OpenGL 4.6

.. code-block:: none
	
	cd ring/extensions/ringopengl/opengl21
	gencode.sh
	buildgcc.sh

Generate RingPostgreSQL Source Code and Build

.. code-block:: none

	cd ring/extensions/ringpostgresql
	./gencode.sh
	./buildgcc.sh

Generate RingQt Source Code and Build

.. code-block:: none

	cd ring/extensions/ringqt
	./gencode.sh
	./buildgccfedora.sh

To be able to call ring from any folder

.. code-block:: none

	cd ring/bin
	sudo ./install.sh

Run Ring Notepad

.. code-block:: none

	cd ring/tools/ringnotepad
	ring rnote.ring



.. index:: 
	pair: Building From Source Code; Building using MacOS X

Building using MacOS X
======================

Get the source code

.. code-block:: none

	git clone http://github.com/ring-lang/ring.git

Install homebrew (follow the directions on homebrew's homepage).
Install Libraries

.. code-block:: none

	cd ring/language/src
	./installdepmac.sh 

Build Ring (Compiler/VM)

.. code-block:: none

	./buildclang.sh

Build Ring2EXE

.. code-block:: none

	cd ring/tools/ring2exe
	sudo ./buildring2exe.sh

Generate RingConsoleColors Source Code and Build

.. code-block:: none

	cd ring/extensions/ringconsolecolors
	./gencode.sh
	./buildclang.sh

Build RingInternet

.. code-block:: none
	
	cd ring/extensions/ringinternet
	./buildclang.sh

Generate RingLibCurl Source Code and Build

.. code-block:: none

	cd ring/extensions/ringcurl
	./gencode.sh
	./buildclang.sh

Generate RingZip Source Code and Build

.. code-block:: none

	cd ring/extensions/ringzip
	./gencode.sh
	./buildclang.sh

Build RingPM

.. code-block:: none

	cd ring/tools/ringpm
	sudo ./buildringpm.sh

Build RingODBC

.. code-block:: none
	
	cd ring/extensions/ringodbc
	./buildclang.sh

Build RingMySQL

.. code-block:: none
	
	cd ring/extensions/ringmysql
	./buildclang.sh

Build RingSQLite

.. code-block:: none
	
	cd ring/extensions/ringsqlite
	./buildclang.sh

Build RingPostgreSQL

.. code-block:: none
	
	cd ring/extensions/ringpostgresql
	gencode.sh
	buildclang.sh

Build RingOpenSSL

.. code-block:: none
	
	cd ring/extensions/ringopenssl
	./buildclang.sh

Build RingMurmurHash

.. code-block:: none
	
	cd ring/extensions/ringmurmurhash
	./buildclang.sh

Generate RingAllegro Source Code and Build

.. code-block:: none

	cd ring/extensions/ringallegro
	./gencode.sh
	./buildclang.sh

Generate RingLibuv Source Code and Build

.. code-block:: none

	cd ring/extensions/ringlibuv
	./gencode.sh
	./buildclang.sh

Generate RingFreeGLUT Source Code and Build 

.. code-block:: none
	
	cd ring/extensions/ringfreeglut
	./gencode.sh
	./buildclang.sh

Generate RingOpenGL Source Code and Build 

The ringopengl folder contains many sub folders for different OpenGL versions
Starting from OpenGL 1.1 to OpenGL 4.6

.. code-block:: none
	
	cd ring/extensions/ringopengl/opengl21
	./gencode.sh
	./buildclang.sh

Generate RingPostgreSQL Source Code and Build

.. code-block:: none

	cd ring/extensions/ringpostgresql
	./gencode.sh
	./buildclang.sh

Generate RingQt Source Code and Build

.. code-block:: none

	cd ring/extensions/ringqt
	./gencodemac.sh
	./buildclang.sh

To be able to call ring from any folder

.. code-block:: none

	cd ring/bin
	sudo ./install.sh

Run Ring Notepad

.. code-block:: none

	cd ring/tools/ringnotepad
	sudo ring rnote.ring

.. index:: 
	pair: Building From Source Code; Building using CMake

Building using CMake
====================

This will build the Ring compiler and Ring Virtual Machine 

.. code-block:: none

	cmake .
	make
