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.

123 lines
2.9KB

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