Merge r4855-4894 from the new_build_system branch. This still has rough spots and some of the dependency relations haven't been expressed but it works, and it's much better than what we had before as it kills off automake, libtool, gettext (package not library), intltool usage.

Originally committed to SVN as r4895.
This commit is contained in:
Amar Takhar 2010-12-05 19:12:42 +00:00
parent d6e9ee9487
commit 5a635ebdb3
42 changed files with 4700 additions and 1528 deletions

View file

@ -1,19 +1,16 @@
AUTOMAKE_OPTIONS = foreign
include Makefile.inc
if WITH_INTERNAL_LIBASS
libass = libass
ifeq (yes, $(WITH_LIBASS))
SUBDIRS += libass
endif
if HAVE_PROVIDER_FFMPEGSOURCE
ffmpegsource = libffms
ifeq (yes, $(HAVE_PROVIDER_FFMPEGSOURCE))
SUBDIRS += libffms
endif
SUBDIRS = \
SUBDIRS += \
universalchardet \
libaegisub \
$(ffmpegsource) \
$(libass) \
tools \
src \
reporter \
@ -21,32 +18,40 @@ SUBDIRS = \
desktop \
po
all: ;
ifeq (yes, $(BUILD_DARWIN))
osx-bundle:
@SHELL@ tools/osx-bundle.sh "@BUNDLE_STRING@" @AEGISUB_VERSION_DATA@ DICT_DIR=$(DICT_DIR)
$(BIN_SHELL) tools/osx-bundle.sh "$(BUNDLE_STRING)" $(AEGISUB_VERSION_DATA) DICT_DIR=$(DICT_DIR)
osx-dmg:
@SHELL@ tools/osx-dmg.sh "@BUNDLE_STRING@" "@DMG_STRING@"
$(BIN_SHELL) tools/osx-dmg.sh "$(BUNDLE_STRING)" "$(DMG_STRING)"
osx-tinderbox-bundle:
@SHELL@ tools/osx-bundle.sh "$(T_BUNDLE)" @AEGISUB_VERSION_DATA@ DICT_DIR="$(DICT_DIR)"
$(BIN_SHELL) tools/osx-bundle.sh "$(T_BUNDLE)" $(AEGISUB_VERSION_DATA) DICT_DIR="$(DICT_DIR)"
osx-tinderbox-dmg:
@SHELL@ tools/osx-dmg.sh "$(T_DMG)" "$(T_BUNDLE)"
mv "$(T_DMG).dmg" bundle.dmg
$(BIN_SHELL) tools/osx-dmg.sh "$(T_DMG)" "$(T_BUNDLE)"
$(BIN_MV) "$(T_DMG).dmg" bundle.dmg
endif
EXTRA_DIST = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
config.guess \
config.sub \
depcomp \
install-sh \
LICENCE \
missing \
INSTALL \
LICENCE \
README \
svn_revision
acinclude.m4 \
autogen.sh \
configure.in \
acconf.h.in\
configure \
svn_revision \
config.log \
install-sh \
Makefile.inc \
Makefile.inc.in \
Makefile.target
# m4macros/
EXTRA_DIST += \
@ -73,7 +78,16 @@ EXTRA_DIST += \
packages/osx_dmg/dmg_set_style.applescript
CLEANFILES= \
intltool-extract \
intltool-merge \
intltool-update
DISTCLEANFILES += \
acconf.h \
configure \
acconf.h.in~ \
svn_revision \
Makefile.inc \
config.log \
acconf.h.in \
config.status \
autom4te.cache \
aclocal.m4 \
include Makefile.target

174
aegisub/Makefile.inc.in Normal file
View file

@ -0,0 +1,174 @@
#########################
# AEGISUB FEATURE SUPPORT
#########################
HAVE_ALSA = @with_alsa@
HAVE_AUTO4_LUA = @with_auto4_lua@
HAVE_AUTOMATION = @with_automation@
HAVE_FFMPEG = @agi_cv_with_ffmpeg@
HAVE_HUNSPELL = @with_hunspell@
HAVE_OPENAL = @with_openal@
HAVE_OPENMP = @with_openmp@
HAVE_OSS = @with_oss@
HAVE_PORTAUDIO = @with_portaudio@
HAVE_PROVIDER_FFMPEGSOURCE = @with_provider_ffmpegsource@
HAVE_PULSEAUDIO = @with_pulseaudio@
WITH_EXTERNAL_LIBASS = @with_external_libass@
WITH_LIBASS = @with_libass@
FOUND_AUDIO_PLAYER = @found_audio_player@
FOUND_VIDEO_PROVIDER = @found_video_provider@
###################
# PLATFORM SETTINGS
###################
BUILD_BSD = @build_bsd@
BUILD_DARWIN = @build_darwin@
BUILD_DEFAULT = @build_default@
BUILD_LINUX = @build_linux@
#######
# FLAGS
#######
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@
CFLAGS_DEP = -MD -MP
LDFLAGS = @LDFLAGS@
INSTALL_FLAGS = -m 664
CCACHE_ENV = CCACHE_SLOPPINESS=time_macros
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)
#########
# STRINGS
#########
AEGISUB_COMMAND =@AEGISUB_COMMAND@
AEGISUB_VERSION_DATA =@AEGISUB_VERSION_DATA@
BUILD_DATE =@BUILD_DATE@
PACKAGE_DEBUG =@PACKAGE_DEBUG@
SVN_REVISION =@SVN_REVISION@
DEBUG_FLAGS =@DEBUG_FLAGS@
# OS X
BUNDLE_STRING =@BUNDLE_STRING@
DARWIN_ARCH =@DARWIN_ARCH@
DMG_STRING =@DMG_STRING@
GETTEXT_PACKAGE =@GETTEXT_PACKAGE@
#######
# PATHS
#######
P_PREFIX =@prefix@
prefix = ${P_PREFIX}
P_PREFIX_EXEC =@exec_prefix@
exec_prefix = ${P_PREFIX_EXEC}
P_BINDIR =@bindir@
P_SBINDIR =@sbindir@
P_LIBEXEC =@libexecdir@
P_DATAROOT =@datarootdir@
P_SYSCONF =@sysconfdir@
P_SHAREDSTATE =@sharedstatedir@
P_LOCALSTATE =@localstatedir@
P_INCLUDE =@includedir@
P_LIB =@libdir@
P_LOCALE =$(P_DATAROOT)/locale
P_DESKTOP =@P_DESKTOP@
P_ICON =@P_ICON@
P_DATA =$(P_DATAROOT)/aegisub/$(AEGISUB_VERSION_DATA)
P_DOC =$(P_DATAROOT)/doc/aegisub/$(AEGISUB_VERSION_DATA)
###############
# LIBRARY FLAGS
###############
CXXFLAGS_WX = @WX_CXXFLAGS@
CXXFLAGS_OPENMP = @OPENMP_CXXFLAGS@
CPPFLAGS_WX = @WX_CPPFLAGS@
CFLAGS_FONTCONFIG = @FONTCONFIG_CFLAGS@
CFLAGS_FREETYPE = @FREETYPE_CFLAGS@
CFLAGS_GL = @GL_CFLAGS@
CFLAGS_FFMPEGSOURCE = -I../libffms/include
CFLAGS_HUNSPELL = @HUNSPELL_CFLAGS@
CFLAGS_ICONV = @ICONV_CFLAGS@
CFLAGS_LIBASS = -I../libass
#CFLAGS_LIBASS = @LIBASS_CFLAGS@
CFLAGS_LIBAVCODEC = @LIBAVCODEC_CFLAGS@
CFLAGS_LIBAVFORMAT = @LIBAVFORMAT_CFLAGS@
CFLAGS_LIBAVUTIL = @LIBAVUTIL_CFLAGS@
CFLAGS_LIBCURL = @LIBCURL_CFLAGS@
CFLAGS_LIBPOSTPROC = @LIBPOSTPROC_CFLAGS@
CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@
CFLAGS_LIBSWSCALE = @LIBSWSCALE_CFLAGS@
CFLAGS_LUA = @LUA_CFLAGS@
CFLAGS_OPENAL = @OPENAL_CFLAGS@
CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@
CFLAGS_PTHREAD = @PTHREAD_CFLAGS@
CFLAGS_UCHARDET = -I../universalchardet
CFLAGS_WX = @WX_CFLAGS@
LDFLAGS_ALSA = @ALSA_LDFLAGS@
LDFLAGS_FONTCONFIG = @FONTCONFIG_LIBS@
LDFLAGS_FREETYPE = @FREETYPE_LIBS@
LDFLAGS_GL = @GL_LIBS@
LDFLAGS_FFMPEGSOURCE = ../libffms/libffmpegsource_aegisub.a
LDFLAGS_HUNSPELL = @HUNSPELL_LIBS@
LDFLAGS_ICONV = @ICONV_LDFLAGS@
LDFLAGS_LIBASS = ../libass/libass_aegisub.a
#LDFLAGS_LIBASS = @LIBASS_LIBS@
LDFLAGS_LIBAVCODEC = @LIBAVCODEC_LIBS@
LDFLAGS_LIBAVFORMAT = @LIBAVFORMAT_LIBS@
LDFLAGS_LIBAVUTIL = @LIBAVUTIL_LIBS@
LDFLAGS_LIBCURL = @LIBCURL_LIBS@
LDFLAGS_LIBPOSTPROC = @LIBPOSTPROC_LIBS@
LDFLAGS_LIBPULSE = @LIBPULSE_LIBS@
LDFLAGS_LIBSWSCALE = @LIBSWSCALE_LIBS@
LDFLAGS_LUA = @LUA_LDFLAGS@
LDFLAGS_OPENAL = @OPENAL_LIBS@
LDFLAGS_PTHREAD = @PTHREAD_LIBS@
LDFLAGS_PORTAUDIO = @PORTAUDIO_LIBS@
LDFLAGS_UCHARDET ?= ../universalchardet/libuniversalchardet.a
LDFLAGS_WX = @WX_LIBS@
#####################
# DEBUG / DEVELOPMENT
#####################
PRECOMPILED_HEADER = @enable_gcc_prec@
CCACHE_ENABLE = @enable_ccache@
LDFLAGS_CCMALLOC = @CCMALLOC_LDFLAGS@
LDFLAGS_DEBUG = @DEBUG_FLAGS@
LDFLAGS_EFENCE = @EFENCE_LDFLAGS@
LDFLAGS_GCOV = @GCOV_LDFLAGS@
CFLAGS_DEBUG = @DEBUG_FLAGS@
CFLAGS_EFENCE = @EFENCE_LDFLAGS@
CFLAGS_GCOV = @GCOV_CFLAGS@
##########
# 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

175
aegisub/Makefile.target Normal file
View file

@ -0,0 +1,175 @@
# *** THERE ARE NO USER-EDITABLE ITEMS HERE. ***
.PHONY: all install clean subdirs $(SUBDIRS)
all: subdirs $(LIB) $(LIB_SHARED) $(PROGRAM)
OBJ = $(addsuffix .o, $(basename $(SRC)))
DEP = $(addsuffix .d, $(basename $(SRC)))
###################
# PLATFORM SPECIFIC
###################
ifeq (yes, $(BUILD_DARWIN))
LIB_SHARED_LINK = $(LIB_SHARED_LINK_OSX)
endif
###########
# LIBRARIES
###########
$(LIB) : $(OBJ)
$(BIN_AR) cru $@ $(OBJ)
$(BIN_RANLIB) $@
ifdef LIB_SHARED
LIB_SHARED_FULL = $(LIB_SHARED).$(LIB_VERSION)
$(LIB_SHARED) : $(OBJ)
$(BIN_CXX) $(LIB_SHARED_LINK) $(OBJ) -o $(LIB_SHARED_FULL)
$(BIN_LN) -s $(LIB_SHARED_FULL) $(LIB_SHARED)
CLEANFILES+= $(LIB_SHARED_FULL)
endif
##########
# PROGRAMS
##########
$(PROGRAM): $(OBJ)
$(BIN_CXX) -o $@ $(LDFLAGS) $(OBJ) $(LDFLAGS_POST)
##########
# CLEANING
##########
clean: $(SUBDIRS)
$(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB) $(LIB_SHARED) $(PROGRAM)
distclean: clean
$(BIN_RM) -rf $(DISTCLEANFILES) $(DEP)
ifdef PRECOMPILED_HEADER_NAME
$(BIN_RM) -f $(PRECOMPILED_HEADER_NAME).gch
endif
#########
# INSTALL
#########
ifeq (install, $(MAKECMDGOALS))
INSTALL_LIB = $(addprefix $(P_LIB)/, $(LIB_SHARED) $(LIB_SHARED_FULL))
endif
install: $(SUBDIRS) install-share install-program install-lib
install-program:
ifdef PROGRAM_INSTALL
@$(BIN_MKDIR) -p $(P_BINDIR)
@$(BIN_INSTALL) $(PROGRAM) $(P_BINDIR)/$(PROGRAM)
endif
install-lib:
ifdef LIB_SHARED_INSTALL
$(BIN_MKDIR) -p $(P_LIB)
$(BIN_INSTALL) $(LIB_SHARED_FULL) $(P_LIB)/$(LIB_SHARED_FULL)
$(BIN_LN) -sf $(P_LIB)/$(LIB_SHARED_FULL) $(P_LIB)/$(LIB_SHARED)
endif
install-share:
ifdef DATA_SHARE
@$(BIN_MKDIR) -p $(addprefix $(P_DATA)/, $(dir $(DATA_SHARE)))
@for i in $(DATA_SHARE); do \
$(BIN_ECHO) "$(BIN_INSTALL) $$i $(P_DATA)/$$i"; \
$(BIN_INSTALL) $$i $(P_DATA)/$$i; \
done
endif
ifdef DATA_SHARE_DOC
@$(BIN_MKDIR) -p $(addprefix $(P_DOC)/, $(dir $(DATA_SHARE_DOC)))
@for i in $(DATA_SHARE_DOC); do \
$(BIN_ECHO) "$(BIN_INSTALL) $$i $(P_DOC)/$$i"; \
$(BIN_INSTALL) $$i $(P_DOC)/$$i; \
done
endif
##############
# DISTRIBUTION
##############
distdir:
@if ! test -f packages/distfile/distfile.sh; then \
echo "Please run this from the parent directory."; \
exit 1; \
fi
${SHELL} packages/distfile/distfile.sh
distfiles: $(SUBDIRS)
@for i in $(SRC) $(HEADER) $(EXTRA_DIST); do \
echo $(CURDIR)/$$i; \
done
########################
# SUBDIRECTORY TRAVERSAL
########################
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)
# Set relations to ensure dependencies are built before their targets during parallel builds.
src: universalchardet libass libffms tools libaegisub
tests: libaegisub
reporter: src
####################
# PRECOMPILED HEADER
####################
ifeq (yes, $(PRECOMPILED_HEADER))
ifdef PRECOMPILED_HEADER_NAME
CXXFLAGS += -include $(PRECOMPILED_HEADER_NAME) -Winvalid-pch -fpch-deps -fpch-preprocess
# This hack is required until we can use the 'private' keyword (gmake 3.82) to avoid all the
# per-object CXXFLAGS being triggered by the ($OBJ) line.
CXXFLAGS_GNU_MAKE_SUCKS := $(CXXFLAGS)
$(OBJ): | $(PRECOMPILED_HEADER_NAME).gch
$(PRECOMPILED_HEADER_NAME).gch: CXXFLAGS = $(CXXFLAGS_GNU_MAKE_SUCKS)
endif
endif
########
# CCACHE
########
ifeq (yes, $(CCACHE_ENABLE))
CXX_ENV = $(CCACHE_ENV)
BIN_CC := ccache $(BIN_CC)
BIN_CXX := ccache $(BIN_CXX)
endif
##################
# TRANSFORM RULES
##################
.SUFFIXES:
.SUFFIXES: .o .c .cpp .cxx
%.o: %.c
$(CXX_ENV) $(BIN_CC) $(CFLAGS_DEP) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
%.o: %.cxx
$(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
$(PRECOMPILED_HEADER_NAME).gch: $(PRECOMPILED_HEADER_NAME)
$(CXX_ENV) $(BIN_CXX) $(CXXFLAGS) $(DEBUG_FLAGS) $<
-include ($DEP)
.SUFFIXES:

View file

@ -10,21 +10,16 @@
# directly.
ACLOCAL=${ACLOCAL-aclocal-1.10}
LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOMAKE=${AUTOMAKE-automake-1.10}
AUTOCONF=${AUTOCONF-autoconf}
GETTEXTIZE=${GETTEXTIZE-glib-gettextize}
INTLTOOLIZE=${INTLTOOLIZE-intltoolize}
GLIB_REQUIRED_VERSION=2.10.0
AUTOCONF_REQUIRED_VERSION=2.54
AUTOMAKE_REQUIRED_VERSION=1.10
INTLTOOL_REQUIRED_VERSION=0.31
LIBTOOL_REQUIRED_VERSION=1.5
REQUIRED_M4="fontutil.m4 glib-gettext.m4 intltool.m4 intl.m4 pkg.m4 iconv.m4"
REQUIRED_M4="fontutil.m4 gettext.m4 pkg.m4 iconv.m4"
REQUIRED_M4_WX="wxwin29.m4 wxwin.m4"
PROJECT="aegisub"
@ -92,26 +87,6 @@ check_version ()
DIE=0
$ECHO_N "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
if ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1; then
LIBTOOLIZE=$LIBTOOLIZE
elif (glibtoolize --version) < /dev/null > /dev/null 2>&1; then
LIBTOOLIZE=glibtoolize
else
echo
echo " You must have libtool installed to compile $PROJECT."
echo " Install the appropriate package for your distribution,"
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
echo
DIE=1
fi
if test x$LIBTOOLIZE != x; then
VER=`$LIBTOOLIZE --version \
| grep libtool | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
check_version $VER $LIBTOOL_REQUIRED_VERSION
fi
$ECHO_N "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1; then
VER=`$AUTOCONF --version | head -n 1 \
@ -157,35 +132,6 @@ if test x$AUTOMAKE != x; then
fi
$ECHO_N "checking for $GETTEXTIZE ... "
if ($GETTEXTIZE --version) < /dev/null > /dev/null 2>&1; then
VER=`$GETTEXTIZE --version \
| grep glib-gettextize | sed "s/.* \([0-9.]*\)/\1/"`
check_version $VER $GLIB_REQUIRED_VERSION
else
echo
echo " You must have glib-gettextize installed to compile $PROJECT."
echo " glib-gettextize is part of glib-2.0, so you should already"
echo " have it. Make sure it is in your PATH."
echo
DIE=1
fi
$ECHO_N "checking for $INTLTOOLIZE >= $INTLTOOL_REQUIRED_VERSION ... "
if ($INTLTOOLIZE --version) < /dev/null > /dev/null 2>&1; then
VER=`$INTLTOOLIZE --version \
| grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
check_version $VER $INTLTOOL_REQUIRED_VERSION
else
echo
echo " You must have intltool installed to compile $PROJECT."
echo " Get the latest version from"
echo " ftp://ftp.gnome.org/pub/GNOME/sources/intltool/"
echo
DIE=1
fi
if test -z "$BIN_AWK"; then
BIN_AWK=`which awk`
fi
@ -274,24 +220,12 @@ if test $RC -ne 0; then
exit $RC
fi
echo "--- $LIBTOOLIZE ---"
$LIBTOOLIZE --force || exit $?
echo "--- $AUTOHEADER ---"
$AUTOHEADER || exit $?
echo "--- $AUTOMAKE ---"
$AUTOMAKE --add-missing || exit $?
echo "--- $AUTOCONF ---"
$AUTOCONF || exit $?
echo "--- $GETTEXTIZE ---"
$GETTEXTIZE --force || exit $?
echo "--- $INTLTOOLIZE ---"
$INTLTOOLIZE --force --automake || exit $?
cd $ORIGDIR
if ! test "$1" = "--skip-configure"; then

View file

@ -1,8 +1,7 @@
automationdir = $(aegisubdatadir)/automation
share_docdir = $(aegisubdocdir)
include ../Makefile.inc
# share/
data_auto4_lua = \
DATA_AUTOMATION += \
autoload/cleantags-autoload.lua \
autoload/kara-templater.lua \
autoload/karaoke-auto-leadin.lua \
@ -17,8 +16,7 @@ data_auto4_lua = \
# share/doc
data_general_doc = \
DATA_GENERAL_DOC = \
demos/raytracer-test1.ass \
v4-docs/basic-function-interface.txt \
v4-docs/configuration-dialogs.txt \
@ -29,27 +27,25 @@ data_general_doc = \
v4-docs/subtitle-data.txt \
v4-docs/template-scripting-ideas.ass
data_auto4_lua_doc = \
DATA_AUTOMATION_DOC += \
demos/future-windy-blur.lua \
demos/raytracer.lua
all: ;
nobase_share_doc_DATA =
nobase_automation_DATA =
if HAVE_AUTOMATION
nobase_automation_DATA += $(data_general)
nobase_share_doc_DATA += $(data_general_doc)
endif
if HAVE_AUTO4_LUA
nobase_automation_DATA += $(data_auto4_lua)
nobase_share_doc_DATA += $(data_auto4_lua_doc)
endif
install: install-share
@$(BIN_MKDIR) -p $(addprefix $(P_DATA)/automation/, $(dir $(DATA_AUTOMATION)))
@for i in $(DATA_AUTOMATION); do \
$(BIN_ECHO) "$(BIN_INSTALL) $$i $(P_DATA)/automation/$$i"; \
$(BIN_INSTALL) $$i $(P_DATA)/automation/$$i; \
done
DATA_SHARE_DOC = $(DATA_GENERAL_DOC) $(DATA_AUTOMATION_DOC)
EXTRA_DIST = \
$(data_general) \
$(data_auto4_lua) \
$(data_general_doc) \
$(data_auto4_lua_doc)
$(DATA_AUTOMATION) \
$(DATA_GENERAL_DOC) \
$(DATA_AUTOMATION_DOC)
include ../Makefile.target

1407
aegisub/config.guess vendored Executable file

File diff suppressed because it is too large Load diff

1504
aegisub/config.sub vendored Executable file

File diff suppressed because it is too large Load diff

View file

@ -38,7 +38,6 @@ m4_define([libass_required_version], [0.9.7])
#######
AC_INIT([Aegisub], [aegisub_version],, [aegisub])
AC_CONFIG_SRCDIR([src/main.cpp])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([acconf.h])
AC_GNU_SOURCE
AC_CANONICAL_HOST
@ -57,6 +56,11 @@ case x"$target" in
esac
AC_MSG_RESULT([$target_or_host])
build_darwin="no"
build_linux="no"
build_bsd="no"
build_default="no"
case "$target_or_host" in
*-*-darwin*)
build_darwin="yes"
@ -107,16 +111,11 @@ fi
# Used for universalchardet.
AC_AGI_MDCPUCFG($target_or_host)
AM_CONDITIONAL([BUILD_BSD], [test "$build_bsd" = "yes"])
AM_CONDITIONAL([BUILD_LINUX], [test "$build_linux" = "yes"])
# For conditional file building and options in Makefile(s).
AM_CONDITIONAL([BUILD_DARWIN], [test "$build_darwin" = "yes"])
AM_CONDITIONAL([BUILD_DEFAULT], [test "$build_default" = "yes"])
# FontConfig is used on Darwin for the fontlister, freetype for !Windows case.
AM_CONDITIONAL([FONTLISTER_FONTCONFIG], [test "$build_darwin" != "yes"])
AM_CONDITIONAL([FONTLISTER_FREETYPE], [test "$build_darwin" = "yes"])
AC_SUBST(build_bsd)
AC_SUBST(build_linux)
AC_SUBST(build_darwin)
AC_SUBST(build_default)
# Handle endianess.
AC_C_BIGENDIAN(
@ -142,25 +141,31 @@ AEGISUB_VERSION_DATA=aegisub_version_data
AC_DEFINE_UNQUOTED(AEGISUB_VERSION_DATA, ["$AEGISUB_VERSION_DATA"], [Data path suffix.])
AC_SUBST(AEGISUB_VERSION_DATA)
# Shared data and Documents location.
aegisubdatadir="$datadir/$PACKAGE/aegisub_version_data"
AC_SUBST(aegisubdatadir)
aegisubdocdir="$datadir/doc/$PACKAGE/aegisub_version_data"
AC_SUBST(aegisubdocdir)
# Name of aegisub binary.
AEGISUB_COMMAND="aegisub-$AEGISUB_VERSION_MAJOR.$AEGISUB_VERSION_MINOR"
AC_SUBST(AEGISUB_COMMAND)
# Handle location of desktop files: http://freedesktop.org/wiki/Specifications/desktop-entry-spec
AC_ARG_WITH(desktop-dir, [ --with-desktop-dir=PATH desktop file locations (default: PREFIX/share)])
AC_ARG_WITH(desktop-dir, [ --with-desktop-dir=PATH desktop file locations
(default: PREFIX/share/applications)])
if ! test -z "$with_desktop_dir" ; then
DESKTOP_DATADIR=$with_desktop_dir
P_DESKTOP=$with_desktop_dir
else
DESKTOP_DATADIR="$datadir"
P_DESKTOP="$datarootdir/applications"
fi
AM_CONDITIONAL(DESKTOP_DATADIR, test "$with_desktop_dir" != "no")
AC_SUBST(DESKTOP_DATADIR)
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, [ --with-icon-dir=PATH icon locations (default: PREFIX/share/icons)])
if ! test -z "$with_icon_dir" ; then
P_ICON=$with_icon_dir
else
P_ICON="$datarootdir/icons"
fi
AC_SUBST(P_ICON)
# Install prefix
@ -197,8 +202,8 @@ 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_LIBTOOL
AC_PROG_INSTALL
AC_PROG_RANLIB
PKG_PROG_PKG_CONFIG([pkgconfig_required_version])
@ -238,8 +243,8 @@ else
PACKAGE_VERSION="${PACKAGE_VERSION}-dev-r${SVN_REVISION}"
VERSION="${VERSION}-dev-r${SVN_REVISION}"
BUNDLE_STRING="Aegisub-${PACKAGE_VERSION}-dev-${SVN_REVISION}"
DMG_STRING="Aegisub-${PACKAGE_VERSION}-dev-${SVN_REVISION}-${arch_bundle}"
BUNDLE_STRING="Aegisub-${PACKAGE_VERSION}"
DMG_STRING="Aegisub-${PACKAGE_VERSION}-${arch_bundle}"
fi
@ -324,21 +329,22 @@ AC_C_VOLATILE
AC_CHECK_LIB([m], [main])
AC_CHECK_FUNC([strlcpy], [
AC_DEFINE([HAVE_STRLCPY], [1], [strlcpy() exists in the c library.])
AC_DEFINE([HAVE_STRLCPY], [1], [strlcpy() exists in the c library.])
], [])
AC_LIBTOOL_DLOPEN_SELF
AC_MSG_CHECKING([[whether preprocessor supports #pragma once]])
AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([[#pragma once]])],
[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PRAGMA_ONCE], [1], [Preprocessor support for #pragma once])
],
[AC_MSG_RESULT([no])])
#AC_LIBTOOL_DLOPEN_SELF
AX_OPENMP([], [with_openmp="no"])
AM_CONDITIONAL([HAVE_OPENMP], [test "$with_openmp" != "no"])
AC_AGI_COMPILE([pragma once], [pragma_once], [], [],[
#pragma once
int main(void) {}
])
if test "$agi_cv_pragma_once" = "no"; then
AC_MSG_FAILURE([Aegisub requires #pragma once to work correctly.])
fi
AX_OPENMP([with_openmp="yes"], [with_openmp="no"])
AC_SUBST(with_openmp)
AC_SUBST(OPENMP_CXXFLAGS)
AC_CHECK_HEADERS([sys/time.h])
@ -527,8 +533,7 @@ if test "$with_alsa" != "no"; then
AC_DEFINE(WITH_ALSA, 1, [Enable ALSA Support])
found_audio_player="yes"
fi
AM_CONDITIONAL([HAVE_ALSA], [test "$with_alsa" != "no"])
AC_SUBST(with_alsa)
AC_SUBST(ALSA_LDFLAGS)
@ -562,7 +567,7 @@ if test "$agi_cv_with_portaudio" = "yes" && test "$with_portaudio" = "yes"; then
found_audio_player="yes"
fi
AM_CONDITIONAL([HAVE_PORTAUDIO], [test "$with_portaudio" != "no"])
AC_SUBST(with_portaudio)
#############
@ -595,7 +600,7 @@ if test "$agi_cv_with_pulseaudio" = "yes" && test "$with_pulseaudio" = "yes"; th
found_audio_player="yes"
fi
AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "$with_pulseaudio" != "no"])
AC_SUBST(with_pulseaudio)
#########
@ -603,7 +608,14 @@ AM_CONDITIONAL([HAVE_PULSEAUDIO], [test "$with_pulseaudio" != "no"])
#########
AC_ARG_WITH(openal,[ --without-openal build without OpenAL audio provider.
(default: auto)], openal_disabled="(disabled)")
if test "$with_openal" != "no"; then
if test "$build_darwin" = "yes"; then
OPENAL_LIBS="-framework OpenAL"
OPENAL_CFLAGS=""
AC_SUBST(OPENAL_LIBS)
AC_SUBST(OPENAL_CFLAGS)
with_openal="yes"
elif test "$with_openal" != "no"; then
PKG_CHECK_MODULES(OPENAL, openal >= 0.0.8, [with_openal=yes], [with_openal=no])
fi
@ -635,7 +647,7 @@ if test "$agi_cv_with_openal" = "yes" && test "$with_openal" = "yes"; then
AC_DEFINE(WITH_OPENAL, 1, [Enable OpenAL support])
fi
AM_CONDITIONAL([HAVE_OPENAL], [test "$with_openal" != "no"])
AC_SUBST(with_openal)
######
@ -657,7 +669,7 @@ if test "$with_oss" != "no"; then
AC_DEFINE(WITH_OSS, 1, [Enable OSS support])
fi
AM_CONDITIONAL([HAVE_OSS], [test "$with_oss" != "no"])
AC_SUBST(with_oss)
#########################
@ -731,7 +743,7 @@ if test "$agi_cv_with_ffmpeg" = "no" || test "$with_ffmpeg" = "no"; then
with_ffmpeg="no"
fi
AM_CONDITIONAL([HAVE_FFMPEG], [test "$agi_cv_with_ffmpeg" = "yes"])
AC_SUBST(agi_cv_with_ffmpeg)
AC_SUBST(LIBAVFORMAT_LIBS)
AC_SUBST(LIBAVFORMAT_CFLAGS)
AC_SUBST(LIBAVCODEC_LIBS)
@ -772,7 +784,7 @@ else
with_provider_ffmpegsource="no"
fi
AM_CONDITIONAL([HAVE_PROVIDER_FFMPEGSOURCE], [test "$with_provider_ffmpegsource" = "yes"])
AC_SUBST(with_provider_ffmpegsource)
AC_SUBST(LIBPOSTPROC_LIBS)
AC_SUBST(LIBPOSTPROC_CFLAGS)
@ -786,6 +798,8 @@ AC_ARG_WITH(external-libass, [ --with-external-libass link to external libass
if test "$enable_libass" != "no"; then
if test "$with_external_libass" != "yes"; then
with_external_libass="no"
if test "$agi_cv_with_iconv" = "yes"; then
LIBASS_LIBS="-L../libass -lass_aegisub"
LIBASS_CFLAGS="-I../libass"
@ -805,28 +819,12 @@ else
with_libass="no"
fi
AM_CONDITIONAL([WITH_LIBASS], [test "$with_libass" = "yes"])
AM_CONDITIONAL([WITH_INTERNAL_LIBASS], [test "$with_libass" = "yes" && test "$with_external_libass" != "yes"])
AC_SUBST(with_libass)
AC_SUBST(with_external_libass)
AC_SUBST(LIBASS_LIBS)
AC_SUBST(LIBASS_CFLAGS)
AC_ARG_ENABLE(csri, [ --disable-csri disable CSRI (ASA) support (default=enabled)], csri_disabled="(disabled)")
if test "$enable_csri" != "no"; then
PKG_CHECK_MODULES(CSRI, csri >= 0.1.0, with_csri="yes", with_csri="no")
PKG_CHECK_MODULES(ASA, asa >= 0.3.2, with_asa="yes", with_asa="no")
if test "$with_csri" = "yes" && test "$with_asa" = "yes"; then
AC_DEFINE(WITH_CSRI, 1, [Enable CSRI (ASA) Subtitle Provider])
fi
else
with_csri="no"
fi
AM_CONDITIONAL([WITH_CSRI], [test "$with_csri" = "yes"])
###########
## Hunspell
###########
@ -853,7 +851,7 @@ if test "$agi_cv_with_hunspell" = "yes" && test "$with_hunspell" = "yes"; then
AC_DEFINE(WITH_HUNSPELL, 1, [Enable Hunspell support.])
fi
AM_CONDITIONAL([HAVE_HUNSPELL], [test "$with_hunspell" != "no"])
AC_SUBST(with_hunspell)
@ -894,14 +892,15 @@ fi
LIBS="$aegisub_save_LIBS"
if test "$agi_cv_with_lua" = "yes"; then
with_auto4="yes"
with_automation="yes"
with_auto4_lua="yes"
AC_DEFINE(WITH_AUTO4_LUA, 1, [Enable Automation (auto4), requires lua])
else
with_auto4="no"
with_automation="no"
with_auto4_lua="no"
fi
AM_CONDITIONAL([HAVE_AUTO4_LUA], [test "$with_auto4" != "no"])
AC_SUBST(with_auto4_lua)
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LDFLAGS)
@ -909,7 +908,7 @@ AC_SUBST(LUA_LDFLAGS)
if test "$with_automation" = "yes"; then
AC_DEFINE(WITH_AUTOMATION, 1, [Enable Automation support, requires any automation language.])
fi
AM_CONDITIONAL([HAVE_AUTOMATION], [test "$with_automation" = "yes"])
AC_SUBST(with_automation)
@ -972,7 +971,7 @@ if test "$enable_gcc_prec" = "yes"; then
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([PRECOMPILED_HEADER], [test "$enable_gcc_prec" = "yes"])
AC_SUBST(enable_gcc_prec)
######################################################
@ -1120,11 +1119,26 @@ if test "$enable_efence" = "yes" && test "$enable_ccmalloc" = "yes"; then
fi
########
# ccache
########
AC_MSG_CHECKING([whether to enable ccache])
AC_ARG_ENABLE(ccache, [ --enable-ccache enable ccache (default=no)])
if test "$enable_ccache" = "yes"; then
AC_MSG_RESULT([yes])
else
enable_ccache="no"
AC_MSG_RESULT([no])
fi
AC_SUBST(enable_ccache)
##############################
# Internationalisation support
##############################
AC_PROG_INTLTOOL
AM_GLIB_GNU_GETTEXT
# Avoid checking for config.rpath, we're not using automake.
define([AC_LIB_RPATH], [:])
AM_GNU_GETTEXT([external])
if test "$build_darwin" = "yes"; then
GETTEXT_PACKAGE="aegisub"
@ -1177,8 +1191,6 @@ if ! test -z "$with_provider_subtitle"; then
else
if test "$with_libass" = "yes"; then
default_provider_subtitle="libass"
elif test "$with_csri" = "yes"; then
default_provider_subtitle="csri"
fi
fi
AC_DEFINE_UNQUOTED([DEFAULT_PROVIDER_SUBTITLE], ["$default_provider_subtitle"], [Default Subtitle Provider.])
@ -1225,32 +1237,15 @@ fi
###############
# Misc settings
###############
AM_CONDITIONAL([FOUND_AUDIO_PLAYER], [test "$found_audio_player" = "yes"])
AM_CONDITIONAL([FOUND_VIDEO_PROVIDER], [test "$found_video_provider" = "yes"])
# Makefiles
AC_CONFIG_FILES([
Makefile
automation/Makefile
desktop/Makefile
libaegisub/Makefile
libass/Makefile
libffms/Makefile
po/Makefile.in
reporter/Makefile
src/Makefile
src/bitmaps/Makefile
src/libresrc/Makefile
tools/Makefile
universalchardet/Makefile
tests/Makefile
])
AC_SUBST(found_audio_player)
AC_SUBST(found_audio_provider)
AC_SUBST(found_video_provider)
# Files that need substitution.
AC_CONFIG_FILES([
desktop/aegisub.desktop
tools/osx-bundle.sed
Makefile.inc
])
AC_OUTPUT
@ -1305,7 +1300,7 @@ Default Settings
Audio Player: $default_player_audio
Scripting Engines
auto4 Lua: $with_auto4 $lua51_disabled
auto4 Lua: $with_auto4_lua $lua51_disabled
Audio Players
ALSA: $with_alsa $alsa_disabled
@ -1322,7 +1317,6 @@ A/V Providers
FFmpegSource: $with_provider_ffmpegsource $ffmpegsource_provider_disabled
Subtitle Providers:
CSRI (ASA): $with_csri $csri_disabled $csri_default
libASS $with_libass $libass_disabled $libass_default
(both require iconv and fontconfig)

View file

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 895 B

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

51
aegisub/desktop/Makefile Normal file
View file

@ -0,0 +1,51 @@
include ../Makefile.inc
applicationsdir = $(DESKTOP_DATADIR)/applications
applications_DATA = aegisub.desktop
iconsscalabledir = $(DESKTOP_DATADIR)/icons/hicolor/scalable/apps
iconsscalable_DATA = scalable/aegisub.svg
all: ;
ICON_HICOLOR = \
16x16/apps/aegisub.png \
22x22/apps/aegisub.png \
24x24/apps/aegisub.png \
32x32/apps/aegisub.png \
48x48/apps/aegisub.png \
64x64/apps/aegisub.png
ICON_SCALABLE = \
scalable/apps/aegisub.svg
DESKTOP_FILE = \
aegisub.desktop
EXTRA_DIST = \
aegisub.desktop.in \
$(ICON_HICOLOR) \
$(ICON_SCALABLE)
install: install-desktop install-icons
install-desktop:
@$(BIN_MKDIR) -p $(P_DESKTOP)
$(BIN_INSTALL) $(DESKTOP_FILE) $(P_DESKTOP)/$(DESKTOP_FILE)
install-icons:
@$(BIN_MKDIR) -p $(addprefix $(P_ICON)/hicolor/, $(dir $(ICON_HICOLOR)))
@for i in $(ICON_HICOLOR); do \
$(BIN_ECHO) "$(BIN_INSTALL) $$i $(P_ICON)/hicolor/$$i"; \
$(BIN_INSTALL) $$i $(P_ICON)/hicolor/$$i; \
done
$(BIN_TOUCH) $(P_ICON)/hicolor
$(BIN_MKDIR) -p $(P_ICON)/hicolor/scalable/apps
$(BIN_CP) $(ICON_SCALABLE) $(P_ICON)/hicolor/$(ICON_SCALABLE)
CLEANFILES = aegisub.desktop
include ../Makefile.target

View file

@ -1,45 +0,0 @@
if DESKTOP_DATADIR
applicationsdir = $(DESKTOP_DATADIR)/applications
applications_DATA = aegisub.desktop
iconsscalabledir = $(DESKTOP_DATADIR)/icons/hicolor/scalable/apps
iconsscalable_DATA = scalable/aegisub.svg
install-data-hook:
touch "$(DESTDIR)$(DESKTOP_DATADIR)/icons/hicolor"
icons16dir = $(DESKTOP_DATADIR)/icons/hicolor/16x16/apps
icons16_DATA = 16x16/aegisub.png
icons22dir = $(DESKTOP_DATADIR)/icons/hicolor/22x22/apps
icons22_DATA = 22x22/aegisub.png
icons24dir = $(DESKTOP_DATADIR)/icons/hicolor/24x24/apps
icons24_DATA = 24x24/aegisub.png
icons32dir = $(DESKTOP_DATADIR)/icons/hicolor/32x32/apps
icons32_DATA = 32x32/aegisub.png
icons48dir = $(DESKTOP_DATADIR)/icons/hicolor/48x48/apps
icons48_DATA = 48x48/aegisub.png
icons64dir = $(DESKTOP_DATADIR)/icons/hicolor/64x64/apps
icons64_DATA = 64x64/aegisub.png
endif
EXTRA_DIST = \
aegisub.desktop.in \
16x16/aegisub.png \
22x22/aegisub.png \
24x24/aegisub.png \
32x32/aegisub.png \
48x48/aegisub.png \
64x64/aegisub.png \
scalable/aegisub.svg
DISTCLEANFILES = aegisub.desktop

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

519
aegisub/install-sh Executable file
View file

@ -0,0 +1,519 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# 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.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# 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_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
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
no_target_directory=
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
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
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
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
trap '(exit $?); exit' 1 2 13 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 starting with `-'.
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
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# 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 -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
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-writeable 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 &&