Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running into an issue installing some packages on FreeBSD 8.2. I realize some of what the problem is but am not certain on the process for remedying the issue.

For example, I'm trying to install apache from ports. About 15 minutes into the process I am left at this step:

checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/usr/ports/devel/libtool/work/libtool-2.4':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

Relevant details in config.log:

configure:13511: /lib/cpp  conftest.cpp
./configure: line 1968: /lib/cpp: No such file or directory
configure:13511: /lib/cpp  conftest.cpp
./configure: line 1968: /lib/cpp: No such file or directory
configure:13550: result: /lib/cpp
configure:13570: /lib/cpp  conftest.cpp
./configure: line 1968: /lib/cpp: No such file or directory
configure:13570: /lib/cpp  conftest.cpp
./configure: line 1968: /lib/cpp: No such file or directory
configure:13602: error: C++ preprocessor "/lib/cpp" fails sanity check
ac_cv_prog_CXXCPP=/lib/cpp
CXXCPP='/lib/cpp'

So, I've gathered the error is with the libtool-2.4 package. I understand that the issue in this case is that there is no /lib/cpp on my installation. Easy fix (or so I thought). I have changed directories to /usr/ports/devel/libtool/work/libtool-2.4 and tried to install that port manually while specifying the correct location of /usr/bin/cpp with configure.

However, then I still get a similar output:

checking how to run the C++ preprocessor... /usr/bin/cpp
configure: error: in `/usr/ports/devel/libtool/work/libtool-2.4':
configure: error: C++ preprocessor "/usr/bin/cpp" fails sanity check
See `config.log' for more details

Looks similar, but in config.log there are more details:

configure:13570: /usr/bin/cpp  conftest.cpp
cpp: error trying to exec 'cc1plus': execvp: No such file or directory
configure:13570: /usr/bin/cpp  conftest.cpp
cpp: error trying to exec 'cc1plus': execvp: No such file or directory
configure:13602: error: C++ preprocessor "/usr/bin/cpp" fails sanity check
ac_cv_env_CXXCPP_value=/usr/bin/cpp
ac_cv_prog_CXXCPP=/usr/bin/cpp
CXXCPP='/usr/bin/cpp'

I know the issue is probably simple but through some simple trial and error and a fair amount of searching around the web, I can't find the solution to this. Any thoughts on how to get past this issue?

share|improve this question
    
Which apache version are you compiling? –  Rilindo Nov 29 '11 at 2:17
    
It was apache22. –  user98651 Nov 29 '11 at 15:54

2 Answers 2

Do you have anything in /etc/make.conf? If so, please post the contents. Also try these commands and post the output:

cd /usr/ports/devel/libtool
make -V PREFIX
make -V LOCALBASE
gcc -v

If you can post a complete transcript of the apache port installation, starting with the "make" command all the way to the error above, that would help, too.

Cheers, Greg

share|improve this answer
    
bsd01# cat /etc/make.conf # added by use.perl 2011-11-28 11:12:37 PERL_VERSION=5.12.4 bsd01# cd /usr/ports/devel/libtool bsd01# make -V PREFIX /usr/local bsd01# make -V LOCALBASE /usr/local bsd01# gcc -v Using built-in specs. Target: i386-undermydesk-freebsd Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD] –  user98651 Nov 28 '11 at 23:05
    
Here is the full output from the config.log port installation: pastebin.com/ffb44NU7 Here is a link to the commands you have above: pastebin.com/MPNTyLkj –  user98651 Nov 28 '11 at 23:10
    
Are you running the installation from the libtool port directory like so? cd /usr/ports/devel/libtool make clean make install clean The reason I ask is your config.log has a line near the top with the script's invocation arguments. They don't look correct compared to what I have when I use the commands above. –  glarkin Nov 29 '11 at 15:41
    
Yes, I have tried that. For good measure I ran it again and have provided the contents of config.log here: pastebin.com/h4S6imyN –  user98651 Nov 29 '11 at 15:56
2  
As you might suspect, /usr/libexec/cc1plus is missing, so all I can assume is that your base system has been corrupted somehow. Can you post the output of "freebsd-update fetch"? That will tell us if the system will replace that file. If it will, then you can do "freebsd-update install" and hopefully get things working from there. –  glarkin Nov 29 '11 at 19:17

I would use pkg_delete to remove all the packages that apache depends on, and you think are causing a problem.

Requires: apr-ipv6-devrandom-gdbm-db42-1.4.5.1.3.12_1, autoconf-2.68, autoconf-wrapper-20101119, db42-4.2.52_5, expat-2.0.1_2, gdbm-1.9.1, libiconv-1.14, libtool-2.4.2, m4-1.4.16,1, pcre-8.30_2, perl-5.12.4_4

Then make clean each one that you remove. Don't forget to go in an manually remove anything that you manually added (where you said "I have changed directories to /usr/ports/devel/libtool/work/libtool-2.4 and tried to install that port manually while specifying the correct location of /usr/bin/cpp with configure." Undo and delete all these manual changes).

Run "make install" from /usr/ports/www/apache22

You should be fine. If this doesn't work, save all of your configurations, and use the scorched earth method:

Run this for each dependency apache22 has:

pkg_delete -dfv <pkg_name>

Then:

rm -rf /usr/ports
rm -rf /var/db/portsnap
mkdir /var/db/portsnap
portsnap fetch
portsnap extract

Now, reinstall apache22 and restore your configurations.

OR

Drop apache entirely and switch to nginx. You will feel better in the end.

"Apache is like Microsoft Word, it has a million options but you only need six. Nginx does those six things, and it does five of them 50 times faster than Apache."

-- Chris Lea

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.