+rm -f conftest*])
+if test $ac_cv_prog_cxx_c_o = no; then
+ AC_DEFINE(CXX_NO_MINUS_C_MINUS_O, 1,
+ [Define to 1 if your C++ compiler doesn't accept
+ -c and -o together.])
+fi
+AC_LANG_POP([C++])dnl
+])# AC_PROG_CXX_C_O
+
+
+# ------------------------------ #
+# 3d. The Objective C compiler. #
+# ------------------------------ #
+
+
+# AC_LANG_PREPROC(Objective C)
+# ----------------------------
+# Find the Objective C preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
+AC_DEFUN([AC_LANG_PREPROC(Objective C)],
+[AC_REQUIRE([AC_PROG_OBJCPP])])
+
+
+# AC_PROG_OBJCPP
+# --------------
+# Find a working Objective C preprocessor.
+AC_DEFUN([AC_PROG_OBJCPP],
+[AC_REQUIRE([AC_PROG_OBJC])dnl
+AC_ARG_VAR([OBJCPP], [Objective C preprocessor])dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+AC_LANG_PUSH(Objective C)dnl
+AC_MSG_CHECKING([how to run the Objective C preprocessor])
+if test -z "$OBJCPP"; then
+ AC_CACHE_VAL(ac_cv_prog_OBJCPP,
+ [dnl
+ # Double quotes because OBJCPP needs to be expanded
+ for OBJCPP in "$OBJC -E" "/lib/cpp"
+ do
+ _AC_PROG_PREPROC_WORKS_IFELSE([break])
+ done
+ ac_cv_prog_OBJCPP=$OBJCPP
+ ])dnl
+ OBJCPP=$ac_cv_prog_OBJCPP
+else
+ ac_cv_prog_OBJCPP=$OBJCPP
+fi
+AC_MSG_RESULT([$OBJCPP])
+_AC_PROG_PREPROC_WORKS_IFELSE([],
+ [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])])
+AC_SUBST(OBJCPP)dnl
+AC_LANG_POP(Objective C)dnl
+])# AC_PROG_OBJCPP
+
+
+# AC_LANG_COMPILER(Objective C)
+# -----------------------------
+# Find the Objective C compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able.
+AC_DEFUN([AC_LANG_COMPILER(Objective C)],
+[AC_REQUIRE([AC_PROG_OBJC])])
+
+
+
+# AC_PROG_OBJC([LIST-OF-COMPILERS])
+# ---------------------------------
+# LIST-OF-COMPILERS is a space separated list of Objective C compilers to
+# search for (if not specified, a default list is used). This just gives
+# the user an opportunity to specify an alternative search list for the
+# Objective C compiler.
+# objcc StepStone Objective-C compiler (also "standard" name for OBJC)
+# objc David Stes' POC. If you installed this, you likely want it.
+# cc Native C compiler (for instance, Apple).
+# CC You never know.
+AN_MAKEVAR([OBJC], [AC_PROG_OBJC])
+AN_PROGRAM([objcc], [AC_PROG_OBJC])
+AN_PROGRAM([objc], [AC_PROG_OBJC])
+AC_DEFUN([AC_PROG_OBJC],
+[AC_LANG_PUSH(Objective C)dnl
+AC_ARG_VAR([OBJC], [Objective C compiler command])dnl
+AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+_AC_ARG_VAR_LIBS()dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+_AC_ARG_VAR_PRECIOUS([OBJC])dnl
+AC_CHECK_TOOLS(OBJC,
+ [m4_default([$1], [gcc objcc objc cc CC])],
+ gcc)
+# Provide some information about the compiler.
+_AS_ECHO_LOG([checking for _AC_LANG compiler version])
+ac_compiler=`set X $ac_compile; echo $[2]`
+_AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
+_AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
+_AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
+
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+_AC_LANG_COMPILER_GNU
+GOBJC=`test $ac_compiler_gnu = yes && echo yes`
+_AC_PROG_OBJC_G
+AC_LANG_POP(Objective C)dnl
+])# AC_PROG_OBJC
+
+
+# _AC_PROG_OBJC_G
+# ---------------
+# Check whether -g works, even if OBJCFLAGS is set, in case the package
+# plays around with OBJCFLAGS (such as to build both debugging and
+# normal versions of a library), tasteless as that idea is.
+# Don't consider -g to work if it generates warnings when plain compiles don't.
+m4_define([_AC_PROG_OBJC_G],
+[ac_test_OBJCFLAGS=${OBJCFLAGS+set}
+ac_save_OBJCFLAGS=$OBJCFLAGS
+AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g,
+ [ac_save_objc_werror_flag=$ac_objc_werror_flag
+ ac_objc_werror_flag=yes
+ ac_cv_prog_objc_g=no
+ OBJCFLAGS="-g"
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [ac_cv_prog_objc_g=yes],
+ [OBJCFLAGS=""
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [],
+ [ac_objc_werror_flag=$ac_save_objc_werror_flag
+ OBJCFLAGS="-g"
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [ac_cv_prog_objc_g=yes])])])
+ ac_objc_werror_flag=$ac_save_objc_werror_flag])
+if test "$ac_test_OBJCFLAGS" = set; then
+ OBJCFLAGS=$ac_save_OBJCFLAGS
+elif test $ac_cv_prog_objc_g = yes; then
+ if test "$GOBJC" = yes; then
+ OBJCFLAGS="-g -O2"
+ else
+ OBJCFLAGS="-g"
+ fi
+else
+ if test "$GOBJC" = yes; then
+ OBJCFLAGS="-O2"
+ else
+ OBJCFLAGS=
+ fi
+fi[]dnl
+])# _AC_PROG_OBJC_G