Commit the new build system (complete re-write), this includes several changes:

* Sane C/CXX/CPP/LDFLAGS
 * --with/--without settings
 * Proper gettext support
 * System portability changes (to support OS X and all other unix-like osen)
 * Features to allow for proper compile time settings (support exists features
   need to be added)

This comes with no warrenty at the moment, auto3 and asa support are both
incomplete/non-existent, there is no documentation and some conftests still nee$
to be written.

It's still incomplete try it at your own risk!

Originally committed to SVN as r1865.
This commit is contained in:
Amar Takhar 2008-03-03 07:22:58 +00:00
parent 1deb1b0217
commit b1c441ff73
22 changed files with 1530 additions and 1454 deletions

5
INSTALL Normal file
View File

@ -0,0 +1,5 @@
* The autogen.sh script is basic and might not work.
* If auto4 doesn't get picked up supply the --with-lua* flags.
* Read the README file.
* This is incomplete (just like this documentation!)

View File

@ -1,78 +1,17 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = ac auto3 automation csri aegisub po
lua51/src/liblua.a:
make -C lua51/src CC=$(CXX) a
all-recursive: lua51/src/liblua.a
SUBDIRS = auto3 automation aegisub po
EXTRA_DIST = \
lua51/COPYRIGHT \
lua51/HISTORY \
lua51/INSTALL \
lua51/MANIFEST \
lua51/Makefile \
lua51/README \
lua51/README.Aegisub \
lua51/doc/contents.html \
lua51/doc/logo.gif \
lua51/doc/lua.css \
lua51/doc/manual.html \
lua51/doc/readme.html \
lua51/lua51.vcproj \
lua51/lua51_vc8.vcproj \
lua51/src/Makefile \
lua51/src/lapi.c \
lua51/src/lapi.h \
lua51/src/lauxlib.c \
lua51/src/lauxlib.h \
lua51/src/lbaselib.c \
lua51/src/lcode.c \
lua51/src/lcode.h \
lua51/src/ldblib.c \
lua51/src/ldebug.c \
lua51/src/ldebug.h \
lua51/src/ldo.c \
lua51/src/ldo.h \
lua51/src/ldump.c \
lua51/src/lfunc.c \
lua51/src/lfunc.h \
lua51/src/lgc.c \
lua51/src/lgc.h \
lua51/src/linit.c \
lua51/src/liolib.c \
lua51/src/llex.c \
lua51/src/llex.h \
lua51/src/llimits.h \
lua51/src/lmathlib.c \
lua51/src/lmem.c \
lua51/src/lmem.h \
lua51/src/loadlib.c \
lua51/src/lobject.c \
lua51/src/lobject.h \
lua51/src/lopcodes.c \
lua51/src/lopcodes.h \
lua51/src/loslib.c \
lua51/src/lparser.c \
lua51/src/lparser.h \
lua51/src/lstate.c \
lua51/src/lstate.h \
lua51/src/lstring.c \
lua51/src/lstring.h \
lua51/src/lstrlib.c \
lua51/src/ltable.c \
lua51/src/ltable.h \
lua51/src/ltablib.c \
lua51/src/ltm.c \
lua51/src/ltm.h \
lua51/src/lua.h \
lua51/src/luaconf.h \
lua51/src/lualib.h \
lua51/src/lundump.c \
lua51/src/lundump.h \
lua51/src/lvm.c \
lua51/src/lvm.h \
lua51/src/lzio.c \
lua51/src/lzio.h
ACLOCAL_AMFLAGS = -I m4
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
mkinstalldirs \
config.guess \
config.sub \
depcomp \
install-sh \
missing \
mkinstalldirs \
INSTALL \
README

3
README Normal file
View File

@ -0,0 +1,3 @@
* There is no ASA support
* auto3 doesn't work either
- if you want support you'll have to do it by hand (for now)

View File

@ -1 +0,0 @@
extra_DIST=compile config.guess config.sub depcomp install-sh missing mkinstalldirs

View File

@ -1,534 +1,5 @@
AC_DEFUN([AC_C_FLAG], [{
AC_LANG_PUSH(C)
ac_c_flag_save="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_MSG_CHECKING([[whether $CC supports $1]])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[AC_MSG_RESULT([yes])],
[
CFLAGS="$ac_c_flag_save"
AC_MSG_RESULT([no])
$2
])
AC_LANG_POP(C)
}])
AC_DEFUN([AC_CXX_FLAG], [{
AC_LANG_PUSH(C++)
ac_cxx_flag_save="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
AC_MSG_CHECKING([[whether $CXX supports $1]])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[AC_MSG_RESULT([yes])],
[
CXXFLAGS="$ac_cxx_flag_save"
AC_MSG_RESULT([no])
$2
])
AC_LANG_POP(C++)
}])
##### 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
#
# 2006-05-29
#
# COPYLEFT
#
# Copyright (c) 2006 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 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, 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
##### 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. This macro adds the
# configure option "--with-apple-opengl-framework", which users can
# use to indicate that Apple's OpenGL framework should be used on Mac
# OS X. If Apple's OpenGL framework is used, the symbol
# "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If no GL implementation
# is found, "no_gl" is set to "yes".
#
# LAST MODIFICATION
#
# 2004-11-15
#
# COPYLEFT
#
# Copyright (c) 2004 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_CHECK_GL],
[AC_REQUIRE([AC_PATH_X])dnl
AC_REQUIRE([ACX_PTHREAD])dnl
#
# There isn't a reliable way to know we should use the Apple OpenGL framework
# without a configure option. A Mac OS X user may have installed an
# alternative GL implementation (e.g., Mesa), which may or may not depend on X.
#
AC_ARG_WITH([apple-opengl-framework],
[AC_HELP_STRING([--with-apple-opengl-framework],
[use Apple OpenGL framework (Mac OS X only)])])
if test "X$with_apple_opengl_framework" = "Xyes"; then
AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
[Use the Apple OpenGL framework.])
GL_LIBS="-framework OpenGL"
else
AC_LANG_PUSH(C)
AX_LANG_COMPILER_MS
if test X$ax_compiler_ms = Xno; then
GL_CFLAGS="${PTHREAD_CFLAGS}"
GL_LIBS="${PTHREAD_LIBS} -lm"
fi
#
# Use x_includes and x_libraries if they have been set (presumably by
# AC_PATH_X).
#
if test "X$no_x" != "Xyes"; then
if test -n "$x_includes"; then
GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"
fi
if test -n "$x_libraries"; then
GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"
fi
fi
AC_CHECK_HEADERS([windows.h])
AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
[ax_cv_check_gl_libgl="no"
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
if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
# if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h>
# endif
# include <GL/gl.h>]],
[[glBegin(0)]])],
[ax_cv_check_gl_libgl="${ax_try_lib}"; break])
done
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}])
if test "X${ax_cv_check_gl_libgl}" = "Xno"; then
no_gl="yes"
GL_CFLAGS=""
GL_LIBS=""
else
GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"
fi
AC_LANG_POP(C)
fi
AC_SUBST([GL_CFLAGS])
AC_SUBST([GL_LIBS])
])dnl
##### 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
#
# 2004-11-15
#
# COPYLEFT
#
# Copyright (c) 2004 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
])])
##### http://autoconf-archive.cryp.to/check_gnu_make.html
#
# SYNOPSIS
#
# CHECK_GNU_MAKE()
#
# DESCRIPTION
#
# This macro searches for a GNU version of make. If a match is found,
# the makefile variable `ifGNUmake' is set to the empty string,
# otherwise it is set to "#". This is useful for including a special
# features in a Makefile, which cannot be handled by other versions
# of make. The variable _cv_gnu_make_command is set to the command to
# invoke GNU make if it exists, the empty string otherwise.
#
# Here is an example of its use:
#
# Makefile.in might contain:
#
# # A failsafe way of putting a dependency rule into a makefile
# $(DEPEND):
# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
#
# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
# @ifGNUmake@ include $(DEPEND)
# @ifGNUmake@ endif
#
# Then configure.in would normally contain:
#
# CHECK_GNU_MAKE()
# AC_OUTPUT(Makefile)
#
# Then perhaps to cause gnu make to override any other make, we could
# do something like this (note that GNU make always looks for
# GNUmakefile first):
#
# if ! test x$_cv_gnu_make_command = x ; then
# mv Makefile GNUmakefile
# echo .DEFAULT: > Makefile ;
# echo \ $_cv_gnu_make_command \$@ >> Makefile;
# fi
#
# Then, if any (well almost any) other make is called, and GNU make
# also exists, then the other make wraps the GNU make.
#
# LAST MODIFICATION
#
# 2002-01-04
#
# COPYLEFT
#
# Copyright (c) 2002 John Darrington <j.darrington@elvis.murdoch.edu.au>
#
# 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(
[CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
_cv_gnu_make_command='' ;
dnl Search all the common names for GNU make
for a in "$MAKE" make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
_cv_gnu_make_command=$a ;
break;
fi
done ;
) ;
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
if test "x$_cv_gnu_make_command" != "x" ; then
ifGNUmake='' ;
else
ifGNUmake='#' ;
AC_MSG_RESULT("Not found");
fi
AC_SUBST(ifGNUmake)
] )
m4_include([m4macros/ac_flag.m4])
m4_include([m4macros/acx_pthread.m4])
m4_include([m4macros/ax_check_gl.m4])
m4_include([m4macros/ax_lang_compiler_ms.m4])
m4_include([m4macros/check_gnu_make.m4])

View File

@ -1,75 +1,92 @@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = res.rc $(srcdir)/*.h beautify
SUFFIXES = .c .cpp .rc
SUBDIRS = bitmaps posix
bin_PROGRAMS = aegisub
noinst_LIBRARIES=
SVNREV := $(shell svnversion | sed 's/[^0-9].*//')
DARCSREV := $(strip $(shell head -n 1 ../_darcs/inventory 2>/dev/null))
REVISION := $(if $(SVNREV),-DBUILD_SVN_REVISION=$(SVNREV)) $(if $(DARCSREV),-DBUILD_DARCS)
BUILDINFO := -DBUILD_CREDIT="\"$(shell whoami)\"" $(REVISION)
AM_CPPFLAGS = -DAEGISUB -Iposix -include posix/defines.h @FREETYPE_CFLAGS@ @WX_CPPFLAGS@
aegisub_LDADD = posix/libposix.a
aegisub_LDFLAGS = @GL_LIBS@ @FREETYPE_LIBS@ @PTHREAD_LIBS@ @WX_LIBS@
AM_CPPFLAGS = -DAEGISUB -Iposix -include posix/defines.h -include posix/config.h $(BUILDINFO)
aegisub_LDADD = posix/libposix.a ../csri/lib/.libs/libcsri.a
aegisub_LDFLAGS =
#XXX: fix this so it's generated by configure and put into acconf.h
#BUILDINFO := -DBUILD_CREDIT=verm -DBUILD_SVN_REVISION=0
if USE_LIBASS
LIBASS=subtitles_provider_libass.cpp
else
LIBASS=
endif
AUDIO_PLAYER=audio_player.cpp
if HAVE_PORTAUDIO
AUDIO_PLAYER += audio_player_portaudio.cpp
endif
if HAVE_ALSA
AUDIO_PLAYER += audio_player_alsa.cpp
noinst_LIBRARIES += libaudio_alsa.a
libaudio_alsa_a_SOURCES = audio_player_alsa.cpp
aegisub_LDFLAGS += @ALSA_LDFLAGS@
endif
if HAVE_PORTAUDIO
noinst_LIBRARIES += libaudio_portaudio.a
libaudio_portaudio_a_SOURCES = audio_player_portaudio.cpp
aegisub_LDFLAGS += @PORTAUDIO_LDFLAGS@
endif
if HAVE_PULSEAUDIO
AUDIO_PLAYER += audio_player_pulse.cpp
endif
AUTOMATION = auto4_base.cpp
if WITH_AUTO4_LUA
AUTOMATION += auto4_lua.cpp auto4_lua_assfile.cpp auto4_lua_dialog.cpp auto4_lua_scriptreader.cpp
aegisub_LDADD += ../lua51/src/liblua.a
endif
if WITH_AUTO3
AUTOMATION += auto4_auto3.cpp
aegisub_LDADD += ../auto3/libaegisub-auto3.la
endif
if WITH_AUTO4_RUBY
AUTOMATION += auto4_ruby_assfile.cpp auto4_ruby.cpp auto4_ruby_dialog.cpp
AM_CPPFLAGS += $(shell ruby -r rbconfig -e "p '-I' + Config::CONFIG['rubylibdir'] + '/' + Config::CONFIG['arch'] ") $(AM_CPPFLAGST)
endif
if WITH_AUTO4_PERL
AUTOMATION += auto4_perl.cpp auto4_perl_script.cpp auto4_perl_dialogs.cpp auto4_perl_ass.cpp auto4_perl_console.cpp
AM_CPPFLAGS += $(shell perl -MExtUtils::Embed -eccflags -eperl_inc)
aegisub_LDFLAGS += $(shell perl -MExtUtils::Embed -eldopts)
endif
if HAVE_HUNSPELL
HUNSPELL=spellchecker_hunspell.cpp
else
HUNSPELL=
noinst_LIBRARIES += libaudio_pulseaudio.a
libaudio_pulseaudio_a_SOURCES = audio_player_pulse.cpp
libaudio_pulseaudio_a_CFLAGS = @LIBPULSE_CFLAGS@
aegisub_LDFLAGS += @LIBPULSE_LIBS@
endif
if HAVE_FFMPEG
FFMPEG=audio_provider_lavc.cpp lavc_file.cpp video_provider_lavc.cpp lavc_keyframes.cpp
else
FFMPEG=
noinst_LIBRARIES += libaudiovideo_ffmpeg.a
libaudiovideo_ffmpeg_a_SOURCES = audio_provider_lavc.cpp lavc_file.cpp video_provider_lavc.cpp lavc_keyframes.cpp
libaudiovideo_ffmpeg_a_CFLAGS = @AVFORMAT_CFLAGS @AVCODEC_CFLAGS@
aegisub_LDFLAGS += @AVFORMAT_LDFLAGS@ @AVCODEC_LDFLAGS@
endif
if HAVE_LIBASS
noinst_LIBRARIES += libsubtitle_ass.a
libsubtitle_ass_a_SOURCES = subtitles_provider_libass.cpp
libsubtitle_ass_a_CFLAGS = @LIBASS_CFLAGS@
aegisub_LDFLAGS += @LIBASS_LIBS@
endif
if HAVE_HUNSPELL
noinst_LIBRARIES += libspell_hunspell.a
libspell_hunspell_a_SOURCES = spellchecker_hunspell.cpp
aegisub_LDFLAGS += @HUNSPELL_LDFLAGS@
endif
if HAVE_AUTO4_LUA
noinst_LIBRARIES += libauto4_lua.a
libauto4_lua_a_SOURCES = auto4_lua.cpp auto4_lua_assfile.cpp auto4_lua_dialog.cpp auto4_lua_scriptreader.cpp
libauto4_lua_a_CFLAGS = @LUA_CPPFLAGS@
aegisub_LDFLAGS += @LUA_LDFLAGS@
endif
if HAVE_AUTO4_PERL
noinst_LIBRARIES += libauto4_perl.a
libauto4_perl_a_SOURCES = auto4_perl.cpp auto4_perl_script.cpp auto4_perl_dialogs.cpp auto4_perl_ass.cpp auto4_perl_console.cpp auto4_perl.h auto4_perl_console.h
libauto4_perl_a_CFLAGS = @PERL_CFLAGS@
aegisub_LDFLAGS += @PERL_LDFLAGS@
endif
if HAVE_AUTO4_RUBY
noinst_LIBRARIES += libauto4_ruby.a
libauto4_ruby_a_SOURCES = auto4_ruby_assfile.cpp auto4_ruby.cpp auto4_ruby_dialog.cpp
lubauto4_ruby_hunspell_a_CFLAGS = @RUBY_CFLAGS@
aegisub_LDFLAGS += @RUBY_LDFLAGS@
endif
if HAVE_AUTO3_LUA
AUTO3_LUA = auto4_auto3.cpp
aegisub_LDADD += -L$(srcdir)/../auto3 -laegisub-auto3
endif
AUTOMATION = auto4_base.cpp
AUDIO_PLAYER= audio_player.cpp
## These aren't built, but are listed here so 'make dist' can always find all the sources
## This should also list all Win32 specific files
EXTRA_aegisub_SOURCES = \
audio_player_alsa.cpp \
audio_player_dsound.cpp \
audio_player_portaudio.cpp \
audio_player_pulse.cpp \
@ -109,6 +126,7 @@ aegisub_SOURCES = \
$(HUNSPELL) \
$(LIBASS) \
$(FFMPEG) \
$(AUTO3_LUA) \
aegisublocale.cpp \
ass_attachment.cpp \
ass_dialogue.cpp \
@ -253,3 +271,5 @@ noinst_HEADERS = \
csri/logging.h \
csri/openerr.h \
mythes.hxx
EXTRA_DIST = $(srcdir)/*.h beautify

View File

@ -1,14 +0,0 @@
EXTRA_DIST = genxpm.sh $(srcdir)/*.bmp $(srcdir)/*.ico
CLEANFILES = Makefile.bitmaps *.xpm
.PHONY: all-bitmaps
Makefile.bitmaps: $(srcdir)/genxpm.sh $(srcdir)/../res.rc
/bin/sh $^ $(srcdir) >$@
all: all-bitmaps
all-bitmaps: Makefile.bitmaps
make -f Makefile.bitmaps CONVERT=$(CONVERT) all

View File

@ -0,0 +1,24 @@
/BITMAP/ {
gsub(/\"bitmaps\//, "", $3)
gsub(/\"/, "", $3)
image[$1] = $3
}
END {
printf(" \
all: bmp2xpm wxicon_xpm.xpm \
.PHONY: all bmp2xpm \
CONVERT ?= convert \
")
printf("wxicon_xpm.xpm: icon.ico\n $(CONVERT) 'icon.ico[2]' wxicon_xpm.xpm\n");
for (v in image) {
printf("%s_xpm.xpm: %s\n", v, image[v])
printf(" $(CONVERT) -transparent \"#c0c0c0\" %s %s_xpm.xpm\n\n", image[v], v)
}
printf("bmp2xpm:")
for (v in image)
printf(" %s_xpm.xpm", v)
}

View File

@ -1,33 +0,0 @@
#!/bin/bash
RESFILE="$1"
SRCDIR="$2"
cd "$SRCDIR"
cat <<EOF
all: bmp2xpm wxicon_xpm.xpm
.PHONY: all bmp2xpm
srcdir=${SRCDIR}
wxicon_xpm.xpm: \$(srcdir)/icon.ico
\$(CONVERT) \$(srcdir)/'icon.ico[2]' wxicon_xpm.xpm
EOF
XPMNAMES=""
for I in *.bmp
do
DNAME="`grep "bitmaps/$I" $RESFILE | cut -d ' ' -f 1`"
echo -e "${DNAME}_xpm.xpm: \$(srcdir)/$I
\t\$(CONVERT) -transparent \\#c0c0c0 \$(srcdir)/$I ${DNAME}_xpm.xpm
"
XPMNAMES="${XPMNAMES} ${DNAME}_xpm.xpm"
done
echo "bmp2xpm: $XPMNAMES"

View File

@ -1,9 +1,3 @@
noinst_LIBRARIES = libposix.a
nodist_libposix_a_SOURCES = res.cpp
CLEANFILES = res.cpp res.h
EXTRA_DIST = genres.sh defines.h
res.h: $(srcdir)/genres.sh $(srcdir)/../res.rc
/bin/sh $^
res.cpp: res.h
EXTRA_DIST = genres.sh defines.h res.cpp res.h config.h

View File

@ -1,75 +1,7 @@
if HAVE_AUTO3_LUA
lib_LTLIBRARIES = libaegisub-auto3.la
EXTRA_libaegisub_auto3_la_SOURCES = callables.c
AM_CFLAGS = -DAUTO3LIB -Ilua/include
libaegisub_auto3_la_SOURCES = \
auto3.c \
lua/src/lapi.c \
lua/src/lcode.c \
lua/src/ldebug.c \
lua/src/ldo.c \
lua/src/ldump.c \
lua/src/lfunc.c \
lua/src/lgc.c \
lua/src/llex.c \
lua/src/lmem.c \
lua/src/lobject.c \
lua/src/lopcodes.c \
lua/src/lparser.c \
lua/src/lstate.c \
lua/src/lstring.c \
lua/src/ltable.c \
lua/src/ltests.c \
lua/src/ltm.c \
lua/src/lundump.c \
lua/src/lvm.c \
lua/src/lzio.c \
lua/src/lib/lauxlib.c \
lua/src/lib/lbaselib.c \
lua/src/lib/ldblib.c \
lua/src/lib/liolib.c \
lua/src/lib/lmathlib.c \
lua/src/lib/loadlib.c \
lua/src/lib/lstrlib.c \
lua/src/lib/ltablib.c
EXTRA_DIST = \
auto3.sln \
auto3.vcproj \
lua/COPYRIGHT \
lua/README
lua/README.Aegisub \
lua/UPDATE \
lua/DIFFS \
lua/HISTORY \
lua/lua.vcproj \
lua/doc/contents.html \
lua/doc/manual.html \
lua/doc/readme.html \
lua/doc/logo.gif
noinst_HEADERS = \
auto3.h \
lua/include/lua.h \
lua/include/lualib.h \
lua/include/lauxlib.h \
lua/src/lapi.h \
lua/src/lcode.h \
lua/src/ldebug.h \
lua/src/ldo.h \
lua/src/lfunc.h \
lua/src/lgc.h \
lua/src/llex.h \
lua/src/llimits.h \
lua/src/lmem.h \
lua/src/lobject.h \
lua/src/lopcodes.h \
lua/src/lparser.h \
lua/src/lstate.h \
lua/src/lstring.h \
lua/src/ltable.h \
lua/src/ltm.h \
lua/src/lundump.h \
lua/src/lzio.h \
lua/src/lvm.h
AM_CFLAGS = -DAUTO3LIB @LUA50_CPPFLAGS@
AM_LDFLAGS = @LUA50_LDFLAGS@
libaegisub_auto3_la_SOURCES = auto3.c
noinst_HEADERS = auto3.h
endif

View File

@ -1,30 +1,272 @@
#!/bin/bash
#!/bin/sh
test "X`echo -e`" = "X-e" && (
if `which bash`; then
echo "Your builtin echo doesn't support -e, running with bash instead."
bash $0
exit
else
echo "Your builtin echo (or echo(1)) doesn't support -e."
echo "If you had bash I'd use that instead, but it seems you don't."
exit 1
fi
)
# This script does all the magic calls to automake/autoconf and friends
# that are needed to configure a Subversion checkout. As described in
# the file HACKING you need a couple of extra tools to run this script
# successfully.
#
# If you are compiling from a released tarball you don't need these
# tools and you shouldn't use this script. Just call ./configure
# directly.
# Generate file list for automation subdir
rm -f automation/Makefile.am
cat > automation/Makefile.am <<EOF
## This file is automatically generated.
## Please edit autogen.sh if you need to modify this file.
ACLOCAL=${ACLOCAL-aclocal-1.9}
AUTOCONF=${AUTOCONF-autoconf}
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOMAKE=${AUTOMAKE-automake-1.9}
LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
automationdir = \$(datarootdir)/aegisub/automation
dist_automation_DATA = \\
EOF
GLIB_REQUIRED_VERSION=2.10.0
AUTOCONF_REQUIRED_VERSION=2.54
AUTOMAKE_REQUIRED_VERSION=1.9
INTLTOOL_REQUIRED_VERSION=0.31
LIBTOOL_REQUIRED_VERSION=1.5
find automation/ -name '*.lua' -or -name '*.rb' -or -name '*.auto3' -or -name '*.txt' | sed '{s/^automation\//\t/; s/$/ \\/}' >> automation/Makefile.am
echo -e "\tdemos/raytracer-test1.ass \\" >> automation/Makefile.am
echo -e "\tv4-docs/template-scripting-ideas.ass\n\n" >> automation/Makefile.am
PROJECT="aegsub http://aegisub.net/"
TEST_TYPE=-d
FILE=aegisub
autoreconf -f -i -s
srcdir=`pwd`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
AWK_BIN ?= awk
test $TEST_TYPE $FILE || {
echo
echo "You must run this script in the top-level $PROJECT directory."
echo
exit 1
}
# bmp -> xmp via the res.rc
if [ ! -f ${srcdir}/aegisub/bitmaps/Makefile.bitmaps ]; then
cat ${srcdir}/aegisub/res.rc | $AWK_BIN -f ${srcdir}/aegisub/bitmaps/genxpm.awk ${srcdir}/aegisub/bitmaps/Makefile.bitmaps
fi
cd ${srcdir}/aegisub/bitmaps
make -f Makefile.bitmaps
cd ${srcdir}
awk '/BITMAP/ { image[count] = $1; ++count} END { printf("EXTRA_DIST="); for (v in image) printf(" \\\n %s", image[v])' \
${srcdir}/aegisub/res.rc \
> ${srcdir}/aegisub/bitmaps/Makefile.am
cd ${srcdir}/aegisub/posix
sh genres.sh ${srcdir}/aegisub/res.rc
cd ${srcdir}
check_version ()
{
VERSION_A=$1
VERSION_B=$2
save_ifs="$IFS"
IFS=.
set dummy $VERSION_A 0 0 0
MAJOR_A=$2
MINOR_A=$3
MICRO_A=$4
set dummy $VERSION_B 0 0 0
MAJOR_B=$2
MINOR_B=$3
MICRO_B=$4
IFS="$save_ifs"
if expr "$MAJOR_A" = "$MAJOR_B" > /dev/null; then
if expr "$MINOR_A" \> "$MINOR_B" > /dev/null; then
echo "yes (version $VERSION_A)"
elif expr "$MINOR_A" = "$MINOR_B" > /dev/null; then
if expr "$MICRO_A" \>= "$MICRO_B" > /dev/null; then
echo "yes (version $VERSION_A)"
else
echo "Too old (version $VERSION_A)"
DIE=1
fi
else
echo "Too old (version $VERSION_A)"
DIE=1
fi
elif expr "$MAJOR_A" \> "$MAJOR_B" > /dev/null; then
echo "Major version might be too new ($VERSION_A)"
else
echo "Too old (version $VERSION_A)"
DIE=1
fi
}
echo
echo "I am testing that you have the tools required to build the"
echo "$PROJECT from Subversion. This test is not foolproof,"
echo "so if anything goes wrong, see the file HACKING for more information..."
echo
DIE=0
echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
if ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1; then
LIBTOOLIZE=$LIBTOOLIZE
elif (glibtoolize --version) < /dev/null > /dev/null 2>&1; then
LIBTOOLIZE=glibtoolize
else
echo
echo " You must have libtool installed to compile $PROJECT."
echo " Install the appropriate package for your distribution,"
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
echo
DIE=1
fi
if test x$LIBTOOLIZE != x; then
VER=`$LIBTOOLIZE --version \
| grep libtool | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
check_version $VER $LIBTOOL_REQUIRED_VERSION
fi
echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1; then
VER=`$AUTOCONF --version | head -n 1 \
| grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
check_version $VER $AUTOCONF_REQUIRED_VERSION
else
echo
echo " You must have autoconf installed to compile $PROJECT."
echo " Download the appropriate package for your distribution,"
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/"
echo
DIE=1;
fi
echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=$AUTOMAKE
ACLOCAL=$ACLOCAL
elif (automake-1.10 --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake-1.10
ACLOCAL=aclocal-1.10
elif (automake-1.9 --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake-1.9
ACLOCAL=aclocal-1.9
else
echo
echo " You must have automake $AUTOMAKE_REQUIRED_VERSION or newer installed to compile $PROJECT."
echo " Download the appropriate package for your distribution,"
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
echo
DIE=1
fi
if test x$AUTOMAKE != x; then
VER=`$AUTOMAKE --version \
| grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
check_version $VER $AUTOMAKE_REQUIRED_VERSION
fi
echo -n "checking for glib-gettextize ... "
if (glib-gettextize --version) < /dev/null > /dev/null 2>&1; then
VER=`glib-gettextize --version \
| grep glib-gettextize | sed "s/.* \([0-9.]*\)/\1/"`
check_version $VER $GLIB_REQUIRED_VERSION
else
echo
echo " You must have glib-gettextize installed to compile $PROJECT."
echo " glib-gettextize is part of glib-2.0, so you should already"
echo " have it. Make sure it is in your PATH."
echo
DIE=1
fi
echo -n "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
VER=`intltoolize --version \
| grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
check_version $VER $INTLTOOL_REQUIRED_VERSION
else
echo
echo " You must have intltool installed to compile $PROJECT."
echo " Get the latest version from"
echo " ftp://ftp.gnome.org/pub/GNOME/sources/intltool/"
echo
DIE=1
fi
if test "$DIE" -eq 1; then
echo
echo "Please install/upgrade the missing tools and call me again."
echo
exit 1
fi
echo
echo "I am going to run ./configure with the following arguments:"
echo
echo " --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS $@"
echo
if test -z "$*"; then
echo "If you wish to pass additional arguments, please specify them "
echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
echo "environment variable."
echo
fi
if test -z "$ACLOCAL_FLAGS"; then
acdir=`$ACLOCAL --print-ac-dir`
m4list="glib-2.0.m4 glib-gettext.m4 gtk-2.0.m4 intltool.m4 pkg.m4"
for file in $m4list
do
if [ ! -f "$acdir/$file" ]; then
echo
echo "WARNING: aclocal's directory is $acdir, but..."
echo " no file $acdir/$file"
echo " You may see fatal macro warnings below."
echo " If these files are installed in /some/dir, set the "
echo " ACLOCAL_FLAGS environment variable to \"-I /some/dir\""
echo " or install $acdir/$file."
echo
fi
done
fi
rm -rf autom4te.cache
$ACLOCAL $ACLOCAL_FLAGS
RC=$?
if test $RC -ne 0; then
echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
exit $RC
fi
$LIBTOOLIZE --force || exit $?
# optionally feature autoheader
($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER || exit 1
$AUTOMAKE --add-missing || exit $?
$AUTOCONF || exit $?
glib-gettextize --force || exit $?
intltoolize --force --automake || exit $?
cd $ORIGDIR
#$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@"
#RC=$?
#if test $RC -ne 0; then
# echo
# echo "Configure failed or did not finish!"
# exit $RC
#fi
#echo
#echo "Now type 'make' to compile the $PROJECT."

115
automation/Makefile.am Normal file
View File

@ -0,0 +1,115 @@
automationdir = $(aegisubdatadir)/automation
data_general= \
automation3.txt \
demos/raytracer-test1.ass \
include/Aegisub.pm \
include/Aegisub/Progress.pm \
include/Aegisub/Script.pm \
include/Auto4Utils.pm \
include/readme.txt \
tests/furi-test.ass \
tests/kara-templater-retime.ass \
v4-docs/basic-function-interface.txt \
v4-docs/configuration-dialogs.txt \
v4-docs/file-streams.txt \
v4-docs/misc.txt \
v4-docs/overview.txt \
v4-docs/progress-reporting.txt \
v4-docs/subtitle-data.txt \
v4-docs/template-scripting-ideas.ass
data_auto4_lua = \
autoload/cleantags-autoload.lua \
autoload/kara-templater.lua \
autoload/karaoke-auto-leadin.lua \
demos/future-windy-blur.lua \
demos/macro-1-edgeblur.lua \
demos/macro-2-mkfullwitdh.lua \
demos/raytracer.lua \
include/cleantags.lua \
include/karaskel-adv.lua \
include/karaskel-auto4.lua \
include/karaskel-base.lua \
include/karaskel.lua \
include/unicode.lua \
include/utils-auto4.lua \
include/utils.lua \
tests/basic-export-test.lua \
tests/basic-tests.lua \
tests/config-dialog-test.lua \
tests/gen-absurd-t-line.lua \
tests/hello-world.lua \
tests/karaoke-parse-test.lua \
tests/progress-reporting-test.lua \
tests/selection-set-test.lua \
tests/test-filter-name-clash.lua \
tests/test-furi.lua \
tests/test-text_extents.lua \
tests/text-extents-test.lua \
tests/trace-level-test.lua \
tests/unicode-test.lua
data_auto3_lua = \
auto3/readme.txt \
auto3/line-per-syllable.auto3 \
auto3/multi-template.auto3 \
auto3/simple-k-replacer.auto3 \
demos/auto3/readme.txt \
demos/auto3/1-minimal.lua \
demos/auto3/10-furigana.ass \
demos/auto3/10-furigana.lua \
demos/auto3/2-dump.lua \
demos/auto3/3-include.lua \
demos/auto3/4-text_extents.lua \
demos/auto3/5-configuration.lua \
demos/auto3/6-simple-effect.lua \
demos/auto3/7-advanced-effect.lua \
demos/auto3/8-skeleton.lua \
demos/auto3/9-advanced-skeleton.lua \
include/karaskel-adv.auto3 \
include/karaskel-base.auto3 \
include/karaskel.auto3 \
include/utils.auto3 \
tests/test-auto3-parsing.auto3
data_auto4_perl = \
demos/macro-1p-edgeblur.pl \
demos/perl-console.pl \
include/Aegisub/PerlConsole.pm \
v4-docs/perl-api.txt
data_auto4_ruby = \
demos/k-replacer.rb \
include/karaoke.rb \
include/utils.rb
nobase_automation_DATA = $(data_general)
if HAVE_AUTO4_LUA
nobase_automation_DATA += $(data_auto4_lua)
endif
if HAVE_AUTO3_LUA
nobase_automation_DATA += $(data_auto3_lua)
endif
if HAVE_AUTO4_PERL
nobase_automation_DATA += $(data_auto4_perl)
endif
if HAVE_AUTO4_RUBY
nobase_automation_DATA += $(data_auto4_ruby)
endif
EXTRA_DIST = \
$(data_general) \
$(data_auto4_lua) \
$(data_auto3_lua) \
$(data_auto4_perl) \
$(data_auto4_ruby)

View File

@ -1,277 +0,0 @@
AC_PREREQ(2.57)
AC_INIT([Aegisub], [2.00-alpha],, [aegisub])
AC_CONFIG_AUX_DIR([ac])
AC_CONFIG_SRCDIR([aegisub/main.cpp])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([aegisub/posix/acconf.h])
AC_GNU_SOURCE
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.14.5])
AC_CANONICAL_HOST
# --enable-lemming: make errors non-fatal. to be used for
# creating dist packages on boxes without X11. intentionally
# not appearing in --help :)
ignore_failure=""
AC_ARG_ENABLE([lemming], [], [ignore_failure="$enableval"])
AC_DEFUN([AC_MSG_XFAILURE], [{
if test "$ignore_failure" == "yes"
then AC_MSG_WARN([$1])
else AC_MSG_FAILURE([$1])
fi
}])
dnl Checks for programs.
CHECK_GNU_MAKE
AC_PROG_CC
AC_PROG_CXX
AC_LANG(C++)
AC_PROG_LIBTOOL
AC_PATH_PROGS(CONVERT, [convert], [])
if test -z "$CONVERT"; then
AC_MSG_XFAILURE([Aegisub needs convert (from ImageMagick) to produce xpms from the supplied bitmaps/icons])
fi
ACX_PTHREAD([], [
AC_MSG_XFAILURE([Aegisub needs pthreads])
])
AC_MSG_CHECKING([whether pthreads works])
AC_COMPILE_IFELSE([
#include <stdlib.h>
#include <pthread.h>
int main() { return 0; }
], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
echo <<EOM
***********************************************************************
* Your pthreads installation seems to be broken.
* Apart from obviously being bad, this can cause strange detection
* errors as well.
* On some Linux distributions, this can be caused by having the package
* libpthread-dev installed. If you have this package, please uninstall
* it now.
***********************************************************************
EOM
AC_MSG_XFAILURE([You need a working pthreads installation.])
])
AC_CHECK_LIB([asound], [snd_pcm_open], [LIBS="-lasound $LIBS"; found_audio=yes], [with_alsa=no])
AC_CHECK_LIB([portaudio], [Pa_Initialize], [LIBS="-lportaudio $LIBS";found_audio=yes], [with_portaudio=no])
AC_CHECK_FUNCS([Pa_GetStreamTime])
PKG_CHECK_MODULES([LIBPULSE], libpulse >= 0.5, [found_audio=yes], [with_pulseaudio=no])
AC_CHECK_LIB([avcodec], [avcodec_init],, [with_ffmpeg=no])
AC_CHECK_LIB([avformat], [av_read_frame],, [with_ffmpeg=no])
AC_CHECK_LIB([swscale], [sws_scale],, [with_ffmpeg=no])
if test "$with_ffmpeg" != "no"; then
found_video_provider=yes
fi
AC_CHECK_LIB([hunspell], [main],, [with_hunspell=no])
AC_CHECK_LIB([ruby1.9], [ruby_init],, [with_ruby=no])
dnl Perl engine
AC_ARG_ENABLE([auto4-perl],
[AS_HELP_STRING([--enable-auto4-perl],[enable automation4 perl engine (under development)@<:@default=no@:>@])],,
[enable_auto4_perl=no])
if test "$enable_auto4_perl" != "no"; then
echo -n 'checking for perl version >= 5.004... '
if perl -e 'require 5.004'; then
enable_auto4_perl=yes
echo 'yes'
else
enable_auto4_perl=no
fi
fi
AC_CHECK_HEADER([wchar.h],,[
AC_MSG_XFAILURE([aegisub needs wide character support, find a wchar.h])
])
PKG_CHECK_MODULES([FREETYPE], freetype2 >= 9.7.0,, [
AC_MSG_XFAILURE([aegisub needs FreeType2 2.1.9, go install it])
])
AX_CHECK_GL
if test ! "$GL_LIBS"; then
AC_MSG_WARN([Could not find system GL library])
AC_MSG_XFAILURE([GL support is required to build Aegisub. (Try mesa3d)])
fi
CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
LIBS="$LIBS $GL_LIBS"
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.8.1, [has_wxconfig=1], [has_wxconfig=0], [std,gl,stc])
if test "$has_wxconfig" != 1; then
echo <<EOM
wxWidgets must be installed on your system
but wx-config script couldn't be found.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' command) is in LD_LIBRARY_PATH or
equivalent variable and wxWidgets version is 2.8.1 or above.
Also, make sure you have the STC (StyledTextCtrl) module
installed. It is shipped with wxWidgets under the contrib
directory, but not built by default.
EOM
AC_MSG_XFAILURE([wxWidgets detection failed.])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS $FREETYPE_CFLAGS $LIBPULSE_CFLAGS"
LIBS="$LIBS $WX_LIBS $FREETYPE_LIBS $LIBPULSE_LIBS"
AC_MSG_CHECKING([wxWidgets OpenGL support])
AC_LINK_IFELSE([
#include <wx/glcanvas.h>
int main(int argc, char **argv) {
wxGLCanvas *canvas;
return 0;
}
],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([not available])
AC_MSG_XFAILURE([wxWidgets OpenGL support missing])
])
AC_MSG_CHECKING([wxWidgets StyledTextCtrl support])
AC_LINK_IFELSE([
#include <wx/stc/stc.h>
int main(int argc, char **argv) {
wxStyledTextCtrl *canvas;
return 0;
}
],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([not available])
AC_MSG_XFAILURE([wxWidgets missing StyledTextCtrl])
])
AC_CHECK_LIB([m], [main])
AC_CHECK_LIB([dl], [dlopen])
AC_ARG_WITH([libass], [AS_HELP_STRING([--without-libass],[disable libass @<:@default=check@:>@])],[],[with_libass=check])
AS_IF([test "x$with_libass" != xno], [
PKG_CHECK_MODULES([LIBASS], libass >= 0.9.1, [
CPPFLAGS="$CPPFLAGS $LIBASS_CFLAGS"
LIBS="$LIBS $LIBASS_LIBS"
AC_DEFINE(HAVE_LIBASS, 1, [found libass via pkg-config])
AC_CHECK_HEADERS([ass/ass.h], [
with_libass=yes
], [ if test "x$with_libass" != xcheck
then AC_MSG_XFAILURE([--with-libass given, but libass headers not found])
fi
with_libass=no
])
], [ if test "x$with_libass" != xcheck
then AC_MSG_XFAILURE([--with-libass given, but libass pkgconfig module found])
fi
with_libass=no
])
])
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_PROG_INSTALL
AC_MSG_CHECKING([[whether preprocessor supports #pragma once]])
AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([[#pragma once]])],
[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PRAGMA_ONCE], [1], [Preprocessor support for #pragma once])
],
[AC_MSG_RESULT([no])])
AC_C_FLAG([-Wall])
AC_C_FLAG([-O2])
AC_C_FLAG([-Wextra],[AC_C_FLAG([-W])])
AC_C_FLAG([-Wno-unused-parameter])
AC_C_FLAG([-std=gnu99])
AC_CXX_FLAG([-Wall])
AC_CXX_FLAG([-Wextra],[AC_CXX_FLAG([-W])])
AC_CXX_FLAG([-Wno-unused-parameter])
AC_CXX_FLAG([-Wno-long-long])
AC_CXX_FLAG([-O2])
AC_CXX_FLAG([-fpermissive])
AC_CXX_FLAG([-fno-strict-aliasing])
AC_CXX_FLAG([-std=c++98])
AC_PATH_XTRA
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_CONFIG_SUBDIRS([csri])
AM_CONDITIONAL([USE_LIBASS], [test "$with_libass" != "no" ])
AM_CONDITIONAL([HAVE_ALSA], [test "$with_alsa" != "no"])
AM_CONDITIONAL([HAVE_PORTAUDIO], [test "$with_portaudio" != "no"])
AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "$with_pulseaudio" != "no"])
AM_CONDITIONAL([HAVE_HUNSPELL], [test "$with_hunspell" != "no"])
AM_CONDITIONAL([HAVE_FFMPEG], [test "$with_ffmpeg" != "no"])
dnl FIXME: These three should probably get proper --with flags,
dnl and Ruby also keep its detection (warn/fail if you have --with-ruby
dnl but the lib isn't detected.)
AM_CONDITIONAL([WITH_AUTO4_PERL], [test "$enable_auto4_perl" != "no"])
AM_CONDITIONAL([WITH_AUTO4_RUBY], [test "$with_ruby" != "no"])
AM_CONDITIONAL([WITH_AUTO4_LUA], [true])
dnl TODO: Make the auto3 lib build on non-Win32 so this can be true
AM_CONDITIONAL([WITH_AUTO3], [true])
AC_OUTPUT([
Makefile
ac/Makefile
auto3/Makefile
automation/Makefile
po/Makefile.in
aegisub/Makefile
aegisub/bitmaps/Makefile
aegisub/posix/Makefile
])
if test -z "$found_audio"; then
echo <<EOM
***********************************************************************
* No supported audio player interface was found on your system.
* If you want audio support in Aegisub you need to install one of
* these libraries:
* - PulseAudio
* http://pulseaudio.org/
* - ALSA (Linux only) (Currently broken)
* http://www.alsa-project.org/
* - PortAudio (version 18 only, version 19 is not compatible)
* http://www.portaudio.com/
***********************************************************************
EOM
fi
if test -z "$found_video_provider"; then
echo <<EOM
***********************************************************************
* No supported video/audio reader interface was found on your system.
* You will not be able to open any video or audio files in Aegisub
* unless you install a supported video/audio provider.
* You will however still be able to open "dummy" video, ie. a blank,
* virtual video clip with subtitles overlaid.
* Currently we only support one video/audio provider on non-Windows
* systems:
* - FFmpeg (libavcodec + libavformat)
* http://ffmpeg.mplayerhq.hu/
***********************************************************************
EOM
fi

491
configure.in Normal file
View File

@ -0,0 +1,491 @@
AC_PREREQ(2.57)
######################
# aegisub version info
######################
m4_define([aegisub_major_version], [2])
m4_define([aegisub_minor_version], [1])
m4_define([aegisub_version], [aegisub_major_version.aegisub_minor_version-dev])
###################
# Required packages
###################
m4_define([pkgconfig_required_version], [0.20])
m4_define([libass_required_version], [0.9.1])
m4_define([freetype_required_version], [9.7.0])
m4_define([fontconfig_required_version], [2.4])
m4_define([perl_required_version], [5.004])
m4_define([ruby_required_version], [1.8])
m4_define([lua_auto4_required_version], [5.1])
m4_define([lua_auto3_required_version], [5.0])
#######
# Setup
#######
AC_INIT([Aegisub], [aegisub_version],, [aegisub])
AC_CONFIG_SRCDIR([aegisub/main.cpp])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([aegisub/posix/acconf.h])
AC_GNU_SOURCE
AC_CANONICAL_HOST
AM_MAINTAINER_MODE
########################
# Configurable variables
########################
aegisubdatadir="$datadir/aegisub/2.1"
AC_SUBST(aegisubdatadir)
####################
# Check for programs
####################
CHECK_GNU_MAKE
AC_PROG_CC
AC_PROG_CXX
AC_LANG(C++)
AC_PROG_LIBTOOL
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG([0.20])
###################################################
# Check for pthreads and setup variables / compiler
###################################################
ACX_PTHREAD([], [AC_MSG_FAILURE([aegisub requires pthreads])])
#LIBS="$PTHREAD_LIBS $LIBS";
#CFLAGS="$CFLAGS $PTHREAD_CFLAGS";
CC="$PTHREAD_CC";
######################
# Check compiler flags
######################
AC_C_FLAG([-Wall])
AC_C_FLAG([-O2])
AC_C_FLAG([-Wextra],[AC_C_FLAG([-W])])
AC_C_FLAG([-Wno-unused-parameter])
AC_C_FLAG([-std=gnu99])
AC_CXX_FLAG([-Wall])
AC_CXX_FLAG([-Wextra],[AC_CXX_FLAG([-W])])
AC_CXX_FLAG([-Wno-unused-parameter])
AC_CXX_FLAG([-Wno-long-long])
AC_CXX_FLAG([-O2])
AC_CXX_FLAG([-fpermissive])
AC_CXX_FLAG([-fno-strict-aliasing])
AC_CXX_FLAG([-std=c++98])
######################################
# Check Headers / Features / Libraries
######################################
AC_PATH_XTRA
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_CHECK_LIB([m], [main])
AC_LIBTOOL_DLOPEN_SELF
AC_MSG_CHECKING([[whether preprocessor supports #pragma once]])
AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([[#pragma once]])],
[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PRAGMA_ONCE], [1], [Preprocessor support for #pragma once])
],
[AC_MSG_RESULT([no])])
#################
# Audio Providers
#################
AC_ARG_WITH(alsa, [ --without-alsa build without ALSA audio provider. (default: auto)], alsa_disabled="(disabled)")
if test "x$with_alsa" != xno; then
AC_CHECK_LIB([asound], [snd_pcm_open], [ALSA_LDFLAGS="-lasound"; found_audio=yes; with_alsa=yes], [with_alsa=no])
fi
AC_SUBST(ALSA_LDFLAGS)
AM_CONDITIONAL([HAVE_ALSA], [test "$with_alsa" != "no"])
AC_ARG_WITH(portaudio,[ --without-portaudio build without PortAudio audio provider.
(default: auto)], portaudio_disabled="(disabled)")
if test "x$with_portaudio" != xno; then
aegisub_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS"
AC_CHECK_LIB([portaudio], [Pa_Initialize], [PORTAUDIO_LDFLAGS="-lportaudio"; found_audio=yes; with_portaudio=yes], [with_portaudio=no])
fi
if test "x$with_portaudio" != xno; then
AC_CHECK_LIB([portaudio], [Pa_GetStreamTime], [LIBS="-lportaudio"], [with_portaudio_getstreamtime=no])
if test "x$with_portaudio_getstreamtime" != xno; then
AC_DEFINE(HAVE_PA_GETSTREAMTIME, 1, [Define to 1 if Pa_GetStreamTime is available in PortAudio])
fi
CPPFLAGS="$aegisub_save_CPPFLAGS"
fi
AC_SUBST(PORTAUDIO_LDFLAGS)
AM_CONDITIONAL([HAVE_PORTAUDIO], [test "$with_portaudio" != "no"])
AC_ARG_WITH(pulseaudio,[ --without-pulseaudio build without PulseAudio audio provider.
(default: auto)], pulseaudio_disabled="(disabled)")
if test "x$with_pulseaudio" != xno; then
PKG_CHECK_MODULES(LIBPULSE, libpulse >= 0.5, [found_audio=yes; with_pulseaudio=yes], [with_pulseaudio=no])
fi
AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "$with_pulseaudio" != "no"])
#################
# Video Providers
#################
AC_ARG_WITH(ffmpeg, [ --without-ffmpeg build without FFMPEG video provider.. (default: auto)], ffmpeg_disabled="(disabled)")
if test "$without_ffmpeg" != xno; then
AC_CHECK_LIB([avcodec], [avcodec_init],AVCODEC_LDFLAGS="-lavcodec", [with_ffmpeg=no])
AC_CHECK_LIB([avformat], [av_read_frame],AVFORMAT_LDFLAGS="-lavcodec", [with_ffmpeg=no])
AC_CHECK_LIB([avformat], [sws_scale],MOSTLY_HARMLESS=, [with_ffmpeg=no])
if test "$with_ffmpeg" != "no"; then
found_video_provider=yes
with_ffmpeg="yes"
fi
fi
AC_SUBST(AVCODEC_LDFLAGS)
AC_SUBST(AVFORMAT_LDFLAGS)
AM_CONDITIONAL([HAVE_FFMPEG], [test "$with_ffmpeg" != "no"])
###################
# Subtitle Provider
###################
AC_ARG_WITH(libass, [ --without-libass disable libass (default=autodetect)],libass_disabled="(disabled)")
if test "x$with_libass" != xno; then
PKG_CHECK_MODULES(LIBASS, libass >= 0.9.1)
aegisub_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LIBASS_LIBS"
AC_CHECK_LIB([ass], [ass_read_styles],[LIBASS_LIBS="$LIBASS_LIBS]", with_libass=no)
LDFLAGS="$aegisub_save_LDFLAGS"
aegisub_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$LIBASS_CFLAGS"
AC_CHECK_HEADER([ass/ass.h],[LIBASS_CFLAGS="$LIBASS_CFLAGS"],with_libass="no")
CPPFLAGS="$aegisub_save_CPPFLAGS"
fi
if test "$with_libass" != "no"; then
AC_DEFINE(HAVE_LIBASS, 1, [found libass via pkg-config])
with_libass="yes"
fi
AC_SUBST(LIBASS_LIBS)
AC_SUBST(LIBASS_CFLAGS)
AM_CONDITIONAL([HAVE_LIBASS], [test "$with_libass" != "no" ])
##############################
# Program Support and Features
##############################
AC_CHECK_HEADER([wchar.h],,[AC_MSG_FAILURE([aegisub requires wide character support])])
AX_CHECK_GL
if test ! "$GL_LIBS"; then
AC_MSG_FAILURE([aegisub requires GL support.])
fi
AC_SUBST(GL_CFLAGS)
AC_SUBST(GL_LIBS)
PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.7.0, [], [AC_MSG_FAILURE([aegisub requires >= FreeType2 2.1.9])])
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.4, [], [AC_MSG_FAILURE([aegisub requires >= fontconfig >= 2.4])])
AC_CHECK_LIB([hunspell], [main], HUNSPELL_LDFLAGS="-lhunspell", [with_hunspell=no])
AM_CONDITIONAL([HAVE_HUNSPELL], [test "$with_hunspell" != "no"])
AC_SUBST(HUNSPELL_LDFLAGS)
############
# Automation
############
AC_ARG_WITH(lua,
[ --without-lua build without lua 5.1 (auto3)], [lua_disabled="(disabled)"])
AC_ARG_WITH(lua-lib,
[ --with-lua-lib=PREFIX PATH location of lua 5.1 library], [lua_lib_dir="$withval"])
AC_ARG_WITH(lua-include,
[ --with-lua-include=PREFIX
PATH location of lua 5.1 includes], [lua_include_dir="$withval"])
if test "$without_lua" != no; then
aegisub_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$lua_lib_dir"
AC_CHECK_LIB([lua], [lua_call], LUA_LDFLAGS="-L$lua_lib_dir -llua", with_lua_lib=no)
LDFLAGS="$aegisub_save_LDFLAGS"
aegisub_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$lua_include_dir"
AC_CHECK_HEADER([lua.h],LUA_CPPLAGS="-I$lua_include_dir",with_lua_include="no")
CPPFLAGS="$aegisub_save_CPPFLAGS"
fi
if test "$with_lua_lib" != "no" && test "$with_lua_include" != "no"; then
with_auto4="yes"
else
with_auto4="no"
fi
AC_SUBST(LUA_CPPFLAGS)
AC_SUBST(LUA_LDFLAGS)
AM_CONDITIONAL([HAVE_AUTO4_LUA], [test "$with_auto4" != "no"])
AC_ARG_WITH(perl, [ --without-perl build without PERL Automation. (default: auto)], perl_disabled="(disabled)")
AC_ARG_WITH(perl-bin, [ --with-perl-bin=PATH location of PERL binary.. (default: $PATH)], [WITH_PERL_BIN="$withval"])
if test -z "$perl_disabled"; then
if test -z "$WITH_PERL_BIN"; then
AC_PATH_PROG([PERL_BIN],perl,no)
else
PERL_BIN="$WITH_PERL_BIN"
fi
if test "$PERL_BIN" != "no"; then
AC_MSG_CHECKING([checking for perl version >= 5.004])
if $PERL_BIN -e 'require 5.004'; then
AC_MSG_RESULT([yes])
with_perl=yes
AC_MSG_CHECKING([checking $PERL_BIN clfags])
PERL_CFLAGS=`$PERL_BIN -MExtUtils::Embed -eccflags -eperl_inc`
AC_MSG_RESULT([$PERL_CFLAGS])
AC_MSG_CHECKING([checking $PERL_BIN libs])
PERL_LDFLAGS=`$PERL_BIN -MExtUtils::Embed -eldopts`
AC_MSG_RESULT([$PERL_LDFLAGS])
else
AC_MSG_RESULT([yes])
with_perl=no
fi
fi
fi
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LDFLAGS)
AM_CONDITIONAL([HAVE_AUTO4_PERL], [test "$with_perl" != "no"])
AC_ARG_WITH(ruby, [ --without-ruby build without Ruby Automation. (default: auto)], ruby_disabled="(disabled)")
AC_ARG_WITH(ruby-bin, [ --with-ruby-bin=PATH location of RUBY binary.. (default: $PATH)], [WITH_RUBY_BIN="$withval"])
if test -z "$ruby_disabled"; then
if test -z "$WITH_RUBY_BIN"; then
AC_PATH_PROG([RUBY_BIN],ruby,no)
else
RUBY_BIN="$WITH_RUBY_BIN"
fi
if test "$RUBY_BIN" != "no"; then
AC_MSG_CHECKING([checking for ruby version >= 1.8])
if $RUBY_BIN -r rbconfig -e 'if Config::CONFIG@<:@"ruby_version"@:>@.to_f >= 1.8 then exit(0) else exit(1) end' ; then
AC_MSG_RESULT([yes])
with_ruby=yes
AC_MSG_CHECKING([checking $RUBY_BIN -r rbconfig archdir, cflags])
RUBY_CFLAGS=`$RUBY_BIN -r rbconfig -e "printf(\"-I%s %s\", Config::CONFIG@<:@'archdir'@:>@, Config::CONFIG@<:@'CFLAGS'@:>@)"`
AC_MSG_RESULT([$RUBY_CFLAGS])
AC_MSG_CHECKING([checking $RUBY_BIN rbconfig libs])
RUBY_LDFLAGS=`$RUBY_BIN -r rbconfig -e "print Config::CONFIG@<:@'LIBS'@:>@"`
AC_MSG_RESULT([$RUBY_LDFLAGS])
else
AC_MSG_RESULT([yes])
with_ruby=no
fi
fi
fi
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LDFLAGS)
AM_CONDITIONAL([HAVE_AUTO4_RUBY], [test "$with_ruby" != "no"])
AC_ARG_WITH(lua50-lib,
[ --with-lua50-lib=PREFIX PATH location of lua 5.0 library
(required for auto3 support)], [lua50_lib_dir="$withval"])
AC_ARG_WITH(lua50-include,
[ --with-lua50-include=PREFIX
PATH location of lua 5.0 includes
(required for auto3 support)], [lua50_include_dir="$withval"])
#if test -z "$lua50-lib-dir"; then
# AC_MSG_WARN([You must supply both --with-lua50-lib AND --with-lua50-include.])
#fi
if ! test -z "$lua50_lib_dir" && ! test -z "$lua50_include_dir"; then
aegisub_save_LDFLAGS="$LDFLAGS"
LDFLAGS="-L$lua50_lib_dir"
AC_CHECK_LIB([lua], [lua_call],[LUA50_LDFLAGS="-L$lua50_lib_dir -llua"; lua50_lib="yes"], [lua50_lib="no"])
LDFLAGS="$aegisub_save_LDFLAGS"
aegisub_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-I$lua50_include_dir"
AC_CHECK_HEADER([lua.h],[LUA50_CPPFLAGS="-I$lua50_include_dir"; lua50_include="yes"],[lua50_include="no"])
CPPFLAGS="$aegisub_save_CPPFLAGS"
fi
if test "$lua50_lib" = "yes" && test "$lua50_include" = "yes"; then
with_auto3="yes"
else
with_auto3="no"
fi
AM_CONDITIONAL([HAVE_AUTO3_LUA], [test "$with_auto3" != "no"])
AC_SUBST(LUA50_CPPFLAGS)
AC_SUBST(LUA50_LDFLAGS)
################
# Widget support
################
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.8.1, [have_wxconfig=1], [have_wxconfig=0], [std,gl,stc])
if test "$have_wxconfig" != 1; then
AC_MSG_FAILURE([
wxWidgets detection failed, please set --with-wx* or add
the libraries to your LDFLAGS, CXX/CFLAGS.
])
fi
#CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
#CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
#CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
aegisub_save_CPPLAGS="$CPPLAGS"
CPPFLAGS="$WX_CFLAGS"
AC_MSG_CHECKING([wxWidgets OpenGL support])
AC_TRY_COMPILE([#include <wx/glcanvas.h>],
[wxGLCanvas *canvas;],
with_wxgl=yes, with_wxgl=no)
AC_MSG_RESULT($with_wxgl)
if test "$with_wxgl" = "no"; then
AC_MSG_FAILURE([wxWidgets OpenGL support missing])
fi
AC_MSG_CHECKING([wxWidgets StyledTextCtrl support])
AC_TRY_COMPILE([#include <wx/stc/stc.h>],
[wxStyledTextCtrl *canvas;],
with_wxstc=yes, with_wxstc=no)
AC_MSG_RESULT($with_wxstc)
if test "$with_wxstc" = "no"; then
AC_MSG_FAILURE([wxWidgets missing StyledTextCtrl])
fi
CPPFLAGS="$aegisub_save_CPPFLAGS"
################################################
# Internationalisation support (keep this last!)
################################################
AC_PROG_INTLTOOL
AM_GLIB_GNU_GETTEXT
GETTEXT_PACKAGE=aegisub21
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
[The prefix for our gettext translation domains.])
AC_OUTPUT([
Makefile
auto3/Makefile
automation/Makefile
po/Makefile.in
aegisub/Makefile
aegisub/bitmaps/Makefile
aegisub/posix/Makefile
])
if test -z "$found_audio"; then
AC_MSG_NOTICE([
***********************************************************************
* No supported audio player interface was found on your system.
* If you want audio support in Aegisub you need to install one of
* these libraries:
* - PulseAudio
* * http://pulseaudio.org/
* - ALSA (Linux only) (Currently broken)
* * http://www.alsa-project.org/
* - PortAudio (version 18 only, version 19 is not compatible)
* * http://www.portaudio.com/
***********************************************************************
])
fi
if test -z "$found_video_provider"; then
AC_MSG_NOTICE([
***********************************************************************
* No supported video/audio reader interface was found on your system.
* You will not be able to open any video or audio files in Aegisub
* unless you install a supported video/audio provider.
* You will however still be able to open "dummy" video, ie. a blank,
* virtual video clip with subtitles overlaid.
* Currently we only support one video/audio provider on non-Windows
* systems:
* - FFmpeg (libavcodec + libavformat)
* * http://ffmpeg.mplayerhq.hu/
***********************************************************************
])
fi
AC_MSG_RESULT([
Scripting Engines:
auto4 Perl: $with_perl $perl_disabled
auto3: $with_auto3
auto4: $with_auto4 $lua_disabled
auto4 Ruby: $with_ruby $ruby_disabled
Audio Providers:
ALSA: $with_alsa $alsa_disabled
PortAudio: $with_portaudio $portaudio_disabled
PulseAudio: $with_pulseaudio $pulseaudio_disabled
Video Providers
ffmpeg: $with_ffmpeg $ffmpeg_disabled
Subtitle Providers:
asa: $with_asa
libass: $with_libass
]);

View File

@ -1,366 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macros for wxWidgets detection. Typically used in configure.in as:
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl ...
dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWidgets must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWidgets libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWidgets version is 2.3.4 or above.
dnl ])
dnl fi
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LIBS="$LIBS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_OPTIONS_WXCONFIG
dnl
dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
dnl --wx-config command line options
dnl ---------------------------------------------------------------------------
AC_DEFUN([AM_OPTIONS_WXCONFIG],
[
AC_ARG_WITH(wxdir,
[ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH],
[ wx_config_name="$withval/wx-config"
wx_config_args="--inplace"])
AC_ARG_WITH(wx-config,
[ --with-wx-config=CONFIG wx-config script to use (optional)],
wx_config_name="$withval" )
AC_ARG_WITH(wx-prefix,
[ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
wx_config_prefix="$withval", wx_config_prefix="")
AC_ARG_WITH(wx-exec-prefix,
[ --with-wx-exec-prefix=PREFIX
Exec prefix where wxWidgets is installed (optional)],
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
])
dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
dnl wx_ver_ok=yes if it is:
AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
[
wx_ver_ok=""
if test "x$WX_VERSION" != x ; then
if test $wx_config_major_version -gt $1; then
wx_ver_ok=yes
else
if test $wx_config_major_version -eq $1; then
if test $wx_config_minor_version -gt $2; then
wx_ver_ok=yes
else
if test $wx_config_minor_version -eq $2; then
if test $wx_config_micro_version -ge $3; then
wx_ver_ok=yes
fi
fi
fi
fi
fi
fi
])
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
dnl
dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
dnl environment variable to override the default name of the wx-config script
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
dnl case the macro won't even waste time on tests for its existence.
dnl
dnl Optional WX-LIBS argument contains comma- or space-separated list of
dnl wxWidgets libraries to link against (it may include contrib libraries). If
dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
dnl link with all of the core wxWidgets libraries.
dnl
dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
dnl invocation command in present. It can be used to fine-tune lookup of
dnl best wxWidgets build available.
dnl
dnl Example use:
dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
dnl [--unicode --debug])
dnl ---------------------------------------------------------------------------
dnl
dnl Get the cflags and libraries from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXCONFIG],
[
dnl do we have wx-config name: it can be wx-config or wxd-config or ...
if test x${WX_CONFIG_NAME+set} != xset ; then
WX_CONFIG_NAME=wx-config
fi
if test "x$wx_config_name" != x ; then
WX_CONFIG_NAME="$wx_config_name"
fi
dnl deal with optional prefixes
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
if test "$cross_compiling" = "yes"; then
wx_config_args="$wx_config_args --host=$host_alias"
fi
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
if test -x "$WX_CONFIG_NAME" ; then
AC_MSG_CHECKING(for wx-config)
WX_CONFIG_PATH="$WX_CONFIG_NAME"
AC_MSG_RESULT($WX_CONFIG_PATH)
else
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
fi
if test "$WX_CONFIG_PATH" != "no" ; then
WX_VERSION=""
min_wx_version=ifelse([$1], ,2.2.1,$1)
if test -z "$5" ; then
AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
else
AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
fi
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_config_micro_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_requested_major_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_requested_minor_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_requested_micro_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
_WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
[$wx_requested_minor_version],
[$wx_requested_micro_version])
if test -n "$wx_ver_ok"; then
AC_MSG_RESULT(yes (version $WX_VERSION))
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
dnl is this even still appropriate? --static is a real option now
dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
dnl what the user actually wants, making this redundant at best.
dnl For now keep it in case anyone actually used it in the past.
AC_MSG_CHECKING([for wxWidgets static library])
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
if test "x$WX_LIBS_STATIC" = "x"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
dnl starting with version 2.2.6 wx-config has --cppflags argument
wx_has_cppflags=""
if test $wx_config_major_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_minor_version -eq 2; then
if test $wx_config_micro_version -ge 6; then
wx_has_cppflags=yes
fi
fi
fi
fi
fi
dnl starting with version 2.7.0 wx-config has --rescomp option
wx_has_rescomp=""
if test $wx_config_major_version -gt 2; then
wx_has_rescomp=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -ge 7; then
wx_has_rescomp=yes
fi
fi
fi
if test "x$wx_has_rescomp" = x ; then
dnl cannot give any useful info for resource compiler
WX_RESCOMP=
else
WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
fi
if test "x$wx_has_cppflags" = x ; then
dnl no choice but to define all flags like CFLAGS
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CPPFLAGS=$WX_CFLAGS
WX_CXXFLAGS=$WX_CFLAGS
WX_CFLAGS_ONLY=$WX_CFLAGS
WX_CXXFLAGS_ONLY=$WX_CFLAGS
else
dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
fi
ifelse([$2], , :, [$2])
else
if test "x$WX_VERSION" = x; then
dnl no wx-config at all
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
fi
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
WX_RESCOMP=""
ifelse([$3], , :, [$3])
fi
else
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
WX_RESCOMP=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(WX_CPPFLAGS)
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_CXXFLAGS)
AC_SUBST(WX_CFLAGS_ONLY)
AC_SUBST(WX_CXXFLAGS_ONLY)
AC_SUBST(WX_LIBS)
AC_SUBST(WX_LIBS_STATIC)
AC_SUBST(WX_VERSION)
AC_SUBST(WX_RESCOMP)
])
dnl ---------------------------------------------------------------------------
dnl Get information on the wxrc program for making C++, Python and xrs
dnl resource files.
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWidgets must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWidgets libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWidgets version is 2.6.0 or above.
dnl ])
dnl fi
dnl
dnl AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0])
dnl if test "x$HAVE_WXRC" != x1; then
dnl AC_MSG_ERROR([
dnl The wxrc program was not installed or not found.
dnl
dnl Please check the wxWidgets installation.
dnl ])
dnl fi
dnl
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
dnl resources. The variable WXRC will be set and substituted in the configure
dnl script and Makefiles.
dnl
dnl Example use:
dnl AM_PATH_WXRC([wxrc=1], [wxrc=0])
dnl ---------------------------------------------------------------------------
dnl
dnl wxrc program from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXRC],
[
AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
if test "x$WX_CONFIG_NAME" = x; then
AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
else
AC_MSG_CHECKING([for wxrc])
if test "x$WXRC" = x ; then
dnl wx-config --utility is a new addition to wxWidgets:
_WX_PRIVATE_CHECK_VERSION(2,5,3)
if test -n "$wx_ver_ok"; then
WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
fi
fi
if test "x$WXRC" = x ; then
AC_MSG_RESULT([not found])
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT([$WXRC])
ifelse([$1], , :, [$1])
fi
AC_SUBST(WXRC)
fi
])

30
m4macros/ac_flag.m4 Normal file
View File

@ -0,0 +1,30 @@
AC_DEFUN([AC_C_FLAG], [{
AC_LANG_PUSH(C)
ac_c_flag_save="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_MSG_CHECKING([[whether $CC supports $1]])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[AC_MSG_RESULT([yes])],
[
CFLAGS="$ac_c_flag_save"
AC_MSG_RESULT([no])
$2
])
AC_LANG_POP(C)
}])
AC_DEFUN([AC_CXX_FLAG], [{
AC_LANG_PUSH(C++)
ac_cxx_flag_save="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
AC_MSG_CHECKING([[whether $CXX supports $1]])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[AC_MSG_RESULT([yes])],
[
CXXFLAGS="$ac_cxx_flag_save"
AC_MSG_RESULT([no])
$2
])
AC_LANG_POP(C++)
}])

279
m4macros/acx_pthread.m4 Normal file
View File

@ -0,0 +1,279 @@
##### 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
#
# 2007-07-29
#
# COPYLEFT
#
# Copyright (c) 2007 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

108
m4macros/ax_check_gl.m4 Normal file
View File

@ -0,0 +1,108 @@
##### 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. This macro adds the
# configure option "--with-apple-opengl-framework", which users can
# use to indicate that Apple's OpenGL framework should be used on Mac
# OS X. If Apple's OpenGL framework is used, the symbol
# "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If no GL implementation
# is found, "no_gl" is set to "yes".
#
# LAST MODIFICATION
#
# 2004-11-15
#
# COPYLEFT
#
# Copyright (c) 2004 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_CHECK_GL],
[AC_REQUIRE([AC_PATH_X])dnl
AC_REQUIRE([ACX_PTHREAD])dnl
#
# There isn't a reliable way to know we should use the Apple OpenGL framework
# without a configure option. A Mac OS X user may have installed an
# alternative GL implementation (e.g., Mesa), which may or may not depend on X.
#
AC_ARG_WITH([apple-opengl-framework],
[AC_HELP_STRING([--with-apple-opengl-framework],
[use Apple OpenGL framework (Mac OS X only)])])
if test "X$with_apple_opengl_framework" = "Xyes"; then
AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
[Use the Apple OpenGL framework.])
GL_LIBS="-framework OpenGL"
else
AC_LANG_PUSH(C)
AX_LANG_COMPILER_MS
if test X$ax_compiler_ms = Xno; then
GL_CFLAGS="${PTHREAD_CFLAGS}"
GL_LIBS="${PTHREAD_LIBS} -lm"
fi
#
# Use x_includes and x_libraries if they have been set (presumably by
# AC_PATH_X).
#
if test "X$no_x" != "Xyes"; then
if test -n "$x_includes"; then
GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"
fi
if test -n "$x_libraries"; then
GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"
fi
fi
AC_CHECK_HEADERS([windows.h])
AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
[ax_cv_check_gl_libgl="no"
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
if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
# if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h>
# endif
# include <GL/gl.h>]],
[[glBegin(0)]])],
[ax_cv_check_gl_libgl="${ax_try_lib}"; break])
done
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}])
if test "X${ax_cv_check_gl_libgl}" = "Xno"; then
no_gl="yes"
GL_CFLAGS=""
GL_LIBS=""
else
GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"
fi
AC_LANG_POP(C)
fi
AC_SUBST([GL_CFLAGS])
AC_SUBST([GL_LIBS])
])dnl

View File

@ -0,0 +1,36 @@
##### 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
#
# 2004-11-15
#
# COPYLEFT
#
# Copyright (c) 2004 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
])])

View File

@ -0,0 +1,78 @@
##### http://autoconf-archive.cryp.to/check_gnu_make.html
#
# SYNOPSIS
#
# CHECK_GNU_MAKE()
#
# DESCRIPTION
#
# This macro searches for a GNU version of make. If a match is found,
# the makefile variable `ifGNUmake' is set to the empty string,
# otherwise it is set to "#". This is useful for including a special
# features in a Makefile, which cannot be handled by other versions
# of make. The variable _cv_gnu_make_command is set to the command to
# invoke GNU make if it exists, the empty string otherwise.
#
# Here is an example of its use:
#
# Makefile.in might contain:
#
# # A failsafe way of putting a dependency rule into a makefile
# $(DEPEND):
# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
#
# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
# @ifGNUmake@ include $(DEPEND)
# @ifGNUmake@ endif
#
# Then configure.in would normally contain:
#
# CHECK_GNU_MAKE()
# AC_OUTPUT(Makefile)
#
# Then perhaps to cause gnu make to override any other make, we could
# do something like this (note that GNU make always looks for
# GNUmakefile first):
#
# if ! test x$_cv_gnu_make_command = x ; then
# mv Makefile GNUmakefile
# echo .DEFAULT: > Makefile ;
# echo \ $_cv_gnu_make_command \$@ >> Makefile;
# fi
#
# Then, if any (well almost any) other make is called, and GNU make
# also exists, then the other make wraps the GNU make.
#
# LAST MODIFICATION
#
# 2002-01-04
#
# COPYLEFT
#
# Copyright (c) 2002 John Darrington <j.darrington@elvis.murdoch.edu.au>
#
# 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(
[CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
_cv_gnu_make_command='' ;
dnl Search all the common names for GNU make
for a in "$MAKE" make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
_cv_gnu_make_command=$a ;
break;
fi
done ;
) ;
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
if test "x$_cv_gnu_make_command" != "x" ; then
ifGNUmake='' ;
else
ifGNUmake='#' ;
AC_MSG_RESULT("Not found");
fi
AC_SUBST(ifGNUmake)
] )

0
po/ChangeLog Normal file
View File