# openldap24 install error: bad flag in substitute command



## teh_fink (Dec 28, 2013)

I'm trying to install the latest net/openldap24-client in a fresh jail on an 8.4-P4 amd64 system. However, the port install errors out while trying to apply a patch with 
	
	



```
bad flag in substitute command
```
:


```
root@mail:~ # uname -a
FreeBSD mail 8.4-RELEASE-p4 FreeBSD 8.4-RELEASE-p4 #0 r255887: Sat Sep 28 07:48:28 PDT 2013
```


```
root@mail:/usr/ports/net/openldap24-client # make clean
===>  Cleaning for openldap-client-2.4.38
root@mail:/usr/ports/net/openldap24-client # make install clean
===>  License OPENLDAP accepted by the user
===>  Found saved configuration for openldap-client-2.4.38
===>   openldap-client-2.4.38 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by openldap-client-2.4.38 for building
===>  Extracting for openldap-client-2.4.38
=> SHA256 Checksum OK for openldap-2.4.38.tgz.
===>  Patching for openldap-client-2.4.38
===>  Applying FreeBSD patches for openldap-client-2.4.38
sed: 1: "s,^OPT =.*,OPT = -O2 -p ...": bad flag in substitute command: '-'
*** Error code 1

Stop in /usr/ports/net/openldap24-client.
*** Error code 1

Stop in /usr/ports/net/openldap24-client.
```

I googled but couldn't find a solution. Any ideas? Thanks in advance!


----------



## worldi (Feb 9, 2014)

Do you have anything funny in your /etc/make.conf? I do and I had to explicitly tell make to use neither ccache nor gcc46 in order to build it.


----------



## daveclewis (Feb 11, 2014)

I had the same problem and had the following in my /etc/make.conf file


```
USE_OPENSSL_RPATH=yes
USE_OPENSSL_PORT=yes
```
I commented out the line


```
USE_OPENSSL_RPATH=yes
```
and the compilation worked.

I'm not sure if this helps or the implications of commenting out the line but it did allow me to compile successfully


----------

