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.

139 lines
3.3KB

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