OSDN Git Service

4a2894c87df2cc4c6e9f92f378962cb42f8b9317
[ring-lang-081/ring.git] / docs / en / target / sourcecode.txt
1 .. index:: 
2         single: Building From Source Code; Introduction
3
4 =========================
5 Building From Source Code
6 =========================
7
8 The Ring programming language is a free open source product (MIT License).
9
10 You can build Ring using CMake or using Scripts (Batch Files or Shell Scripts).
11
12 The next steps explains building using scripts.
13
14 .. index:: 
15         pair: Building From Source Code; Building using Microsoft Windows
16
17 Building using Microsoft Windows
18 ================================
19
20 Get the source code
21
22 .. code-block:: ring
23
24         git clone http://github.com/ring-lang/ring.git
25
26 Build Ring (Compiler/VM)
27
28 .. code-block:: ring
29
30         cd ring/src
31         buildvc.bat
32         buildvcw.bat
33
34 Build Ring2EXE
35
36 .. code-block:: none
37
38         cd ../ring2exe
39         buildring2exe.bat
40
41 Generate RingConsoleColors Source Code and Build
42
43 .. code-block:: ring
44
45         cd ../extensions/ringconsolecolors
46         gencode.bat
47         buildvc.bat
48
49 Build RingInternet
50
51 .. code-block:: ring
52         
53         cd ../extensions/ringinternet
54         buildvc.bat
55
56 Generate RingLibCurl Source Code and Build
57
58 .. code-block:: ring
59
60         cd ../extensions/ringcurl
61         gencode.bat
62         buildvc.bat
63
64 Generate RingZip Source Code and Build
65
66 .. code-block:: ring
67
68         cd ../extensions/ringzip
69         gencode.bat
70         buildvc.bat
71
72
73 Build RingPM
74
75 .. code-block:: none
76
77         cd ../ringpm
78         buildringpm.bat
79
80 Build RingODBC
81
82 .. code-block:: ring
83         
84         cd ../extensions/ringodbc
85         buildvc.bat
86
87 Build RingMySQL
88
89 .. code-block:: ring
90         
91         cd ../extensions/ringmysql
92         buildvc.bat
93
94 Build RingSQLite
95
96 .. code-block:: ring
97         
98         cd ../extensions/ringsqlite
99         buildvc.bat
100
101 Build RingPostgreSQL
102
103 .. code-block:: ring
104         
105         cd ../extensions/ringpostgresql
106         gencode.bat
107         buildvc.bat
108
109 Build RingOpenSSL
110
111 .. code-block:: ring
112         
113         cd ../extensions/ringopenssl
114         buildvc.bat
115
116 Build RingMurmurHash
117
118 .. code-block:: ring
119         
120         cd ../extensions/ringmurmurhash
121         buildvc.bat
122
123 Generate RingAllegro Source Code and Build
124
125 .. code-block:: ring
126
127         cd ../extensions/ringallegro
128         gencode.bat
129         buildvc.bat
130
131 Generate RingLibuv Source Code and Build
132
133 .. code-block:: ring
134
135         cd ../extensions/ringlibuv
136         gencode.bat
137         buildvc.bat
138
139 Generate RingFreeGLUT Source Code and Build 
140
141 .. code-block:: ring
142         
143         cd ../extensions/ringfreeglut
144         gencode.bat
145         buildvc.bat
146
147 Generate RingOpenGL Source Code and Build 
148
149 The ringopengl folder contains many sub folders for different OpenGL versions
150
151 Starting from OpenGL 1.1 to OpenGL 4.6
152
153 .. code-block:: ring
154         
155         cd ../extensions/ringopengl/opengl21
156         gencode.bat
157         buildvc.bat
158
159 Generate RingPostgreSQL Source Code and Build 
160
161 .. code-block:: ring
162         
163         cd ../extensions/ringpostgresql
164         gencode.bat
165         buildvc.bat
166
167 Install Qt 5.12 : https://download.qt.io/archive/qt/5.12/5.12.6/
168
169 Generate RingQt Source Code and Build
170
171 .. code-block:: ring
172
173         cd ../extensions/ringqt
174         gencodeqt512.bat
175         buildqt512.bat
176
177 To be able to call ring from any folder
178
179 .. code-block:: ring
180
181         cd ../../bin
182         install.bat
183
184 Add Ring/bin to System path
185
186 .. code-block:: ring
187
188         Hit "windows key".
189         Type "Edit the System environment variables"
190         Select "Advanced" tab.
191         Click on "Enviroment Variables..."
192         Double click on "Path"
193         Add at the end the new path separated by semicolon. 
194             ;C:\Ring\Bin
195
196 Run Ring Notepad
197
198 .. code-block:: ring
199
200         cd applications/rnote
201         ring rnote.ring
202
203 .. index:: 
204         pair: Building From Source Code; Building using Ubuntu Linux
205
206 Building using Ubuntu Linux
207 ===========================
208
209 Get the source code
210
211 .. code-block:: ring
212
213         git clone http://github.com/ring-lang/ring.git
214
215 Install Libraries
216
217 .. code-block:: ring
218
219         cd ring/src
220         ./installdep.sh 
221
222 Build Ring (Compiler/VM)
223
224 .. code-block:: ring
225
226         sudo ./buildgcc.sh
227
228 Build Ring2EXE
229
230 .. code-block:: none
231
232         cd ../ring2exe
233         sudo ./buildring2exe.sh
234
235 Generate RingConsoleColors Source Code and Build
236
237 .. code-block:: ring
238
239         cd ../extensions/ringconsolecolors
240         ./gencode.sh
241         ./buildgcc.sh
242
243 Build RingInternet
244
245 .. code-block:: ring
246         
247         cd ../extensions/ringinternet
248         ./buildgcc.sh
249
250 Generate RingLibCurl Source Code and Build
251
252 .. code-block:: ring
253
254         cd ../extensions/ringcurl
255         ./gencode.sh
256         ./buildgcc.sh
257
258 Generate RingZip Source Code and Build
259
260 .. code-block:: ring
261
262         cd ../extensions/ringzip
263         ./gencode.sh
264         ./buildgcc.sh
265
266 Build RingPM
267
268 .. code-block:: none
269
270         cd ../ringpm
271         sudo ./buildringpm.sh
272
273 Build RingODBC
274
275 .. code-block:: ring
276         
277         cd ../extensions/ringodbc
278         ./buildgcc.sh
279
280 Build RingMySQL
281
282 .. code-block:: ring
283         
284         cd ../extensions/ringmysql
285         ./buildgcc.sh
286
287 Build RingSQLite
288
289 .. code-block:: ring
290         
291         cd ../extensions/ringsqlite
292         ./buildgcc.sh
293
294 Build RingPostgreSQL
295
296 .. code-block:: ring
297         
298         cd ../extensions/ringpostgresql
299         gencode.sh
300         buildgcc.sh
301
302 Build RingOpenSSL
303
304 .. code-block:: ring
305         
306         cd ../extensions/ringopenssl
307         ./buildgcc.sh
308
309 Build RingMurmurHash
310
311 .. code-block:: ring
312         
313         cd ../extensions/ringmurmurhash
314         ./buildgcc.sh
315
316 Generate RingAllegro Source Code and Build
317
318 .. code-block:: ring
319
320         cd ../extensions/ringallegro
321         ./gencode.sh
322         ./buildgcc.sh
323
324 Generate RingLibuv Source Code and Build
325
326 We will build Libuv first
327
328 .. code-block:: ring
329
330         cd ../extensions/ringlibuv/libuv
331         sudo apt-get install libtool m4 automake
332         sh autogen.sh
333         ./configure
334         make
335         make check
336         sudo make install
337
338 Then we will build RingLibuv
339
340 .. code-block:: ring
341         
342         cd ..
343         ./gencode.sh
344         ./buildgcc.sh
345
346 Generate RingFreeGLUT Source Code and Build 
347
348 .. code-block:: ring
349         
350         cd ../extensions/ringfreeglut
351         ./gencode.sh
352         ./buildgcc.sh
353
354 Generate RingOpenGL Source Code and Build 
355
356 The ringopengl folder contains many sub folders for different OpenGL versions
357
358 Starting from OpenGL 1.1 to OpenGL 4.6
359
360 .. code-block:: ring
361         
362         cd ../extensions/ringopengl/opengl21
363         gencode.sh
364         buildgcc.sh
365
366 Generate RingPostgreSQL Source Code and Build
367
368 .. code-block:: ring
369
370         cd ../extensions/ringpostgresql
371         ./gencode.sh
372         ./buildgcc.sh
373
374 Generate RingQt Source Code and Build
375
376 .. code-block:: ring
377
378         cd ../extensions/ringqt
379         ./gencode.sh
380         ./buildgcc.sh
381
382 To be able to call ring from any folder
383
384 .. code-block:: ring
385
386         cd ../../bin
387         sudo ./install.sh
388
389 Run Ring Notepad
390
391 .. code-block:: ring
392
393         cd applications/rnote
394         ring rnote.ring
395
396 .. index:: 
397         pair: Building From Source Code; Building using Fedora Linux
398
399 Building using Fedora Linux
400 ===========================
401
402 Get the source code
403
404 .. code-block:: ring
405
406         git clone http://github.com/ring-lang/ring.git
407
408 Install Libraries
409
410 .. code-block:: ring
411
412         cd ring/src
413         ./installdepfedora.sh 
414
415 Build Ring (Compiler/VM)
416
417 .. code-block:: ring
418
419         sudo ./buildgcc.sh
420
421 Build Ring2EXE
422
423 .. code-block:: none
424
425         cd ../ring2exe
426         sudo ./buildring2exe.sh
427
428 Generate RingConsoleColors Source Code and Build
429
430 .. code-block:: ring
431
432         cd ../extensions/ringconsolecolors
433         ./gencode.sh
434         ./buildgcc.sh
435
436 Build RingInternet
437
438 .. code-block:: ring
439         
440         cd ../extensions/ringinternet
441         ./buildgcc.sh
442
443 Generate RingLibCurl Source Code and Build
444
445 .. code-block:: ring
446
447         cd ../extensions/ringcurl
448         ./gencode.sh
449         ./buildgcc.sh
450
451 Generate RingZip Source Code and Build
452
453 .. code-block:: ring
454
455         cd ../extensions/ringzip
456         ./gencode.sh
457         ./buildgcc.sh
458
459 Build RingPM
460
461 .. code-block:: none
462
463         cd ../ringpm
464         sudo ./buildringpm.sh
465
466 Build RingODBC
467
468 .. code-block:: ring
469         
470         cd ../extensions/ringodbc
471         ./buildgcc.sh
472
473 Build RingMySQL
474
475 .. code-block:: ring
476         
477         cd ../extensions/ringmysql
478         ./buildgccfedora.sh
479
480 Build RingSQLite
481
482 .. code-block:: ring
483         
484         cd ../extensions/ringsqlite
485         ./buildgcc.sh
486
487 Build RingPostgreSQL
488
489 .. code-block:: ring
490         
491         cd ../extensions/ringpostgresql
492         gencode.sh
493         buildgcc.sh
494
495 Build RingOpenSSL
496
497 .. code-block:: ring
498         
499         cd ../extensions/ringopenssl
500         ./buildgcc.sh
501
502 Build RingMurmurHash
503
504 .. code-block:: ring
505         
506         cd ../extensions/ringmurmurhash
507         ./buildgcc.sh
508
509 Generate RingAllegro Source Code and Build
510
511 .. code-block:: ring
512
513         cd ../extensions/ringallegro
514         ./gencode.sh
515         ./buildgcc.sh
516
517 Generate RingLibuv Source Code and Build
518
519 We will build Libuv first
520
521 .. code-block:: ring
522
523         cd ../extensions/ringlibuv/libuv
524         sudo dnf install libtool m4 autoconf automake
525         sh autogen.sh
526         ./configure
527         make
528         make check
529         sudo make install
530
531 Then we will build RingLibuv
532
533 .. code-block:: ring
534         
535         cd ..
536         ./gencode.sh
537         ./buildgcc.sh
538
539 Generate RingFreeGLUT Source Code and Build 
540
541 .. code-block:: ring
542         
543         cd ../extensions/ringfreeglut
544         ./gencode.sh
545         ./buildgcc.sh
546
547 Generate RingOpenGL Source Code and Build 
548
549 The ringopengl folder contains many sub folders for different OpenGL versions
550
551 Starting from OpenGL 1.1 to OpenGL 4.6
552
553 .. code-block:: ring
554         
555         cd ../extensions/ringopengl/opengl21
556         gencode.sh
557         buildgcc.sh
558
559 Generate RingPostgreSQL Source Code and Build
560
561 .. code-block:: ring
562
563         cd ../extensions/ringpostgresql
564         ./gencode.sh
565         ./buildgcc.sh
566
567 Generate RingQt Source Code and Build
568
569 .. code-block:: ring
570
571         cd ../extensions/ringqt
572         ./gencode.sh
573         ./buildgccfedora.sh
574
575 To be able to call ring from any folder
576
577 .. code-block:: ring
578
579         cd ../../bin
580         sudo ./install.sh
581
582 Run Ring Notepad
583
584 .. code-block:: ring
585
586         cd applications/rnote
587         ring rnote.ring
588
589
590
591 .. index:: 
592         pair: Building From Source Code; Building using MacOS X
593
594 Building using MacOS X
595 ======================
596
597 Get the source code
598
599 .. code-block:: ring
600
601         git clone http://github.com/ring-lang/ring.git
602
603 Install homebrew (follow the directions on homebrew's homepage).
604 Install Libraries
605
606 .. code-block:: ring
607
608         cd ring/src
609         ./installdepmac.sh 
610
611 Build Ring (Compiler/VM)
612
613 .. code-block:: ring
614
615         ./buildclang.sh
616
617 Build Ring2EXE
618
619 .. code-block:: none
620
621         cd ../ring2exe
622         sudo ./buildring2exe.sh
623
624 Generate RingConsoleColors Source Code and Build
625
626 .. code-block:: ring
627
628         cd ../extensions/ringconsolecolors
629         ./gencode.sh
630         ./buildclang.sh
631
632 Build RingInternet
633
634 .. code-block:: ring
635         
636         cd ../extensions/ringinternet
637         ./buildclang.sh
638
639 Generate RingLibCurl Source Code and Build
640
641 .. code-block:: ring
642
643         cd ../extensions/ringcurl
644         ./gencode.sh
645         ./buildclang.sh
646
647 Generate RingZip Source Code and Build
648
649 .. code-block:: ring
650
651         cd ../extensions/ringzip
652         ./gencode.sh
653         ./buildclang.sh
654
655 Build RingPM
656
657 .. code-block:: none
658
659         cd ../ringpm
660         sudo ./buildringpm.sh
661
662 Build RingODBC
663
664 .. code-block:: ring
665         
666         cd ../extensions/ringodbc
667         ./buildclang.sh
668
669 Build RingMySQL
670
671 .. code-block:: ring
672         
673         cd ../extensions/ringmysql
674         ./buildclang.sh
675
676 Build RingSQLite
677
678 .. code-block:: ring
679         
680         cd ../extensions/ringsqlite
681         ./buildclang.sh
682
683 Build RingPostgreSQL
684
685 .. code-block:: ring
686         
687         cd ../extensions/ringpostgresql
688         gencode.sh
689         buildclang.sh
690
691 Build RingOpenSSL
692
693 .. code-block:: ring
694         
695         cd ../extensions/ringopenssl
696         ./buildclang.sh
697
698 Build RingMurmurHash
699
700 .. code-block:: ring
701         
702         cd ../extensions/ringmurmurhash
703         ./buildclang.sh
704
705 Generate RingAllegro Source Code and Build
706
707 .. code-block:: ring
708
709         cd ../extensions/ringallegro
710         ./gencode.sh
711         ./buildclang.sh
712
713 Generate RingLibuv Source Code and Build
714
715 .. code-block:: ring
716
717         cd ../extensions/ringlibuv
718         ./gencode.sh
719         ./buildclang.sh
720
721 Generate RingFreeGLUT Source Code and Build 
722
723 .. code-block:: ring
724         
725         cd ../extensions/ringfreeglut
726         ./gencode.sh
727         ./buildclang.sh
728
729 Generate RingOpenGL Source Code and Build 
730
731 The ringopengl folder contains many sub folders for different OpenGL versions
732 Starting from OpenGL 1.1 to OpenGL 4.6
733
734 .. code-block:: ring
735         
736         cd ../extensions/ringopengl/opengl21
737         ./gencode.sh
738         ./buildclang.sh
739
740 Generate RingPostgreSQL Source Code and Build
741
742 .. code-block:: ring
743
744         cd ../extensions/ringpostgresql
745         ./gencode.sh
746         ./buildclang.sh
747
748 Generate RingQt Source Code and Build
749
750 .. code-block:: ring
751
752         cd ../extensions/ringqt
753         ./gencodemac.sh
754         ./buildclang.sh
755
756 To be able to call ring from any folder
757
758 .. code-block:: ring
759
760         cd ../../bin
761         sudo ./install.sh
762
763 Run Ring Notepad
764
765 .. code-block:: ring
766
767         cd applications/rnote
768         sudo ring rnote.ring
769
770 .. index:: 
771         pair: Building From Source Code; Building using CMake
772
773 Building using CMake
774 ====================
775
776 Install libraries (MySQL Client, OpenSSL, LibCurl, Allegro 5 and Qt 5.5)
777
778 .. code-block:: ring
779
780         cmake .
781         make