Mercurial > mplayer.hg
comparison configure @ 16803:f4501109e056
replace all the direct $TMPO calls by a tmp_run() function call
author | aurel |
---|---|
date | Tue, 18 Oct 2005 21:44:14 +0000 |
parents | a356a606bd66 |
children | a0a0ee2715ea |
comparison
equal
deleted
inserted
replaced
16802:a356a606bd66 | 16803:f4501109e056 |
---|---|
49 compile_check $TMPC $@ | 49 compile_check $TMPC $@ |
50 } | 50 } |
51 | 51 |
52 cxx_check() { | 52 cxx_check() { |
53 compile_check $TMPCPP $@ -lstdc++ | 53 compile_check $TMPCPP $@ -lstdc++ |
54 } | |
55 | |
56 tmp_run() { | |
57 "$TMPO" >> "$TMPLOG" 2>&1 | |
54 } | 58 } |
55 | 59 |
56 # Display error message, flushes tempfile, exit | 60 # Display error message, flushes tempfile, exit |
57 die () { | 61 die () { |
58 echo | 62 echo |
1329 signal(SIGILL, catch); | 1333 signal(SIGILL, catch); |
1330 __asm__ __volatile__ ("$3":::"memory");return(0); | 1334 __asm__ __volatile__ ("$3":::"memory");return(0); |
1331 } | 1335 } |
1332 EOF | 1336 EOF |
1333 | 1337 |
1334 if ( cc_check && $TMPO ) > /dev/null 2>&1 ; then | 1338 if cc_check && tmp_run ; then |
1335 echores "yes" | 1339 echores "yes" |
1336 _optimizing="$_optimizing $2" | 1340 _optimizing="$_optimizing $2" |
1337 return 0 | 1341 return 0 |
1338 else | 1342 else |
1339 echores "failed" | 1343 echores "failed" |
2778 EOF | 2782 EOF |
2779 _pthreads=no | 2783 _pthreads=no |
2780 if not hpux ; then | 2784 if not hpux ; then |
2781 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do | 2785 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do |
2782 # for crosscompilation, we cannot execute the program, be happy if we can link statically | 2786 # for crosscompilation, we cannot execute the program, be happy if we can link statically |
2783 cc_check $_ld_tmp && ($TMPO || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break | 2787 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break |
2784 done | 2788 done |
2785 fi | 2789 fi |
2786 fi | 2790 fi |
2787 if test "$_pthreads" = yes ; then | 2791 if test "$_pthreads" = yes ; then |
2788 echores "yes (using $_ld_pthread)" | 2792 echores "yes (using $_ld_pthread)" |
4092 printf("libpng: %s\n", png_libpng_ver); | 4096 printf("libpng: %s\n", png_libpng_ver); |
4093 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver)); | 4097 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver)); |
4094 } | 4098 } |
4095 EOF | 4099 EOF |
4096 if cc_check -lpng -lz $_ld_lm ; then | 4100 if cc_check -lpng -lz $_ld_lm ; then |
4097 if "$TMPO" >> "$TMPLOG" ; then | 4101 if tmp_run ; then |
4098 _png=yes | 4102 _png=yes |
4099 else | 4103 else |
4100 _res_comment="mismatch of library and header versions" | 4104 _res_comment="mismatch of library and header versions" |
4101 fi | 4105 fi |
4102 fi | 4106 fi |
4127 int main(void) { | 4131 int main(void) { |
4128 return 0; | 4132 return 0; |
4129 } | 4133 } |
4130 EOF | 4134 EOF |
4131 if cc_check -ljpeg $_ld_lm ; then | 4135 if cc_check -ljpeg $_ld_lm ; then |
4132 if "$TMPO" >> "$TMPLOG" ; then | 4136 if tmp_run ; then |
4133 _jpg=yes | 4137 _jpg=yes |
4134 fi | 4138 fi |
4135 fi | 4139 fi |
4136 fi | 4140 fi |
4137 echores "$_jpg" | 4141 echores "$_jpg" |
4192 int main(void) { | 4196 int main(void) { |
4193 return 0; | 4197 return 0; |
4194 } | 4198 } |
4195 EOF | 4199 EOF |
4196 for _ld_tmp in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do | 4200 for _ld_tmp in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do |
4197 cc_check $_ld_tmp && "$TMPO" >> "$TMPLOG" && _ld_gif="$_ld_tmp" && _gif=yes && break | 4201 cc_check $_ld_tmp && tmp_run && _ld_gif="$_ld_tmp" && _gif=yes && break |
4198 done | 4202 done |
4199 fi | 4203 fi |
4200 | 4204 |
4201 # If no library was found, and the user wants support forced, | 4205 # If no library was found, and the user wants support forced, |
4202 # then we force it on with libgif, as this is the safest | 4206 # then we force it on with libgif, as this is the safest |
4230 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst); | 4234 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst); |
4231 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib. | 4235 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib. |
4232 return 0; | 4236 return 0; |
4233 } | 4237 } |
4234 EOF | 4238 EOF |
4235 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then | 4239 if cc_check "$_ld_gif" && tmp_run ; then |
4236 _def_gif_4='#define HAVE_GIF_4 1' | 4240 _def_gif_4='#define HAVE_GIF_4 1' |
4237 _gif="yes" | 4241 _gif="yes" |
4238 fi | 4242 fi |
4239 else | 4243 else |
4240 _def_gif='#undef HAVE_GIF' | 4244 _def_gif='#undef HAVE_GIF' |
4256 GifFileType gif; | 4260 GifFileType gif; |
4257 printf("UserData is at address %p\n", gif.UserData); | 4261 printf("UserData is at address %p\n", gif.UserData); |
4258 return 0; | 4262 return 0; |
4259 } | 4263 } |
4260 EOF | 4264 EOF |
4261 if cc_check "$_ld_gif" && "$TMPO" >>"$TMPLOG" 2>&1 ; then | 4265 if cc_check "$_ld_gif" && tmp_run ; then |
4262 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK' | 4266 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK' |
4263 echores "disabled" | 4267 echores "disabled" |
4264 else | 4268 else |
4265 echores "enabled" | 4269 echores "enabled" |
4266 fi | 4270 fi |
4570 | 4574 |
4571 cat > $TMPC << EOF | 4575 cat > $TMPC << EOF |
4572 #include <artsc.h> | 4576 #include <artsc.h> |
4573 int main(void) { return 0; } | 4577 int main(void) { return 0; } |
4574 EOF | 4578 EOF |
4575 cc_check `artsc-config --libs` `artsc-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _arts=yes | 4579 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes |
4576 | 4580 |
4577 fi | 4581 fi |
4578 fi | 4582 fi |
4579 | 4583 |
4580 if test "$_arts" = yes ; then | 4584 if test "$_arts" = yes ; then |
4596 | 4600 |
4597 cat > $TMPC << EOF | 4601 cat > $TMPC << EOF |
4598 #include <esd.h> | 4602 #include <esd.h> |
4599 int main(void) { return 0; } | 4603 int main(void) { return 0; } |
4600 EOF | 4604 EOF |
4601 cc_check `esd-config --libs` `esd-config --cflags` && "$TMPO" >> "$TMPLOG" 2>&1 && _esd=yes | 4605 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes |
4602 | 4606 |
4603 fi | 4607 fi |
4604 fi | 4608 fi |
4605 echores "$_esd" | 4609 echores "$_esd" |
4606 | 4610 |
4633 #include <polyp/polyplib.h> | 4637 #include <polyp/polyplib.h> |
4634 #include <polyp/mainloop.h> | 4638 #include <polyp/mainloop.h> |
4635 #include <polyp/polyplib-error.h> | 4639 #include <polyp/polyplib-error.h> |
4636 int main(void) { return 0; } | 4640 int main(void) { return 0; } |
4637 EOF | 4641 EOF |
4638 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && "$TMPO" >> "$TMPLOG" 2>&1 && _polyp=yes | 4642 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes |
4639 | 4643 |
4640 fi | 4644 fi |
4641 fi | 4645 fi |
4642 echores "$_polyp" | 4646 echores "$_polyp" |
4643 | 4647 |
5052 } | 5056 } |
5053 return 0; | 5057 return 0; |
5054 } | 5058 } |
5055 EOF | 5059 EOF |
5056 _freetype=no | 5060 _freetype=no |
5057 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && $TMPO >> "$TMPLOG" && _freetype=yes | 5061 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes |
5058 else | 5062 else |
5059 _freetype=no | 5063 _freetype=no |
5060 fi | 5064 fi |
5061 fi | 5065 fi |
5062 if test "$_freetype" = yes ; then | 5066 if test "$_freetype" = yes ; then |
5121 } | 5125 } |
5122 return 0; | 5126 return 0; |
5123 } | 5127 } |
5124 EOF | 5128 EOF |
5125 _fribidi=no | 5129 _fribidi=no |
5126 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && $TMPO >> "$TMPLOG" && _fribidi=yes | 5130 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes |
5127 else | 5131 else |
5128 _fribidi=no | 5132 _fribidi=no |
5129 fi | 5133 fi |
5130 fi | 5134 fi |
5131 if test "$_fribidi" = yes ; then | 5135 if test "$_fribidi" = yes ; then |
5639 public: int myreturn(void); | 5643 public: int myreturn(void); |
5640 }; | 5644 }; |
5641 int myclass::myreturn(void) { ret = 0; return ret ; } | 5645 int myclass::myreturn(void) { ret = 0; return ret ; } |
5642 int main(void) { myclass myobject; return myobject.myreturn(); } | 5646 int main(void) { myclass myobject; return myobject.myreturn(); } |
5643 EOF | 5647 EOF |
5644 if cxx_check && "$TMPO" >> "$TMPLOG" 2>&1 ; then | 5648 if cxx_check && tmp_run ; then |
5645 _dshow=yes | 5649 _dshow=yes |
5646 echores "yes (C++ is ok)" | 5650 echores "yes (C++ is ok)" |
5647 else | 5651 else |
5648 echores "no" | 5652 echores "no" |
5649 cat << EOF | 5653 cat << EOF |
6186 cat > $TMPC <<EOF | 6190 cat > $TMPC <<EOF |
6187 #include <lame/lame.h> | 6191 #include <lame/lame.h> |
6188 int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor); return 0; } | 6192 int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor); return 0; } |
6189 EOF | 6193 EOF |
6190 # Note: libmp3lame usually depends on vorbis | 6194 # Note: libmp3lame usually depends on vorbis |
6191 cc_check -lmp3lame $_ld_vorbis $_ld_lm && "$TMPO" >> "$TMPLOG" 2>&1 && _mp3lame=yes | 6195 cc_check -lmp3lame $_ld_vorbis $_ld_lm && tmp_run && _mp3lame=yes |
6192 if test "$_mp3lame" = yes ; then | 6196 if test "$_mp3lame" = yes ; then |
6193 _def_mp3lame="#define HAVE_MP3LAME" | 6197 _def_mp3lame="#define HAVE_MP3LAME" |
6194 _ld_mp3lame="-lmp3lame $_ld_vorbis" | 6198 _ld_mp3lame="-lmp3lame $_ld_vorbis" |
6195 cat > $TMPC << EOF | 6199 cat > $TMPC << EOF |
6196 #include <lame/lame.h> | 6200 #include <lame/lame.h> |