2007-09-06 21:34:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# build info
|
|
|
|
|
|
|
|
WHO=$(whoami)
|
|
|
|
WHERE=$(hostname)
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
OS=$(uname -o)
|
|
|
|
|
|
|
|
cat <<!EOF
|
|
|
|
# file generated by $0
|
|
|
|
|
|
|
|
WHO = ${WHO}
|
|
|
|
WHERE = ${WHERE}
|
|
|
|
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}gcc" > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
M68K_CROSS_COMPILE=m68k-linux-gnu-
|
|
|
|
if ! type "${M68K_CROSS_COMPILE}gcc" > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
echo "Cannot find m68k cross-compiler" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
M68K_GCC_VERSION=$(${M68K_CROSS_COMPILE}gcc -dumpversion 2> /dev/null)
|
|
|
|
echo "cross-compiler is ${M68K_CROSS_COMPILE}gcc ${M68K_GCC_VERSION}" 1>&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<!EOF
|
|
|
|
|
|
|
|
M68K_CROSS_COMPILE = ${M68K_CROSS_COMPILE}
|
|
|
|
|
|
|
|
M68K_AS = \$(M68K_CROSS_COMPILE)as
|
|
|
|
M68K_CC = \$(M68K_CROSS_COMPILE)gcc
|
|
|
|
M68K_LD = \$(M68K_CROSS_COMPILE)ld
|
|
|
|
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}gcc" > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
PPC_CROSS_COMPILE=powerpc-linux-gnu-
|
|
|
|
if ! type "${PPC_CROSS_COMPILE}gcc" > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
echo "Cannot find powerpc cross-compiler" 1>&2
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
PPC_GCC_VERSION=$(${PPC_CROSS_COMPILE}gcc -dumpversion 2> /dev/null)
|
|
|
|
echo "cross-compiler is ${PPC_CROSS_COMPILE}gcc ${PPC_GCC_VERSION}" 1>&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<!EOF
|
|
|
|
|
|
|
|
PPC_CROSS_COMPILE = ${PPC_CROSS_COMPILE}
|
|
|
|
|
|
|
|
PPC_AS = \$(PPC_CROSS_COMPILE)as
|
|
|
|
PPC_CC = \$(PPC_CROSS_COMPILE)gcc
|
|
|
|
PPC_LD = \$(PPC_CROSS_COMPILE)ld
|
|
|
|
PPC_OBJCOPY = \$(PPC_CROSS_COMPILE)objcopy
|
|
|
|
PPC_STRIP = \$(PPC_CROSS_COMPILE)strip
|
|
|
|
!EOF
|
|
|
|
|
|
|
|
# target compiler
|
|
|
|
|
|
|
|
cat <<!EOF
|
|
|
|
|
2007-09-06 22:07:00 +00:00
|
|
|
ifeq (\$(TARGET),m68k-linux)
|
|
|
|
|
2007-09-06 21:34:48 +00:00
|
|
|
AS = \$(M68K_AS)
|
|
|
|
CC = \$(M68K_CC)
|
|
|
|
LD = \$(M68K_LD)
|
|
|
|
OBJCOPY = \$(M68K_OBJCOPY)
|
|
|
|
STRIP = \$(M68K_STRIP)
|
2007-09-06 22:07:00 +00:00
|
|
|
|
|
|
|
else ifeq (\$(TARGET),m68k-netbsd)
|
|
|
|
|
|
|
|
AS = \$(M68K_AS)
|
|
|
|
CC = \$(M68K_CC)
|
|
|
|
LD = \$(M68K_LD)
|
|
|
|
OBJCOPY = \$(M68K_OBJCOPY)
|
|
|
|
STRIP = \$(M68K_STRIP)
|
|
|
|
|
|
|
|
else ifeq (\$(TARGET),ppc-linux)
|
|
|
|
|
2007-09-06 21:34:48 +00:00
|
|
|
AS = \$(PPC_AS)
|
|
|
|
CC = \$(PPC_CC)
|
|
|
|
LD = \$(PPC_LD)
|
|
|
|
OBJCOPY = \$(PPC_OBJCOPY)
|
|
|
|
STRIP = \$(PPC_STRIP)
|
2007-09-06 22:07:00 +00:00
|
|
|
|
2007-09-06 21:34:48 +00:00
|
|
|
else
|
2007-09-06 22:07:00 +00:00
|
|
|
|
2007-09-06 21:34:48 +00:00
|
|
|
AS = \$(CROSS_COMPILE)as
|
|
|
|
CC = \$(CROSS_COMPILE)gcc
|
|
|
|
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
|