Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(69863)

Delta Between Two Patch Sets: Misc/python-config.sh.in

Issue 16235: Add python-config.sh for use during cross compilation.
Left Patch Set: Created 6 years, 10 months ago
Right Patch Set: Created 6 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Makefile.pre.in ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/bin/sh 1 #!/bin/sh
2 2
3 exit_with_usage () 3 exit_with_usage ()
4 { 4 {
5 echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags| --extension-suffix|--help|--abiflags|--configdir" 5 echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags| --extension-suffix|--help|--abiflags|--configdir"
6 exit 1 6 exit $1
7 } 7 }
8 8
9 if [ "$1" = "" ] ; then 9 if [ "$1" = "" ] ; then
10 exit_with_usage 10 exit_with_usage 1
11 fi 11 fi
12 12
13 # Returns the actual prefix where this script was installed to. 13 # Returns the actual prefix where this script was installed to.
14 installed_prefix () 14 installed_prefix ()
15 { 15 {
16 local RESULT=$(dirname $(cd $(dirname "$1") && pwd -P)) 16 RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
17 if [ $(which readlink) ] ; then 17 if which readlink >/dev/null 2>&1 ; then
18 RESULT=$(readlink -f "$RESULT") 18 RESULT=$(readlink -f "$RESULT")
19 fi 19 fi
20 echo $RESULT 20 echo $RESULT
21 } 21 }
22 22
23 prefix_build="@prefix@" 23 prefix_build="@prefix@"
24 prefix_real=$(installed_prefix "$0") 24 prefix_real=$(installed_prefix "$0")
25 25
26 # Use sed to fix paths from their built to locations to their installed to locat ions. 26 # Use sed to fix paths from their built to locations to their installed to locat ions.
27 prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#") 27 prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
28 exec_prefix_build="@exec_prefix@" 28 exec_prefix_build="@exec_prefix@"
29 exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real #") 29 exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real #")
30 includedir=$(echo "@includedir@" | sed "s#$prefix_build#$prefix_real#") 30 includedir=$(echo "@includedir@" | sed "s#$prefix_build#$prefix_real#")
31 libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#") 31 libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#")
32 CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#") 32 CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#")
33 VERSION="@VERSION@" 33 VERSION="@VERSION@"
34 LIBM="@LIBM@" 34 LIBM="@LIBM@"
35 LIBC="@LIBC@" 35 LIBC="@LIBC@"
36 SYSLIBS="$LIBM $LIBC" 36 SYSLIBS="$LIBM $LIBC"
37 ABIFLAGS="@ABIFLAGS@" 37 ABIFLAGS="@ABIFLAGS@"
38 # Protect against lack of substitution.
39 if [ "$ABIFLAGS" = "@ABIFLAGS@" ] ; then
40 ABIFLAGS=
41 fi
42 LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}" 38 LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"
43 BASECFLAGS="@BASECFLAGS@" 39 BASECFLAGS="@BASECFLAGS@"
44 LDLIBRARY="@LDLIBRARY@" 40 LDLIBRARY="@LDLIBRARY@"
45 LINKFORSHARED="@LINKFORSHARED@" 41 LINKFORSHARED="@LINKFORSHARED@"
46 OPT="@OPT@" 42 OPT="@OPT@"
47 PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" 43 PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
48 LDVERSION="@LDVERSION@" 44 LDVERSION="@LDVERSION@"
49 LIBDEST=${prefix}/lib/python${VERSION} 45 LIBDEST=${prefix}/lib/python${VERSION}
50 LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#") 46 LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
51 SO="@SO@" 47 SO="@SO@"
52 PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" 48 PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
53 INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}" 49 INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
54 PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}" 50 PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
55 51
56 # Scan for --help or unknown argument. 52 # Scan for --help or unknown argument.
57 for ARG in $* 53 for ARG in $*
58 do 54 do
59 case $ARG in 55 case $ARG in
60 --help) 56 --help)
61 exit_with_usage 57 exit_with_usage 0
62 ;; 58 ;;
63 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension- suffix|--abiflags|--configdir) 59 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension- suffix|--abiflags|--configdir)
64 ;; 60 ;;
65 *) 61 *)
66 exit_with_usage 62 exit_with_usage 1
67 ;; 63 ;;
68 esac 64 esac
69 done 65 done
70 66
71 for ARG in $* 67 for ARG in "$@"
72 do 68 do
73 case $ARG in 69 case "$ARG" in
74 --prefix) 70 --prefix)
75 echo "$prefix" 71 echo "$prefix"
76 ;; 72 ;;
77 --exec-prefix) 73 --exec-prefix)
78 echo "$exec_prefix" 74 echo "$exec_prefix"
79 ;; 75 ;;
80 --includes) 76 --includes)
81 echo "$INCDIR $PLATINCDIR" 77 echo "$INCDIR $PLATINCDIR"
82 ;; 78 ;;
83 --cflags) 79 --cflags)
(...skipping 17 matching lines...) Expand all
101 echo "$SO" 97 echo "$SO"
102 ;; 98 ;;
103 --abiflags) 99 --abiflags)
104 echo "$ABIFLAGS" 100 echo "$ABIFLAGS"
105 ;; 101 ;;
106 --configdir) 102 --configdir)
107 echo "$LIBPL" 103 echo "$LIBPL"
108 ;; 104 ;;
109 esac 105 esac
110 done 106 done
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+