allow --enable-default-toolkit=cocoa in makefiles and default toolkit can now be overridden on platform that don't use X11. r=cls/sr=hyatt. bug#121496

This commit is contained in:
pinkerton%netscape.com 2002-01-24 15:11:18 +00:00
parent d8d1417669
commit 7180e5e8d1
23 changed files with 57 additions and 41 deletions

View File

@ -98,7 +98,7 @@ tier_0_dirs = \
tier_1_dirs = js
# MacOSX needs to build lib for MoreFiles before xpcom
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
tier_1_dirs += lib/mac/MoreFiles
endif

View File

@ -304,6 +304,7 @@ MOZ_ENABLE_GTK2 = @MOZ_ENABLE_GTK2@
MOZ_ENABLE_XLIB = @MOZ_ENABLE_XLIB@
MOZ_ENABLE_QT = @MOZ_ENABLE_QT@
MOZ_ENABLE_PHOTON = @MOZ_ENABLE_PHOTON@
MOZ_ENABLE_COCOA = @MOZ_ENABLE_COCOA@
MOZ_ENABLE_XREMOTE = @MOZ_ENABLE_XREMOTE@
MOZ_GTK_CFLAGS = @MOZ_GTK_CFLAGS@

View File

@ -448,6 +448,7 @@ XPCOM_LIBS='-L$(DIST)/bin -lxpcom'
MOZ_COMPONENT_NSPR_LIBS='-L$(DIST)/bin $(NSPR_LIBS)'
MOZ_COMPONENT_XPCOM_LIBS='-L$(DIST)/bin -lxpcom'
_PLATFORM_DEFAULT_TOOLKIT=gtk
MOZ_WIDGET_TOOLKIT_LDFLAGS='-lwidget_$(MOZ_WIDGET_TOOLKIT)'
MOZ_GFX_TOOLKIT_LDFLAGS='-lgfx_$(MOZ_WIDGET_TOOLKIT) $(MOZ_XLIBRGB_LDFLAGS)'
WIDGET_DLL='\"libwidget_$(MOZ_WIDGET_TOOLKIT)$(DLL_SUFFIX)\"'
@ -723,7 +724,7 @@ case "$target" in
*-beos*)
no_x=yes
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
MOZ_WIDGET_TOOLKIT="beos"
_PLATFORM_DEFAULT_TOOLKIT="beos"
DSO_LDOPTS='-nostart -Wl,-h -Wl,$@'
TK_LIBS='-lbe -lroot'
LIBS="$LIBS -lbe"
@ -772,7 +773,7 @@ case "$target" in
AC_DEFINE(TARGET_API_MAC_CARBON)
no_x=yes
MACOSX=1
MOZ_WIDGET_TOOLKIT='mac'
_PLATFORM_DEFAULT_TOOLKIT='mac'
DSO_LDOPTS="$DSO_LDOPTS -arch ppc -install_name @executable_path/\$@"
TK_LIBS='-framework Carbon /System/Library/Frameworks/Carbon.framework/Carbon'
TK_CFLAGS="-I/Developer/Headers/FlatCarbon -F/System/Library/Frameworks"
@ -948,7 +949,7 @@ case "$target" in
AC_DEFINE(STDC_HEADERS)
TARGET_MD_ARCH=win32
OS_TARGET=WINNT
MOZ_WIDGET_TOOLKIT='windows'
_PLATFORM_DEFAULT_TOOLKIT='windows'
BIN_SUFFIX='.exe'
USE_SHORT_LIBNAME=1
@ -1025,7 +1026,7 @@ case "$target" in
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/config-defs.h -D_POSIX_C_SOURCE=199506'
if test "$with_x" != "yes"
then
MOZ_WIDGET_TOOLKIT="photon"
_PLATFORM_DEFAULT_TOOLKIT="photon"
AC_DEFINE(NO_X11)
TK_CFLAGS='-I/usr/include/photon'
TK_LIBS='-lph'
@ -1086,7 +1087,7 @@ case "$target" in
DSO_PIC_CFLAGS=''
OS_ARCH=OS2
OS_TARGET=OS2
MOZ_WIDGET_TOOLKIT=os2
_PLATFORM_DEFAULT_TOOLKIT=os2
MOZ_WIDGET_TOOLKIT_LDFLAGS='$(DIST)/lib/wdgt$(MOZ_WIDGET_TOOLKIT)'
MOZ_GFX_TOOLKIT_LDFLAGS='$(DIST)/lib/gfx_$(MOZ_WIDGET_TOOLKIT)'
WIDGET_DLL='\"wdgt$(MOZ_WIDGET_TOOLKIT)$(DLL_SUFFIX)\"'
@ -1193,7 +1194,7 @@ alpha*-*-osf*)
dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
AC_DEFINE(STDC_HEADERS)
if test "$no_x" = "yes"; then
MOZ_WIDGET_TOOLKIT='photon'
_PLATFORM_DEFAULT_TOOLKIT='photon'
TK_CFLAGS='-I/usr/nto/include/photon'
TK_LIBS='-lphoton -lphrender'
AC_DEFINE(NO_X11)
@ -2602,9 +2603,8 @@ dnl =
dnl ========================================================
MOZ_ARG_HEADER(Toolkit Options)
if test "$no_x" != "yes"; then
dnl ========================================================
dnl = Select the default x toolkit
dnl = Select the default toolkit
dnl ========================================================
dnl XXX - remove this next milestone
if test -z "$enable_default_toolkit" && test "$enable_toolkit"; then
@ -2612,22 +2612,33 @@ if test "$no_x" != "yes"; then
fi
MOZ_ARG_ENABLE_STRING(default-toolkit,
[ --enable-default-toolkit=TK
Select default toolkit (default=gtk)],
Select default toolkit (default=<platform specific>)],
[ _DEFAULT_TOOLKIT=$enableval ],
[ _DEFAULT_TOOLKIT=gtk ])
[ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
if test "$_DEFAULT_TOOLKIT" = "gtk" \
-o "$_DEFAULT_TOOLKIT" = "qt" \
-o "$_DEFAULT_TOOLKIT" = "gtk2" \
-o "$_DEFAULT_TOOLKIT" = "xlib"
-o "$_DEFAULT_TOOLKIT" = "xlib" \
-o "$_DEFAULT_TOOLKIT" = "os2" \
-o "$_DEFAULT_TOOLKIT" = "beos" \
-o "$_DEFAULT_TOOLKIT" = "photon" \
-o "$_DEFAULT_TOOLKIT" = "mac" \
-o "$_DEFAULT_TOOLKIT" = "windows" \
-o "$_DEFAULT_TOOLKIT" = "cocoa"
then
dnl nglayout only supports building with one toolkit,
dnl so ignore everything after the first comma (",").
MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
else
AC_MSG_ERROR(Toolkit must be xlib, gtk, gtk2 or qt.)
if test "$no_x" != "yes"; then
AC_MSG_ERROR([Toolkit must be xlib, gtk, gtk2 or qt.])
else
AC_MSG_ERROR([Toolkit must be $_PLATFORM_DEFAULT_TOOLKIT.])
fi
fi
if test "$no_x" != "yes"; then
dnl ========================================================
dnl = Gtk support hackery =
dnl ========================================================
@ -2709,6 +2720,10 @@ photon)
MOZ_ENABLE_PHOTON=1
AC_DEFINE(MOZ_WIDGET_PHOTON)
;;
cocoa)
MOZ_ENABLE_COCOA=1
AC_DEFINE(MOZ_WIDGET_COCOA)
;;
esac
if test "$MOZ_ENABLE_XREMOTE"; then
@ -2880,6 +2895,7 @@ AC_SUBST(MOZ_ENABLE_XLIB)
AC_SUBST(MOZ_ENABLE_GTK2)
AC_SUBST(MOZ_ENABLE_QT)
AC_SUBST(MOZ_ENABLE_PHOTON)
AC_SUBST(MOZ_ENABLE_COCOA)
AC_SUBST(MOZ_ENABLE_XREMOTE)
AC_SUBST(MOZ_GTK_CFLAGS)
AC_SUBST(MOZ_GTK_LDFLAGS)

View File

@ -29,7 +29,7 @@ include $(DEPTH)/config/autoconf.mk
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
DIRS = win
else
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
DIRS = mac
else
DIRS = unix

View File

@ -58,7 +58,7 @@ EXPORTS = \
nsThemeConstants.h \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXPORTS += nsIPrintingContext.h
endif

View File

@ -109,7 +109,7 @@ ifneq (,$(filter gtk xlib beos,$(MOZ_WIDGET_TOOLKIT)))
CPPSRCS += imgScaler.cpp
endif
ifeq (mac, $(MOZ_WIDGET_TOOLKIT))
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
CPPSRCS += \
mac/nsRegionPool.cpp \
$(NULL)
@ -121,7 +121,7 @@ EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
ifeq (mac, $(MOZ_WIDGET_TOOLKIT))
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += \
$(TK_LIBS) \
$(NULL)

View File

@ -26,7 +26,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifeq (mac,$(MOZ_WIDGET_TOOLKIT))
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
THEME_PLATFORM = mac
else
THEME_PLATFORM = win

View File

@ -74,7 +74,7 @@ CPPSRCS = \
nsWindowCreator.cpp \
$(NULL)
ifeq (,$(filter beos os2 photon mac windows,$(MOZ_WIDGET_TOOLKIT)))
ifeq (,$(filter beos os2 photon mac cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
DIRS += unix
VIEWER_TK_LIBS = unix/$(MOZ_WIDGET_TOOLKIT)/libviewer_$(MOZ_WIDGET_TOOLKIT)_s.a
else
@ -88,7 +88,7 @@ endif
ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
TOOLKIT_CPPSRCS = nsPhMain.cpp nsPhMenu.cpp
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TOOLKIT_CPPSRCS = nsMacMain.cpp
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)

View File

@ -55,7 +55,7 @@ EXPORTS = \
nsIXRemoteWidgetHelper.h \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXPORTS += nsWidgetAtoms.h nsWidgetAtomList.h
endif
@ -79,7 +79,7 @@ XPIDLSRCS = \
nsIXRemoteClient.idl \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
XPIDLSRCS += nsIEventSink.idl
endif

View File

@ -28,7 +28,7 @@ include $(DEPTH)/config/autoconf.mk
DIRS = xpwidgets support
ifneq (,$(filter beos os2 mac,$(MOZ_WIDGET_TOOLKIT)))
ifneq (,$(filter beos os2 mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
DIRS += $(MOZ_WIDGET_TOOLKIT)
endif

View File

@ -55,11 +55,11 @@ CPPSRCS = \
nsClipboardHelper.cpp \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
CPPSRCS += nsWidgetAtoms.cpp
endif
ifneq (,$(filter beos os2 mac windows,$(MOZ_WIDGET_TOOLKIT)))
ifneq (,$(filter beos os2 mac cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
CPPSRCS += nsBaseFilePicker.cpp
REQUIRES += docshell view intl
endif

View File

@ -38,7 +38,7 @@ EXPORTS = \
$(NULL)
# pull in MoreFiles for MacOSX
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
REQUIRES += macmorefiles
endif
@ -89,7 +89,7 @@ EXTRA_DSO_LDOPTS += -liberty
endif
# pull in MoreFiles for MacOSX
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += $(DEPTH)/dist/lib/libmacmorefiles_s.a
endif
@ -118,7 +118,7 @@ ifdef GC_LEAK_DETECTOR
DEFINES += -DGC_LEAK_DETECTOR
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
CXXFLAGS += $(TK_CFLAGS)
EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif

View File

@ -62,7 +62,7 @@ CPPSRCS = \
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
CPPSRCS += nsLocalFileOS2.cpp
#else
#ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
#ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
#CPPSRCS += nsLocalFileMac.cpp
#CSRCS += macDirectoryCopy.c
else
@ -97,7 +97,7 @@ EXPORTS = \
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
EXPORTS += nsLocalFileOS2.h
else
#ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
#ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
#EXPORTS += nsLocalFileMac.h nsILocalFileMac.h
#else
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)

View File

@ -47,7 +47,7 @@ XPIDLSRCS = \
nsINativeAppSupport.idl \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
XPIDLSRCS += nsIInternetConfigService.idl
else
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)

View File

@ -329,7 +329,7 @@ nsStaticComponents.cpp: nsStaticComponents.cpp.in Makefile Makefile.in $(FINAL_L
sed -e "s|%MODULE_LIST%|$(foreach m, $(_COMPONENT_LIST),MODULE($(m)),)|" \
> $@
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
ifdef MOZ_DEBUG
APP_NAME = MozillaDebug
@ -343,7 +343,6 @@ libs:: $(PROGRAM)
cp -R $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app
cp -RL $(DIST)/bin $(DIST)/$(APP_NAME).app/Contents/MacOS
cp -RL $(srcdir)/macbuild/mach.icns $(DIST)/$(APP_NAME).app/Contents/Resources/mach.icns
endif
echo_objs:

View File

@ -29,7 +29,7 @@ include $(DEPTH)/config/autoconf.mk
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
DIRS = win
else
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
DIRS = mac
else
DIRS = unix

View File

@ -30,7 +30,7 @@ DIRS = resources
include $(topsrcdir)/config/rules.mk
ifeq (mac,$(MOZ_WIDGET_TOOLKIT))
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
CHROME_PLATFORM = mac
else
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))

View File

@ -29,7 +29,7 @@ include $(DEPTH)/config/autoconf.mk
ifneq (,$(filter os2 windows,$(MOZ_WIDGET_TOOLKIT)))
DIRS = win
else
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
DIRS = mac
else
DIRS = unix

View File

@ -29,7 +29,7 @@ include $(DEPTH)/config/autoconf.mk
ifneq (,$(filter os2 windows,$(MOZ_WIDGET_TOOLKIT)))
DIRS = win
else
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
DIRS = mac
else
DIRS = unix

View File

@ -28,7 +28,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifeq (,$(filter beos os2 mac windows,$(MOZ_WIDGET_TOOLKIT)))
ifeq (,$(filter beos os2 mac cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
DIRS = public src
endif

View File

@ -32,7 +32,7 @@ CHROME_DEPS = build.dtd
include $(topsrcdir)/config/rules.mk
ifeq (mac,$(MOZ_WIDGET_TOOLKIT))
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
CHROME_PLATFORM = mac
else
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))

View File

@ -29,7 +29,7 @@ include $(DEPTH)/config/autoconf.mk
ifneq (,$(filter os2 windows,$(MOZ_WIDGET_TOOLKIT)))
DIRS = win
else
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
DIRS = mac
else
DIRS = unix

View File

@ -62,7 +62,7 @@ DEFINES += -DSTANDALONE_REGISTRY
include $(topsrcdir)/config/rules.mk
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
LIBS += -lmacmorefiles_s
LDFLAGS += $(TK_LIBS)
endif