Diff

Differences From Artifact [09ccdfc66e]:

To Artifact [bdd97ba1c5]:


   135    135   	pkgIndex="${pkgDir}/pkgIndex.tcl"
   136    136   
   137    137   	mkdir -p "${pkgDir}"
   138    138   
   139    139   	cp tcc.tcl "${pkgDir}"
   140    140   	cp pkgIndex.tcl "${pkgDir}"
   141    141   
          142  +	# Install headers needed for compilation
          143  +	incDir="${pkgDir}/include"
          144  +	mkdir "${incDir}"
          145  +
          146  +	touch include/windows.h
          147  +	cp -r include/* "${incDir}"
          148  +	cp -r ../../../{tcl,tk}/inst/include/* "${incDir}"
          149  +
          150  +	find "${incDir}" -name '*.a' | xargs rm -f
          151  +
          152  +	# Install libraries
          153  +	libDir="${pkgDir}/lib"
          154  +	mkdir "${libDir}"
          155  +
          156  +	(
          157  +		cd c || exit 1
          158  +		rm -f *.a *.o
          159  +		for file in *.c; do
          160  +			ofile="$(echo "${file}" | sed 's@\.c$@.o@')"
          161  +			"${CC:-gcc}" -I../include -I../../../../{tcl,tk}/inst/include/ -I../../../../tcl/build/tcl${TCLVERS}/generic/ -I../../../../tcl/build/tcl${TCLVERS}/unix/ -DUSE_TCL_STUBS=1 -c "${file}" -o "${ofile}"
          162  +		done
          163  +		"${AR:-ar}" cu ../lib/libtcc1.a *.o
          164  +		"${RANLIB:-ranlib}" ../lib/libtcc1.a
          165  +	)
          166  +	cp lib/libtcc1.a "${libDir}"
          167  +
          168  +	# Create VFS-insert
   142    169   	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
   143         -	find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f --
          170  +	find "${OUTDIR}" -name '*.a' -type f | grep -v '/lib/libtcc1\.a$' | xargs rm -f
   144    171   
   145    172   	exit 0
   146    173   ) || exit 1
   147    174   
   148    175   exit 0