Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Unnamed
Friday, March 30th, 2007 at 12:21:39pm UTC 

  1. #!/bin/sh
  2.  
  3. # configuration is being done in a script because starting with GCC-3.2
  4. # the compiler flags are changing too much between minor releases to detect
  5. # with Makefile scripts alone.  For now it just tells you if you have the
  6. # prerequisite compilers.
  7.  
  8. ERROR=0
  9.  
  10. # test for nasm
  11. OBJDIR=`arch`
  12. TOPDIR=`pwd`
  13.  
  14. if [ `arch` == i686 ];
  15. then
  16.  
  17.         if [ -x /usr/bin/nasm -o -x /usr/local/bin/nasm ]; then HAVE_NASM=y; else HAVE_NASM=n; fi
  18.  
  19.         if [ "$HAVE_NASM" == "n" ];
  20.         then echo " *** Nasm is required.  Download it from nasm.sourceforge.net";
  21.         ERROR=1
  22.         fi
  23.  
  24. fi
  25.  
  26. if [ -x /usr/bin/yasm -o -x /usr/local/bin/yasm ]; then HAVE_YASM=y; else HAVE_YASM=n; fi
  27.  
  28. if [ $HAVE_YASM == n ];
  29. then echo " *** Yasm is required.  Download it from www.tortall.net/projects/yasm/";
  30. ERROR=1
  31. fi
  32.  
  33.  
  34. # test for videodev2.h
  35.  
  36. rm -f a.out
  37. cat > conftest.c << EOF
  38. #include <asm/types.h>
  39. #include <sys/time.h>
  40. #include <linux/videodev2.h>
  41. int main()
  42. {
  43.         return 0;
  44. }
  45. EOF
  46.  
  47. gcc conftest.c >& /dev/null
  48.  
  49. if [ -x a.out ]; then HAVE_VIDEO4LINUX2=y; else HAVE_VIDEO4LINUX2=n; fi
  50.  
  51.  
  52. # test for dvb
  53.  
  54. rm -f a.out
  55. cat > conftest.c << EOF
  56. #include <linux/dvb/dmx.h>
  57. #include <linux/dvb/frontend.h>
  58. int main()
  59. {
  60.         return 0;
  61. }
  62. EOF
  63.  
  64. gcc conftest.c >& /dev/null
  65.  
  66. if [ -x a.out ]; then HAVE_DVB=y; else HAVE_DVB=n; fi
  67.  
  68. rm -f a.out conftest.c
  69.  
  70.  
  71.  
  72.  
  73. # test for -msse support
  74.  
  75. rm -f a.out
  76. cat > conftest.c << EOF
  77. int main()
  78. {
  79.         return 0;
  80. }
  81. EOF
  82.  
  83. gcc -msse conftest.c >& /dev/null
  84.  
  85. if [ -x a.out ]; then HAVE_GCC=y; else HAVE_GCC=n; fi
  86.  
  87. rm -f a.out conftest.c
  88.  
  89. if [ $HAVE_GCC == n ];
  90. then echo " *** GCC 3.2.2 or greater is required.  Download it from gcc.gnu.org";
  91. ERROR=1
  92. fi
  93.  
  94.  
  95.  
  96.  
  97. # test for OpenGL 2.0
  98.  
  99.  
  100. rm -f a.out
  101. cat > conftest.c << EOF
  102. #include <GL/gl.h>
  103. #include <GL/glext.h>
  104. #include <GL/glu.h>
  105. int main()
  106. {
  107.         glUseProgram(0);
  108.         return 0;
  109. }
  110. EOF
  111.  
  112. gcc conftest.c -lGL -lGLU >& /dev/null
  113.  
  114. if [ -x a.out ]; then HAVE_GL=y; else HAVE_GL=n; fi
  115.  
  116. rm -f a.out conftest.c
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. if [ $ERROR == 1 ];
  126. then echo "Giving up and going to a movie."
  127. exit 1
  128. fi
  129.  
  130.  
  131.  
  132.  
  133.  
  134. # fix libraries
  135. echo CONFIGURING QUICKTIME
  136. cd quicktime* && ./configure && cd ..
  137.  
  138. echo CONFIGURING LIBMPEG3
  139. cd libmpeg3* && ./configure && cd ..
  140.  
  141. echo CONFIGURING FFTW
  142. cd fftw* && CFLAGS=-fPIC ./configure && cd ..
  143.  
  144. echo CONFIGURING MJPEGTOOLS
  145. cd mjpegtools* && ./configure --enable-shared=no && cd ..
  146.  
  147.  
  148.  
  149. echo CONFIGURING SNDFILE
  150. cd libsndfile* && chmod a+x ./configure && ./configure && cd ..
  151.  
  152. echo CONFIGURING RAW1394
  153. cd libraw1394* && \
  154. ./configure --enable-shared=no && \
  155. ln -sf src libraw1394 && \
  156. cd ..
  157.  
  158. echo CONFIGURING AVC1394
  159. cd libavc1394* && \
  160. RAW1394_PATH=`expr $TOPDIR/libraw1394*` && \
  161. PKG_CONFIG_PATH=$RAW1394_PATH CFLAGS=-I$RAW1394_PATH/ LDFLAGS=-L$RAW1394_PATH/src/.libs ./configure --enable-shared=no && \
  162. cd ..
  163.  
  164. echo CONFIGURING IEC61883
  165. cd libiec61883* && \
  166. RAW1394_PATH=`expr $TOPDIR/libraw1394*` && \
  167. PKG_CONFIG_PATH=$RAW1394_PATH CFLAGS=-I$RAW1394_PATH/ LDFLAGS=-L$RAW1394_PATH/src/.libs ./configure --enable-shared=no && \
  168. cd ..
  169.  
  170. echo CONFIGURING THEORA
  171. LIBOGG_PATH=`expr $TOPDIR/quicktime/libogg*` && \
  172. LIBVORBIS_PATH=`expr $TOPDIR/quicktime/libvorbis*` && \
  173. cd libtheora* && \
  174. PKG_CONFIG_PATH=$LIBOGG_PATH:$LIBVORBIS_PATH CFLAGS="-I$LIBOGG_PATH/include -L$LIBOGG_PATH/src -I$LIBVORBIS_PATH/include -L$LIBVORBIS_PATH/lib" ./configure --enable-shared=no && \
  175. cd ..
  176.  
  177.  
  178.  
  179. # write configuration header
  180. echo "Writing hvirtual_config.h"
  181. cat > hvirtual_config.h << EOF
  182. // Configuration file made by configure.  Don't edit.
  183. EOF
  184.  
  185. if [ "$HAVE_VIDEO4LINUX2" == "y" ];
  186. then
  187.         echo "#define HAVE_VIDEO4LINUX2" >> hvirtual_config.h
  188.         echo "Have Video4Linux 2"
  189. else
  190.         echo "Don't have Video4Linux 2"
  191. fi
  192.  
  193. if [ "$HAVE_DVB" == "y" ];
  194. then
  195.         echo "#define HAVE_DVB" >> hvirtual_config.h
  196.         echo "Have DVB"
  197. else
  198.         echo "Don't have DVB"
  199. fi
  200.  
  201.  
  202. if [ "$HAVE_GL" == "y" ];
  203. then
  204. cat >> hvirtual_config.h << EOF
  205. #ifndef HAVE_GL
  206. #define HAVE_GL
  207. #endif
  208. EOF
  209.         echo "Have OpenGL 2.0"
  210. else
  211.         echo "Don't have OpenGL 2.0"
  212. fi
  213.  
  214.  
  215.  
  216.  
  217. # success
  218. if [ "$ERROR" == "0" ];
  219. then echo "Configured successfully.  Type 'make' to build it.";
  220. fi

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right