libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

Freebsd, make returns error : shadow.h not found.

Open mirza-ubaid opened this issue 7 years ago • 7 comments

mirza-ubaid avatar Mar 05 '18 11:03 mirza-ubaid

Hi, FreeBSD system user database is somehow different than Linux one. You are free to provide some patches that would make it possible to compile on FreeBSD, but it is not officially supported.

Regards, Michal

michalvasko avatar Mar 05 '18 11:03 michalvasko

I am not how to solve this issue. I was hoping someone could guide me to right direction. because I can not find way to get same libshadow as available in other linux OS. In file session_server_ssh.c: #include <shadow.h>

mirza-ubaid avatar Mar 05 '18 12:03 mirza-ubaid

Hi, like I said, I cannot help you with this because I have never programmed on FreeBSD. Ask in their forums, for example. We do not support FreeBSD so your issue is not really our concern.

Regards, Michal

michalvasko avatar Mar 05 '18 13:03 michalvasko

I have the same problem under OSX:

Claus-MBP:build clausklein$ cmake ..
-- The C compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at CMakeLists.txt:105 (message):
  Missing tools (devscripts, debhelper package) for building deb package.

  You won't be able to generate deb package from source code.

  Compiling libnetconf2 should still works fine.


CMake Warning at CMakeLists.txt:116 (message):
  Missing tools (rpm package) for building rpm package.

  You won't be able to generate rpm package from source code.

  Compiling libnetconf2 should still works fine.


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for stdatomic.h
CMake Warning (dev) at /opt/local/share/cmake-3.15/Modules/CheckIncludeFile.cmake:80 (message):
  Policy CMP0075 is not set: Include file check macros honor
  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  CMAKE_REQUIRED_LIBRARIES is set to:

    pthread

  For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
  CMakeLists.txt:184 (check_include_file)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for stdatomic.h - found
-- Looking for pthread_mutex_timedlock
-- Looking for pthread_mutex_timedlock - not found
-- Looking for pthread_rwlockattr_setkind_np
-- Looking for pthread_rwlockattr_setkind_np - not found
-- Found OpenSSL: /opt/local/lib/libcrypto.dylib (found version "1.1.1d")  
-- Performing Test HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES
-- Performing Test HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES - Failed
-- Found Doxygen: /opt/local/bin/doxygen (found version "1.8.15") found components:  doxygen dot 
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- Found CMocka: /opt/local/lib/libcmocka.dylib (Required is at least version "1.0.0") 
-- valgrind executable not found! Disabling memory leaks tests
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/clausklein/Workspace/c/libnetconf2/build
Claus-MBP:build clausklein$ 

Claus-MBP:build clausklein$ make
Scanning dependencies of target netconf2
[  2%] Building C object CMakeFiles/netconf2.dir/src/io.c.o
[  4%] Building C object CMakeFiles/netconf2.dir/src/log.c.o
[  6%] Building C object CMakeFiles/netconf2.dir/src/messages_client.c.o
[  8%] Building C object CMakeFiles/netconf2.dir/src/messages_server.c.o
[ 10%] Building C object CMakeFiles/netconf2.dir/src/session.c.o
[ 12%] Building C object CMakeFiles/netconf2.dir/src/session_client.c.o
[ 14%] Building C object CMakeFiles/netconf2.dir/src/session_server.c.o
[ 17%] Building C object CMakeFiles/netconf2.dir/src/time.c.o
[ 19%] Building C object CMakeFiles/netconf2.dir/src/session_client_ssh.c.o
[ 21%] Building C object CMakeFiles/netconf2.dir/src/session_server_ssh.c.o
/Users/clausklein/Workspace/c/libnetconf2/src/session_server_ssh.c:22:10: fatal error: 'shadow.h' file not found
#include <shadow.h>
         ^
1 error generated.
make[2]: *** [CMakeFiles/netconf2.dir/build.make:180: CMakeFiles/netconf2.dir/src/session_server_ssh.c.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:161: CMakeFiles/netconf2.dir/all] Fehler 2
make: *** [Makefile:141: all] Fehler 2
Claus-MBP:build clausklein$ 

ClausKlein avatar Dec 11 '19 06:12 ClausKlein

Hi, yes, that is quite expected. It would be required to rewrite this part of the code to get system users by whatever means OSX does it. Since OSX is not officially supported we will not implement this change, but we would accept patches from whoever would make the effort.

Regards, Michal

michalvasko avatar Dec 11 '19 08:12 michalvasko

Ok, thanks.

perhaps, I could add a check for that header to CMakeLists.txt

And, if you want, cmake should export its installed configuration like this:

install(TARGETS netconf2 EXPORT netconf2-targets)

see https://github.com/CESNET/libnetconf2/pull/188

ClausKlein avatar Dec 11 '19 09:12 ClausKlein

Hi, what exactly do you mean? The main problem is how to handle different user checking on OSX, adding some macros to detect when this special code should be used is a detail.

Regards, Michal

michalvasko avatar Dec 11 '19 09:12 michalvasko