configure 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/sh
  2. # Note: future version will have a syntax something like
  3. # ./configure [OPTIONS]
  4. # Where OPTIONS is any of:
  5. # --help
  6. # --codes CODE1 ...
  7. # --sizes SIZE1 ...
  8. # --jargons JARGON1 ...
  9. # --extras EXTRA1 ...
  10. # --vars VAR1=VAL1 ...
  11. # which is why I warn when --vars is not used before VAR1=VAL1
  12. # Avoid depending upon Character Ranges.
  13. # Taken from autoconf 2.50
  14. cr_az='abcdefghijklmnopqrstuvwxyz'
  15. cr_AZ='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  16. cr_09='0123456789'
  17. cr_alnum=$cr_az$cr_AZ$cr_09
  18. # also taken form autoconf
  19. case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  20. *c*,-n*) ECHO_N= ECHO_C='
  21. ' ECHO_T=' ' ;;
  22. *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  23. *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
  24. esac
  25. mode=none
  26. for option
  27. do
  28. case $option in
  29. --vars)
  30. mode=vars
  31. ;;
  32. *=*)
  33. if test $mode != vars; then
  34. echo "Warning: future versions will require --vars before variables are set"
  35. mode=vars
  36. fi
  37. # Taken from autoconf 2.50
  38. envvar=`expr "x$option" : 'x\([^=]*\)='`
  39. # Reject names that are not valid shell variable names.
  40. expr "x$envvar" : ".*[^_$cr_alnum]" >/dev/null &&
  41. { echo "$as_me: error: invalid variable name: $envvar" >&2
  42. { (exit 1); exit 1; }; }
  43. optarg=`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`
  44. eval "$envvar='$optarg'"
  45. export $envvar
  46. ;;
  47. --help)
  48. echo "Usage: ./configure [--help | --vars VAR1=VAL1 ...]"
  49. echo " Note: Variables may also be set in the environment brefore running config"
  50. echo " Useful vars: ASPELL ASPELL_PARMS WORD_LIST_COMPRESS DESTDIR"
  51. exit 0
  52. ;;
  53. *)
  54. echo "Error: unrecognized option $option";
  55. exit 1
  56. ;;
  57. esac
  58. done
  59. if test x = "x$ASPELL"
  60. then ASPELL=aspell; fi
  61. if test x = "x$WORD_LIST_COMPRESS"
  62. then WORD_LIST_COMPRESS=word-list-compress; fi
  63. echo $ECHO_N "Finding Dictionary file location ... $ECHO_C"
  64. dictdir=`$ASPELL dump config dict-dir`
  65. echo $dictdir
  66. echo $ECHO_N "Finding Data file location ... $ECHO_C"
  67. datadir=`$ASPELL dump config data-dir`
  68. echo $datadir
  69. echo "ASPELL = $ASPELL" > Makefile
  70. echo "ASPELL_FLAGS = $ASPELL_FLAGS" >> Makefile
  71. echo "WORD_LIST_COMPRESS = $WORD_LIST_COMPRESS" >> Makefile
  72. echo "DESTDIR = $DESTDIR" >> Makefile
  73. echo "dictdir = $dictdir" >> Makefile
  74. echo "datadir = $datadir" >> Makefile
  75. echo >> Makefile
  76. cat Makefile.pre >> Makefile