diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | m4/objc.m4 | 107 |
2 files changed, 85 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index 156b1c741..7acc64305 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,7 @@ AC_PREREQ(2.59) +m4_include([m4/objc.m4]) + dnl Note that autoconf/autoheader/automake cache using autom4te, so version.sh dnl will only be run if configure.ac has changed. This must be done before dnl AC_INIT so that XINE_VERSION_SPEC, which is an m4 macro, is available. diff --git a/m4/objc.m4 b/m4/objc.m4 index 1e3b3cb41..73dd8b6a0 100644 --- a/m4/objc.m4 +++ b/m4/objc.m4 @@ -1,4 +1,6 @@ # Extracted from autoconf 2.61 to obtain Objective C macros. +# Only expand if the version of autoconf in use doesn't have the macro itself. +m4_ifdef([AC_PROG_OBJC], [], [ # This file is part of Autoconf. -*- Autoconf -*- # Programming languages support. @@ -53,17 +55,79 @@ # Roland McGrath, Noah Friedman, david d zuhn, and many others. # ------------------------------ # -# 3d. The Objective C compiler. # +# 1d. The Objective C language. # # ------------------------------ # -m4_ifdef([AC_PROG_OBJCPP], [], [ -dnl Commented out, because aclocal freaks out about the ()'s -dnl # AC_LANG_PREPROC(Objective C) -dnl # ---------------------------- -dnl # Find the Objective C preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able. -dnl AC_DEFUN([AC_LANG_PREPROC(Objective C)], -dnl [AC_REQUIRE([AC_PROG_OBJCPP])]) +# AC_LANG(Objective C) +# -------------------- +m4_define([AC_LANG(Objective C)], +[ac_ext=m +ac_cpp='$OBJCPP $CPPFLAGS' +ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' +ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' +ac_compiler_gnu=$ac_cv_objc_compiler_gnu +]) + + +# AC_LANG_OBJC +# ------------ +AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)]) + + +# _AC_LANG_ABBREV(Objective C) +# ---------------------------- +m4_define([_AC_LANG_ABBREV(Objective C)], [objc]) + + +# _AC_LANG_PREFIX(Objective C) +# ---------------------------- +m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC]) + + +# ------------------------- # +# 2d. Objective C sources. # +# ------------------------- # + +# AC_LANG_SOURCE(Objective C)(BODY) +# --------------------------------- +m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)]) + + +# AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY]) +# ------------------------------------------------ +m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)]) + + +# AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION) +# --------------------------------------------- +m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)]) + + +# AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION) +# -------------------------------------------- +m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)]) + + +# AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION) +# ----------------------------------------------------------- +m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)]) + + +# AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION) +# --------------------------------------------------- +m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)]) + + +# ------------------------------ # +# 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. +m4_defun([AC_LANG_PREPROC(Objective C)], +[AC_REQUIRE([AC_PROG_OBJCPP])]) # AC_PROG_OBJCPP @@ -96,17 +160,12 @@ AC_SUBST(OBJCPP)dnl AC_LANG_POP(Objective C)dnl ])# AC_PROG_OBJCPP -])dnl m4_ifdef([AC_PROG_OBJCPP]) - -m4_ifdef([AC_PROG_OBJC], [], [ - -dnl Commented out, because aclocal freaks out about the ()'s -dnl # AC_LANG_COMPILER(Objective C) -dnl # ----------------------------- -dnl # Find the Objective C compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able. -dnl AC_DEFUN([AC_LANG_COMPILER(Objective C)], -dnl [AC_REQUIRE([AC_PROG_OBJC])]) +# AC_LANG_COMPILER(Objective C) +# ----------------------------- +# Find the Objective C compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able. +m4_defun([AC_LANG_COMPILER(Objective C)], +[AC_REQUIRE([AC_PROG_OBJC])]) @@ -128,18 +187,19 @@ AC_DEFUN([AC_PROG_OBJC], 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 +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]) +echo "$as_me:$LINENO:" \ + "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD 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]) +_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD]) m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl @@ -190,5 +250,4 @@ else fi fi[]dnl ])# _AC_PROG_OBJC_G - ])dnl m4_ifdef([AC_PROG_OBJC]) |