You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.7KB

  1. #!/bin/sh
  2. # default parameters
  3. prefix="/usr/local"
  4. cc="gcc"
  5. ar="ar"
  6. cpu=`uname -m`
  7. case "$cpu" in
  8. i386|i486|i586|i686)
  9. cpu="x86"
  10. mmx="yes"
  11. ;;
  12. *)
  13. mmx="no"
  14. ;;
  15. esac
  16. gprof="no"
  17. if [ "$1" = "-h" -o "$1" = "--help" ] ; then
  18. cat << EOF
  19. Usage: configure [options]
  20. Options: [defaults in brackets after descriptions]
  21. --help print this message
  22. EOF
  23. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  24. echo " --cc=CC use C compiler CC [$cc]"
  25. echo " --cpu=CPU force cpu to CPU [$cpu]"
  26. echo " --disable-mmx disable mmx usage"
  27. echo " --enable-gprof enable profiling with gprof [$gprof]"
  28. exit 1
  29. fi
  30. for opt do
  31. case "$opt" in
  32. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
  33. ;;
  34. --cc=*) cc=`echo $opt | cut -d '=' -f 2`
  35. ;;
  36. --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
  37. ;;
  38. --disable-mmx) mmx="no"
  39. ;;
  40. --enable-gprof) gprof="yes"
  41. ;;
  42. esac
  43. done
  44. echo "Install prefix $prefix"
  45. echo "C compiler $cc"
  46. echo "CPU $cpu"
  47. echo "MMX enabled $mmx"
  48. echo "gprof enabled $gprof"
  49. echo "Creating config.mk and config.h"
  50. echo "# Automatically generated by configure - do not modify" > config.mk
  51. echo "/* Automatically generated by configure - do not modify */" > config.h
  52. echo "PREFIX=$prefix" >> config.mk
  53. echo "CC=$cc" >> config.mk
  54. echo "AR=$ar" >> config.mk
  55. if [ "$cpu" = "x86" ] ; then
  56. echo "CONFIG_CPU_X86=y" >> config.mk
  57. echo "#define CONFIG_CPU_X86 1" >> config.h
  58. fi
  59. if [ "$mmx" = "yes" ] ; then
  60. echo "CONFIG_MMX=y" >> config.mk
  61. echo "#define CONFIG_MMX 1" >> config.h
  62. fi
  63. if [ "$gprof" = "yes" ] ; then
  64. echo "CONFIG_GPROF=y" >> config.mk
  65. echo "#define CONFIG_GPROF 1" >> config.h
  66. fi