home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Utilities / vmount-0.6a-I / src / mklinks.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-12-19  |  902 b   |  36 lines

  1. #!/bin/sh
  2.  
  3. self=`which "$0"`
  4. name=`basename $0`
  5. mypath=`echo $self | sed "s/[/]$name\$//"`
  6. cd "$mypath"
  7. mypath=`pwd`
  8.  
  9. if [ -d Linux ]; then
  10.     linuxdir=Linux
  11. elif [ -d linux ]; then
  12.     linuxdir=linux
  13. else
  14.     echo "No linux directory found."
  15.     echo "Get the linux kernel source and install it in \"Linux\" or \"linux\""
  16.     exit 1
  17. fi
  18. echo "using linux directory \"$linuxdir\""
  19.  
  20. echo "Setting up links ..."
  21. rm -f include
  22. rm -f fs
  23. ln -s "$linuxdir/include" .
  24. ln -s "$linuxdir/fs" .
  25. rm -f fs/Makefile
  26. (cd "$linuxdir/fs"; ln -s ../../fs-Makefile Makefile)
  27.  
  28. echo "Generating autoconf.h in directory my_include/linux ..."
  29. rm -f autoconf.h
  30. echo '/* This file was generated by mklinks.sh from config.make. */' >autoconf.h
  31. echo '/* Do not modify it directly. */' >>autoconf.h
  32. echo >>autoconf.h
  33. awk '/^CONFIG.*/{printf("#define %s\t1\n", $1)}' config.make >>autoconf.h
  34. mv -f autoconf.h my_include/linux
  35.  
  36. echo "$name ready."