diff options
| author | Paul Eggert | 2013-12-27 11:14:10 -0800 |
|---|---|---|
| committer | Paul Eggert | 2013-12-27 11:14:10 -0800 |
| commit | 5eedd0b92daed0c4178a5bea79e95962edd0874b (patch) | |
| tree | eee30bdb7d5bd10350c3d70c1771bfea3419f546 | |
| parent | 8a6212d71de51594bea1231c90152735615d7a38 (diff) | |
| download | emacs-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-- | ChangeLog | 11 | ||||
| -rw-r--r-- | configure.ac | 38 |
2 files changed, 31 insertions, 18 deletions
| @@ -1,3 +1,14 @@ | |||
| 1 | 2013-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 | |||
| 1 | 2013-12-27 Jan Djärv <jan.h.d@swipnet.se> | 12 | 2013-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 |
| 40 | fi | 40 | fi |
| 41 | 41 | ||
| 42 | case "`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 | ;; | ||
| 52 | esac | ||
| 53 | |||
| 54 | dnl Set emacs_config_options to the options of 'configure', quoted for the shell, | 42 | dnl Set emacs_config_options to the options of 'configure', quoted for the shell, |
| 55 | dnl and then quoted again for a C string. Separate options with spaces. | 43 | dnl and then quoted again for a C string. Separate options with spaces. |
| 56 | dnl Add some environment variables, if they were passed via the environment | 44 | dnl Add some environment variables, if they were passed via the environment |
| @@ -93,6 +81,15 @@ done | |||
| 93 | AC_CONFIG_HEADERS(src/config.h:src/config.in) | 81 | AC_CONFIG_HEADERS(src/config.h:src/config.in) |
| 94 | AC_CONFIG_SRCDIR(src/lisp.h) | 82 | AC_CONFIG_SRCDIR(src/lisp.h) |
| 95 | AC_CONFIG_AUX_DIR(build-aux) | 83 | AC_CONFIG_AUX_DIR(build-aux) |
| 84 | |||
| 85 | xcsdkdir= | ||
| 86 | AC_CHECK_PROGS(XCRUN, [xcrun]) | ||
| 87 | if 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` | ||
| 91 | fi | ||
| 92 | |||
| 96 | dnl Fairly arbitrary, older versions might work too. | 93 | dnl Fairly arbitrary, older versions might work too. |
| 97 | AM_INIT_AUTOMAKE(1.11) | 94 | AM_INIT_AUTOMAKE(1.11) |
| 98 | 95 | ||
| @@ -650,12 +647,17 @@ fi | |||
| 650 | #### Choose a compiler. | 647 | #### Choose a compiler. |
| 651 | 648 | ||
| 652 | dnl Sets GCC=yes if using gcc. | 649 | dnl Sets GCC=yes if using gcc. |
| 653 | if test x$opsys = xdarwin && test x"$XCRUN" != x; then | 650 | AC_PROG_CC |
| 654 | AC_PROG_CC([gcc cc cl clang "$XCRUN gcc" "$XCRUN clang"]) | 651 | if 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 |
| 657 | else | ||
| 658 | AC_PROG_CC | ||
| 659 | fi | 661 | fi |
| 660 | AM_PROG_CC_C_O | 662 | AM_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>])]) |