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

Side by Side Diff: Misc/python-config.sh.in

Issue 16235: Add python-config.sh for use during cross compilation.
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:
View unified diff | Download patch
« no previous file with comments | « Makefile.pre.in ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/sh
2
3 exit_with_usage ()
4 {
5 echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags| --extension-suffix|--help|--abiflags|--configdir"
6 exit $1
7 }
8
9 if [ "$1" = "" ] ; then
10 exit_with_usage 1
11 fi
12
13 # Returns the actual prefix where this script was installed to.
14 installed_prefix ()
15 {
16 RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
17 if which readlink >/dev/null 2>&1 ; then
18 RESULT=$(readlink -f "$RESULT")
19 fi
20 echo $RESULT
21 }
22
23 prefix_build="@prefix@"
24 prefix_real=$(installed_prefix "$0")
25
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#")
28 exec_prefix_build="@exec_prefix@"
29 exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real #")
30 includedir=$(echo "@includedir@" | 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#")
33 VERSION="@VERSION@"
34 LIBM="@LIBM@"
35 LIBC="@LIBC@"
36 SYSLIBS="$LIBM $LIBC"
37 ABIFLAGS="@ABIFLAGS@"
38 LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"
39 BASECFLAGS="@BASECFLAGS@"
40 LDLIBRARY="@LDLIBRARY@"
41 LINKFORSHARED="@LINKFORSHARED@"
42 OPT="@OPT@"
43 PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
44 LDVERSION="@LDVERSION@"
45 LIBDEST=${prefix}/lib/python${VERSION}
46 LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
47 SO="@SO@"
48 PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
49 INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
50 PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
51
52 # Scan for --help or unknown argument.
53 for ARG in $*
54 do
55 case $ARG in
56 --help)
57 exit_with_usage 0
58 ;;
59 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension- suffix|--abiflags|--configdir)
60 ;;
61 *)
62 exit_with_usage 1
63 ;;
64 esac
65 done
66
67 for ARG in "$@"
68 do
69 case "$ARG" in
70 --prefix)
71 echo "$prefix"
72 ;;
73 --exec-prefix)
74 echo "$exec_prefix"
75 ;;
76 --includes)
77 echo "$INCDIR $PLATINCDIR"
78 ;;
79 --cflags)
80 echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
81 ;;
82 --libs)
83 echo "$LIBS"
84 ;;
85 --ldflags)
86 LINKFORSHAREDUSED=
87 if [ -z "$PYTHONFRAMEWORK" ] ; then
88 LINKFORSHAREDUSED=$LINKFORSHARED
89 fi
90 LIBPLUSED=
91 if [ "$PY_ENABLE_SHARED" = "0" ] ; then
92 LIBPLUSED="-L$LIBPL"
93 fi
94 echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
95 ;;
96 --extension-suffix)
97 echo "$SO"
98 ;;
99 --abiflags)
100 echo "$ABIFLAGS"
101 ;;
102 --configdir)
103 echo "$LIBPL"
104 ;;
105 esac
106 done
OLDNEW
« no previous file with comments | « Makefile.pre.in ('k') | no next file » | no next file with comments »

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