This is a discussion on CFLAGS or CXXFLAGS in SlackBuild within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> In most SlackBuild scripts there are following lines: CFLAGS="$SLKCFLAGS" \ ../configure \ $ARCH-slackware-linux But what if the application being ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| In most SlackBuild scripts there are following lines: CFLAGS="$SLKCFLAGS" \ ../configure \ $ARCH-slackware-linux But what if the application being compiled is written in C++. Does the C++ compiler pick upo the CFLAGS? Or is it necessary to specify CXXFLAGS? And why isn't there an export of the CFLAGS necessary? -- "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." -- Howard Aiken |
| |||
| Guybrush Threepwood wrote: > In most SlackBuild scripts there are following lines: > > CFLAGS="$SLKCFLAGS" \ > ./configure \ > $ARCH-slackware-linux > > But what if the application being compiled is written in C++. Does the C++ > compiler pick upo the CFLAGS? Or is it necessary to specify CXXFLAGS? The build script for applications that are written in c++ use the CXXFLAGS (see for example source/xap/xpdf/xpdf.SlackBuild). These variables are usually documented by running ./configure --help > And why isn't there an export of the CFLAGS necessary? > The backslash character means that the shell have to consider that it is a single line; exactly as you type: CFLAGS="$SLKCFLAGS" ./configure The syntax FOO=hello command run the "command" by putting the variable FOO in its environment. It does not put it in the environement of the commands that are run afterwards. Olive |
| |||
| On Thu, 24 Nov 2005 16:55:56 +0100, Olive wrote: > Guybrush Threepwood wrote: >> In most SlackBuild scripts there are following lines: >> >> CFLAGS="$SLKCFLAGS" \ >> ./configure \ >> $ARCH-slackware-linux >> >> But what if the application being compiled is written in C++. Does the >> C++ compiler pick upo the CFLAGS? Or is it necessary to specify >> CXXFLAGS? > > The build script for applications that are written in c++ use the CXXFLAGS > (see for example source/xap/xpdf/xpdf.SlackBuild). These variables are > usually documented by running ./configure --help > When running ./configure --help I get this as last lines: Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for example) > Olive -- "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." -- Howard Aiken |
| |||
| Guybrush Threepwood wrote: > On Thu, 24 Nov 2005 16:55:56 +0100, Olive wrote: > > >>Guybrush Threepwood wrote: >> >>>In most SlackBuild scripts there are following lines: >>> >>>CFLAGS="$SLKCFLAGS" \ >>>./configure \ >>> $ARCH-slackware-linux >>> >>>But what if the application being compiled is written in C++. Does the >>>C++ compiler pick upo the CFLAGS? Or is it necessary to specify >>>CXXFLAGS? >> >>The build script for applications that are written in c++ use the CXXFLAGS >>(see for example source/xap/xpdf/xpdf.SlackBuild). These variables are >>usually documented by running ./configure --help >> > > > When running ./configure --help I get this as last lines: > > Some influential environment variables: > CC C compiler command > CFLAGS C compiler flags > LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a > nonstandard directory <lib dir> > CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have > headers in a nonstandard directory <include dir> > CPP C preprocessor > CXX C++ compiler command > CXXFLAGS C++ compiler flags > CXXCPP C++ preprocessor > F77 Fortran 77 compiler command > FFLAGS Fortran 77 compiler flags > > Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for > example) These flags are not directly used by the compiler but the Makefile use it to pass command line option to the compiler. Simply run make and you will see how the compiler is called. I think that this help is generic and documents some flags even when it is not needed. For example in the ../configure --help of gimp-2.2.8; I see reference to flags to be passed to the Fortran compiler and I am sure gimp does not use Fortran. Olive > > > >>Olive > > |
| |||
| On Fri, 25 Nov 2005 17:57:01 +0100, Olive wrote: > Guybrush Threepwood wrote: >> >> When running ./configure --help I get this as last lines: >> >> Some influential environment variables: >> CC C compiler command >> CFLAGS C compiler flags >> LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a >> nonstandard directory <lib dir> >> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have >> headers in a nonstandard directory <include dir> >> CPP C preprocessor >> CXX C++ compiler command >> CXXFLAGS C++ compiler flags >> CXXCPP C++ preprocessor >> F77 Fortran 77 compiler command FFLAGS Fortran 77 >> compiler flags >> >> Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for >> example) > > These flags are not directly used by the compiler but the Makefile use it > to pass command line option to the compiler. Simply run make and you will > see how the compiler is called. I think that this help is generic and > documents some flags even when it is not needed. For example in the > ./configure --help of gimp-2.2.8; I see reference to flags to be passed to > the Fortran compiler and I am sure gimp does not use Fortran. > > Olive So I just look if the compiler(s) gets called with the options I like, and if not, I alter the variables? -- "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." -- Howard Aiken |
| ||||
| Guybrush Threepwood wrote: > On Fri, 25 Nov 2005 17:57:01 +0100, Olive wrote: > > >>Guybrush Threepwood wrote: >> >>>When running ./configure --help I get this as last lines: >>> >>>Some influential environment variables: >>> CC C compiler command >>> CFLAGS C compiler flags >>> LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a >>> nonstandard directory <lib dir> >>> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have >>> headers in a nonstandard directory <include dir> >>> CPP C preprocessor >>> CXX C++ compiler command >>> CXXFLAGS C++ compiler flags >>> CXXCPP C++ preprocessor >>> F77 Fortran 77 compiler command FFLAGS Fortran 77 >>> compiler flags >>> >>>Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for >>>example) >> >>These flags are not directly used by the compiler but the Makefile use it >>to pass command line option to the compiler. Simply run make and you will >>see how the compiler is called. I think that this help is generic and >>documents some flags even when it is not needed. For example in the >>./configure --help of gimp-2.2.8; I see reference to flags to be passed to >>the Fortran compiler and I am sure gimp does not use Fortran. >> >>Olive > > > So I just look if the compiler(s) gets called with the options I like, and > if not, I alter the variables? > Simply yes. Of course, if you need something more special, you will need to alter the Makefile. Olive |