[svn] / branches / release-1_3-branch / xvidcore / build / generic / configure.in Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/build/generic/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1382, Mon Mar 22 22:36:25 2004 UTC revision 1615, Tue May 17 15:55:24 2005 UTC
# Line 2  Line 2 
2  dnl  dnl
3  dnl Autoconf script for XviD  dnl Autoconf script for XviD
4  dnl  dnl
5  dnl Copyright(C) 2003 Edouard Gomez <ed.gomez@free.fr>  dnl Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>
6  dnl  dnl
7  dnl ==========================================================================  dnl ==========================================================================
8    
9  AC_INIT([XviD], [1.0.0 rc3], [xvid-devel@xvid.org])  AC_PREREQ([2.50])
10    
11    AC_INIT([XviD], [1.1.0-beta2], [xvid-devel@xvid.org])
12  AC_CONFIG_SRCDIR(configure.in)  AC_CONFIG_SRCDIR(configure.in)
13    
14  dnl Do not forget to increase that when needed.  dnl Do not forget to increase that when needed.
15  API_MAJOR="4"  API_MAJOR="4"
16  API_MINOR="0"  API_MINOR="1"
17    
18  dnl NASM version requirement  dnl NASM version requirement
19  minimum_nasm_patch_version=34  minimum_nasm_patch_version=34
20  nasm_prog="nasm"  nasm_prog="nasm"
21    yasm_prog="yasm"
22    
23  dnl Default CFLAGS -- Big impact on overall speed  dnl Default CFLAGS -- Big impact on overall speed
24  our_cflags_defaults="-Wall"  our_cflags_defaults="-Wall"
# Line 160  Line 163 
163            AC_MSG_RESULT(ia32)            AC_MSG_RESULT(ia32)
164                  ARCHITECTURE="IA32"                  ARCHITECTURE="IA32"
165                  ;;                  ;;
166              x86_64)
167                    AC_MSG_RESULT(x86_64)
168                    ARCHITECTURE="X86_64"
169                    ;;
170                  powerpc)                  powerpc)
171                  AC_MSG_RESULT(PowerPC)                  AC_MSG_RESULT(PowerPC)
172                  dnl ATM the ppc port is out of date                  ARCHITECTURE="PPC"
                 dnl ARCHITECTURE="PPC"  
                 ARCHITECTURE="GENERIC"  
173                  ;;                  ;;
174                  ia64)                  ia64)
175                  AC_MSG_RESULT(ia64)                  AC_MSG_RESULT(ia64)
# Line 325  Line 330 
330  dnl IA32  dnl IA32
331  dnl  dnl
332    
333  if test "$ARCHITECTURE" = "IA32" ; then  if test "$ARCHITECTURE" = "IA32" -o "$ARCHITECTURE" = "X86_64" ; then
334    
335     dnl     dnl
336     dnl Checking nasm existence     dnl Checking for nasm compatible programs
337       dnl yasm is preferred over nasm, because... i can use it
338       dnl to profile assembly code ;-)
339     dnl     dnl
340    
341       found_nasm_comp_prog="no"
342       chosen_asm_prog=""
343    
344       dnl Check for yasm first
345       AC_CHECK_PROG([ac_yasm], [$yasm_prog], [yes], [no], , [yes])
346       if test "$ac_yasm" = "yes" ; then
347         found_nasm_comp_prog="yes"
348         chosen_asm_prog="$yasm_prog"
349       fi
350    
351       dnl if yasm hasn't been found, then check for nasm (not buggy version)
352       if test "$found_nasm_comp_prog" = "no" -a "$ARCHITECTURE" != "X86_64" ; then
353     AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])     AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])
354     if test "$ac_nasm" = "yes" ; then     if test "$ac_nasm" = "yes" ; then
   
355        dnl        dnl
356        dnl Checking nasm patch version        dnl Checking nasm patch version
357        dnl        dnl
358        AC_MSG_CHECKING([for nasm patch version])        AC_MSG_CHECKING([for nasm patch version])
359        nasm_patch=`nasm -r | cut -d '.' -f 3 | cut -d ' ' -f 1`             nasm_patch=`$nasm_prog -r | cut -d '.' -f 3 | cut -d ' ' -f 1`
360        if test -z $nasm_patch ; then        if test -z $nasm_patch ; then
361          nasm_patch=-1          nasm_patch=-1
362        fi        fi
# Line 345  Line 364 
364    
365    
366        if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then        if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then
367          AC_MSG_WARN([nasm patch version too old - Compiling generic sources only])                 AC_MSG_WARN([nasm patch version is too old])
         ARCHITECTURE="GENERIC"  
368        else        else
369                   found_nasm_comp_prog="yes"
370                           chosen_asm_prog="$nasm_prog"
371               fi
372           fi
373       fi
374    
375           dnl           dnl
376           dnl Checking nasm format - win32 or elf     dnl Ok now sort what object format we must use
377           dnl           dnl
378           AC_MSG_CHECKING([for nasm object format])     if test "$found_nasm_comp_prog" = "yes" ; then
379           AC_MSG_CHECKING([for asm object format])
380           case "$target_os" in           case "$target_os" in
381                *bsd*|linux*|beos|irix*|solaris*)                *bsd*|linux*|beos|irix*|solaris*)
382                    AC_MSG_RESULT([elf])                    AC_MSG_RESULT([elf])
383                    NASM_FORMAT="elf"                    NASM_FORMAT="elf"
384                   MARK_FUNCS="-DMARK_FUNCS"
385                    PREFIX=""                    PREFIX=""
386                    ;;                    ;;
387                [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)                [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)
388                    AC_MSG_RESULT([win32])                    AC_MSG_RESULT([win32])
389                    NASM_FORMAT="win32"                    NASM_FORMAT="win32"
390                    PREFIX="-DPREFIX"                    PREFIX="-DPREFIX"
391                   MARK_FUNCS=""
392                    ;;                    ;;
393            esac            esac
394    
395            AS=nasm         AS="$chosen_asm_prog"
           AFLAGS="-I\$(<D)/ -f $NASM_FORMAT $PREFIX"  
396            ASSEMBLY_EXTENSION="asm"            ASSEMBLY_EXTENSION="asm"
397            ASSEMBLY_SOURCES="SRC_IA32"         AFLAGS="-I\$(<D)/ -f $NASM_FORMAT $PREFIX $MARK_FUNCS"
398           ASSEMBLY_SOURCES="SRC_${ARCHITECTURE}"
399           if test "$ARCHITECTURE" = "X86_64" ; then
400                   AFLAGS=${AFLAGS}" -m amd64"
401         fi         fi
   
402     else     else
403          AC_MSG_WARN([nasm not found - Compiling generic sources only])         AC_MSG_WARN([no correct assembler was found - Compiling generic sources only])
404          ARCHITECTURE="GENERIC"          ARCHITECTURE="GENERIC"
405     fi     fi
   
406  fi  fi
407    
408  dnl  dnl
409  dnl PPC  dnl PPC
410  dnl  dnl
411    dnl With the PPC platform we do not use assembly language, we better keep with
412    dnl intrinsic altivec functions and types as they are supported by both Apple
413    dnl and GNU gcc with very slight changes to code which can be sumed up by:
414    dnl
415    dnl Apple:
416    dnl  - compile with the option -faltivec
417    dnl  - define vectors with parentheses vec = (0,0,0,0)
418    dnl GNU
419    dnl  - compile with -maltivec -mabi=altivec
420    dnl  - include <altivec.h> before using intrincic
421    dnl  - define vectors with vec = {0,0,0,0}
422    dnl
423    dnl * The compile time option will be "injected" into SPECIFIC_CFLAGS variable
424    dnl * The need for altivec.h will also be injected into SPECIFIC_CFLAGS through
425    dnl   a -DHAVE_ALTIVEC_H
426    dnl * The vector definition is handled in portab.h thx to
427    dnl   HAVE_PARENTHESES/BRACES_ALTIVEC_DECL
428    dnl
429    PPC_ALTIVEC_SOURCES=""
430  if test "$ARCHITECTURE" = "PPC" ; then  if test "$ARCHITECTURE" = "PPC" ; then
431     AS="\$(CC)"     AS="\$(CC)"
432     AFLAGS="-c"     AFLAGS=""
433     ASSEMBLY_EXTENSION="s"     ASSEMBLY_EXTENSION=".s"
434     ASSEMBLY_SOURCES="SRC_PPC"     ASSEMBLY_SOURCES=""
435     AC_MSG_CHECKING([for Altivec support])  
436     cat > conftest.S << EOF     AC_MSG_CHECKING([for altivec.h])
437           .text  cat > conftest.c << EOF
438           vxor 0,0,0  #include <altivec.h>
439    int main() { return(0); }
440  EOF  EOF
441     if $CC -c conftest.S 2>/dev/null 1>/dev/null ; then     if $CC -faltivec -c conftest.c 2>/dev/null 1>/dev/null || \
442          $CC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then
443          AC_MSG_RESULT(yes)          AC_MSG_RESULT(yes)
444          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DARCH_IS_PPC_ALTIVEC"          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_H"
445          ASSEMBLY_SOURCES="SRC_ALTIVEC"          TEMP_ALTIVEC="-DHAVE_ALTIVEC_H"
446     else     else
447          AC_MSG_RESULT(no)          AC_MSG_RESULT(no)
448            TEMP_ALTIVEC=""
449     fi     fi
450    
451       AC_MSG_CHECKING([for Altivec compiler support])
452    cat > conftest.c << EOF
453    #ifdef HAVE_ALTIVEC_H
454    #include <altivec.h>
455    #endif
456    
457    int main()
458    {
459      vector unsigned int vartest2 = (vector unsigned int)(0);
460      vector unsigned int vartest3 = (vector unsigned int)(1);
461      vartest2 = vec_add(vartest2, vartest3);
462      return(0);
463    }
464    EOF
465       if $CC $TEMP_ALTIVEC -faltivec -c conftest.c 2>/dev/null 1>/dev/null ; then
466            AC_MSG_RESULT([yes (Apple)])
467            SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC"
468            PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"
469       else
470    cat > conftest.c << EOF
471    #ifdef HAVE_ALTIVEC_H
472    #include <altivec.h>
473    #endif
474    
475    int main()
476    {
477      vector unsigned int vartest2 = (vector unsigned int){0};
478      vector unsigned int vartest3 = (vector unsigned int){1};
479      vartest2 = vec_add(vartest2, vartest3);
480      return(0);
481    }
482    EOF
483       if $CC $TEMP_ALTIVEC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then
484            AC_MSG_RESULT([yes (GNU)])
485            SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -maltivec -mabi=altivec -DHAVE_ALTIVEC_BRACES_DECL $TEMP_ALTIVEC"
486            PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"
487       else
488            AC_MSG_RESULT([no (ppc support won't be compiled in)])
489            dnl Only C code can be compiled :-(
490            ARCHITECTURE="GENERIC"
491       fi
492       fi
493    
494     rm -f conftest.*     rm -f conftest.*
495  fi  fi
496    
# Line 439  Line 530 
530  AC_CHECK_HEADERS(  AC_CHECK_HEADERS(
531          stdio.h \          stdio.h \
532          signal.h \          signal.h \
533            stdlib.h \
534            string.h \
535            assert.h \
536            math.h \
537          , , AC_MSG_ERROR(Missing header file))          , , AC_MSG_ERROR(Missing header file))
538    
539  dnl ==========================================================================  dnl ==========================================================================
# Line 467  Line 562 
562  fi  fi
563    
564  dnl ==========================================================================  dnl ==========================================================================
565    dnl Some gcc flags can't be used for gcc >= 3.4.0
566    dnl ==========================================================================
567    
568    if test "$GCC" = "yes" ; then
569    cat << EOF > test.c
570    #include <stdio.h>
571    int main(int argc, char **argv)
572    {
573            if (*argv[[1]] == 'M') {
574                    printf("%d", __GNUC__);
575            }
576            if (*argv[[1]] == 'm') {
577                    printf("%d", __GNUC_MINOR__);
578            }
579            return 0;
580    }
581    EOF
582            $CC -o gcc-ver test.c
583    
584            GCC_MAJOR=`./gcc-ver M`
585            GCC_MINOR=`./gcc-ver m`
586    
587            rm -f test.c
588            rm -f gcc-ver
589    
590            # GCC 4.x
591            if test $GCC_MAJOR -gt 3 ; then
592                    CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
593                    CFLAGS=`echo $CFLAGS | sed s,'-freduce-all-givs','',g`
594                    CFLAGS=`echo $CFLAGS | sed s,'-fmove-all-movables','',g`
595                    CFLAGS=`echo $CFLAGS | sed s,'-fnew-ra','',g`
596                    CFLAGS=`echo $CFLAGS | sed s,'-fwritable-strings','',g`
597            fi
598    
599            # GCC 3.4.x
600            if test $GCC_MAJOR -eq 3 && $GCC_MINOR -gt 3 ; then
601                    CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
602            fi
603    fi
604    
605    
606    dnl ==========================================================================
607  dnl  dnl
608  dnl Substitions  dnl Substitions
609  dnl  dnl
# Line 490  Line 627 
627  AC_SUBST(SPECIFIC_LDFLAGS)  AC_SUBST(SPECIFIC_LDFLAGS)
628  AC_SUBST(SPECIFIC_CFLAGS)  AC_SUBST(SPECIFIC_CFLAGS)
629  AC_SUBST(DCT_IA64_SOURCES)  AC_SUBST(DCT_IA64_SOURCES)
630    AC_SUBST(PPC_ALTIVEC_SOURCES)
631  AC_SUBST(RANLIB)  AC_SUBST(RANLIB)
632  AC_SUBST(API_MAJOR)  AC_SUBST(API_MAJOR)
633  AC_SUBST(API_MINOR)  AC_SUBST(API_MINOR)

Legend:
Removed from v.1382  
changed lines
  Added in v.1615

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4