$NetBSD: patch-ag,v 1.9 2017/06/22 20:48:04 tnn Exp $ --- Configure.orig 2015-07-07 20:17:04.000000000 +0000 +++ Configure @@ -3013,32 +3013,66 @@ return(0); } echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR" echo "!!!WARNING!!! Configuring for NetBSD 3.0" ;; + 4.0*) + LSOF_TSTBIGF=" " + LSOF_VERS="4000000" + ;; + 4.99.*) + LSOF_TSTBIGF=" " + LSOF_VERS="4099000" + ;; + 4*) + LSOF_VERS="4000000" + echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR" + echo "!!!WARNING!!! Configuring for NetBSD 4.0" + ;; + 5.[012]*) + LSOF_TSTBIGF=" " + LSOF_VERS="5000000" + ;; + 5.99.*) + LSOF_TSTBIGF=" " + LSOF_VERS="5099000" + ;; + 5*) + LSOF_VERS="5000000" + echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR" + echo "!!!WARNING!!! Configuring for NetBSD 5.0" + ;; + 6.[01]*) + LSOF_TSTBIGF=" " + LSOF_VERS="6000000" + ;; + 6.99.*) + LSOF_TSTBIGF=" " + LSOF_VERS="6099000" + ;; + 7.[01]*) + LSOF_TSTBIGF=" " + LSOF_VERS="7000000" + ;; + 7.99.*) + LSOF_TSTBIGF=" " + LSOF_VERS="7099000" + ;; + 8.99.*) + LSOF_TSTBIGF=" " + LSOF_VERS="8099000" + ;; *) echo "Unknown NetBSD release: $LSOF_VSTR" - echo Assuming NetBSD 1.6 - LSOF_VERS="1006000" + echo Assuming NetBSD 7.0 + LSOF_VERS="7000000" ;; esac # } fi # } - # Test for legal NetBSD version. - - case $LSOF_VERS in # { - 1002000|1003000|1004000|1005000|1006000) - ;; - 2000000|2099009|2099010) - ;; - 3000000|3099000) - ;; - *) - echo "Unknown NetBSD version: $LSOF_VERS" - rm -f $LSOF_HLP - exit 1 - ;; - esac # } LSOF_CFGF="$LSOF_CFGF -DNETBSDV=$LSOF_VERS" LSOF_TMP1="-DN_UNIXV=/netbsd" - if test -r ${LSOF_INCLUDE}/util.h # { + if test -r /dev/ksyms # { + then + LSOF_TMP1="-DN_UNIXV=/dev/ksyms" + elif test -r ${LSOF_INCLUDE}/util.h # { then grep -q getbootfile ${LSOF_INCLUDE}/util.h if test $? -eq 0 # { @@ -3437,6 +3471,7 @@ return(0); } fi # } LSOF_TMP2="sys/vnode.h" LSOF_NBSD_PTYFS=0 + LSOF_NBSD_TMPFS=0 if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { then LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" @@ -3514,7 +3549,25 @@ return(0); } fi # } fi # } fi # } - if test "X$NETBSD_UVM" = "X" # { + grep -q VT_TMPFS $LSOF_TMP3 + if test $? -eq 0 # { + then + LSOF_TMP2="fs/tmpfs/tmpfs.h" + if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then + LSOF_CFGF="$LSOF_CFGF -DHASTMPFS" + else + if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { + then + if test $NETBSD_SYS != $LSOF_INCLUDE # { + then + LSOF_CFGF="$LSOF_CFGF -DHASTMPFS" + LSOF_NBSD_TMPFS=1 + fi # } + fi # } + fi # } + fi # } + if test "X$NETBSD_UVM" = "X" # { then grep -q UVM $LSOF_TMP3 if test $? -ne 0 # { @@ -3799,6 +3852,28 @@ return(0); } LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include" fi # } fi # } + if test $LSOF_NBSD_TMPFS -eq 1 # { + then + + # Make a local copy of $NETBSD_SYS/sys/fs/tmpfs/tmpfs.h. + + if test ! -d dialects/n+obsd/include # { + then + mkdir dialects/n+obsd/include + fi # } + if test ! -d dialects/n+obsd/include/fs # { + then + mkdir dialects/n+obsd/include/fs + fi # } + rm -rf dialects/n+obsd/include/fs/tmpfs + mkdir dialects/n+obsd/include/fs/tmpfs + cp $NETBSD_SYS/fs/tmpfs/tmpfs.h dialects/n+obsd/include/fs/tmpfs + echo $LSOF_CFGF | grep /dialects/n+obsd/include > /dev/null 2>&1 + if test $? -ne 0 # { + then + LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include" + fi # } + fi # } LSOF_CFGL="$LSOF_CFGL -lkvm" LSOF_DIALECT_DIR=n+obsd ;; @@ -5535,7 +5610,7 @@ fi # } echo "" >> $LSOF_MKFC if test "X$LSOF_DEBUG" = "X" # { then - LSOF_DEBUG="-O" + LSOF_DEBUG="" else if test "X$LSOF_DEBUG" = "XNo-O" # { then