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.

77 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.mak and config.h"
  50. echo "# Automatically generated by configure - do not modify" > config.mak
  51. echo "/* Automatically generated by configure - do not modify */" > config.h
  52. echo "prefix=$prefix" >> config.mak
  53. echo "CC=$cc" >> config.mak
  54. echo "AR=$ar" >> config.mak
  55. echo "OPTFLAGS=-O2" >> config.mak
  56. if [ "$cpu" = "x86" ] ; then
  57. echo "TARGET_ARCH_X86=yes" >> config.mak
  58. echo "#define ARCH_X86 1" >> config.h
  59. fi
  60. if [ "$mmx" = "yes" ] ; then
  61. echo "TARGET_MMX=yes" >> config.mak
  62. echo "#define HAVE_MMX 1" >> config.h
  63. fi
  64. if [ "$gprof" = "yes" ] ; then
  65. echo "TARGET_GPROF=yes" >> config.mak
  66. echo "#define HAVE_GPROF 1" >> config.h
  67. fi