a configure's options such as "--extra-cflags" --- I am confused

15,739

You can always run the configure script as configure --help; it will print a usage statement and information about many of the accepted parameters -- and usually, hopefully, the package-specific ones of interest.

That said, --extra-cflags would provide extra command-line switches for the C compiler, --as would give the path to the assembler, --sysroot would give an alternate installation directory, and --extra-ldflags would provide extra flags for the linker. Those are all fairly advanced, and you're unlikely to need to use them.

Share:
15,739
Henry
Author by

Henry

Updated on June 28, 2022

Comments

  • Henry
    Henry almost 2 years
        # configure for i386 build
    ./configure \
    --cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
    --as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
    --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
    --extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system \
    --target-os=darwin \
    --arch=i386 \
    --cpu=i386 \
    --extra-cflags='-arch i386' \
    --extra-ldflags='-arch i386' \
    --prefix=compiled/i386 \
    --enable-cross-compile \
    --disable-armv5te \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffserver \
    --disable-ffprobe \
    --disable-doc
    

    the below will build ffmpeg static libraries for i386. but i don't know about the option's means such as "--extra-cflags"、"--extra-ldflags"、"--sysroot="、"--as=".

    who can tell me about those options mean ? where i can find the details explanation?

    thanks . I am waitting for your help.

  • Chris Stratton
    Chris Stratton almost 12 years
    The situation in the question looks to me like cross compiling (likely for the x86 "iphone" that is their simulator), so presumably there's a need to override environment variables which give the settings needed to build for the host, with values needed to build for the target.
  • Henry
    Henry almost 12 years
    thanks eepp and chris stratton . I konw those option's are environment variables now. I can find the help to exec the configure -help about this.
  • Henry
    Henry almost 12 years
    thanks ernest , i am follow your help. and find the way to understand this. thanks again.
  • Hashim Aziz
    Hashim Aziz about 5 years
    Is there any difference in using --extra-cflags and using CLFAGS as environment variables? Are they both taken into account by gcc at the same time?
  • Ernest Friedman-Hill
    Ernest Friedman-Hill about 5 years
    @Hashim They are literally *extra”. They will add to anything defined in CFLAGS, rather than replace any previous definition. Depending on your circumstances, they might be equivalent, or not. The “extra” flags make it easy to use what’s already in the environment and then add more.