10 | | # Only build iconv on Solaris, HP-UX and Cygwin |
11 | | if [ "x$UNAME" != xSunOS ] && [ "x$UNAME" != xHP-UX ] && [ "x$UNAME" != xCYGWIN ] ; then |
12 | | echo "iconv will not be installed, as we only need to build it on" |
13 | | echo "Solaris, HP-UX and Cygwin - see:" |
14 | | echo "http://trac.sagemath.org/sage_trac/ticket/8567" |
15 | | exit 0 |
| 14 | if [ "x$UNAME" = xSunOS ] || [ "x$UNAME" = xHP-UX ] || [ "x$UNAME" = xCYGWIN ] ; then |
| 15 | echo "iconv will be installed as the operating system is Cygwin, HP-UX or Solaris" |
| 16 | echo "These system either lack iconv, or do not have a sufficiently capable" |
| 17 | echo "iconv. See:" |
| 18 | echo "http://trac.sagemath.org/sage_trac/ticket/8567" |
| 19 | echo "http://trac.sagemath.org/sage_trac/ticket/9603" |
| 20 | |
| 21 | echo "First removing old iconv files if they exist" |
| 22 | # If iconv is updated, please double-check these are still necessary |
| 23 | # and that there are no extra files added. |
| 24 | |
| 25 | rm -f $SAGE_LOCAL/bin/iconv $SAGE_LOCAL/lib/charset.alias |
| 26 | rm -f $SAGE_LOCAL/lib/*libiconv* $SAGE_LOCAL/lib/libcharset* |
| 27 | rm -f $SAGE_LOCAL/include/iconv.h $SAGE_LOCAL/include/libcharset.h |
| 28 | rm -f $SAGE_LOCAL/include/localcharset.h |
| 29 | rm -rf $SAGE_LOCAL/share/doc/libiconv |
| 30 | rm -f $SAGE_LOCAL/share/man/man1/iconv* $SAGE_LOCAL/share/man/man3/iconv* |
| 31 | |
| 32 | |
| 33 | # Let an environment variable CFLAG64 specify the option to generate 64-bit |
| 34 | # code. If this is not set, default to -m64. |
| 35 | if [ -z "$CFLAG64" ] ; then |
| 36 | CFLAG64=-m64 |
| 37 | fi |
| 38 | |
| 39 | # Add option for a 64-bit build if needed. |
| 40 | if [ "x$SAGE64" = xyes ] ; then |
| 41 | CFLAGS="$CFLAG64" |
| 42 | export CFLAGS |
| 43 | fi |
| 44 | |
| 45 | cd src |
| 46 | ./configure --prefix=$SAGE_LOCAL |
| 47 | if [ $? -ne 0 ]; then |
| 48 | echo "Error configuring iconv" |
| 49 | exit 1 |
| 50 | fi |
| 51 | |
| 52 | make |
| 53 | if [ $? -ne 0 ]; then |
| 54 | echo "Error building iconv" |
| 55 | exit 1 |
| 56 | fi |
| 57 | |
| 58 | make install |
| 59 | if [ $? -ne 0 ]; then |
| 60 | echo "Error installing iconv" |
| 61 | exit 1 |
| 62 | fi |
| 63 | exit 0 |
| 64 | else |
| 65 | echo "iconv will not be installed, as we only need to build it on" |
| 66 | echo "Solaris, HP-UX and Cygwin, as the system iconv will be" |
| 67 | echo "used on other platforms, rather than the one shipped with Sage" |
| 68 | echo "See:" |
| 69 | echo "http://trac.sagemath.org/sage_trac/ticket/8567" |
| 70 | echo "http://trac.sagemath.org/sage_trac/ticket/9603" |
| 71 | exit 0 |
18 | | echo "Installing iconv as the operating system is Cygwin, HP-UX or Solaris" |
19 | | |
20 | | |
21 | | echo "Removing old iconv files if they exist" |
22 | | # If iconv is updated, please double-check these are still necessary |
23 | | # and that there are no extra files added. |
24 | | |
25 | | rm -f $SAGE_LOCAL/bin/iconv $SAGE_LOCAL/lib/charset.alias |
26 | | rm -f $SAGE_LOCAL/lib/*libiconv* $SAGE_LOCAL/lib/libcharset* |
27 | | rm -f $SAGE_LOCAL/include/iconv.h $SAGE_LOCAL/include/libcharset.h |
28 | | rm -f $SAGE_LOCAL/include/localcharset.h |
29 | | rm -rf $SAGE_LOCAL/share/doc/libiconv |
30 | | rm -f $SAGE_LOCAL/share/man/man1/iconv* $SAGE_LOCAL/share/man/man3/iconv* |
31 | | |
32 | | |
33 | | # Let an environment variable CFLAG64 specify the option to generate 64-bit |
34 | | # code. If this is not set, default to -m64. |
35 | | if [ -z "$CFLAG64" ] ; then |
36 | | CFLAG64=-m64 |
37 | | fi |
38 | | |
39 | | # Add option for a 64-bit build if needed. |
40 | | if [ "x$SAGE64" = xyes ] ; then |
41 | | CFLAGS="$CFLAG64" |
42 | | export CFLAGS |
43 | | fi |
44 | | |
45 | | cd src |
46 | | ./configure --prefix=$SAGE_LOCAL |
47 | | if [ $? -ne 0 ]; then |
48 | | echo "Error configuring iconv" |
49 | | exit 1 |
50 | | fi |
51 | | |
52 | | make |
53 | | if [ $? -ne 0 ]; then |
54 | | echo "Error making iconv" |
55 | | exit 1 |
56 | | fi |
57 | | |
58 | | make install |
59 | | |
60 | | if [ $? -ne 0 ]; then |
61 | | echo "Error installing iconv" |
62 | | exit 1 |
63 | | fi |
64 | | |