| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
:orphan: |
| 4 |
|
| 5 |
.. warning:: |
| 6 |
Building with GNU Autotools is deprecated, you should build with CMake: :doc:`/install/cmake` |
| 7 |
|
| 8 |
How to build Groonga at the repository by GNU Autotools |
| 9 |
======================================================= |
| 10 |
|
| 11 |
This document describes how to build Groonga at the repository by GNU |
| 12 |
Autotools. |
| 13 |
|
| 14 |
You can't choose this way if you develop Groonga on Windows. If you |
| 15 |
want to use Windows for developing Groonga, see :doc:`windows_cmake`. |
| 16 |
|
| 17 |
Install depended software |
| 18 |
------------------------- |
| 19 |
|
| 20 |
TODO |
| 21 |
|
| 22 |
* `Autoconf <http://www.gnu.org/software/autoconf/>`_ |
| 23 |
* `Automake <http://www.gnu.org/software/automake/>`_ |
| 24 |
* `GNU Libtool <http://www.gnu.org/software/libtool/>`_ |
| 25 |
* `Ruby <https://www.ruby-lang.org/>`_ |
| 26 |
* `Git <https://git-scm.com/>`_ |
| 27 |
* `Cutter <http://cutter.sourceforge.net/>`_ |
| 28 |
* ... |
| 29 |
|
| 30 |
Checkout Groonga from the repository |
| 31 |
------------------------------------ |
| 32 |
|
| 33 |
Users use released source archive. But developers must build Groonga |
| 34 |
at the repository. Because source code in the repository is the |
| 35 |
latest. |
| 36 |
|
| 37 |
The Groonga repository is hosted on `GitHub |
| 38 |
<https://github.com/groonga/groonga>`_. Checkout the latest source |
| 39 |
code from the repository:: |
| 40 |
|
| 41 |
% git clone --recursive [email protected]:groonga/groonga.git |
| 42 |
|
| 43 |
Create ``configure`` |
| 44 |
-------------------- |
| 45 |
|
| 46 |
You need to create ``configure``. ``configure`` is included in source |
| 47 |
archive but not included in the repository. |
| 48 |
|
| 49 |
``configure`` is a build tool that detects your system and generates |
| 50 |
build configurations for your environment. |
| 51 |
|
| 52 |
Run ``autogen.sh`` to create ``configure``:: |
| 53 |
|
| 54 |
% ./autogen.sh |
| 55 |
|
| 56 |
Run ``configure`` |
| 57 |
----------------- |
| 58 |
|
| 59 |
You can custom your build configuration by passing options to |
| 60 |
``configure``. |
| 61 |
|
| 62 |
Here are recommended ``configure`` options for developers:: |
| 63 |
|
| 64 |
% ./configure --prefix=/tmp/local --enable-debug --enable-mruby --with-ruby |
| 65 |
|
| 66 |
Here are descriptions of these options: |
| 67 |
|
| 68 |
``--prefix=/tmp/local`` |
| 69 |
It specifies that you install your Groonga into temporary |
| 70 |
directory. You can do "clean install" by removing |
| 71 |
``/tmp/local`` directory. It'll be useful for debugging install. |
| 72 |
|
| 73 |
``--enable-debug`` |
| 74 |
It enables debug options for C/C++ compiler. It's useful for |
| 75 |
debugging on debugger such as GDB and LLDB. |
| 76 |
|
| 77 |
``--eanble-mruby`` |
| 78 |
It enables mruby support. The feature isn't enabled by default |
| 79 |
but developers should enable the feature. |
| 80 |
|
| 81 |
``--with-ruby`` |
| 82 |
It's needed for ``--enable-mruby`` and running functional tests. |
| 83 |
|
| 84 |
Run ``make`` |
| 85 |
------------ |
| 86 |
|
| 87 |
Now, you can build Groonga. |
| 88 |
|
| 89 |
Here is a recommended ``make`` command line for developers:: |
| 90 |
|
| 91 |
% make -j8 > /dev/null |
| 92 |
|
| 93 |
``-j8`` decreases build time. It enables parallel build. If you have 8 |
| 94 |
or more CPU cores, you can increase ``8`` to decreases more build |
| 95 |
time. |
| 96 |
|
| 97 |
You can just see only warning and error messages by ``> |
| 98 |
/dev/null``. Developers shouldn't add new warnings and errors in new |
| 99 |
commit. |
| 100 |
|
| 101 |
See also |
| 102 |
-------- |
| 103 |
|
| 104 |
* :doc:`/contribution/development/test` |