Bug#859130: configure and Makefile.in
On Wed, Apr 25, 2018 at 11:07:23PM +0200, Geert Stappers wrote:
>
> Find attached a configure and Makefile.in
>
> Those are files that I miss upstream
>
Now with attachments ...
Groeten
Geert Stappers
--
Leven en laten leven
#!/bin/bash
#
# configure
# checks where it is running
# creates Makefile for that environment
# depends heavely on sed, streaming editor
#
# Running this script as
# ./configure
# results in overwritting the hardcore development Makefile
# with a Makefile that just builds and installs
#
# Intended use case is UNIX-alike environments.
#
#
FND_OS=$( uname )
case $( arch ) in
(i?86)
FND_BITNESS=32
;;
(x86_64)
FND_BITNESS=64
;;
(*)
FND_BITNESS=32
echo W: Using default bitness of ${FND_BITNESS}
;;
esac
case ${FND_OS}_${FND_BITNESS} in
(Linux_32)
MY_NAME=lina
MY_STEALC=stealconstant
;;
(Linux_64)
MY_NAME=lina
MY_STEALC=stealconstant64
;;
(MacOS_64)
MY_NAME=xina
MY_STEALC=stealconstant64
;;
(*)
echo W: Oops
echo I: Found Operating System: ${FND_OS}
echo I: Found bitness: {FND_BITNESS}
;;
esac
#
# Here should be code to detect which assembler use
#currently hardcoded
FND_ASM=as
FND_ASM=fasm
case ${FND_ASM} in
(as)
MY_ASMPRG=as
MY_ASMEXT=s
MY_ASMOPT=
MY_ASMLN2='ld -o $@ a.out'
MY_ASMM4=gas.m4
MY_M4=m4
;;
(fasm)
MY_ASMPRG=fasm
MY_ASMEXT=fas
MY_ASMOPT=-m256000
MY_ASMLN2='chmod a+x $@'
MY_ASMM4=fasm.m4
MY_M4=m4
;;
# FIXME nasm (and probably other assemblers) not defined
(*)
echo E: unknown assembler ${FND_ASM}
echo I: advice at least check this script for FIXME
exit 1
;;
esac
sed \
-e "s/@MY_NAME@/${MY_NAME}/g" \
-e "s/@MY_ASMPRG@/${MY_ASMPRG}/g" \
-e "s/@MY_ASMEXT@/${MY_ASMEXT}/g" \
-e "s/@MY_ASMOPT@/${MY_ASMOPT}/g" \
-e "s/@MY_ASMLN2@/${MY_ASMLN2}/g" \
-e "s/@MY_ASMM4@/${MY_ASMM4}/g" \
-e "s/@MY_M4@/${MY_M4}/g" \
-e "s/@MY_STEALC@/${MY_STEALC}/g" \
Makefile.in > Makefile
# l l
#
# Makefile
# for ciforth in UNIX environments
#
SOURCE = ci86.gnr
COLLETERAL = \
VERSION \
lina.cfg \
@MY_ASMM4@
all: lina documentation
lina: lina.@MY_ASMEXT@
@MY_ASMPRG@ $< @MY_ASMOPT@
@MY_ASMLN2@
lina.@MY_ASMEXT@: $(COLLETERAL) $(SOURCE)
cat $(COLLETERAL) $(SOURCE) | @MY_M4@ - |\
sed -e '/Split here /,$$d' >$@
VERSION: namescooked.m4
echo 'define({M4_VERSION},{'${VERSION}'})' >$@
namescooked.m4: names.m4 $(SOURCE)
cat names.m4 >$@
echo "define({ci86gnrversion}, ifelse(M4_VERSION,test,\
{snapshot `grep TITLE ci86.gnr|sed -e 's/.*Revision: //'|\
sed -e 's/ .*//' `},\
{M4_VERSION}\
))dnl" >>$@
documentation:
echo Currently low priority > $@
clean:
rm -f lina.@MY_ASMEXT@ lina.*s* a.out
rm -f namescooked.m4
distclean: clean
rm -f lina
install: lina forth.lab
mkdir -p $(DESTDIR)/usr/bin
cp lina $(DESTDIR)/usr/bin
mkdir -p $(DESTDIR)/usr/lib
cp forth.lab $(DESTDIR)/usr/lib
# l l
Reply to: