summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2013-09-15 19:58:46 +0200
committerJan Djärv <jan.h.d@swipnet.se>2013-09-15 19:58:46 +0200
commit3fa2054efdfa3c22456072254e6c67682a595233 (patch)
treef882ecc281d2ac5d5aefd27e2c22ece5a0bb0ca4 /configure.ac
parentc089653d568d5c696f2d35e1bcf9bba64af85b97 (diff)
downloademacs-3fa2054efdfa3c22456072254e6c67682a595233.tar.gz
Port the font backend from the Mac port.
* configure.ac: Add check for OSX 10.5, required for macfont.o. * etc/NEWS: Mention the macfont backend. * src/Makefile.in (NS_OBJ, SOME_MACHINE_OBJECTS): Add macfont.o. * src/font.c (syms_of_font): Call syms_of_macfont. * src/font.h: Declare syms_of_macfont. * src/nsfns.m: Include macfont.h. (Fx_create_frame): Register macfont driver, make a better default font. (Fns_popup_font_panel): Get font from macfont driver, if used. * src/nsfont.m (ns_tmp_flags, ns_tmp_font): Remove. (nsfont_open): Set font driver type. Set font->ascent and font->descent. Figure out font instead of ns_tmp_font, and flags instead of ns_tmp_flags. Fix indentation. Remove call to ns_draw_text_decoration, moved to nsterm. * src/nsterm.m: Include macfont.h. (ns_tmp_flags, ns_tmp_font): Remove. (ns_compute_glyph_string_overhangs): Check for driver Qns. (ns_draw_glyph_string): Use local variables instead of ns_tmp_flags, ns_tmp_font. Call ns_draw_text_decoration here instead of nsfont.m. (changeFont:): Fix code style. Check for font driver type when getiing font. * src/nsterm.h (FONT_DESCENT, FONT_ASCENT): Define to (f)->ascent and (f)->descent.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac34
1 files changed, 29 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index ab2e48b6f0f..86a5f300982 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1623,7 +1623,10 @@ fail;
[AC_MSG_ERROR([`--with-ns' was specified, but the include
files are missing or cannot be compiled.])])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
+ macfont_file=""
+ if test "${NS_IMPL_COCOA}" = "yes"; then
+ AC_MSG_CHECKING([for OSX 10.4 or newer])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
[
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
@@ -1635,13 +1638,33 @@ fail;
])],
ns_osx_have_104=yes,
ns_osx_have_104=no)
+ AC_MSG_RESULT([$ns_osx_have_104])
+
+ if test $ns_osx_have_104 = no; then
+ AC_MSG_ERROR([`OSX 10.4 or newer is required']);
+ fi
+ AC_MSG_CHECKING([for OSX 10.5 or newer])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
+ [
+#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ ; /* OK */
+#else
+#error "OSX 10.5 not found"
+#endif
+#endif
+ ])],
+ ns_osx_have_105=yes,
+ ns_osx_have_105=no)
+ AC_MSG_RESULT([$ns_osx_have_105])
+ if test $ns_osx_have_105 = yes; then
+ macfont_file="macfont.o"
+ fi
+ fi
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <Foundation/NSObjCRuntime.h>],
[NSInteger i;])],
ns_have_nsinteger=yes,
ns_have_nsinteger=no)
- if test $ns_osx_have_104 = no; then
- AC_MSG_ERROR([`OSX 10.4 or newer is required']);
- fi
if test $ns_have_nsinteger = yes; then
AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.])
fi
@@ -1677,7 +1700,8 @@ if test "${HAVE_NS}" = yes; then
leimdir="\${ns_appresdir}/leim"
INSTALL_ARCH_INDEP_EXTRA=
fi
- NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
+
+ NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o $macfont_file"
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"