cmake find ncurses fixed/broke/fixed/broke ....

create symlink in /usr/include to ncurses.h in /usr/include/ncurses

If patches do not come through, I can email to someone. Maybe, René.
--- oorexx-5.0.0beta/CMakeLists.txt.~1~	Fri Jan 19 17:32:58 2018
+++ oorexx-5.0.0beta/CMakeLists.txt	Sat Jan 20 23:48:03 2018
@@ -346,6 +346,32 @@
   check_include_file(usersec.h HAVE_USERSEC_H)
   check_include_file(ncurses.h HAVE_NCURSES_H)
 endif ()
+if (UNIX)
+    if (NOT LINUX)
+        check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
+        if (HAVE_LIBSOCKET)
+          set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
+        endif (HAVE_LIBSOCKET)
+        check_library_exists(nsl gethostbyname "" HAVE_LIBNSL)
+        if (HAVE_LIBNSL)
+          set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
+        endif (HAVE_LIBNSL)
+        check_library_exists(resolv hstrerror "" HAVE_LIBRESOLV)
+        if (HAVE_LIBRESOLV)
+          set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} resolv)
+        endif (HAVE_LIBRESOLV)
+        check_library_exists(rt nanosleep "" HAVE_LIBRT)
+        if (HAVE_LIBRT)
+          set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
+        endif (HAVE_LIBRT)
+    endif (NOT LINUX)
+    check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+    check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+    check_function_exists(poll HAVE_POLL)
+    check_function_exists(select HAVE_SELECT)
+    check_function_exists(cfmakeraw HAVE_CFMAKERAW)
+    check_function_exists(regcomp HAVE_REGCOMP)
+endif (UNIX)
 set (PACKAGE ${PROJECT_NAME})
 set (PACKAGE_BUGREPORT "http://sourceforge.net/projects/oorexx/";)
 set (PACKAGE_NAME ${PROJECT_NAME})
@@ -499,7 +525,7 @@
             ${build_common_platform_dir}
             ${build_lib_dir})
 # Extra link library definitions
-target_link_libraries(rexxapi ${platform_rexxapi_libs})
+target_link_libraries(rexxapi ${platform_rexxapi_libs} ${CMAKE_REQUIRED_LIBRARIES})
 
 install(TARGETS rexxapi RUNTIME DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
                         LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
@@ -767,7 +793,7 @@
             ${build_interpreter_platform_dir})
 
 # Extra link library definitions
-target_link_libraries(rexx rexxapi ${platform_interpreter_libs})
+target_link_libraries(rexx rexxapi ${platform_interpreter_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rexx RUNTIME DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
                      LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
                      ARCHIVE DESTINATION ${INSTALL_INCLUDE_DIR} COMPONENT DevLib)
@@ -808,7 +834,7 @@
             ${build_api_platform_dir}
             ${build_messages_dir})
 # Extra link library definitions
-target_link_libraries(rexx_exe rexx rexxapi ${platform_rexx_exe_libs})
+target_link_libraries(rexx_exe rexx rexxapi ${platform_rexx_exe_libs} ${CMAKE_REQUIRED_LIBRARIES})
 # Merge in extra manifest information on Windows
 if (WIN32)
 add_custom_command(TARGET rexx_exe POST_BUILD
@@ -837,7 +863,7 @@
             ${build_api_dir}
             ${build_api_platform_dir})
 # Extra link library definitions
-target_link_libraries(rexximage rexx rexxapi ${platform_rexximg_libs})
+target_link_libraries(rexximage rexx rexxapi ${platform_rexximg_libs} ${CMAKE_REQUIRED_LIBRARIES})
 
 # handy macro for copying files from the source into the build directory.
 macro (copy_build_file name source)
@@ -909,7 +935,7 @@
 target_include_directories(rxapi PUBLIC
          ${build_rexxapi_server_dir})
 # Extra link library definitions
-target_link_libraries(rxapi rexx rexxapi ${platform_rxapi_libs})
+target_link_libraries(rxapi rexx rexxapi ${platform_rxapi_libs} ${CMAKE_REQUIRED_LIBRARIES})
 
 # Kill the rxapi daemon whenever we have to build, otherwise the build
 # will fail.  Unfortunately, the killing of the process is not immediate,
@@ -1012,7 +1038,7 @@
             ${build_api_platform_dir}
             ${build_messages_dir})
 # Extra link library definitions
-target_link_libraries(rexxc rexx rexxapi ${platform_rexxc_libs})
+target_link_libraries(rexxc rexx rexxapi ${platform_rexxc_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rexxc RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
 
 #################### rxqueue (executable) #########################
@@ -1034,7 +1060,7 @@
             ${build_interpreter_platform_dir}
             ${build_messages_dir})
 # Extra link library definitions
-target_link_libraries(rxqueue rexx rexxapi ${platform_rxqueue_libs})
+target_link_libraries(rxqueue rexx rexxapi ${platform_rxqueue_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rxqueue RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
 
 #################### rxsubcom (executable) #########################
@@ -1056,7 +1082,7 @@
              ${build_interpreter_platform_dir}
              ${build_messages_dir})
 # Extra link library definitions
-target_link_libraries(rxsubcom rexx rexxapi ${platform_subcom_libs})
+target_link_libraries(rxsubcom rexx rexxapi ${platform_subcom_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rxsubcom RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
 
 #################### librexxutil.so ################
@@ -1079,7 +1105,7 @@
              ${build_api_platform_dir}
              ${build_messages_dir})
 # Extra link library definitions
-target_link_libraries(rexxutil rexx rexxapi ${platform_rexxutil_libs})
+target_link_libraries(rexxutil rexx rexxapi ${platform_rexxutil_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rexxutil RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
                          LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
 set_target_properties(rexxutil PROPERTIES VERSION ${ORX_VERSION})
@@ -1101,7 +1127,7 @@
              ${build_api_dir}
              ${build_api_platform_dir})
 # Extra link library definitions
-target_link_libraries(rxmath rexx rexxapi ${platform_rxmath_libs})
+target_link_libraries(rxmath rexx rexxapi ${platform_rxmath_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rxmath RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
                        LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
 set_target_properties(rxmath PROPERTIES VERSION ${ORX_VERSION})
@@ -1119,7 +1145,7 @@
              ${build_extensions_rxsock_dir}/rxsockfn.cpp
              ${platform_rxsock_sources})
 # Extra link library definitions
-target_link_libraries(rxsock rexx rexxapi ${platform_rxsock_libs})
+target_link_libraries(rxsock rexx rexxapi ${platform_rxsock_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rxsock RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
                        LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
 set_target_properties(rxsock PROPERTIES VERSION ${ORX_VERSION})
@@ -1136,7 +1162,7 @@
    target_link_libraries(rxsock6 rexx rexxapi ${platform_rxsock_libs} ws2_32)
 else ()
    # Extra link library definitions
-   target_link_libraries(rxsock6 rexx rexxapi ${platform_rxsock_libs})
+   target_link_libraries(rxsock6 rexx rexxapi ${platform_rxsock_libs} ${CMAKE_REQUIRED_LIBRARIES})
 endif ()
 
 install(TARGETS rxsock6 RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
@@ -1163,7 +1189,7 @@
              ${build_api_platform_dir}
              ${build_messages_dir})
 # Extra link library definitions
-target_link_libraries(rxregexp rexx rexxapi ${platform_rxregexp_libs})
+target_link_libraries(rxregexp rexx rexxapi ${platform_rxregexp_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS rxregexp RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
                          LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
 set_target_properties(rxregexp PROPERTIES VERSION ${ORX_VERSION})
@@ -1188,7 +1214,7 @@
              ${build_api_platform_dir}
              ${build_extensions_hostemu_dir})
 # Extra link library definitions
-target_link_libraries(hostemu rexx rexxapi ${platform_hostemu_libs})
+target_link_libraries(hostemu rexx rexxapi ${platform_hostemu_libs} ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS hostemu RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
                         LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
 set_target_properties(hostemu PROPERTIES VERSION ${ORX_VERSION})
@@ -1206,9 +1232,9 @@
 # gcc (at least on Linux) requires linking with -lcrypt
 # clang (at least on Darwin) doesn't have libcrypt
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-    target_link_libraries(rxunixsys rexx rexxapi crypt)
+    target_link_libraries(rxunixsys rexx rexxapi crypt ${CMAKE_REQUIRED_LIBRARIES})
 else ()
-    target_link_libraries(rxunixsys rexx rexxapi)
+    target_link_libraries(rxunixsys rexx rexxapi ${CMAKE_REQUIRED_LIBRARIES})
 endif ()
 
 set_target_properties(rxunixsys PROPERTIES VERSION ${ORX_VERSION})
@@ -1226,7 +1252,7 @@
              ${build_api_platform_dir}
              ${build_extensions_dir}/orxncurses)
 # Extra link library definitions
-target_link_libraries(orxncurses rexx rexxapi ncurses)
+target_link_libraries(orxncurses rexx rexxapi ncurses ${CMAKE_REQUIRED_LIBRARIES})
 set_target_properties(orxncurses PROPERTIES VERSION ${ORX_VERSION})
 install(TARGETS orxncurses RUNTIME DESTINATION ${INSTALL_LIB_DIR}
                           LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
@@ -1244,7 +1270,7 @@
 target_include_directories(orexxole PUBLIC
              ${build_extensions_ole_dir})
 # Extra link library definitions
-target_link_libraries(orexxole rexx rexxapi)
+target_link_libraries(orexxole rexx rexxapi ${CMAKE_REQUIRED_LIBRARIES})
 install(TARGETS orexxole RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR})
 endif ()
 
--- oorexx-5.0.0beta/interpreter/platform/unix/SystemInitialization.cpp.~1~	Fri Jan 19 17:32:43 2018
+++ oorexx-5.0.0beta/interpreter/platform/unix/SystemInitialization.cpp	Sat Jan 20 23:43:05 2018
@@ -45,6 +45,7 @@
 {
 #endif
 
+#ifndef __sun
 int _init() __attribute__((constructor));
 int _fini() __attribute__((destructor));
 
@@ -62,8 +63,8 @@
     SystemInterpreter::processShutdown();
     return 0;
 }
+#endif
 
-
 #ifdef AIX
 }
 #endif
--- oorexx-5.0.0beta/extensions/rxsock/orxsock6.cpp.~1~	Fri Jan 19 17:32:56 2018
+++ oorexx-5.0.0beta/extensions/rxsock/orxsock6.cpp	Sat Jan 20 23:52:18 2018
@@ -60,6 +60,9 @@
         // need to define this for Mac OSX 10.2
         #define _BSD_SOCKLEN_T_
     #endif
+    #ifdef __sun
+        #include <alloca.h>
+    #endif
     #include <sys/socket.h>
     #include <sys/ioctl.h>
     #include <sys/time.h>
--- oorexx-5.0.0beta/extensions/platform/unix/rxunixsys/rxunixsys.h.~1~	Fri Jan 19 17:32:52 2018
+++ oorexx-5.0.0beta/extensions/platform/unix/rxunixsys/rxunixsys.h	Sat Jan 20 23:43:05 2018
@@ -83,6 +83,10 @@
 # define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
 #endif
 
+#if defined(__sun)
+# define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+#endif
+
 /*----------------------------------------------------------------------------*/
 /* Global variables                                                           */
 /*----------------------------------------------------------------------------*/
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to