Revision 50a334e4 configure

View differences:

configure
511 511
    eval "$var=\"\$$var $*\""
512 512
}
513 513

  
514
add_cppflags(){
515
    append CPPFLAGS "$@"
516
}
517

  
514 518
add_cflags(){
515 519
    append CFLAGS "$@"
516 520
}
......
532 536
    log check_cc "$@"
533 537
    cat > $TMPC
534 538
    log_file $TMPC
535
    check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
539
    check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
536 540
}
537 541

  
538 542
check_cpp(){
539 543
    log check_cpp "$@"
540 544
    cat > $TMPC
541 545
    log_file $TMPC
542
    check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
546
    check_cmd $cc $CPPFLAGS "$@" -E -o $TMPO $TMPC
543 547
}
544 548

  
545 549
check_as(){
546 550
    log check_as "$@"
547 551
    cat > $TMPC
548 552
    log_file $TMPC
549
    check_cmd $as $CFLAGS "$@" -c -o $TMPO $TMPC
553
    check_cmd $as $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
550 554
}
551 555

  
552 556
check_asm(){
......
578 582
    check_cmd $cc $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
579 583
}
580 584

  
585
check_cppflags(){
586
    log check_cppflags "$@"
587
    check_cc "$@" <<EOF && add_cppflags "$@"
588
int x;
589
EOF
590
}
591

  
581 592
check_cflags(){
582 593
    log check_cflags "$@"
583 594
    check_cc "$@" <<EOF && add_cflags "$@"
......
1235 1246
enable swscale_alpha
1236 1247

  
1237 1248
# build settings
1238
add_cflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
1249
add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
1239 1250
SHFLAGS='-shared -Wl,-soname,$$(@F)'
1240 1251
FFSERVERLDFLAGS=-Wl,-E
1241 1252
LIBPREF="lib"
......
1256 1267

  
1257 1268
# gcc stupidly only outputs the basename of targets with -MM, but we need the
1258 1269
# full relative path for objects in subdirectories for non-recursive Make.
1259
DEPEND_CMD='$(CC) $(CFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
1270
DEPEND_CMD='$(CC) $(CPPFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
1260 1271

  
1261 1272
# find source path
1262 1273
source_path="$(dirname "$0")"
......
1456 1467
    cc_type=xlc
1457 1468
elif $cc -V 2>/dev/null | grep -q Compaq; then
1458 1469
    cc_type=ccc
1459
    DEPEND_CMD='$(CC) $(CFLAGS) -M $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
1470
    DEPEND_CMD='$(CC) $(CPPFLAGS) -M $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
1460 1471
    debuglevel=3
1461 1472
    add_ldflags -Wl,-z,now # calls to libots crash without this
1462 1473
elif $cc --vsn 2>/dev/null | grep -q RVCT; then
......
1499 1510
fi
1500 1511

  
1501 1512
check_cflags -std=c99
1502
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cflags -D_FILE_OFFSET_BITS=64
1513
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
1503 1514
#include <stdlib.h>
1504 1515
EOF
1505
check_cc -D_LARGEFILE_SOURCE <<EOF && add_cflags -D_LARGEFILE_SOURCE
1516
check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
1506 1517
#include <stdlib.h>
1507 1518
EOF
1508 1519

  
......
1593 1604
    beos|haiku|zeta)
1594 1605
        prefix_default="$HOME/config"
1595 1606
        # helps building libavcodec
1596
        add_cflags -DPIC -fomit-frame-pointer
1607
        add_cppflags -DPIC
1608
        add_cflags -fomit-frame-pointer
1597 1609
        # 3 gcc releases known for BeOS, each with ugly bugs
1598 1610
        gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
1599 1611
        case "$gcc_version" in
......
1620 1632
        FFSERVERLDFLAGS=""
1621 1633
        SHFLAGS='-shared -Wl,-h,$$(@F)'
1622 1634
        network_extralibs="-lsocket -lnsl"
1623
        add_cflags -D__EXTENSIONS__
1635
        add_cppflags -D__EXTENSIONS__
1624 1636
        ;;
1625 1637
    netbsd)
1626 1638
        oss_indev_extralibs="-lossaudio"
......
2472 2484
    echo "STRIP=$strip" >> config.mak ||
2473 2485
    echo "STRIP=echo ignoring strip" >> config.mak
2474 2486

  
2487
echo "CPPFLAGS?=$CPPFLAGS" >> config.mak
2475 2488
echo "OPTFLAGS=$CFLAGS" >> config.mak
2476 2489
echo "LDFLAGS=$LDFLAGS" >> config.mak
2477 2490
echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak

Also available in: Unified diff