diff --git a/README b/README index 12e82aa..40f0073 100644 --- a/README +++ b/README @@ -8,6 +8,7 @@ targeting m68k-amigaos with: * g++ 2.95.3 + libstdc++ * binutils 2.9.1 (assembler, linker, etc.) * libnix 2.1 (standard ANSI/C library replacement for AmigaOS) + * libm 5.4 (provides math library implementation for non-FPU Amigas) * AmigaOS headers & libraries (for AmigaOS 3.9) * ixemul.library 48.2 @@ -31,6 +32,7 @@ Prerequisites (look at bootstrap.conf file): - gawk 1.3.8 * Amiga specific sources & binaries: - libnix 2.1 + - libm 5.4 - AmigaOS NDK 3.9 - sfdc 1.4 - libamiga-bin diff --git a/archives/fetch.sh b/archives/fetch.sh index 3724faa..1db9b5f 100755 --- a/archives/fetch.sh +++ b/archives/fetch.sh @@ -25,6 +25,9 @@ download \ download \ "http://ftp.back2roots.org/geekgadgets/amiga/m68k/snapshots/990529/bin/libamiga-bin.tgz" \ "libamiga-bin.tar.gz" +download \ + "http://ftp.back2roots.org/geekgadgets/amiga/m68k/snapshots/990529/src/libm-5.4-src.tgz" \ + "libm-5.4.tar.gz" download \ "http://sourceforge.net/projects/amiga/files/ixemul.library/48.2/ixemul-src.lha/download" \ "ixemul-48.2.lha" diff --git a/bootstrap.conf b/bootstrap.conf index d32ad61..a602bd6 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -30,6 +30,9 @@ readonly BINUTILS_SRC="${BINUTILS}.tar.gz" readonly IXEMUL="ixemul-48.2" readonly IXEMUL_SRC="${IXEMUL}.lha" +readonly LIBM="libm-5.4" +readonly LIBM_SRC="${LIBM}.tar.gz" + readonly LIBNIX="libnix-2.1" readonly LIBNIX_SRC="${LIBNIX}.tar.gz" diff --git a/bootstrap.sh b/bootstrap.sh index e1689f8..4e16ecb 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -133,6 +133,10 @@ function unpack_sources { mv "libnix" "${LIBNIX}" chmod a+x "${LIBNIX}/mkinstalldirs" + unpack_clean "${LIBM}" "${LIBM_SRC}" + mv "contrib/libm" "${LIBM}" + rmdir "contrib" + mkdir_empty "${LIBAMIGA}" pushd "${LIBAMIGA}" tar -xzf "${ARCHIVES}/${LIBAMIGA_SRC}" @@ -214,15 +218,14 @@ function build_tools { popd - touch "${STAMP}/build-tools" + touch "${STAMP}/build-tools" } function build_binutils { [ -f "${STAMP}/build-binutils" ] && return 0 pushd "${BUILD_DIR}" - rm -rf "${BINUTILS}" - mkdir -p "${BINUTILS}" + mkdir_empty "${BINUTILS}" cd "${BINUTILS}" "${SOURCES}/${BINUTILS}/configure" \ --prefix="${PREFIX}" \ @@ -232,15 +235,14 @@ function build_binutils { make install install-info popd - touch "${STAMP}/build-binutils" + touch "${STAMP}/build-binutils" } function build_gcc { [ -f "${STAMP}/build-gcc" ] && return 0 pushd "${BUILD_DIR}" - rm -rf "${GCC}" - mkdir -p "${GCC}" + mkdir_empty "${GCC}" cd "${GCC}" "${SOURCES}/${GCC}/configure" \ --prefix="${PREFIX}" \ @@ -252,16 +254,17 @@ function build_gcc { make install ${FLAGS_FOR_TARGET[*]} popd - touch "${STAMP}/build-gcc" + touch "${STAMP}/build-gcc" } function build_gpp { [ -f "${STAMP}/build-gpp" ] && return 0 + local GPP="${GCC/gcc/g++}" + pushd "${BUILD_DIR}" - rm -rf "${GCC}" - mkdir -p "${GCC}" - cd "${GCC}" + mkdir_empty "${GPP}" + cd "${GPP}" "${SOURCES}/${GCC}/configure" \ --prefix="${PREFIX}" \ --host="i686-linux-gnu" \ @@ -272,7 +275,7 @@ function build_gpp { make install ${FLAGS_FOR_TARGET[*]} popd - touch "${STAMP}/build-gpp" + touch "${STAMP}/build-gpp" } function process_headers { @@ -284,8 +287,7 @@ function process_headers { cd "${SFDC}" ./configure \ --prefix="${PREFIX}" - make - make install + make && make install popd pushd "${PREFIX}/include" @@ -300,7 +302,7 @@ function process_headers { done popd - touch "${STAMP}/process-headers" + touch "${STAMP}/process-headers" } function install_libamiga { @@ -310,15 +312,14 @@ function install_libamiga { cp -av "${SOURCES}/${LIBAMIGA}/lib" . popd - touch "${STAMP}/install-libamiga" + touch "${STAMP}/install-libamiga" } function build_libnix { [ -f "${STAMP}/build-libnix" ] && return 0 pushd "${BUILD_DIR}" - rm -rf "${LIBNIX}" - mkdir -p "${LIBNIX}" + mkdir_empty "${LIBNIX}" cd "${LIBNIX}" "${SOURCES}/${LIBNIX}/configure" \ --prefix="${PREFIX}" \ @@ -336,15 +337,34 @@ function build_libnix { make install MAKEINFO=: popd - touch "${STAMP}/build-libnix" + touch "${STAMP}/build-libnix" +} + +function build_libm { + [ -f "${STAMP}/build-libm" ] && return 0 + + pushd "${BUILD_DIR}" + mkdir_empty "${LIBM}" + cd "${LIBM}" + CC=m68k-amigaos-gcc \ + AR=m68k-amigaos-ar \ + CFLAGS="-noixemul" \ + RANLIB=m68k-amigaos-ranlib \ + "${SOURCES}/${LIBM}/configure" \ + --prefix="${PREFIX}" \ + --host="i686-linux-gnu" \ + --build="m68k-amigaos" + make && make install + popd + + touch "${STAMP}/build-libm" } function build_ixemul { [ -f "${STAMP}/build-ixemul" ] && return 0 pushd "${BUILD_DIR}" - rm -rf "${IXEMUL}" - mkdir -p "${IXEMUL}" + mkdir_empty "${IXEMUL}" cd "${IXEMUL}" CC=m68k-amigaos-gcc \ CFLAGS="-noixemul -I${PREFIX}/include" \ @@ -358,7 +378,7 @@ function build_ixemul { make MAKEINFO=: install popd - touch "${STAMP}/build-ixemul" + touch "${STAMP}/build-ixemul" } function build { @@ -393,6 +413,7 @@ function build { process_headers install_libamiga build_libnix + build_libm build_gpp build_ixemul }