summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2021-12-02 23:52:36 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2021-12-02 23:52:36 +0900
commit2bc47f09832073c87ccdf1060bd93ff95878685a (patch)
tree77fdd40c4d9e8bb6854f6cc4498b07f39aa095a3
parentbe179342cc6273abb8710546a18e80afd69f3e86 (diff)
downloadibus-2bc47f09832073c87ccdf1060bd93ff95878685a.tar.gz
autogen: Delete gnome-autogen dependency
You may like to call ./autogen.sh --enable-gtk-doc with your custom configure options. Also set SAVE_DIST_FILE=1 by default
-rw-r--r--.travis.yml7
-rwxr-xr-xautogen.sh96
-rw-r--r--src/Makefile.am18
3 files changed, 80 insertions, 41 deletions
diff --git a/.travis.yml b/.travis.yml
index b9aa9e43..8dbff129 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,13 +19,11 @@ arch:
addons:
apt:
packages:
- # For autogen.sh
- - gnome-common
- - gtk-doc-tools
# For make from
# https://packages.ubuntu.com/search?searchon=sourcenames&keywords=ibus
- desktop-file-utils
- gobject-introspection
+ - gtk-doc-tools
- iso-codes
- libdconf-dev
- libgirepository1.0-dev
@@ -47,7 +45,7 @@ jobs:
before_script:
- sudo apt-get -qq update
env:
- - SAVE_DIST_FILES=1
+ - SAVE_DIST_FILES=0
script:
- set -e
- git config pull.rebase false
@@ -56,6 +54,7 @@ jobs:
# https://salsa.debian.org/debian/ibus/-/blob/master/debian/rules
- >
./autogen.sh
+ --enable-gtk-doc
--with-python=/usr/bin/python3
--with-ucd-dir='/usr/share/unicode'
--enable-install-tests
diff --git a/autogen.sh b/autogen.sh
index ea633e06..1acbf705 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,22 +1,47 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-PKG_NAME="ibus"
-DIST_FILES="
-engine/simple.xml.in
-src/ibusemojigen.h
-src/ibusunicodegen.h
-"
+: ${srcdir=$(dirname $0)}
+: ${srcdir:=.}
+: ${SAVE_DIST_FILES:=0}
+
+olddir=$(pwd)
+# shellcheck disable=SC2016
+PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
+WANT_GTK_DOC=0
+GCC_VERSION=$(gcc --version | head -1 | awk '{print $3}')
+GCC_MAJOR_VERSION=$(echo "$GCC_VERSION" | awk -F. '{print $1}')
FEDORA_PKG1='autoconf automake libtool gettext-devel'
FEDORA_PKG2='glib2-devel gtk2-devel gtk3-devel
wayland-devel'
FEDORA_PKG3='cldr-emoji-annotation iso-codes-devel unicode-emoji unicode-ucd
xkeyboard-config-devel'
-(test -z "$DISABLE_INSTALL_PKGS") && {
+CFLAGS=${CFLAGS-"-Wall -Wformat -Werror=format-security"}
+(test $GCC_MAJOR_VERSION -ge 10) && {
+ CFLAGS="$CFLAGS -fanalyzer -fsanitize=address -fsanitize=leak"
+ FEDORA_PKG1="$FEDORA_PKG1 libasan"
+}
+
+cd "$srcdir"
+
+(test -f configure.ac \
+ && test -f README ) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+}
+
+(test $(grep -q "^GTK_DOC_CHECK" configure.ac)) || {
+ WANT_GTK_DOC=1
+ FEDORA_PKG2="$FEDORA_PKG2 gtk-doc"
+}
+
+(test -f ChangeLog) || {
+ touch ChangeLog
+}
+
+(test "x$DISABLE_INSTALL_PKGS" = "x") && {
(test -f /etc/fedora-release ) && {
rpm -q $FEDORA_PKG1 || exit 1
rpm -q $FEDORA_PKG2 || exit 1
@@ -27,30 +52,39 @@ FEDORA_PKG3='cldr-emoji-annotation iso-codes-devel unicode-emoji unicode-ucd
}
}
-(test -f $srcdir/configure.ac \
- && test -f $srcdir/README ) || {
- echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
- echo " top-level $PKG_NAME directory"
- exit 1
-}
-
-which gnome-autogen.sh || {
- echo "Not found gnome-autogen.sh. You may need to install gnome-common"
- exit 1
+CONFIGFLAGS="$@"
+(test "$#" = 0 -a "x$NOCONFIGURE" = "x" ) && {
+ echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
+ echo "*** If you wish to pass any to it, please specify them on the" >&2
+ echo "*** '$0' command line." >&2
+ echo "" >&2
+ (test $WANT_GTK_DOC -eq 1) && CONFIGFLAGS="--enable-gtk-doc $@"
}
-(test -f $srcdir/ChangeLog) || {
- touch $srcdir/ChangeLog
-}
+(test $WANT_GTK_DOC -eq 1) && gtkdocize --copy
-CFLAGS=${CFLAGS-"-Wall -Wformat -Werror=format-security"}
+ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" REQUIRED_AUTOMAKE_VERSION=1.11 \
+autoreconf --verbose --force --install || exit 1
-# need --enable-gtk-doc for gnome-autogen.sh to make dist
-ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" REQUIRED_AUTOMAKE_VERSION=1.11 CFLAGS="$CFLAGS" . gnome-autogen.sh "$@"
+cd "$olddir"
+(test "x$NOCONFIGURE" = "x" ) && {
+ echo "$srcdir/configure $CONFIGFLAGS"
+ $srcdir/configure $CONFIGFLAGS || exit 1
+ (test "$1" = "--help" ) && {
+ exit 0
+ } || {
+ echo "Now type 'make' to compile $PKG_NAME" || exit 1
+ }
+} || {
+ echo "Skipping configure process."
+}
-(test -z "$SAVE_DIST_FILES") && {
- for f in $DIST_FILES ; do
- echo "rm $f"
- rm $f
- done
+cd "$srcdir"
+(test "x$SAVE_DIST_FILES" = "x0" ) && {
+ # rm engine/simple.xml.in src/ibusemojigen.h src/ibusunicodegen.h
+ for d in engine src; do
+ echo "make -C $d maintainer-clean-generic"
+ make -C $d maintainer-clean-generic
+ done
} || :
+cd "$olddir"
diff --git a/src/Makefile.am b/src/Makefile.am
index 742ee7d7..578694b5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,7 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2015-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
@@ -296,8 +296,8 @@ dicts/emoji-%.dict: emoji-parser
echo "Skip $$plus_comment $@"; \
fi;
-ibusemojigen.h: dicts/emoji-en.dict
- $(NULL)
+ibusemojigen.h:
+ $(MAKE) $(AM_MAKEFLAGS) dicts/emoji-en.dict
# We put dicts/emoji-%.dict as the make target for the parallel build
# and the make target has to be genarated even if the file size is zero.
@@ -364,8 +364,8 @@ dicts/unicode-blocks.dict: unicode-parser
echo "Generated $@"; \
fi;
-ibusunicodegen.h: dicts/unicode-blocks.dict
- $(NULL)
+ibusunicodegen.h:
+ $(MAKE) $(AM_MAKEFLAGS) dicts/unicode-blocks.dict
unicode_parser_SOURCES = \
unicode-parser.c \
@@ -398,9 +398,15 @@ CLEANFILES += \
stamp-ibusenumtypes.h \
$(NULL)
-DISTCLEANFILES = \
+MAINTAINERCLEANFILES = \
ibusemojigen.h \
ibusunicodegen.h \
+ dicts/emoji-en.dict \
+ dicts/unicode-blocks.dict \
+ $(NULL)
+
+DISTCLEANFILES = \
+ $(MAINTAINERCLEANFILES) \
ibusversion.h \
$(NULL)