a configure's options such as "--extra-cflags" --- I am confused
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.
Henry
Updated on June 28, 2022Comments
-
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 almost 12 yearsThe 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 almost 12 yearsthanks 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 almost 12 yearsthanks ernest , i am follow your help. and find the way to understand this. thanks again.
-
Hashim Aziz about 5 yearsIs there any difference in using
--extra-cflags
and using CLFAGS as environment variables? Are they both taken into account bygcc
at the same time? -
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.