INSTALL 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Basic Dropbear build instructions:
  2. - Edit localoptions.h to set which features you want. Available options
  3. are described in default_options.h, these will be overridden by
  4. anything set in localoptions.h
  5. localoptions.h should be located in the build directory if you are
  6. building out of tree.
  7. - Configure for your system:
  8. ./configure (optionally with --disable-zlib or --disable-syslog,
  9. or --help for other options)
  10. (you'll need to first run "autoconf; autoheader" if you edit configure.ac)
  11. - Compile:
  12. make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
  13. - Optionally install, or copy the binaries another way
  14. make install (/usr/local/bin is usual default):
  15. or
  16. make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install
  17. (you can leave items out of the PROGRAMS list to avoid compiling them. If you
  18. recompile after changing the PROGRAMS list, you *MUST* "make clean" before
  19. recompiling - bad things will happen otherwise)
  20. DEVELOPING.md has some notes on other developer topics, including debugging.
  21. See MULTI for instructions on making all-in-one binaries.
  22. If you want to compile statically use ./configure --enable-static
  23. By default Dropbear adds various build flags that improve robustness
  24. against programming bugs (good for security). If these cause problems
  25. they can be disabled with ./configure --disable-harden
  26. Binaries can be stripped with "make strip"
  27. ============================================================================
  28. If you're compiling for a 386-class CPU, you will probably need to add
  29. CFLAGS=-DLTC_NO_BSWAP so that libtomcrypt doesn't use 486+ instructions.
  30. ============================================================================
  31. Compiling with uClibc:
  32. Firstly, make sure you have at least uclibc 0.9.17, as getusershell() in prior
  33. versions is broken. Also note that you may get strange issues if your uClibc
  34. headers don't match the library you are running with, ie the headers might
  35. say that shadow password support exists, but the libraries don't have it.
  36. Compiling for uClibc should be the same as normal, just set CC to the magic
  37. uClibc toolchain compiler (ie export CC=i386-uclibc-gcc or whatever).
  38. You can use "make STATIC=1" to make statically linked binaries, and it is
  39. advisable to strip the binaries too. If you're looking to make a small binary,
  40. you should remove unneeded ciphers and MD5, by editing localoptions.h
  41. It is possible to compile zlib in, by copying zlib.h and zconf.h into a
  42. subdirectory (ie zlibincludes), and
  43. export CFLAGS="-Izlibincludes -I../zlibincludes"
  44. export LDFLAGS=/usr/lib/libz.a
  45. before ./configure and make.
  46. If you disable zlib, you must explicitly disable compression for the client -
  47. OpenSSH is possibly buggy in this regard, it seems you need to disable it
  48. globally in ~/.ssh/config, not just in the host entry in that file.
  49. You may want to manually disable lastlog recording when using uClibc, configure
  50. with --disable-lastlog.
  51. One common problem is pty allocation. There are a number of types of pty
  52. allocation which can be used -- if they work properly, the end result is the
  53. same for each type. Running configure should detect the best type to use
  54. automatically, however for some systems, this may be incorrect. Some
  55. things to note:
  56. If your system expects /dev/pts to be mounted (this is a uClibc option),
  57. make sure that it is.
  58. Make sure that your libc headers match the library version you are using.
  59. If openpty() is being used (HAVE_OPENPTY defined in config.h) and it fails,
  60. you can try compiling with --disable-openpty. You will probably then need
  61. to create all the /dev/pty?? and /dev/tty?? devices, which can be
  62. problematic for devfs. In general, openpty() is the best way to allocate
  63. PTYs, so it's best to try and get it working.