Difference between revisions of "Black&White Project/Automatic compilation/configure"

From Kiwix
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:


* The new configure script will tend to a more standard autotools approach by changing options names.
* The new configure script will tend to a more standard autotools approach by changing options names.
* There are two main direction: static build or shared build.
* There are two main direction: packaged build or regular build.
* Each dependency (shared objects or archive) can be specified.
* Each dependency (shared objects or archive) can be specified.
* Not found dependencies falls back to download/compile mode.
* Not found dependencies falls back to download/compile mode.
* Download/compile respects main direction.
* Download/compile respects main direction.
* Each dependency can be explicitly compiled statically


Files modified:
Files modified:
* [http://kiwix.svn.sourceforge.net/viewvc/kiwix/moulinkiwix/autogen.sh?revision=HEAD&content-type=text%2Fplain autogen.sh]
* [http://kiwix.svn.sourceforge.net/viewvc/kiwix/moulinkiwix/autogen.sh?revision=HEAD&content-type=text%2Fplain autogen.sh]
* [http://kiwix.svn.sourceforge.net/viewvc/kiwix/moulinkiwix/configure_alt.ac?revision=HEAD&view=markup configure_alt.ac]
* [http://kiwix.svn.sourceforge.net/viewvc/kiwix/moulinkiwix/configure_alt.ac?revision=HEAD&view=markup configure_alt.ac]
* All Makefile.am


== Options ==
== Options ==


Options behavior depends on the build type:
All dependencies must be present as shared objects (dll, dylib).
* If building a shared version, dependency resolution is:
A packaged build is a regular build which then creates a tarball containing all shared objects.
** if --with-static-option= then use that static path to link.
Components are NOT built statically.
** if --with-option=path then use that shared object to link to.
** try to find shared lib with pkg-config
* If building a static version:
** if --with-static-option= then use that path to link.
** download and build dependency ourselves


''--with-static-option'' can receive ''SELF'' as value which the script will interpret as ''download and build a static version for me''.
The command line binaries (server, indexer, searcher, manager, reader) are built statically.


=== ''--build-static'' (default: false) ===
Each dependency has two options:
'''variable''': ''STATIC_BUILD'' (bool)
 
* ''--with-dep=''
Used to specify the folder where to find the shared objects.
* ''--with-static-dep=''
Used to specify the path to the static archive.
 
Both options can receive ''SELF'' as value which the script will interpret as ''download and build for me''. Should SELF be defined for either shared or static, both will be built and used.
 
=== ''--enable-compileall'' (default: false) ===
'''variable''': ''COMPIL_DEPS'' (bool)


Defines whether to build a static version or not.
Defines whether to build a static version or not.
There is no ''--build-shared'' option.


=== ''--with-gecko-sdk='' ===
=== ''--with-gecko-sdk='' ===
Line 45: Line 48:
Debian package: xulrunner-1.9-dev (ubuntu maverick and before, debian 6) [https://developer.mozilla.org/en/Gecko_SDK Gecko_SDK]
Debian package: xulrunner-1.9-dev (ubuntu maverick and before, debian 6) [https://developer.mozilla.org/en/Gecko_SDK Gecko_SDK]


=== ''--with-z='' ===
=== Optional packages ===
'''variable''': ''ZLIB_LDFLAGS''. Path to ''libz.so''.


Debian package: zlib1g
Command line tools are mostly optional (except for server).
Active/deactive compilation with ''enable-xxx'' and ''disable-xxx''.


=== ''--with-static-z='' ===
=== Regular dependencies ===
'''variable''': ''ZLIB_LDFLAGS''. Path to ''libz.a''.


Debian package: zlib1g-dev
The following dependencies are required:


=== ''--with-xapian='' ===
* Zlib
'''variable''': ''XAPIAN_LDFLAGS''. Path to ''libxapian.so''.
* Xapian
* SQLite
* libmicroHTTPd
* LZMA
* aria2 (only the aria2c binary)
* cLucene
* ICU (static option is a path as there are multiple archives)


Debian package: libxapian22
== Typical usages ==


=== ''--with-static-xapian='' ===
== Regular build ==
'''variable''': ''XAPIAN_LDFLAGS''. Path to ''libxapian.a''.
 
Debian package: libxapian-dev
 
 
=== ''--with-icu='' ===
'''variable''': ''ICU_LDFLAGS''. Path to '''folder''' containing ''libicudata.so'', ''libicule.so'', ''libiculx.so'', ''libicuio.so'', ''libicuuc.so'', ''libicui18n.so'', ''libicutu.so''.
 
Debian package: libicu44
 
=== ''--with-static-icu='' ===
'''variable''': ''ICU_LDFLAGS''. Path to '''folder''' containing ''libicudata.a'', ''libicule.a'', ''libiculx.a'', ''libicuio.a'', ''libicuuc.a'', ''libicui18n.a'', ''libicutu.a''.
 
Debian package: libicu-dev
 
 
=== ''--with-sqlite='' ===
'''variable''': ''SQLITE_LDFLAGS''. Path to ''libsqlite3.so''.
 
Debian package: libsqlite3
 
=== ''--with-static-sqlite='' ===
'''variable''': ''SQLITE_LDFLAGS''. Path to ''libsqlite3.a''.
 
Debian package: libsqlite3-dev
 
=== ''--with-uuid='' ===
'''variable''': ''UUID_LDFLAGS''. Path to ''libuuid.so''.
 
Debian package: uuid-dev
 
=== ''--with-static-uuid='' ===
'''variable''': ''UUID_LDFLAGS''. Path to ''libuuid.a''.
 
Debian package: uuid-dev
 
e2fsprogs-utils
 
=== ''--with-microhttpd='' ===
'''variable''': ''MICROHTTPD_LDFLAGS''. Path to ''libmicrohttpd.so''.
 
Debian package: libmicrohttpd5
 
=== ''--with-static-microhttpd='' ===
'''variable''': ''MICROHTTPD_LDFLAGS''. Path to ''libmicrohttpd.a''.
 
Debian package: libmicrohttpd-dev
 
=== ''--with-lzma='' ===
'''variable''': ''LZMA_LDFLAGS''. Path to ''liblzma.so''.
 
Debian package: liblzma2
 
=== ''--with-static-lzma='' ===
'''variable''': ''LZMA_LDFLAGS''. Path to ''liblzma.a''.
 
Debian package: liblzma-dev
 
=== ''--with-cares='' ===
'''variable''': ''CARES_LDFLAGS''. Path to ''libcares.so''.
 
Debian package: libc-ares2
 
=== ''--with-static-cares='' ===
'''variable''': ''CARES_LDFLAGS''. Path to ''libcares.a''.
 
Debian package: libc-ares-dev
 
=== ''--with-aria2='' ===
'''variable''': ''ARIA2_LDFLAGS''. Path to ''aria2c''.
 
Debian package: aria2 ('''/! Kiwix now requires version 1.14 which is not yet in debian/ubuntu)
 
=== ''--with-static-aria2='' ===
'''variable''': ''ARIA2_LDFLAGS''. Path to ''aria2c''.
 
=== ''--with-clucene='' ===
'''variable''': ''CLUCENE_LDFLAGS''. Path to 'clucene.so''.


Debian package: libclucene0ldbl
<pre>./configure --with-z=/opt/local/lib --with-static-lzma=SELF</pre>


=== ''--with-static-clucene='' ===
This will build Kiwix with /opt/local/lib/libz.dll and retrive+compile LZMA.
'''variable''': ''CLUCENE_LDFLAGS''. Path to 'clucene.a''.
 
Debian package: libclucene-dev
 
=== ''--without-clucene'' (default: true) ===
'''variable''': ''WITH_CLUCENE'' (bool)
 
Disables support for clucene search Engine.
Default to off as it is deprecated in favor of xapian.
 
== Typical usages ==
 
== Regular build ==


<pre>./configure --with-static-z=SELF --with-static-lzma=SELF --with-static-aria2=SELF</pre>
== Packaged build shortcut ==


This will build a shared version of Kiwix with components using libz and liblzma statically.
<pre>./configure --enable-compileall</pre>


== Static build ==
== Build instructions ==


<pre>./configure --build-static</pre>
<pre>./autogen.sh alt
./configure
make src/dependencies
./configure
make
make static</pre>

Latest revision as of 16:03, 25 April 2012

In order to ease maintenance and readability of this very essential script in the build process, we have decided that configure.ac needed a major rewrite. Because this script cascades everywhere towards the compilation chain, we will work on the rewrite in parallel.

To use the new compile script, do the following:

./autogen.sh alt

The configure.ac does not exist anymore in svn. A link to configure_orig.ac (previous version) is created by autogen.sh.

Changes

  • The new configure script will tend to a more standard autotools approach by changing options names.
  • There are two main direction: packaged build or regular build.
  • Each dependency (shared objects or archive) can be specified.
  • Not found dependencies falls back to download/compile mode.
  • Download/compile respects main direction.

Files modified:

Options

All dependencies must be present as shared objects (dll, dylib). A packaged build is a regular build which then creates a tarball containing all shared objects. Components are NOT built statically.

The command line binaries (server, indexer, searcher, manager, reader) are built statically.

Each dependency has two options:

  • --with-dep=

Used to specify the folder where to find the shared objects.

  • --with-static-dep=

Used to specify the path to the static archive.

Both options can receive SELF as value which the script will interpret as download and build for me. Should SELF be defined for either shared or static, both will be built and used.

--enable-compileall (default: false)

variable: COMPIL_DEPS (bool)

Defines whether to build a static version or not.

--with-gecko-sdk=

variable: GECKO_SDK_PATH. Path to sdk/ of xulrunner-sdk or gecko-sdk.

Debian package: xulrunner-1.9-dev (ubuntu maverick and before, debian 6) Gecko_SDK

Optional packages

Command line tools are mostly optional (except for server). Active/deactive compilation with enable-xxx and disable-xxx.

Regular dependencies

The following dependencies are required:

  • Zlib
  • Xapian
  • SQLite
  • libmicroHTTPd
  • LZMA
  • aria2 (only the aria2c binary)
  • cLucene
  • ICU (static option is a path as there are multiple archives)

Typical usages

Regular build

./configure --with-z=/opt/local/lib --with-static-lzma=SELF

This will build Kiwix with /opt/local/lib/libz.dll and retrive+compile LZMA.

Packaged build shortcut

./configure --enable-compileall

Build instructions

./autogen.sh alt
./configure
make src/dependencies
./configure
make
make static