qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [06/50] [abbrv] qpid-proton git commit: PROTON-465: Make FindPerlLibs work properly without Perl devel files
Date Fri, 14 Nov 2014 11:03:15 GMT
PROTON-465: Make FindPerlLibs work properly without Perl devel files

First, fixed the build environment to only use the Proton Perl CMake
module when the standard fails.

Second, fixed the Proton CMake module to spout an info message that the
Perl bindings won't be built when the development files aren't found.

git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1630545 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/a4ad5219
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a4ad5219
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a4ad5219

Branch: refs/heads/examples
Commit: a4ad5219d98b0e056a218c400e144159b27ec849
Parents: c575aed
Author: mcpierce <mcpierce@unknown>
Authored: Thu Oct 9 18:08:18 2014 +0000
Committer: mcpierce <mcpierce@unknown>
Committed: Thu Oct 9 18:08:18 2014 +0000

----------------------------------------------------------------------
 proton-c/bindings/CMakeLists.txt         |  3 +-
 tools/cmake/Modules/FindPerlLibs.cmake   | 73 ------------------------
 tools/cmake/Modules/ProtonFindPerl.cmake | 81 +++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a4ad5219/proton-c/bindings/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/CMakeLists.txt b/proton-c/bindings/CMakeLists.txt
index b5e6fba..e996282 100644
--- a/proton-c/bindings/CMakeLists.txt
+++ b/proton-c/bindings/CMakeLists.txt
@@ -82,8 +82,7 @@ endif (PHP_CONFIG_EXE)
 mark_as_advanced (PHP_CONFIG_EXE)
 
 # Prerequisites for Perl:
-include(FindPerl)
-include(FindPerlLibs)
+include(ProtonFindPerl)
 if (PERLLIBS_FOUND)
   set (DEFAULT_PERL ON)
 endif (PERLLIBS_FOUND)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a4ad5219/tools/cmake/Modules/FindPerlLibs.cmake
----------------------------------------------------------------------
diff --git a/tools/cmake/Modules/FindPerlLibs.cmake b/tools/cmake/Modules/FindPerlLibs.cmake
deleted file mode 100644
index 0a1a061..0000000
--- a/tools/cmake/Modules/FindPerlLibs.cmake
+++ /dev/null
@@ -1,73 +0,0 @@
-# - Find Perl Libraries
-# This module searches for Perl libraries in the event that those files aren't
-# found by the default Cmake module.
-
-# include(${CMAKE_CURRENT_LIST_DIR}/FindPerlLibs.cmake)
-
-if(NOT PERLLIBS_FOUND)
-  MESSAGE ( STATUS "Trying alternative search for Perl" )
-
-  # taken from Cmake 2.8 FindPerlLibs.cmake
-  EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
-                     -V:installarchlib
-                     OUTPUT_VARIABLE PERL_ARCHLIB_OUTPUT_VARIABLE
-                     RESULT_VARIABLE PERL_ARCHLIB_RESULT_VARIABLE )
-
-  if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
-  endif ( NOT PERL_ARCHLIB_RESULT_VARIABLE )
-
-  EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
-                    -MConfig -e "print \$Config{archlibexp}"
-                    OUTPUT_VARIABLE PERL_OUTPUT
-                    RESULT_VARIABLE PERL_RETURN_VALUE )
-
-  IF ( NOT PERL_RETURN_VALUE )
-    FIND_PATH ( PERL_INCLUDE_PATH perl.h ${PERL_OUTPUT}/CORE )
-  ENDIF ( NOT PERL_RETURN_VALUE )
-
-  # if either the library path is not found not set at all
-  # then do our own search
-  if ( NOT PERL_LIBRARY )
-    EXECUTE_PROCESS( COMMAND ${PERL_EXECUTABLE} -V:libperl
-                     OUTPUT_VARIABLE PERL_LIBRARY_OUTPUT
-                     RESULT_VARIABLE PERL_LIBRARY_RESULT )
-
-    IF ( NOT PERL_LIBRARY_RESULT )
-      string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARIES ${PERL_LIBRARY_OUTPUT})
-    ENDIF ( NOT PERL_LIBRARY_RESULT )
-
-    MESSAGE ( STATUS  "Looking for ${PERL_POSSIBLE_LIBRARIES}" )
-
-    find_file(PERL_LIBRARY
-      NAMES ${PERL_POSSIBLE_LIBRARIES}
-      PATHS /usr/lib
-            ${PERL_ARCHLIB}/CORE
-      )
-
-  endif ( NOT PERL_LIBRARY )
-
-  IF ( PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY )
-      EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
-                        -MConfig -e "print \$Config{libperl}"
-                        OUTPUT_VARIABLE PERL_OUTPUT
-                        RESULT_VARIABLE PERL_RETURN_VALUE )
-
-      IF ( NOT PERL_RETURN_VALUE )
-        FIND_LIBRARY ( PERL_LIBRARY NAMES ${PERL_OUTPUT}
-                                    PATHS ${PERL_INCLUDE_PATH} )
-
-      ENDIF ( NOT PERL_RETURN_VALUE )
-  ENDIF ( PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY )
-
-  IF ( PERL_LIBRARY )
-    MESSAGE ( STATUS "Found PerlLibs: ${PERL_LIBRARY}" )
-  ELSE()
-    MESSAGE ( STATUS "PerlLibs Not Found" )
-  ENDIF ( PERL_LIBRARY )
-
-  if (PERL_LIBRARY)
-    set (DEFAULT_PERL ON)
-  endif (PERL_LIBRARY)
-endif(NOT PERLLIBS_FOUND)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a4ad5219/tools/cmake/Modules/ProtonFindPerl.cmake
----------------------------------------------------------------------
diff --git a/tools/cmake/Modules/ProtonFindPerl.cmake b/tools/cmake/Modules/ProtonFindPerl.cmake
new file mode 100644
index 0000000..e2f3fef
--- /dev/null
+++ b/tools/cmake/Modules/ProtonFindPerl.cmake
@@ -0,0 +1,81 @@
+# - Find Perl Libraries
+# This module searches for Perl libraries in the event that those files aren't
+# found by the default Cmake module.
+
+# include(${CMAKE_CURRENT_LIST_DIR}/FindPerlLibs.cmake)
+
+include(FindPerl)
+include(FindPerlLibs)
+
+if(NOT PERLLIBS_FOUND)
+  MESSAGE ( STATUS "Trying alternative search for Perl" )
+
+  # taken from Cmake 2.8 FindPerlLibs.cmake
+  EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
+                     -V:installarchlib
+                     OUTPUT_VARIABLE PERL_ARCHLIB_OUTPUT_VARIABLE
+                     RESULT_VARIABLE PERL_ARCHLIB_RESULT_VARIABLE )
+
+  if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
+    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
+    file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
+  endif ( NOT PERL_ARCHLIB_RESULT_VARIABLE )
+
+  EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
+                    -MConfig -e "print \$Config{archlibexp}"
+                    OUTPUT_VARIABLE PERL_OUTPUT
+                    RESULT_VARIABLE PERL_RETURN_VALUE )
+
+  IF ( NOT PERL_RETURN_VALUE )
+    FIND_PATH ( PERL_INCLUDE_PATH perl.h ${PERL_OUTPUT}/CORE )
+
+    IF (PERL_INCLUDE_PATH MATCHES .*-NOTFOUND OR NOT PERL_INCLUDE_PATH)
+        MESSAGE(STATUS "Could not find perl.h")
+    ENDIF ()
+
+  ENDIF ( NOT PERL_RETURN_VALUE )
+
+  # if either the library path is not found not set at all
+  # then do our own search
+  if ( NOT PERL_LIBRARY )
+    EXECUTE_PROCESS( COMMAND ${PERL_EXECUTABLE} -V:libperl
+                     OUTPUT_VARIABLE PERL_LIBRARY_OUTPUT
+                     RESULT_VARIABLE PERL_LIBRARY_RESULT )
+
+    IF ( NOT PERL_LIBRARY_RESULT )
+      string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARIES ${PERL_LIBRARY_OUTPUT})
+    ENDIF ( NOT PERL_LIBRARY_RESULT )
+
+    MESSAGE ( STATUS  "Looking for ${PERL_POSSIBLE_LIBRARIES}" )
+
+    find_file(PERL_LIBRARY
+      NAMES ${PERL_POSSIBLE_LIBRARIES}
+      PATHS /usr/lib
+            ${PERL_ARCHLIB}/CORE
+      )
+
+  endif ( NOT PERL_LIBRARY )
+
+  IF ( PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY )
+      EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
+                        -MConfig -e "print \$Config{libperl}"
+                        OUTPUT_VARIABLE PERL_OUTPUT
+                        RESULT_VARIABLE PERL_RETURN_VALUE )
+
+      IF ( NOT PERL_RETURN_VALUE )
+        FIND_LIBRARY ( PERL_LIBRARY NAMES ${PERL_OUTPUT}
+                                    PATHS ${PERL_INCLUDE_PATH} )
+
+      ENDIF ( NOT PERL_RETURN_VALUE )
+  ENDIF ( PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY )
+
+  IF(PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY OR
+     PERL_INCLUDE_PATH MATCHES .*-NOTFOUND OR NOT PERL_INCLUDE_PATH)
+    MESSAGE (STATUS "No Perl devel environment found - skipping Perl bindings")
+    SET (DEFAULT_PERL OFF)
+  ELSE()
+    MESSAGE ( STATUS "Found PerlLibs: ${PERL_LIBRARY}" )
+    SET (DEFAULT_PERL ON)
+  ENDIF()
+
+endif(NOT PERLLIBS_FOUND)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message