Changeset 6039c6 in git
- Timestamp:
- Apr 10, 2017, 3:44:33 PM (7 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
- Children:
- 7626a494d17999205045943cef22e9c6ab6c9f63
- Parents:
- 8a20520a56cabf3ab18f0ccf689a7f4d0910d24a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
m4/ax_python_embed.m4
r8a2052 r6039c6 1 1 # =========================================================================== 2 # http://www.gnu.org/software/autoconf-archive/ax_python_embed.html2 # https://www.gnu.org/software/autoconf-archive/ax_python_embed.html 3 3 # =========================================================================== 4 4 # … … 121 121 # warranty. 122 122 123 #serial 8123 #serial 15 124 124 125 125 # AX_PYTHON_DEFAULT( ) … … 140 140 # Input: 141 141 # $1 is the optional search path for the python executable if needed 142 # Ou put:142 # Output: 143 143 # PYTHON_USE (AM_CONDITIONAL) is true if python executable found 144 144 # and --enable-python was requested; otherwise false. … … 171 171 # "yes" was specified, but we don't have a path 172 172 # for the executable. 173 # So, let's sear th the PATH Environment Variable.173 # So, let's search the PATH Environment Variable. 174 174 AC_MSG_RESULT(yes) 175 175 AC_PATH_PROG( … … 224 224 if test -n "$PYTHON" 225 225 then 226 ax_python_prefix=`${PYTHON} -config --prefix`226 ax_python_prefix=`${PYTHON} -c "import sys; print(sys.prefix)"` 227 227 if test -z "$ax_python_prefix" 228 228 then 229 229 AC_MSG_ERROR([Python Prefix is not known]) 230 230 fi 231 # ax_python_execprefix=`${PYTHON}-config --exec-prefix` 232 # ax_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"` 233 # ax_python_includespec="-I${ax_python_prefix}/include/python${ax_python_version}" 234 # if test x"$python_prefix" != x"$python_execprefix"; then 235 # ax_python_execspec="-I${ax_python_execprefix}/include/python${ax_python_version}" 236 # ax_python_includespec="${ax_python_includespec} $ax_python_execspec" 237 # fi 238 ax_python_cspec=`${PYTHON}-config --cflags | sed -e 's@ -mno-fused-madd @ @g'` 239 # or -Qunused-arguments / clang :( 240 # ax_python_cspec="${ax_python_ccshared} ${ax_python_includespec}" 231 ax_python_execprefix=`${PYTHON} -c "import sys; print(sys.exec_prefix)"` 232 ax_python_version=`$PYTHON -c "import sys; print(sys.version[[:3]])"` 233 ax_python_includespec="-I${ax_python_prefix}/include/python${ax_python_version}" 234 if test x"$python_prefix" != x"$python_execprefix"; then 235 ax_python_execspec="-I${ax_python_execprefix}/include/python${ax_python_version}" 236 ax_python_includespec="${ax_python_includespec} $ax_python_execspec" 237 fi 238 ax_python_ccshared=`${PYTHON} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('CFLAGSFORSHARED'))"` 239 ax_python_cspec="${ax_python_ccshared} ${ax_python_includespec}" 241 240 AC_SUBST([PYTHON_CSPEC], [${ax_python_cspec}]) 242 241 AC_MSG_NOTICE([PYTHON_CSPEC=${ax_python_cspec}]) … … 270 269 AC_DEFUN([AX_PYTHON_LSPEC], 271 270 [ 272 273 271 AC_ARG_VAR( [PYTHON], [Python Executable Path] ) 274 272 if test -n "$PYTHON" 275 273 then 276 277 274 AX_PYTHON_RUN([ 278 275 import sys … … 304 301 # other included Frameworks. However, it is necessary 305 302 # where someone has installed more than one frameworked 306 # Python. Frameworks are really only used in Mac OSX.303 # Python. Frameworks are really only used in MacOSX. 307 304 strLibFW = dictConfig.get("PYTHONFRAMEWORKPREFIX") 308 305 if strLibFW and (strLibFW != ""): 309 306 strLinkSpec += " -F%s" % (strLibFW) 310 307 strLinkSpec += " %s" % (dictConfig.get('LINKFORSHARED')) 311 print strLinkSpec308 print(strLinkSpec) 312 309 ]) 313 314 # AC_SUBST([PYTHON_LSPEC], [${ax_python_output}]) 315 # AC_MSG_NOTICE([PYTHON_LSPEC=${ax_python_output}]) 316 317 ax_python_lspec=`${PYTHON}-config --ldflags` 318 AC_SUBST([PYTHON_LSPEC], [${ax_python_lspec}]) 319 AC_MSG_NOTICE([PYTHON_LSPEC=${ax_python_lspec}]) 320 310 AC_SUBST([PYTHON_LSPEC], [${ax_python_output}]) 311 AC_MSG_NOTICE([PYTHON_LSPEC=${ax_python_output}]) 321 312 fi 322 313 ]) … … 355 346 AC_MSG_ERROR([Python Executable Path is not known]) 356 347 fi 357 ax_python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`358 ax_python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`348 ax_python_prefix=`${PYTHON} -c "import sys; print(sys.prefix)"` 349 ax_python_execprefix=`${PYTHON} -c "import sys; print(sys.exec_prefix)"` 359 350 AC_SUBST([PYTHON_PREFIX], ["${ax_python_prefix}"]) 360 351 AC_SUBST([PYTHON_EXECPREFIX], ["${ax_python_execprefix}"]) … … 395 386 # Run ACTION-IF-TRUE if the Python interpreter has version >= VERSION. 396 387 # Run ACTION-IF-FALSE otherwise. 397 # This test uses sys.hexversion instead of the string equival ant (first388 # This test uses sys.hexversion instead of the string equivalent (first 398 389 # word of sys.version), in order to cope with versions such as 2.2c1. 399 390 # hexversion has been introduced in Python 1.5.2; it's probably not … … 407 398 AC_MSG_CHECKING([whether $PYTHON version >= $1]) 408 399 AX_PYTHON_RUN([ 409 import sys , string400 import sys 410 401 # split strings by '.' and convert to numeric. Append some zeros 411 402 # because we need at least 4 digits for the hex conversion. 412 minver = map(int, string.split('$1', '.')) + [[0, 0, 0]] 403 # It accepts a string like "X[.Y[.Z]]" with X,Y,Z=digits 404 # and [] means optional. 405 minver = list(map(int, '$1'.split('.'))) + [[0, 0, 0]] 406 minver[3] = 255 413 407 minverhex = 0 414 for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]408 for i in range(0, 4): minverhex = (minverhex << 8) + minver[[i]] 415 409 if sys.hexversion >= minverhex: 416 410 sys.exit( 0 ) … … 453 447 # Input: 454 448 # $1 is the optional search path for the python executable if needed 455 # Ou put:449 # Output: 456 450 # PYTHON_USE (AM_CONDITIONAL) is true if python executable found 457 451 # and --with-python was requested; otherwise false. … … 484 478 # "yes" was specified, but we don't have a path 485 479 # for the executable. 486 # So, let's sear th the PATH Environment Variable.480 # So, let's search the PATH Environment Variable. 487 481 AC_MSG_RESULT(yes) 488 482 AC_PATH_PROG(
Note: See TracChangeset
for help on using the changeset viewer.