From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Robert Newsgroups: gmane.emacs.devel Subject: configure and freetype, etc. under non-X Date: Fri, 13 Feb 2009 14:53:04 +0200 Message-ID: <3416C46E-796D-4DCD-9308-43E6359A2F0A@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: multipart/mixed; boundary=Apple-Mail-11-671830640 X-Trace: ger.gmane.org 1234529792 11535 80.91.229.12 (13 Feb 2009 12:56:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Feb 2009 12:56:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 13 13:57:47 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LXxbh-00045m-Bv for ged-emacs-devel@m.gmane.org; Fri, 13 Feb 2009 13:57:25 +0100 Original-Received: from localhost ([127.0.0.1]:33775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXxaN-0005Mv-GJ for ged-emacs-devel@m.gmane.org; Fri, 13 Feb 2009 07:56:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXxaI-0005Mc-61 for emacs-devel@gnu.org; Fri, 13 Feb 2009 07:55:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXxaG-0005MB-EO for emacs-devel@gnu.org; Fri, 13 Feb 2009 07:55:57 -0500 Original-Received: from [199.232.76.173] (port=37514 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXxaG-0005M6-6L for emacs-devel@gnu.org; Fri, 13 Feb 2009 07:55:56 -0500 Original-Received: from mail-fx0-f16.google.com ([209.85.220.16]:33257) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LXxaE-000755-OI for emacs-devel@gnu.org; Fri, 13 Feb 2009 07:55:55 -0500 Original-Received: by fxm9 with SMTP id 9so3091686fxm.18 for ; Fri, 13 Feb 2009 04:55:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:to:message-id :content-type:from:subject:date:x-mailer; bh=25wA0Ta9CUuzPj5mV2NuT5v4PdVwDZLQh8kbrT3yIyc=; b=Q5ddslitWp4YIX83DWk+eVYLbAbnY9vTmVy6OJH5USgcfWES7urXMGzZW/E1TE+Iby 8M5khKsDq+JjsPqsHdwjnAQazUa/ienDbtOtJAfeAh8dbd+R97QvrF+2qtEImApH9FSR R86wQfJY4QfHC1kUJVUglPu5K7JthTzciEfco= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=d2efUWzcdfeHYrB04RFhNX+zw9b1Xg4d1IWt1fzGX0lAWIcwRc+4yh1YYDkgoETKFJ QXEkZAVLYMqsJyIidYLCmxk3n27UtE8mp4eVPrw2Q5N4lHUrsoaV8z+l6B4nZpYKKvGE TOxdd0uZBrrgbz3NEvXV2KtfV5rcPO47tiwDo= Original-Received: by 10.103.11.5 with SMTP id o5mr1139113mui.132.1234529562601; Fri, 13 Feb 2009 04:52:42 -0800 (PST) Original-Received: from ?10.20.48.125? (gw1.panoulu.net [212.50.147.101]) by mx.google.com with ESMTPS id i7sm2898245mue.14.2009.02.13.04.52.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 13 Feb 2009 04:52:41 -0800 (PST) X-Mailer: Apple Mail (2.753.1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109039 Archived-At: --Apple-Mail-11-671830640 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed It appears that in configure.in the checks for freetype, xft, otf, and m17n_flt are done regardless of whether the user is compiling for an X11 environment. Under NS at least these are all unneeded, and doing the checks can cause unnecessary linking against these libraries if they happen to be present on the system. This can cause startup failure for this binary on other machines that lack those (actually unneeded) libraries. What's the best way to avoid this? The patch here disables these checks except under X11 and sets the variables to "no", but is there a different preferred way? --Apple-Mail-11-671830640 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=configFreetype.patch Content-Disposition: attachment; filename=configFreetype.patch Index: configure.in =================================================================== RCS file: /sources/emacs/emacs/configure.in,v retrieving revision 1.585 diff -u -p -r1.585 configure.in --- configure.in 4 Feb 2009 11:33:34 -0000 1.585 +++ configure.in 13 Feb 2009 12:51:32 -0000 @@ -1824,90 +1824,102 @@ either XPointer or XPointer*.])dnl CFLAGS=$late_CFLAGS fi -### Start of font-backend section. -PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2.0, HAVE_FC=yes, HAVE_FC=no) -test "${HAVE_FC}" = "no" && with_freetype=no +### Start of font-backend (under any platform) section. +# (nothing here yet -- this is a placeholder) +### End of font-backend (under any platform) section. + +### Start of font-backend (under X11) section. +if test "${HAVE_X11}" != "no"; then + PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2.0, HAVE_FC=yes, HAVE_FC=no) + test "${HAVE_FC}" = "no" && with_freetype=no ## Use -lXft if available, unless `--with-freetype=no' nor `--with-xft=no'. -HAVE_XFT=maybe -if test "x${with_freetype}" = "xno" || test "x${with_x}" = "xno"; then - with_xft="no"; -fi -if test "x${with_xft}" != "xno"; then - - PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no) - if test "$HAVE_XFT" != no; then - OLD_CPPFLAGS="$CPPFLAGS" - OLD_CFLAGS="$CFLAGS" - OLD_LIBS="$LIBS" - CPPFLAGS="$CPPFLAGS $XFT_CFLAGS" - CFLAGS="$CFLAGS $XFT_CFLAGS" - LIBS="$XFT_LIBS $LIBS" - AC_CHECK_HEADER(X11/Xft/Xft.h, - AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS)) + HAVE_XFT=maybe + if test "x${with_freetype}" = "xno" || test "x${with_x}" = "xno"; then + with_xft="no"; + fi + if test "x${with_xft}" != "xno"; then + + PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no) + if test "$HAVE_XFT" != no; then + OLD_CPPFLAGS="$CPPFLAGS" + OLD_CFLAGS="$CFLAGS" + OLD_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $XFT_CFLAGS" + CFLAGS="$CFLAGS $XFT_CFLAGS" + LIBS="$XFT_LIBS $LIBS" + AC_CHECK_HEADER(X11/Xft/Xft.h, + AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS)) + + if test "${HAVE_XFT}" = "yes"; then + AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.]) + AC_SUBST(XFT_LIBS) + C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS" + else + CPPFLAGS="$OLD_CPPFLAGS" + CFLAGS="$OLD_CFLAGS" + LIBS="$OLD_LIBS" + fi # "${HAVE_XFT}" = "yes" + fi # "$HAVE_XFT" != no + fi # "x${with_xft}" != "xno" + + dnl For the "Does Emacs use" message at the end. + if test "$HAVE_XFT" != "yes"; then + HAVE_XFT=no + fi + + HAVE_FREETYPE=no + ### Use -lfreetype if available, unless `--with-freetype=no'. if test "${HAVE_XFT}" = "yes"; then - AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.]) - AC_SUBST(XFT_LIBS) - C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS" - else - CPPFLAGS="$OLD_CPPFLAGS" - CFLAGS="$OLD_CFLAGS" - LIBS="$OLD_LIBS" - fi # "${HAVE_XFT}" = "yes" - fi # "$HAVE_XFT" != no -fi # "x${with_xft}" != "xno" - -dnl For the "Does Emacs use" message at the end. -if test "$HAVE_XFT" != "yes"; then - HAVE_XFT=no -fi + dnl As we use Xft, we anyway use freetype. + dnl In this case, there's no need of additional CFLAGS and LIBS. + HAVE_FREETYPE=yes + FONTCONFIG_CFLAGS= + FONTCONFIG_LIBS= + elif test "x${with_freetype}" != "xno" && test "x${with_x}" != "xno"; then + PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes, HAVE_FREETYPE=no) + fi -HAVE_FREETYPE=no -### Use -lfreetype if available, unless `--with-freetype=no'. -if test "${HAVE_XFT}" = "yes"; then - dnl As we use Xft, we anyway use freetype. - dnl In this case, there's no need of additional CFLAGS and LIBS. - HAVE_FREETYPE=yes - FONTCONFIG_CFLAGS= - FONTCONFIG_LIBS= -elif test "x${with_freetype}" != "xno" && test "x${with_x}" != "xno"; then - - PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes, HAVE_FREETYPE=no) -fi - -HAVE_LIBOTF=no -if test "${HAVE_FREETYPE}" = "yes"; then - AC_DEFINE(HAVE_FREETYPE, 1, - [Define to 1 if using the freetype and fontconfig libraries.]) - if test "${with_libotf}" != "no"; then - PKG_CHECK_MODULES(LIBOTF, libotf, HAVE_LIBOTF=yes, - HAVE_LIBOTF=no) - if test "$HAVE_LIBOTF" = "yes"; then - AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.]) - AC_CHECK_LIB(otf, OTF_get_variation_glyphs, - HAVE_OTF_GET_VARIATION_GLYPHS=yes, - HAVE_OTF_GET_VARIATION_GLYPHS=no) - if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then - AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1, - [Define to 1 if libotf has OTF_get_variation_glyphs.]) + HAVE_LIBOTF=no + if test "${HAVE_FREETYPE}" = "yes"; then + AC_DEFINE(HAVE_FREETYPE, 1, + [Define to 1 if using the freetype and fontconfig libraries.]) + if test "${with_libotf}" != "no"; then + PKG_CHECK_MODULES(LIBOTF, libotf, HAVE_LIBOTF=yes, + HAVE_LIBOTF=no) + if test "$HAVE_LIBOTF" = "yes"; then + AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.]) + AC_CHECK_LIB(otf, OTF_get_variation_glyphs, + HAVE_OTF_GET_VARIATION_GLYPHS=yes, + HAVE_OTF_GET_VARIATION_GLYPHS=no) + if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then + AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1, + [Define to 1 if libotf has OTF_get_variation_glyphs.]) + fi + fi fi + dnl FIXME should there be an error if HAVE_FREETYPE != yes? + dnl Does the new font backend require it, or can it work without it? fi - fi -dnl FIXME should there be an error if HAVE_FREETYPE != yes? -dnl Does the new font backend require it, or can it work without it? -fi -HAVE_M17N_FLT=no -if test "${HAVE_LIBOTF}" = yes; then - if test "${with_m17n_flt}" != "no"; then - PKG_CHECK_MODULES(M17N_FLT, m17n-flt, HAVE_M17N_FLT=yes, HAVE_M17N_FLT=no) - if test "$HAVE_M17N_FLT" = "yes"; then - AC_DEFINE(HAVE_M17N_FLT, 1, [Define to 1 if using libm17n-flt.]) + HAVE_M17N_FLT=no + if test "${HAVE_LIBOTF}" = yes; then + if test "${with_m17n_flt}" != "no"; then + PKG_CHECK_MODULES(M17N_FLT, m17n-flt, HAVE_M17N_FLT=yes, HAVE_M17N_FLT=no) + if test "$HAVE_M17N_FLT" = "yes"; then + AC_DEFINE(HAVE_M17N_FLT, 1, [Define to 1 if using libm17n-flt.]) + fi + fi fi - fi +else + HAVE_XFT=no + HAVE_FREETYPE=no + HAVE_LIBOTF=no + HAVE_M17N_FLT=no fi +### End of font-backend (under X11) section. AC_SUBST(FREETYPE_CFLAGS) AC_SUBST(FREETYPE_LIBS) @@ -1918,8 +1930,6 @@ AC_SUBST(LIBOTF_LIBS) AC_SUBST(M17N_FLT_CFLAGS) AC_SUBST(M17N_FLT_LIBS) -### End of font-backend section. - ### Use -lXpm if available, unless `--with-xpm=no'. HAVE_XPM=no if test "${HAVE_X11}" = "yes"; then --Apple-Mail-11-671830640 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-11-671830640--