[617118d] | 1 | #!/bin/sh |
---|
| 2 | # |
---|
| 3 | # Tcl ( Reqd for expect ) |
---|
| 4 | # |
---|
| 5 | # TODO: work to be done to make tclConfig.sh behave |
---|
| 6 | cd ${SRC} |
---|
| 7 | LOG=tcl-blfs.log |
---|
| 8 | |
---|
| 9 | SELF=`basename ${0}` |
---|
| 10 | set_buildenv |
---|
| 11 | set_libdirname |
---|
| 12 | setup_multiarch |
---|
| 13 | |
---|
| 14 | unpack_tarball tcl${TCL_VER}-src && |
---|
| 15 | cd ${PKGDIR}/unix |
---|
| 16 | |
---|
| 17 | if [ ! "${libdirname}" = "lib" ]; then |
---|
| 18 | extra_conf="--libdir=/usr/${libdirname}" |
---|
| 19 | # change TCL_LIBRARY in Makefile so it is under $(libdir) |
---|
| 20 | if [ ! -f Makefile.in-ORIG ]; then cp -p Makefile.in Makefile.in-ORIG ; fi |
---|
| 21 | sed '/TCL_LIBRARY/s@\$(prefix)/lib@$(libdir)@g' Makefile.in-ORIG > Makefile.in |
---|
| 22 | fi |
---|
| 23 | |
---|
| 24 | max_log_init Tcl ${TCL_VER} "blfs (shared)" ${CONFLOGS} ${LOG} |
---|
| 25 | CC="${CC-gcc} ${ARCH_CFLAGS}" \ |
---|
| 26 | CFLAGS="${TGT_CFLAGS}" \ |
---|
| 27 | ./configure --prefix=/usr --enable-threads ${extra_conf} \ |
---|
| 28 | --mandir=/usr/share/man --infodir=/usr/share/info \ |
---|
| 29 | >> ${LOGFILE} 2>&1 && |
---|
| 30 | echo " o Configure OK" && |
---|
| 31 | |
---|
| 32 | min_log_init ${BUILDLOGS} && |
---|
| 33 | make ${PMFLAGS} LDFLAGS="-s" \ |
---|
| 34 | >> ${LOGFILE} 2>&1 && |
---|
| 35 | echo " o Build OK" && |
---|
| 36 | |
---|
| 37 | min_log_init ${TESTLOGS} && |
---|
| 38 | make test \ |
---|
| 39 | >> ${LOGFILE} 2>&1 && |
---|
| 40 | echo " o Test OK" && |
---|
| 41 | # clock test may fail... not a real concern for our purposes... |
---|
| 42 | |
---|
| 43 | # TODO: get version from tcl itself |
---|
| 44 | V=`echo ${TCL_VER} | cut -d "." -f 1,2` |
---|
| 45 | |
---|
| 46 | sed -i "s@${SRC}/${PKGDIR}/unix@/usr/${libdirname}@" tclConfig.sh && |
---|
| 47 | sed -i "s@${SRC}/${PKGDIR}@/usr/include/tcl${V}@" tclConfig.sh && |
---|
| 48 | sed -i "s@^TCL_LIB_FILE='libtcl${V}..TCL_DBGX..so'@TCL_LIB_FILE=\"libtcl${V}\$\{TCL_DBGX\}.so\"@" \ |
---|
| 49 | tclConfig.sh |
---|
| 50 | |
---|
| 51 | # The following isn't required for tcl 8.4.9 ... |
---|
| 52 | # TODO: check which versions (apart from 8.4.6) this is needed for |
---|
| 53 | case ${TCL_VER} in |
---|
| 54 | 8.4.6 ) |
---|
| 55 | mv ../doc/{,Tcl_}Thread.3 && |
---|
| 56 | sed -i 's/ Thread.3/ Tcl_Thread.3/' mkLinks |
---|
| 57 | ;; |
---|
| 58 | esac |
---|
| 59 | |
---|
| 60 | min_log_init ${INSTLOGS} && |
---|
| 61 | make install \ |
---|
| 62 | >> ${LOGFILE} 2>&1 && |
---|
| 63 | echo " o ALL OK" || barf |
---|
| 64 | |
---|
| 65 | install -d /usr/include/tcl${V}/unix && |
---|
| 66 | install -m644 *.h /usr/include/tcl${V}/unix/ && |
---|
| 67 | install -d /usr/include/tcl${V}/generic && |
---|
| 68 | install -c -m644 ../generic/*.h /usr/include/tcl${V}/generic/ && |
---|
| 69 | rm -f /usr/include/tcl${V}/generic/{tcl,tclDecls,tclPlatDecls}.h && |
---|
| 70 | ln -nsf ../../include/tcl${V} /usr/${libdirname}/tcl${V}/include && |
---|
| 71 | ln -sf libtcl${V}.so /usr/${libdirname}/libtcl.so |
---|
| 72 | |
---|
| 73 | # Create symlink for tclsh |
---|
| 74 | TCLSH=$(basename $(find /usr/bin -type f -name tclsh\*)) |
---|
| 75 | test "tclsh" != "${TCLSH}" && |
---|
| 76 | ln -sf ./${TCLSH} /usr/bin/tclsh |
---|
| 77 | |
---|