diff --git a/indra/cmake/BuildPackagesInfo.cmake b/indra/cmake/BuildPackagesInfo.cmake index 8f8b6b23300d21e1995347fbfa60dd0091cecaeb..6f5f6fd93554b6580f348b2374535d69f4d959c0 100644 --- a/indra/cmake/BuildPackagesInfo.cmake +++ b/indra/cmake/BuildPackagesInfo.cmake @@ -13,8 +13,8 @@ add_custom_command(OUTPUT packages-info.txt MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py ${CMAKE_SOURCE_DIR}/../autobuild.xml - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE} -DAUTOBUILD=${AUTOBUILD_EXECUTABLE} - ${PYTHON_EXECUTABLE} + ${Python2_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt ) diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake index f75c23a5de26796831a7f142fad4b1ccaf2e027b..984f7bb22ad5ed3c9af537595cf1aaff39b5c0d1 100644 --- a/indra/cmake/LLTestCommand.cmake +++ b/indra/cmake/LLTestCommand.cmake @@ -4,14 +4,14 @@ MACRO(LL_TEST_COMMAND OUTVAR LD_LIBRARY_PATH) # cannot return a value. And yet, variables you set inside a FUNCTION are # local. Try a MACRO instead. SET(value - ${PYTHON_EXECUTABLE} + ${Python2_EXECUTABLE} "${CMAKE_SOURCE_DIR}/cmake/run_build_test.py") FOREACH(dir ${LD_LIBRARY_PATH}) LIST(APPEND value "-l${dir}") ENDFOREACH(dir) - # Enough different tests want to be able to find CMake's PYTHON_EXECUTABLE + # Enough different tests want to be able to find CMake's Python2_EXECUTABLE # that we should just pop it into the environment for everybody. - LIST(APPEND value "-DPYTHON=${PYTHON_EXECUTABLE}") + LIST(APPEND value "-DPYTHON=${Python2_EXECUTABLE}") LIST(APPEND value ${ARGN}) SET(${OUTVAR} ${value}) ##IF(LL_TEST_VERBOSE) diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index 1f687f59dbea38fa11d14bb406318bc6a7a9dd8b..e9bf28fc83218ae17be2e82e4bf20887d6a80d17 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -1,19 +1,17 @@ # -*- cmake -*- -set(PYTHONINTERP_FOUND) - if (WINDOWS) # On Windows, explicitly avoid Cygwin Python. if (DEFINED ENV{VIRTUAL_ENV}) - find_program(PYTHON_EXECUTABLE + find_program(Python2_EXECUTABLE NAMES python.exe PATHS "$ENV{VIRTUAL_ENV}\\scripts" NO_DEFAULT_PATH ) else() - find_program(PYTHON_EXECUTABLE + find_program(Python2_EXECUTABLE NAMES python25.exe python23.exe python.exe NO_DEFAULT_PATH # added so that cmake does not find cygwin python PATHS @@ -29,37 +27,12 @@ if (WINDOWS) [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] ) endif() -elseif (EXISTS /etc/debian_version) - # On Debian and Ubuntu, avoid Python 2.4 if possible. - - find_program(PYTHON_EXECUTABLE python PATHS /usr/bin) - - if (PYTHON_EXECUTABLE) - set(PYTHONINTERP_FOUND ON) - endif (PYTHON_EXECUTABLE) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - # On MAC OS X be sure to search standard locations first - string(REPLACE ":" ";" PATH_LIST "$ENV{PATH}") - find_program(PYTHON_EXECUTABLE - NAMES python python25 python24 python23 - NO_DEFAULT_PATH # Avoid searching non-standard locations first - PATHS - /bin - /usr/bin - /usr/local/bin - ${PATH_LIST} - ) + if (NOT Python2_EXECUTABLE) + message(FATAL_ERROR "No Python interpreter found") + endif (NOT Python2_EXECUTABLE) - if (PYTHON_EXECUTABLE) - set(PYTHONINTERP_FOUND ON) - endif (PYTHON_EXECUTABLE) + mark_as_advanced(Python2_EXECUTABLE) else (WINDOWS) - include(FindPythonInterp) + find_package(Python2 REQUIRED COMPONENTS Interpreter) endif (WINDOWS) - -if (NOT PYTHON_EXECUTABLE) - message(FATAL_ERROR "No Python interpreter found") -endif (NOT PYTHON_EXECUTABLE) - -mark_as_advanced(PYTHON_EXECUTABLE) diff --git a/indra/cmake/TemplateCheck.cmake b/indra/cmake/TemplateCheck.cmake index 2fada2eda979e9eb17072bd54ee554ed6446a641..4dc3e89c3115c3d9855f052b12fdb588b5db5e59 100644 --- a/indra/cmake/TemplateCheck.cmake +++ b/indra/cmake/TemplateCheck.cmake @@ -6,7 +6,7 @@ macro (check_message_template _target) add_custom_command( TARGET ${_target} PRE_LINK - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${SCRIPTS_DIR}/template_verifier.py --mode=development --cache_master --master_url=${TEMPLATE_VERIFIER_MASTER_URL} ${TEMPLATE_VERIFIER_OPTIONS} COMMENT "Verifying message template - See http://wiki.secondlife.com/wiki/Template_verifier.py" diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index ec5d33f902befe0a8d812ed08de4d0f6eb6b64e2..af2d8a0153c79930aa152109bc5771c57f4e2554 100755 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file run_build_test.py @author Nat Goodspeed diff --git a/indra/copy_win_scripts/start-client.py b/indra/copy_win_scripts/start-client.py index bcc99a49b0d5fa5a096dbfce536a081874a7141a..6c4c15ad39f0a416c02ad67242fe96dd0254b626 100755 --- a/indra/copy_win_scripts/start-client.py +++ b/indra/copy_win_scripts/start-client.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file start-client.py diff --git a/indra/fix-incredibuild.py b/indra/fix-incredibuild.py index 6a2c8f17078a4a4568a5b9d56fb2abffb4ebd5dd..6b13a7b466f59cfed4b13705f525474fe653f092 100755 --- a/indra/fix-incredibuild.py +++ b/indra/fix-incredibuild.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 ## ## $LicenseInfo:firstyear=2011&license=viewerlgpl$ ## Second Life Viewer Source Code diff --git a/indra/lib/python/indra/util/test_win32_manifest.py b/indra/lib/python/indra/util/test_win32_manifest.py index 0532cb006537df4af76d63a521bcd223f8d31b2c..9863b97778a68f086e435e6884edbf51ca2752e1 100755 --- a/indra/lib/python/indra/util/test_win32_manifest.py +++ b/indra/lib/python/indra/util/test_win32_manifest.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file test_win32_manifest.py @brief Test an assembly binding version and uniqueness in a windows dll or exe. diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index ee1163f11306786ce6e2dea494bf8e040b841f2b..44f339d2c4a240012f2444848b3c4d424fa880a8 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -149,7 +149,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) "${llcorehttp_TEST_SOURCE_FILES}" "${test_libs}" "-Dhttp_proxy" - ${PYTHON_EXECUTABLE} + ${Python2_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llcorehttp_peer.py" ) diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index 493143641b04cdbb979c7dd932e4144c4010e50c..6e5ca38e89475eb415ee4c6500d81b147fc1a64f 100755 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file test_llsdmessage_peer.py @author Nat Goodspeed diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py index 9cd2959ea18e59b1999ca72cfeb2ecfd5cfa99ec..511fd31fc86e6a0c6dccdd4a5023e48b42907316 100755 --- a/indra/llmessage/tests/test_llsdmessage_peer.py +++ b/indra/llmessage/tests/test_llsdmessage_peer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file test_llsdmessage_peer.py @author Nat Goodspeed diff --git a/indra/llmessage/tests/testrunner.py b/indra/llmessage/tests/testrunner.py index c25945067eb0fd4ab5628fca93174aaef62b42a2..baabe05f1b5cd3d1d803dc12d2ee14c11756e4aa 100755 --- a/indra/llmessage/tests/testrunner.py +++ b/indra/llmessage/tests/testrunner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file testrunner.py @author Nat Goodspeed diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 33a18dea087bf1ae6062c9314c8c06eac635276c..aa244028870be837ef9efb20f220d670c661fd9d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1903,7 +1903,7 @@ if (WINDOWS) add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --actions=copy @@ -1967,7 +1967,7 @@ if (WINDOWS) if (PACKAGE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py ${CMAKE_CURRENT_SOURCE_DIR}/.. @@ -1981,7 +1981,7 @@ if (WINDOWS) add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/touched.bat - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} @@ -2128,7 +2128,7 @@ if (LINUX) add_custom_command( OUTPUT ${product}.tar.bz2 - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} @@ -2154,7 +2154,7 @@ if (LINUX) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --actions=copy @@ -2231,7 +2231,7 @@ if (DARWIN) add_custom_command( TARGET ${VIEWER_BINARY_NAME} POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --actions=copy @@ -2267,7 +2267,7 @@ if (DARWIN) add_custom_command( TARGET llpackage POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python2_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --arch=${ARCH} @@ -2333,7 +2333,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR}) endif(CMAKE_CFG_INTDIR STREQUAL ".") add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" - COMMAND "${PYTHON_EXECUTABLE}" + COMMAND "${Python2_EXECUTABLE}" ARGS "${CMAKE_CURRENT_SOURCE_DIR}/generate_breakpad_symbols.py" "${LLBUILD_CONFIG}" diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py index d351c406bce923c8871b7442885989e87dbf0cfe..2fc5abe8bacf6fc65450d688d872a81cf6cc3575 100755 --- a/indra/newview/generate_breakpad_symbols.py +++ b/indra/newview/generate_breakpad_symbols.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file generate_breakpad_symbols.py @author Brad Kittenbrink <brad@lindenlab.com> diff --git a/indra/newview/tests/test_llxmlrpc_peer.py b/indra/newview/tests/test_llxmlrpc_peer.py index cff40aa4c2516809595b78b31c3a1a10e0af0f1e..f644afa1a2a9d3dce82a191e68cf8595c50ce437 100755 --- a/indra/newview/tests/test_llxmlrpc_peer.py +++ b/indra/newview/tests/test_llxmlrpc_peer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file test_llxmlrpc_peer.py @author Nat Goodspeed diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index f48f073b20e0e1ee95fd6e84e56baab23e722915..8c0bbc26c38c261670978bfb8d1fa40993c2c6d2 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """\ @file viewer_manifest.py @author Ryan Williams diff --git a/indra/test/test_llmanifest.py b/indra/test/test_llmanifest.py index a97abbc6eed3292fad3af64d5ac746ec2cfb20fd..b2b2b72c3bb435642178179db3287e2a839ae2c0 100755 --- a/indra/test/test_llmanifest.py +++ b/indra/test/test_llmanifest.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 """ @file test_llmanifest.py @author Ryan Williams