diff --git a/src/configure b/src/configure index 31f75aed4e..5f3690303f 100755 --- a/src/configure +++ b/src/configure @@ -1356,7 +1356,7 @@ Optional Features: --enable-athena-check If auto-select GUI, check for Athena default=yes --enable-nextaw-check If auto-select GUI, check for neXtaw default=yes --enable-carbon-check If auto-select GUI, check for Carbon default=yes - --enable-macvim-check If auto-select GUI, check for MacVim default=yes + --enable-macvim-check If auto-select GUI, check for MacVim default=yes --disable-gtktest Do not try to compile and run a test GTK program --disable-acl Don't check for ACL support. --disable-gpm Don't use gpm (Linux mouse daemon). @@ -1366,7 +1366,8 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-mac-arch=ARCH current, intel, ppc or both + --with-macsdk=SDK SDK version (10.4, 10.5, 10.6, ...) + --with-macarchs=ARCHS space separated list of archs (i386 x86_64 ppc ...) --with-local-dir=PATH search PATH instead of /usr/local for local libraries. --without-local-dir do not search /usr/local for local libraries. --with-vim-name=NAME what to call the Vim executable @@ -1388,7 +1389,6 @@ Optional Packages: --with-motif-lib=STRING Library for Motif --with-tlib=library terminal library to be used --with-xcodecfg=CFG Debug, Release (default: Release) - --with-archs=ARCHS space separated list of archs (i386 x86_64 ppc ...) Some influential environment variables: CC C compiler command @@ -3677,26 +3677,32 @@ echo "${ECHO_T}no, Darwin support disabled" >&6; } echo "${ECHO_T}yes, Darwin support excluded" >&6; } fi - { echo "$as_me:$LINENO: checking --with-mac-arch argument" >&5 -echo $ECHO_N "checking --with-mac-arch argument... $ECHO_C" >&6; } -# Check whether --with-mac-arch was given. -if test "${with_mac_arch+set}" = set; then - withval=$with_mac_arch; MACARCH="$withval"; { echo "$as_me:$LINENO: result: $MACARCH" >&5 -echo "${ECHO_T}$MACARCH" >&6; } + { echo "$as_me:$LINENO: checking --with-macsdk argument" >&5 +echo $ECHO_N "checking --with-macsdk argument... $ECHO_C" >&6; } + +# Check whether --with-macsdk was given. +if test "${with_macsdk+set}" = set; then + withval=$with_macsdk; MACSDK="$withval"; { echo "$as_me:$LINENO: result: $MACSDK" >&5 +echo "${ECHO_T}$MACSDK" >&6; } else - MACARCH="current"; { echo "$as_me:$LINENO: result: defaulting to $MACARCH" >&5 -echo "${ECHO_T}defaulting to $MACARCH" >&6; } + MACSDK=""; { echo "$as_me:$LINENO: result: using default" >&5 +echo "${ECHO_T}using default" >&6; } fi - if test "x$MACARCH" = "xboth"; then - { echo "$as_me:$LINENO: checking for 10.4 universal SDK" >&5 -echo $ECHO_N "checking for 10.4 universal SDK... $ECHO_C" >&6; } - save_cppflags="$CPPFLAGS" + if test -n "$MACSDK"; then + { echo "$as_me:$LINENO: checking if SDK is supported" >&5 +echo $ECHO_N "checking if SDK is supported... $ECHO_C" >&6; } save_cflags="$CFLAGS" save_ldflags="$LDFLAGS" - CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + sdkflags="/Developer/SDKs/MacOSX$MACSDK" + if test "x$MACSDK" = "x10.4"; then + sdkflags="$sdkflags""u" + fi + sdkflags="$sdkflags.sdk -mmacosx-version-min=$MACSDK" + CFLAGS="$CFLAGS -isysroot $sdkflags" + LDFLAGS="$LDFLAGS -Wl,-syslibroot,$sdkflags" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3730,20 +3736,46 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - { echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + XCODEFLAGS="$XCODEFLAGS -sdk macosx$MACSDK MACOSX_DEPLOYMENT_TARGET=$MACSDK" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6; } - CFLAGS="$save_cflags" - { echo "$as_me:$LINENO: checking if Intel architecture is supported" >&5 -echo $ECHO_N "checking if Intel architecture is supported... $ECHO_C" >&6; } - CPPFLAGS="$CPPFLAGS -arch i386" - LDFLAGS="$save_ldflags -arch i386" - cat >conftest.$ac_ext <<_ACEOF + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + CFLAGS="$save_cflags" + LDFLAGS="$save_ldflags" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + fi + + + { echo "$as_me:$LINENO: checking --with-macarchs argument" >&5 +echo $ECHO_N "checking --with-macarchs argument... $ECHO_C" >&6; } + +# Check whether --with-macarchs was given. +if test "${with_macarchs+set}" = set; then + withval=$with_macarchs; ARCHS="$withval"; { echo "$as_me:$LINENO: result: $ARCHS" >&5 +echo "${ECHO_T}$ARCHS" >&6; } +else + ARCHS=""; { echo "$as_me:$LINENO: result: defaulting to native arch" >&5 +echo "${ECHO_T}defaulting to native arch" >&6; } +fi + + + if test -n "$ARCHS"; then + { echo "$as_me:$LINENO: checking if architectures are supported" >&5 +echo $ECHO_N "checking if architectures are supported... $ECHO_C" >&6; } + save_cflags="$CFLAGS" + save_ldflags="$LDFLAGS" + archflags=`echo "$ARCHS" | sed -e 's/[[:<:]]/-arch /g'` + CFLAGS="$CFLAGS $archflags" + LDFLAGS="$LDFLAGS $archflags" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3776,32 +3808,28 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; }; MACARCH="intel" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + XCODEFLAGS="$XCODEFLAGS ARCHS=\"$ARCHS\" ONLY_ACTIVE_ARCH=\"NO\"" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - MACARCH="ppc" - CPPFLAGS="$save_cppflags -arch ppc" - LDFLAGS="$save_ldflags -arch ppc" + { echo "$as_me:$LINENO: result: no, will build for native arch only" >&5 +echo "${ECHO_T}no, will build for native arch only" >&6; } + ARCHS="" + CFLAGS="$save_cflags" + LDFLAGS="$save_ldflags" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - elif test "x$MACARCH" = "xintel"; then - CPPFLAGS="$CPPFLAGS -arch intel" - LDFLAGS="$LDFLAGS -arch intel" - elif test "x$MACARCH" = "xppc"; then - CPPFLAGS="$CPPFLAGS -arch ppc" - LDFLAGS="$LDFLAGS -arch ppc" fi + if test -z "$ARCHS"; then + CFLAGS="$CFLAGS -m32" + LDFLAGS="$LDFLAGS -m32" + fi + if test "$enable_darwin" = "yes"; then MACOSX=yes @@ -4152,11 +4180,6 @@ fi fi fi fi - - if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then - CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-Oz/'` - fi - else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -8230,11 +8253,7 @@ echo "${ECHO_T}yes" >&6; }; GUITYPE=CARBONGUI datadir='${prefix}/Vim.app/Contents/Resources' - if test "x$MACARCH" = "xboth"; then - CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" - else - CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" - fi + CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" fi if test "$VIMNAME" = "vim"; then @@ -16484,9 +16503,6 @@ echo "${ECHO_T}yes" >&6; } echo "${ECHO_T}no" >&6; } fi fi -if test "x$MACARCH" = "xboth"; then - LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" -fi if test "x$MACOSX" = "xyes"; then { echo "$as_me:$LINENO: checking --with-xcodecfg argument" >&5 @@ -16504,85 +16520,6 @@ fi - - - { echo "$as_me:$LINENO: checking --with-archs argument" >&5 -echo $ECHO_N "checking --with-archs argument... $ECHO_C" >&6; } - -# Check whether --with-archs was given. -if test "${with_archs+set}" = set; then - withval=$with_archs; ARCHS="$withval"; { echo "$as_me:$LINENO: result: $ARCHS" >&5 -echo "${ECHO_T}$ARCHS" >&6; } -else - ARCHS=""; { echo "$as_me:$LINENO: result: defaulting to native arch" >&5 -echo "${ECHO_T}defaulting to native arch" >&6; } -fi - - - if test -n "$ARCHS"; then - { echo "$as_me:$LINENO: checking if architectures are supported" >&5 -echo $ECHO_N "checking if architectures are supported... $ECHO_C" >&6; } - save_cflags="$CFLAGS" - save_ldflags="$LDFLAGS" - archflags=`echo "$ARCHS" | sed -e 's/[[:<:]]/-arch /g'` - CFLAGS="$CFLAGS $archflags" - LDFLAGS="$LDFLAGS $archflags" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - XCODEFLAGS="$XCODEFLAGS ARCHS=\"$ARCHS\" ONLY_ACTIVE_ARCH=\"NO\"" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { echo "$as_me:$LINENO: result: no, will build for native arch only" >&5 -echo "${ECHO_T}no, will build for native arch only" >&6; } - ARCHS="" - CFLAGS="$save_cflags" - LDFLAGS="$save_ldflags" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - if test -z "$ARCHS"; then - CFLAGS="$CFLAGS -m32" - LDFLAGS="$LDFLAGS -m32" - fi - - fi diff --git a/src/configure.in b/src/configure.in index 2bcc32f324..6e702f2819 100644 --- a/src/configure.in +++ b/src/configure.in @@ -111,45 +111,63 @@ if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_RESULT([yes, Darwin support excluded]) fi - AC_MSG_CHECKING(--with-mac-arch argument) - AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both], - MACARCH="$withval"; AC_MSG_RESULT($MACARCH), - MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) - if test "x$MACARCH" = "xboth"; then - AC_MSG_CHECKING(for 10.4 universal SDK) - dnl There is a terrible inconsistency (but we appear to get away with it): - dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS - dnl doesn't, because "gcc -E" doesn't grok it. That means the configure - dnl tests using the preprocessor are actually done with the wrong header - dnl files. $LDFLAGS is set at the end, because configure uses it together - dnl with $CFLAGS and we can only have one -sysroot argument. - save_cppflags="$CPPFLAGS" + AC_MSG_CHECKING(--with-macsdk argument) + AC_ARG_WITH(macsdk, + [ --with-macsdk=SDK SDK version (10.4, 10.5, 10.6, ...)], + [ MACSDK="$withval"; AC_MSG_RESULT($MACSDK) ], + [ MACSDK=""; AC_MSG_RESULT(using default) ]) + + if test -n "$MACSDK"; then + AC_MSG_CHECKING(if SDK is supported) save_cflags="$CFLAGS" save_ldflags="$LDFLAGS" - CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" + sdkflags="/Developer/SDKs/MacOSX$MACSDK" + if test "x$MACSDK" = "x10.4"; then + sdkflags="$sdkflags""u" + fi + sdkflags="$sdkflags.sdk -mmacosx-version-min=$MACSDK" + CFLAGS="$CFLAGS -isysroot $sdkflags" + LDFLAGS="$LDFLAGS -Wl,-syslibroot,$sdkflags" AC_TRY_LINK([ ], [ ], - AC_MSG_RESULT(found, will make universal binary), - - AC_MSG_RESULT(not found) - CFLAGS="$save_cflags" - AC_MSG_CHECKING(if Intel architecture is supported) - CPPFLAGS="$CPPFLAGS -arch i386" - LDFLAGS="$save_ldflags -arch i386" - AC_TRY_LINK([ ], [ ], - AC_MSG_RESULT(yes); MACARCH="intel", - AC_MSG_RESULT(no, using PowerPC) - MACARCH="ppc" - CPPFLAGS="$save_cppflags -arch ppc" - LDFLAGS="$save_ldflags -arch ppc")) - elif test "x$MACARCH" = "xintel"; then - CPPFLAGS="$CPPFLAGS -arch intel" - LDFLAGS="$LDFLAGS -arch intel" - elif test "x$MACARCH" = "xppc"; then - CPPFLAGS="$CPPFLAGS -arch ppc" - LDFLAGS="$LDFLAGS -arch ppc" + [ AC_MSG_RESULT([yes]) + XCODEFLAGS="$XCODEFLAGS -sdk macosx$MACSDK MACOSX_DEPLOYMENT_TARGET=$MACSDK" ], + [ AC_MSG_RESULT([no]) + CFLAGS="$save_cflags" + LDFLAGS="$save_ldflags" ]) fi + + AC_MSG_CHECKING(--with-macarchs argument) + AC_ARG_WITH(macarchs, + [ --with-macarchs=ARCHS space separated list of archs (i386 x86_64 ppc ...)], + [ ARCHS="$withval"; AC_MSG_RESULT($ARCHS) ], + [ ARCHS=""; AC_MSG_RESULT(defaulting to native arch) ]) + + if test -n "$ARCHS"; then + AC_MSG_CHECKING(if architectures are supported) + save_cflags="$CFLAGS" + save_ldflags="$LDFLAGS" + archflags=`echo "$ARCHS" | sed -e 's/[[[:<:]]]/-arch /g'` + CFLAGS="$CFLAGS $archflags" + LDFLAGS="$LDFLAGS $archflags" + AC_TRY_LINK([ ], [ ], + [ AC_MSG_RESULT([yes]) + XCODEFLAGS="$XCODEFLAGS ARCHS=\"$ARCHS\" ONLY_ACTIVE_ARCH=\"NO\"" ], + [ AC_MSG_RESULT([no, will build for native arch only]) + ARCHS="" + CFLAGS="$save_cflags" + LDFLAGS="$save_ldflags" ]) + fi + if test -z "$ARCHS"; then + dnl Mac OS X 10.6 compiles 64 bit by default, but 64 bit is currently not + dnl supported. Compile 32 bit unless an architecture has been selected + dnl manually. + CFLAGS="$CFLAGS -m32" + LDFLAGS="$LDFLAGS -m32" + fi + + if test "$enable_darwin" = "yes"; then MACOSX=yes OS_EXTRA_SRC="os_macosx.c os_mac_conv.c"; @@ -176,14 +194,6 @@ if test "`(uname) 2>/dev/null`" = Darwin; then fi fi fi - - dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double - dnl free. This happens in expand_filename(), because the optimizer swaps - dnl two blocks of code, both using "repl", that can't be swapped. - if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then - CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'` - fi - else AC_MSG_RESULT(no) fi @@ -1435,7 +1445,7 @@ fi if test "x$SKIP_MACVIM" != "xYES" -a "$enable_gui_canon" != "macvim"; then AC_MSG_CHECKING(whether or not to look for MacVim) AC_ARG_ENABLE(macvim-check, - [ --enable-macvim-check If auto-select GUI, check for MacVim [default=yes]], + [ --enable-macvim-check If auto-select GUI, check for MacVim [default=yes]], , enable_macvim_check="yes") AC_MSG_RESULT($enable_macvim_check); if test "x$enable_macvim_check" = "xno"; then @@ -1464,11 +1474,7 @@ if test "x$MACOSX" = "xyes"; then dnl Sorry for the hard coded default datadir='${prefix}/Vim.app/Contents/Resources' - if test "x$MACARCH" = "xboth"; then - CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon" - else - CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" - fi + CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon" fi if test "$VIMNAME" = "vim"; then @@ -3256,9 +3262,6 @@ if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \ AC_MSG_RESULT(no) fi fi -if test "x$MACARCH" = "xboth"; then - LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" -fi if test "x$MACOSX" = "xyes"; then AC_MSG_CHECKING(--with-xcodecfg argument) @@ -3268,66 +3271,6 @@ if test "x$MACOSX" = "xyes"; then AC_MSG_RESULT($withval) ], [ AC_MSG_RESULT(using default) ]) - - dnl This is an attempt to support choice of SDKs, however it does not - dnl work to compile with different SDKs. Must figure out how to fix - dnl this before this option can be used. -dnl AC_MSG_CHECKING(--with-macsdk argument) -dnl AC_ARG_WITH(macsdk, -dnl [ --with-macsdk=SDK SDK version (10.4, 10.5, 10.6, ...)], -dnl [ macsdk="$withval"; AC_MSG_RESULT($macsdk) ], -dnl [ macsdk=""; AC_MSG_RESULT(using default) ]) -dnl -dnl if test -n "$macsdk"; then -dnl AC_MSG_CHECKING(if SDK is supported) -dnl save_cflags="$CFLAGS" -dnl save_ldflags="$LDFLAGS" -dnl sdkflags="/Developer/SDKs/MacOSX$macsdk" -dnl if test "x$macsdk" = "x10.4"; then -dnl sdkflags="$sdkflags""u" -dnl fi -dnl sdkflags="$sdkflags.sdk -mmacosx-version-min=$macsdk" -dnl CFLAGS="$CFLAGS -isysroot $sdkflags" -dnl LDFLAGS="$LDFLAGS -Wl,-syslibroot,$sdkflags" -dnl AC_TRY_LINK([ ], [ ], -dnl [ AC_MSG_RESULT([yes]) -dnl XCODEFLAGS="$XCODEFLAGS -sdk macosx$macsdk" ], -dnl [ AC_MSG_RESULT([no]) -dnl ARCHS="" -dnl CFLAGS="$save_cflags" -dnl LDFLAGS="$save_ldflags" ]) -dnl fi - - - AC_MSG_CHECKING(--with-archs argument) - AC_ARG_WITH(archs, - [ --with-archs=ARCHS space separated list of archs (i386 x86_64 ppc ...)], - [ ARCHS="$withval"; AC_MSG_RESULT($ARCHS) ], - [ ARCHS=""; AC_MSG_RESULT(defaulting to native arch) ]) - - if test -n "$ARCHS"; then - AC_MSG_CHECKING(if architectures are supported) - save_cflags="$CFLAGS" - save_ldflags="$LDFLAGS" - archflags=`echo "$ARCHS" | sed -e 's/[[[:<:]]]/-arch /g'` - CFLAGS="$CFLAGS $archflags" - LDFLAGS="$LDFLAGS $archflags" - AC_TRY_LINK([ ], [ ], - [ AC_MSG_RESULT([yes]) - XCODEFLAGS="$XCODEFLAGS ARCHS=\"$ARCHS\" ONLY_ACTIVE_ARCH=\"NO\"" ], - [ AC_MSG_RESULT([no, will build for native arch only]) - ARCHS="" - CFLAGS="$save_cflags" - LDFLAGS="$save_ldflags" ]) - fi - if test -z "$ARCHS"; then - dnl Mac OS X 10.6 compiles 64 bit by default, but 64 bit is currently not - dnl supported. Compile 32 bit unless an architecture has been selected - dnl manually. - CFLAGS="$CFLAGS -m32" - LDFLAGS="$LDFLAGS -m32" - fi - AC_SUBST(XCODEFLAGS) fi