[svn] / trunk / xvidcore / build / generic / configure.in Repository:
ViewVC logotype

Diff of /trunk/xvidcore/build/generic/configure.in

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

revision 1536, Sun Aug 22 13:16:03 2004 UTC revision 1847, Fri Dec 5 10:18:52 2008 UTC
# Line 1  Line 1 
1  dnl ==========================================================================  dnl ==========================================================================
2  dnl  dnl
3  dnl Autoconf script for XviD  dnl Autoconf script for Xvid
4  dnl  dnl
5  dnl Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>  dnl Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>
6  dnl  dnl
# Line 8  Line 8 
8    
9  AC_PREREQ([2.50])  AC_PREREQ([2.50])
10    
11  AC_INIT([XviD], [1.1.0-alpha], [xvid-devel@xvid.org])  AC_INIT([Xvid], [1.3.0], [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="1"  API_MINOR="3"
17    
18  dnl NASM version requirement  dnl NASM/YASM version requirement
19  minimum_nasm_patch_version=34  minimum_yasm_minor_version=7
20    minimum_nasm_minor_version=0
21    minimum_nasm_major_version=2
22  nasm_prog="nasm"  nasm_prog="nasm"
23  yasm_prog="yasm"  yasm_prog="yasm"
24    
# Line 25  Line 27 
27  our_cflags_defaults="$our_cflags_defaults -O2"  our_cflags_defaults="$our_cflags_defaults -O2"
28  our_cflags_defaults="$our_cflags_defaults -fstrength-reduce"  our_cflags_defaults="$our_cflags_defaults -fstrength-reduce"
29  our_cflags_defaults="$our_cflags_defaults -finline-functions"  our_cflags_defaults="$our_cflags_defaults -finline-functions"
 our_cflags_defaults="$our_cflags_defaults -freduce-all-givs"  
30  our_cflags_defaults="$our_cflags_defaults -ffast-math"  our_cflags_defaults="$our_cflags_defaults -ffast-math"
31  our_cflags_defaults="$our_cflags_defaults -fomit-frame-pointer"  our_cflags_defaults="$our_cflags_defaults -fomit-frame-pointer"
32    
# Line 163  Line 164 
164            AC_MSG_RESULT(ia32)            AC_MSG_RESULT(ia32)
165                  ARCHITECTURE="IA32"                  ARCHITECTURE="IA32"
166                  ;;                  ;;
167              x86_64)
168                    AC_MSG_RESULT(x86_64)
169                    ARCHITECTURE="X86_64"
170                    ;;
171                  powerpc)                  powerpc)
172                  AC_MSG_RESULT(PowerPC)                  AC_MSG_RESULT(PowerPC)
173                  ARCHITECTURE="PPC"                  ARCHITECTURE="PPC"
# Line 195  Line 200 
200          BUS="64BIT"          BUS="64BIT"
201          ;;          ;;
202       *)       *)
203          AC_MSG_ERROR([XviD supports only 32/64 bit architectures])          AC_MSG_ERROR([Xvid supports only 32/64 bit architectures])
204          ;;          ;;
205  esac  esac
206    
# Line 261  Line 266 
266  SPECIFIC_CFLAGS=""  SPECIFIC_CFLAGS=""
267  PRE_SHARED_LIB=""  PRE_SHARED_LIB=""
268  case "$target_os" in  case "$target_os" in
269       *bsd*|linux*|irix*|solaris*)       linux*|solaris*)
270            AC_MSG_RESULT([ok])
271            STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
272            SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"
273            SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -Wl,--version-script=libxvidcore.ld -lc -lm"
274            SPECIFIC_CFLAGS="-fPIC"
275            ;;
276         *bsd*|irix*)
277          AC_MSG_RESULT([ok])          AC_MSG_RESULT([ok])
278          STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"          STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
279          SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"          SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"
# Line 326  Line 338 
338  dnl IA32  dnl IA32
339  dnl  dnl
340    
341  if test "$ARCHITECTURE" = "IA32" ; then  if test "$ARCHITECTURE" = "IA32" -o "$ARCHITECTURE" = "X86_64" ; then
342    
343     dnl     dnl
344     dnl Checking for nasm compatible programs     dnl Checking for nasm compatible programs
    dnl yasm is preferred over nasm, because... i can use it  
    dnl to profile assembly code ;-)  
345     dnl     dnl
346    
347     found_nasm_comp_prog="no"     found_nasm_comp_prog="no"
# Line 340  Line 350 
350     dnl Check for yasm first     dnl Check for yasm first
351     AC_CHECK_PROG([ac_yasm], [$yasm_prog], [yes], [no], , [yes])     AC_CHECK_PROG([ac_yasm], [$yasm_prog], [yes], [no], , [yes])
352     if test "$ac_yasm" = "yes" ; then     if test "$ac_yasm" = "yes" ; then
353           dnl
354           dnl Checking yasm version
355           dnl
356           AC_MSG_CHECKING([for yasm version])
357           yasm_minor=`$yasm_prog --version | cut -d '.' -f 2 | cut -d ' ' -f 1`
358           if test -z $yasm_minor ; then
359              yasm_minor=-1
360           fi
361           AC_MSG_RESULT([$yasm_minor])
362    
363           dnl Actually, yasm >= 0.6.2 should be ok
364           dnl But I'm too lazy to check also the patch version...
365           if test "$yasm_minor" -lt "$minimum_yasm_minor_version" ; then
366             AC_MSG_WARN([yasm version is too old])
367           else
368       found_nasm_comp_prog="yes"       found_nasm_comp_prog="yes"
369       chosen_asm_prog="$yasm_prog"       chosen_asm_prog="$yasm_prog"
370     fi     fi
371       fi
372    
373     dnl if yasm hasn't been found, then check for nasm (not buggy version)     dnl Check for nasm (not buggy version)
374     if test "$found_nasm_comp_prog" = "no" ; then     if test "$found_nasm_comp_prog" = "no" ; then
375         AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])         AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])
376         if test "$ac_nasm" = "yes" ; then         if test "$ac_nasm" = "yes" ; then
377             dnl             dnl
378             dnl Checking nasm patch version             dnl Checking nasm version
379             dnl             dnl
380             AC_MSG_CHECKING([for nasm patch version])             AC_MSG_CHECKING([for nasm version])
381             nasm_patch=`$nasm_prog -r | cut -d '.' -f 3 | cut -d ' ' -f 1`             nasm_minor=`$nasm_prog -v | cut -d '.' -f 2 | cut -d ' ' -f 1`
382             if test -z $nasm_patch ; then             nasm_major=`$nasm_prog -v | cut -d '.' -f 1 | cut -d ' ' -f 3`
383                nasm_patch=-1             if test -z $nasm_minor ; then
384             fi                nasm_minor=-1
385             AC_MSG_RESULT([$nasm_patch])             fi
386               if test -z $nasm_major ; then
387                  nasm_major=-1
388             if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then             fi
389                 AC_MSG_WARN([nasm patch version is too old])             AC_MSG_RESULT([$nasm_major])
390    
391               dnl need nasm 2.x for SSE3/4 and X86_64
392               if test "$nasm_major" -lt "$minimum_nasm_major_version" ; then
393                 AC_MSG_WARN([nasm version is too old])
394             else             else
395                 found_nasm_comp_prog="yes"                 found_nasm_comp_prog="yes"
396                         chosen_asm_prog="$nasm_prog"                         chosen_asm_prog="$nasm_prog"
# Line 375  Line 405 
405         AC_MSG_CHECKING([for asm object format])         AC_MSG_CHECKING([for asm object format])
406         case "$target_os" in         case "$target_os" in
407             *bsd*|linux*|beos|irix*|solaris*)             *bsd*|linux*|beos|irix*|solaris*)
408                   if test "$ARCHITECTURE" = "X86_64" ; then
409                       AC_MSG_RESULT([elf64])
410                       NASM_FORMAT="elf64"
411                   else
412                 AC_MSG_RESULT([elf])                 AC_MSG_RESULT([elf])
413                 NASM_FORMAT="elf"                 NASM_FORMAT="elf"
414                   fi
415                 MARK_FUNCS="-DMARK_FUNCS"                 MARK_FUNCS="-DMARK_FUNCS"
416                     PREFIX=""                     PREFIX=""
417                 ;;                 ;;
418             [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)             [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)
419                   if test "$ARCHITECTURE" = "X86_64" ; then
420                       AC_MSG_RESULT([win64])
421                       NASM_FORMAT="win64"
422                   else
423                 AC_MSG_RESULT([win32])                 AC_MSG_RESULT([win32])
424                 NASM_FORMAT="win32"                 NASM_FORMAT="win32"
425                   fi
426                   PREFIX="-DWINDOWS"
427                   MARK_FUNCS=""
428                   ;;
429               *darwin*)
430                   AC_MSG_RESULT([macho])
431                   NASM_FORMAT="macho"
432                 PREFIX="-DPREFIX"                 PREFIX="-DPREFIX"
433                 MARK_FUNCS=""                 MARK_FUNCS=""
434                 ;;                 ;;
435         esac         esac
436    
437         AS="$chosen_asm_prog"         AS="$chosen_asm_prog"
        AFLAGS="-I\$(<D)/ -f $NASM_FORMAT $PREFIX $MARK_FUNCS"  
438         ASSEMBLY_EXTENSION="asm"         ASSEMBLY_EXTENSION="asm"
439         ASSEMBLY_SOURCES="SRC_IA32"         AFLAGS="-I\$(<D)/ -I../../src/ -f $NASM_FORMAT $PREFIX $MARK_FUNCS"
440           ASSEMBLY_SOURCES="SRC_${ARCHITECTURE}"
441           if test "$ARCHITECTURE" = "X86_64" ; then
442                   AFLAGS=${AFLAGS}" -DARCH_IS_X86_64"
443           fi
444     else     else
445         AC_MSG_WARN([no correct assembler was found - Compiling generic sources only])         AC_MSG_WARN([no correct assembler was found - Compiling generic sources only])
446         ARCHITECTURE="GENERIC"         ARCHITECTURE="GENERIC"
# Line 406  Line 455 
455  dnl and GNU gcc with very slight changes to code which can be sumed up by:  dnl and GNU gcc with very slight changes to code which can be sumed up by:
456  dnl  dnl
457  dnl Apple:  dnl Apple:
458  dnl  - compile with the option -faltivec  dnl  - compile with the option -arch ppc -faltivec
459  dnl  - define vectors with parentheses vec = (0,0,0,0)  dnl  - define vectors with parentheses vec = (0,0,0,0)
460  dnl GNU  dnl GNU
461  dnl  - compile with -maltivec -mabi=altivec  dnl  - compile with -maltivec -mabi=altivec
# Line 431  Line 480 
480  #include <altivec.h>  #include <altivec.h>
481  int main() { return(0); }  int main() { return(0); }
482  EOF  EOF
483     if $CC -faltivec -c conftest.c 2>/dev/null 1>/dev/null || \     if $CC -arch ppc -faltivec -c conftest.c 2>/dev/null 1>/dev/null || \
484        $CC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then        $CC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then
485          AC_MSG_RESULT(yes)          AC_MSG_RESULT(yes)
486          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_H"          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_H"
# Line 455  Line 504 
504    return(0);    return(0);
505  }  }
506  EOF  EOF
507     if $CC $TEMP_ALTIVEC -faltivec -c conftest.c 2>/dev/null 1>/dev/null ; then     if $CC $TEMP_ALTIVEC -arch ppc -faltivec -c conftest.c 2>/dev/null 1>/dev/null ; then
508          AC_MSG_RESULT([yes (Apple)])          AC_MSG_RESULT([yes (Apple)])
509          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC"          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -arch ppc -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC"
510          PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"          PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"
511     else     else
512  cat > conftest.c << EOF  cat > conftest.c << EOF
# Line 531  Line 580 
580    
581  dnl ==========================================================================  dnl ==========================================================================
582  dnl  dnl
583    dnl Check for pthread
584    dnl
585    dnl ==========================================================================
586    
587    AC_CHECK_HEADER(
588            pthread.h,
589            AC_CHECK_LIB(
590                    pthread,
591                    pthread_create,
592                    AC_CHECK_LIB(
593                            pthread,
594                            pthread_join,
595                            SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD"
596                            SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread",
597                            AC_MSG_WARN(Pthread not supported. No SMP support)),
598                    AC_MSG_WARN(Pthread not supported. No SMP support)),
599            AC_MSG_WARN(Pthread not supported. No SMP support))
600    
601    dnl ==========================================================================
602    dnl
603  dnl Now we can set CFLAGS if needed  dnl Now we can set CFLAGS if needed
604  dnl  dnl
605  dnl ==========================================================================  dnl ==========================================================================
# Line 555  Line 624 
624  fi  fi
625    
626  dnl ==========================================================================  dnl ==========================================================================
627    dnl Some gcc flags can't be used for gcc >= 3.4.0
628    dnl ==========================================================================
629    
630    if test "$GCC" = "yes" ; then
631    cat << EOF > test.c
632    #include <stdio.h>
633    int main(int argc, char **argv)
634    {
635            if (*argv[[1]] == 'M') {
636                    printf("%d", __GNUC__);
637            }
638            if (*argv[[1]] == 'm') {
639                    printf("%d", __GNUC_MINOR__);
640            }
641            return 0;
642    }
643    EOF
644            $CC -o gcc-ver test.c
645    
646            GCC_MAJOR=`./gcc-ver M`
647            GCC_MINOR=`./gcc-ver m`
648    
649            rm -f test.c
650            rm -f gcc-ver
651    
652            # GCC 4.x
653            if test "${GCC_MAJOR}" -gt 3 ; then
654                    CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
655                    CFLAGS=`echo $CFLAGS | sed s,'-freduce-all-givs','',g`
656                    CFLAGS=`echo $CFLAGS | sed s,'-fmove-all-movables','',g`
657                    CFLAGS=`echo $CFLAGS | sed s,'-fnew-ra','',g`
658                    CFLAGS=`echo $CFLAGS | sed s,'-fwritable-strings','',g`
659            fi
660    
661            # GCC 3.4.x
662            if test "${GCC_MAJOR}" -eq 3 && test "${GCC_MINOR}" -gt 3 ; then
663                    CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
664            fi
665    fi
666    
667    
668    dnl ==========================================================================
669  dnl  dnl
670  dnl Substitions  dnl Substitions
671  dnl  dnl

Legend:
Removed from v.1536  
changed lines
  Added in v.1847

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