You are not logged in.

#1 2012-05-22 20:19:34

kcy29581
Member
From: CA
Registered: 2004-12-23
Posts: 231

[SOLVED] GCC configuration file?

Hi all,

I understand that the /etc/makepkg.conf file has settings for makepkg. I am looking for the file that configures GCC, so that when I compile anything from source I can have the correct settings applies (such as -march, -mtune, etc.).

I've searched but can't find a location for this file. I bet I'm missing the obvious here...

Last edited by kcy29581 (2012-05-22 20:34:11)


There is no spoon in Arch...

Offline

#2 2012-05-22 20:24:06

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] GCC configuration file?

You set compiler options in the same file:

CFLAGS=" ... "
CXXFLAGS=" ... "
LDFLAGS=" ... "

You can always modify individual PKGBUILDs and supply custom settings depending on the package you're building.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2012-05-22 20:24:28

kcy29581
Member
From: CA
Registered: 2004-12-23
Posts: 231

Re: [SOLVED] GCC configuration file?

I have found the following links, but I'm wondering if Arch has a universal file somewhere for gcc/g++; Gentoo does this with a /etc/make.conf file.

http://linuxreviews.org/howtos/compiling/#toc3
http://stackoverflow.com/questions/8772 … ermanently


There is no spoon in Arch...

Offline

#4 2012-05-22 20:24:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,564
Website

Re: [SOLVED] GCC configuration file?

I'm not sure there is such a file.  There are various environment variables, but I suspect what you want is a Makefile.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2012-05-22 20:25:45

Terminator
Member
From: Belgium
Registered: 2012-05-07
Posts: 265

Re: [SOLVED] GCC configuration file?

Apparently it's distro-specific and I can't find it on my arch.

Google said this smile

Last edited by Terminator (2012-05-22 20:26:09)

Offline

#6 2012-05-22 20:26:11

kcy29581
Member
From: CA
Registered: 2004-12-23
Posts: 231

Re: [SOLVED] GCC configuration file?

bohoomil wrote:

You set compiler options in the same file:

CFLAGS=" ... "
CXXFLAGS=" ... "
LDFLAGS=" ... "

You can always modify individual PKGBUILDs and supply custom settings depending on the package you're building.

Am I right in saying that those flags are only taken in consideration if I explicitly use makepkg? My goal is to compile Wine with some patches, and I may not make a PKGBUILD for it.

Thanks.


There is no spoon in Arch...

Offline

#7 2012-05-22 20:27:43

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] GCC configuration file?

Look here: https://wiki.archlinux.org/index.php/Ma … pile_flags

Various distros may use a bit different naming for the same config file, e.g. CRUX has pkgmk.conf, but inside you'll find a very similar content to Arch's. Therefore you can safely modify makepkg and the compiler will use the defaults you've provided.

Edit: spelling.

Last edited by bohoomil (2012-05-22 20:31:57)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#8 2012-05-22 20:30:08

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] GCC configuration file?

kcy29581 wrote:

My goal is to compile Wine with some patches, and I may not make a PKGBUILD for it.

My advice would be: modify a PKGBUILD, as this can save you lots of headache. After all, PKGBUILD is in 50% exactly what you do on command line, but additionally creates a package that conforms with the distro standards.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#9 2012-05-22 20:33:08

kcy29581
Member
From: CA
Registered: 2004-12-23
Posts: 231

Re: [SOLVED] GCC configuration file?

bohoomil wrote:
kcy29581 wrote:

My goal is to compile Wine with some patches, and I may not make a PKGBUILD for it.

My advice would be: modify a PKGBUILD, as this can save you lots of headache. After all, PKGBUILD is in 50% exactly what you do on command line, but additionally creates a package that conforms with the distro standards.

Maybe you're right and I should use this as an excuse to finally learn how to make a PKGBUILD of my own smile


There is no spoon in Arch...

Offline

#10 2012-05-22 20:33:52

kcy29581
Member
From: CA
Registered: 2004-12-23
Posts: 231

Re: [SOLVED] GCC configuration file?

Many thanks to the amazing replies! I've had everything confirmed, and indeed it is very distro specific.

You guys rock.


There is no spoon in Arch...

Offline

#11 2012-05-22 20:52:56

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] GCC configuration file?

Great to hear that.

When you need a custom PKGBUILD, there is no need to create one from scratch. Just grab one of many variants available in the ABS or AUR and modify it so that you get what you want. If something doesn't work as expected, just ask (providing us with snippets in question). The results will be safer and most likely better. Good luck!


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#12 2012-05-23 00:32:27

kcy29581
Member
From: CA
Registered: 2004-12-23
Posts: 231

Re: [SOLVED] GCC configuration file?

For reference if anyone else needs it: I found out that gcc 4.x series got rid of the default specs file, but it can be recreated if needed. Check: http://gcc.gnu.org/gcc-4.0/changes.html


There is no spoon in Arch...

Offline

Board footer

Powered by FluxBB