Replace most inappropriate uses of LDFLAGS with LIBS

Originally committed to SVN as r6097.
This commit is contained in:
Thomas Goyne 2011-12-22 21:24:40 +00:00
parent 48526bf341
commit 71109a87e1
8 changed files with 175 additions and 227 deletions

View file

@ -1,153 +1,153 @@
######################### #########################
# AEGISUB FEATURE SUPPORT # AEGISUB FEATURE SUPPORT
######################### #########################
HAVE_ALSA = @with_alsa@ HAVE_ALSA = @with_alsa@
HAVE_AUTO4_LUA = @with_auto4_lua@ HAVE_AUTO4_LUA = @with_auto4_lua@
HAVE_HUNSPELL = @with_hunspell@ HAVE_HUNSPELL = @with_hunspell@
HAVE_OPENAL = @with_openal@ HAVE_OPENAL = @with_openal@
HAVE_OSS = @with_oss@ HAVE_OSS = @with_oss@
HAVE_PORTAUDIO = @with_portaudio@ HAVE_PORTAUDIO = @with_portaudio@
HAVE_FFMS = @with_ffms@ HAVE_FFMS = @with_ffms@
HAVE_PULSEAUDIO = @with_pulseaudio@ HAVE_PULSEAUDIO = @with_pulseaudio@
HAVE_LIBASS = @with_libass@ HAVE_LIBASS = @with_libass@
################### ###################
# PLATFORM SETTINGS # PLATFORM SETTINGS
################### ###################
BUILD_BSD = @build_bsd@ BUILD_BSD = @build_bsd@
BUILD_DARWIN = @build_darwin@ BUILD_DARWIN = @build_darwin@
BUILD_DEFAULT = @build_default@ BUILD_DEFAULT = @build_default@
BUILD_LINUX = @build_linux@ BUILD_LINUX = @build_linux@
####### #######
# FLAGS # FLAGS
####### #######
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@ CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CFLAGS_DEP = -MD -MP CFLAGS_DEP = -MD -MP
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
INSTALL_FLAGS = -m 664 INSTALL_FLAGS = -m 664
CCACHE_ENV = CCACHE_SLOPPINESS=time_macros CCACHE_ENV = CCACHE_SLOPPINESS=time_macros
LIB_SHARED_LINK = -shared -Wl,-soname -Wl,$(LIB_SHARED_FULL) 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.5 -install_name ${CURDIR}/$(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.5 -install_name ${CURDIR}/$(LIB_SHARED_FULL)
######### #########
# STRINGS # STRINGS
######### #########
AEGISUB_COMMAND =@AEGISUB_COMMAND@ AEGISUB_COMMAND = @AEGISUB_COMMAND@
AEGISUB_VERSION_DATA =@AEGISUB_VERSION_DATA@ AEGISUB_VERSION_DATA = @AEGISUB_VERSION_DATA@
BUILD_DATE =@BUILD_DATE@ BUILD_DATE = @BUILD_DATE@
PACKAGE_DEBUG =@PACKAGE_DEBUG@ PACKAGE_DEBUG = @PACKAGE_DEBUG@
SVN_REVISION =@SVN_REVISION@ SVN_REVISION = @SVN_REVISION@
DEBUG_FLAGS =@DEBUG_FLAGS@ DEBUG_FLAGS = @DEBUG_FLAGS@
# OS X # OS X
BUNDLE_STRING =@BUNDLE_STRING@ BUNDLE_STRING = @BUNDLE_STRING@
DARWIN_ARCH =@DARWIN_ARCH@ DARWIN_ARCH = @DARWIN_ARCH@
DMG_STRING =@DMG_STRING@ DMG_STRING = @DMG_STRING@
GETTEXT_PACKAGE =@GETTEXT_PACKAGE@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
####### #######
# PATHS # PATHS
####### #######
P_PREFIX =@prefix@ P_PREFIX = @prefix@
prefix = ${P_PREFIX} prefix = ${P_PREFIX}
P_PREFIX_EXEC =@exec_prefix@ P_PREFIX_EXEC = @exec_prefix@
exec_prefix = ${P_PREFIX_EXEC} exec_prefix = ${P_PREFIX_EXEC}
P_BINDIR =@bindir@ P_BINDIR = @bindir@
P_SBINDIR =@sbindir@ P_SBINDIR = @sbindir@
P_LIBEXEC =@libexecdir@ P_LIBEXEC = @libexecdir@
P_DATAROOT =@datarootdir@ P_DATAROOT = @datarootdir@
P_SYSCONF =@sysconfdir@ P_SYSCONF = @sysconfdir@
P_SHAREDSTATE =@sharedstatedir@ P_SHAREDSTATE = @sharedstatedir@
P_LOCALSTATE =@localstatedir@ P_LOCALSTATE = @localstatedir@
P_INCLUDE =@includedir@ P_INCLUDE = @includedir@
P_LIB =@libdir@ P_LIB = @libdir@
P_LOCALE =$(P_DATAROOT)/locale P_LOCALE = $(P_DATAROOT)/locale
P_DESKTOP =@P_DESKTOP@ P_DESKTOP = @P_DESKTOP@
P_ICON =@P_ICON@ P_ICON = @P_ICON@
P_DATA =$(P_DATAROOT)/aegisub/$(AEGISUB_VERSION_DATA) P_DATA = $(P_DATAROOT)/aegisub/$(AEGISUB_VERSION_DATA)
P_DOC =$(P_DATAROOT)/doc/aegisub/$(AEGISUB_VERSION_DATA) P_DOC = $(P_DATAROOT)/doc/aegisub/$(AEGISUB_VERSION_DATA)
############### ###############
# LIBRARY FLAGS # LIBRARY FLAGS
############### ###############
CFLAGS_WX = @WX_CFLAGS@ CFLAGS_WX = @WX_CFLAGS@
CXXFLAGS_WX = @WX_CXXFLAGS@ CXXFLAGS_WX = @WX_CXXFLAGS@
CPPFLAGS_WX = @WX_CPPFLAGS@ CPPFLAGS_WX = @WX_CPPFLAGS@
LDFLAGS_WX = @WX_LIBS@ LIBS_WX = @WX_LIBS@
CFLAGS_FONTCONFIG = @FONTCONFIG_CFLAGS@ CFLAGS_FONTCONFIG = @FONTCONFIG_CFLAGS@
CFLAGS_FREETYPE = @FREETYPE_CFLAGS@ CFLAGS_FREETYPE = @FREETYPE_CFLAGS@
CFLAGS_GL = @GL_CFLAGS@ CFLAGS_GL = @GL_CFLAGS@
CFLAGS_FFMS = @FFMS_CFLAGS@ CFLAGS_FFMS = @FFMS_CFLAGS@
CFLAGS_FFTW3 = @FFTW3_CFLAGS@ CFLAGS_FFTW3 = @FFTW3_CFLAGS@
CFLAGS_HUNSPELL = @HUNSPELL_CFLAGS@ CFLAGS_HUNSPELL = @HUNSPELL_CFLAGS@
CFLAGS_ICONV = @ICONV_CFLAGS@ CFLAGS_ICONV = @ICONV_CFLAGS@
CFLAGS_LIBASS = @LIBASS_CFLAGS@ CFLAGS_LIBASS = @LIBASS_CFLAGS@
CFLAGS_LIBCURL = @LIBCURL_CFLAGS@ CFLAGS_LIBCURL = @LIBCURL_CFLAGS@
CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@ CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@
CFLAGS_LUA = @LUA_CFLAGS@ CFLAGS_LUA = @LUA_CFLAGS@
CFLAGS_OPENAL = @OPENAL_CFLAGS@ CFLAGS_OPENAL = @OPENAL_CFLAGS@
CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@ CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@
CFLAGS_PTHREAD = @PTHREAD_CFLAGS@ CFLAGS_PTHREAD = @PTHREAD_CFLAGS@
CFLAGS_UCHARDET = -I../universalchardet CFLAGS_UCHARDET = -I../universalchardet
LDFLAGS_ALSA = @ALSA_LDFLAGS@ LIBS_ALSA = @ALSA_LIBS@
LDFLAGS_FONTCONFIG = @FONTCONFIG_LIBS@ LIBS_FONTCONFIG = @FONTCONFIG_LIBS@
LDFLAGS_FREETYPE = @FREETYPE_LIBS@ LIBS_FREETYPE = @FREETYPE_LIBS@
LDFLAGS_GL = @GL_LIBS@ LIBS_GL = @GL_LIBS@
LDFLAGS_FFMS = @FFMS_LIBS@ LIBS_FFMS = @FFMS_LIBS@
LDFLAGS_FFTW3 = @FFTW3_LIBS@ LIBS_FFTW3 = @FFTW3_LIBS@
LDFLAGS_HUNSPELL = @HUNSPELL_LIBS@ LIBS_HUNSPELL = @HUNSPELL_LIBS@
LDFLAGS_ICONV = @ICONV_LDFLAGS@ LIBS_ICONV = @ICONV_LIBS@
LDFLAGS_LIBASS = @LIBASS_LIBS@ LIBS_LIBASS = @LIBASS_LIBS@
LDFLAGS_LIBCURL = @LIBCURL_LIBS@ LIBS_LIBCURL = @LIBCURL_LIBS@
LDFLAGS_LIBPULSE = @LIBPULSE_LIBS@ LIBS_LIBPULSE = @LIBPULSE_LIBS@
LDFLAGS_LUA = @LUA_LDFLAGS@ LDFLAGS_LUA = @LUA_LDFLAGS@
LDFLAGS_OPENAL = @OPENAL_LIBS@ LIBS_OPENAL = @OPENAL_LIBS@
LDFLAGS_PTHREAD = @PTHREAD_LIBS@ LIBS_PTHREAD = @PTHREAD_LIBS@
LDFLAGS_PORTAUDIO = @PORTAUDIO_LIBS@ LIBS_PORTAUDIO = @PORTAUDIO_LIBS@
LDFLAGS_UCHARDET ?= ../universalchardet/libuniversalchardet.a LIBS_UCHARDET ?= ../universalchardet/libuniversalchardet.a
##################### #####################
# DEBUG / DEVELOPMENT # DEBUG / DEVELOPMENT
##################### #####################
PRECOMPILED_HEADER = @enable_gcc_prec@ PRECOMPILED_HEADER = @enable_gcc_prec@
CCACHE_ENABLE = @enable_ccache@ CCACHE_ENABLE = @enable_ccache@
LDFLAGS_CCMALLOC = @CCMALLOC_LDFLAGS@ LDFLAGS_CCMALLOC = @CCMALLOC_LDFLAGS@
LDFLAGS_EFENCE = @EFENCE_LDFLAGS@ LIBS_EFENCE = @EFENCE_LIBS@
LDFLAGS_GCOV = @GCOV_LDFLAGS@ LIBS_GCOV = @GCOV_LIBS@
CFLAGS_EFENCE = @EFENCE_LDFLAGS@ CFLAGS_EFENCE = @EFENCE_CFLAGS@
CFLAGS_GCOV = @GCOV_CFLAGS@ CFLAGS_GCOV = @GCOV_CFLAGS@
########## ##########
# BINARIES # BINARIES
########## ##########
BIN_AR = ar BIN_AR = ar
BIN_RANLIB = ranlib BIN_RANLIB = ranlib
BIN_LN = ln BIN_LN = ln
BIN_RM = rm BIN_RM = rm
BIN_SHELL = @SHELL@ BIN_SHELL = @SHELL@
BIN_MV = mv BIN_MV = mv
BIN_SED = sed BIN_SED = sed
BIN_INSTALL = @INSTALL@ BIN_INSTALL = @INSTALL@
BIN_MSGMERGE = @MSGMERGE@ BIN_MSGMERGE = @MSGMERGE@
BIN_XGETTEXT = @XGETTEXT@ BIN_XGETTEXT = @XGETTEXT@
BIN_MSGFMT = @MSGFMT@ BIN_MSGFMT = @MSGFMT@
BIN_CC = @CC@ BIN_CC = @CC@
BIN_CXX = @CXX@ BIN_CXX = @CXX@
BIN_CP = cp BIN_CP = cp
BIN_MKDIR = mkdir BIN_MKDIR = mkdir
BIN_MKDIR_P = mkdir -p BIN_MKDIR_P = mkdir -p
BIN_ECHO = echo BIN_ECHO = echo
BIN_TOUCH = touch BIN_TOUCH = touch

View file

@ -30,19 +30,17 @@ $(LIB) : $(OBJ)
ifdef LIB_SHARED ifdef LIB_SHARED
LIB_SHARED_FULL = $(LIB_SHARED).$(LIB_VERSION) LIB_SHARED_FULL = $(LIB_SHARED).$(LIB_VERSION)
$(LIB_SHARED) : $(OBJ) $(LIB_SHARED) : $(OBJ)
$(BIN_CXX) $(LIB_SHARED_LINK) $(LDFLAGS) $(OBJ) $(LDFLAGS_POST) -o $(LIB_SHARED_FULL) $(BIN_CXX) $(LIB_SHARED_LINK) $(LDFLAGS) $(OBJ) $(LIBS) -o $(LIB_SHARED_FULL)
$(BIN_LN) -sf $(LIB_SHARED_FULL) $(LIB_SHARED) $(BIN_LN) -sf $(LIB_SHARED_FULL) $(LIB_SHARED)
CLEANFILES+= $(LIB_SHARED_FULL) CLEANFILES+= $(LIB_SHARED_FULL)
endif endif
########## ##########
# PROGRAMS # PROGRAMS
########## ##########
$(PROGRAM): $(OBJ) $(PROGRAM): $(OBJ)
$(BIN_CXX) -o $@ $(LDFLAGS) $(OBJ) $(LDFLAGS_POST) $(BIN_CXX) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
########## ##########
# CLEANING # CLEANING

View file

@ -62,7 +62,7 @@ AS_CASE([$host],
AS_IF([test "$build_bsd" = "yes"], [ AS_IF([test "$build_bsd" = "yes"], [
ICONV_CFLAGS="-I/usr/local/include" ICONV_CFLAGS="-I/usr/local/include"
ICONV_LDFLAGS="-L/usr/local/lib -liconv" ICONV_LIBS="-L/usr/local/lib -liconv"
]) ])
# Used for universalchardet. # Used for universalchardet.
@ -260,39 +260,26 @@ AC_CHECK_SIZEOF([time_t])
############################## ##############################
# Program Support and Features # Program Support and Features
############################## ##############################
########################## #########################
# X ### Required Dependencies
########################## #########################
AC_PATH_XTRA AC_PATH_XTRA
AS_IF([test x$no_x = xyes && test x$build_darwin != xyes], AS_IF([test x$no_x = xyes && test x$build_darwin != xyes],
[AC_MSG_FAILURE([You must have a working copy of X installed.])]) [AC_MSG_FAILURE([You must have a working copy of X installed.])])
#########
## OpenGL
#########
AX_CHECK_GL AX_CHECK_GL
AS_IF([test x$no_gl = xyes], [AC_MSG_FAILURE([Aegisub requires GL support.])]) AS_IF([test x$no_gl = xyes], [AC_MSG_FAILURE([Aegisub requires GL support.])])
AC_SUBST(GL_CFLAGS) AC_SUBST(GL_CFLAGS)
AC_SUBST(GL_LIBS) AC_SUBST(GL_LIBS)
#######
## cURL
#######
PKG_CHECK_MODULES(LIBCURL, libcurl >= curl_required_version,, PKG_CHECK_MODULES(LIBCURL, libcurl >= curl_required_version,,
[AC_MSG_FAILURE([aegisub requires >= cURL curl_required_version])]) [AC_MSG_FAILURE([aegisub requires >= cURL curl_required_version])])
###########
## Freetype
###########
PKG_CHECK_MODULES(FREETYPE, freetype2 >= freetype_required_version, PKG_CHECK_MODULES(FREETYPE, freetype2 >= freetype_required_version,
AC_DEFINE(WITH_FREETYPE2, 1, [Enable FreeType 2 support.]), AC_DEFINE(WITH_FREETYPE2, 1, [Enable FreeType 2 support.]),
[AC_MSG_FAILURE([Aegisub requires >= FreeType2 freetype_required_version])]) [AC_MSG_FAILURE([Aegisub requires >= FreeType2 freetype_required_version])])
#############
## Fontconfig
#############
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version, PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version,
[AC_DEFINE(WITH_FONTCONFIG, 1, [Enable FontConfig support.])], [AC_DEFINE(WITH_FONTCONFIG, 1, [Enable FontConfig support.])],
[AC_MSG_FAILURE([Aegisub requires fontconfig >= fontconfig_required_version])]) [AC_MSG_FAILURE([Aegisub requires fontconfig >= fontconfig_required_version])])
@ -301,17 +288,11 @@ PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version,
## iconv ## iconv
######## ########
AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv []]) AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv []])
AC_ARG_VAR([ICONV_LDFLAGS], [LDFLAGS to use for iconv [-liconv]]) AC_ARG_VAR([ICONV_LIBS], [LIBS to use for iconv [-liconv]])
AS_IF([test -z "$ICONV_LDFLAGS"], [ AS_IF([test -z "$ICONV_LIBS"], AC_SEARCH_LIBS([iconv_open], [iconv]))
OLD_LIBS="$LIBS"
LIBS=""
AC_SEARCH_LIBS([iconv_open], [iconv])
ICONV_LDFLAGS="$LIBS"
LIBS="$OLD_LIBS"
])
AC_AGI_COMPILE([iconv], [iconv], [$ICONV_CFLAGS], [$ICONV_LDFLAGS],[ AC_AGI_COMPILE([iconv], [iconv], [$ICONV_CFLAGS], [$ICONV_LIBS],[
#include <iconv.h> #include <iconv.h>
int main(void) { int main(void) {
iconv_t ic; iconv_t ic;
@ -320,12 +301,12 @@ int main(void) {
return 0; return 0;
} ]) } ])
AC_SUBST(ICONV_LDFLAGS) AC_SUBST(ICONV_LIBS)
AC_SUBST(ICONV_CFLAGS) AC_SUBST(ICONV_CFLAGS)
AS_IF([test x$agi_cv_with_iconv = xno], [AC_MSG_FAILURE([Please install a working iconv library.])]) 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_LDFLAGS],[ AC_AGI_COMPILE([iconv (const)], [iconv_const], [$ICONV_CFLAGS], [$ICONV_LIBS],[
#include <iconv.h> #include <iconv.h>
int main(void) { int main(void) {
iconv_t cd = iconv_open("UTF-16", "UTF-8"); iconv_t cd = iconv_open("UTF-16", "UTF-8");
@ -350,18 +331,18 @@ AC_ARG_WITH(alsa,
[build without ALSA audio provider [auto]])) [build without ALSA audio provider [auto]]))
AC_ARG_VAR([ALSA_CFLAGS], [CFLAGS to use for ALSA []]) AC_ARG_VAR([ALSA_CFLAGS], [CFLAGS to use for ALSA []])
AC_ARG_VAR([ALSA_LDFLAGS], [LDFLAGS to use for ALSA [-lasound -lrt]]) AC_ARG_VAR([ALSA_LIBS], [LIBS to use for ALSA [-lasound -lrt]])
ALSA_LDFLAGS=${ALSA_LDFLAGS:--lasound -lrt} ALSA_LIBS=${ALSA_LIBS:--lasound -lrt}
AS_IF([test x$with_alsa = xno], AS_IF([test x$with_alsa = xno],
[alsa_disabled="(disabled)"], [alsa_disabled="(disabled)"],
[AC_CHECK_LIB([asound], [snd_pcm_open], [with_alsa="yes"], [with_alsa="no"], $ALSA_LDFLAGS)]) [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])) AS_IF([test x$with_alsa = xyes], AC_DEFINE(WITH_ALSA, 1, [Enable ALSA Support]))
AC_SUBST(ALSA_CFLAGS) AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LDFLAGS) AC_SUBST(ALSA_LIBS)
AC_SUBST(with_alsa) AC_SUBST(with_alsa)
############ ############
@ -564,7 +545,7 @@ WX_UNICODE=$UNICODE
WX_CONFIG_CHECK([wx_required_version],,,[std,gl,stc],[$WXCONFIG_FLAGS]) WX_CONFIG_CHECK([wx_required_version],,,[std,gl,stc],[$WXCONFIG_FLAGS])
AS_IF([test x$have_wxconfig = xno], AS_IF([test x$have_wxconfig = xno],
AC_MSG_FAILURE([wxWidgets detection failed, please set --with-wx* or add the libraries to your LDFLAGS, CXX/CFLAGS.])) AC_MSG_FAILURE([wxWidgets detection failed, please set --with-wx* or add the libraries to your LIBS, CXX/CFLAGS.]))
AC_ARG_ENABLE(slow-wx-checks, AC_ARG_ENABLE(slow-wx-checks,
AS_HELP_STRING([--disable-slow-wx-checks],[Disable slow-running checks for wx components.])) AS_HELP_STRING([--disable-slow-wx-checks],[Disable slow-running checks for wx components.]))
@ -657,18 +638,18 @@ AS_IF([test x$enable_profile = xyes], [
# gcov # gcov
###### ######
AC_ARG_VAR([GCOV_CFLAGS], [gcov cflag(s) to use with --enable-gcov [-ftest-coverage -fprofile-arcs]]) AC_ARG_VAR([GCOV_CFLAGS], [gcov cflag(s) to use with --enable-gcov [-ftest-coverage -fprofile-arcs]])
AC_ARG_VAR([GCOV_LDFLAGS], [gcov ldflag(s) to use with --enable-gcov [-lgcov]]) AC_ARG_VAR([GCOV_LIBS], [gcov ldflag(s) to use with --enable-gcov [-lgcov]])
AC_MSG_CHECKING([whether to turn on gcov]) AC_MSG_CHECKING([whether to turn on gcov])
AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[enable gcov [no]])) AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[enable gcov [no]]))
AS_IF([test x$enable_gcov = xyes], [ AS_IF([test x$enable_gcov = xyes], [
GCOV_CFLAGS=${GCOV_CLFAGS:--fprofile-arcs -ftest-coverage} GCOV_CFLAGS=${GCOV_CLFAGS:--fprofile-arcs -ftest-coverage}
GCOV_LDFLAGS=${GCOV_LDFLAGS:--lgcov} GCOV_LIBS=${GCOV_LIBS:--lgcov}
AC_MSG_RESULT([yes ($GCOV_CFLAGS) ($GCOV_LDFLAGS)]) AC_MSG_RESULT([yes ($GCOV_CFLAGS) ($GCOV_LIBS)])
CFLAGS="$CFLAGS $GCOV_CFLAGS" CFLAGS="$CFLAGS $GCOV_CFLAGS"
LDFLAGS="$LDFLAGS $GCOV_LDFLAGS" LIBS="$LIBS $GCOV_LIBS"
], [ ], [
enable_gcov="no" enable_gcov="no"
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -677,18 +658,18 @@ AS_IF([test x$enable_gcov = xyes], [
################ ################
# Electric Fence # Electric Fence
################ ################
AC_ARG_VAR([EFENCE_LDFLAGS], [Electric Fence ldflag(s) to use with --enable-profile [-lefence]]) AC_ARG_VAR([EFENCE_LIBS], [Electric Fence ldflag(s) to use with --enable-profile [-lefence]])
AC_MSG_CHECKING([whether to turn on Electric Fence]) AC_MSG_CHECKING([whether to turn on Electric Fence])
AC_ARG_ENABLE(efence, AS_HELP_STRING([--enable-efence],[enable Electric Fence [no]])) AC_ARG_ENABLE(efence, AS_HELP_STRING([--enable-efence],[enable Electric Fence [no]]))
AS_IF([test x$enable_efence = xyes], [ AS_IF([test x$enable_efence = xyes], [
EFENCE_LDFLAGS=${EFENCE_LDFLAGS:--lefence} EFENCE_LIBS=${EFENCE_LIBS:--lefence}
AC_MSG_RESULT([yes ($EFENCE_LDFLAGS)]) AC_MSG_RESULT([yes ($EFENCE_LIBS)])
], [ ], [
enable_efence="no" enable_efence="no"
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
]) ])
AC_SUBST(EFENCE_LDFLAGS) AC_SUBST(EFENCE_LIBS)
########## ##########
# ccmalloc # ccmalloc
@ -808,6 +789,7 @@ Configure settings
CXXFLAGS $CXXFLAGS CXXFLAGS $CXXFLAGS
CPPFLAGS $CPPFLAGS CPPFLAGS $CPPFLAGS
LDFLAGS $LDFLAGS LDFLAGS $LDFLAGS
LIBS $LIBS
Default Settings Default Settings
Audio Player: $default_player_audio Audio Player: $default_player_audio

View file

@ -13,7 +13,7 @@ lagi_pre.h.gch: CXXFLAGS := $(CXXFLAGS)
ifeq (yes, $(BUILD_DARWIN)) ifeq (yes, $(BUILD_DARWIN))
CXXFLAGS += -I/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Headers/ CXXFLAGS += -I/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Headers/
LDFLAGS += -L../universalchardet -luniversalchardet LIBS += -L../universalchardet -luniversalchardet
endif endif
common/charset_conv.o: CXXFLAGS += $(CFLAGS_ICONV) common/charset_conv.o: CXXFLAGS += $(CFLAGS_ICONV)

View file

@ -1,43 +1,29 @@
AC_DEFUN([AC_AGI_COMPILE],[ AC_DEFUN([AC_AGI_COMPILE],[
aegisub_save_LDFLAGS="$LDFLAGS" aegisub_save_LIBS="$LIBS"
aegisub_save_CPPFLAGS="$CPPFLAGS" aegisub_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$3" CPPFLAGS="$CPPFLAGS $3"
LDFLAGS="$4" LIBS="$LIBS $4"
AC_CACHE_CHECK( AC_CACHE_CHECK(
[whether $1 works], [agi_cv_with_$2], [whether $1 works], [agi_cv_with_$2],
[AC_RUN_IFELSE([AC_LANG_SOURCE([$5])], [AC_RUN_IFELSE([AC_LANG_SOURCE([$5])],
[eval agi_cv_with_$2="yes"], [eval agi_cv_with_$2="yes"],
[eval agi_cv_with_$2="no"], [eval agi_cv_with_$2="no"],
[if test $? -ne 0; then [AS_IF([test $? -ne 0], [eval agi_cv_with_$2="no"], [eval agi_cv_with_$2="yes"])])])
eval agi_cv_with_$2="no";
else
eval agi_cv_with_$2="yes";
fi])
])
CPPFLAGS="$aegisub_save_CPPFLAGS" CPPFLAGS="$aegisub_save_CPPFLAGS"
LDFLAGS="$aegisub_save_LDFLAGS" LIBS="$aegisub_save_LIBS"
]) ])
AC_DEFUN([AC_AGI_LINK],[ AC_DEFUN([AC_AGI_LINK],[
aegisub_save_LIBS="$LIBS"
aegisub_save_CPPFLAGS="$CPPFLAGS" aegisub_save_CPPFLAGS="$CPPFLAGS"
aegisub_save_CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS $4"
CPPFLAGS="$4" LIBS="$LIBS $5"
CXXFLAGS="$CPPFLAGS" AC_CHECK_HEADER([$3], [agi_cv_header="yes"], [agi_cv_header="no"])
AC_CHECK_HEADER([$3],[agi_cv_header="yes"], [agi_cv_header="no"]) AS_IF([test "x$agi_cv_header" = xyes],
if test "$agi_cv_header" = "yes"; then [AC_CACHE_CHECK(
aegisub_save_LDFLAGS="$LDFLAGS" [whether $1 works], [agi_cv_with_$2],
LDFLAGS="$5" [AC_LINK_IFELSE([AC_LANG_SOURCE([$6])], [eval agi_cv_with_$2="yes"], [eval agi_cv_with_$2="no"])])]
AC_CACHE_CHECK( [eval agi_cv_with_$2="no"])
[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"])
])
LDFLAGS="$aegisub_save_LDFLAGS"
else
eval agi_cv_with_$2="no"
fi
CPPFLAGS="$aegisub_save_CPPFLAGS" CPPFLAGS="$aegisub_save_CPPFLAGS"
CXXFLAGS="$aegisub_save_CXXFLAGS" LIBS="$aegisub_save_LIBS"
]) ])

View file

@ -4,27 +4,9 @@ PROGRAM = reporter-3.0
PROGRAM_INSTALL = yes PROGRAM_INSTALL = yes
PRECOMPILED_HEADER_NAME=r_pre.h PRECOMPILED_HEADER_NAME=r_pre.h
#if PRECOMPILED_HEADER
#BUILT_SOURCES = r_pre.h.gch
#AM_CXXFLAGS += -include r_pre.h -Winvalid-pch -fpch-deps -fpch-preprocess
#nodist_reporter_3_0_SOURCES = r_prec.h.gch
#endif
CXXFLAGS += -Iinclude $(CFLAGS_WX) -I../libaegisub/include CXXFLAGS += -Iinclude $(CFLAGS_WX) -I../libaegisub/include
LDFLAGS += $(LDFLAGS_WX) $(LDFLAGS_LIBCURL) -L../libaegisub -laegisub-3.0 $(LDFLAGS_UCHARDET) -Wl,-rpath ../libaegisub $(LDFLAGS_GL) LIBS += $(LIBS_WX) $(LIBS_LIBCURL) -L../libaegisub -laegisub-3.0 $(LIBS_UCHARDET) $(LIBS_GL)
LDFLAGS += -Wl,-rpath ../libaegisub
ifeq (yes, $(HAVE_PROVIDER_FFMPEGSOURCE))
LDFLAGS += $(LDFLAGS_LIBAVFORMAT) $(LDFLAGS_LIBAVCODEC) $(LDFLAGS_LIBSWSCALE) $(LDFLAGS_LIBAVUTIL) $(LDFLAGS_LIBPOSTPROC)
endif
#if PRECOMPILED_HEADER
## This doesn't depend on Makefile on purpose, you should already know what you're doing when using this.
#r_pre.h.gch: r_pre.h
# @CXX@ @WX_CPPFLAGS@ @CXXFLAGS@ @DEBUG_FLAGS@ r_pre.h
#DISTCLEANFILES += r_pre.h.gch
#endif
# File-specific flags # File-specific flags
upload.o: CXXFLAGS += $(CFLAGS_CURL) upload.o: CXXFLAGS += $(CFLAGS_CURL)

View file

@ -10,14 +10,16 @@ AEGISUB_CFLAGS = -I. -I.. -Iinclude -I../libaegisub/include -DAEGISUB $(CFLAGS_
CFLAGS += $(AEGISUB_CFLAGS) CFLAGS += $(AEGISUB_CFLAGS)
CXXFLAGS += $(AEGISUB_CFLAGS) -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX) CXXFLAGS += $(AEGISUB_CFLAGS) -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX)
LDFLAGS += -L../libaegisub -laegisub-3.0 LIBS += -L../libaegisub -laegisub-3.0
LDFLAGS += $(LDFLAGS_CCMALLOC) $(LDFLAGS_EFENCE) $(LDFLAGS_GL) LIBS += $(LIBS_CCMALLOC) $(LIBS_EFENCE) $(LIBS_GL)
LDFLAGS += $(LDFLAGS_PTHREAD) $(LDFLAGS_WX) $(LDFLAGS_FREETYPE) LIBS += $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE)
LDFLAGS += $(LDFLAGS_FONTCONFIG) $(LDFLAGS_FFTW3) LIBS += $(LIBS_FONTCONFIG) $(LIBS_FFTW3)
LDFLAGS_POST += $(LDFLAGS_UCHARDET) LIBS += $(LIBS_UCHARDET)
LDFLAGS += $(LDFLAGS_CCMALLOC)
ifdef BUILD_DARWIN ifdef BUILD_DARWIN
LDFLAGS += -lz LIBS += -lz
endif endif
############### ###############
@ -26,25 +28,25 @@ endif
ifeq (yes, $(HAVE_ALSA)) ifeq (yes, $(HAVE_ALSA))
SRC_OPT += audio_player_alsa.cpp SRC_OPT += audio_player_alsa.cpp
audio_player_alsa.o: CXXFLAGS += $(CFLAGS_ALSA) audio_player_alsa.o: CXXFLAGS += $(CFLAGS_ALSA)
LDFLAGS += $(LDFLAGS_ALSA) LIBS += $(LIBS_ALSA)
endif endif
ifeq (yes, $(HAVE_PORTAUDIO)) ifeq (yes, $(HAVE_PORTAUDIO))
SRC_OPT += audio_player_portaudio.cpp SRC_OPT += audio_player_portaudio.cpp
audio_player_portaudio.o: CXXFLAGS += $(CFLAGS_PORTAUDIO) audio_player_portaudio.o: CXXFLAGS += $(CFLAGS_PORTAUDIO)
LDFLAGS += $(LDFLAGS_PORTAUDIO) LIBS += $(LIBS_PORTAUDIO)
endif endif
ifeq (yes, $(HAVE_PULSEAUDIO)) ifeq (yes, $(HAVE_PULSEAUDIO))
SRC_OPT += audio_player_pulse.cpp SRC_OPT += audio_player_pulse.cpp
audio_player_pulse.o: CXXFLAGS += $(CFLAGS_LIBPULSE) audio_player_pulse.o: CXXFLAGS += $(CFLAGS_LIBPULSE)
LDFLAGS += $(LDFLAGS_LIBPULSE) LIBS += $(LIBS_LIBPULSE)
endif endif
ifeq (yes, $(HAVE_OPENAL)) ifeq (yes, $(HAVE_OPENAL))
SRC_OPT += audio_player_openal.cpp SRC_OPT += audio_player_openal.cpp
audio_player_openal.o: CXXFLAGS += $(CFLAGS_OPENAL) audio_player_openal.o: CXXFLAGS += $(CFLAGS_OPENAL)
LDFLAGS += $(LDFLAGS_OPENAL) LIBS += $(LIBS_OPENAL)
endif endif
ifeq (yes, $(HAVE_OSS)) ifeq (yes, $(HAVE_OSS))
@ -58,8 +60,7 @@ ifeq (yes, $(HAVE_FFMS))
SRC_OPT += audio_provider_ffmpegsource.cpp video_provider_ffmpegsource.cpp ffmpegsource_common.cpp SRC_OPT += audio_provider_ffmpegsource.cpp video_provider_ffmpegsource.cpp ffmpegsource_common.cpp
audio_provider_ffmpegsource.o video_provider_ffmpegsource.o ffmpegsource_common.o: \ audio_provider_ffmpegsource.o video_provider_ffmpegsource.o ffmpegsource_common.o: \
CXXFLAGS += $(CFLAGS_FFMS) CXXFLAGS += $(CFLAGS_FFMS)
LDFLAGS += $(LDFLAGS_FFMS) LIBS += $(LIBS_FFMS)
LDFLAGS_POST += $(LDFLAGS_FFMS)
endif endif
########### ###########
@ -68,8 +69,7 @@ endif
ifeq (yes, $(HAVE_LIBASS)) ifeq (yes, $(HAVE_LIBASS))
SRC_OPT += subtitles_provider_libass.cpp SRC_OPT += subtitles_provider_libass.cpp
subtitles_provider_libass.o: CXXFLAGS += $(CFLAGS_LIBASS) subtitles_provider_libass.o: CXXFLAGS += $(CFLAGS_LIBASS)
LDFLAGS += $(LDFLAGS_LIBASS) LIBS += $(LIBS_LIBASS)
LDFLAGS_POST += $(LDFLAGS_LIBASS)
endif endif
############ ############
@ -87,7 +87,7 @@ endif
ifeq (yes, $(HAVE_HUNSPELL)) ifeq (yes, $(HAVE_HUNSPELL))
SRC_OPT += spellchecker_hunspell.cpp SRC_OPT += spellchecker_hunspell.cpp
spellchecker_hunspell.o: CXXFLAGS += $(CFLAGS_HUNSPELL) spellchecker_hunspell.o: CXXFLAGS += $(CFLAGS_HUNSPELL)
LDFLAGS += $(LDFLAGS_HUNSPELL) LIBS += $(LIBS_HUNSPELL)
endif endif
##################### #####################

View file

@ -3,11 +3,11 @@ include ../Makefile.inc
PROGRAM = run PROGRAM = run
LDFLAGS += -L../libaegisub -laegisub-3.0 -Wl,-rpath $(CURDIR)/../libaegisub -lgtest -L../universalchardet -luniversalchardet LIBS += -L../libaegisub -laegisub-3.0 -lgtest -L../universalchardet -luniversalchardet
LDFLAGS += $(LDFLAGS_ICONV) LDFLAGS += -Wl,-rpath $(CURDIR)/../libaegisub $(LDFLAGS_ICONV)
CPPFLAGS += -I../src/include -I../libaegisub/include $(CFLAGS_ICONV) CPPFLAGS += -I../src/include -I../libaegisub/include $(CFLAGS_ICONV)
CXXFLAGS += -Wno-unused-value CXXFLAGS += -Wno-unused-value
ifdef $(BUILD_DARWIN) ifdef $(BUILD_DARWIN)