зеркало из https://github.com/mozilla/pjs.git
bug 676589 - configure and xpcom changes for targeting iOS. r=khuey
This commit is contained in:
Родитель
093f2c8be5
Коммит
4b675f0da5
|
@ -519,11 +519,16 @@ endif # USE_STATIC_LIBS
|
|||
endif # WINNT && !GNU_CC
|
||||
|
||||
ifeq ($(OS_ARCH),Darwin)
|
||||
# Darwin doesn't cross-compile, so just set both types of flags here.
|
||||
# Compiling ObjC requires an Apple compiler anyway, so it's ok to set
|
||||
# host CMFLAGS here.
|
||||
HOST_CMFLAGS += -fobjc-exceptions
|
||||
HOST_CMMFLAGS += -fobjc-exceptions
|
||||
OS_COMPILE_CMFLAGS += -fobjc-exceptions
|
||||
OS_COMPILE_CMMFLAGS += -fobjc-exceptions
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),uikit)
|
||||
OS_COMPILE_CMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
|
||||
OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
|
||||
endif
|
||||
endif
|
||||
|
||||
COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS)
|
||||
|
|
40
configure.in
40
configure.in
|
@ -2107,7 +2107,17 @@ case "$target" in
|
|||
# The ExceptionHandling framework is needed for Objective-C exception
|
||||
# logging code in nsObjCExceptions.h. Currently we only use that in debug
|
||||
# builds.
|
||||
MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
AC_MSG_CHECKING([for -framework ExceptionHandling])
|
||||
LDFLAGS="$LDFLAGS -framework ExceptionHandling"
|
||||
AC_TRY_LINK(,[return 0;],
|
||||
ac_cv_have_framework_exceptionhandling="yes",
|
||||
ac_cv_have_framework_exceptionhandling="no")
|
||||
AC_MSG_RESULT([$ac_cv_have_framework_exceptionhandling])
|
||||
if test "$ac_cv_have_framework_exceptionhandling" = "yes"; then
|
||||
MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
|
||||
fi
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
# Debug builds should always have frame pointers
|
||||
MOZ_DEBUG_FLAGS="-g -fno-omit-frame-pointer"
|
||||
|
||||
|
@ -3272,7 +3282,7 @@ dnl These are all the places some variant of statfs can be hiding.
|
|||
MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
|
||||
|
||||
dnl Quota support
|
||||
MOZ_CHECK_HEADERS(sys/quota.h)
|
||||
MOZ_CHECK_HEADERS(sys/quota.h sys/sysmacros.h)
|
||||
MOZ_CHECK_HEADERS(linux/quota.h)
|
||||
|
||||
dnl Try for MMX support
|
||||
|
@ -4996,13 +5006,27 @@ cairo-os2)
|
|||
;;
|
||||
|
||||
cairo-cocoa)
|
||||
MOZ_WIDGET_TOOLKIT=cocoa
|
||||
AC_DEFINE(MOZ_WIDGET_COCOA)
|
||||
# Check if we have the Cocoa framework, or if we're targeting Cocoa Touch
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -framework Cocoa"
|
||||
AC_TRY_LINK(,[return 0;],_HAVE_FRAMEWORK_COCOA=1,_HAVE_FRAMEWORK_COCOA=)
|
||||
if test -z "$_HAVE_FRAMEWORK_COCOA"; then
|
||||
LDFLAGS="$_SAVE_LDFLAGS -framework UIKit";
|
||||
AC_TRY_LINK(,[return 0;],_HAVE_FRAMEWORK_UIKIT=1,
|
||||
AC_MSG_ERROR([Neither Cocoa nor UIKit frameworks were found. Are you using the correct SDK?]))
|
||||
MOZ_WIDGET_TOOLKIT=uikit
|
||||
AC_DEFINE(MOZ_WIDGET_UIKIT)
|
||||
TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
|
||||
else
|
||||
MOZ_WIDGET_TOOLKIT=cocoa
|
||||
AC_DEFINE(MOZ_WIDGET_COCOA)
|
||||
TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
|
||||
fi
|
||||
MOZ_USER_DIR="Mozilla"
|
||||
AC_DEFINE(XP_MACOSX)
|
||||
TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
|
||||
|
||||
TK_CFLAGS="-DNO_X11"
|
||||
LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
|
||||
LDFLAGS="$LDFLAGS -lobjc"
|
||||
CFLAGS="$CFLAGS $TK_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
|
||||
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
|
||||
|
@ -8018,6 +8042,7 @@ dnl Test for correct temporary object destruction order
|
|||
dnl ========================================================
|
||||
dnl We want to make sure the compiler follows the C++ spec here as
|
||||
dnl xpcom and the string classes depend on it (bug 235381).
|
||||
if test -z "$CROSS_COMPILE"; then
|
||||
AC_MSG_CHECKING([for correct temporary object destruction order])
|
||||
AC_TRY_RUN([ class A {
|
||||
public: A(int& x) : mValue(x) {}
|
||||
|
@ -8042,6 +8067,7 @@ AC_MSG_RESULT([$result])
|
|||
if test "$result" = "no"; then
|
||||
AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
|
||||
|
@ -8525,7 +8551,7 @@ if test "$MOZ_TREE_CAIRO"; then
|
|||
qt)
|
||||
QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
|
||||
;;
|
||||
cocoa)
|
||||
cocoa | uikit)
|
||||
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
|
||||
QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
|
||||
QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
|
||||
|
|
|
@ -519,11 +519,16 @@ endif # USE_STATIC_LIBS
|
|||
endif # WINNT && !GNU_CC
|
||||
|
||||
ifeq ($(OS_ARCH),Darwin)
|
||||
# Darwin doesn't cross-compile, so just set both types of flags here.
|
||||
# Compiling ObjC requires an Apple compiler anyway, so it's ok to set
|
||||
# host CMFLAGS here.
|
||||
HOST_CMFLAGS += -fobjc-exceptions
|
||||
HOST_CMMFLAGS += -fobjc-exceptions
|
||||
OS_COMPILE_CMFLAGS += -fobjc-exceptions
|
||||
OS_COMPILE_CMMFLAGS += -fobjc-exceptions
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),uikit)
|
||||
OS_COMPILE_CMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
|
||||
OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
|
||||
endif
|
||||
endif
|
||||
|
||||
COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS)
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
#include "nsIObjectOutputStream.h"
|
||||
#include "nsIPipe.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
#include "nsILocalFileMac.h"
|
||||
#include "nsIMacUtils.h"
|
||||
#endif
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
COMPONENT(WINDOWSREGKEY, nsWindowsRegKeyConstructor)
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#if defined(MOZ_WIDGET_COCOA)
|
||||
COMPONENT(MACUTILSIMPL, nsMacUtilsImplConstructor)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
|
|||
#include "nsWindowsRegKey.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
#include "nsMacUtilsImpl.h"
|
||||
#endif
|
||||
|
||||
|
@ -215,7 +215,7 @@ NS_GENERIC_AGGREGATED_CONSTRUCTOR_INIT(nsProperties, Init)
|
|||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUUIDGenerator, Init)
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacUtilsImpl)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "prprf.h"
|
||||
#if defined(XP_WIN)
|
||||
#include <windows.h>
|
||||
#elif defined(XP_MACOSX)
|
||||
#elif defined(MOZ_WIDGET_COCOA)
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#elif defined(MOZ_WIDGET_GTK2)
|
||||
#include <gtk/gtk.h>
|
||||
|
@ -486,7 +486,7 @@ ParseManifestCommon(NSLocationType aType, nsILocalFile* aFile,
|
|||
info.dwMajorVersion,
|
||||
info.dwMinorVersion);
|
||||
}
|
||||
#elif defined(XP_MACOSX)
|
||||
#elif defined(MOZ_WIDGET_COCOA)
|
||||
SInt32 majorVersion, minorVersion;
|
||||
if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) &&
|
||||
(Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr)) {
|
||||
|
|
|
@ -563,7 +563,7 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
|
|||
}
|
||||
return NS_NewNativeLocalFile(tString, PR_TRUE, aFile);
|
||||
}
|
||||
#elif defined(XP_MACOSX)
|
||||
#elif defined(MOZ_WIDGET_COCOA)
|
||||
{
|
||||
return GetOSXFolderType(kUserDomain, kTemporaryFolderType, aFile);
|
||||
}
|
||||
|
@ -897,7 +897,7 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
|
|||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
#if defined (XP_MACOSX)
|
||||
#if defined (MOZ_WIDGET_COCOA)
|
||||
nsresult
|
||||
GetOSXFolderType(short aDomain, OSType aFolderType, nsILocalFile **localFile)
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "nscore.h"
|
||||
#include "nsILocalFile.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
#include <Carbon/Carbon.h>
|
||||
#include "nsILocalFileMac.h"
|
||||
#include "prenv.h"
|
||||
|
@ -131,7 +131,7 @@ enum SystemDirectories {
|
|||
nsresult
|
||||
GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
|
||||
nsILocalFile** aFile);
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
nsresult
|
||||
GetOSXFolderType(short aDomain, OSType aFolderType, nsILocalFile **localFile);
|
||||
#endif
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include "prenv.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#if defined(MOZ_WIDGET_COCOA)
|
||||
#include <Carbon/Carbon.h>
|
||||
#include "nsILocalFileMac.h"
|
||||
#elif defined(XP_OS2)
|
||||
|
@ -68,7 +68,7 @@
|
|||
// WARNING: These hard coded names need to go away. They need to
|
||||
// come from localizable resources
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#if defined(MOZ_WIDGET_COCOA)
|
||||
#define APP_REGISTRY_NAME NS_LITERAL_CSTRING("Application Registry")
|
||||
#define ESSENTIAL_FILES NS_LITERAL_CSTRING("Essential Files")
|
||||
#elif defined(XP_WIN) || defined(XP_OS2)
|
||||
|
@ -84,7 +84,7 @@
|
|||
#define NS_ENV_PLUGINS_DIR "EnvPlugins" // env var MOZ_PLUGIN_PATH
|
||||
#define NS_USER_PLUGINS_DIR "UserPlugins"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
#define NS_MACOSX_USER_PLUGIN_DIR "OSXUserPlugins"
|
||||
#define NS_MACOSX_LOCAL_PLUGIN_DIR "OSXLocalPlugins"
|
||||
#define NS_MACOSX_JAVA2_PLUGIN_DIR "OSXJavaPlugins"
|
||||
|
@ -128,7 +128,7 @@ nsAppFileLocationProvider::GetFile(const char *prop, PRBool *persistent, nsIFile
|
|||
*_retval = nsnull;
|
||||
*persistent = PR_TRUE;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
FSRef fileRef;
|
||||
nsCOMPtr<nsILocalFileMac> macFile;
|
||||
#endif
|
||||
|
@ -194,7 +194,7 @@ nsAppFileLocationProvider::GetFile(const char *prop, PRBool *persistent, nsIFile
|
|||
if (NS_SUCCEEDED(rv))
|
||||
rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
|
||||
}
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
else if (nsCRT::strcmp(prop, NS_MACOSX_USER_PLUGIN_DIR) == 0)
|
||||
{
|
||||
if (::FSFindFolder(kUserDomain, kInternetPlugInFolderType, false, &fileRef) == noErr) {
|
||||
|
@ -324,7 +324,7 @@ NS_METHOD nsAppFileLocationProvider::GetProductDirectory(nsILocalFile **aLocalFi
|
|||
PRBool exists;
|
||||
nsCOMPtr<nsILocalFile> localDir;
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#if defined(MOZ_WIDGET_COCOA)
|
||||
FSRef fsRef;
|
||||
OSType folderType = aLocal ? (OSType) kCachedDataFolderType : (OSType) kDomainLibraryFolderType;
|
||||
OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef);
|
||||
|
@ -395,7 +395,7 @@ NS_METHOD nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsILocalFile **aL
|
|||
rv = GetProductDirectory(getter_AddRefs(localDir), aLocal);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#if defined(XP_MACOSX) || defined(XP_OS2) || defined(XP_WIN)
|
||||
#if defined(MOZ_WIDGET_COCOA) || defined(XP_OS2) || defined(XP_WIN)
|
||||
// These 3 platforms share this part of the path - do them as one
|
||||
rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("Profiles"));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -552,7 +552,7 @@ nsAppFileLocationProvider::GetFiles(const char *prop, nsISimpleEnumerator **_ret
|
|||
|
||||
if (!nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR_LIST))
|
||||
{
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
// As of Java for Mac OS X 10.5 Update 10, Apple has (in effect) deprecated Java Plugin2 on
|
||||
// on OS X 10.5, and removed the soft link to it from /Library/Internet Plug-Ins/. Java
|
||||
// Plugin2 is still present and usable, but there are no longer any links to it in the
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include "prenv.h"
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_WIDGET_COCOA
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#endif
|
||||
|
@ -78,7 +78,7 @@
|
|||
// For Windows platform, We are choosing Appdata folder as HOME
|
||||
#if defined (XP_WIN)
|
||||
#define HOME_DIR NS_WIN_APPDATA_DIR
|
||||
#elif defined (XP_MACOSX)
|
||||
#elif defined (MOZ_WIDGET_COCOA)
|
||||
#define HOME_DIR NS_OSX_HOME_DIR
|
||||
#elif defined (XP_UNIX)
|
||||
#define HOME_DIR NS_UNIX_HOME_DIR
|
||||
|
@ -139,7 +139,7 @@ nsDirectoryService::GetCurrentProcessDirectory(nsILocalFile** aFile)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#elif defined(XP_MACOSX)
|
||||
#elif defined(MOZ_WIDGET_COCOA)
|
||||
// Works even if we're not bundled.
|
||||
CFBundleRef appBundle = CFBundleGetMainBundle();
|
||||
if (appBundle != nsnull)
|
||||
|
@ -615,7 +615,7 @@ nsDirectoryService::GetFile(const char *prop, PRBool *persistent, nsIFile **_ret
|
|||
rv = GetSpecialSystemDirectory(OS_CurrentWorkingDirectory, getter_AddRefs(localFile));
|
||||
}
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#if defined(MOZ_WIDGET_COCOA)
|
||||
else if (inAtom == nsDirectoryService::sDirectory)
|
||||
{
|
||||
rv = GetOSXFolderType(kClassicDomain, kSystemFolderType, getter_AddRefs(localFile));
|
||||
|
|
|
@ -45,7 +45,7 @@ DIR_ATOM(sOS_CurrentWorkingDirectory, NS_OS_CURRENT_WORKING_DIR)
|
|||
DIR_ATOM(sOS_HomeDirectory, NS_OS_HOME_DIR)
|
||||
DIR_ATOM(sOS_DesktopDirectory, NS_OS_DESKTOP_DIR)
|
||||
DIR_ATOM(sInitCurrentProcess_dummy, NS_XPCOM_INIT_CURRENT_PROCESS_DIR)
|
||||
#if defined (XP_MACOSX)
|
||||
#if defined (MOZ_WIDGET_COCOA)
|
||||
DIR_ATOM(sDirectory, NS_OS_SYSTEM_DIR)
|
||||
DIR_ATOM(sTrashDirectory, NS_MAC_TRASH_DIR)
|
||||
DIR_ATOM(sStartupDirectory, NS_MAC_STARTUP_DIR)
|
||||
|
|
|
@ -86,11 +86,11 @@
|
|||
|
||||
/* Platform Specific Locations */
|
||||
|
||||
#if !defined (XP_UNIX) || defined(XP_MACOSX)
|
||||
#if !defined (XP_UNIX) || defined(MOZ_WIDGET_COCOA)
|
||||
#define NS_OS_SYSTEM_DIR "SysD"
|
||||
#endif
|
||||
|
||||
#if defined (XP_MACOSX)
|
||||
#if defined (MOZ_WIDGET_COCOA)
|
||||
#define NS_MAC_DESKTOP_DIR NS_OS_DESKTOP_DIR
|
||||
#define NS_MAC_TRASH_DIR "Trsh"
|
||||
#define NS_MAC_STARTUP_DIR "Strt"
|
||||
|
|
|
@ -63,7 +63,7 @@ void NS_ShutdownLocalFile()
|
|||
nsLocalFile::GlobalShutdown();
|
||||
}
|
||||
|
||||
#if !defined(XP_MACOSX) && !defined(XP_WIN)
|
||||
#if !defined(MOZ_WIDGET_COCOA) && !defined(XP_WIN)
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::InitWithFile(nsILocalFile *aFile)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче