aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2013-12-27 11:14:10 -0800
committerPaul Eggert2013-12-27 11:14:10 -0800
commit5eedd0b92daed0c4178a5bea79e95962edd0874b (patch)
treeeee30bdb7d5bd10350c3d70c1771bfea3419f546
parent8a6212d71de51594bea1231c90152735615d7a38 (diff)
downloademacs-5eedd0b92daed0c4178a5bea79e95962edd0874b.tar.gz
emacs-5eedd0b92daed0c4178a5bea79e95962edd0874b.zip
Port xcrun configuration to GNU/Linux.
* configure.ac (xcsdkdir): Default to empty. (XCRUN): Don't require Darwin for xcrun. Move xcrun checking to just before AM_INIT_AUTOMAKE, to make the dependency between it and automake clearer. (CC): Don't use AC_PROG_CC twice; only the first use expands to the shell code that is wanted, which breaks 'configure' on non-Darwin platforms. Instead, fix CC by hand if it's not found.
-rw-r--r--ChangeLog11
-rw-r--r--configure.ac38
2 files changed, 31 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 107c28ca074..80e988f533a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
12013-12-27 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port xcrun configuration to GNU/Linux.
4 * configure.ac (xcsdkdir): Default to empty.
5 (XCRUN): Don't require Darwin for xcrun. Move xcrun checking to
6 just before AM_INIT_AUTOMAKE, to make the dependency between it
7 and automake clearer.
8 (CC): Don't use AC_PROG_CC twice; only the first use expands to the
9 shell code that is wanted, which breaks 'configure' on non-Darwin
10 platforms. Instead, fix CC by hand if it's not found.
11
12013-12-27 Jan Djärv <jan.h.d@swipnet.se> 122013-12-27 Jan Djärv <jan.h.d@swipnet.se>
2 13
3 * configure.ac: Detect xcrun on OSX and use it for make, gcc and 14 * configure.ac: Detect xcrun on OSX and use it for make, gcc and
diff --git a/configure.ac b/configure.ac
index ca37219f1b2..f0659457a79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,18 +39,6 @@ then
39 esac 39 esac
40fi 40fi
41 41
42case "`uname 2>/dev/null`" in
43 *Darwin*)
44 xcsdkdir=
45 AC_CHECK_PROGS(XCRUN, [xcrun])
46 if test x"$XCRUN" != x; then
47 AC_CHECK_PROGS(MAKE, [make "$XCRUN make"])
48 export MAKE
49 xcsdkdir="`$XCRUN --show-sdk-path 2>/dev/null`"
50 fi
51 ;;
52esac
53
54dnl Set emacs_config_options to the options of 'configure', quoted for the shell, 42dnl Set emacs_config_options to the options of 'configure', quoted for the shell,
55dnl and then quoted again for a C string. Separate options with spaces. 43dnl and then quoted again for a C string. Separate options with spaces.
56dnl Add some environment variables, if they were passed via the environment 44dnl Add some environment variables, if they were passed via the environment
@@ -93,6 +81,15 @@ done
93AC_CONFIG_HEADERS(src/config.h:src/config.in) 81AC_CONFIG_HEADERS(src/config.h:src/config.in)
94AC_CONFIG_SRCDIR(src/lisp.h) 82AC_CONFIG_SRCDIR(src/lisp.h)
95AC_CONFIG_AUX_DIR(build-aux) 83AC_CONFIG_AUX_DIR(build-aux)
84
85xcsdkdir=
86AC_CHECK_PROGS(XCRUN, [xcrun])
87if test -n "$XCRUN"; then
88 AC_CHECK_PROGS(MAKE, [make "$XCRUN make"])
89 test -n "$MAKE" && export MAKE
90 xcsdkdir=`$XCRUN --show-sdk-path 2>/dev/null`
91fi
92
96dnl Fairly arbitrary, older versions might work too. 93dnl Fairly arbitrary, older versions might work too.
97AM_INIT_AUTOMAKE(1.11) 94AM_INIT_AUTOMAKE(1.11)
98 95
@@ -650,12 +647,17 @@ fi
650#### Choose a compiler. 647#### Choose a compiler.
651 648
652dnl Sets GCC=yes if using gcc. 649dnl Sets GCC=yes if using gcc.
653if test x$opsys = xdarwin && test x"$XCRUN" != x; then 650AC_PROG_CC
654 AC_PROG_CC([gcc cc cl clang "$XCRUN gcc" "$XCRUN clang"]) 651if test -n "$XCRUN"; then
652 if test -z "$CC"; then
653 if $XCRUN gcc --version >/dev/null 2>&1; then
654 CC="$XCRUN gcc"
655 elif $XCRUN clang --version >/dev/null 2>&1; then
656 CC="$XCRUN clang"
657 fi
658 fi
655 AC_CHECK_PROGS(AR, [ar "$XCRUN ar"]) 659 AC_CHECK_PROGS(AR, [ar "$XCRUN ar"])
656 test x"$AR" != x && export AR 660 test -n "$AR" && export AR
657else
658 AC_PROG_CC
659fi 661fi
660AM_PROG_CC_C_O 662AM_PROG_CC_C_O
661 663
@@ -3293,7 +3295,7 @@ if test "${with_xml2}" != "no"; then
3293 # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc. 3295 # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc.
3294 if test "${HAVE_LIBXML2}" != "yes" -a "$opsys" = "darwin"; then 3296 if test "${HAVE_LIBXML2}" != "yes" -a "$opsys" = "darwin"; then
3295 SAVE_CPPFLAGS="$CPPFLAGS" 3297 SAVE_CPPFLAGS="$CPPFLAGS"
3296 CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2" 3298 CPPFLAGS="$CPPFLAGS -I'$xcsdkdir/usr/include/libxml2'"
3297 AC_CHECK_HEADER(libxml/HTMLparser.h, 3299 AC_CHECK_HEADER(libxml/HTMLparser.h,
3298 [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, , 3300 [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, ,
3299 [#include <libxml/HTMLparser.h>])]) 3301 [#include <libxml/HTMLparser.h>])])