# Using different as for port



## nekoexmachina (Feb 28, 2010)

Hello, forums!
as pf http://www.freebsd.org/doc/en/articles/custom-gcc/article.html , i can use different CC's for different ports. 
What is about gnu/as?
I want to create a port for newer mplayer with mt support - and it does not compile with system's as, just with newest binutils-2009. Ive tried to grep binutils from Makefiles in ports dir - there were some ports that needed recent binutils, i've tried to read them - but did not understand how does as substitution work.


----------



## sahne (Feb 28, 2010)

hi,

have you tried passing the correct flags to mplayers configure script ?

if quickly had a look at i and maybe passing --as=/path/to/gnu-as will do the job 

add something like this to your Makefile and test it.

```
BUILD_DEPENDS += /path/to/ports-ac:${PORTSDIS}/devel/binutils
BUILD_DEPENDS += /path/to/ports-gcc:${PORTSDIS}/lang/gcc44

CONFIGURE_ARGS+=  --as=/path/to/ports-as
CONFIGURE_ARGS+=  --cc=/path/to/ports-gcc
```


----------



## sahne (Feb 28, 2010)

sorry, the above code didn't work in a quick test but you can patch mplayers config.mak file after the configure run
all you have to do is replacing the CC, AS, etc. vars in config.mak.


```
post-configure:
    sed -i .new 's/AS=.*$/AS=\/path\/to\/as' {WRKSRC}/config.mak && mv ${WRKSRC}/config.mak.new ${WRKSRC}/config.mak
```

I hope this one finally will fix your problem


----------



## nekoexmachina (Mar 1, 2010)

Yeah, thanks alot, that helped.


----------

