2007-09-06 21:34:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-09-08 23:34:10 +00:00
|
|
|
CC=gcc
|
|
|
|
AS=as
|
|
|
|
LD=ld
|
|
|
|
OBJCOPY=objcopy
|
|
|
|
STRIP=strip
|
|
|
|
|
2007-09-06 21:34:48 +00:00
|
|
|
# build info
|
|
|
|
|
|
|
|
WHO=$(whoami)
|
|
|
|
WHERE=$(hostname)
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
OS=$(uname -o)
|
|
|
|
|
|
|
|
cat <<!EOF
|
|
|
|
# file generated by $0
|
|
|
|
|
2007-09-13 18:33:59 +00:00
|
|
|
WHEN = \$(shell LANG=C date)
|
2007-09-07 08:41:20 +00:00
|
|
|
WHO = ${WHO}
|
|
|
|
WHERE = ${WHERE}
|
|
|
|
ARCH = ${ARCH}
|
|
|
|
OS = ${OS}
|
2007-09-06 21:34:48 +00:00
|
|
|
|
|
|
|
SIGNATURE = \$(PACKAGE)-\$(VERSION) \$(WHO)@\$(WHERE)(\$(ARCH) \$(OS)) \$(WHEN)
|
|
|
|
!EOF
|
|
|
|
|
|
|
|
# m68k cross-compiler
|
|
|
|
|
|
|
|
if test "${ARCH}" != "m68k"
|
|
|
|
then
|
|
|
|
M68K_CROSS_COMPILE=m68k-linux-
|
2007-09-08 23:34:10 +00:00
|
|
|
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
2007-09-06 21:34:48 +00:00
|
|
|
then
|
|
|
|
M68K_CROSS_COMPILE=m68k-linux-gnu-
|
2007-09-08 23:34:10 +00:00
|
|
|
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
2007-09-06 21:34:48 +00:00
|
|
|
then
|
|
|
|
echo "Cannot find m68k cross-compiler" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2007-09-08 23:34:10 +00:00
|
|
|
M68K_GCC_VERSION=$(${M68K_CROSS_COMPILE}${CC} -dumpversion 2> /dev/null)
|
|
|
|
echo "cross-compiler is ${M68K_CROSS_COMPILE}${CC} ${M68K_GCC_VERSION}" 1>&2
|
2007-09-06 21:34:48 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<!EOF
|
|
|
|
|
|
|
|
M68K_CROSS_COMPILE = ${M68K_CROSS_COMPILE}
|
|
|
|
|
2007-09-08 23:34:10 +00:00
|
|
|
M68K_AS = \$(M68K_CROSS_COMPILE)${AS}
|
|
|
|
M68K_CC = \$(M68K_CROSS_COMPILE)${CC}
|
|
|
|
M68K_LD = \$(M68K_CROSS_COMPILE)${LD}
|
|
|
|
M68K_OBJCOPY = \$(M68K_CROSS_COMPILE)${OBJCOPY}
|
|
|
|
M68K_STRIP = \$(M68K_CROSS_COMPILE)${STRIP}
|
2007-09-06 21:34:48 +00:00
|
|
|
!EOF
|
|
|
|
|
|
|
|
if test "${ARCH}" != "ppc"
|
|
|
|
then
|
|
|
|
PPC_CROSS_COMPILE=powerpc-linux-
|
2007-09-08 23:34:10 +00:00
|
|
|
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
2007-09-06 21:34:48 +00:00
|
|
|
then
|
|
|
|
PPC_CROSS_COMPILE=powerpc-linux-gnu-
|
2007-09-08 23:34:10 +00:00
|
|
|
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
2007-09-06 21:34:48 +00:00
|
|
|
then
|
|
|
|
echo "Cannot find powerpc cross-compiler" 1>&2
|
2007-09-08 23:34:10 +00:00
|
|
|
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
|
2007-09-06 21:34:48 +00:00
|
|
|
cat <<!EOF
|
|
|
|
|
|
|
|
PPC_CROSS_COMPILE = ${PPC_CROSS_COMPILE}
|
|
|
|
|
2007-09-08 23:34:10 +00:00
|
|
|
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}
|
2007-09-06 21:34:48 +00:00
|
|
|
!EOF
|
2007-09-08 23:34:10 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2007-09-06 21:34:48 +00:00
|
|
|
|
|
|
|
# target compiler
|
|
|
|
|
|
|
|
cat <<!EOF
|
|
|
|
|
2007-09-06 22:07:00 +00:00
|
|
|
ifeq (\$(TARGET),m68k-linux)
|
|
|
|
|
2007-09-07 08:41:20 +00:00
|
|
|
override AS = \$(M68K_AS)
|
|
|
|
override CC = \$(M68K_CC)
|
|
|
|
override LD = \$(M68K_LD)
|
|
|
|
override OBJCOPY = \$(M68K_OBJCOPY)
|
|
|
|
override STRIP = \$(M68K_STRIP)
|
2007-09-06 22:07:00 +00:00
|
|
|
|
|
|
|
else ifeq (\$(TARGET),m68k-netbsd)
|
|
|
|
|
2007-09-07 08:41:20 +00:00
|
|
|
override AS = \$(M68K_AS)
|
|
|
|
override CC = \$(M68K_CC)
|
|
|
|
override LD = \$(M68K_LD)
|
|
|
|
override OBJCOPY = \$(M68K_OBJCOPY)
|
|
|
|
override STRIP = \$(M68K_STRIP)
|
2007-09-06 22:07:00 +00:00
|
|
|
|
2007-09-08 23:34:10 +00:00
|
|
|
!EOF
|
|
|
|
|
|
|
|
if type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
cat <<!EOF
|
2007-09-06 22:07:00 +00:00
|
|
|
else ifeq (\$(TARGET),ppc-linux)
|
|
|
|
|
2007-09-07 08:41:20 +00:00
|
|
|
override AS = \$(PPC_AS)
|
|
|
|
override CC = \$(PPC_CC)
|
|
|
|
override LD = \$(PPC_LD)
|
|
|
|
override OBJCOPY = \$(PPC_OBJCOPY)
|
|
|
|
override STRIP = \$(PPC_STRIP)
|
2007-09-06 22:07:00 +00:00
|
|
|
|
2007-09-08 23:34:10 +00:00
|
|
|
!EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<!EOF
|
2007-09-06 21:34:48 +00:00
|
|
|
else
|
2007-09-06 22:07:00 +00:00
|
|
|
|
2007-09-08 23:34:10 +00:00
|
|
|
AS = \$(CROSS_COMPILE)${AS}
|
|
|
|
CC = \$(CROSS_COMPILE)${CC}
|
|
|
|
LD = \$(CROSS_COMPILE)${LD}
|
|
|
|
OBJCOPY = \$(CROSS_COMPILE)${OBJCOPY}
|
|
|
|
STRIP = \$(CROSS_COMPILE)${STRIP}
|
2007-09-06 22:07:00 +00:00
|
|
|
|
2007-09-06 21:34:48 +00:00
|
|
|
endif
|
|
|
|
!EOF
|
|
|
|
|
|
|
|
# docbook to man
|
|
|
|
|
|
|
|
if type docbook-to-man > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
cat <<!EOF
|
|
|
|
|
|
|
|
%.8: %.sgml
|
|
|
|
docbook-to-man \$< > \$@
|
|
|
|
!EOF
|
|
|
|
else
|
|
|
|
if type ${docbook-to-man} > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
cat <<!EOF
|
|
|
|
|
|
|
|
%.8: %.sgml
|
|
|
|
docbook2man \$<
|
|
|
|
!EOF
|
|
|
|
else
|
|
|
|
|
|
|
|
%.8: %.sgml
|
|
|
|
echo "Missing tools to generate \$@ from \$<"
|
|
|
|
fi
|
|
|
|
fi
|