[vlc-devel] Problems with Mac OS X compile

Vance Shipley vances at motivity.ca
Sat Aug 2 19:30:29 CEST 2008

I'm seeing the same problem as has been reported on a few previous
occassions with the configure line recommended in the "OSXCompile"
document.  The issue is that when "--with-macosx-sdk" is used the
options "-isysroot" and "-mmacosx-version-min" are added to CXX
(as well as CC, OBJC and LD):

    dnl  Check for Mac OS X SDK settings
       [  --with-macosx-sdk=DIR   compile using the SDK in DIR])
    if test "${with_macosx_sdk}" != "" ; then
        CC="${CC} -isysroot ${with_macosx_sdk}"
        CXX="${CXX} -isysroot ${with_macosx_sdk}"
        OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
        LD="${LD} -syslibroot ${with_macosx_sdk}"
       [  --with-macosx-version-min=VERSION  compile for MacOSX VERSION and above])
    if test "${with_macosx_version_min}" != "" ; then
        CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
        CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
        OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
        LD="${LD} -macosx_version_min=${with_macosx_version_min}"
        CFLAGS_save="${CFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"; CFLAGS="${CFLAGS_save}"
        CXXFLAGS_save="${CXXFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"; CXXFLAGS="${CXXFLAGS_save}"
        OBJCFLAGS_save="${OBJCFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"; OBJCFLAGS="${OBJCFLAGS_save}"

The autoconf macro AC_PROG_CXXCPP (included by other macros) contains
a test which checks to see if CXX is the GNU g++ compiler:

	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
	    (test "X$CXX" != "Xg++"))) ; then

This fails because CXX isn't equal to "g++", it is now "g++ -isysroot

It appears that the OS X specific flags are being added to CXX instead
of CXXFLAGS, as they should be, purposely.  I'm not clear on the use
of CXXFLAGS_save so I don't have the answer as to how to fix this.


On Fri, Jun 20, 2008 at 01:41:29PM -0700, Dave Still wrote:
> In which case, I get the following error from "./configure --enable- 
> debug --with-macosx-sdk":
> ...
> checking how to recognize dependent libraries... (cached) pass_all
> checking dlfcn.h usability... no
> checking dlfcn.h presence... yes
> configure: WARNING: dlfcn.h: present but cannot be compiled
> configure: WARNING: dlfcn.h:     check for missing prerequisite
> headers?
> configure: WARNING: dlfcn.h: see the Autoconf documentation
> configure: WARNING: dlfcn.h:     section "Present But Cannot Be  
> Compiled"
> configure: WARNING: dlfcn.h: proceeding with the preprocessor's result
> configure: WARNING: dlfcn.h: in the future, the compiler will take  
> precedence
> checking for dlfcn.h... yes
> checking how to run the C++ preprocessor... /lib/cpp
> configure: error: C++ preprocessor "/lib/cpp" fails sanity check

More information about the vlc-devel mailing list