comparison configure @ 28668:838f5706f17e

configure: Make the special dvdnav test the last one again The libdvdnav linker flag handling is hacky and can add flags that make any compile attempt using them fail unless MPlayer's internal dvdread has been compiled and is linked as a part of the resulting binary. For this reason no more tests using the common flags can be performed after the flags from the dvdnav test have been added. However the dvdnav test was no longer the last one despite some warning comments. Move it back to the last position and make the warnings a bit more explicit.
author uau
date Mon, 23 Feb 2009 01:39:27 +0000
parents 68542628747d
children 1f76d86e49ae
comparison
equal deleted inserted replaced
28667:8363a6c42ace 28668:838f5706f17e
7871 def_maemo='#undef CONFIG_MAEMO' 7871 def_maemo='#undef CONFIG_MAEMO'
7872 fi 7872 fi
7873 echores "$_maemo" 7873 echores "$_maemo"
7874 fi 7874 fi
7875 7875
7876 #this must be the last test to be performed or the ones following it will likely fail 7876 #############################################################################
7877 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer 7877
7878 # to use its own copy of the library) 7878 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7879 # the OMF format needs to come after the 'extern symbol prefix' check, which
7880 # uses nm.
7881 if os2 ; then
7882 _ld_extra="$_ld_extra -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7883 fi
7884
7885 # linker paths should be the same for mencoder and mplayer
7886 _ld_tmp=""
7887 for I in $_libs_mplayer ; do
7888 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7889 if test -z "$_tmp" ; then
7890 _ld_extra="$_ld_extra $I"
7891 else
7892 _ld_tmp="$_ld_tmp $I"
7893 fi
7894 done
7895 _libs_mplayer=$_ld_tmp
7896
7897
7898 #############################################################################
7899 if darwin ; then
7900 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7901 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7902 CFLAGS="$CFLAGS -no-cpp-precomp"
7903 fi
7904 fi
7905 if amigaos ; then
7906 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7907 fi
7908 # Thread support
7909 if linux ; then
7910 CFLAGS="$CFLAGS -D_REENTRANT"
7911 elif freebsd || netbsd || openbsd || bsdos ; then
7912 # FIXME bsd needs this so maybe other OS'es
7913 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7914 fi
7915 # 64 bit file offsets?
7916 if test "$_largefiles" = yes || freebsd ; then
7917 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7918 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7919 # dvdread support requires this (for off64_t)
7920 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7921 fi
7922 fi
7923
7924 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7925
7926 cat > $TMPC << EOF
7927 int main(void) { return 0; }
7928 EOF
7929 if test "$cc_vendor" = "gnu" ; then
7930 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
7931 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7932 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7933 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7934 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
7935 else
7936 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
7937 fi
7938
7939 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
7940
7941 # This must be the last test to be performed. Any other tests following it
7942 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7943 # against libdvdread (to permit MPlayer to use its own copy of the library).
7944 # So any compilation using the flags added here but not linking against
7945 # libdvdread can fail.
7879 echocheck "DVD support (libdvdnav)" 7946 echocheck "DVD support (libdvdnav)"
7880 dvdnav_internal=no 7947 dvdnav_internal=no
7881 if test "$_dvdnav" = auto ; then 7948 if test "$_dvdnav" = auto ; then
7882 if test "$_dvdread_internal" = yes ; then 7949 if test "$_dvdread_internal" = yes ; then
7883 _dvdnav=yes 7950 _dvdnav=yes
7913 def_dvdnav='#undef CONFIG_DVDNAV' 7980 def_dvdnav='#undef CONFIG_DVDNAV'
7914 _noinputmodules="dvdnav $_noinputmodules" 7981 _noinputmodules="dvdnav $_noinputmodules"
7915 fi 7982 fi
7916 echores "$_dvdnav" 7983 echores "$_dvdnav"
7917 7984
7918 7985 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7919 ############################################################################# 7986 # Read dvdnav comment above.
7920
7921 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7922 # the OMF format needs to come after the 'extern symbol prefix' check, which
7923 # uses nm.
7924 if os2 ; then
7925 _ld_extra="$_ld_extra -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7926 fi
7927
7928 # linker paths should be the same for mencoder and mplayer
7929 _ld_tmp=""
7930 for I in $_libs_mplayer ; do
7931 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7932 if test -z "$_tmp" ; then
7933 _ld_extra="$_ld_extra $I"
7934 else
7935 _ld_tmp="$_ld_tmp $I"
7936 fi
7937 done
7938 _libs_mplayer=$_ld_tmp
7939
7940
7941 #############################################################################
7942 if darwin ; then
7943 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7944 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7945 CFLAGS="$CFLAGS -no-cpp-precomp"
7946 fi
7947 fi
7948 if amigaos ; then
7949 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7950 fi
7951 # Thread support
7952 if linux ; then
7953 CFLAGS="$CFLAGS -D_REENTRANT"
7954 elif freebsd || netbsd || openbsd || bsdos ; then
7955 # FIXME bsd needs this so maybe other OS'es
7956 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7957 fi
7958 # 64 bit file offsets?
7959 if test "$_largefiles" = yes || freebsd ; then
7960 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7961 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7962 # dvdread support requires this (for off64_t)
7963 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7964 fi
7965 fi
7966
7967 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7968
7969 cat > $TMPC << EOF
7970 int main(void) { return 0; }
7971 EOF
7972 if test "$cc_vendor" = "gnu" ; then
7973 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
7974 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7975 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7976 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7977 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
7978 else
7979 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
7980 fi
7981
7982 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
7983 7987
7984 ############################################################################# 7988 #############################################################################
7985 echo "Creating config.mak" 7989 echo "Creating config.mak"
7986 cat > config.mak << EOF 7990 cat > config.mak << EOF
7987 # -------- Generated by configure ----------- 7991 # -------- Generated by configure -----------