--- c-boot.orig/v7/src/compiler/machines/C/ctop.scm 2007-01-20 15:12:16.000000000 -0500 +++ c-boot/v7/src/compiler/machines/C/ctop.scm 2007-01-20 18:42:03.000000000 -0500 @@ -216,7 +216,7 @@ USA. ("-shared") "cc" "ld") - ("NETBSD-x86-64" + ("NETBSD" "so" ("-g" "-O2" "-fPIC" "-c") ("-shared") --- c-boot.orig/v7/src/compiler/configure 2007-01-12 01:19:53.000000000 -0500 +++ c-boot/v7/src/compiler/configure 2007-01-20 20:52:36.000000000 -0500 @@ -26,19 +26,19 @@ MACHINE= while test $# -gt 0; do case "${1}" in - (--enable-native-code=c) + --enable-native-code=c) MACHINE=C shift ;; - (--enable-native-code) + --enable-native-code) MACHINE= shift ;; - (--disable-native-code | --enable-native-code=no) + --disable-native-code | --enable-native-code=no) MACHINE=none shift ;; - (*) + *) shift ;; esac @@ -46,28 +46,28 @@ done if test "x${MACHINE}" = x; then case `./config.guess` in - (alpha-* | alphaev[56]-* | alphaev56-* | alphapca56-*) + alpha-* | alphaev[56]-* | alphaev56-* | alphapca56-*) MACHINE=alpha ;; - (m68k-*) + m68k-*) MACHINE=bobcat ;; - (i[3456]86-*) + i[3456]86-*) MACHINE=i386 ;; - (mips-* | mipsel-*) + mips-* | mipsel-*) MACHINE=mips ;; - (sparc-*) + sparc-*) MACHINE=sparc ;; - (hppa-* | hppa1.[01]-* | hppa2.?-*) + hppa-* | hppa1.[01]-* | hppa2.?-*) MACHINE=spectrum ;; - (vax-*) + vax-*) MACHINE=vax ;; - (*) + *) MACHINE=none ;; esac --- c-boot.orig/v7/src/microcode/configure.ac 2007-01-19 23:48:24.000000000 -0500 +++ c-boot/v7/src/microcode/configure.ac 2007-01-21 02:38:50.000000000 -0500 @@ -696,18 +696,25 @@ fi dnl Decide whether we're using static or dynamic libraries. if test "${enable_static_libs}" = no; then - AC_CHECK_LIB([dl], [dlopen], - [ - AC_DEFINE([HAVE_LIBDL], [1], - [Define to 1 if you have the `dl' library (-ldl).]) - LIBS="${STATIC_LIBS} -ldl ${LIBS}" - STATIC_LIBS= - OPTIONAL_BASES="${OPTIONAL_BASES} pruxdld" - ], - [enable_static_libs=yes]) + AC_CHECK_LIB([c], [dlopen], + [ + LIBS="${STATIC_LIBS} ${LIBS}" + ], + [ + AC_CHECK_LIB([dl], [dlopen], + [ + AC_DEFINE([HAVE_LIBDL], [1], + [Define to 1 if you have the `dl' library (-ldl).]) + LIBS="${STATIC_LIBS} -ldl ${LIBS}" + ], + [enable_static_libs=yes]) + ]) fi if test ${enable_static_libs} != no; then STATIC_LIBS=${MODULE_LIBS}${STATIC_LIBS} +else + STATIC_LIBS= + OPTIONAL_BASES="${OPTIONAL_BASES} pruxdld" fi if test ${enable_valgrind_mode} != no; then @@ -735,6 +742,14 @@ case ${host_os} in linux-gnu) DO_GCC_TESTS=yes ;; +netbsd*) + DO_GCC_TESTS=yes + dnl NetBSD, by default, has programs find non-base libraries via RPATH + if test "x${x_libraries}" != x; then + FOO=-Wl,-rpath,`echo ${x_libraries} | sed -e "s/:/ -Wl,-rpath,/g"` + LIBS="${LIBS} ${FOO}" + fi + ;; freebsd*) M4_FLAGS="${M4_FLAGS} -P SUPPRESS_LEADING_UNDERSCORE,1" ;;