2
0

configure 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. # -*- mode: sh -*-
  3. # Minimal configure script which writes out a Makefile.inc
  4. # Copyright 2010, 2011 Colin Walters <walters@verbum.org>
  5. # Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php)
  6. prefix=/usr
  7. datarootdir=${datarootdir:-${prefix}/share}
  8. blacklist=true
  9. for arg; do
  10. case "$arg" in
  11. --prefix=*) prefix=${arg#*=};;
  12. --bindir=*) bindir=${arg#*=};;
  13. --sbindir=*) sbindir=${arg#*=};;
  14. --libexecdir=*) libexecdir=${arg#*=};;
  15. --datarootdir=*) datarootdir=${arg#*=};;
  16. --datadir=*) datadir=${arg#*=};;
  17. --sysconfdir=*) sysconfdir=${arg#*=};;
  18. --libdir=*) libdir=${arg#*=};;
  19. --mandir=*) mandir=${arg#*=};;
  20. --disable-blacklist) blacklist=false;;
  21. *) echo "Ignoring unknown option '$arg'";;
  22. esac
  23. shift
  24. done
  25. # Handle srcdir != builddir
  26. srcdir=$(dirname $0)
  27. if ! test -f Makefile; then
  28. ln -s ${srcdir}/Makefile Makefile
  29. fi
  30. cat > Makefile.inc.tmp <<EOF
  31. srcdir = ${srcdir}
  32. prefix ?= ${prefix}
  33. bindir ?= ${bindir:-${prefix}/bin}
  34. sbindir ?= ${sbindir:-${prefix}/sbin}
  35. libexecdir ?= ${libexecdir:-${prefix}/libexec}
  36. datarootdir ?= ${datarootdir}
  37. datadir ?= ${datadir:-${datarootdir}}
  38. sysconfdir ?= ${sysconfdir:-${prefix}/etc}
  39. libdir ?= ${libdir:-${prefix}/lib}
  40. mandir ?= ${mandir:-${prefix}/share/man}
  41. blacklist ?= ${blacklist}
  42. EOF
  43. mv Makefile.inc.tmp Makefile.inc