| 1 |
Build and Installation of Libdiscid |
| 2 |
=================================== |
| 3 |
|
| 4 |
You can either use the GNU build system (autotools) or Cmake to build libdiscid. |
| 5 |
No additionaly tools (except a C compiler) are required. |
| 6 |
An out-of-source build is recommended. |
| 7 |
|
| 8 |
Cmake |
| 9 |
----- |
| 10 |
mkdir _build; cd _build/ |
| 11 |
cmake .. |
| 12 |
make |
| 13 |
make check |
| 14 |
make install |
| 15 |
|
| 16 |
|
| 17 |
Autotools |
| 18 |
--------- |
| 19 |
mkdir _build; cd _build/ |
| 20 |
../configure |
| 21 |
make |
| 22 |
make check |
| 23 |
make install |
| 24 |
|
| 25 |
|
| 26 |
Both |
| 27 |
---- |
| 28 |
Optional API documentation in HTML format is created by Doxygen with: |
| 29 |
|
| 30 |
make docs |
| 31 |
|
| 32 |
|
| 33 |
Compiler flags |
| 34 |
-------------- |
| 35 |
|
| 36 |
The following defines can be used to change the build: |
| 37 |
|
| 38 |
DISCID_USE_HTTPS: If set, the functions discid_get_submission_url and |
| 39 |
discid_get_webservice_url will generate URLs using the HTTPS protocol instead |
| 40 |
of HTTP. This might break existing applications that rely on the exact URL |
| 41 |
structure being returned. |
| 42 |
|
| 43 |
To enable this feature when using CMake, change the cmake command from above to: |
| 44 |
|
| 45 |
cmake -DENABLE_USE_HTTPS=ON .. |
| 46 |
|
| 47 |
To enable this feature when using Autotools, change the configure command from above to: |
| 48 |
|
| 49 |
../configure --enable-use-https=yes |
| 50 |
|
| 51 |
NOTE: Having DISCID_USE_HTTPS enabled will become the default in a future release. |
| 52 |
Please prepare your code to not rely on the specific URL protocol for URLs |
| 53 |
generated by libdiscid. |
| 54 |
|
| 55 |
|
| 56 |
Building from git repository |
| 57 |
---------------------------- |
| 58 |
If you fetched the source with git, you should either |
| 59 |
use Cmake (no difference to the source distribution) |
| 60 |
or have autoconf, automake and libtool installed and do ./autogen.sh |
| 61 |
before doing the usual build. |
| 62 |
|
| 63 |
|
| 64 |
Tips for Windows |
| 65 |
---------------- |
| 66 |
For most systems cmake and autotools work (nearly) "out of the box". |
| 67 |
On Windows you should use Cmake. |
| 68 |
|
| 69 |
Building with MinGW in the MinGW/MSYS shell: |
| 70 |
|
| 71 |
cmake -G "MSYS Makefiles" .. |
| 72 |
make |
| 73 |
|
| 74 |
Building with NMake (MS Visual Studio command line): |
| 75 |
|
| 76 |
cmake -G "NMake Makefiles" .. |
| 77 |
nmake |
| 78 |
|
| 79 |
|
| 80 |
Notes for BSD |
| 81 |
------------- |
| 82 |
With Cmake builds the library version/soname will work the same as on Linux. |
| 83 |
With the Autotools, libtool is used and generates sonames as major+minor. |
| 84 |
For NetBSD there seems to be a change with libdiscid 0.4.0, where libtool now |
| 85 |
seems to use Linux versioning (soversion=major). |
| 86 |
|
| 87 |
Please make sure that the correct soname is used. |
| 88 |
Libdiscid still has major version 0 and is backwards compatible to 0.1.0. |