summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorMatt Messier <mmessier@grapetv.org>2007-05-04 21:55:20 -0400
committerMatt Messier <mmessier@grapetv.org>2007-05-04 21:55:20 -0400
commitf1d5c1fc6c4c79bdc8969b94cf0ca08d3dbd7735 (patch)
tree9d176ab2d4ec713b663aa8a317f32f7f596e3284 /m4
parentb5de3be503bc9fac73ffbcaf6ce92970195c122f (diff)
downloadxine-lib-f1d5c1fc6c4c79bdc8969b94cf0ca08d3dbd7735.tar.gz
xine-lib-f1d5c1fc6c4c79bdc8969b94cf0ca08d3dbd7735.tar.bz2
More build cleanups
-- Pull AC_PROG_OBJC and AC_PROG_OBJCPP from autoconf 2.61, but use the local versions only if they're not defined by the version of autoconf in use. -- Always call AC_PROG_OBJC since there's no harm in doing so. It'll fail most of the time, but it's cleaner than adding yet another $host_os check -- Remove -DCONFIG_DARWIN from CPPFLAGS since it was added specifically for ffmpeg when ffmpeg was built using xine's built infrastructure rather than its own. It's now defined properly where its needed elsewhere. -- Set host_or_hostalias early rather than later in the middle of xv checking since a bunch of other stuff depends on it too.
Diffstat (limited to 'm4')
-rw-r--r--m4/Makefile.am1
-rw-r--r--m4/objc.m4194
-rw-r--r--m4/optimizations.m42
-rw-r--r--m4/xv.m411
4 files changed, 196 insertions, 12 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am
index ca42405a5..242fff4d3 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST = \
libFLAC.m4 \
libfame.m4 \
macosx.m4 \
+ objc.m4 \
opengl.m4 \
optimizations.m4 \
pkg.m4 \
diff --git a/m4/objc.m4 b/m4/objc.m4
new file mode 100644
index 000000000..1e3b3cb41
--- /dev/null
+++ b/m4/objc.m4
@@ -0,0 +1,194 @@
+# Extracted from autoconf 2.61 to obtain Objective C macros.
+
+# This file is part of Autoconf. -*- Autoconf -*-
+# Programming languages support.
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception, the Free Software Foundation gives unlimited
+# permission to copy, distribute and modify the configure scripts that
+# are the output of Autoconf. You need not follow the terms of the GNU
+# General Public License when using or distributing such scripts, even
+# though portions of the text of Autoconf appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the Autoconf program.
+#
+# Certain portions of the Autoconf source text are designed to be copied
+# (in certain cases, depending on the input) into the output of
+# Autoconf. We call these the "data" portions. The rest of the Autoconf
+# source text consists of comments plus executable code that decides which
+# of the data portions to output in any given case. We call these
+# comments and executable code the "non-data" portions. Autoconf never
+# copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of Autoconf
+# released by the Free Software Foundation. When you make and
+# distribute a modified version of Autoconf, you may extend this special
+# exception to the GPL to apply to your modified version as well, *unless*
+# your modified version has the potential to copy into its output some
+# of the text that was the non-data portion of the version that you started
+# with. (In other words, unless your change moves or copies text from
+# the non-data portions to the data portions.) If your modification has
+# such potential, you must delete any notice of this special exception
+# to the GPL from your modified version.
+#
+# Written by David MacKenzie, with help from
+# Akim Demaille, Paul Eggert,
+# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
+# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+
+# ------------------------------ #
+# 3d. The Objective C compiler. #
+# ------------------------------ #
+
+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_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
+
+])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_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
+
+])dnl m4_ifdef([AC_PROG_OBJC])
diff --git a/m4/optimizations.m4 b/m4/optimizations.m4
index d47dc94e0..f25da2a02 100644
--- a/m4/optimizations.m4
+++ b/m4/optimizations.m4
@@ -125,7 +125,7 @@ AC_DEFUN([AC_OPTIMIZATIONS], [
;;
pentiumpro-* | pentium2-* | i686-*)
archopt_val="pentiumpro"
- if test x"$check_athlon" = "xyes"; then
+ if test x"$host" = x"$build"; then
if test -f /proc/cpuinfo; then
modelname=`cat /proc/cpuinfo | grep "model\ name\ :" | sed -e 's/ //g' | cut -d':' -f2`
case "$modelname" in
diff --git a/m4/xv.m4 b/m4/xv.m4
index 04b7f1ee1..073f339fb 100644
--- a/m4/xv.m4
+++ b/m4/xv.m4
@@ -121,17 +121,6 @@ AC_DEFUN([XINE_XV_SUPPORT], [
AM_CONDITIONAL(HAVE_XV, test "x$ac_have_xv" = "xyes")
- host_or_hostalias="$host"
- if test "$host_or_hostalias" = ""; then
- dnl user has called ./configure with a host parameter unknown to
- dnl config.sub; the canonical "$host" is empty
- dnl
- dnl Try the following switch with user's original host_alias
- dnl input instead.
- dnl
- host_or_hostalias="$host_alias"
- fi
-
case "$host_or_hostalias" in
hppa*)
if test "x$ac_have_xv_static" = "xyes"; then