[MDEV-14344] Cmake arguments Fedora RPM Created: 2017-11-10  Updated: 2017-11-10  Resolved: 2017-11-10

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Packaging, Platform RedHat
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Michal Schorm Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

Hello,
I'd love to go through our Cmake arguments in Fedora and listen to your feedback, because in several cases I'm not sure which to use and which values are correct, because the cmake files are hardly readable for me.

Also, I have to use many macros to automatize the build.

The first part:

%cmake . \
         -DBUILD_CONFIG=mysql_release \
         -DFEATURE_SET="community" \
         -DINSTALL_LAYOUT=RPM \
         -DDAEMON_NAME="%{daemon_name}" \
         -DDAEMON_NO_PREFIX="%{daemon_no_prefix}" \
         -DLOG_LOCATION="%{logfile}" \
         -DPID_FILE_DIR="%{pidfiledir}" \
         -DNICE_PROJECT_NAME="MariaDB" \
         -DRPM="%{?rhel:rhel%{rhel}}%{!?rhel:fedora%{fedora}}" \
         -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
         -DINSTALL_SYSCONFDIR="%{_sysconfdir}" \
         -DINSTALL_SYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \
         -DINSTALL_DOCDIR="share/doc/%{_pkgdocdirname}" \
         -DINSTALL_DOCREADMEDIR="share/doc/%{_pkgdocdirname}" \
         -DINSTALL_INCLUDEDIR=include/mysql \
         -DINSTALL_INFODIR=share/info \
         -DINSTALL_LIBDIR="%{_lib}" \
         -DINSTALL_MANDIR=share/man \
         -DINSTALL_MYSQLSHAREDIR=share/%{pkg_name} \
         -DINSTALL_MYSQLTESTDIR=share/mysql-test \
         -DINSTALL_PLUGINDIR="%{_lib}/%{pkg_name}/plugin" \
         -DINSTALL_SBINDIR=libexec \
         -DINSTALL_SCRIPTDIR=bin \
         -DINSTALL_SQLBENCHDIR=share \
         -DINSTALL_SUPPORTFILESDIR=share/%{pkg_name} \
         -DMYSQL_DATADIR="%{dbdatadir}" \
         -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
         -DTMPDIR=/var/tmp \

The first part should be straightforward. I have to provide a path or some text. Easy.

Now comes the second part:

         -DENABLED_LOCAL_INFILE=ON \
         -DENABLE_DTRACE=ON \
         -DWITH_EMBEDDED_SERVER=%{?with_embedded:ON}%{!?with_embedded:OFF} \
         -DWITH_SSL=system \
         -DWITH_ZLIB=system \
         -DWITH_PCRE=%{?with_bundled_pcre:system}%{!?with_bundled_pcre:bundled} \
         -DWITH_JEMALLOC=system \
         -DWITH_LIBARCHIVE=ON \
         -DWITH_MARIABACKUP=%{?with_backup:ON}%{!?with_backup:NO} \
         -DWITH_TOKUDB=%{?with_tokudb:DYNAMIC}%{!?with_tokudb:NO} \
         -DWITH_MROONGA=%{?with_mroonga:DYNAMIC}%{!?with_mroonga:NO} \
         -DWITH_OQGRAPH=%{?with_oqgraph:DYNAMIC}%{!?with_oqgraph:NO} \
         -DWITH_SPHINX=%{!?with_sphinx:DYNAMIC}%{?with_sphinx:NO} \
%{?with_debug: -DCMAKE_BUILD_TYPE=Debug} \
%{?_hardened_build: -DWITH_MYSQLD_LDFLAGS="-pie -Wl,-z,relro,-z,now"}
 
make %{?_smp_mflags} VERBOSE=1

In this part I'm not sure, which values to use at all.
ON / OFF ?
ON / NO ?
system / ... ?

In cmake/plugin.cmake you say:

    # NO - not at all
    # YES - static if possible, otherwise dynamic if possible, otherwise abort
    # AUTO - static if possible, otherwise dynamic, if possible
    # STATIC - static if possible, otherwise not at all
    # DYNAMIC - dynamic if possible, otherwise not at all

But I'm not sure if that apply only to plugins or which parts are labeled as plugins at the first place. (Is mariadbackup a plugin? It only contains binaries ... ; Are storage engines plugins? Which?)

From the cmakes I got also a feeling that there are many ways to define such a thing, but only some of them are "the right way" to do it. In that case I'm here for such advice too.

If you'd like to check your latest pushed SPECfile, here it is.



 Comments   
Comment by Michal Schorm [ 2017-11-10 ]

Actually, I have a bad feeling, that Sphinx plugin (ha_sphinx.so) builds only, when "DWITH_SPHINX=NO" or "DWITH_SPHINX=OFF" is specified and does not build when "DWITH_SPHINX=ON" or "DWITH_SPHINX=DYNAMIC" is given.

Comment by Sergei Golubchik [ 2017-11-10 ]

Could you please resend it to the mailing list? It's neither a bug nor a feature request for MariaDB, as far as I understand.

Comment by Michal Schorm [ 2017-11-10 ]

You are absolutelly correct.

I´ll resend it to mariadb-discuss@lists.launchpad.net

Comment by Sergei Golubchik [ 2017-11-10 ]

For the reference: https://lists.launchpad.net/maria-discuss/msg04852.html

Generated at Thu Feb 08 08:12:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.