improve autogen.sh script (fancy output, better gettext usage)
This commit is contained in:
parent
812ed965e9
commit
9d96e3ad33
79
autogen.sh
79
autogen.sh
@ -1,20 +1,63 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# gettextize updates Makefile.am, configure.in
|
###
|
||||||
cp configure.in configure.in.old
|
### common stuff
|
||||||
cp Makefile.am Makefile.am.old
|
###
|
||||||
if test "$1" = "--auto" ; then
|
OK="\\033[70G[\\033[1;32mOK\\033[1;00m]"
|
||||||
grep -v 'read dummy < /dev/tty' $(which gettextize) | /bin/sh -s -- --copy --force --intl --no-changelog
|
FAIL="\\033[70G[\\033[1;31mFAILED\\033[1;00m]"
|
||||||
else
|
|
||||||
gettextize --copy --force --intl --no-changelog
|
AUTOGEN_LOG=autogen.log
|
||||||
fi
|
|
||||||
mv Makefile.am.old Makefile.am
|
err ()
|
||||||
mv configure.in.old configure.in
|
{
|
||||||
libtoolize --automake --force --copy
|
echo "-------"
|
||||||
aclocal
|
echo "Error :"
|
||||||
# autoheader creates config.h.in needed by autoconf
|
echo "---8<-----------------------------------"
|
||||||
autoheader
|
cat $AUTOGEN_LOG
|
||||||
# autoconf creates configure
|
echo "----------------------------------->8---"
|
||||||
autoconf
|
exit 1
|
||||||
# automake creates Makefile.in
|
}
|
||||||
automake --add-missing --copy --gnu
|
|
||||||
|
run ()
|
||||||
|
{
|
||||||
|
echo -n "Running \"$@\""
|
||||||
|
eval $@ >$AUTOGEN_LOG 2>&1
|
||||||
|
if [ $? = 0 ] ; then
|
||||||
|
echo -e $OK
|
||||||
|
else
|
||||||
|
echo -e $FAIL
|
||||||
|
err
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
### cleanning part
|
||||||
|
###
|
||||||
|
# remove autotools stuff
|
||||||
|
run "rm -rf config"
|
||||||
|
run "rm -f config.h.in"
|
||||||
|
run "rm -f aclocal.m4 configure config.log config.status"
|
||||||
|
run "rm -rf autom4te*.cache"
|
||||||
|
# remove libtool stuff
|
||||||
|
run "rm -f libtool"
|
||||||
|
# remove gettext stuff
|
||||||
|
run "rm -f ABOUT-NLS"
|
||||||
|
run "rm -rf intl"
|
||||||
|
|
||||||
|
###
|
||||||
|
### configuration part
|
||||||
|
###
|
||||||
|
# create the config directory
|
||||||
|
run "mkdir -p config/m4"
|
||||||
|
run "mkdir intl"
|
||||||
|
|
||||||
|
# execute autotools cmds
|
||||||
|
run "autopoint -f"
|
||||||
|
run "libtoolize --automake --force --copy"
|
||||||
|
run "aclocal --force -I config/m4"
|
||||||
|
run "autoheader"
|
||||||
|
run "autoconf"
|
||||||
|
run "automake --add-missing --copy --gnu"
|
||||||
|
|
||||||
|
# ending
|
||||||
|
rm -f $AUTOGEN_LOG
|
||||||
|
@ -49,7 +49,8 @@ esac
|
|||||||
|
|
||||||
# Gettext
|
# Gettext
|
||||||
ALL_LINGUAS="fr es cs hu de ru"
|
ALL_LINGUAS="fr es cs hu de ru"
|
||||||
AM_GNU_GETTEXT
|
AM_GNU_GETTEXT([use-libtool])
|
||||||
|
AM_GNU_GETTEXT_VERSION([0.15])
|
||||||
|
|
||||||
# Checks for libraries
|
# Checks for libraries
|
||||||
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
|
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
|
||||||
|
@ -1,20 +1,63 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# gettextize updates Makefile.am, configure.in
|
###
|
||||||
cp configure.in configure.in.old
|
### common stuff
|
||||||
cp Makefile.am Makefile.am.old
|
###
|
||||||
if test "$1" = "--auto" ; then
|
OK="\\033[70G[\\033[1;32mOK\\033[1;00m]"
|
||||||
grep -v 'read dummy < /dev/tty' $(which gettextize) | /bin/sh -s -- --copy --force --intl --no-changelog
|
FAIL="\\033[70G[\\033[1;31mFAILED\\033[1;00m]"
|
||||||
else
|
|
||||||
gettextize --copy --force --intl --no-changelog
|
AUTOGEN_LOG=autogen.log
|
||||||
fi
|
|
||||||
mv Makefile.am.old Makefile.am
|
err ()
|
||||||
mv configure.in.old configure.in
|
{
|
||||||
libtoolize --automake --force --copy
|
echo "-------"
|
||||||
aclocal
|
echo "Error :"
|
||||||
# autoheader creates config.h.in needed by autoconf
|
echo "---8<-----------------------------------"
|
||||||
autoheader
|
cat $AUTOGEN_LOG
|
||||||
# autoconf creates configure
|
echo "----------------------------------->8---"
|
||||||
autoconf
|
exit 1
|
||||||
# automake creates Makefile.in
|
}
|
||||||
automake --add-missing --copy --gnu
|
|
||||||
|
run ()
|
||||||
|
{
|
||||||
|
echo -n "Running \"$@\""
|
||||||
|
eval $@ >$AUTOGEN_LOG 2>&1
|
||||||
|
if [ $? = 0 ] ; then
|
||||||
|
echo -e $OK
|
||||||
|
else
|
||||||
|
echo -e $FAIL
|
||||||
|
err
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
### cleanning part
|
||||||
|
###
|
||||||
|
# remove autotools stuff
|
||||||
|
run "rm -rf config"
|
||||||
|
run "rm -f config.h.in"
|
||||||
|
run "rm -f aclocal.m4 configure config.log config.status"
|
||||||
|
run "rm -rf autom4te*.cache"
|
||||||
|
# remove libtool stuff
|
||||||
|
run "rm -f libtool"
|
||||||
|
# remove gettext stuff
|
||||||
|
run "rm -f ABOUT-NLS"
|
||||||
|
run "rm -rf intl"
|
||||||
|
|
||||||
|
###
|
||||||
|
### configuration part
|
||||||
|
###
|
||||||
|
# create the config directory
|
||||||
|
run "mkdir -p config/m4"
|
||||||
|
run "mkdir intl"
|
||||||
|
|
||||||
|
# execute autotools cmds
|
||||||
|
run "autopoint -f"
|
||||||
|
run "libtoolize --automake --force --copy"
|
||||||
|
run "aclocal --force -I config/m4"
|
||||||
|
run "autoheader"
|
||||||
|
run "autoconf"
|
||||||
|
run "automake --add-missing --copy --gnu"
|
||||||
|
|
||||||
|
# ending
|
||||||
|
rm -f $AUTOGEN_LOG
|
||||||
|
@ -49,7 +49,8 @@ esac
|
|||||||
|
|
||||||
# Gettext
|
# Gettext
|
||||||
ALL_LINGUAS="fr es cs hu de ru"
|
ALL_LINGUAS="fr es cs hu de ru"
|
||||||
AM_GNU_GETTEXT
|
AM_GNU_GETTEXT([use-libtool])
|
||||||
|
AM_GNU_GETTEXT_VERSION([0.15])
|
||||||
|
|
||||||
# Checks for libraries
|
# Checks for libraries
|
||||||
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
|
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user