Remove autotools build system
This commit is contained in:
parent
936b39303d
commit
c965171663
28 changed files with 0 additions and 8153 deletions
12
Makefile
12
Makefile
|
@ -1,12 +0,0 @@
|
|||
include header.mk
|
||||
|
||||
ifeq (yes, $(BUILD_DARWIN))
|
||||
osx-bundle:
|
||||
$(BIN_SHELL) tools/osx-bundle.sh "$(AEGISUB_COMMAND)" "$(BIN_WX_CONFIG)" "$(FONTCONFIG_CONF_DIR)" DICT_DIR=$(DICT_DIR)
|
||||
|
||||
osx-dmg: osx-bundle
|
||||
codesign -s 'Mac Developer' --deep Aegisub.app || true
|
||||
$(BIN_SHELL) tools/osx-dmg.sh "$(BUILD_VERSION_STRING)"
|
||||
endif
|
||||
|
||||
include Makefile.target
|
139
Makefile.inc.in
139
Makefile.inc.in
|
@ -1,139 +0,0 @@
|
|||
#########################
|
||||
# AEGISUB FEATURE SUPPORT
|
||||
#########################
|
||||
HAVE_ALSA = @with_alsa@
|
||||
HAVE_FFMS2 = @with_ffms2@
|
||||
HAVE_HUNSPELL = @with_hunspell@
|
||||
HAVE_LIBPULSE = @with_libpulse@
|
||||
HAVE_OPENAL = @with_openal@
|
||||
HAVE_OSS = @with_oss@
|
||||
HAVE_PORTAUDIO = @with_portaudio@
|
||||
HAVE_UCHARDET = @with_uchardet@
|
||||
|
||||
##############
|
||||
# BUILD OUTPUT
|
||||
##############
|
||||
PROGRAM := $(PROGRAM)
|
||||
LIB := $(LIB)
|
||||
|
||||
###################
|
||||
# PLATFORM SETTINGS
|
||||
###################
|
||||
BUILD_DARWIN = @build_darwin@
|
||||
|
||||
#######
|
||||
# FLAGS
|
||||
#######
|
||||
CFLAGS = @CFLAGS@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CFLAGS_DEP = -MMD -MP
|
||||
LIBS = @LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
INSTALL_FLAGS = -m 644
|
||||
LIB_SHARED_LINK = -shared -Wl,-soname -Wl,$(LIB_SHARED_FULL)
|
||||
LIB_SHARED_LINK_OSX = -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -compatibility_version $(LIB_VERSION) -current_version $(LIB_VERSION) -Wl,-single_module -mmacosx-version-min=10.8 -install_name ${CURDIR}/$(LIB_SHARED_FULL)
|
||||
|
||||
#########
|
||||
# STRINGS
|
||||
#########
|
||||
AEGISUB_COMMAND = @AEGISUB_COMMAND@
|
||||
AEGISUB_CATALOG = @AEGISUB_CATALOG@
|
||||
BUILD_DATE = @BUILD_DATE@
|
||||
BUILD_VERSION_STRING = @BUILD_GIT_VERSION_STRING@
|
||||
|
||||
#######
|
||||
# PATHS
|
||||
#######
|
||||
prefix = ${P_PREFIX}
|
||||
exec_prefix = ${P_PREFIX_EXEC}
|
||||
datarootdir = ${P_DATAROOT}
|
||||
P_PREFIX = @prefix@
|
||||
P_PREFIX_EXEC = @exec_prefix@
|
||||
P_BINDIR = @bindir@
|
||||
P_DATAROOT = @datarootdir@
|
||||
P_LOCALE = @localedir@
|
||||
|
||||
P_DESKTOP = @P_DESKTOP@
|
||||
P_ICON = @P_ICON@
|
||||
P_DATA = $(P_DATAROOT)/aegisub/
|
||||
|
||||
###############
|
||||
# LIBRARY FLAGS
|
||||
###############
|
||||
CFLAGS_WX = @WX_CFLAGS@
|
||||
CXXFLAGS_WX = @WX_CXXFLAGS@
|
||||
CPPFLAGS_WX = @WX_CPPFLAGS@
|
||||
LIBS_WX = @WX_LIBS@ -lz
|
||||
|
||||
CPPFLAGS_BOOST = @BOOST_CPPFLAGS@
|
||||
LIBS_BOOST = @BOOST_LDFLAGS@ @BOOST_FILESYSTEM_LIB@ @BOOST_LOCALE_LIB@ @BOOST_REGEX_LIB@ @BOOST_SYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_CHRONO_LIB@
|
||||
|
||||
CFLAGS_FFMS2 = @FFMS2_CFLAGS@
|
||||
CFLAGS_FFTW3 = @FFTW3_CFLAGS@
|
||||
CFLAGS_FONTCONFIG = @FONTCONFIG_CFLAGS@
|
||||
CFLAGS_FREETYPE = @FREETYPE_CFLAGS@
|
||||
CFLAGS_GL = @GL_CFLAGS@
|
||||
CFLAGS_HUNSPELL = @HUNSPELL_CFLAGS@
|
||||
CFLAGS_ICONV = @ICONV_CFLAGS@
|
||||
CFLAGS_ICU = @ICU_I18N_CFLAGS@
|
||||
CFLAGS_LIBASS = @LIBASS_CFLAGS@
|
||||
CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@
|
||||
CFLAGS_LUA = @LUAJIT_CFLAGS@
|
||||
CFLAGS_OPENAL = @OPENAL_CFLAGS@
|
||||
CFLAGS_OSS = @OSS_CFLAGS@
|
||||
CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@
|
||||
CFLAGS_PTHREAD = @PTHREAD_CFLAGS@
|
||||
CFLAGS_UCHARDET = @UCHARDET_CFLAGS@
|
||||
|
||||
LIBS_ALSA = @ALSA_LIBS@
|
||||
LIBS_FFMS2 = @FFMS2_LIBS@
|
||||
LIBS_FFTW3 = @FFTW3_LIBS@
|
||||
LIBS_FONTCONFIG = @FONTCONFIG_LIBS@
|
||||
LIBS_FREETYPE = @FREETYPE_LIBS@
|
||||
LIBS_GL = @GL_LIBS@
|
||||
LIBS_HUNSPELL = @HUNSPELL_LIBS@
|
||||
LIBS_ICONV = @ICONV_LIBS@
|
||||
LIBS_ICU = @ICU_UC_LIBS@ @ICU_I18N_LIBS@
|
||||
LIBS_LIBASS = @LIBASS_LIBS@
|
||||
LIBS_LIBPULSE = @LIBPULSE_LIBS@
|
||||
LIBS_LUA = @LUAJIT_LIBS@
|
||||
LIBS_OPENAL = @OPENAL_LIBS@
|
||||
LIBS_PORTAUDIO = @PORTAUDIO_LIBS@
|
||||
LIBS_PTHREAD = @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
LIBS_UCHARDET = @UCHARDET_LIBS@
|
||||
|
||||
ifeq (yes, $(BUILD_DARWIN))
|
||||
LIBS_LUA = $(TOP)vendor/luajit/src/libluajit.a
|
||||
endif
|
||||
|
||||
FONTCONFIG_CONF_DIR = @FONTCONFIG_CONF_DIR@
|
||||
|
||||
#####################
|
||||
# DEBUG / DEVELOPMENT
|
||||
#####################
|
||||
PRECOMPILED_HEADER = @enable_gcc_prec@
|
||||
|
||||
##########
|
||||
# BINARIES
|
||||
##########
|
||||
BIN_AR = ar
|
||||
BIN_RANLIB = ranlib
|
||||
BIN_LN = ln
|
||||
BIN_RM = rm
|
||||
BIN_SHELL = @SHELL@
|
||||
BIN_MV = mv
|
||||
BIN_SED = sed
|
||||
BIN_INSTALL = @INSTALL@
|
||||
BIN_MSGMERGE = @MSGMERGE@
|
||||
BIN_XGETTEXT = @XGETTEXT@
|
||||
BIN_MSGFMT = @MSGFMT@
|
||||
BIN_CC = @CC@
|
||||
BIN_CXX = @CXX@
|
||||
BIN_CP = cp
|
||||
BIN_MKDIR = mkdir
|
||||
BIN_MKDIR_P = mkdir -p
|
||||
BIN_ECHO = echo
|
||||
BIN_TOUCH = touch
|
||||
BIN_LUA = @LUA@
|
||||
BIN_WX_CONFIG = @WX_CONFIG_PATH@
|
121
Makefile.target
121
Makefile.target
|
@ -1,121 +0,0 @@
|
|||
ifneq (yes, $(INCLUDING_CHILD_MAKEFILES))
|
||||
COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub
|
||||
.PHONY: $(COMMANDS)
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
# Would be nice to move this somewhere else (Makefile.inc?)
|
||||
ifeq (yes, $(BUILD_DARWIN))
|
||||
CFLAGS += -mmacosx-version-min=10.8 -gfull
|
||||
CXXFLAGS += -mmacosx-version-min=10.8 -gfull
|
||||
LDFLAGS += -mmacosx-version-min=10.8 -Wl,-dead_strip -pagezero_size 10000 -image_base 100000000
|
||||
LIB_SHARED_LINK = $(LIB_SHARED_LINK_OSX)
|
||||
endif
|
||||
|
||||
LIB_TARGETS := $(addprefix $(TOP)lib/,$(LIB:%=lib%.a))
|
||||
|
||||
# Handle per-target flags in the form foo_CFLAGS := -w by mapping them to all
|
||||
# of the objects a target depends on. This has potentially dumb results if
|
||||
# multiple targets use a single object file, so don't do that.
|
||||
define set_target_flags
|
||||
OBJ += $($1_OBJ)
|
||||
|
||||
$($1_OBJ): CPPFLAGS := $(CPPFLAGS) $($1_CPPFLAGS)
|
||||
$($1_OBJ): CXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS)
|
||||
$($1_OBJ): OBJCXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS)
|
||||
|
||||
ifeq (yes, $(PRECOMPILED_HEADER))
|
||||
ifdef $1_PCH
|
||||
CLEANFILES += $($1_PCH).gch
|
||||
$($1_OBJ): CXXFLAGS += -include $($1_PCH) $(PCHFLAGS)
|
||||
$($1_OBJ): $($1_PCH).gch
|
||||
$($1_PCH).gch: $($1_PCH)
|
||||
$($1_PCH).gch: CPPFLAGS := $(CPPFLAGS) $($1_CPPFLAGS)
|
||||
$($1_PCH).gch: CXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS)
|
||||
else
|
||||
$($1_OBJ): CXXFLAGS += -include acconf.h
|
||||
endif
|
||||
else
|
||||
$($1_OBJ): CXXFLAGS += -include acconf.h
|
||||
endif
|
||||
endef
|
||||
$(foreach target,$(LIB),$(eval $(call set_target_flags,$(target),$(TOP)lib/lib$(target).a)))
|
||||
$(foreach target,$(PROGRAM),$(eval $(call set_target_flags,$(notdir $(target)),$(target))))
|
||||
|
||||
# Create the build and install targets for programs
|
||||
# Not done with a pattern rule since the pattern would be just %: and doing that
|
||||
# leads to make trying to use gcc to make any nonexistent targets rather than
|
||||
# erroring
|
||||
define create_program_targets
|
||||
ifdef $1_INSTALLNAME
|
||||
install: $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME)
|
||||
$(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME): $(dir $2)$($1_INSTALLNAME)
|
||||
@$(BIN_MKDIR) -p $(DESTDIR)$(P_BINDIR)
|
||||
@$(BIN_INSTALL) $(dir $2)$($1_INSTALLNAME) $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME)
|
||||
$(dir $2)$($1_INSTALLNAME): $($1_OBJ)
|
||||
$(BIN_CXX) -o $(dir $2)$($1_INSTALLNAME) $(LDFLAGS) $($1_OBJ) $(LIBS) $($1_LIBS)
|
||||
all: $(dir $2)$($1_INSTALLNAME)
|
||||
else
|
||||
$2: $($1_OBJ)
|
||||
$(BIN_CXX) -o $2 $(LDFLAGS) $($1_OBJ) $(LIBS) $($1_LIBS)
|
||||
all: $2
|
||||
endif
|
||||
$(eval CLEANFILES += $(filter-out %/,$2 $(dir $2)$($1_INSTALLNAME)))
|
||||
endef
|
||||
$(foreach target,$(PROGRAM),$(eval $(call create_program_targets,$(notdir $(target)),$(target))))
|
||||
|
||||
# The dependency files which will be automatically generated by gcc.
|
||||
# The filter is due to that libraries also appear in OBJ
|
||||
DEP := $(filter %.d,$(OBJ:%.o=%.d))
|
||||
|
||||
# If the goal is a relative path to a file, convert it to an absolute path
|
||||
ifneq ($(filter-out $(COMMANDS),$(MAKECMDGOALS)),)
|
||||
ABSGOAL := $(abspath $(MAKECMDGOALS))
|
||||
ifneq ($(MAKECMDGOALS),$(ABSGOAL))
|
||||
$(MAKECMDGOALS): $(ABSGOAL) ;
|
||||
endif
|
||||
endif
|
||||
|
||||
# Primary build targets
|
||||
all: $(LIB_TARGETS)
|
||||
|
||||
clean:
|
||||
$(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB_TARGETS)
|
||||
|
||||
distclean: clean
|
||||
$(BIN_RM) -rf $(DISTCLEANFILES) $(DEP)
|
||||
|
||||
depclean: clean
|
||||
$(BIN_RM) -rf $(DEP)
|
||||
|
||||
install:
|
||||
|
||||
# The actual build rules
|
||||
.SUFFIXES:
|
||||
|
||||
CXX_CMD = $(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS)
|
||||
CC_CMD = $(CXX_ENV) $(BIN_CC) $(CFLAGS_DEP) $(CPPFLAGS)
|
||||
POST_FLAGS = $($@_FLAGS) -c -o $@ $<
|
||||
|
||||
%.o: %.c ; $(CC_CMD) $(CFLAGS) $(POST_FLAGS)
|
||||
%.o: %.cpp ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS)
|
||||
%.o: %.cxx ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS)
|
||||
%.o: %.cc ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS)
|
||||
%.o: %.mm ; $(CXX_CMD) $(OBJCXXFLAGS) $(POST_FLAGS)
|
||||
%.o: %.m ; $(CC_CMD) $(CFLAGS) -fmodules $(POST_FLAGS)
|
||||
|
||||
%.gch: %
|
||||
@$(BIN_RM) -f $@
|
||||
$(CXX_ENV) $(BIN_CXX) $(CPPFLAGS) $(CXXFLAGS) -x c++-header $<
|
||||
|
||||
.SECONDEXPANSION:
|
||||
|
||||
# Libraries contain all object files they depend on (but they may depend on other files)
|
||||
# Not using libtool on OS X because it has an unsilenceable warning about a
|
||||
# compatibility issue with BSD 4.3 (wtf)
|
||||
lib%.a: $$($$*_OBJ)
|
||||
@$(BIN_MKDIR_P) $(dir $@)
|
||||
$(BIN_AR) cru $@ $(filter %.o,$^)
|
||||
$(BIN_RANLIB) $@
|
||||
|
||||
-include $(DEP)
|
||||
endif
|
15
acinclude.m4
15
acinclude.m4
|
@ -1,15 +0,0 @@
|
|||
m4_include([m4macros/ac_agi.m4])
|
||||
m4_include([m4macros/ac_flag.m4])
|
||||
m4_include([m4macros/agi_find_libheader.m4])
|
||||
m4_include([m4macros/ax_boost_base.m4])
|
||||
m4_include([m4macros/ax_boost_chrono.m4])
|
||||
m4_include([m4macros/ax_boost_filesystem.m4])
|
||||
m4_include([m4macros/ax_boost_locale.m4])
|
||||
m4_include([m4macros/ax_boost_regex.m4])
|
||||
m4_include([m4macros/ax_boost_system.m4])
|
||||
m4_include([m4macros/ax_boost_thread.m4])
|
||||
m4_include([m4macros/ax_check_gl.m4])
|
||||
m4_include([m4macros/ax_lang_compiler_ms.m4])
|
||||
m4_include([m4macros/ax_pthread.m4])
|
||||
m4_include([m4macros/check_gnu_make.m4])
|
||||
m4_include([m4macros/wxwin.m4])
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo Running autoreconf...
|
||||
autoreconf -ivf "$@"
|
||||
|
||||
echo Now run ./configure and then make to build Aegisub
|
|
@ -1,28 +0,0 @@
|
|||
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
|
||||
|
||||
DATA_AUTOMATION := \
|
||||
$(sort $(wildcard $(d)autoload/*)) \
|
||||
$(sort $(wildcard $(d)demos/*)) \
|
||||
$(sort $(wildcard $(d)include/*.lua)) \
|
||||
$(sort $(wildcard $(d)include/aegisub/*))
|
||||
|
||||
DATA_AUTOMATION_REL := $(subst $(d),,$(DATA_AUTOMATION))
|
||||
DATA_AUTOMATION_INSTALLED = $(addprefix $(DESTDIR)$(P_DATA)/automation/, $(DATA_AUTOMATION_REL))
|
||||
|
||||
$(DESTDIR)$(P_DATA)/automation/%: $(d)%
|
||||
$(MKDIR_INSTALL)
|
||||
|
||||
aegisub-lua_OBJ := $(d)tests/aegisub.o $(TOP)lib/libaegisub.a $(TOP)lib/libluabins.a $(LIBS_LUA)
|
||||
aegisub-lua_CPPFLAGS := $(CPPFLAGS_BOOST) $(CFLAGS_LUA) -I$(TOP)libaegisub/include -I$(TOP)src $(CXXFLAGS_WX)
|
||||
aegisub-lua_LIBS := $(LIBS_WX) $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_PTHREAD)
|
||||
|
||||
PROGRAM += $(d)aegisub-lua
|
||||
|
||||
test-automation: $(PROGRAM)
|
||||
eval `luarocks path`; cd $(TOP)automation; ./aegisub-lua tests/busted.lua -p 'moon' tests/modules
|
||||
|
||||
test: test-automation
|
||||
|
||||
install: $(DATA_AUTOMATION_INSTALLED)
|
||||
|
||||
include $(TOP)Makefile.target
|
1476
config.guess
vendored
1476
config.guess
vendored
File diff suppressed because it is too large
Load diff
1808
config.sub
vendored
1808
config.sub
vendored
File diff suppressed because it is too large
Load diff
630
configure.ac
630
configure.ac
|
@ -1,630 +0,0 @@
|
|||
AC_PREREQ(2.57)
|
||||
|
||||
###################
|
||||
# Required packages
|
||||
###################
|
||||
m4_define([boost_required_version], [1.50.0])
|
||||
m4_define([curl_required_version], [7.18.2])
|
||||
m4_define([ffms2_required_version], [2.16])
|
||||
m4_define([fftw3_required_version], [3.3])
|
||||
m4_define([fontconfig_required_version], [2.4])
|
||||
m4_define([freetype_required_version], [9.7.0])
|
||||
m4_define([hunspell_required_version], [1.2.0])
|
||||
m4_define([icu_required_version], [4.8.1.1])
|
||||
m4_define([libass_required_version], [0.9.7])
|
||||
m4_define([libpulse_required_version], [0.5])
|
||||
m4_define([pkgconfig_required_version], [0.20])
|
||||
m4_define([portaudio_required_version], [19])
|
||||
m4_define([wx_required_version], [3.0.0])
|
||||
|
||||
#######
|
||||
# Setup
|
||||
#######
|
||||
AC_INIT([Aegisub], [aegisub_version],, [aegisub])
|
||||
: ${CFLAGS=""}
|
||||
: ${CXXFLAGS=""}
|
||||
AC_CONFIG_SRCDIR([src/main.cpp])
|
||||
AC_CONFIG_HEADER([acconf.h])
|
||||
AC_GNU_SOURCE
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
###########################
|
||||
# Check host architecture
|
||||
###########################
|
||||
build_darwin="no"
|
||||
build_linux="no"
|
||||
|
||||
AS_CASE([$host],
|
||||
[*-*-darwin*], [build_darwin="yes"],
|
||||
[*-*-linux*], [build_linux="yes"])
|
||||
|
||||
AC_SUBST(build_darwin)
|
||||
|
||||
########################
|
||||
# Configurable variables
|
||||
########################
|
||||
# Name of aegisub binary.
|
||||
# This is tagged with the version on release branches.
|
||||
AEGISUB_COMMAND="aegisub"
|
||||
AC_SUBST(AEGISUB_COMMAND)
|
||||
AC_DEFINE_UNQUOTED([AEGISUB_COMMAND], ["${AEGISUB_COMMAND}"], [Name of the Aegisub executable])
|
||||
|
||||
# Name of gettext catalog.
|
||||
AEGISUB_CATALOG="aegisub"
|
||||
AC_SUBST(AEGISUB_CATALOG)
|
||||
AC_DEFINE_UNQUOTED([AEGISUB_CATALOG], ["${AEGISUB_CATALOG}"], [Name of the Aegisub gettext catalog])
|
||||
|
||||
# Handle location of desktop files: http://freedesktop.org/wiki/Specifications/desktop-entry-spec
|
||||
AC_ARG_WITH(desktop-dir,
|
||||
AS_HELP_STRING([--with-desktop-dir=PATH],[desktop file locations [PREFIX/share/applications]]))
|
||||
|
||||
P_DESKTOP=${with_desktop_dir:-$datarootdir/applications}
|
||||
AC_SUBST(P_DESKTOP)
|
||||
|
||||
# Handle location of icons: http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
|
||||
AC_ARG_WITH(icon-dir,
|
||||
AS_HELP_STRING([--with-icon-dir=PATH],[icon locations [PREFIX/share/icons]]))
|
||||
|
||||
P_ICON=${with_icon_dir:-$datarootdir/icons}
|
||||
AC_SUBST(P_ICON)
|
||||
|
||||
# Install prefix
|
||||
# If a user doesn't supply --prefix then it is set to NONE so we
|
||||
# set it to $ac_default_prefix if it hasn't been supplied.
|
||||
AS_CASE([x$prefix], [xNONE | x], [prefix="$ac_default_prefix"], [])
|
||||
|
||||
# Install prefix used by wxStandardPaths::SetInstallPrefix.
|
||||
AC_DEFINE_UNQUOTED([INSTALL_PREFIX], ["$prefix"], [Default install prefix, or --prefix.])
|
||||
|
||||
# Build credit
|
||||
AC_ARG_WITH(build-credit,
|
||||
AS_HELP_STRING([--with-build-credit=NAME],[Build credit shown in the program title.]),
|
||||
[use_build_credit="yes"])
|
||||
|
||||
AC_MSG_CHECKING([whether BUILD_CREDIT has been set])
|
||||
AS_IF([test x$use_build_credit = xyes],
|
||||
AS_IF([test x$with_build_credit = xyes || test -z "$with_build_credit"], [
|
||||
AC_MSG_FAILURE([You must set a value eg --with-build-credit=<username>])
|
||||
], [
|
||||
AC_MSG_RESULT([yes ($with_build_credit)])
|
||||
AC_DEFINE_UNQUOTED([BUILD_CREDIT], ["$with_build_credit"], [Build credit supplied in application title using --with-build-credit=])
|
||||
]),
|
||||
[AC_MSG_RESULT([no])])
|
||||
|
||||
####################
|
||||
# Check for programs
|
||||
####################
|
||||
CHECK_GNU_MAKE
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_LANG(C++)
|
||||
AM_PROG_CC_C_O
|
||||
# This is reported to be required on Ubuntu, I haven't had time to check.
|
||||
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
PKG_PROG_PKG_CONFIG([pkgconfig_required_version])
|
||||
|
||||
#################
|
||||
# Developers only
|
||||
#################
|
||||
AC_MSG_CHECKING([for version])
|
||||
. $srcdir/build/version.sh "$srcdir"
|
||||
AC_MSG_RESULT([$BUILD_GIT_VERSION_STRING $VERSION_SOURCE])
|
||||
|
||||
AC_MSG_CHECKING([for build date])
|
||||
BUILD_DATE=`date "+%Y-%m-%d %H:%M %Z"`
|
||||
AC_MSG_RESULT($BUILD_DATE)
|
||||
|
||||
AC_SUBST([BUILD_GIT_VERSION_STRING])
|
||||
AC_SUBST([BUILD_DATE])
|
||||
|
||||
###################################################
|
||||
# Check for pthreads and setup variables / compiler
|
||||
###################################################
|
||||
AS_IF([test x$build_darwin != xyes], [
|
||||
ACX_PTHREAD([], [AC_MSG_FAILURE([You must have working pthreads.])])
|
||||
CC="$PTHREAD_CC"
|
||||
])
|
||||
|
||||
######################
|
||||
# Check compiler flags
|
||||
######################
|
||||
AC_ARG_ENABLE(compiler-flags, AS_HELP_STRING([--disable-compiler-flags],[Disable *all* additional compiler flags. [no]]))
|
||||
|
||||
AS_IF([test x$enable_compiler_flags != xno], [
|
||||
CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -std=gnu99 -pipe -g"
|
||||
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -pipe -g"
|
||||
AC_CXX_FLAG([-std=c++11])
|
||||
AC_CXX_FLAG([-Wno-c++11-narrowing])
|
||||
AC_C_FLAG([-Wno-unused-local-typedefs])
|
||||
AC_CXX_FLAG([-Wno-unused-local-typedefs])
|
||||
|
||||
# -O* messes with debugging.
|
||||
AS_IF([test x$enable_debug = xyes], [
|
||||
CFLAGS="$CFLAGS -O0"
|
||||
CXXFLAGS="$CXXFLAGS -O0"
|
||||
], [
|
||||
CFLAGS="$CFLAGS -O3"
|
||||
CXXFLAGS="$CXXFLAGS -O3"
|
||||
])
|
||||
])
|
||||
|
||||
AC_ARG_WITH([libc++], AS_HELP_STRING([--with-libc++],[Use libc++ rather than libstdc++. [auto]]))
|
||||
AS_IF([test x$with_libc__ != xno], [
|
||||
AC_LANG_PUSH(C++)
|
||||
ac_ld_flag_save="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -stdlib=libc++"
|
||||
AC_MSG_CHECKING([[whether $CXX supports -stdlib=libc++]])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]])], [
|
||||
AC_MSG_RESULT([yes])
|
||||
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
|
||||
], [
|
||||
AS_IF([test x$with_libc__ = xyes], [
|
||||
AC_MSG_FAILURE([no])
|
||||
], [
|
||||
LDFLAGS="$ac_ld_flag_save"
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
AC_LANG_POP(C++)
|
||||
])
|
||||
|
||||
######################################
|
||||
# Check Headers / Features / Libraries
|
||||
######################################
|
||||
AC_CHECK_LIB([m], [main])
|
||||
AC_CHECK_LIB([dl], [dlclose])
|
||||
AC_CHECK_HEADERS([sys/time.h])
|
||||
|
||||
AC_ARG_ENABLE(sanity-checks,
|
||||
AS_HELP_STRING([--disable-sanity-checks],[Skip verifying that found libraries work.]))
|
||||
|
||||
##############################
|
||||
# Program Support and Features
|
||||
##############################
|
||||
#########################
|
||||
### Required Dependencies
|
||||
#########################
|
||||
|
||||
AS_IF([test x$build_darwin != xyes], [
|
||||
AC_PATH_XTRA
|
||||
AS_IF([test x$no_x = xyes],
|
||||
[AC_MSG_FAILURE([You must have a working copy of X installed.])])
|
||||
|
||||
AX_CHECK_GL
|
||||
AS_IF([test x$no_gl = xyes], [AC_MSG_FAILURE([Aegisub requires GL support.])])
|
||||
], [
|
||||
AC_CHECK_HEADERS([OpenGL/gl.h])
|
||||
])
|
||||
AC_SUBST(GL_CFLAGS)
|
||||
AC_SUBST(GL_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(FREETYPE, freetype2 >= freetype_required_version)
|
||||
|
||||
AS_IF([test x$build_darwin != xyes], [
|
||||
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version)
|
||||
FONTCONFIG_CONF_DIR=$($PKG_CONFIG --variable=confdir fontconfig)
|
||||
AC_SUBST(FONTCONFIG_CONF_DIR)
|
||||
])
|
||||
|
||||
PKG_CHECK_MODULES(LIBASS, libass >= libass_required_version)
|
||||
|
||||
AX_BOOST_BASE([boost_required_version])
|
||||
AX_BOOST_CHRONO
|
||||
AX_BOOST_FILESYSTEM
|
||||
AX_BOOST_LOCALE
|
||||
AX_BOOST_REGEX
|
||||
AX_BOOST_SYSTEM
|
||||
AX_BOOST_THREAD
|
||||
|
||||
cppflags_bak="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
AC_CHECK_HEADERS([boost/spirit/home/phoenix/version.hpp])
|
||||
CPPFLAGS=$cppflags_bak
|
||||
|
||||
AC_DEFINE(BOOST_SYSTEM_NO_DEPRECATED, 1,
|
||||
[Disable deprecated parts of boost.system])
|
||||
AC_DEFINE(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION, 1,
|
||||
[Disable boost.serialization support for boost.multi_index])
|
||||
|
||||
PKG_CHECK_MODULES(ICU_UC, icu-uc >= icu_required_version)
|
||||
PKG_CHECK_MODULES(ICU_I18N, icu-i18n >= icu_required_version)
|
||||
|
||||
########
|
||||
## boost
|
||||
########
|
||||
AS_IF([test x$enable_sanity_checks != xno], [
|
||||
AC_AGI_COMPILE([boost ICU support], [boost_icu], [$BOOST_CPPFLAGS],
|
||||
[$BOOST_LDFLAGS $BOOST_REGEX_LIB $ICU_UC_LIBS $ICU_I18N_LIBS],[
|
||||
#include <boost/regex/icu.hpp>
|
||||
int main() {
|
||||
auto regex = boost::make_u32regex(".", boost::u32regex::perl);
|
||||
boost::smatch result;
|
||||
u32regex_search("a", result, regex, boost::match_default);
|
||||
} ])
|
||||
|
||||
AS_IF([test x$agi_cv_with_boost_icu = xno],
|
||||
[AC_MSG_FAILURE([Aegisub requires that boost be built with ICU support.])])
|
||||
])
|
||||
|
||||
########
|
||||
## iconv
|
||||
########
|
||||
AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv []])
|
||||
AC_ARG_VAR([ICONV_LIBS], [LIBS to use for iconv [-liconv]])
|
||||
|
||||
AS_IF([test -z "$ICONV_LIBS"], AC_SEARCH_LIBS([iconv_open], [iconv]))
|
||||
|
||||
AC_AGI_COMPILE([iconv], [iconv], [$ICONV_CFLAGS], [$ICONV_LIBS],[
|
||||
#include <iconv.h>
|
||||
int main() {
|
||||
return !iconv_open("UTF-8", "UTF-8");
|
||||
} ])
|
||||
|
||||
AC_SUBST(ICONV_LIBS)
|
||||
AC_SUBST(ICONV_CFLAGS)
|
||||
|
||||
AS_IF([test x$agi_cv_with_iconv = xno], [AC_MSG_FAILURE([Please install a working iconv library.])])
|
||||
|
||||
AC_AGI_COMPILE([iconv (const)], [iconv_const], [$ICONV_CFLAGS], [$ICONV_LIBS],[
|
||||
#include <iconv.h>
|
||||
int main(void) {
|
||||
iconv_t cd = iconv_open("UTF-16", "UTF-8");
|
||||
const char *in = "in";
|
||||
char *out = new char();
|
||||
size_t res, inbytesleft, outbytesleft;
|
||||
res = iconv(cd, &in, &inbytesleft, &out, &outbytesleft);
|
||||
return 0;
|
||||
} ])
|
||||
|
||||
AS_IF([test x$agi_cv_with_iconv_const = xyes],
|
||||
[AC_DEFINE(AGI_ICONV_CONST, 1, [Enable if iconv expects the in argument to be const])])
|
||||
|
||||
###############
|
||||
# Audio Players
|
||||
###############
|
||||
#######
|
||||
## ALSA
|
||||
#######
|
||||
AC_ARG_WITH(alsa,
|
||||
AS_HELP_STRING([--without-alsa],
|
||||
[build without ALSA audio player [auto]]))
|
||||
|
||||
AC_ARG_VAR([ALSA_CFLAGS], [CFLAGS to use for ALSA []])
|
||||
AC_ARG_VAR([ALSA_LIBS], [LIBS to use for ALSA [-lasound -lrt]])
|
||||
|
||||
ALSA_LIBS=${ALSA_LIBS:--lasound -lrt}
|
||||
|
||||
AS_IF([test x$with_alsa = xno],
|
||||
[alsa_disabled="(disabled)"],
|
||||
[AC_CHECK_LIB([asound], [snd_pcm_open], [with_alsa="yes"], [with_alsa="no"], $ALSA_LIBS)])
|
||||
|
||||
AS_IF([test x$with_alsa = xyes], AC_DEFINE(WITH_ALSA, 1, [Enable ALSA Support]))
|
||||
|
||||
AC_SUBST(ALSA_CFLAGS)
|
||||
AC_SUBST(ALSA_LIBS)
|
||||
AC_SUBST(with_alsa)
|
||||
|
||||
#########
|
||||
## OpenAL
|
||||
#########
|
||||
AC_ARG_WITH(openal,
|
||||
AS_HELP_STRING([--without-openal],
|
||||
[build without OpenAL audio player [auto]]))
|
||||
|
||||
AS_IF([test x$build_darwin = xyes], [
|
||||
OPENAL_LIBS="-framework OpenAL"
|
||||
OPENAL_CFLAGS=""
|
||||
AC_SUBST(OPENAL_LIBS)
|
||||
AC_SUBST(OPENAL_CFLAGS)
|
||||
with_openal="yes"
|
||||
],
|
||||
[test x$with_openal = xno], [openal_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(OPENAL, openal >= 0.0.8, [with_openal=yes], [with_openal=no])])
|
||||
|
||||
AS_IF([test x$with_openal != xno], [
|
||||
AC_AGI_COMPILE([OpenAL], [openal], [$OPENAL_CFLAGS], [$OPENAL_LIBS],[
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenAL/AL.h>
|
||||
#include <OpenAL/ALC.h>
|
||||
#else
|
||||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
#endif
|
||||
int main(void) {
|
||||
ALCdevice *device = alcOpenDevice(0);
|
||||
if (!device) return 1;
|
||||
ALCcontext *context = alcCreateContext(device, 0);
|
||||
if (!context) return 1;
|
||||
return 0;
|
||||
} ])
|
||||
])
|
||||
|
||||
AS_IF([test x$agi_cv_with_openal = xno && test x$with_openal = xyes], [
|
||||
AC_MSG_WARN([OpenAL detected, but it doesn''t work...])
|
||||
with_openal="no"
|
||||
])
|
||||
|
||||
AS_IF([test x$agi_cv_with_openal = xyes && test x$with_openal = xyes],
|
||||
AC_DEFINE(WITH_OPENAL, 1, [Enable OpenAL support]))
|
||||
|
||||
AC_SUBST(with_openal)
|
||||
|
||||
######
|
||||
## OSS
|
||||
######
|
||||
AC_ARG_VAR([OSS_CFLAGS], [CFLAGS to use for OSS [auto]])
|
||||
AC_ARG_WITH(oss,
|
||||
AS_HELP_STRING([--without-oss],
|
||||
[build without OSS audio player [auto]]))
|
||||
|
||||
AS_IF([test x$with_oss = xno], [oss_disabled="(disabled)"], [
|
||||
AS_IF([test -z "$OSS_CFLAGS" && test -f "/etc/oss.conf"], [
|
||||
. /etc/oss.conf
|
||||
OSS_CFLAGS="-I${OSSLIBDIR}/include/sys"
|
||||
])
|
||||
AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [with_oss="yes"], [with_oss="no"])
|
||||
])
|
||||
|
||||
AS_IF([test x$with_oss = xyes], AC_DEFINE(WITH_OSS, 1, [Enable OSS support]))
|
||||
|
||||
AC_SUBST(with_oss)
|
||||
|
||||
###################
|
||||
# Simple pkg-config stuff
|
||||
###################
|
||||
AGI_OPT_PKG(libpulse, [build without PulseAudio audio player [auto]], [Enable PulseAudio support])
|
||||
AGI_OPT_PKG(portaudio-2.0, [build without PortAudio v19 audio player [auto]], [Enable PortAudio v19 support])
|
||||
|
||||
AGI_OPT_PKG(ffms2, [build without ffms2 A/V provider [auto]], [Enable FFMS2 support])
|
||||
|
||||
AGI_OPT_PKG(fftw3, [build without fftw support [auto]], [Enable fftw support])
|
||||
AGI_OPT_PKG(hunspell, [build without hunspell spell-checking [auto]], [Enable Hunspell support])
|
||||
AGI_OPT_PKG(uchardet, [build without automatic character set detection [auto]], [Enable uchardet support])
|
||||
|
||||
########
|
||||
# LuaJIT
|
||||
########
|
||||
system_luajit="bundled"
|
||||
AC_ARG_WITH(system-luajit, AS_HELP_STRING([--without-system-luajit], [Use built-in LuaJIT [auto]]))
|
||||
# Check if it's available at all
|
||||
AS_IF([test x$with_system_luajit = xno], [],
|
||||
[PKG_CHECK_MODULES(LUAJIT, luajit >= 2.0.0, [], [
|
||||
AS_IF([test x$with_system_luajit = xyes],
|
||||
[AC_MSG_FAILURE([--with-sytem-luajit was specified, but luajit could not be found])])
|
||||
with_system_luajit="no"])])
|
||||
|
||||
# Check if it's compiled in Lua 5.2 mode
|
||||
# This check can be skipped by manually setting agi_cv_luajit_is_52
|
||||
AS_IF([test x$with_system_luajit != xno], [
|
||||
aegisub_save_LIBS="$LIBS"
|
||||
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $LUAJIT_CFLAGS"
|
||||
LIBS="$LIBS $LUAJIT_LIBS"
|
||||
AC_CACHE_CHECK(
|
||||
[whether LuaJIT is compiled in 5.2 mode], [agi_cv_luajit_is_52],
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM(
|
||||
[[#include <lauxlib.h>]],
|
||||
[[lua_State *L = luaL_newstate();
|
||||
if (!L) return 1;
|
||||
// This is valid in lua 5.2, but a syntax error in 5.1
|
||||
const char testprogram[] = "function foo() while true do break return end end";
|
||||
return luaL_loadstring(L, testprogram) == LUA_ERRSYNTAX;
|
||||
]])], [agi_cv_luajit_is_52="yes"], [agi_cv_luajit_is_52="no"])])
|
||||
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
||||
LIBS="$aegisub_save_LIBS"
|
||||
|
||||
if test $agi_cv_luajit_is_52 != yes; then
|
||||
AS_IF([test x$with_system_luajit = xyes],
|
||||
[AC_MSG_FAILURE([LuaJIT must be compiled in Lua 5.2 mode])])
|
||||
with_system_luajit="no"
|
||||
else
|
||||
with_system_luajit="yes"
|
||||
system_luajit="system"
|
||||
fi
|
||||
])
|
||||
|
||||
AS_IF([test $with_system_luajit = no],
|
||||
[AC_SUBST([LUAJIT_CFLAGS], ['-I$(TOP)vendor/luajit/include'])
|
||||
AC_SUBST([LUAJIT_LIBS], ['$(TOP)vendor/luajit/src/libluajit.a'])])
|
||||
|
||||
# We also need a Lua binary to run part of the build system
|
||||
# Which version doesn't matter as the scripts are portable between them
|
||||
AC_CHECK_PROGS([LUA], [lua luajit lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1])
|
||||
|
||||
# If the user doesn't have an installed copy of Lua, just use the one built
|
||||
# as part of building LuaJIT
|
||||
AS_IF([test -z $LUA], [LUA='$(TOP)vendor/luajit/src/host/minilua'])
|
||||
|
||||
######################################################
|
||||
# Debugging support
|
||||
######################################################
|
||||
AC_MSG_CHECKING([whether to turn on debugging])
|
||||
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debugging [no]]))
|
||||
AC_MSG_RESULT([${enable_debug:=no}])
|
||||
|
||||
AC_MSG_CHECKING([whether to use exception handling in debug mode])
|
||||
AC_ARG_ENABLE(debug-exceptions, AS_HELP_STRING([--enable-debug-exceptions],[enable exception handling in debug mode [no]]))
|
||||
AC_MSG_RESULT([${enabled_debug_exceptions:=no}])
|
||||
|
||||
AS_IF([test x$enable_debug_exceptions = xyes],
|
||||
[AC_DEFINE(WITH_EXCEPTIONS, 1,
|
||||
[Enable exception handling in debug mode. (--enable-debug) This is always enabled when debug mode is off.])])
|
||||
|
||||
################
|
||||
# Widget support
|
||||
################
|
||||
WX_CONFIG_OPTIONS
|
||||
WX_STANDARD_OPTIONS([debug])
|
||||
WX_DEBUG=$DEBUG
|
||||
WX_UNICODE=$UNICODE
|
||||
WX_CONFIG_CHECK([wx_required_version],,,[std,gl,stc],[$WXCONFIG_FLAGS])
|
||||
AC_SUBST(WX_CONFIG_PATH)
|
||||
|
||||
AS_IF([test x$WX_VERSION = x],
|
||||
[AC_MSG_FAILURE([wxWidgets detection failed, please set --with-wx* or add the libraries to your LIBS, CXX/CFLAGS.])])
|
||||
|
||||
AS_IF([test x$enable_sanity_checks != xno], [
|
||||
AC_AGI_LINK([wxWidgets OpenGL support], [wxopengl], [wx/glcanvas.h], [$GL_CFLAGS $WX_CFLAGS], [$GL_LIBS $WX_LIBS],[
|
||||
#include <wx/glcanvas.h>
|
||||
int main(void) {
|
||||
wxGLCanvas *canvas;
|
||||
wxGLContext *context;
|
||||
return 0;
|
||||
} ])
|
||||
AC_AGI_LINK([wxWidgets StyledTextCtrl support], [wxstc], [wx/stc/stc.h], [$WX_CFLAGS], [$WX_LIBS],[
|
||||
#include <wx/stc/stc.h>
|
||||
int main(void) {
|
||||
wxStyledTextCtrl *canvas;
|
||||
return 0;
|
||||
} ])
|
||||
])
|
||||
|
||||
AS_IF([test x$with_agi_cv_wxopengl = xno], AC_MSG_FAILURE([wxWidgets OpenGL support missing]))
|
||||
AS_IF([test x$with_agi_cv_wxstc = xno], AC_MSG_FAILURE([wxWidgets StyledTextCtrl support missing]))
|
||||
|
||||
# This turns on some internal (to aegisub) debugging features.
|
||||
# A debug version of wxWidgets is required.
|
||||
AS_IF([test x$enable_debug = xyes],
|
||||
[AS_IF([$WX_CONFIG_PATH --debug],[AC_CXX_FLAG([-D_DEBUG])])])
|
||||
|
||||
############################
|
||||
# Precompiled Header Support
|
||||
# Only works with gcc! (and clang)
|
||||
############################
|
||||
AC_MSG_CHECKING([whether to use precompiled headers])
|
||||
AC_ARG_ENABLE(gcc-prec, AS_HELP_STRING([--disable-gcc-prec],[disable GCC precompiled headers]))
|
||||
AC_MSG_RESULT([${enable_gcc_prec:=yes}])
|
||||
AC_SUBST(enable_gcc_prec)
|
||||
AC_PCH_FLAG([-Winvalid-pch])
|
||||
AC_PCH_FLAG([-fpch-deps])
|
||||
AC_PCH_FLAG([-fpch-preprocess])
|
||||
|
||||
##############################
|
||||
# Internationalisation support
|
||||
##############################
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
################
|
||||
# Update checker
|
||||
################
|
||||
AC_MSG_CHECKING([whether to enable the update checker])
|
||||
AC_ARG_ENABLE(update-checker,
|
||||
AS_HELP_STRING([--disable-update-checker], [disable the update checker [no]]))
|
||||
AC_MSG_RESULT(${enable_update_checker:=yes})
|
||||
AS_IF([test "x$enable_update_checker" != "xno"],
|
||||
[AC_DEFINE([WITH_UPDATE_CHECKER], [],
|
||||
[Whether to enable the update checker])])
|
||||
|
||||
AC_MSG_CHECKING([for update checker server])
|
||||
AC_ARG_WITH(update-server,
|
||||
AS_HELP_STRING([--with-update-server=HOSTNAME],
|
||||
[Server to use for the update checker
|
||||
[updates.aegisub.org]]))
|
||||
AC_MSG_RESULT(${with_update_server:=updates.aegisub.org})
|
||||
AC_DEFINE_UNQUOTED([UPDATE_CHECKER_SERVER], ["$with_update_server"],
|
||||
[Server for the update checker])
|
||||
|
||||
AC_MSG_CHECKING([for update checker base URL])
|
||||
AC_ARG_WITH(update-url,
|
||||
AS_HELP_STRING([--with-update-url=HOSTNAME],
|
||||
[Base path to use for the update checker [/trunk]]))
|
||||
AC_MSG_RESULT(${with_update_url:=/trunk})
|
||||
AC_DEFINE_UNQUOTED([UPDATE_CHECKER_BASE_URL], ["$with_update_url"],
|
||||
[Base path for the update checker])
|
||||
|
||||
####################################################################
|
||||
# Default settings for Providers/Players
|
||||
# * This is done at the end to preserve sanity rather than littering
|
||||
# it above.
|
||||
####################################################################
|
||||
AC_ARG_WITH(player-audio,
|
||||
AS_HELP_STRING([--with-player-audio=(ALSA|OpenAL|PortAudio|PulseAudio|OSS)],
|
||||
[Default Audio Player [Linux/ALSA, Darwin/OpenAL, 1:*/OSS, 2:*/PortAudio]]))
|
||||
|
||||
# Default audio player.
|
||||
AS_IF([test -z "$with_player_audio"], [
|
||||
AS_IF([test x$build_linux = xyes && test x$with_alsa = xyes], [DEFAULT_PLAYER_AUDIO="ALSA"],
|
||||
[test x$build_darwin = xyes && test x$with_openal = xyes], [DEFAULT_PLAYER_AUDIO="OpenAL"],
|
||||
[test x$with_portaudio = xyes], [DEFAULT_PLAYER_AUDIO="PortAudio"],
|
||||
[test x$with_oss = xyes], [DEFAULT_PLAYER_AUDIO="OSS"],
|
||||
[test x$with_alsa = xyes], [DEFAULT_PLAYER_AUDIO="ALSA"],
|
||||
[test x$with_openal = xyes], [DEFAULT_PLAYER_AUDIO="OpenAL"],
|
||||
[test x$with_libpulse = xyes], [DEFAULT_PLAYER_AUDIO="PulseAudio"])],
|
||||
[DEFAULT_PLAYER_AUDIO="$with_player_audio"])
|
||||
AC_SUBST(DEFAULT_PLAYER_AUDIO)
|
||||
|
||||
# Set some friendly strings if some of the above aren't detected.
|
||||
DEFAULT_PLAYER_AUDIO=${DEFAULT_PLAYER_AUDIO:-NONE}
|
||||
|
||||
###############
|
||||
# Misc settings
|
||||
###############
|
||||
# Files that need substitution.
|
||||
AC_CONFIG_FILES([
|
||||
packages/desktop/aegisub.desktop.template
|
||||
src/libresrc/default_config_platform.json
|
||||
tools/osx-bundle.sed
|
||||
Makefile.inc
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
AS_IF([test x"$DEFAULT_PLAYER_AUDIO" = xNONE], 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)
|
||||
* * http://www.alsa-project.org/
|
||||
* - PortAudio (version 19 only)
|
||||
* * http://www.portaudio.com/
|
||||
***********************************************************************
|
||||
]))
|
||||
|
||||
AS_IF([test x$with_ffms2 != xyes], [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:
|
||||
* - FFMS2
|
||||
* * http://github.com/FFMS/ffms2
|
||||
***********************************************************************
|
||||
])])
|
||||
|
||||
AC_MSG_RESULT([
|
||||
Configure settings
|
||||
Install prefix: $prefix
|
||||
Revision: $BUILD_GIT_VERSION_STRING
|
||||
Debug $enable_debug
|
||||
CFLAGS $CFLAGS
|
||||
CXXFLAGS $CXXFLAGS
|
||||
CPPFLAGS $CPPFLAGS
|
||||
LDFLAGS $LDFLAGS
|
||||
LIBS $LIBS
|
||||
|
||||
Default Settings
|
||||
Audio Player: $DEFAULT_PLAYER_AUDIO
|
||||
|
||||
Audio Players
|
||||
ALSA: $with_alsa $alsa_disabled
|
||||
OpenAL: $with_openal $openal_disabled
|
||||
OSS: $with_oss $oss_disabled
|
||||
PortAudio: $with_portaudio $portaudio_disabled
|
||||
PulseAudio: $with_libpulse $libpulse_disabled
|
||||
|
||||
Misc Packages
|
||||
uchardet: $with_uchardet $uchardet_disabled
|
||||
Hunspell: $with_hunspell $hunspell_disabled
|
||||
FFTW3: $with_fftw3 $fftw3_disabled
|
||||
LuaJIT: $system_luajit
|
||||
])
|
43
header.mk
43
header.mk
|
@ -1,43 +0,0 @@
|
|||
d := $(abspath $(dir $(lastword $(filter-out $(lastword $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))))/
|
||||
|
||||
ifndef TOP
|
||||
TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/
|
||||
include $(TOP)Makefile.inc
|
||||
|
||||
subdirs := \
|
||||
automation \
|
||||
libaegisub \
|
||||
packages/desktop \
|
||||
po \
|
||||
src \
|
||||
tests \
|
||||
tools \
|
||||
vendor/luabins \
|
||||
vendor/luajit
|
||||
|
||||
subdirs := $(addprefix $(TOP),$(addsuffix /Makefile,$(subdirs)))
|
||||
|
||||
INCLUDING_CHILD_MAKEFILES=yes
|
||||
d_save := $d
|
||||
$(foreach dir,$(filter-out $(abspath $(MAKEFILE_LIST)),$(subdirs)), $(eval include $(dir)))
|
||||
d := $(d_save)
|
||||
INCLUDING_CHILD_MAKEFILES=no
|
||||
|
||||
DISTCLEANFILES += \
|
||||
$(TOP)acconf.h \
|
||||
$(TOP)configure \
|
||||
$(TOP)acconf.h.in~ \
|
||||
$(TOP)build/git_version.h \
|
||||
$(TOP)Makefile.inc \
|
||||
$(TOP)config.log \
|
||||
$(TOP)acconf.h.in \
|
||||
$(TOP)config.status \
|
||||
$(TOP)autom4te.cache \
|
||||
$(TOP)aclocal.m4 \
|
||||
|
||||
define MKDIR_INSTALL
|
||||
@$(BIN_MKDIR_P) $(dir $@)
|
||||
$(BIN_INSTALL) -m644 $< $@
|
||||
endef
|
||||
|
||||
endif
|
501
install-sh
501
install-sh
|
@ -1,501 +0,0 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2016-01-11.22; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
|
@ -1,56 +0,0 @@
|
|||
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
|
||||
|
||||
aegisub_OBJ := \
|
||||
$(d)common/parser.o \
|
||||
$(d)ass/dialogue_parser.o \
|
||||
$(d)ass/time.o \
|
||||
$(d)ass/uuencode.o \
|
||||
$(patsubst %.cpp,%.o,$(sort $(wildcard $(d)audio/*.cpp))) \
|
||||
$(patsubst %.cpp,%.o,$(sort $(wildcard $(d)common/cajun/*.cpp))) \
|
||||
$(patsubst %.cpp,%.o,$(sort $(wildcard $(d)lua/modules/*.cpp))) \
|
||||
$(patsubst %.c,%.o,$(sort $(wildcard $(d)lua/modules/*.c))) \
|
||||
$(patsubst %.cpp,%.o,$(sort $(wildcard $(d)lua/*.cpp))) \
|
||||
$(patsubst %.cpp,%.o,$(sort $(wildcard $(d)unix/*.cpp))) \
|
||||
$(d)common/calltip_provider.o \
|
||||
$(d)common/character_count.o \
|
||||
$(d)common/charset.o \
|
||||
$(d)common/charset_6937.o \
|
||||
$(d)common/charset_conv.o \
|
||||
$(d)common/color.o \
|
||||
$(d)common/file_mapping.o \
|
||||
$(d)common/format.o \
|
||||
$(d)common/fs.o \
|
||||
$(d)common/hotkey.o \
|
||||
$(d)common/io.o \
|
||||
$(d)common/json.o \
|
||||
$(d)common/kana_table.o \
|
||||
$(d)common/karaoke_matcher.o \
|
||||
$(d)common/keyframe.o \
|
||||
$(d)common/line_iterator.o \
|
||||
$(d)common/log.o \
|
||||
$(d)common/mru.o \
|
||||
$(d)common/option.o \
|
||||
$(d)common/option_value.o \
|
||||
$(d)common/path.o \
|
||||
$(d)common/thesaurus.o \
|
||||
$(d)common/util.o \
|
||||
$(d)common/vfr.o \
|
||||
$(d)common/ycbcr_conv.o
|
||||
|
||||
ifeq (yes, $(BUILD_DARWIN))
|
||||
aegisub_OBJ += $(patsubst %.mm,%.o,$(sort $(wildcard $(d)osx/*.mm)))
|
||||
else
|
||||
aegisub_OBJ += $(d)common/dispatch.o
|
||||
endif
|
||||
|
||||
aegisub_PCH := $(d)lagi_pre.h
|
||||
aegisub_CPPFLAGS := -I$(d)include -I$(TOP) $(CPPFLAGS_BOOST) $(CFLAGS_LUA) $(CFLAGS_PTHREAD)
|
||||
|
||||
$(d)common/charset.o_FLAGS := $(CFLAGS_UCHARDET)
|
||||
$(d)common/charset_conv.o_FLAGS := $(CFLAGS_ICONV)
|
||||
$(d)common/parser.o_FLAGS := -ftemplate-depth=256
|
||||
$(d)unix/path.o_FLAGS := -DP_DATA=\"$(P_DATA)\"
|
||||
|
||||
LIB += aegisub
|
||||
|
||||
include $(TOP)Makefile.target
|
|
@ -1,51 +0,0 @@
|
|||
AC_DEFUN([AC_AGI_COMPILE],[
|
||||
aegisub_save_LIBS="$LIBS"
|
||||
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $3"
|
||||
LIBS="$LIBS $4"
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CACHE_CHECK(
|
||||
[whether $1 works], [agi_cv_with_$2],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([$5])],
|
||||
[eval agi_cv_with_$2="yes"],
|
||||
[eval agi_cv_with_$2="no"],
|
||||
[AS_IF([test $? -ne 0], [eval agi_cv_with_$2="no"], [eval agi_cv_with_$2="yes"])])])
|
||||
AC_LANG_POP(C++)
|
||||
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
||||
LIBS="$aegisub_save_LIBS"
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_AGI_LINK],[
|
||||
aegisub_save_LIBS="$LIBS"
|
||||
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $4"
|
||||
LIBS="$LIBS $5"
|
||||
AC_CHECK_HEADER([$3], [agi_cv_header="yes"], [agi_cv_header="no"])
|
||||
AS_IF([test "x$agi_cv_header" = xyes],
|
||||
[AC_CACHE_CHECK(
|
||||
[whether $1 works], [agi_cv_with_$2],
|
||||
[AC_LINK_IFELSE([AC_LANG_SOURCE([$6])], [eval agi_cv_with_$2="yes"], [eval agi_cv_with_$2="no"])])]
|
||||
[eval agi_cv_with_$2="no"])
|
||||
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
||||
LIBS="$aegisub_save_LIBS"
|
||||
])
|
||||
|
||||
# An optional dependency which requires pkg-config
|
||||
# Args: Name, AC_ARG_WITH help string, AC_DEFINE help string
|
||||
AC_DEFUN([AGI_OPT_PKG], [
|
||||
m4_define([varname], m4_bpatsubst([$1], [-.*], []))dnl
|
||||
m4_define([upper], m4_translit(varname, [a-z], [A-Z]))dnl
|
||||
|
||||
AC_ARG_WITH(varname, AS_HELP_STRING([--without-][varname], [$2]))
|
||||
AS_IF([test x$with_]varname[ = xno],
|
||||
varname[_disabled="(disabled)"],
|
||||
[PKG_CHECK_MODULES(upper, $1 >= varname[]_required_version, [
|
||||
AC_DEFINE([WITH_]upper, 1, $3)
|
||||
with_[]varname="yes"
|
||||
], [
|
||||
AS_IF([test x$with_]varname[ = xyes],
|
||||
[AC_MSG_FAILURE([--with-]varname[ was specified, but ]varname[ could not be found])])
|
||||
with_[]varname="no"
|
||||
])])
|
||||
AC_SUBST([with_]varname)
|
||||
])
|
|
@ -1,56 +0,0 @@
|
|||
AC_DEFUN([AC_C_FLAG], [{
|
||||
AC_LANG_PUSH(C)
|
||||
ac_c_flag_save="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror $1"
|
||||
AC_MSG_CHECKING([[whether $CC supports $1]])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]])],
|
||||
[
|
||||
CFLAGS="$ac_c_flag_save $1"
|
||||
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 -Werror $1"
|
||||
AC_MSG_CHECKING([[whether $CXX supports $1]])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]])],
|
||||
[
|
||||
CXXFLAGS="$ac_cxx_flag_save $1"
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
CXXFLAGS="$ac_cxx_flag_save"
|
||||
AC_MSG_RESULT([no])
|
||||
$2
|
||||
])
|
||||
AC_LANG_POP(C++)
|
||||
}])
|
||||
AC_DEFUN([AC_PCH_FLAG], [{
|
||||
AC_LANG_PUSH(C++)
|
||||
ac_cxx_flag_save="$CXXFLAGS"
|
||||
ac_cxx_werror_flag_save="$ac_cxx_werror_flag"
|
||||
ac_cxx_werror_flag=yes
|
||||
CXXFLAGS="$CXXFLAGS -Werror $1"
|
||||
AC_MSG_CHECKING([[whether $CXX supports $1]])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]])],
|
||||
[
|
||||
PCHFLAGS="$PCHFLAGS $1"
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
$2
|
||||
])
|
||||
CXXFLAGS="$ac_cxx_flag_save"
|
||||
ac_cxx_werror_flag="$ac_cxx_werror_flag_save"
|
||||
AC_LANG_POP(C++)
|
||||
}])
|
|
@ -1,58 +0,0 @@
|
|||
AC_DEFUN([AGI_FIND_HEADER],[
|
||||
file=`echo $2 | $as_tr_sh`
|
||||
|
||||
aegisub_save_CPPFLAGS="$CPPFLAGS"
|
||||
|
||||
for dir in $3; do
|
||||
vdir=`echo $dir | $as_tr_sh`
|
||||
CPPFLAGS="-I$dir"
|
||||
AC_CACHE_CHECK(
|
||||
[for $2 in $dir],
|
||||
[agi_cv_header_${vdir}_${file}],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <$2>])],
|
||||
[eval agi_cv_header_${vdir}_${file}="yes"; found="${dir}"],
|
||||
[eval agi_cv_header_${vdir}_${file}="no"; found=""])
|
||||
])
|
||||
|
||||
if test -n "$found"; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if test -n "$found"; then
|
||||
$1_CFLAGS="-I$found"
|
||||
fi
|
||||
CPPFLAGS="$aegisub_save_CPPFLAGS"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([AGI_FIND_LIB],[
|
||||
aegisub_save_LIBS="$LIBS"
|
||||
|
||||
if test -n "$3"; then
|
||||
LDDIR="-L$3"
|
||||
fi
|
||||
|
||||
for lib in $2; do
|
||||
vlib=`echo $lib | $as_tr_sh`
|
||||
LIBS="$LDDIR -l$lib"
|
||||
AC_CACHE_CHECK(
|
||||
[for -l${lib}],
|
||||
[agi_cv_lib_${vlib}],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM()],
|
||||
[eval agi_cv_lib_${vlib}="yes"; found="${lib}"],
|
||||
[eval agi_cv_lib_${vlib}="no"; found=""])
|
||||
])
|
||||
|
||||
if test -n "$found"; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if test -n "$found"; then
|
||||
$1_LIBS="$LDDIR -l$found"
|
||||
fi
|
||||
LIBS="$aegisub_save_LIBS"
|
||||
])
|
|
@ -1,301 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_base.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for the Boost C++ libraries of a particular version (or newer)
|
||||
#
|
||||
# If no path to the installed boost library is given the macro searchs
|
||||
# under /usr, /usr/local, /opt and /opt/local and evaluates the
|
||||
# $BOOST_ROOT environment variable. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
|
||||
# Copyright (c) 2009 Peter Adolphs
|
||||
#
|
||||
# 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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 42
|
||||
|
||||
# example boost program (need to pass version)
|
||||
m4_define([_AX_BOOST_BASE_PROGRAM],
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <boost/version.hpp>
|
||||
]],[[
|
||||
(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))]));
|
||||
]])])
|
||||
|
||||
AC_DEFUN([AX_BOOST_BASE],
|
||||
[
|
||||
AC_ARG_WITH([boost],
|
||||
[AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
|
||||
[use Boost library from a standard location (ARG=yes),
|
||||
from the specified location (ARG=<path>),
|
||||
or disable it (ARG=no)
|
||||
@<:@ARG=yes@:>@ ])],
|
||||
[
|
||||
AS_CASE([$withval],
|
||||
[no],[want_boost="no";_AX_BOOST_BASE_boost_path=""],
|
||||
[yes],[want_boost="yes";_AX_BOOST_BASE_boost_path=""],
|
||||
[want_boost="yes";_AX_BOOST_BASE_boost_path="$withval"])
|
||||
],
|
||||
[want_boost="yes"])
|
||||
|
||||
|
||||
AC_ARG_WITH([boost-libdir],
|
||||
[AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
|
||||
[Force given directory for boost libraries.
|
||||
Note that this will override library path detection,
|
||||
so use this parameter only if default library detection fails
|
||||
and you know exactly where your boost libraries are located.])],
|
||||
[
|
||||
AS_IF([test -d "$withval"],
|
||||
[_AX_BOOST_BASE_boost_lib_path="$withval"],
|
||||
[AC_MSG_ERROR([--with-boost-libdir expected directory name])])
|
||||
],
|
||||
[_AX_BOOST_BASE_boost_lib_path=""])
|
||||
|
||||
BOOST_LDFLAGS=""
|
||||
BOOST_CPPFLAGS=""
|
||||
AS_IF([test "x$want_boost" = "xyes"],
|
||||
[_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])])
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
AC_SUBST(BOOST_LDFLAGS)
|
||||
])
|
||||
|
||||
|
||||
# convert a version string in $2 to numeric and affect to polymorphic var $1
|
||||
AC_DEFUN([_AX_BOOST_BASE_TONUMERICVERSION],[
|
||||
AS_IF([test "x$2" = "x"],[_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"],[_AX_BOOST_BASE_TONUMERICVERSION_req="$2"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\.[[0-9]]*\)'`
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\)'`
|
||||
AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"],
|
||||
[AC_MSG_ERROR([You should at least specify libboost major version])])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.\([[0-9]]*\)'`
|
||||
AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"],
|
||||
[_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
|
||||
AS_IF([test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"],
|
||||
[_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor`
|
||||
AS_VAR_SET($1,$_AX_BOOST_BASE_TONUMERICVERSION_RET)
|
||||
])
|
||||
|
||||
dnl Run the detection of boost should be run only if $want_boost
|
||||
AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
|
||||
_AX_BOOST_BASE_TONUMERICVERSION(WANT_BOOST_VERSION,[$1])
|
||||
succeeded=no
|
||||
|
||||
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
dnl On 64-bit systems check for system libraries in both lib64 and lib.
|
||||
dnl The former is specified by FHS, but e.g. Debian does not adhere to
|
||||
dnl this (as it rises problems for generic multi-arch support).
|
||||
dnl The last entry in the list is chosen by default when no libraries
|
||||
dnl are found, e.g. when only header-only libraries are installed!
|
||||
AS_CASE([${host_cpu}],
|
||||
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
|
||||
[ppc64|s390x|sparc64|aarch64|ppc64le],[libsubdirs="lib64 lib lib64"],
|
||||
[libsubdirs="lib"],
|
||||
)
|
||||
|
||||
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
|
||||
dnl them priority over the other paths since, if libs are found there, they
|
||||
dnl are almost assuredly the ones desired.
|
||||
AS_CASE([${host_cpu}],
|
||||
[i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
|
||||
[multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
|
||||
)
|
||||
|
||||
dnl first we check the system location for boost libraries
|
||||
dnl this location ist chosen if boost libraries are installed with the --layout=system option
|
||||
dnl or if you install boost with RPM
|
||||
AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"])
|
||||
AS_IF([test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"],[
|
||||
AC_MSG_RESULT([yes])
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
|
||||
for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"])
|
||||
AS_IF([test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ],[
|
||||
AC_MSG_RESULT([yes])
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
|
||||
break;
|
||||
],
|
||||
[AC_MSG_RESULT([no])])
|
||||
done],[
|
||||
AC_MSG_RESULT([no])])
|
||||
],[
|
||||
if test X"$cross_compiling" = Xyes; then
|
||||
search_libsubdirs=$multiarch_libsubdir
|
||||
else
|
||||
search_libsubdirs="$multiarch_libsubdir $libsubdirs"
|
||||
fi
|
||||
for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then
|
||||
for libsubdir in $search_libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
dnl overwrite ld flags if we have required special directory with
|
||||
dnl --with-boost-libdir parameter
|
||||
AS_IF([test "x$_AX_BOOST_BASE_boost_lib_path" != "x"],
|
||||
[BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"])
|
||||
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION)])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
found_system=yes
|
||||
],[
|
||||
])
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
|
||||
|
||||
dnl if we found no boost with system layout we search for boost libraries
|
||||
dnl built and installed without the --layout=system option or for a staged(not installed) version
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
BOOST_CPPFLAGS=
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
BOOST_LDFLAGS=
|
||||
fi
|
||||
_version=0
|
||||
if test -n "$_AX_BOOST_BASE_boost_path" ; then
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
fi
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
done
|
||||
dnl if nothing found search for layout used in Windows distributions
|
||||
if test -z "$BOOST_CPPFLAGS"; then
|
||||
if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
|
||||
fi
|
||||
fi
|
||||
dnl if we found something and BOOST_LDFLAGS was unset before
|
||||
dnl (because "$_AX_BOOST_BASE_boost_lib_path" = ""), set it here.
|
||||
if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test "x$cross_compiling" != "xyes" ; then
|
||||
for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
best_path=$_AX_BOOST_BASE_boost_path
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$best_path/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$BOOST_ROOT" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
|
||||
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
|
||||
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
|
||||
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
|
||||
V_CHECK=`expr $stage_version_shorten \>\= $_version`
|
||||
if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
|
||||
BOOST_CPPFLAGS="-I$BOOST_ROOT"
|
||||
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
found_system=yes
|
||||
],[
|
||||
])
|
||||
AC_LANG_POP([C++])
|
||||
fi
|
||||
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
if test "x$_version" = "x0" ; then
|
||||
AC_MSG_NOTICE([[We could not detect the boost libraries (version $1 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
|
||||
else
|
||||
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
|
||||
fi
|
||||
# execute ACTION-IF-NOT-FOUND (if present):
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
|
||||
# execute ACTION-IF-FOUND (if present):
|
||||
ifelse([$2], , :, [$2])
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
|
||||
])
|
|
@ -1,118 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_CHRONO
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for Chrono library from the Boost C++ libraries. The macro requires
|
||||
# a preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_CHRONO_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_CHRONO
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2012 Xiyue Deng <manphiz@gmail.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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 4
|
||||
|
||||
AC_DEFUN([AX_BOOST_CHRONO],
|
||||
[
|
||||
AC_ARG_WITH([boost-chrono],
|
||||
AS_HELP_STRING([--with-boost-chrono@<:@=special-lib@:>@],
|
||||
[use the Chrono library from boost - it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-chrono=boost_chrono-gcc-mt ]),
|
||||
[
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_chrono_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_chrono_lib="$withval"
|
||||
fi
|
||||
],
|
||||
[want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Chrono library is available,
|
||||
ax_cv_boost_chrono,
|
||||
[AC_LANG_PUSH([C++])
|
||||
CXXFLAGS_SAVE=$CXXFLAGS
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/chrono.hpp>]],
|
||||
[[boost::chrono::system_clock::time_point* time = new boost::chrono::system_clock::time_point; delete time;]])],
|
||||
ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no)
|
||||
CXXFLAGS=$CXXFLAGS_SAVE
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
if test "x$ax_cv_boost_chrono" = "xyes"; then
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
|
||||
AC_DEFINE(HAVE_BOOST_CHRONO,,[define if the Boost::Chrono library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
|
||||
LDFLAGS_SAVE=$LDFLAGS
|
||||
if test "x$ax_boost_user_chrono_lib" = "x"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/libboost_chrono*.so* $BOOSTLIBDIR/libboost_chrono*.dylib* $BOOSTLIBDIR/libboost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_chrono.*\)\.so.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
|
||||
[link_chrono="no"])
|
||||
done
|
||||
if test "x$link_chrono" != "xyes"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/boost_chrono*.dll* $BOOSTLIBDIR/boost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_chrono.*\)\.dll.*$;\1;' -e 's;^\(boost_chrono.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
|
||||
[link_chrono="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
for ax_lib in $ax_boost_user_chrono_lib boost_chrono-$ax_boost_user_chrono_lib; do
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
|
||||
[link_chrono="no"])
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the library!)
|
||||
fi
|
||||
if test "x$link_chrono" = "xno"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
])
|
|
@ -1,118 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_FILESYSTEM
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for Filesystem library from the Boost C++ libraries. The macro
|
||||
# requires a preceding call to AX_BOOST_BASE. Further documentation is
|
||||
# available at <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_FILESYSTEM_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_FILESYSTEM
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
|
||||
# Copyright (c) 2009 Michael Tindal
|
||||
# Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
|
||||
#
|
||||
# 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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 27
|
||||
|
||||
AC_DEFUN([AX_BOOST_FILESYSTEM],
|
||||
[
|
||||
AC_ARG_WITH([boost-filesystem],
|
||||
AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
|
||||
[use the Filesystem library from boost - it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
|
||||
[
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_filesystem_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_filesystem_lib="$withval"
|
||||
fi
|
||||
],
|
||||
[want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
LIBS_SAVED=$LIBS
|
||||
LIBS="$LIBS $BOOST_SYSTEM_LIB"
|
||||
export LIBS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
|
||||
ax_cv_boost_filesystem,
|
||||
[AC_LANG_PUSH([C++])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
|
||||
[[using namespace boost::filesystem;
|
||||
path my_path( "foo/bar/data.txt" );
|
||||
return 0;]])],
|
||||
ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
if test "x$ax_cv_boost_filesystem" = "xyes"; then
|
||||
AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
if test "x$ax_boost_user_filesystem_lib" = "x"; then
|
||||
for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
|
||||
[link_filesystem="no"])
|
||||
done
|
||||
if test "x$link_filesystem" != "xyes"; then
|
||||
for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
|
||||
[link_filesystem="no"])
|
||||
done
|
||||
fi
|
||||
else
|
||||
for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
|
||||
[link_filesystem="no"])
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the library!)
|
||||
fi
|
||||
if test "x$link_filesystem" != "xyes"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
LIBS="$LIBS_SAVED"
|
||||
fi
|
||||
])
|
|
@ -1,119 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_locale.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_LOCALE
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for System library from the Boost C++ libraries. The macro requires
|
||||
# a preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_LOCALE_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_LOCALE
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2012 Xiyue Deng <manphiz@gmail.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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 2
|
||||
|
||||
AC_DEFUN([AX_BOOST_LOCALE],
|
||||
[
|
||||
AC_ARG_WITH([boost-locale],
|
||||
AS_HELP_STRING([--with-boost-locale@<:@=special-lib@:>@],
|
||||
[use the Locale library from boost - it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-locale=boost_locale-gcc-mt ]),
|
||||
[
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_locale_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_locale_lib="$withval"
|
||||
fi
|
||||
],
|
||||
[want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Locale library is available,
|
||||
ax_cv_boost_locale,
|
||||
[AC_LANG_PUSH([C++])
|
||||
CXXFLAGS_SAVE=$CXXFLAGS
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/locale.hpp>]],
|
||||
[[boost::locale::generator gen;
|
||||
std::locale::global(gen(""));]])],
|
||||
ax_cv_boost_locale=yes, ax_cv_boost_locale=no)
|
||||
CXXFLAGS=$CXXFLAGS_SAVE
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
if test "x$ax_cv_boost_locale" = "xyes"; then
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
|
||||
AC_DEFINE(HAVE_BOOST_LOCALE,,[define if the Boost::Locale library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
|
||||
LDFLAGS_SAVE=$LDFLAGS
|
||||
if test "x$ax_boost_user_locale_lib" = "x"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/libboost_locale*.so* $BOOSTLIBDIR/libboost_locale*.dylib* $BOOSTLIBDIR/libboost_locale*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_locale.*\)\.so.*$;\1;' -e 's;^lib\(boost_locale.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_locale.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break],
|
||||
[link_locale="no"])
|
||||
done
|
||||
if test "x$link_locale" != "xyes"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/boost_locale*.dll* $BOOSTLIBDIR/boost_locale*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_locale.*\)\.dll.*$;\1;' -e 's;^\(boost_locale.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break],
|
||||
[link_locale="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
for ax_lib in $ax_boost_user_locale_lib boost_locale-$ax_boost_user_locale_lib; do
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break],
|
||||
[link_locale="no"])
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the library!)
|
||||
fi
|
||||
if test "x$link_locale" = "xno"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
])
|
|
@ -1,111 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_regex.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_REGEX
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for Regex library from the Boost C++ libraries. The macro requires
|
||||
# a preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_REGEX_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_REGEX
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
|
||||
# Copyright (c) 2008 Michael Tindal
|
||||
#
|
||||
# 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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 23
|
||||
|
||||
AC_DEFUN([AX_BOOST_REGEX],
|
||||
[
|
||||
AC_ARG_WITH([boost-regex],
|
||||
AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
|
||||
[use the Regex library from boost - it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
|
||||
[
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_regex_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_regex_lib="$withval"
|
||||
fi
|
||||
],
|
||||
[want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Regex library is available,
|
||||
ax_cv_boost_regex,
|
||||
[AC_LANG_PUSH([C++])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
|
||||
]],
|
||||
[[boost::regex r(); return 0;]])],
|
||||
ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
if test "x$ax_cv_boost_regex" = "xyes"; then
|
||||
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
if test "x$ax_boost_user_regex_lib" = "x"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.dylib* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.dylib.*;\1;' -e 's;^lib\(boost_regex.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
|
||||
[link_regex="no"])
|
||||
done
|
||||
if test "x$link_regex" != "xyes"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/boost_regex*.dll* $BOOSTLIBDIR/boost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
|
||||
[link_regex="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do
|
||||
AC_CHECK_LIB($ax_lib, main,
|
||||
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
|
||||
[link_regex="no"])
|
||||
done
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the Boost::Regex library!)
|
||||
fi
|
||||
if test "x$link_regex" != "xyes"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
])
|
|
@ -1,121 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_system.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_SYSTEM
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for System library from the Boost C++ libraries. The macro requires
|
||||
# a preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_SYSTEM_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_SYSTEM
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
|
||||
# Copyright (c) 2008 Michael Tindal
|
||||
# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 19
|
||||
|
||||
AC_DEFUN([AX_BOOST_SYSTEM],
|
||||
[
|
||||
AC_ARG_WITH([boost-system],
|
||||
AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
|
||||
[use the System library from boost - it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-system=boost_system-gcc-mt ]),
|
||||
[
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_system_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_system_lib="$withval"
|
||||
fi
|
||||
],
|
||||
[want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::System library is available,
|
||||
ax_cv_boost_system,
|
||||
[AC_LANG_PUSH([C++])
|
||||
CXXFLAGS_SAVE=$CXXFLAGS
|
||||
CXXFLAGS=
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
|
||||
[[boost::system::error_category *a = 0;]])],
|
||||
ax_cv_boost_system=yes, ax_cv_boost_system=no)
|
||||
CXXFLAGS=$CXXFLAGS_SAVE
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
if test "x$ax_cv_boost_system" = "xyes"; then
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
|
||||
AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
|
||||
LDFLAGS_SAVE=$LDFLAGS
|
||||
if test "x$ax_boost_user_system_lib" = "x"; then
|
||||
for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
|
||||
[link_system="no"])
|
||||
done
|
||||
if test "x$link_system" != "xyes"; then
|
||||
for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
|
||||
[link_system="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
|
||||
[link_system="no"])
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the library!)
|
||||
fi
|
||||
if test "x$link_system" = "xno"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
])
|
|
@ -1,163 +0,0 @@
|
|||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_thread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_THREAD
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for Thread library from the Boost C++ libraries. The macro requires
|
||||
# a preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_THREAD_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_THREAD
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
|
||||
# Copyright (c) 2009 Michael Tindal
|
||||
#
|
||||
# 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. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 31
|
||||
|
||||
AC_DEFUN([AX_BOOST_THREAD],
|
||||
[
|
||||
AC_ARG_WITH([boost-thread],
|
||||
AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
|
||||
[use the Thread library from boost -
|
||||
it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-thread=boost_thread-gcc-mt ]),
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_thread_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_thread_lib="$withval"
|
||||
fi
|
||||
],
|
||||
[want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Thread library is available,
|
||||
ax_cv_boost_thread,
|
||||
[AC_LANG_PUSH([C++])
|
||||
CXXFLAGS_SAVE=$CXXFLAGS
|
||||
|
||||
if test "x$host_os" = "xsolaris" ; then
|
||||
CXXFLAGS="-pthreads $CXXFLAGS"
|
||||
elif test "x$host_os" = "xmingw32" ; then
|
||||
CXXFLAGS="-mthreads $CXXFLAGS"
|
||||
else
|
||||
CXXFLAGS="-pthread $CXXFLAGS"
|
||||
fi
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[@%:@include <boost/thread/thread.hpp>]],
|
||||
[[boost::thread_group thrds;
|
||||
return 0;]])],
|
||||
ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
|
||||
CXXFLAGS=$CXXFLAGS_SAVE
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
if test "x$ax_cv_boost_thread" = "xyes"; then
|
||||
if test "x$host_os" = "xsolaris" ; then
|
||||
BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
|
||||
elif test "x$host_os" = "xmingw32" ; then
|
||||
BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
|
||||
else
|
||||
BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
|
||||
fi
|
||||
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
|
||||
AC_DEFINE(HAVE_BOOST_THREAD,,
|
||||
[define if the Boost::Thread library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
|
||||
LDFLAGS_SAVE=$LDFLAGS
|
||||
case "x$host_os" in
|
||||
*bsd* )
|
||||
LDFLAGS="-pthread $LDFLAGS"
|
||||
break;
|
||||
;;
|
||||
esac
|
||||
if test "x$ax_boost_user_thread_lib" = "x"; then
|
||||
for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[link_thread="yes"; break],
|
||||
[link_thread="no"])
|
||||
done
|
||||
if test "x$link_thread" != "xyes"; then
|
||||
for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[link_thread="yes"; break],
|
||||
[link_thread="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[link_thread="yes"; break],
|
||||
[link_thread="no"])
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the library!)
|
||||
fi
|
||||
if test "x$link_thread" = "xno"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
else
|
||||
BOOST_THREAD_LIB="-l$ax_lib"
|
||||
case "x$host_os" in
|
||||
*bsd* )
|
||||
BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
|
||||
break;
|
||||
;;
|
||||
xsolaris )
|
||||
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
|
||||
break;
|
||||
;;
|
||||
xmingw32 )
|
||||
break;
|
||||
;;
|
||||
* )
|
||||
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
|
||||
break;
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(BOOST_THREAD_LIB)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
])
|
|
@ -1,559 +0,0 @@
|
|||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/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", "GL_LIBS", "GL_LDFLAGS", respectively. If no usable GL
|
||||
# implementation is found, "no_gl" is set to "yes".
|
||||
#
|
||||
# You could disable OpenGL using --with-gl=no
|
||||
#
|
||||
# You could choose a specific OpenGL libs using --with-gl=lib_name
|
||||
#
|
||||
# Under darwin, cygwin and mingw target you could prefer the OpenGL
|
||||
# implementation that link with X setting --with-gl=x or without X support
|
||||
# with --with-gl=nox. Notes that this script try to guess the right
|
||||
# implementation.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# You should use something like this in your headers:
|
||||
#
|
||||
# #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
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
|
||||
# Copyright (c) 2012 Bastien Roucaries <roucaries.bastien+autoconf@gmail.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 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.
|
||||
|
||||
#serial 17
|
||||
|
||||
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)]])])
|
||||
|
||||
dnl Default include : add windows.h
|
||||
dnl see http://www.opengl.org/wiki/Platform_specifics:_Windows
|
||||
dnl (acceded 20120801)
|
||||
AC_DEFUN([_AX_CHECK_GL_INCLUDES_DEFAULT],dnl
|
||||
[
|
||||
AC_INCLUDES_DEFAULT
|
||||
[
|
||||
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# endif
|
||||
]
|
||||
])
|
||||
|
||||
dnl local save flags
|
||||
AC_DEFUN([_AX_CHECK_GL_SAVE_FLAGS],
|
||||
[dnl
|
||||
ax_check_gl_saved_libs="${LIBS}"
|
||||
ax_check_gl_saved_cflags="${CFLAGS}"
|
||||
ax_check_gl_saved_cppflags="${CPPFLAGS}"
|
||||
ax_check_gl_saved_ldflags="${LDFLAGS}"
|
||||
])
|
||||
|
||||
dnl local restore flags
|
||||
AC_DEFUN([_AX_CHECK_GL_RESTORE_FLAGS],
|
||||
[dnl
|
||||
LIBS="${ax_check_gl_saved_libs}"
|
||||
CFLAGS="${ax_check_gl_saved_cflags}"
|
||||
CPPFLAGS="${ax_check_gl_saved_cppflags}"
|
||||
LDFLAGS="${ax_check_gl_saved_ldflags}"
|
||||
])
|
||||
|
||||
dnl default switch case failure
|
||||
AC_DEFUN([_AX_CHECK_MSG_FAILURE_ORDER],
|
||||
[dnl
|
||||
AC_MSG_FAILURE([Order logic in ax_check_gl is buggy])
|
||||
])
|
||||
|
||||
# set the varible ax_check_gl_need_x
|
||||
# this variable determine if we need opengl that link with X
|
||||
# value are default aka try the first library wether if it link or not with x
|
||||
# yes that means we need a opengl with x
|
||||
# no that means we do not need an opengl with x
|
||||
AC_DEFUN([_AX_CHECK_GL_NEED_X],
|
||||
[dnl
|
||||
# do not check if empty : allow a subroutine to modify the choice
|
||||
AS_IF([test "X$ax_check_gl_need_x" = "X"],
|
||||
[ax_check_gl_need_x="default"
|
||||
AS_IF([test "X$no_x" = "Xyes"],[ax_check_gl_need_x="no"])
|
||||
AS_IF([test "X$ax_check_gl_want_gl" = "Xnox"],[ax_check_gl_need_x="no"])
|
||||
AS_IF([test "X$ax_check_gl_want_gl" = "Xx"],[ax_check_gl_need_x="yes"])])
|
||||
])
|
||||
|
||||
# compile the example program
|
||||
AC_DEFUN([_AX_CHECK_GL_COMPILE],
|
||||
[dnl
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
CFLAGS="${GL_CFLAGS} ${CFLAGS}"
|
||||
AC_COMPILE_IFELSE([_AX_CHECK_GL_PROGRAM],
|
||||
[ax_check_gl_compile_opengl="yes"],
|
||||
[ax_check_gl_compile_opengl="no"])
|
||||
_AX_CHECK_GL_RESTORE_FLAGS()
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
|
||||
# compile the example program (cache)
|
||||
AC_DEFUN([_AX_CHECK_GL_COMPILE_CV],
|
||||
[dnl
|
||||
AC_CACHE_CHECK([for compiling a minimal OpenGL program],[ax_cv_check_gl_compile_opengl],
|
||||
[_AX_CHECK_GL_COMPILE()
|
||||
ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"])
|
||||
ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
|
||||
])
|
||||
|
||||
# link the example program
|
||||
AC_DEFUN([_AX_CHECK_GL_LINK],
|
||||
[dnl
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
CFLAGS="${GL_CFLAGS} ${CFLAGS}"
|
||||
LIBS="${GL_LIBS} ${LIBS}"
|
||||
LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
|
||||
AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM],
|
||||
[ax_check_gl_link_opengl="yes"],
|
||||
[ax_check_gl_link_opengl="no"])
|
||||
_AX_CHECK_GL_RESTORE_FLAGS()
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
|
||||
# link the example program (cache)
|
||||
AC_DEFUN([_AX_CHECK_GL_LINK_CV],
|
||||
[dnl
|
||||
AC_CACHE_CHECK([for linking a minimal OpenGL program],[ax_cv_check_gl_link_opengl],
|
||||
[_AX_CHECK_GL_LINK()
|
||||
ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"])
|
||||
ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
|
||||
])
|
||||
|
||||
dnl Check headers manually (default case)
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT],
|
||||
[AC_REQUIRE([AC_PATH_XTRA])
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
CFLAGS="${GL_CFLAGS} ${CFLAGS}"
|
||||
# see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
|
||||
AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
|
||||
# FIXME: use extra cflags
|
||||
AC_CHECK_HEADERS([GL/gl.h],[ax_check_gl_have_headers="yes"],
|
||||
[ax_check_gl_have_headers_headers="no"],
|
||||
[_AX_CHECK_GL_INCLUDES_DEFAULT()])
|
||||
# do not try darwin specific OpenGl/gl.h
|
||||
_AX_CHECK_GL_RESTORE_FLAGS()
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
|
||||
# darwin headers without X
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX],[
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
# FIXME: use -framework opengl as an extra cflags
|
||||
CFLAGS="-framework opengl ${GL_CFLAGS} ${CFLAGS}"
|
||||
AC_CHECK_HEADERS([OpenGL/gl.h],[ax_check_gl_have_headers="yes"],
|
||||
[ax_check_gl_have_headers_headers="no"],
|
||||
[_AX_CHECK_GL_INCLUDES_DEFAULT()])
|
||||
AS_IF([test "X$ax_check_gl_have_headers" = "yes"],
|
||||
[GL_CFLAGS="-framework opengl ${GL_CFLAGS}"])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
|
||||
# check header for darwin
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN],
|
||||
[AC_REQUIRE([_AX_CHECK_GL_NEED_X])dnl
|
||||
AS_CASE(["$ax_check_gl_order"],
|
||||
# try to use framework
|
||||
["gl"],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()],
|
||||
# try to use framework then mesa (X)
|
||||
["gl mesagl"],[
|
||||
_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()
|
||||
AS_IF([test "X$ax_check_gl_have_headers" = "yes"],
|
||||
[ax_check_gl_order="gl"
|
||||
ax_check_gl_need_x="yes"],
|
||||
[ax_check_gl_order="mesagl gl"
|
||||
ax_check_gl_need_x="no"]
|
||||
# retry with general test
|
||||
_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()])],
|
||||
["mesagl gl"],[
|
||||
_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()
|
||||
AS_IF([test "X$ax_check_gl_have_headers" = "yes"],
|
||||
[ax_check_gl_order="mesagl gl"
|
||||
ax_check_gl_need_x="no"],
|
||||
[ax_check_gl_order="gl"
|
||||
ax_check_gl_need_x="yes"
|
||||
# retry with framework
|
||||
_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()])],
|
||||
[_AX_CHECK_MSG_FAILURE_ORDER()])
|
||||
])
|
||||
|
||||
dnl Check headers manually: subroutine must set ax_check_gl_have_headers={yes,no}
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AS_CASE([${host}],
|
||||
[*-darwin*],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN],
|
||||
[_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()])
|
||||
AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers],
|
||||
[ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"])
|
||||
])
|
||||
|
||||
# dnl try to found library (generic case)
|
||||
# dnl $1 is set to the library to found
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_GENERIC],
|
||||
[dnl
|
||||
ax_check_gl_manual_libs_generic_extra_libs="$1"
|
||||
AS_IF([test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"],
|
||||
[AC_MSG_ERROR([AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty])])
|
||||
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
CFLAGS="${GL_CFLAGS} ${CFLAGS}"
|
||||
LIBS="${GL_LIBS} ${LIBS}"
|
||||
AC_SEARCH_LIBS([glBegin],[$ax_check_gl_manual_libs_generic_extra_libs],
|
||||
[ax_check_gl_lib_opengl="yes"],
|
||||
[ax_check_gl_lib_opengl="no"])
|
||||
AS_CASE([$ac_cv_search_glBegin],
|
||||
["none required"],[],
|
||||
[no],[],
|
||||
[GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}"])
|
||||
_AX_CHECK_GL_RESTORE_FLAGS()
|
||||
AC_LANG_PUSH([C])
|
||||
])
|
||||
|
||||
# dnl try to found lib under darwin
|
||||
# darwin opengl hack
|
||||
# see http://web.archive.org/web/20090410052741/http://developer.apple.com/qa/qa2007/qa1567.html
|
||||
# and http://web.eecs.umich.edu/~sugih/courses/eecs487/glut-howto/
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_DARWIN],
|
||||
[# ldhack list
|
||||
ldhack1 = "-Wl,-framework,OpenGL"
|
||||
ldhack2 = "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
|
||||
ldhack3 = "$ldhack1,$ldhack2"
|
||||
|
||||
# select hack
|
||||
AS_IF([test "X$ax_check_gl_need_x" = "Xyes"],
|
||||
[# libs already set by -framework cflag
|
||||
darwinlibs=""
|
||||
ldhacks="$ldhack1 $ldhack2 $ldhack3"],
|
||||
[# do not use framework ldflags in case of x version
|
||||
darwinlibs="GL gl MesaGL"
|
||||
ldhack="$ldhack2"])
|
||||
|
||||
ax_check_gl_link_opengl="no"
|
||||
for extralibs in " " $darwinlibs; do
|
||||
for extraldflags in " " ldhacks; do
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
CFLAGS="${GL_CFLAGS} ${CFLAGS}"
|
||||
LIBS="$extralibs ${GL_LIBS} ${LIBS}"
|
||||
LDFLAGS="$extraldflags ${GL_LDFLAGS} ${LDFLAGS}"
|
||||
AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM],
|
||||
[ax_check_gl_link_opengl="yes"],
|
||||
[ax_check_gl_link_opengl="no"])
|
||||
_AX_CHECK_GL_RESTORE_FLAGS()
|
||||
AC_LANG_POP([C])
|
||||
AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break])
|
||||
done;
|
||||
AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break])
|
||||
done;
|
||||
GL_LIBS="$extralibs ${GL_LIBS}"
|
||||
GL_LDFLAGS="$extraldflags ${GL_LDFLAGS}"
|
||||
])
|
||||
|
||||
dnl Check library manually: subroutine must set
|
||||
dnl $ax_check_gl_lib_opengl={yes,no}
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AS_CASE([${host}],
|
||||
[*-darwin*],[_AX_CHECK_GL_MANUAL_LIBS_DARWIN()],
|
||||
# try first cygwin version
|
||||
[*-cygwin*|*-mingw*],[
|
||||
AS_CASE(["$ax_check_gl_order"],
|
||||
["gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32])],
|
||||
["gl mesagl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32 GL gl MesaGL])],
|
||||
["mesagl gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL opengl32])],
|
||||
[_AX_CHECK_MSG_FAILURE_ORDER()])],
|
||||
[AS_CASE(["$ax_check_gl_order"],
|
||||
["gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl])],
|
||||
["gl mesagl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL])],
|
||||
["mesagl gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([MesaGL GL gl])],
|
||||
[_AX_CHECK_MSG_FAILURE_ORDER()])]
|
||||
)
|
||||
|
||||
AC_CACHE_CHECK([for OpenGL libraries],[ax_cv_check_gl_lib_opengl],
|
||||
[ax_cv_check_gl_lib_opengl="${ax_check_gl_lib_opengl}"])
|
||||
ax_check_gl_lib_opengl="${ax_cv_check_gl_lib_opengl}"
|
||||
])
|
||||
|
||||
# manually check aka old way
|
||||
AC_DEFUN([_AX_CHECK_GL_MANUAL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_PATH_XTRA])dnl
|
||||
|
||||
no_gl="yes"
|
||||
|
||||
_AX_CHECK_GL_MANUAL_HEADERS()
|
||||
AS_IF([test "X$ax_check_gl_have_headers" = "Xyes"],
|
||||
[_AX_CHECK_GL_COMPILE_CV()],
|
||||
[ax_check_gl_compile_opengl=no])
|
||||
|
||||
AS_IF([test "X$ax_check_gl_compile_opengl" = "Xyes"],
|
||||
[_AX_CHECK_GL_MANUAL_LIBS],
|
||||
[ax_check_gl_lib_opengl=no])
|
||||
|
||||
AS_IF([test "X$ax_check_gl_lib_opengl" = "Xyes"],
|
||||
[_AX_CHECK_GL_LINK_CV()],
|
||||
[ax_check_gl_link_opengl=no])
|
||||
|
||||
AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],
|
||||
[no_gl="no"],
|
||||
[no_gl="yes"])
|
||||
])dnl
|
||||
|
||||
|
||||
# try to test using pkgconfig: set ax_check_gl_pkg_config=no if not found
|
||||
AC_DEFUN([_AX_CHECK_GL_PKG_CONFIG],dnl
|
||||
[dnl
|
||||
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
|
||||
dnl First try mesagl
|
||||
AS_CASE(["$ax_check_gl_order"],
|
||||
["gl"],[PKG_CHECK_MODULES([GL],[mesagl],
|
||||
[ax_check_gl_pkg_config=yes],
|
||||
[ax_check_gl_pkg_config=no])],
|
||||
["gl mesagl"],[PKG_CHECK_MODULES([GL],[gl],
|
||||
[ax_check_gl_pkg_config=yes],
|
||||
[PKG_CHECK_MODULES([GL],[mesagl],
|
||||
[ax_check_gl_pkg_config=yes],
|
||||
[ax_check_gl_pkg_config=no])])],
|
||||
["mesagl gl"],[PKG_CHECK_MODULES([GL],[mesagl],
|
||||
[ax_check_gl_pkg_config=yes],
|
||||
[PKG_CHECK_MODULES([GL],[gl],
|
||||
[ax_check_gl_pkg_config=yes],
|
||||
[ax_check_gl_pkg_config=no])])],
|
||||
[_AX_CHECK_MSG_FAILURE_ORDER])
|
||||
|
||||
AS_IF([test "X$ax_check_gl_pkg_config" = "Xyes"],[
|
||||
# check headers
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
CFLAGS="${GL_CFLAGS} ${CFLAGS}"
|
||||
AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
|
||||
AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h],
|
||||
[ax_check_gl_have_headers="yes";break],
|
||||
[ax_check_gl_have_headers_headers="no"],
|
||||
[_AX_CHECK_GL_INCLUDES_DEFAULT()])
|
||||
_AX_CHECK_GL_RESTORE_FLAGS()
|
||||
AC_LANG_POP([C])
|
||||
AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers],
|
||||
[ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"])
|
||||
|
||||
# pkgconfig library are suposed to work ...
|
||||
AS_IF([test "X$ax_cv_check_gl_have_headers" = "Xno"],
|
||||
[AC_MSG_ERROR("Pkgconfig detected OpenGL library has no headers!")])
|
||||
|
||||
_AX_CHECK_GL_COMPILE_CV()
|
||||
AS_IF([test "X$ax_cv_check_gl_compile_opengl" = "Xno"],
|
||||
[AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for compiling minimal program!")])
|
||||
|
||||
_AX_CHECK_GL_LINK_CV()
|
||||
AS_IF([test "X$ax_cv_check_gl_link_opengl" = "Xno"],
|
||||
[AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for linking minimal program!")])
|
||||
],[ax_check_gl_pkg_config=no])
|
||||
])
|
||||
|
||||
# test if gl link with X
|
||||
AC_DEFUN([_AX_CHECK_GL_WITH_X],
|
||||
[
|
||||
# try if opengl need X
|
||||
AC_LANG_PUSH([C])
|
||||
_AX_CHECK_GL_SAVE_FLAGS()
|
||||
CFLAGS="${GL_CFLAGS} ${CFLAGS}"
|
||||
LIBS="${GL_LIBS} ${LIBS}"
|
||||
LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [glXQueryVersion])],
|
||||
[ax_check_gl_link_implicitly_with_x="yes"],
|
||||
[ax_check_gl_link_implicitly_with_x="no"])
|
||||
_AX_CHECK_GL_RESTORE_FLAGS()
|
||||
AC_LANG_POP([C])
|
||||
])
|
||||
|
||||
# internal routine: entry point if gl not disable
|
||||
AC_DEFUN([_AX_CHECK_GL],[dnl
|
||||
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
AC_REQUIRE([AC_PATH_X])dnl
|
||||
|
||||
# does we need X or not
|
||||
_AX_CHECK_GL_NEED_X()
|
||||
|
||||
# try first pkgconfig
|
||||
AC_MSG_CHECKING([for a working OpenGL implementation by pkg-config])
|
||||
AS_IF([test "X${PKG_CONFIG}" = "X"],
|
||||
[ AC_MSG_RESULT([no])
|
||||
ax_check_gl_pkg_config=no],
|
||||
[ AC_MSG_RESULT([yes])
|
||||
_AX_CHECK_GL_PKG_CONFIG()])
|
||||
|
||||
# if no pkgconfig or pkgconfig fail try manual way
|
||||
AS_IF([test "X$ax_check_gl_pkg_config" = "Xno"],
|
||||
[_AX_CHECK_GL_MANUAL()],
|
||||
[no_gl=no])
|
||||
|
||||
# test if need to test X compatibility
|
||||
AS_IF([test $no_gl = no],
|
||||
[# test X compatibility
|
||||
AS_IF([test X$ax_check_gl_need_x != "Xdefault"],
|
||||
[AC_CACHE_CHECK([wether OpenGL link implictly with X],[ax_cv_check_gl_link_with_x],
|
||||
[_AX_CHECK_GL_WITH_X()
|
||||
ax_cv_check_gl_link_with_x="${ax_check_gl_link_implicitly_with_x}"])
|
||||
AS_IF([test "X${ax_cv_check_gl_link_with_x}" = "X${ax_check_gl_need_x}"],
|
||||
[no_gl="no"],
|
||||
[no_gl=yes])])
|
||||
])
|
||||
])
|
||||
|
||||
# ax_check_gl entry point
|
||||
AC_DEFUN([AX_CHECK_GL],
|
||||
[AC_REQUIRE([AC_PATH_X])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
||||
AC_ARG_WITH([gl],
|
||||
[AS_HELP_STRING([--with-gl@<:@=ARG@:>@],
|
||||
[use opengl (ARG=yes),
|
||||
using the specific lib (ARG=<lib>),
|
||||
using the OpenGL lib that link with X (ARG=x),
|
||||
using the OpenGL lib that link without X (ARG=nox),
|
||||
or disable it (ARG=no)
|
||||
@<:@ARG=yes@:>@ ])],
|
||||
[
|
||||
AS_CASE(["$withval"],
|
||||
["no"|"NO"],[ax_check_gl_want_gl="no"],
|
||||
["yes"|"YES"],[ax_check_gl_want_gl="yes"],
|
||||
[ax_check_gl_want_gl="$withval"])
|
||||
],
|
||||
[ax_check_gl_want_gl="yes"])
|
||||
|
||||
dnl compatibility with AX_HAVE_OPENGL
|
||||
AC_ARG_WITH([Mesa],
|
||||
[AS_HELP_STRING([--with-Mesa@<:@=ARG@:>@],
|
||||
[Prefer the Mesa library over a vendors native OpenGL (ARG=yes except on mingw ARG=no),
|
||||
@<:@ARG=yes@:>@ ])],
|
||||
[
|
||||
AS_CASE(["$withval"],
|
||||
["no"|"NO"],[ax_check_gl_want_mesa="no"],
|
||||
["yes"|"YES"],[ax_check_gl_want_mesa="yes"],
|
||||
[AC_MSG_ERROR([--with-mesa flag is only yes no])])
|
||||
],
|
||||
[ax_check_gl_want_mesa="default"])
|
||||
|
||||
# check consistency of parameters
|
||||
AS_IF([test "X$have_x" = "Xdisabled"],
|
||||
[AS_IF([test X$ax_check_gl_want_gl = "Xx"],
|
||||
[AC_MSG_ERROR([You prefer OpenGL with X and asked for no X support])])])
|
||||
|
||||
AS_IF([test "X$have_x" = "Xdisabled"],
|
||||
[AS_IF([test X$x_check_gl_want_mesa = "Xyes"],
|
||||
[AC_MSG_WARN([You prefer mesa but you disable X. Disable mesa because mesa need X])
|
||||
ax_check_gl_want_mesa="no"])])
|
||||
|
||||
# mesa default means yes except on mingw
|
||||
AC_MSG_CHECKING([wether we should prefer mesa for opengl implementation])
|
||||
AS_IF([test X$ax_check_gl_want_mesa = "Xdefault"],
|
||||
[AS_CASE([${host}],
|
||||
[*-mingw*],[ax_check_gl_want_mesa=no],
|
||||
[ax_check_gl_want_mesa=yes])])
|
||||
AC_MSG_RESULT($ax_check_gl_want_mesa)
|
||||
|
||||
# set default guess order
|
||||
AC_MSG_CHECKING([for a working OpenGL order detection])
|
||||
AS_IF([test "X$no_x" = "Xyes"],
|
||||
[ax_check_gl_order="gl"],
|
||||
[AS_IF([test X$ax_check_gl_want_mesa = "Xyes"],
|
||||
[ax_check_gl_order="mesagl gl"],
|
||||
[ax_check_gl_order="gl mesagl"])])
|
||||
AC_MSG_RESULT($ax_check_gl_order)
|
||||
|
||||
# set flags
|
||||
no_gl="yes"
|
||||
have_GL="no"
|
||||
|
||||
# now do the real testing
|
||||
AS_IF([test X$ax_check_gl_want_gl != "Xno"],
|
||||
[_AX_CHECK_GL()])
|
||||
|
||||
AC_MSG_CHECKING([for a working OpenGL implementation])
|
||||
AS_IF([test "X$no_gl" = "Xno"],
|
||||
[have_GL="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([for CFLAGS needed for OpenGL])
|
||||
AC_MSG_RESULT(["${GL_CFLAGS}"])
|
||||
AC_MSG_CHECKING([for LIBS needed for OpenGL])
|
||||
AC_MSG_RESULT(["${GL_LIBS}"])
|
||||
AC_MSG_CHECKING([for LDFLAGS needed for OpenGL])
|
||||
AC_MSG_RESULT(["${GL_LDFLAGS}"])],
|
||||
[AC_MSG_RESULT([no])
|
||||
GL_CFLAGS=""
|
||||
GL_LIBS=""
|
||||
GL_LDFLAGS=""])
|
||||
|
||||
AC_SUBST([GL_CFLAGS])
|
||||
AC_SUBST([GL_LIBS])
|
||||
AC_SUBST([GL_LDFLAGS])
|
||||
])
|
|
@ -1,36 +0,0 @@
|
|||
##### 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
|
||||
])])
|
|
@ -1,332 +0,0 @@
|
|||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_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).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||
#
|
||||
# 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 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.
|
||||
|
||||
#serial 21
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_PUSH([C])
|
||||
ax_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], [ax_pthread_ok=yes])
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
if test x"$ax_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.
|
||||
|
||||
ax_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_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:
|
||||
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Clang doesn't consider unrecognized options an error unless we specify
|
||||
# -Werror. We throw in some extra Clang-specific options to ensure that
|
||||
# this doesn't happen for GCC, which also accepts -Werror.
|
||||
|
||||
AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
|
||||
save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_extra_flags="-Werror"
|
||||
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ax_pthread_extra_flags=
|
||||
AC_MSG_RESULT([no])])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
for flag in $ax_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([ax_pthread_config], [pthread-config], [yes], [no])
|
||||
if test x"$ax_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 $ax_pthread_extra_flags"
|
||||
|
||||
# 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_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
static void routine(void *a) { a = 0; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
pthread_join(th, 0);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_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_LINK_IFELSE([AC_LANG_PROGRAM([#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_os} in
|
||||
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
|
||||
osf* | hpux*) flag="-D_REENTRANT";;
|
||||
solaris*)
|
||||
if test "$GCC" = "yes"; then
|
||||
flag="-D_REENTRANT"
|
||||
else
|
||||
# TODO: What about Clang on Solaris?
|
||||
flag="-mt -D_REENTRANT"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$flag])
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT], [
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
|
||||
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: compile with *_r variant
|
||||
if test "x$GCC" != xyes; then
|
||||
case $host_os in
|
||||
aix*)
|
||||
AS_CASE(["x/$CC"],
|
||||
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
|
||||
[#handle absolute path differently from PATH based program lookup
|
||||
AS_CASE(["x$CC"],
|
||||
[x/*],
|
||||
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
|
||||
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||
|
||||
AC_SUBST([PTHREAD_LIBS])
|
||||
AC_SUBST([PTHREAD_CFLAGS])
|
||||
AC_SUBST([PTHREAD_CC])
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$ax_pthread_ok" = xyes; then
|
||||
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
|
||||
:
|
||||
else
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
|
@ -1,78 +0,0 @@
|
|||
##### 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)
|
||||
] )
|
1060
m4macros/wxwin.m4
1060
m4macros/wxwin.m4
File diff suppressed because it is too large
Load diff
|
@ -1,36 +0,0 @@
|
|||
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
|
||||
|
||||
GTEST_ROOT ?= $(TOP)vendor/googletest
|
||||
GTEST_FILE := ${GTEST_ROOT}/src/gtest-all
|
||||
|
||||
run_PCH := $(d)support/tests_pre.h
|
||||
run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \
|
||||
-I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
|
||||
run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare
|
||||
run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_UCHARDET) $(LIBS_PTHREAD)
|
||||
run_OBJ := \
|
||||
$(patsubst %.cpp,%.o,$(wildcard $(d)tests/*.cpp)) \
|
||||
$(d)support/main.o \
|
||||
$(d)support/util.o \
|
||||
$(TOP)lib/libaegisub.a \
|
||||
$(GTEST_FILE).o
|
||||
|
||||
# This bit of goofiness is to make it only try to build the tests if google
|
||||
# test can be found and silently skip it if not, by using $(wildcard) to check
|
||||
# for file existence
|
||||
PROGRAM += $(subst $(GTEST_FILE).cc,$(d)run,$(wildcard $(GTEST_FILE).cc))
|
||||
|
||||
ifeq (yes, $(BUILD_DARWIN))
|
||||
run_LIBS += -framework ApplicationServices -framework Foundation
|
||||
endif
|
||||
|
||||
$(d)data: $(d)setup.sh
|
||||
cd $(TOP)tests; ./setup.sh
|
||||
|
||||
gtest_filter ?= *
|
||||
test-libaegisub: $(d)run $(d)data
|
||||
cd $(TOP)tests; ./run --gtest_filter="$(gtest_filter)"
|
||||
|
||||
test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc))
|
||||
|
||||
include $(TOP)Makefile.target
|
Loading…
Reference in a new issue