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.

99 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. 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. # Checking for CFLAGS
  53. if test -z "$CFLAGS"; then
  54. CFLAGS="-O2"
  55. fi
  56. echo "prefix=$prefix" >> config.mak
  57. echo "CC=$cc" >> config.mak
  58. echo "AR=$ar" >> config.mak
  59. echo "OPTFLAGS=$CFLAGS" >> config.mak
  60. if [ "$cpu" = "x86" ] ; then
  61. echo "TARGET_ARCH_X86=yes" >> config.mak
  62. echo "#define ARCH_X86 1" >> config.h
  63. fi
  64. if [ "$mmx" = "yes" ] ; then
  65. echo "TARGET_MMX=yes" >> config.mak
  66. echo "#define HAVE_MMX 1" >> config.h
  67. fi
  68. if [ "$gprof" = "yes" ] ; then
  69. echo "TARGET_GPROF=yes" >> config.mak
  70. echo "#define HAVE_GPROF 1" >> config.h
  71. fi
  72. echo "#define BIN_PORTABILITY 1 /*undefine it if you want to get maximal performance*/" >> config.h
  73. # if you do not want to use encoders, disable that.
  74. echo "#define CONFIG_ENCODERS 1" >> config.h
  75. echo "CONFIG_ENCODERS=yes" >> config.mak
  76. # if you do not want to use decoders, disable that.
  77. echo "#define CONFIG_DECODERS 1" >> config.h
  78. echo "CONFIG_DECODERS=yes" >> config.mak
  79. # special AC3 and MPGLIB enabling stuff in case you already have it
  80. # without libavcodec.
  81. echo "#define CONFIG_AC3 1" >> config.h
  82. echo "CONFIG_AC3=yes" >> config.mak
  83. echo "#define CONFIG_MPGLIB 1" >> config.h
  84. echo "CONFIG_MPGLIB=yes" >> config.mak