cmake conversion #2

Merged
SlavekB merged 1 commits from feat/cmakeConv into master 5 years ago
Ghost commented 5 years ago

ldapcontroller.cpp is crowded with "FIXME" and hard coded path but since I know pretty nothing about ldap, I didn't take on that.

I don't expect that conversion to cmake to run smooth at first run since I couldn't build It with automake, I've done It looking at one of your deb package.

ldapcontroller.cpp is crowded with "FIXME" and hard coded path but since I know pretty nothing about ldap, I didn't take on that. I don't expect that conversion to cmake to run smooth at first run since I couldn't build It with automake, I've done It looking at one of your deb package.
Ghost added the PR/rfc label 5 years ago
SlavekB reviewed 5 years ago
SlavekB left a comment
Owner

Here is one problem regarding the slapi library.

Here is one problem regarding the slapi library.
Ghost commented 5 years ago
Poster

I don't know how you can build the slapi-acl-manager plugin without the slapi library but I can't here is the error when I try to build without:

/home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/acl-updater/plugin/plugin.cpp:123:1:
 warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
[ 96%] Linking CXX shared library libslapi-acl-manager.so
cd /home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/build/acl-updater/plugin && 
/usr/bin/cmake -E cmake_link_script CMakeFiles/slapi-acl-manager-shared.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC  -fvisibility=hidden -fvisibility-inlines-hidden  -DTQT_NO_ASCII_CAST 
-DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION -DTQT_THREAD_SUPPORT -D_REENTRANT
-include tqt.h -I/usr/include/tqt3 -I/usr/include/tqt -DTQT_NO_ASCII_CAST 
-DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION -DTQT_THREAD_SUPPORT -D_REENTRANT
-include tqt.h -Wl,--no-undefined -shared -Wl,-soname,libslapi-acl-manager.so
-o libslapi-acl-manager.so CMakeFiles/slapi-acl-manager-shared.dir/interface.c.o
CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o /usr/lib64/libtdecore.so.14.0.0
-ltdeldap -lkrb5 /usr/lib64/libDCOP.so.14.0.0 /usr/lib64/libtdefx.so.14.0.0 -ltqt
-ltqt-mt -lXrender -lX11 -lc -lz -lidn -lXcomposite -lICE -lSM -lgamin-1 -lutil
 
CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o: In function `post_modify(slapi_pblock*)':
plugin.cpp:(.text+0x109): undefined reference to `slapi_pblock_get'
plugin.cpp:(.text+0x171): undefined reference to `slapi_pblock_get'
plugin.cpp:(.text+0x1c5): undefined reference to `slapi_ch_strdup'
plugin.cpp:(.text+0x1d5): undefined reference to `slapi_dn_normalize_case'
plugin.cpp:(.text+0x54c): undefined reference to `slapi_pblock_get'
plugin.cpp:(.text+0x5a0): undefined reference to `slapi_ch_free_string'
CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o: In function `plugin_destroy(slapi_pblock*)':
plugin.cpp:(.text+0x68e): undefined reference to `slapi_ch_array_free'
CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o: In function `internal_plugin_init':
plugin.cpp:(.text+0x747): undefined reference to `slapi_pblock_get'
plugin.cpp:(.text+0x79b): undefined reference to `slapi_pblock_get'
plugin.cpp:(.text+0x7ec): undefined reference to `slapi_ch_calloc'
plugin.cpp:(.text+0x837): undefined reference to `slapi_ch_strdup'
plugin.cpp:(.text+0xa08): undefined reference to `slapi_pblock_set'
plugin.cpp:(.text+0xa24): undefined reference to `slapi_pblock_set'
plugin.cpp:(.text+0xa40): undefined reference to `slapi_pblock_set'
plugin.cpp:(.text+0xb01): undefined reference to `slapi_pblock_set'
collect2: error: ld returned 1 exit status
acl-updater/plugin/CMakeFiles/slapi-acl-manager-shared.dir/build.make:127: 
recipe for target 'acl-updater/plugin/libslapi-acl-manager.so' failed
make[2]: *** [acl-updater/plugin/libslapi-acl-manager.so] Error 1
make[2]: Leaving directory '/home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/build'
CMakeFiles/Makefile2:277: recipe for target 
'acl-updater/plugin/CMakeFiles/slapi-acl-manager-shared.dir/all' failed
make[1]: *** [acl-updater/plugin/CMakeFiles/slapi-acl-manager-shared.dir/all] Error 2
make[1]: Leaving directory 
'/home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/build'
Makefile:130: recipe for target 'all' failed
make: *** [all] Error 2
I don't know how you can build the slapi-acl-manager plugin without the slapi library but I can't here is the error when I try to build without: ``` /home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/acl-updater/plugin/plugin.cpp:123:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] [ 96%] Linking CXX shared library libslapi-acl-manager.so cd /home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/build/acl-updater/plugin && /usr/bin/cmake -E cmake_link_script CMakeFiles/slapi-acl-manager-shared.dir/link.txt --verbose=1 /usr/bin/c++ -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -DTQT_NO_ASCII_CAST -DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION -DTQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -I/usr/include/tqt3 -I/usr/include/tqt -DTQT_NO_ASCII_CAST -DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION -DTQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -Wl,--no-undefined -shared -Wl,-soname,libslapi-acl-manager.so -o libslapi-acl-manager.so CMakeFiles/slapi-acl-manager-shared.dir/interface.c.o CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o /usr/lib64/libtdecore.so.14.0.0 -ltdeldap -lkrb5 /usr/lib64/libDCOP.so.14.0.0 /usr/lib64/libtdefx.so.14.0.0 -ltqt -ltqt-mt -lXrender -lX11 -lc -lz -lidn -lXcomposite -lICE -lSM -lgamin-1 -lutil CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o: In function `post_modify(slapi_pblock*)': plugin.cpp:(.text+0x109): undefined reference to `slapi_pblock_get' plugin.cpp:(.text+0x171): undefined reference to `slapi_pblock_get' plugin.cpp:(.text+0x1c5): undefined reference to `slapi_ch_strdup' plugin.cpp:(.text+0x1d5): undefined reference to `slapi_dn_normalize_case' plugin.cpp:(.text+0x54c): undefined reference to `slapi_pblock_get' plugin.cpp:(.text+0x5a0): undefined reference to `slapi_ch_free_string' CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o: In function `plugin_destroy(slapi_pblock*)': plugin.cpp:(.text+0x68e): undefined reference to `slapi_ch_array_free' CMakeFiles/slapi-acl-manager-shared.dir/plugin.cpp.o: In function `internal_plugin_init': plugin.cpp:(.text+0x747): undefined reference to `slapi_pblock_get' plugin.cpp:(.text+0x79b): undefined reference to `slapi_pblock_get' plugin.cpp:(.text+0x7ec): undefined reference to `slapi_ch_calloc' plugin.cpp:(.text+0x837): undefined reference to `slapi_ch_strdup' plugin.cpp:(.text+0xa08): undefined reference to `slapi_pblock_set' plugin.cpp:(.text+0xa24): undefined reference to `slapi_pblock_set' plugin.cpp:(.text+0xa40): undefined reference to `slapi_pblock_set' plugin.cpp:(.text+0xb01): undefined reference to `slapi_pblock_set' collect2: error: ld returned 1 exit status acl-updater/plugin/CMakeFiles/slapi-acl-manager-shared.dir/build.make:127: recipe for target 'acl-updater/plugin/libslapi-acl-manager.so' failed make[2]: *** [acl-updater/plugin/libslapi-acl-manager.so] Error 1 make[2]: Leaving directory '/home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/build' CMakeFiles/Makefile2:277: recipe for target 'acl-updater/plugin/CMakeFiles/slapi-acl-manager-shared.dir/all' failed make[1]: *** [acl-updater/plugin/CMakeFiles/slapi-acl-manager-shared.dir/all] Error 2 make[1]: Leaving directory '/home/cethyel/Public/trinity-pot/CMAKECONV/kcmldapcontroller/build' Makefile:130: recipe for target 'all' failed make: *** [all] Error 2 ```
Owner

Yes, ignore my comment in review. I'm testing CMake build on Debian, and although with automake the 'slapi' library was not necessary, with cmake the 'slapi' library is required.

Yes, ignore my comment in review. I'm testing CMake build on Debian, and although with automake the 'slapi' library was not necessary, with cmake the 'slapi' library is required.
SlavekB reviewed 5 years ago
SlavekB left a comment
Owner

It looks good. After confirming the need for a 'slapi' library, one adjustment is needed.

It looks good. After confirming the need for a 'slapi' library, one adjustment is needed.
##### slapi-acl-manager (shared)
tde_add_library( slapi-acl-manager SHARED
Owner

slapi-acl-manager is built as plugin = without 'lib' prefix. Therefore here should be MODULE instead of SHARED.

`slapi-acl-manager` is built as plugin = without 'lib' prefix. Therefore here should be `MODULE` instead of `SHARED`.
Ghost commented 5 years ago
Poster

I still need slapi to link with.

I still need slapi to link with.
Ghost commented 5 years ago
Poster

Furthermore, I'm not sure there's a difference between SHARED and MODULE on Linux.
Sometime ago (weeks) I red that the difference matters on Mac but we don't build for Mac.

Furthermore, I'm not sure there's a difference between SHARED and MODULE on Linux. Sometime ago (weeks) I red that the difference matters on Mac but we don't build for Mac.
Owner

When you use SHARED, the prefix lib is added to the resulting file name => in this case libslapi-acl-manager. When you use MODULE, the resulting file is not prefixed with lib => in this case slapi-acl-manager. Because slapi-acl-manager is used as a plugin, it is built without a prefix. Therefore, here we use MODULE instead of SHARED.

As I mentioned above, linking to the slapi library is correct => is necessary.

When you use `SHARED`, the prefix `lib` is added to the resulting file name => in this case `libslapi-acl-manager`. When you use MODULE, the resulting file is not prefixed with `lib` => in this case `slapi-acl-manager`. Because slapi-acl-manager is used as a plugin, it is built without a prefix. Therefore, here we use `MODULE` instead of `SHARED`. As I mentioned above, linking to the `slapi` library is correct => is necessary.
Ghost commented 5 years ago
Poster

ok, got It!

ok, got It!
Owner

Pushed usual patches for UI includes and ASCII cast. However, I will still have to do work on detection of slapi library. There is no slapi-dev package present on Debian since year 2008 until current testing.

Pushed usual patches for UI includes and ASCII cast. However, I will still have to do work on detection of `slapi` library. There is no slapi-dev package present on Debian since year 2008 until current testing.
SlavekB added PR/wip and removed PR/rfc labels 5 years ago
Collaborator

but it says libslapi is provided by slapd https://packages.debian.org/stretch/libslapi-2.4-2

Could be that now libslp-dev is used?

apt-cache show libslp-dev

Package: libslp-dev
Description: OpenSLP development files
 Service Location Protocol is an IETF standard protocol that is used to
 discover/advertise services on the network. You can use SLP for anything
 from locating a suitable printer on your floor to discovering what LDAP
 directories are available in your organization.
 .
 This package allows development of SLP applications using the OpenSLP
 libraries. It includes headers, libraries and links to allow static and
 dynamic linking. It also includes slptool, a utility to test service
 advertisement/lookup. The library implements RFC 2614 - An API for
 Service Location.
but it says libslapi is provided by slapd https://packages.debian.org/stretch/libslapi-2.4-2 Could be that now libslp-dev is used? apt-cache show libslp-dev Package: libslp-dev Description: OpenSLP development files Service Location Protocol is an IETF standard protocol that is used to discover/advertise services on the network. You can use SLP for anything from locating a suitable printer on your floor to discovering what LDAP directories are available in your organization. . This package allows development of SLP applications using the OpenSLP libraries. It includes headers, libraries and links to allow static and dynamic linking. It also includes slptool, a utility to test service advertisement/lookup. The library implements RFC 2614 - An API for Service Location.
Owner

Yes, the slapi library is available in the slapd package. However, it is not ready to be naturally available for linking – there is no base libslapi.so. Therefore, it is not searchable using CMake find_library, so we need to add a search for a file with a specific version of the library (such as libslapi-2.4.so.2).

The libslp-dev package is a completely unrelated library.

Yes, the `slapi` library is available in the `slapd` package. However, it is not ready to be naturally available for linking – there is no base `libslapi.so`. Therefore, it is not searchable using CMake `find_library`, so we need to add a search for a file with a specific version of the library (such as `libslapi-2.4.so.2`). The `libslp-dev` package is a completely unrelated library.
SlavekB self-assigned this 5 years ago
SlavekB removed the PR/wip label 5 years ago
SlavekB closed this pull request 5 years ago
SlavekB deleted branch feat/cmakeConv 5 years ago
SlavekB added this to the R14.0.7 release milestone 5 years ago
The pull request has been merged as 2f07f1237e.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/kcmldapcontroller#2
Loading…
There is no content yet.