# -- Check for working C compiler: /usr/bin/cc -- broken



## c00kie (Jul 11, 2013)

I'm having some issues whilst trying to update certain ports.

`# /usr/local/sbin/portupgrade -r mysql-server-5.5.29\*`

```
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /usr/ports/databases/mysql55-server/work/mysql-5.5.32/CMakeFiles/CMakeTmp

  

  Run Build Command:/usr/local/bin/gmake "cmTryCompileExec760590957/fast"

  Shared object "libintl.so.9" not found, required by "gmake"
```


`# /usr/local/sbin/portupgrade -r cmake-2.8.9\*`

```
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /usr/ports/devel/cmake/work/cmake-2.8.11.2/CMakeFiles/CMakeTmp

  

  Run Build Command:/usr/local/bin/gmake "cmTryCompileExec1383712450/fast"

  Shared object "libintl.so.9" not found, required by "gmake"

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (project)
```

`# /usr/local/sbin/portupgrade -r mysql-client-5.5.29\*`

```
--->  Upgrading 'mysql-client-5.5.29' to 'mysql-client-5.5.32' (databases/mysql55-client)
...
-- Running cmake version 2.8.9
-- The C compiler identification is GNU 4.2.1
CMake Error: Could not find cmake module file:/usr/ports/databases/mysql55-client/work/mysql-5.5.32/CMakeFiles/CMakeCCompiler.cmake
-- The CXX compiler identification is GNU 4.2.1
CMake Error: Could not find cmake module file:/usr/ports/databases/mysql55-client/work/mysql-5.5.32/CMakeFiles/CMakeCXXCompiler.cmake
-- Check for working C compiler: /usr/bin/cc
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
  Unknown extension ".c" for file

    /usr/ports/databases/mysql55-client/work/mysql-5.5.32/CMakeFiles/CMakeTmp/testCCompiler.c

  try_compile() works only for enabled languages.  Currently these are:

    C CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:94 (PROJECT)


-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:


  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:94 (PROJECT)


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop in /usr/ports/databases/mysql55-client.
*** Error code 1

Stop in /usr/ports/databases/mysql55-client.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20130711-59895-txwous env UPGRADE_TOOL=portupgrade UPGRADE_PORT=mysql-client-5.5.29 UPGRADE_PORT_VER=5.5.29 make
** Fix the problem and try again.
--->  Skipping 'databases/mysql55-server' (mysql-server-5.5.29) because a requisite package 'mysql-client-5.5.29' (databases/mysql55-client) failed (specify -k to force)
--->  Skipping 'devel/apr1' (apr-1.4.6.1.4.1_3) because a requisite package 'mysql-client-5.5.29' (databases/mysql55-client) failed (specify -k to force)
** Listing the failed packages (-:ignored / *:skipped / !:failed)
	! databases/mysql55-client (mysql-client-5.5.29)	(unknown build error)
	* databases/mysql55-server (mysql-server-5.5.29)
	* devel/apr1 (apr-1.4.6.1.4.1_3)
```

Does anyone know more about the nature of:

```
The C compiler "/usr/bin/cc" is not able to compile a simple test program.
-- Check for working C compiler: /usr/bin/cc -- broken
```
error reports?


----------



## wblock@ (Jul 11, 2013)

c00kie said:
			
		

> ```
> Shared object "libintl.so.9" not found, required by "gmake"
> ```




```
% locate libintl.so.9
/usr/local/lib/libintl.so.9
% pkg_info -W /usr/local/lib/libintl.so.9
/usr/local/lib/libintl.so.9 was installed by package gettext-0.18.1.1_1
```

What is the output of `pkg_info -Ix gettext`?  Also, have you been following /usr/ports/UPDATING?

Please install sysutils/bsdadminscripts and run `pkg_libchk -q`.  It will show a list of installed programs that are missing shared libraries.


----------



## c00kie (Jul 12, 2013)

wblock@ said:
			
		

> ```
> % locate libintl.so.9
> /usr/local/lib/libintl.so.9
> % pkg_info -W /usr/local/lib/libintl.so.9
> ...



*H*i*,*


```
[CMD=#]pkg_info -W /usr/local/lib/libintl.so.9[/CMD]
pkg_info: /usr/local/lib/libintl.so.9: file cannot be found
[CMD=#]/usr/local/sbin/portupgrade -r p5-Locale-gettext-1.05_3\* [/CMD]
stale dependency use -O to force
```
So I force using -O and:

```
[CMD=#]pkg_info -W /usr/local/lib/libintl.so.9[/CMD]
/usr/local/lib/libintl.so.9 was installed by package gettext-0.18.1.1_1
gettext-0.18.1.1_1                  =   up-to-date with port
```

Hence it looks like we've now got libintl.so.9 on my system and gettext.



> What is the output of `pkg_info -Ix gettext`?




```
[CMD=#]pkg_info -Ix gettext[/CMD]
gettext-0.18.1.1_1  GNU gettext package
p5-Locale-gettext-1.05_3 Message handling functions
```



> Also, have you been following /usr/ports/UPDATING?



Indeed, I have been keeping an eye on /usr/ports/UPDATING going back a full 12 months:


```
[cmd=#]/usr/sbin/pkg_updating -d `/bin/date -v-1y +%Y%m%d`[/cmd]
20130706:
  AFFECTS: users of devel/apr1
20130503:
  AFFECTS: users of security/libgcrypt and any port that depends on it
20130427:
  AFFECTS: users of print/a2ps-{a4,letter}, print/c2ps-{a4,letter}, 
20130316:
  AFFECTS: users of converters/libiconv and devel/gettext
20121211:
20121015:
20120928:
20120902: 
20120820:
```

although I'm a little unsure about one entry 20120902 please see below.


> Please install sysutils/bsdadminscripts and run `pkg_libchk -q`.  It will show a list of installed programs that are missing shared libraries.



`# /usr/local/sbin/pkg_libchk -q` reveals:

```
apache22-2.2.25
```

I think this could be the problem and in fact from /usr/ports/UPDATING:


```
20120902:
  AFFECTS: users of www/apache22, www/apache22-event-mpm, www/apache22-itk-mpm, www/apache22-peruser-mpm, www/apache22-worker-mpm
  AUTHOR: ohauer@FreeBSD.org

  The port use now the options NG framework, this means WITH_xxx
  directives are no longer valid.

  Additional:
  - APR only specific options like THREADS, MYSQL, PGSQL, SQLITE,
    BDB and IPV6 where removed.
  - PKGNAME has changed from apache-2... to apache22-2...
  - PROXY is now a MULTI directive which means at last one additional
    PROXY_(AJP|BALANCER|CONNECT|FTP|HTTP|SCGI) module is required.
  - CGI is only a valid option for MPM prefork, peruser and itk.
```

I'm unclear what I have to do with the preceding advice? I mean from:

```
[CMD=#]pkg_version -v | less                      [/CMD]
apache22-2.2.25                     =   up-to-date with port
```

but feel there is probably more to it than this? Moreover, I'm really lost with advice such as:


```
The port use now the options NG framework, this means WITH_xxx
  directives are no longer valid.
```

Could you walk me through it?


----------



## wblock@ (Jul 12, 2013)

The output from `pkg_libchk` says the compiled version of www/apache22 is missing a shared library.  Usually that means the port that provides that library has been rebuilt and now provides a newer version of the library.  Somehow, www/apache22 was left out when all the ports depending on that library were rebuilt.  With ports-mgmt/portupgrade, that would be done when the library-providing port was upgraded with `portupgrade -r`.  Please consider switching to ports-mgmt/portmaster, which does that automatically.

The options framework message is not relevant unless you have WITH_ entries in make.conf that apply to the Apache port.


----------



## c00kie (Jul 12, 2013)

wblock@ said:
			
		

> Please consider switching to ports-mgmt/portmaster, which does that automatically.



ports-mgmt/portmaster is a little gem. I re-installed apache22 using ports-mgmt/portmaster which then solved all the issues I had with mysql-server _and_ mysql-client. All my ports are now up-to-date and healthy.

Thanks for the great advice.


----------

