diff --git a/tools/tools/tcl_bmake/mkMakefile.sh b/tools/tools/tcl_bmake/mkMakefile.sh index b5765eae669d..59083a3d704e 100644 --- a/tools/tools/tcl_bmake/mkMakefile.sh +++ b/tools/tools/tcl_bmake/mkMakefile.sh @@ -1,5 +1,5 @@ -: -# $Id: mkMakefile.sh,v 1.2 1996/06/30 18:02:58 phk Exp $ +#! /bin/sh +# $Id: mkMakefile.sh,v 1.3 1996/08/19 15:02:47 peter Exp $ # # This script generates a bmake Makefile for src/lib/libtcl # @@ -18,7 +18,7 @@ LIBTCL=../../../lib/libtcl/ mkdir -p ${LIBTCL} -(cd ${SRCDIR}/unix ; sh configure --enable-shared) || true +(cd ${SRCDIR}/unix ; sh configure --enable-shared --prefix=/usr) || true echo "include ${SRCDIR}/unix/Makefile" > m.x echo ' @@ -37,7 +37,7 @@ echo '$' >> ${LIBTCL}Makefile echo '# This file is generated automatically, think twice!' >> ${LIBTCL}Makefile echo '# Please change src/tools/tools/tcl_bmake/mkMakefile.sh instead' >> ${LIBTCL}Makefile echo '# Generated by src/tools/tools/tcl_bmake/mkMakefile.sh version:' >> ${LIBTCL}Makefile -echo '# $Id: mkMakefile.sh,v 1.2 1996/06/30 18:02:58 phk Exp $' | tr -d '$' >> ${LIBTCL}Makefile +echo '# $Id: mkMakefile.sh,v 1.3 1996/08/19 15:02:47 peter Exp $' | tr -d '$' >> ${LIBTCL}Makefile echo >> ${LIBTCL}Makefile # Tell make(1) to pick up stuff from here @@ -45,6 +45,7 @@ echo 'TCLDIST=${.CURDIR}/../../contrib/tcl' >> ${LIBTCL}Makefile echo >> ${LIBTCL}Makefile echo '.PATH: ${TCLDIST}/generic' >> ${LIBTCL}Makefile echo '.PATH: ${TCLDIST}/unix' >> ${LIBTCL}Makefile +echo '.PATH: ${TCLDIST}/doc' >> ${LIBTCL}Makefile # Tell cpp(1) to pick up stuff from here echo 'CFLAGS+= -I${TCLDIST}/generic' >> ${LIBTCL}Makefile @@ -58,6 +59,13 @@ echo "SHLIB_MINOR= ${SHLIB_MINOR}" >> ${LIBTCL}Makefile # Set the name of the library echo 'LIB= tcl' >> ${LIBTCL}Makefile +echo >> ${LIBTCL}Makefile +echo ".if !defined(NOPIC)" >> ${LIBTCL}Makefile +echo "LINKS+= \${SHLIBDIR}/lib\${LIB}.so.\${SHLIB_MINOR}.\${SHLIB_MINOR} \\" >> ${LIBTCL}Makefile +echo " \${SHLIBDIR}/lib\${LIB}\${SHLIB_MINOR}.so.1.0" >> ${LIBTCL}Makefile +echo ".endif" >> ${LIBTCL}Makefile +echo "LINKS+= \${LIBDIR}/lib\${LIB}.a \${LIBDIR}/lib\${LIB}\${SHLIB_MAJOR}.a" >> ${LIBTCL}Makefile + echo >> ${LIBTCL}Makefile # some needed CFLAGS @@ -89,6 +97,8 @@ beforeinstall: ${TCLDIST}/generic/tcl.h tcl.macros ${TCLDIST}/unix/tclAppInit.c ${DESTDIR}/${TCL_LIBRARY} ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \ tcl.macros ${DESTDIR}/usr/share/tmac/tcl.macros + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \ + ${.CURDIR}/tclConfig.sh ${DESTDIR}/${TCL_LIBRARY} tcl.macros: ${TCLDIST}/doc/man.macros cp ${.ALLSRC} ${.TARGET} @@ -96,27 +106,25 @@ tcl.macros: ${TCLDIST}/doc/man.macros ' >> ${LIBTCL}Makefile echo ' -SEDARG="/\.so *man.macros/s;.*;.so /usr/share/tmac/tcl.macros;" +MANFILTER=sed "/\.so *man.macros/s;.*;.so /usr/share/tmac/tcl.macros;" ' >> ${LIBTCL}Makefile # The (n) manpages for i in ${SRCDIR}/doc/*.n do - basename $i .n | awk ' - { - print "" - print $1 ".n: ${TCLDIST}/doc/" B ".n" - print "\tsed ${SEDARG} < \${.ALLSRC} > \${.TARGET}" - print "" - print "MANn+= " $1 ".n " - } - ' F=$i B=`basename $i .n` >> ${LIBTCL}Makefile + basename $i | awk '{print "MANn+= " $1}' >> ${LIBTCL}Makefile done echo >> ${LIBTCL}Makefile # The (3) manpages for i in ${SRCDIR}/doc/*.3 +do + basename $i | awk '{print "MAN3+= " $1 }' >> ${LIBTCL}Makefile +done + +echo >> ${LIBTCL}Makefile +for i in ${SRCDIR}/doc/*.3 do sed ' 1,/^.SH NAME/d @@ -126,24 +134,21 @@ do 1s/\\-.*//p ' | awk ' { - print "" - print $1 ".3: ${TCLDIST}/doc/" B ".3" - print "\tsed ${SEDARG} < \${.ALLSRC} > \${.TARGET}" - print "" - print "MAN3+= " $1 ".3 " for (i = 2 ; i <= NF ; i++) print "MLINKS+= " $1 ".3 " $i ".3 " } - ' F=$i B=`basename $i .3` >> ${LIBTCL}Makefile + ' B=`basename $i .3` >> ${LIBTCL}Makefile done echo ' -CLEANFILES= ${MAN3} ${MANn} tcl.macros +CLEANFILES= tcl.macros .include ' >> ${LIBTCL}Makefile +sed -e '/^TCL_BUILD_LIB_SPEC=/s/^/#XXX not available# /' < ${SRCDIR}/unix/tclConfig.sh > ${LIBTCL}/tclConfig.sh + rm -f m.x ${SRCDIR}/unix/config.log ${SRCDIR}/unix/Makefile ${SRCDIR}/unix/config.cache ${SRCDIR}/unix/config.status ${SRCDIR}/unix/tclConfig.sh