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.

104 lines
2.4KB

  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. mp3lib="yes"
  18. if [ "$1" = "-h" -o "$1" = "--help" ] ; then
  19. cat << EOF
  20. Usage: configure [options]
  21. Options: [defaults in brackets after descriptions]
  22. --help print this message
  23. EOF
  24. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  25. echo " --cc=CC use C compiler CC [$cc]"
  26. echo " --cpu=CPU force cpu to CPU [$cpu]"
  27. echo " --disable-mmx disable mmx usage"
  28. echo " --enable-gprof enable profiling with gprof [$gprof]"
  29. echo " --disable-mp3lib disable mp3 lib compiling"
  30. exit 1
  31. fi
  32. for opt do
  33. case "$opt" in
  34. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
  35. ;;
  36. --cc=*) cc=`echo $opt | cut -d '=' -f 2`
  37. ;;
  38. --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
  39. ;;
  40. --disable-mmx) mmx="no"
  41. ;;
  42. --enable-gprof) gprof="yes"
  43. ;;
  44. --disable-mp3lib) mp3lib="no"
  45. ;;
  46. esac
  47. done
  48. echo "Install prefix $prefix"
  49. echo "C compiler $cc"
  50. echo "CPU $cpu"
  51. echo "MMX enabled $mmx"
  52. echo "gprof enabled $gprof"
  53. echo "Creating config.mak and config.h"
  54. echo "# Automatically generated by configure - do not modify" > config.mak
  55. echo "/* Automatically generated by configure - do not modify */" > config.h
  56. # Checking for CFLAGS
  57. if test -z "$CFLAGS"; then
  58. CFLAGS="-O2"
  59. fi
  60. echo "prefix=$prefix" >> config.mak
  61. echo "CC=$cc" >> config.mak
  62. echo "AR=$ar" >> config.mak
  63. echo "OPTFLAGS=$CFLAGS" >> config.mak
  64. if [ "$cpu" = "x86" ] ; then
  65. echo "TARGET_ARCH_X86=yes" >> config.mak
  66. echo "#define ARCH_X86 1" >> config.h
  67. fi
  68. if [ "$mmx" = "yes" ] ; then
  69. echo "TARGET_MMX=yes" >> config.mak
  70. echo "#define HAVE_MMX 1" >> config.h
  71. fi
  72. if [ "$gprof" = "yes" ] ; then
  73. echo "TARGET_GPROF=yes" >> config.mak
  74. echo "#define HAVE_GPROF 1" >> config.h
  75. fi
  76. # if you do not want to use encoders, disable that.
  77. echo "#define CONFIG_ENCODERS 1" >> config.h
  78. echo "CONFIG_ENCODERS=yes" >> config.mak
  79. # if you do not want to use decoders, disable that.
  80. echo "#define CONFIG_DECODERS 1" >> config.h
  81. echo "CONFIG_DECODERS=yes" >> config.mak
  82. # special AC3 and MPGLIB enabling stuff in case you already have it
  83. # without libavcodec.
  84. echo "#define CONFIG_AC3 1" >> config.h
  85. echo "CONFIG_AC3=yes" >> config.mak
  86. if [ "$mp3lib" = "yes" ] ; then
  87. echo "#define CONFIG_MPGLIB 1" >> config.h
  88. echo "CONFIG_MPGLIB=yes" >> config.mak
  89. fi