Add DevIL 1.7.8.

This commit is contained in:
rude
2013-09-26 00:20:08 +02:00
parent 6e493fb605
commit c065120c58
487 changed files with 219483 additions and 0 deletions
+275
View File
@@ -0,0 +1,275 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/acx_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise). (This
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also link it with them as well. e.g. you should link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threads programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
#
# 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. 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 the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
if test x"$acx_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
[attr_name=$attr; break])
done
AC_MSG_RESULT($attr_name)
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r
if test x"$GCC" != xyes; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD
+192
View File
@@ -0,0 +1,192 @@
# Configure paths for Allegro
# Shamelessly stolen from libxml.a4
# Jon Rafkind 2004-06-06
# Adapted from:
# Configure paths for libXML
# Toshio Kuratomi 2001-04-21
# Adapted from:
# Configure paths for GLIB
# Owen Taylor 97-11-3
dnl AM_PATH_allegro([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for allegro, and define allegro_CFLAGS and allegro_LIBS
dnl
AC_DEFUN([AM_PATH_ALLEGRO],[
AC_ARG_WITH(allegro-prefix,
[ --with-allegro-prefix=PFX Prefix where liballegro is installed (optional)],
ALLEGRO_CONFIG_prefix="$withval", ALLEGRO_CONFIG_prefix="")
AC_ARG_WITH(allegro-exec-prefix,
[ --with-allegro-exec-prefix=PFX Exec prefix where liballegro is installed (optional)],
ALLEGRO_CONFIG_exec_prefix="$withval", ALLEGRO_CONFIG_exec_prefix="")
AC_ARG_ENABLE(allegrotest,
[ --disable-allegrotest Do not try to compile and run a test LIBallegro program],,
enable_allegrotest=yes)
if test x$ALLEGRO_CONFIG_exec_prefix != x ; then
ALLEGRO_CONFIG_args="$ALLEGRO_CONFIG_args --exec-prefix=$ALLEGRO_CONFIG_exec_prefix"
if test x${ALLEGRO_CONFIG+set} != xset ; then
ALLEGRO_CONFIG=$ALLEGRO_CONFIG_exec_prefix/bin/allegro-config
fi
fi
if test x$ALLEGRO_CONFIG_prefix != x ; then
ALLEGRO_CONFIG_args="$ALLEGRO_CONFIG_args --prefix=$ALLEGRO_CONFIG_prefix"
if test x${ALLEGRO_CONFIG+set} != xset ; then
ALLEGRO_CONFIG=$ALLEGRO_CONFIG_prefix/bin/allegro-config
fi
fi
AC_PATH_PROG(ALLEGRO_CONFIG, allegro-config, no)
min_allegro_version=ifelse([$1], ,4.0.0,[$1])
AC_MSG_CHECKING(for Allegro - version >= $min_allegro_version)
no_allegro=""
if test "$ALLEGRO_CONFIG" = "no" ; then
no_allegro=yes
else
allegro_CFLAGS=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --cflags`
allegro_LIBS=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --libs`
ALLEGRO_CONFIG_major_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
ALLEGRO_CONFIG_minor_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
ALLEGRO_CONFIG_micro_version=`$ALLEGRO_CONFIG $ALLEGRO_CONFIG_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_allegrotest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $allegro_CFLAGS"
LIBS="$allegro_LIBS $LIBS"
dnl
dnl Now check if the installed liballegro is sufficiently new.
dnl (Also sanity checks the results of allegro-config to some extent)
dnl
rm -f conf.allegrotest
AC_TRY_RUN([
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <allegro.h>
int
main()
{
int allegro_major_version, allegro_minor_version, allegro_micro_version;
int major, minor, micro;
char *tmp_version;
int tmp_int_version;
system("touch conf.allegrotest");
/* Capture allegro-config output via autoconf/configure variables */
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = (char *)strdup("$min_allegro_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string from allegro-config\n", "$min_allegro_version");
free(tmp_version);
exit(1);
}
free(tmp_version);
/* Capture the version information from the header files */
allegro_major_version = ALLEGRO_VERSION;
allegro_minor_version = ALLEGRO_SUB_VERSION;
allegro_micro_version = ALLEGRO_WIP_VERSION;
/* Compare allegro-config output to the Allegro headers */
if ((allegro_major_version != $ALLEGRO_CONFIG_major_version) ||
(allegro_minor_version != $ALLEGRO_CONFIG_minor_version))
{
printf("*** Allegro header files (version %d.%d.%d) do not match\n",
allegro_major_version, allegro_minor_version, allegro_micro_version);
printf("*** allegro-config (version %d.%d.%d)\n",
$ALLEGRO_CONFIG_major_version, $ALLEGRO_CONFIG_minor_version, $ALLEGRO_CONFIG_micro_version);
return 1;
}
/* Compare the headers to the library to make sure we match */
/* Less than ideal -- doesn't provide us with return value feedback,
* only exits if there's a serious mismatch between header and library.
*/
/* TODO:
* This doesnt work!
*/
/* ALLEGRO_TEST_VERSION; */
/* Test that the library is greater than our minimum version */
if (($ALLEGRO_CONFIG_major_version > major) ||
(($ALLEGRO_CONFIG_major_version == major) && ($ALLEGRO_CONFIG_minor_version > minor)) ||
(($ALLEGRO_CONFIG_major_version == major) && ($ALLEGRO_CONFIG_minor_version == minor) &&
($ALLEGRO_CONFIG_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of Allegro (%d.%d.%d) was found.\n",
allegro_major_version, allegro_minor_version, allegro_micro_version);
printf("*** You need a version of Allegro newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** Allegro is always available from http://alleg.sf.net.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the allegro-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of Allegro, but you can also set the ALLEGRO_CONFIG environment to point to the\n");
printf("*** correct copy of allegro-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
return 1;
} END_OF_MAIN()
],, no_allegro=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_allegro" = x ; then
AC_MSG_RESULT(yes (version $ALLEGRO_CONFIG_major_version.$ALLEGRO_CONFIG_minor_version.$ALLEGRO_CONFIG_micro_version))
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$ALLEGRO_CONFIG" = "no" ; then
echo "*** The allegro-config script installed by Allegro could not be found"
echo "*** If Allegro was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the ALLEGRO_CONFIG environment variable to the"
echo "*** full path to allegro-config."
else
if test -f conf.allegrotest ; then
:
else
echo "*** Could not run Allegro test program, checking why..."
CFLAGS="$CFLAGS $allegro_CFLAGS"
LIBS="$LIBS $allegro_LIBS"
AC_TRY_LINK([
#include <allegro.h>
#include <stdio.h>
], [ ALLEGRO_TEST_VERSION; return 0;],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Allegro or finding the wrong"
echo "*** version of Allegro. If it is not finding Allegro, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Allegro was incorrectly installed"
echo "*** or that you have moved Allegro since it was installed. In the latter case, you"
echo "*** may want to edit the allegro-config script: $ALLEGRO_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
allegro_CFLAGS=""
allegro_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(allegro_CFLAGS)
AC_SUBST(allegro_LIBS)
rm -f conf.allegrotest
])
+135
View File
@@ -0,0 +1,135 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_check_gl.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_GL
#
# DESCRIPTION
#
# Check for an OpenGL implementation. If GL is found, the required
# compiler and linker flags are included in the output variables
# "GL_CFLAGS" and "GL_LIBS", respectively. If no usable GL implementation
# is found, "no_gl" is set to "yes".
#
# If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the
# header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These
# preprocessor definitions may not be mutually exclusive.
#
# LAST MODIFICATION
#
# 2008-10-07
#
# COPYLEFT
#
# Copyright (c) 2008 Braden McDaniel <braden@endoframe.com>
#
# 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 of the License, 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 haeceived a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. 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 the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_CHECK_GL],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PATH_X])dnl
AC_REQUIRE([ACX_PTHREAD])dnl
AC_LANG_PUSH([C])
AX_LANG_COMPILER_MS
AS_IF([test X$ax_compiler_ms = Xno],
[GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm"])
#
# Use x_includes and x_libraries if they have been set (presumably by
# AC_PATH_X).
#
AS_IF([test "X$no_x" != "Xyes"],
[AS_IF([test -n "$x_includes"],
[GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"])]
AS_IF([test -n "$x_libraries"],
[GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"]))
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h])
CPPFLAGS="${ax_save_CPPFLAGS}"
AC_CHECK_HEADERS([windows.h])
m4_define([AX_CHECK_GL_PROGRAM],
[AC_LANG_PROGRAM([[
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GL_H
# include <GL/gl.h>
# elif defined(HAVE_OPENGL_GL_H)
# include <OpenGL/gl.h>
# else
# error no gl.h
# endif]],
[[glBegin(0)]])])
AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
[ax_cv_check_gl_libgl="no"
case $host_cpu in
x86_64) ax_check_gl_libdir=lib64 ;;
*) ax_check_gl_libdir=lib ;;
esac
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lopengl32 -lGL"
for ax_lib in ${ax_check_libs}; do
AS_IF([test X$ax_compiler_ms = Xyes],
[ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
[ax_try_lib="${ax_lib}"])
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="${ax_try_lib}"; break],
[ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break],
[ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break])])])
done
AS_IF([test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes],
[LIBS='-framework OpenGL'
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="$LIBS"])])
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}])
AS_IF([test "X$ax_cv_check_gl_libgl" = Xno],
[no_gl=yes; GL_CFLAGS=""; GL_LIBS=""],
[GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"])
AC_LANG_POP([C])
AC_SUBST([GL_CFLAGS])
AC_SUBST([GL_LIBS]) ])
+154
View File
@@ -0,0 +1,154 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_check_glu.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_GLU
#
# DESCRIPTION
#
# Check for GLU. If GLU is found, the required preprocessor and linker
# flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS",
# respectively. If no GLU implementation is found, "no_glu" is set to
# "yes".
#
# If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the
# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These
# preprocessor definitions may not be mutually exclusive.
#
# Some implementations (in particular, some versions of Mac OS X) are
# known to treat the GLU tesselator callback function type as "GLvoid
# (*)(...)" rather than the standard "GLvoid (*)()". If the former
# condition is detected, this macro defines "HAVE_VARARGS_GLU_TESSCB".
#
# LAST MODIFICATION
#
# 2008-10-07
#
# COPYLEFT
#
# Copyright (c) 2008 Braden McDaniel <braden@endoframe.com>
#
# 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 of the License, 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, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. 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 the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_CHECK_GLU],
[AC_REQUIRE([AX_CHECK_GL])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
GLU_CFLAGS="${GL_CFLAGS}"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h])
CPPFLAGS="${ax_save_CPPFLAGS}"
m4_define([AX_CHECK_GLU_PROGRAM],
[AC_LANG_PROGRAM([[
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GLU_H
# include <GL/glu.h>
# elif defined(HAVE_OPENGL_GLU_H)
# include <OpenGL/glu.h>
# else
# error no glu.h
# endif]],
[[gluBeginCurve(0)]])])
AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
[ax_cv_check_glu_libglu="no"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
#
# First, check for the possibility that everything we need is already in
# GL_LIBS.
#
LIBS="${GL_LIBS} ${ax_save_LIBS}"
#
# libGLU typically links with libstdc++ on POSIX platforms.
# However, setting the language to C++ means that test program
# source is named "conftest.cc"; and Microsoft cl doesn't know what
# to do with such a file.
#
AC_LANG_PUSH([C++])
AS_IF([test X$ax_compiler_ms = Xyes],
[AC_LANG_PUSH([C])])
AC_LINK_IFELSE(
[AX_CHECK_GLU_PROGRAM],
[ax_cv_check_glu_libglu=yes],
[LIBS=""
ax_check_libs="-lglu32 -lGLU"
for ax_lib in ${ax_check_libs}; do
AS_IF([test X$ax_compiler_ms = Xyes],
[ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
[ax_try_lib="${ax_lib}"])
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM],
[ax_cv_check_glu_libglu="${ax_try_lib}"; break])
done
])
AS_IF([test X$ax_compiler_ms = Xyes],
[AC_LANG_POP([C])])
AC_LANG_POP([C++])
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}])
AS_IF([test "X$ax_cv_check_glu_libglu" = Xno],
[no_glu=yes; GLU_CFLAGS=""; GLU_LIBS=""],
[AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes],
[GLU_LIBS="$GL_LIBS"],
[GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"])])
AC_SUBST([GLU_CFLAGS])
AC_SUBST([GLU_LIBS])
#
# Some versions of Mac OS X include a broken interpretation of the GLU
# tesselation callback function signature.
#
AS_IF([test "X$ax_cv_check_glu_libglu" != Xno],
[AC_CACHE_CHECK([for varargs GLU tesselator callback function type],
[ax_cv_varargs_glu_tesscb],
[ax_cv_varargs_glu_tesscb=no
ax_save_CFLAGS="$CFLAGS"
CFLAGS="$GL_CFLAGS $CFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
# ifdef HAVE_GL_GLU_H
# include <GL/glu.h>
# else
# include <OpenGL/glu.h>
# endif]],
[[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])],
[ax_cv_varargs_glu_tesscb=yes])
CFLAGS="$ax_save_CFLAGS"])
AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes],
[AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
[Use nonstandard varargs form for the GLU tesselator callback])])])
])
+117
View File
@@ -0,0 +1,117 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_check_glut.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_GLUT
#
# DESCRIPTION
#
# Check for GLUT. If GLUT is found, the required compiler and linker flags
# are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS",
# respectively. If GLUT is not found, "no_glut" is set to "yes".
#
# If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the
# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These
# preprocessor definitions may not be mutually exclusive.
#
# LAST MODIFICATION
#
# 2008-10-07
#
# COPYLEFT
#
# Copyright (c) 2008 Braden McDaniel <braden@endoframe.com>
#
# 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 of the License, 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, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. 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 the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_CHECK_GLUT],
[AC_REQUIRE([AX_CHECK_GLU])dnl
AC_REQUIRE([AC_PATH_XTRA])dnl
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADERS([GL/glut.h GLUT/glut.h])
CPPFLAGS="${ax_save_CPPFLAGS}"
GLUT_CFLAGS=${GLU_CFLAGS}
GLUT_LIBS=${GLU_LIBS}
m4_define([AX_CHECK_GLUT_PROGRAM],
[AC_LANG_PROGRAM([[
# if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GLUT_H
# include <GL/glut.h>
# elif defined(HAVE_GLUT_GLUT_H)
# include <GLUT/glut.h>
# else
# error no glut.h
# endif]],
[[glutMainLoop()]])])
#
# If X is present, assume GLUT depends on it.
#
AS_IF([test X$no_x != Xyes],
[GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"])
AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut],
[ax_cv_check_glut_libglut="no"
AC_LANG_PUSH(C)
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lglut32 -lglut"
for ax_lib in ${ax_check_libs}; do
AS_IF([test X$ax_compiler_ms = Xyes],
[ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
[ax_try_lib="${ax_lib}"])
LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM],
[ax_cv_check_glut_libglut="${ax_try_lib}"; break])
done
AS_IF([test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes],
[LIBS='-framework GLUT'
AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM],
[ax_cv_check_glut_libglut="$LIBS"])])
CPPFLAGS="${ax_save_CPPFLAGS}"
LIBS="${ax_save_LIBS}"
AC_LANG_POP(C)])
AS_IF([test "X$ax_cv_check_glut_libglut" = Xno],
[no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS=""],
[GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"])
AC_SUBST([GLUT_CFLAGS])
AC_SUBST([GLUT_LIBS])
])dnl
@@ -0,0 +1,38 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_lang_compiler_ms.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_LANG_COMPILER_MS
#
# DESCRIPTION
#
# Check whether the compiler for the current language is Microsoft.
#
# This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU Autoconf
# implementation.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Braden McDaniel <braden@endoframe.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_LANG_COMPILER_MS],
[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler],
[ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER
choke me
#endif
]])],
[ax_compiler_ms=yes],
[ax_compiler_ms=no])
ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms
])])
+178
View File
@@ -0,0 +1,178 @@
dnl
dnl Checks for SDL presence, adds cflags to ILUT_CFLAGS and libs to ILUT_LIBS
dnl also sets use_sdl variable
dnl
AC_DEFUN([SETTLE_SDL],
[TEST_API([sdl])
AS_IF([test "x$enable_sdl" = "xyes"],
[AM_PATH_SDL(1.2.5,
[use_sdl="yes"],
[use_sdl="no"]) ])
AS_IF([test "x$use_sdl" = "xyes"],
[AC_DEFINE([ILUT_USE_SDL],
[],
[Support SDL API])
ILUT_CFLAGS="$SDL_CFLAGS $ILUT_CFLAGS"
ILUT_LIBS="$SDL_LIBS $ILUT_LIBS"
SUPPORTED_API="$SUPPORTED_API SDL"]) ])
dnl
dnl Checks for OpenGL implementations, external macros from Autoconf macro archives used
dnl Checks for GL, GLU (needed for DevIL) and for GLUT (one of the examples uses this)
dnl sets use_ogl and have_glut variables
dnl
AC_DEFUN([SETTLE_OPENGL],
[TEST_API(opengl)
AS_IF([test "x$enable_opengl" = "xyes"],
[AX_CHECK_GL
AX_CHECK_GLU
AX_CHECK_GLUT
AS_IF([test "x$no_gl" != "xyes" -a "x$no_glu" != "xyes"],
[use_ogl="yes"
ILUT_LIBS="$GLU_LIBS $GL_LIBS $ILUT_LIBS"
AS_IF([test "x$no_glut" != "xyes"],
[have_glut="yes"
ILUT_LIBS="$GLUT_LIBS $ILUT_LIBS"])
AC_DEFINE([ILUT_USE_OPENGL],
[1],
[Define if system supports OpenGL API])
SUPPORTED_API="$SUPPORTED_API OpenGL"]) ]) ])
dnl
dnl The check for Allegro game programming library.
dnl The part before "official" AM_PATH_ALLEGRO is for unofficial autotools builds
dnl sets use_allegro variable
dnl
AC_DEFUN([SETTLE_ALLEGRO],
[TEST_API([allegro])
AS_IF([test "x$enable_allegro" = "xyes"],
[AC_CHECK_HEADER([allegro.h],
[AC_CHECK_LIB([alleg],
[main],
[use_allegro="yes"
ILUT_LIBS="-lalleg $ILUT_LIBS"])
AC_CHECK_LIB([allegro_unsharable],
[main],
[ILUT_LIBS="-lalleg_unsharable $ILUT_LIBS"])
AC_CHECK_LIB([alleg42],
[main],
[use_allegro="yes"
ILUT_LIBS="-lalleg42 $ILUT_LIBS"]) ])
AS_IF([test "x$use_allegro" != "xyes"],
[AM_PATH_ALLEGRO(4.2.0,
[use_allegro="yes"
ILUT_LIBS="$allegro_LIBS $ILUT_LIBS"
ILUT_CFLAGS="$allegro_CFLAGS $ILUT_CFLAGS"],
[use_allegro="no"]) ]) ])
AS_IF([test "x$use_allegro" = "xyes"],
[AC_DEFINE([ILUT_USE_ALLEGRO],
[],
[Support Allegro API])
SUPPORTED_API="$SUPPORTED_API Allegro"]) ])
dnl
dnl 32-bit Windows support
dnl checks for gdi32 lib presence
dnl sets use_w32 variable
dnl
AC_DEFUN([SETTLE_W32],
[TEST_API([w32])
AS_IF([test "x$enable_w32" = "xyes"],
[AC_CHECK_LIB([gdi32],
[main],
[ILUT_LIBS="-lgdi32 $ILUT_LIBS"
use_w32="yes"
SUPPORTED_API="$SUPPORTED_API w32"]) ]) ])
dnl
dnl check for DirectX 8
dnl sets use_directx8 variable
dnl
AC_DEFUN([SETTLE_DX8],
[TEST_API([directx8])
AS_IF([test "x$enable_directx8" = "xyes"],
[AC_CHECK_HEADER([d3d8.h],
[AC_DEFINE([ILUT_USE_DIRECTX8],,
[Support DirectX8 API])
use_directx8="yes"
SUPPORTED_API="$SUPPORTED_API DirectX8"]) ]) ])
dnl
dnl DirectX 9
dnl sets use_directx9 variable
dnl
AC_DEFUN([SETTLE_DX9],
[TEST_API([directx9])
AS_IF([test "x$enable_directx9" = "xyes"],
[AC_CHECK_HEADER([d3d9.h],
[AC_DEFINE([ILUT_USE_DIRECTX9],,
[Support DirectX9 API])
use_directx9="yes"
SUPPORTED_API="$SUPPORTED_API DirectX9"]) ]) ])
dnl
dnl DirectX 10
dnl sets use_directx10 variable
dnl
AC_DEFUN([SETTLE_DX10],
[TEST_API([directx10])
AS_IF([test "x$enable_directx10" = "xyes"],
[AC_CHECK_HEADER([d3d10.h],
[AC_DEFINE([ILUT_USE_DIRECTX10],,
[Support DirectX10 API])
use_directx10="yes"
SUPPORTED_API="$SUPPORTED_API DirectX10"]) ]) ])
dnl
dnl Checks for X11 developement stuff and for XShm
dnl sets use_x11 and use_xshm vars
dnl
AC_DEFUN([SETTLE_X11],
[TEST_API([x11])
AS_IF([test "x$enable_x11" = "xyes"],
[AC_CHECK_HEADER([X11/Xlib.h],
[use_x11="yes"],
[use_x11="no"])
AC_CHECK_LIB([X11],
[main],
[dnl The use_x11 var is either "yes" already, or we don't want "no" to be overwritten
ILUT_LIBS="-lX11 $ILUT_LIBS"],
[use_x11="no"]) ])
TEST_API([shm])
AS_IF([test "x$enable_shm" = "xyes"],
[AC_CHECK_HEADER([X11/extensions/XShm.h],
[use_xshm="yes"],
[use_xshm="no"],
[[#include <X11/Xlib.h>]])
AC_CHECK_LIB([Xext],
[main],
[use_shm="yes"
ILUT_LIBS="-lXext $ILUT_LIBS"],
[use_shm="no"]) ])
TEST_API([render])
AS_IF([test "x$enable_render" = "xyes"],
[AC_CHECK_HEADER([X11/extensions/Xrender.h],
[use_xrender="yes"],
[use_xrender="no"],
[[#include <X11/Xlib.h>]])
AC_CHECK_LIB([Xrender],
[main],
[use_render="yes"
ILUT_LIBS="-lXrender $ILUT_LIBS"],
[use_render="no"]) ])
AS_IF([test "x$use_x11" != "xno"],
[AC_DEFINE([ILUT_USE_X11],
[1],
[Support X11 API])
SUPPORTED_API="$SUPPORTED_API X11"])
AS_IF([test "$use_xshm" = "yes"],
[AC_DEFINE([ILUT_USE_XSHM],
[],
[Support X11 XShm extension])
SUPPORTED_API="$SUPPORTED_API XShm"])
AS_IF([test "$use_xrender" = "yes"],
[AC_DEFINE([ILUT_USE_XRENDER],
[],
[Support X11 XRender extension])
SUPPORTED_API="$SUPPORTED_API XRender"]) ])
+298
View File
@@ -0,0 +1,298 @@
AC_DEFUN([ADD_CFLAGS],
[GENERAL_CFLAGS="$GENERAL_CFLAGS $1"])
dnl IL_CFLAGS="$IL_CFLAGS $1"])
dnl ILU_CFLAGS="$ILU_CFLAGS $1"
dnl ILUT_CFLAGS="$ILUT_CFLAGS $1"])
dnl IL_CFLAGS are present everywhere
dnl
dnl Check CPU Extensions
dnl
AC_DEFUN([TEST_EXT],
[AC_ARG_ENABLE([$6],
[AC_HELP_STRING([--enable-$6],
[Doesn't compile $1 support. Overrides general enable of ASM])],
[use_$1=$enable_$6
test "x$enable_$6" = "xyes" && enable_asm="yes"],
[use_$1=test])
AC_MSG_CHECKING([$1])
AS_IF([test "$use_$1" = "yes"],
[AC_DEFINE([$4],
[1],
[$1 extension found])
AC_DEFINE([VECTORMEM],
[1],
[Memory must be vector aligned])
ADD_CFLAGS([$2])
AC_MSG_RESULT([yes])
SUPPORTED_EXTENSION=$SUPPORTED_EXTENSION"$1 "],
[test "$use_$1" = "test" -a "x$enable_asm" = "xyes"],
[CFLAGS_TMP=$CFLAGS
CFLAGS="$CFLAGS $2"
AC_COMPILE_IFELSE([$5
int main()
{$3;return 0;}],
[AC_DEFINE([$4],
[],
[$1 extension found])
AC_DEFINE([VECTORMEM],
[],
[Memory must be vector aligned])
ADD_CFLAGS([$2])
AC_MSG_RESULT([yes])
SUPPORTED_EXTENSION=$SUPPORTED_EXTENSION"$1 "],
[AC_MSG_RESULT([no]) ])
CFLAGS="$CFLAGS_TMP"],
[AC_MSG_RESULT(disabled)]) ])
dnl
dnl Check CPU Assembly
dnl
dnl add test to have only an ASM for compilation
AC_DEFUN([TEST_ASM],
[AC_ARG_ENABLE([$4],
[AC_HELP_STRING([--enable-$4],
[Compile with $4 support])],
[use_$4=$enable_$4],[use_$4=test])
AC_MSG_CHECKING([$4])
AS_IF([test "$use_$4" = "yes"],
[SUPPORTED_EXTENSION=$SUPPORTED_EXTENSION"$2 "
AC_DEFINE([$3],
[],
[$2 assembly found])
AC_MSG_RESULT([yes])],
[test "$use_$4" = "no"],
[AC_MSG_RESULT(no)],
[AS_CASE([$host_cpu],
[$1],
[SUPPORTED_EXTENSION=$SUPPORTED_EXTENSION"$2 "
AC_DEFINE([$3],
[],
[$2 assembly found])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]) ]) ]) ])
dnl
dnl Setup Libraries
dnl SET_LIB([libname],[if-found],[if-not-found])
dnl
AC_DEFUN([SET_LIB],
[AC_ARG_WITH([$1],
[AC_HELP_STRING([--with-$1=[[yes/no]]],
[Do wou want to use lib$1?])],
[],
[enable_$1="yes"])
AS_IF([test "$enable_$1" = "yes"],
[AC_CHECK_LIB([$1],
[main],
[LIBS="-l$1 $LIBS"
support_$1="yes"],
[support_$1="no"])
AS_IF([test "x$support_$1" = "xyes" -a -n '$2'],
[$2],
[test "x$support_$1" = "xno" -a -n '$3'],
[$3]) ]) ])
dnl
dnl Formats
dnl
dnl usage:
dnl TEST_FORMAT(<name>, <varname>[, <check for a lib>]))
dnl
AC_DEFUN([TEST_FORMAT],
[AC_ARG_ENABLE([$1],
[AC_HELP_STRING([--enable-$1],
[Compile $1 support. $3 (default=yes) ])],
[],
[enable_$1="yes"])
AS_IF([test $# -eq 4 -a "x$enable_$1" = "xyes"],
[$4])
AC_MSG_CHECKING([whether we would like to have support for $1 format])
AS_IF([test "x$enable_$1" = "xno" -o "x$lib_test_result" = "xno"],
[AC_MSG_RESULT([no])
AC_DEFINE([IL_NO_$2],
[],
[$1 support ($3)])],
[AC_MSG_RESULT([yes])
SUPPORTED_FORMATS="$SUPPORTED_FORMATS $2"])
lib_test_result="" ])
dnl
dnl Adds a library to human-readable list of dependencies
dnl
dnl Usage:
dnl MAYBE_OPTIONAL_DEPENDENCY(<library part prefix>, <library name>)
dnl for example:
dnl MAYBE_OPTIONAL_DEPENDENCY([IL], [libjpeg])
dnl MAYBE_OPTIONAL_DEPENDENCY([ILUT], [allegro])
dnl
AC_DEFUN([MAYBE_OPTIONAL_DEPENDENCY],
[AS_IF([test "x$enable_modules" = "xyes"],
[$1_LIBS_OPTIONAL="${$1_LIBS_OPTIONAL} $2"],
[$1_LIBS_REQUIRED="${$1_LIBS_REQUIRED} $2"]) ])
dnl
dnl Check for libraries
dnl
dnl Usage:
dnl DEVIL_IL_LIB(<include>, <library>)
dnl the <library> is appended to IL_LIBS, sets have_<library> to yes/no
dnl Nothing else is done, see MAYBE_OPTIONAL_DEPENDENCY macro...
dnl
AC_DEFUN([DEVIL_IL_LIB],
[AC_CHECK_HEADER([$1],
[AC_CHECK_LIB([$2],
[main],
[IL_LIBS="-l$2 $IL_LIBS"
have_$2="yes"],
[have_$2="no"])],
[have_$2="no"]) ])
dnl
dnl Checks for squish library = GPU accelerated DXT compression
dnl Can be used along with nvidia texture tools
dnl
AC_DEFUN([DEVIL_CHECK_LIBSQUISH],
[DEVIL_IL_LIB([squish.h],
[squish])
lib_test_result="$have_squish"
AS_IF([test "x$lib_test_result" = "xyes"],
[AC_DEFINE([IL_USE_DXTC_SQUISH],
[1],
[Define if you have libsquish installed])
MAYBE_OPTIONAL_DEPENDENCY([IL],
[libsquish]) ]) ])
dnl
dnl Checks for nvidia texture tools library - GPU acceleration of DXT compression
dnl Can be used along with libsquish
dnl
AC_DEFUN([DEVIL_CHECK_NVIDIA_TEXTOOLS],
[DEVIL_IL_LIB([nvtt/nvtt.h],
[nvtt])
lib_test_result="$have_nvtt"
AS_IF([test "x$lib_test_result" = "xyes"],
[AC_DEFINE([IL_USE_DXTC_NVIDIA],
[1],
[Define if you have nvidia texture tools library installed])
MAYBE_OPTIONAL_DEPENDENCY([IL],
[libnvtt-nvidia_texture_tools]) ]) ])
AC_DEFUN([SETTLE_LCMS],
[AC_CHECK_LIB([lcms],
[main],
[have_lcms_lib="yes"
IL_LIBS="-llcms $IL_LIBS"])
AC_CHECK_HEADER([lcms/lcms.h],
[have_lcms_h="yes"])
AC_CHECK_HEADER([lcms.h],
[have_lcms_h="yes"
lcms_nodirinclude="yes"])
AS_IF([test "x$lcms_nodirinclude" = "xyes"],
[AC_DEFINE([LCMS_NODIRINCLUDE],
[1],
[LCMS include without lcms/ support]) ])
AS_IF([test "x$have_lcms_lib" = "xyes" -a "x$have_lcms_h" = "xyes"],
[have_lcms="yes"
IL_LIBS_REQUIRED="$IL_LIBS_REQUIRED lcms"
lib_test_result="yes"],
[lib_test_result="no"]) ])
AC_DEFUN([SETTLE_OPENEXR],
[PKG_CHECK_MODULES([OPENEXR],
[OpenEXR],
[have_openexr="yes"],
[have_openexr="no"])
MAYBE_OPTIONAL_DEPENDENCY([IL],
[OpenEXR])
IL_LIBS="$OPENEXR_LIBS $IL_LIBS"
IL_CFLAGS="$OPENEXR_CFLAGS $IL_CFLAGS"
lib_test_result="$have_openexr"])
AC_DEFUN([SETTLE_JPEG],
[DEVIL_IL_LIB([jpeglib.h],
[jpeg])
AC_DEFINE([IL_USE_JPEGLIB_UNMODIFIED],
[1],
[Use libjpeg without modification. always enabled.])
lib_test_result="$have_jpeg"
AS_IF([test "x$lib_test_result" = "xyes"],
[MAYBE_OPTIONAL_DEPENDENCY([IL],
[libjpeg]) ]) ])
AC_DEFUN([SETTLE_JASPER],
[DEVIL_IL_LIB([jasper/jasper.h],
[jasper])
AS_IF([test "x$have_jasper" != "xyes"],
[DEVIL_IL_LIB([jasper/jasper.h],
[jp2])
lib_test_result="$have_jp2" ],
[lib_test_result="yes"])
AS_IF([test "x$lib_test_result" = "xyes"],
[MAYBE_OPTIONAL_DEPENDENCY([IL],
[JasPer]) ]) ])
AC_DEFUN([SETTLE_MNG],
[DEVIL_IL_LIB([libmng.h],
[mng])
lib_test_result="$have_mng"
AS_IF([test "x$lib_test_result" = "xyes"],
[MAYBE_OPTIONAL_DEPENDENCY([IL],
[libmng]) ]) ])
AC_DEFUN([SETTLE_PNG],
[DEVIL_IL_LIB([png.h],
[png12])
AS_IF([test "x$have_png12" = "xno"],
[DEVIL_IL_LIB([png.h],
[png])
lib_test_result="$have_png"],
[lib_test_result="$have_png12"])
AS_IF([test "x$lib_test_result" = "xyes"],
[MAYBE_OPTIONAL_DEPENDENCY([IL],
[libpng]) ]) ])
AC_DEFUN([SETTLE_TIFF],
[DEVIL_IL_LIB([tiffio.h],
[tiff])
lib_test_result="$have_tiff"
AS_IF([test "x$lib_test_result" = "xyes"],
[MAYBE_OPTIONAL_DEPENDENCY([IL],
[libtiff]) ]) ])
dnl
dnl ILUT generic APIs checking
dnl
AC_DEFUN([TEST_API],
[AC_ARG_ENABLE([$1],
[AC_HELP_STRING([--enable-$1],
[Compiles $1 support for ILUT (default=yes) ])],
[],
[enable_$1="yes"]) ])
dnl Test for restrict c/c++ keyword
AC_DEFUN([DEVIL_CHECK_RESTRICT],
[AC_MSG_CHECKING([restrict keyword])
AC_COMPILE_IFELSE([[void foo(void * restrict test){}]],
[AC_DEFINE([RESTRICT_KEYWORD],
[],
[restric keyword available])
restrict_keyword="found"
AC_MSG_RESULT([yes]) ],
[AC_MSG_RESULT([no]) ]) ])
AC_DEFUN([DEVIL_CHECK_RESTRICT_GNU99],
[TMP_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -std=gnu99 -fgnu89-inline"
AC_MSG_CHECKING([restrict gnu99 keyword])
AC_COMPILE_IFELSE([[void foo(void * restrict test){}]],
[AC_DEFINE([RESTRICT_KEYWORD],
[1],
[restric keyword available])
AC_MSG_RESULT([yes])
CFLAGS="$TMP_CFLAGS"
ADD_CFLAGS(-std=gnu99 -fgnu89-inline)],
[AC_MSG_RESULT([no])
CFLAGS="$TMP_CFLAGS"]) ])
+51
View File
@@ -0,0 +1,51 @@
AC_DEFUN([IL_REPORT],
[AC_MSG_NOTICE([+----------------------------------------+])
AS_IF([test "x$enable_IL" = "xyes"],
[AC_MSG_NOTICE([\| IL library Supported formats \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([$SUPPORTED_FORMATS])
AC_MSG_NOTICE([+----------------------------------------+])
AC_MSG_NOTICE([\| IL library External libraries \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([Required libs: $IL_LIBS_REQUIRED])
AS_IF([test "x$enable_modules" = "xyes"],
[AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([Optional libs: $IL_LIBS_OPTIONAL]) ]) ],
[AC_MSG_NOTICE([\| IL disabled (huh? good luck!) \|]) ]) ])
AC_DEFUN([ILU_REPORT],
[AC_MSG_NOTICE([+----------------------------------------+])
AS_IF([test "x$enable_ILU" = "xyes"],
[AC_MSG_NOTICE([\| ILU part enabled \|]) ],
[AC_MSG_NOTICE([\| ILU part disabled \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([Pass --enable-ILU option to the configure script if you want to build ILU]) ]) ])
AC_DEFUN([ILUT_REPORT],
[AC_MSG_NOTICE([+----------------------------------------+])
AS_IF([test "x$enable_ILUT" = "xyes"],
[AC_MSG_NOTICE([\| ILUT library Supported APIs \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([$SUPPORTED_API])],
[AC_MSG_NOTICE([\| ILUT part disabled \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([Pass --enable-ILUT option to the configure script if you want to build ILUT]) ]) ])
AC_DEFUN([EXTENSIONS_REPORT],
[AC_MSG_NOTICE([+----------------------------------------+])
AC_MSG_NOTICE([\| Detected Machine Extensions \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([$SUPPORTED_EXTENSION]) ])
AC_DEFUN([EXAMPLES_REPORT],
[AC_MSG_NOTICE([+----------------------------------------+])
AS_IF([test "x$with_examples" = "xyes"],
[AC_MSG_NOTICE([\| Building examples \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([$EXAMPLES_TO_BUILD])
AS_IF([test "x$build" != "x$host"],
[AC_MSG_NOTICE([Note: You may get some errors when cross-compiling when using OpenEXR, Allegro and/or SDL. So if you are cross-compiling and getting these errors (very likely if you use MingW), just pass --disable-exr, --disable-allegro or --disable-sdl to the configure script.]) ]) ],
[AC_MSG_NOTICE([\| Not building any examples \|])
AC_MSG_NOTICE([+----------------------------------------+-------+])
AC_MSG_NOTICE([Pass --with-examples option to the configure script if you want to build examples.]) ])
AC_MSG_NOTICE([+----------------------------------------+]) ])
+7325
View File
File diff suppressed because it is too large Load Diff
+368
View File
@@ -0,0 +1,368 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [0], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])
+123
View File
@@ -0,0 +1,123 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
m4_define([lt_combine],
[m4_if([$2], [], [],
[m4_if([$4], [], [],
[lt_join(m4_quote(m4_default([$1], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2],
[m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]),
[_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl
])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])
+23
View File
@@ -0,0 +1,23 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# Generated from ltversion.in.
# serial 2976 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.2.4])
m4_define([LT_PACKAGE_REVISION], [1.2976])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.2.4'
macro_revision='1.2976'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
+92
View File
@@ -0,0 +1,92 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 4 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+155
View File
@@ -0,0 +1,155 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
ifelse([$4], , [AC_MSG_ERROR(dnl
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT
])],
[AC_MSG_RESULT([no])
$4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES
+181
View File
@@ -0,0 +1,181 @@
# Configure paths for SDL
# Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
sdl_exec_prefix="$withval", sdl_exec_prefix="")
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
if test "x$prefix" != xNONE; then
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
fi
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
dnl checks the results of sdl-config to some extent
dnl
rm -f conf.sdltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_sdl_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
if (($sdl_major_version > major) ||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the SDL_CONFIG environment variable to the"
echo "*** full path to sdl-config."
else
if test -f conf.sdltest ; then
:
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "SDL.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main K_and_R_C_main
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding SDL or finding the wrong"
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
SDL_CFLAGS=""
SDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
rm -f conf.sdltest
])