--- ChangeLog | 6 + configure | 985 +++++++++++++++++++++++---------------------------- configure.ac | 234 ++++++------ 3 files changed, 561 insertions(+), 664 deletions(-)
diff --git a/ChangeLog b/ChangeLog index b0adb41d..883cb7e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-01-12 Ladislav Michl <la...@linux-mips.org> + + * configure: + * configure.ac: + Initial changes to make package cross-compilation aware. + 2020-01-11 Ladislav Michl <la...@linux-mips.org> * configure: diff --git a/configure b/configure index 14d52bae..d1473906 100755 --- a/configure +++ b/configure @@ -612,7 +612,6 @@ OBJ_MERGE_CMD_FLAG USE_ARC ac_cv_objc_threaded objc_threaded -CLANG_CC OBJC_LIB_FLAG cc_gnuruntime GNUSTEP_INSTALL_LD_SO_CONF @@ -683,17 +682,18 @@ CHOWN TAR NM LN_S +GNUSTEP_HAS_PKGCONFIG INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM -DLLTOOL -AR -RANLIB -CYGWIN cc_bundle cc_cppprecomp +CLANG_CC EGREP GREP +RANLIB +DLLTOOL +AR ac_ct_OBJCXX OBJCXXFLAGS OBJCXX @@ -708,8 +708,8 @@ CPPFLAGS LDFLAGS CFLAGS CC +CYGWIN ac_cv_library_combo -GNUSTEP_HAS_PKGCONFIG target_os target_vendor target_cpu @@ -2318,8 +2318,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # have an Objective-C runtime available yet. # -targetArgument=${target} - ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -2460,48 +2458,13 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- -# Extract the first word of "pkgconfig", so it can be a program name with args. -set dummy pkgconfig; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GNUSTEP_HAS_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GNUSTEP_HAS_PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_GNUSTEP_HAS_PKGCONFIG="$GNUSTEP_HAS_PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in no -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNUSTEP_HAS_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GNUSTEP_HAS_PKGCONFIG" && ac_cv_path_GNUSTEP_HAS_PKGCONFIG="yes" - ;; -esac -fi -GNUSTEP_HAS_PKGCONFIG=$ac_cv_path_GNUSTEP_HAS_PKGCONFIG -if test -n "$GNUSTEP_HAS_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUSTEP_HAS_PKGCONFIG" >&5 -$as_echo "$GNUSTEP_HAS_PKGCONFIG" >&6; } +if test x"${host}" = x"${target}" ; then + cross_compiling=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + cross_compiling=yes + ac_tool_prefix=${target_alias}- fi - - #-------------------------------------------------------------------- # Setup the library combination #-------------------------------------------------------------------- @@ -2541,24 +2504,101 @@ $as_echo "$ac_cv_library_combo" >&6; } OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | awk -F- '{print $1}'` # The ng runtime library setting requires clang rather than gcc +defaultng=no if test "$OBJC_RUNTIME_LIB" = "ng"; then - defaultng=yes; + defaultng=yes +fi + +#-------------------------------------------------------------------- +# specific target_os options +#-------------------------------------------------------------------- +case "$target_os" in + freebsd* | openbsd* ) + INCLUDES="$INCLUDES -I/usr/local/include" + LIB_DIR="$LIB_DIR -L/usr/local/lib";; + netbsd*) INCLUDES="$INCLUDES -I/usr/pkg/include" + LIB_DIR="$LIB_DIR -Wl,-R/usr/pkg/lib -L/usr/pkg/lib";; +esac + +#-------------------------------------------------------------------- +# Determine the host, build, and target systems +#-------------------------------------------------------------------- +case $host_os in + *cygwin* ) + MINGW32=no + MINGW64=no + CYGWIN=yes + MSWIND=yes;; + *mingw32* ) + MINGW32=yes + MINGW64=no + CYGWIN=no + MSWIND=yes;; + *mingw64* ) + MINGW32=no + MINGW64=yes + CYGWIN=no + MSWIND=yes;; + * ) + MINGW32=no + MINGW64=no + CYGWIN=no + MSWIND=no;; +esac + + +if test "$MINGW32" = yes; then + echo "hosted on mingw32 .." + export SHELL=sh + if test "$OBJC_RUNTIME_LIB" = ng; then + export CC=${CC:-clang} + else + export CC=${CC:-gcc} + fi + export AR=${AR:-ar} + export RANLIB=${RANLIB:-ranlib} + export DLLTOOL=${DLLTOOL:-dlltool} +elif test "$MINGW64" = yes; then + echo "hosted on mingw64 .." + export SHELL=sh + if test "$OBJC_RUNTIME_LIB" = ng; then + export CC=${CC:-clang} + else + export CC=${CC:-gcc} + fi + export AR=${AR:-ar} + export RANLIB=${RANLIB:-ranlib} + export DLLTOOL=${DLLTOOL:-dlltool} +elif test "$CYGWIN" = yes; then + echo "hosted on cygwin .." + if test "$OBJC_RUNTIME_LIB" = ng; then + export CC=${CC:-clang} + else + export CC=${CC:-gcc} + fi + export AR=${AR:-ar} + export RANLIB=${RANLIB:-ranlib} + export DLLTOOL=${DLLTOOL:-dlltool} +fi + +if test ${defaultng} = yes; then if test "$OBJCC" = ""; then - OBJCC=clang + OBJCC=${ac_tool_prefix}clang fi if test "$CC" = ""; then - CC=clang + CC=${ac_tool_prefix}clang fi if test "$OBJCXX" = ""; then - OBJCXX=clang++ + OBJCXX=${ac_tool_prefix}clang++ fi if test "$CXX" = ""; then - CXX=clang++ + CXX=${ac_tool_prefix}clang++ fi -else - defaultng=no; fi +#-------------------------------------------------------------------- +# Find the binary and compile tools +#-------------------------------------------------------------------- ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4001,253 +4041,108 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -# We may use egrep for some tests further down below -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - -#-------------------------------------------------------------------- -# Check if we are using Apple cc -#-------------------------------------------------------------------- -cc_cppprecomp=0 -cc_byndle=0 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for apple compiler flags" >&5 -$as_echo_n "checking for apple compiler flags... " >&6; } -cc_cppprecomp=`${CC} -no-cpp-precomp 2>&1 | grep -c "unrecognized"` -cc_bundle=`${CC} -bundle 2>&1 | grep -c "couldn"` -# 0 means we have the flag -if test $cc_cppprecomp = 0; then - cc_cppprecomp=yes -else - cc_cppprecomp=no fi -if test $cc_bundle = 0; then - cc_bundle=yes +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - cc_bundle=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_bundle" >&5 -$as_echo "$cc_bundle" >&6; } - - -#-------------------------------------------------------------------- -# specific target_os options -#-------------------------------------------------------------------- -case "$target_os" in - freebsd* | openbsd* ) - INCLUDES="$INCLUDES -I/usr/local/include" - LIB_DIR="$LIB_DIR -L/usr/local/lib";; - netbsd*) INCLUDES="$INCLUDES -I/usr/pkg/include" - LIB_DIR="$LIB_DIR -Wl,-R/usr/pkg/lib -L/usr/pkg/lib";; -esac - -#-------------------------------------------------------------------- -# Determine the host, build, and target systems -#-------------------------------------------------------------------- -case $host_os in - *cygwin* ) - MINGW32=no - MINGW64=no - CYGWIN=yes - MSWIND=yes;; - *mingw32* ) - MINGW32=yes - MINGW64=no - CYGWIN=no - MSWIND=yes;; - *mingw64* ) - MINGW32=no - MINGW64=yes - CYGWIN=no - MSWIND=yes;; - * ) - MINGW32=no - MINGW64=no - CYGWIN=no - MSWIND=no;; -esac - - - - -if test "$MINGW32" = yes; then - echo "hosted on mingw32 .." - export SHELL=sh - if test "$OBJC_RUNTIME_LIB" = ng; then - export CC=${CC:-clang} - else - export CC=${CC:-gcc} - fi - export AR=${AR:-ar} - export RANLIB=${RANLIB:-ranlib} - export DLLTOOL=${DLLTOOL:-dlltool} -elif test "$MINGW64" = yes; then - echo "hosted on mingw64 .." - export SHELL=sh - if test "$OBJC_RUNTIME_LIB" = ng; then - export CC=${CC:-clang} + if test "x$ac_ct_AR" = x; then + AR="" else - export CC=${CC:-gcc} - fi - export AR=${AR:-ar} - export RANLIB=${RANLIB:-ranlib} - export DLLTOOL=${DLLTOOL:-dlltool} -elif test "$CYGWIN" = yes; then - echo "hosted on cygwin .." - if test "$OBJC_RUNTIME_LIB" = ng; then - export CC=${CC:-clang} - else - export CC=${CC:-gcc} + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR fi - export AR=${AR:-ar} - export RANLIB=${RANLIB:-ranlib} - export DLLTOOL=${DLLTOOL:-dlltool} +else + AR="$ac_cv_prog_AR" fi -#-------------------------------------------------------------------- -# Find the binary and compile tools -#-------------------------------------------------------------------- -if test "x$target" != "x$host"; then - echo "cross compiling from $host to $target .." - cross_compiling="yes" - if test "$OBJC_RUNTIME_LIB" = ng; then - # Extract the first word of ""${targetArgument}-clang"", so it can be a program name with args. -set dummy "${targetArgument}-clang"; ac_word=$2 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4256,7 +4151,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC=" "${targetArgument}-clang"" + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4264,29 +4159,30 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="clang" fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - else - # Extract the first word of ""${targetArgument}-gcc"", so it can be a program name with args. -set dummy "${targetArgument}-gcc"; ac_word=$2 +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4295,7 +4191,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC=" "${targetArgument}-gcc"" + ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4303,22 +4199,35 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="gcc" fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL fi - # Extract the first word of ""${targetArgument}-ranlib"", so it can be a program name with args. -set dummy "${targetArgument}-ranlib"; ac_word=$2 +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : @@ -4334,7 +4243,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB=" "${targetArgument}-ranlib"" + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4342,7 +4251,6 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib" fi fi RANLIB=$ac_cv_prog_RANLIB @@ -4355,15 +4263,18 @@ $as_echo "no" >&6; } fi - # Extract the first word of ""${targetArgument}-ar"", so it can be a program name with args. -set dummy "${targetArgument}-ar"; ac_word=$2 +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4372,7 +4283,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR=" "${targetArgument}-ar"" + ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4380,66 +4291,188 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi - # Extract the first word of ""${targetArgument}-dlltool"", so it can be a program name with args. -set dummy "${targetArgument}-dlltool"; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : + +# We may use egrep for some tests further down below +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL=" "${targetArgument}-dlltool"" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done done IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool" + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP fi + + fi fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5 +$as_echo_n "checking whether the compiler is clang... " >&6; } +# Note that ${GCC} is set to "yes" for GNU Compatible Compiler +# not only GCC itself +if test ! x"${GCC}" = x"yes" ; then + CLANG_CC=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if "${CC}" -v 2>&1 | grep -q 'clang version'; then + CLANG_CC=yes + else + CLANG_CC=no + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CLANG_CC}" >&5 +$as_echo "${CLANG_CC}" >&6; } -else - if test "$OBJC_RUNTIME_LIB" = ng; then - # - # Detect compiler support for Blocks; perhaps someday -fblocks won't be - # required, in which case we'll need to change this. - # - saveCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fblocks" - ac_ext=c +if test ${defaultng} = yes; then + # Detect compiler support for Blocks; perhaps someday -fblocks won't be + # required, in which case we'll need to change this. + saveCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fblocks" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -4459,192 +4492,50 @@ main () _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac64v_blocks="yes" + ac64v_blocks="yes" else - ac_cv_blocks="no" + ac_cv_blocks="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saveCFLAGS" - ac_ext=c + CFLAGS="$saveCFLAGS" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "$ac_cv_blocks" = no; then - as_fn_error $? "Your compiler doesn't appear to support blocks. To fix this use the CC environment varibale to specify a different compiler (or use a different library-combo)" "$LINENO" 5; - fi - fi - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + if test "$ac_cv_blocks" = no; then + as_fn_error $? "Your compiler doesn't appear to support blocks. To fix this use the CC environment varibale to specify a different compiler (or use a different library-combo)" "$LINENO" 5; fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +#-------------------------------------------------------------------- +# Check if we are using Apple cc +#-------------------------------------------------------------------- +cc_cppprecomp=0 +cc_byndle=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for apple compiler flags" >&5 +$as_echo_n "checking for apple compiler flags... " >&6; } +cc_cppprecomp=`${CC} -no-cpp-precomp 2>&1 | grep -c "unrecognized"` +cc_bundle=`${CC} -bundle 2>&1 | grep -c "couldn"` +# 0 means we have the flag +if test $cc_cppprecomp = 0; then + cc_cppprecomp=yes else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi + cc_cppprecomp=no fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } +if test $cc_bundle = 0; then + cc_bundle=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + cc_bundle=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_bundle" >&5 +$as_echo "$cc_bundle" >&6; } - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi -fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -4776,6 +4667,48 @@ else $as_echo "no" >&6; }; fi +# Extract the first word of "pkgconfig", so it can be a program name with args. +set dummy pkgconfig; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GNUSTEP_HAS_PKGCONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GNUSTEP_HAS_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GNUSTEP_HAS_PKGCONFIG="$GNUSTEP_HAS_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in no +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GNUSTEP_HAS_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GNUSTEP_HAS_PKGCONFIG" && ac_cv_path_GNUSTEP_HAS_PKGCONFIG="yes" + ;; +esac +fi +GNUSTEP_HAS_PKGCONFIG=$ac_cv_path_GNUSTEP_HAS_PKGCONFIG +if test -n "$GNUSTEP_HAS_PKGCONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUSTEP_HAS_PKGCONFIG" >&5 +$as_echo "$GNUSTEP_HAS_PKGCONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s @@ -5891,25 +5824,6 @@ fi # But we need to compute, and print out, what flag we're using now. OBJC_FINAL_LIB_FLAG="$OBJC_LIB_FLAG" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5 -$as_echo_n "checking whether the compiler is clang... " >&6; } -if test ! x"${GCC}" = x"yes" ; then - CLANG_CC=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -else - if "${CC}" -v 2>&1 | grep -q 'clang version'; then - CLANG_CC=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - CLANG_CC=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi -fi - - saved_CFLAGS="$CFLAGS" saved_LIBS="$LIBS" CFLAGS="$CFLAGS -x objective-c -I$srcdir $OBJC_CPPFLAGS $OBJC_LDFLAGS" @@ -6426,18 +6340,15 @@ fi # To work around this, we use -Wl,-r with clang, and -r with GCC. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the flag to use to do partial linking" >&5 $as_echo_n "checking for the flag to use to do partial linking... " >&6; } -gs_cv_using_clang=`${CC} --version 2>&5 | grep -c "clang"` -if test x"${gs_cv_using_clang}" = x"0" ; then - OBJ_MERGE_CMD_FLAG=-r - { $as_echo "$as_me:${as_lineno-$LINENO}: result: -r" >&5 -$as_echo "-r" >&6; } -else +if test ${CLANG_CC} = yes; then OBJ_MERGE_CMD_FLAG=-Wl,-r - { $as_echo "$as_me:${as_lineno-$LINENO}: result: -Wl,-r" >&5 -$as_echo "-Wl,-r" >&6; } +else + OBJ_MERGE_CMD_FLAG=-r fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${OBJ_MERGE_CMD_FLAG}" >&5 +$as_echo "${OBJ_MERGE_CMD_FLAG}" >&6; } #-------------------------------------------------------------------- # Check for the GCC version - this is used in the following tests @@ -6445,9 +6356,9 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the GCC version" >&5 $as_echo_n "checking for the GCC version... " >&6; } -if test ! x"${GCC}" = x"yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: it's not gcc" >&5 -$as_echo "no: it's not gcc" >&6; } +if test ${CLANG_CC} = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not gcc" >&5 +$as_echo "not gcc" >&6; } else # Running gcc -dumpversion we get something like 2.95.4 or # egcs-2.91.66 or 3.0.2 or 3.1 20011211 @@ -6470,8 +6381,8 @@ else gs_cv_gcc_parsed_version=${gs_cv_gcc_major_version}.${gs_cv_gcc_minor_version} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: version: ${gs_cv_gcc_parsed_version}" >&5 -$as_echo "version: ${gs_cv_gcc_parsed_version}" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${gs_cv_gcc_parsed_version}" >&5 +$as_echo "${gs_cv_gcc_parsed_version}" >&6; } fi # Do not restore LIBS and CFLAGS yet as we need to test if the @@ -6546,10 +6457,8 @@ fi # Check if we need -shared-libgcc linker flags -if test x"$USE_OBJC_EXCEPTIONS" = x"yes" -a x"${GCC}" = x"yes"; then - if test x"$CLANG_CC" = x"no"; then - LDFLAGS="$LDFLAGS -shared-libgcc" - fi +if test x"$USE_OBJC_EXCEPTIONS" = x"yes" -a ${CLANG_CC} = no; then + LDFLAGS="$LDFLAGS -shared-libgcc" fi #-------------------------------------------------------------------- @@ -6569,7 +6478,7 @@ AUTO_DEPENDENCIES="" if test "$CYGWIN" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: autodependencies do not work on cygwin" >&5 $as_echo "no: autodependencies do not work on cygwin" >&6; } -elif test ! ${GCC} = "yes" ; then +elif test ${CLANG_CC} = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: it's not gcc" >&5 $as_echo "no: it's not gcc" >&6; } else @@ -6612,7 +6521,7 @@ GCC_WITH_PRECOMPILED_HEADERS="no" # First, a preliminary test. If this is not gcc, precompiled headers # are not supported. -if test ! "${GCC}" = "yes" ; then +if test ${CLANG_CC} = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: it's not gcc" >&5 $as_echo "no: it's not gcc" >&6; } else @@ -6654,7 +6563,7 @@ $as_echo_n "checking if the compiler requires -shared flag to build for Solaris. # set SOLARIS_SHARED to yes if gcc => 4.x SOLARIS_SHARED="" -if test ! ${GCC} = "yes" ; then +if test ${CLANG_CC} = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no: it's not gcc" >&5 $as_echo "no: it's not gcc" >&6; } else diff --git a/configure.ac b/configure.ac index d470527e..8c9ae7f1 100644 --- a/configure.ac +++ b/configure.ac @@ -39,11 +39,14 @@ AC_CONFIG_SRCDIR([application.make]) # have an Objective-C runtime available yet. # -targetArgument=${target} +AC_CANONICAL_TARGET -AC_CANONICAL_TARGET([]) - -AC_PATH_PROG(GNUSTEP_HAS_PKGCONFIG, pkgconfig, yes, no) +if test x"${host}" = x"${target}" ; then + cross_compiling=no +else + cross_compiling=yes + ac_tool_prefix=${target_alias}- +fi #-------------------------------------------------------------------- # Setup the library combination @@ -98,61 +101,10 @@ AC_MSG_RESULT($ac_cv_library_combo) OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | awk -F- '{print $1}'` # The ng runtime library setting requires clang rather than gcc +defaultng=no if test "$OBJC_RUNTIME_LIB" = "ng"; then - defaultng=yes; - if test "$OBJCC" = ""; then - OBJCC=clang - fi - if test "$CC" = ""; then - CC=clang - fi - if test "$OBJCXX" = ""; then - OBJCXX=clang++ - fi - if test "$CXX" = ""; then - CXX=clang++ - fi -else - defaultng=no; -fi - -AC_PROG_CC -AC_PROG_CPP - -# We also look for a C++ compiler. While not strictly needed, some -# people use gnustep-make to compile C++ code. It's nice to detect a -# C++ compiler, if we have one, and automatically use it to -# compile/link C++ code. :-) -AC_PROG_CXX - -# Similarly for the ObjC++ compiler... -AC_PROG_OBJCXX - -# We may use egrep for some tests further down below -AC_PROG_EGREP - -#-------------------------------------------------------------------- -# Check if we are using Apple cc -#-------------------------------------------------------------------- -cc_cppprecomp=0 -cc_byndle=0 -AC_MSG_CHECKING([for apple compiler flags]) -cc_cppprecomp=`${CC} -no-cpp-precomp 2>&1 | grep -c "unrecognized"` -cc_bundle=`${CC} -bundle 2>&1 | grep -c "couldn"` -# 0 means we have the flag -if test $cc_cppprecomp = 0; then - cc_cppprecomp=yes -else - cc_cppprecomp=no + defaultng=yes fi -if test $cc_bundle = 0; then - cc_bundle=yes -else - cc_bundle=no -fi -AC_MSG_RESULT($cc_bundle) -AC_SUBST(cc_cppprecomp) -AC_SUBST(cc_bundle) #-------------------------------------------------------------------- # specific target_os options @@ -192,8 +144,6 @@ case $host_os in esac AC_SUBST(CYGWIN) -AC_EXEEXT -AC_OBJEXT if test "$MINGW32" = yes; then echo "hosted on mingw32 .." export SHELL=sh @@ -228,50 +178,99 @@ elif test "$CYGWIN" = yes; then export DLLTOOL=${DLLTOOL:-dlltool} fi +if test ${defaultng} = yes; then + if test "$OBJCC" = ""; then + OBJCC=${ac_tool_prefix}clang + fi + if test "$CC" = ""; then + CC=${ac_tool_prefix}clang + fi + if test "$OBJCXX" = ""; then + OBJCXX=${ac_tool_prefix}clang++ + fi + if test "$CXX" = ""; then + CXX=${ac_tool_prefix}clang++ + fi +fi + #-------------------------------------------------------------------- # Find the binary and compile tools #-------------------------------------------------------------------- -if test "x$target" != "x$host"; then - echo "cross compiling from $host to $target .." - cross_compiling="yes" - if test "$OBJC_RUNTIME_LIB" = ng; then - AC_CHECK_PROG(CC, "${targetArgument}-clang", dnl - "${targetArgument}-clang", clang) +AC_PROG_CC +AC_PROG_CPP + +# We also look for a C++ compiler. While not strictly needed, some +# people use gnustep-make to compile C++ code. It's nice to detect a +# C++ compiler, if we have one, and automatically use it to +# compile/link C++ code. :-) +AC_PROG_CXX + +# Similarly for the ObjC++ compiler... +AC_PROG_OBJCXX + +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(DLLTOOL, dlltool) +AC_PROG_RANLIB + +# We may use egrep for some tests further down below +AC_PROG_EGREP + +AC_MSG_CHECKING(whether the compiler is clang) +# Note that ${GCC} is set to "yes" for GNU Compatible Compiler +# not only GCC itself +if test ! x"${GCC}" = x"yes" ; then + CLANG_CC=no +else + if "${CC}" -v 2>&1 | grep -q 'clang version'; then + CLANG_CC=yes else - AC_CHECK_PROG(CC, "${targetArgument}-gcc", dnl - "${targetArgument}-gcc", gcc) + CLANG_CC=no fi - AC_CHECK_PROG(RANLIB, "${targetArgument}-ranlib", dnl - "${targetArgument}-ranlib", ranlib) - AC_CHECK_PROG(AR, "${targetArgument}-ar", dnl - "${targetArgument}-ar", ar) - AC_CHECK_PROG(DLLTOOL, "${targetArgument}-dlltool", dnl - "${targetArgument}-dlltool", dlltool) -else - if test "$OBJC_RUNTIME_LIB" = ng; then - # - # Detect compiler support for Blocks; perhaps someday -fblocks won't be - # required, in which case we'll need to change this. - # - saveCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fblocks" - AC_LANG_PUSH(C) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[(void)^{int i; i = 0; }();])], [ - ac64v_blocks="yes" - ], [ - ac_cv_blocks="no" - ]) - CFLAGS="$saveCFLAGS" - AC_LANG_POP(C) - if test "$ac_cv_blocks" = no; then - AC_MSG_ERROR([Your compiler doesn't appear to support blocks. To fix this use the CC environment varibale to specify a different compiler (or use a different library-combo)]); - fi +fi +AC_MSG_RESULT(${CLANG_CC}) +AC_SUBST(CLANG_CC) + +if test ${defaultng} = yes; then + # Detect compiler support for Blocks; perhaps someday -fblocks won't be + # required, in which case we'll need to change this. + saveCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fblocks" + AC_LANG_PUSH(C) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[(void)^{int i; i = 0; }();])], [ + ac64v_blocks="yes" + ], [ + ac_cv_blocks="no" + ]) + CFLAGS="$saveCFLAGS" + AC_LANG_POP(C) + if test "$ac_cv_blocks" = no; then + AC_MSG_ERROR([Your compiler doesn't appear to support blocks. To fix this use the CC environment varibale to specify a different compiler (or use a different library-combo)]); fi - AC_CHECK_PROG(AR, ar, ar) - AC_CHECK_PROG(DLLTOOL, dlltool, dlltool) - AC_PROG_RANLIB fi +#-------------------------------------------------------------------- +# Check if we are using Apple cc +#-------------------------------------------------------------------- +cc_cppprecomp=0 +cc_byndle=0 +AC_MSG_CHECKING([for apple compiler flags]) +cc_cppprecomp=`${CC} -no-cpp-precomp 2>&1 | grep -c "unrecognized"` +cc_bundle=`${CC} -bundle 2>&1 | grep -c "couldn"` +# 0 means we have the flag +if test $cc_cppprecomp = 0; then + cc_cppprecomp=yes +else + cc_cppprecomp=no +fi +if test $cc_bundle = 0; then + cc_bundle=yes +else + cc_bundle=no +fi +AC_MSG_RESULT($cc_bundle) +AC_SUBST(cc_cppprecomp) +AC_SUBST(cc_bundle) + AC_PROG_INSTALL AC_MSG_CHECKING([if 'install -p' works]) @@ -308,6 +307,8 @@ else AC_MSG_RESULT(no); fi +AC_PATH_PROG(GNUSTEP_HAS_PKGCONFIG, pkgconfig, yes, no) + AC_PROG_LN_S([]) AC_CHECK_PROGS(NM, gnm, nm) @@ -1219,21 +1220,6 @@ AC_SUBST(OBJC_LIB_FLAG) # But we need to compute, and print out, what flag we're using now. OBJC_FINAL_LIB_FLAG="$OBJC_LIB_FLAG" -AC_MSG_CHECKING(whether the compiler is clang) -if test ! x"${GCC}" = x"yes" ; then - CLANG_CC=no - AC_MSG_RESULT(no) -else - if "${CC}" -v 2>&1 | grep -q 'clang version'; then - CLANG_CC=yes - AC_MSG_RESULT(yes) - else - CLANG_CC=no - AC_MSG_RESULT(no) - fi -fi -AC_SUBST(CLANG_CC) - saved_CFLAGS="$CFLAGS" saved_LIBS="$LIBS" CFLAGS="$CFLAGS -x objective-c -I$srcdir $OBJC_CPPFLAGS $OBJC_LDFLAGS" @@ -1496,24 +1482,22 @@ AC_SUBST(USE_ARC) # # To work around this, we use -Wl,-r with clang, and -r with GCC. AC_MSG_CHECKING(for the flag to use to do partial linking) -gs_cv_using_clang=`${CC} --version 2>&5 | grep -c "clang"` -if test x"${gs_cv_using_clang}" = x"0" ; then - OBJ_MERGE_CMD_FLAG=-r - AC_MSG_RESULT([-r]) -else +if test ${CLANG_CC} = yes; then OBJ_MERGE_CMD_FLAG=-Wl,-r - AC_MSG_RESULT([-Wl,-r]) +else + OBJ_MERGE_CMD_FLAG=-r fi AC_SUBST(OBJ_MERGE_CMD_FLAG) +AC_MSG_RESULT(${OBJ_MERGE_CMD_FLAG}) #-------------------------------------------------------------------- # Check for the GCC version - this is used in the following tests #-------------------------------------------------------------------- AC_MSG_CHECKING(for the GCC version) -if test ! x"${GCC}" = x"yes" ; then - AC_MSG_RESULT(no: it's not gcc) +if test ${CLANG_CC} = yes; then + AC_MSG_RESULT(not gcc) else # Running gcc -dumpversion we get something like 2.95.4 or # egcs-2.91.66 or 3.0.2 or 3.1 20011211 @@ -1536,7 +1520,7 @@ else gs_cv_gcc_parsed_version=${gs_cv_gcc_major_version}.${gs_cv_gcc_minor_version} - AC_MSG_RESULT(version: ${gs_cv_gcc_parsed_version}) + AC_MSG_RESULT(${gs_cv_gcc_parsed_version}) fi # Do not restore LIBS and CFLAGS yet as we need to test if the @@ -1605,10 +1589,8 @@ fi AC_SUBST(USE_OBJC_EXCEPTIONS) # Check if we need -shared-libgcc linker flags -if test x"$USE_OBJC_EXCEPTIONS" = x"yes" -a x"${GCC}" = x"yes"; then - if test x"$CLANG_CC" = x"no"; then - LDFLAGS="$LDFLAGS -shared-libgcc" - fi +if test x"$USE_OBJC_EXCEPTIONS" = x"yes" -a ${CLANG_CC} = no; then + LDFLAGS="$LDFLAGS -shared-libgcc" fi #-------------------------------------------------------------------- @@ -1626,7 +1608,7 @@ AC_MSG_CHECKING(if the compiler supports autodependencies) AUTO_DEPENDENCIES="" if test "$CYGWIN" = yes; then AC_MSG_RESULT(no: autodependencies do not work on cygwin) -elif test ! ${GCC} = "yes" ; then +elif test ${CLANG_CC} = yes; then AC_MSG_RESULT(no: it's not gcc) else if test "${gs_cv_gcc_major_version}" -ge "3" >&5 2>&5; then @@ -1665,7 +1647,7 @@ GCC_WITH_PRECOMPILED_HEADERS="no" # First, a preliminary test. If this is not gcc, precompiled headers # are not supported. -if test ! "${GCC}" = "yes" ; then +if test ${CLANG_CC} = yes; then AC_MSG_RESULT(no: it's not gcc) else if test "${gs_cv_gcc_parsed_version}" = "4.1" >&5 2>&5; then @@ -1702,7 +1684,7 @@ AC_MSG_CHECKING(if the compiler requires -shared flag to build for Solaris) # set SOLARIS_SHARED to yes if gcc => 4.x SOLARIS_SHARED="" -if test ! ${GCC} = "yes" ; then +if test ${CLANG_CC} = yes; then AC_MSG_RESULT(no: it's not gcc) else if test "${gs_cv_gcc_major_version}" -ge "4" >&5 2>&5; then -- 2.25.0.rc2