mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-29 15:30:55 +00:00
add configure script
Remove tools.sh, and let ./configure to generate tools.mk Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
08be6d9c46
commit
bd8f87287c
5
Makefile
5
Makefile
@ -35,8 +35,9 @@ all: tools.mk docs libemile libblock libiso9660 libiso9660-m68k libgzip-m68k \
|
||||
libconfig libconfig-m68k \
|
||||
second/$(KARCH)-linux-all/second second/m68k-linux-scsi-driver/apple_driver
|
||||
|
||||
tools.mk: scripts/tools.sh
|
||||
sh scripts/tools.sh > $@
|
||||
tools.mk:
|
||||
@echo "Please run ./configure"
|
||||
@false
|
||||
|
||||
ALL_BIN = cdboot-sarge.bin cdboot-woody.bin cdboot-etch.bin
|
||||
|
||||
|
114
scripts/tools.sh → configure
vendored
Normal file → Executable file
114
scripts/tools.sh → configure
vendored
Normal file → Executable file
@ -13,7 +13,35 @@ WHERE=$(hostname)
|
||||
ARCH=$(uname -m)
|
||||
OS=$(uname -o)
|
||||
|
||||
cat <<!EOF
|
||||
if test "${ARCH}" != "m68k" ; then
|
||||
M68K_CROSS_COMPILE=${M68K_CROSS_COMPILE:-m68k-linux-}
|
||||
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
M68K_CROSS_COMPILE=m68k-linux-gnu-
|
||||
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
echo "Cannot find m68k cross-compiler" 1>&2
|
||||
unset M68K_CROSS_COMPILE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "${ARCH}" != "ppc" ; then
|
||||
PPC_CROSS_COMPILE=${PPC_CROSS_COMPILE:-powerpc-linux-}
|
||||
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
PPC_CROSS_COMPILE=powerpc-linux-gnu-
|
||||
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
echo "Cannot find powerpc cross-compiler" 1>&2
|
||||
unset PPC_CROSS_COMPILE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exec 5> tools.mk.tmp
|
||||
|
||||
cat 1>&5 <<!EOF
|
||||
# file generated by $0
|
||||
|
||||
WHEN = \$(shell LANG=C date)
|
||||
@ -23,26 +51,6 @@ ARCH = ${ARCH}
|
||||
OS = ${OS}
|
||||
|
||||
SIGNATURE = \$(PACKAGE)-\$(VERSION) \$(WHO)@\$(WHERE)(\$(ARCH) \$(OS)) \$(WHEN)
|
||||
!EOF
|
||||
|
||||
# m68k cross-compiler
|
||||
|
||||
if test "${ARCH}" != "m68k"
|
||||
then
|
||||
M68K_CROSS_COMPILE=m68k-linux-
|
||||
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
M68K_CROSS_COMPILE=m68k-linux-gnu-
|
||||
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
echo "Cannot find m68k cross-compiler" 1>&2
|
||||
fi
|
||||
fi
|
||||
M68K_GCC_VERSION=$(${M68K_CROSS_COMPILE}${CC} -dumpversion 2> /dev/null)
|
||||
echo "cross-compiler is ${M68K_CROSS_COMPILE}${CC} ${M68K_GCC_VERSION}" 1>&2
|
||||
fi
|
||||
|
||||
cat <<!EOF
|
||||
|
||||
M68K_CROSS_COMPILE = ${M68K_CROSS_COMPILE}
|
||||
|
||||
@ -53,35 +61,29 @@ M68K_OBJCOPY = \$(M68K_CROSS_COMPILE)${OBJCOPY}
|
||||
M68K_STRIP = \$(M68K_CROSS_COMPILE)${STRIP}
|
||||
!EOF
|
||||
|
||||
if test "${ARCH}" != "ppc"
|
||||
then
|
||||
PPC_CROSS_COMPILE=powerpc-linux-
|
||||
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
PPC_CROSS_COMPILE=powerpc-linux-gnu-
|
||||
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
echo "Cannot find powerpc cross-compiler" 1>&2
|
||||
else
|
||||
PPC_GCC_VERSION=$(${PPC_CROSS_COMPILE}${CC} -dumpversion 2> /dev/null)
|
||||
echo "cross-compiler is ${PPC_CROSS_COMPILE}${CC} ${PPC_GCC_VERSION}" 1>&2
|
||||
cat <<!EOF
|
||||
if [ "${M68K_CROSS_COMPILE}" != "" ] ; then
|
||||
M68K_GCC_VERSION=$(${M68K_CROSS_COMPILE}${CC} -dumpversion 2> /dev/null)
|
||||
echo "cross-compiler is ${M68K_CROSS_COMPILE}${CC} ${M68K_GCC_VERSION}" 1>&2
|
||||
fi
|
||||
|
||||
if [ "${PPC_CROSS_COMPILE}" != "" ] ; then
|
||||
PPC_GCC_VERSION=$(${PPC_CROSS_COMPILE}${CC} -dumpversion 2> /dev/null)
|
||||
echo "cross-compiler is ${PPC_CROSS_COMPILE}${CC} ${PPC_GCC_VERSION}" 1>&2
|
||||
cat 1>&5 <<!EOF
|
||||
PPC_CROSS_COMPILE = ${PPC_CROSS_COMPILE}
|
||||
|
||||
PPC_AS = \$(PPC_CROSS_COMPILE)${AS}
|
||||
PPC_CC = \$(PPC_CROSS_COMPILE)${CC}
|
||||
PPC_LD = \$(PPC_CROSS_COMPILE)${LD}
|
||||
PPC_OBJCOPY = \$(PPC_CROSS_COMPILE)${OBJCOPY}
|
||||
PPC_STRIP = \$(PPC_CROSS_COMPILE)${STRIP}
|
||||
PPC_AS = \$(PPC_CROSS_COMPILE)${AS}
|
||||
PPC_CC = \$(PPC_CROSS_COMPILE)${CC}
|
||||
PPC_LD = \$(PPC_CROSS_COMPILE)${LD}
|
||||
PPC_OBJCOPY = \$(PPC_CROSS_COMPILE)${OBJCOPY}
|
||||
PPC_STRIP = \$(PPC_CROSS_COMPILE)${STRIP}
|
||||
!EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# target compiler
|
||||
|
||||
cat <<!EOF
|
||||
cat 1>&5 <<!EOF
|
||||
|
||||
ifeq (\$(TARGET),m68k-linux)
|
||||
|
||||
@ -101,9 +103,8 @@ override STRIP = \$(M68K_STRIP)
|
||||
|
||||
!EOF
|
||||
|
||||
if type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
||||
then
|
||||
cat <<!EOF
|
||||
if [ "${PPC_GCC_VERSION}" != "" ] ; then
|
||||
cat 1>&5 <<!EOF
|
||||
else ifeq (\$(TARGET),ppc-linux)
|
||||
|
||||
override AS = \$(M68K_AS)
|
||||
@ -115,23 +116,24 @@ override STRIP = \$(M68K_STRIP)
|
||||
!EOF
|
||||
fi
|
||||
|
||||
cat <<!EOF
|
||||
cat 1>&5 <<!EOF
|
||||
else
|
||||
|
||||
AS = \$(CROSS_COMPILE)${AS}
|
||||
CC = \$(CROSS_COMPILE)${CC}
|
||||
LD = \$(CROSS_COMPILE)${LD}
|
||||
OBJCOPY = \$(CROSS_COMPILE)${OBJCOPY}
|
||||
STRIP = \$(CROSS_COMPILE)${STRIP}
|
||||
AS = \$(CROSS_COMPILE)${AS}
|
||||
CC = \$(CROSS_COMPILE)${CC}
|
||||
LD = \$(CROSS_COMPILE)${LD}
|
||||
OBJCOPY = \$(CROSS_COMPILE)${OBJCOPY}
|
||||
STRIP = \$(CROSS_COMPILE)${STRIP}
|
||||
|
||||
endif
|
||||
!EOF
|
||||
|
||||
|
||||
# docbook to man
|
||||
|
||||
if type docbook-to-man > /dev/null 2>&1
|
||||
then
|
||||
cat <<!EOF
|
||||
cat 1>&5 <<!EOF
|
||||
|
||||
%.5: %.sgml
|
||||
docbook-to-man \$< > \$@
|
||||
@ -142,7 +144,7 @@ cat <<!EOF
|
||||
else
|
||||
if type docbook2man > /dev/null 2>&1
|
||||
then
|
||||
cat <<!EOF
|
||||
cat 1>&5 <<!EOF
|
||||
|
||||
%.5: %.sgml
|
||||
docbook2man \$< > \$@
|
||||
@ -151,8 +153,8 @@ cat <<!EOF
|
||||
docbook2man \$< > \$@
|
||||
!EOF
|
||||
else
|
||||
|
||||
cat <<!EOF
|
||||
|
||||
cat 1>&5 <<!EOF
|
||||
%.5: %.sgml
|
||||
@echo "Missing tools to generate \$@ from \$<" >&2 && false
|
||||
|
||||
@ -161,3 +163,5 @@ cat <<!EOF
|
||||
!EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
mv tools.mk.tmp tools.mk
|
3
debian/rules
vendored
3
debian/rules
vendored
@ -35,7 +35,8 @@ build: build-stamp
|
||||
build-stamp:
|
||||
dh_testdir
|
||||
# Add here commands to compile the package.
|
||||
$(MAKE) M68K_CROSS_COMPILE="$(M68K_CROSS_COMPILE)" CROSS_COMPILE="$(CROSS_COMPILE)" $(target)
|
||||
M68K_CROSS_COMPILE="$(M68K_CROSS_COMPILE)" ./configure
|
||||
$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" $(target)
|
||||
touch build-stamp
|
||||
|
||||
clean:
|
||||
|
Loading…
x
Reference in New Issue
Block a user