Skip to content

Commit

Permalink
Some improvements in autotools
Browse files Browse the repository at this point in the history
But couldn't find how put translations working with intltoolize ...
  • Loading branch information
sergiomb2 committed May 9, 2016
1 parent 88aa023 commit bc71f47
Show file tree
Hide file tree
Showing 42 changed files with 71,167 additions and 66,612 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SUBDIRS =

if COMPILE_NLS
SUBDIRS += intl po
SUBDIRS += po
endif

SUBDIRS += docs src unittests
Expand Down
56 changes: 3 additions & 53 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
# Helps bootstrapping 'aMule' when checked out from the source control system.
# Requires GNU autoconf, GNU automake and GNU which.
# Requires GNU autoconf, GNU automake, intltool and GNU which.

WANT_AUTOMAKE="1.9"
export WANT_AUTOMAKE
Expand All @@ -24,61 +24,11 @@ if expr "$WANT_AUTOMAKE" \> "$automake_version" >/dev/null; then
exit 1
fi

# Determine version of gettext.
gettext_version=`gettext --version | head -n 1 | sed -e 's/[^0]*\(0\.[0-9][^ ]*\).*/\1/'`
confver=`cat configure.in | grep '^AM_GNU_GETTEXT_VERSION(' | sed -e 's/^AM_GNU_GETTEXT_VERSION(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`

# Require version as specified in configure.in.
if expr "$confver" \> "$gettext_version" >/dev/null; then
gettext --version | head -n 1
echo "Fatal error: gettext version "$confver" or higher is required."
exit 1
fi

# Force intl regenration to get last update from installed gettext templates
rm -rf intl/*
#if [ ! -d intl ]; then
echo "Setting up internationalization files."
autopoint --force
if grep -q datarootdir po/Makefile.in.in; then
echo autopoint honors dataroot variable, not patching.
else
echo autopoint does not honor dataroot variable, patching.
sed -e '/^datadir *=/a\
datarootdir = @datarootdir@' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
sed -e '/^datadir *=/a\
datarootdir = @datarootdir@' intl/Makefile.in > intl/Makefile.in.tmp && mv -f intl/Makefile.in.tmp intl/Makefile.in
fi
UNAME=`uname`
if [ x$UNAME = x"Darwin" ]; then
echo Not patching po/Makefile.in.in - sed is too old.
else
sed -e '/^clean:/a\
rm -f *.gmo' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
fi
# if [ -f Makefile -a -x config.status ]; then
# CONFIG_FILES=intl/Makefile CONFIG_HEADERS= /bin/sh ./config.status
# fi
# gettextize --intl -f --no-changelog
# echo "restoring Makefile.am and configure.in"
# cp -f Makefile.am~ Makefile.am
# cp -f configure.in~ configure.in
#fi

echo "Running aclocal -I m4"
aclocal -I m4

echo "Running autoheader"
autoheader

echo "Running autoconf"
autoconf

echo "Creating pixmaps Makefile.am"
OLDPWD="`pwd`"
cd src/pixmaps/flags_xpm
./makeflags.sh
cd "$OLDPWD"

echo "Running automake --foreign -a -c -f"
automake --foreign -a -c -f
echo "Running autoreconf --install"
autoreconf --install
12 changes: 8 additions & 4 deletions configure.in → configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

AC_INIT([aMule],[SVN],[[email protected]])
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([subdir-objects foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])

AC_PREREQ(2.59)
Expand Down Expand Up @@ -75,7 +75,7 @@ MULE_ARG_ENABLE([webserver], [no], [compile aMule WebServer], [WEB])
MULE_ARG_ENABLE([amule-gui], [no], [compile aMule remote GUI], [AMULE_GUI])
MULE_ARG_ENABLE([cas], [no], [compile C aMule Statistics], [CAS])
MULE_ARG_ENABLE([wxcas], [no], [compile aMule GUI Statistics], [WXCAS])
MULE_ARG_ENABLE([ed2k], [yes], [don't compile aMule ed2k links handler], [ED2K])
MULE_ARG_ENABLE([ed2k], [yes], [dont compile aMule ed2k links handler], [ED2K])
MULE_ARG_ENABLE([alc], [no], [compile aMuleLinkCreator GUI version], [ALC])
MULE_ARG_ENABLE([alcc], [no], [compile aMuleLinkCreator for console], [ALCC])
MULE_ARG_ENABLE([xas], [no], [install xas XChat2 plugin], [XAS])
Expand All @@ -94,7 +94,7 @@ QT_CONFIG_OPTIONS
AC_ARG_WITH(
[gnu-malloc],
[AS_HELP_STRING([--without-gnu-malloc],
[Don't assume that we use GNU libc compatible malloc/realloc when cross-compiling])],
[Dont assume that we use GNU libc compatible malloc/realloc when cross-compiling])],
[gnumalloc=$withval], [gnumalloc=yes])


Expand Down Expand Up @@ -331,6 +331,11 @@ AC_LANG_POP([C++])
dnl Sets gettext version.
dnl AM_GNU_GETTEXT_VERSION *must not* be moved away from configure.in!
AM_GNU_GETTEXT_VERSION(0.11.5)
AM_GNU_GETTEXT([external])
#IT_PROG_INTLTOOL
#GETTEXT_PACKAGE="amule"
#AC_SUBST(GETTEXT_PACKAGE)
#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])
MULE_CHECK_NLS
AC_LANG_PUSH([C++])

Expand Down Expand Up @@ -465,7 +470,6 @@ dnl Generate the Makefiles
AC_CONFIG_FILES([Makefile
docs/Makefile
docs/man/Makefile
intl/Makefile
po/Makefile.in
src/Makefile
src/pixmaps/Makefile
Expand Down
1 change: 0 additions & 1 deletion m4/nls.m4
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ AC_DEFUN([MULE_CHECK_NLS],
[Specify a comma-separated list of languages you want to have installed. See po/LINGUAS for available languages])],
[AS_IF([test "$withval" != "all"], [LINGUAS="`echo $withval | sed -e 's/,/ /g'`"])])
AM_GNU_GETTEXT([no-libtool], [need-ngettext])
AS_IF([test $USE_INCLUDED_LIBINTL = yes], [INCINTL=-I\${top_builddir}/intl])
AS_IF([test x$USE_NLS = xyes], [MULE_CHECK_AUTOPOINT(, [USE_NLS=no])])
Expand Down
Loading

0 comments on commit bc71f47

Please sign in to comment.