diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 25 | ||||
-rw-r--r-- | scripts/xdt-autogen.in | 217 |
2 files changed, 242 insertions, 0 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..41b8478 --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,25 @@ +# $Id$ +# +# Copyright (c) 2002-2005 +# The Xfce development team. All rights reserved. +# +# Written for Xfce by Benedikt Meurer <benny@xfce.org>. +# + +bin_SCRIPTS = \ + xdt-autogen + +xdt-autogen: Makefile $(srcdir)/xdt-autogen.in + rm -f xdt-autogen xdt-autogen.gen + sed -e 's,\@DATADIR\@,$(datadir),g' \ + $(srcdir)/xdt-autogen.in \ + > xdt-autogen.gen + mv xdt-autogen.gen xdt-autogen + +CLEANFILES = \ + xdt-autogen + +EXTRA_DIST = \ + xdt-autogen.in + +# vi:set ts=8 sw=8 noet ai: diff --git a/scripts/xdt-autogen.in b/scripts/xdt-autogen.in new file mode 100644 index 0000000..f6cbb4b --- /dev/null +++ b/scripts/xdt-autogen.in @@ -0,0 +1,217 @@ +#!/bin/sh +# +# $Id$ +# +# Copyright (c) 2002-2005 +# The Xfce development team. All rights reserved. +# +# Written for Xfce by Benedikt Meurer <benny@xfce.org>. +# +# xdt-autogen - Part of the Xfce developer tools. +# + + +## +## Determine XDG data dirs +## +test -z "${XDG_DATA_HOME}" && XDG_DATA_HOME="${HOME}/.local/share" +test -z "${XDG_DATA_DIRS}" && XDG_DATA_DIRS="/usr/local/share:/usr/share" +test -d "@DATADIR@" && XDG_DATA_DIRS="@DATADIR@:${XDG_DATA_DIRS}" +XDG_DATA_DIRS="${XDG_DATA_HOME}:${XDG_DATA_DIRS}" +export XDG_DATA_DIRS XDG_DATA_HOME + + +## +## Search for the configure.{ac,in} file +## +SOURCE_DIR=`pwd`; test -z "${SOURCE_DIR}" && SOURCE_DIR="." +if test -f "${SOURCE_DIR}/configure.ac"; then + CONFIGURE_FILE="${SOURCE_DIR}/configure.ac"; +elif test -f "${SOURCE_DIR}/configure.in"; then + CONFIGURE_FILE="${SOURCE_DIR}/configure.in"; +else + cat >&2 <<EOF +xdt-autogen: Directory "${SOURCE_DIR}" does not look like a + top-level package directory. +EOF + exit 1 +fi + + +## +## Check for autoconf +## +test -z "${XDT_PROG_AUTOCONF}" && XDT_PROG_AUTOCONF="autoconf" +(${XDT_PROG_AUTOCONF} --version) </dev/null >/dev/null 2>&0 || { + cat >&2 <<EOF +xdt-autogen: You must have "autoconf" installed on your system. + Download the appropriate package for your distribution, + or get the source tarball at ftp://ftp.gnu.org/pub/gnu/. +EOF + exit 1 +} + + +## +## Check for libtoolize +## +test -z "${XDT_PROG_LIBTOOLIZE}" && XDT_PROG_LIBTOOLIZE="libtoolize" +if grep "^AC_PROG_LIBTOOL" "${CONFIGURE_FILE}" >/dev/null 2>&1; then + (${XDT_PROG_LIBTOOLIZE} --version) </dev/null >/dev/null 2>&0 || { + cat >&2 <<EOF +xdt-autogen: You must have "libtool" installed on your system. + Download the appropriate package for your distribution, + or get the source tarball at ftp://ftp.gnu.org/pub/gnu/. +EOF + exit 1 + } +fi + + +## +## Check for glib-gettextize +## +test -z "${XDT_PROG_GLIB_GETTEXTIZE}" && XDT_PROG_GLIB_GETTEXTIZE="glib-gettextize" +if test -d "${SOURCE_DIR}/po"; then + (${XDT_PROG_GLIB_GETTEXTIZE} --version) </dev/null >/dev/null 2>&1 || { + cat >&2 <<EOF +xdt-autogen: You must have "glib2" installed. You can get if from + ftp://ftp.gtk.org/pub/gtk/. +EOF + exit 1 + } +fi + + +## +## Check for gtkdocize +## +test -z "${XDT_PROG_GTKDOCIZE}" && XDT_PROG_GTKDOCIZE="gtkdocize" +if grep "^GTK_DOC_CHECK" "${CONFIGURE_FILE}" >/dev/null 2>&1; then + (${XDT_PROG_GTKDOCIZE} --version) </dev/null >/dev/null 2>&1 || { + cat >&2 <<EOF +xdt-autogen: You have "gtk-doc" installed. You can get if from + http://www.gtk.org/gtk-doc/. +EOF + exit 1 + } +fi + + +## +## Check for aclocal +## +test -z "${XDT_PROG_ACLOCAL}" && XDT_PROG_ACLOCAL="aclocal" +(${XDT_PROG_ACLOCAL} --version) </dev/null >/dev/null 2>&1 || { + cat >&2 <<EOF +xdt-autogen: You must have "autoconf" installed (which includes the + "aclocal" tool). You can get the source tarball at + ftp://ftp.gnu.org/pub/gnu/. +EOF + exit 1 +} + + +## +## Check for autoheader +## +test -z "${XDT_PROG_AUTOHEADER}" && XDT_PROG_AUTOHEADER="autoheader" +if grep "^AM_CONFIG_HEADER" "${CONFIGURE_FILE}" >/dev/null 2>&1; then + (${XDT_PROG_AUTOHEADER} --version) </dev/null >/dev/null 2>&1 || { + cat >&2 <<EOF +xdt-autogen: You must have "autoconf" installed (which includes the + "autoheader" tool). You can get the source tarball at + ftp://ftp.gnu.org/pub/gnu/. +EOF + exit 1 + } +fi + + +## +## Check for automake +## +test -z "${XDT_PROG_AUTOMAKE}" && XDT_PROG_AUTOMAKE="automake" +(${XDT_PROG_AUTOMAKE} --version) </dev/null >/dev/null 2>&1 || { + cat >&2 <<EOF +xdt-autogen: You must have "automake" installed on your system. + You can get the source tarball at + ftp://ftp.gnu.org/pub/gnu/. +EOF + exit 1 +} + + +## +## Check for configure flags +## +test -z "${XDT_CONFIGURE_FLAGS}" && XDT_CONFIGURE_FLAGS="--enable-maintainer-mode" +CONFIGURE_FLAGS="${XDT_CONFIGURE_FLAGS} $@" + + +## +## Check for aclocal flags +## +ACLOCAL_FLAGS="${ACLOCAL_FLAGS} ${XDT_ACLOCAL_FLAGS}" +test -d "${SOURCE_DIR}/m4macros" && ACLOCAL_FLAGS="${ACLOCAL_FLAGS} -I ${SOURCE_DIR}/m4macros" +test -d "${SOURCE_DIR}/m4" && ACLOCAL_FLAGS="${ACLOCAL_FLAGS} -I ${SOURCE_DIR}/m4" +for path in `echo "${XDG_DATA_DIRS}" | sed 's,:, ,g'`; do + if test -d "${path}/xfce4/dev-tools/m4macros"; then + ACLOCAL_FLAGS="${ACLOCAL_FLAGS} -I ${path}/xfce4/dev-tools/m4macros" + elif test -d "${path}/xfce4/dev-tools/m4"; then + ACLOCAL_FLAGS="${ACLOCAL_FLAGS} -I ${path}/xfce4/dev-tools/m4" + fi +done + + +## +## Do the real work(TM) +## +if test -d "${SOURCE_DIR}/po"; then + if test ! -f "${SOURCE_DIR}/aclocal.m4"; then + (echo "Creating ${SOURCE_DIR}/aclocal.m4..." && + echo "dnl Auto-generated by xdt-autogen" > "${SOURCE_DIR}/aclocal.m4") || exit 1 + fi + (echo "Running ${XDT_PROG_GLIB_GETTEXTIZE} --force --copy..." && + ${XDT_PROG_GLIB_GETTEXTIZE} --force --copy) || exit 1 + if test -f "${SOURCE_DIR}/aclocal.m4" -a ! -w "${SOURCE_DIR}/aclocal.m4"; then + (echo "Making ${SOURCE_DIR}/aclocal.m4 writable..." && + chmod u+w "${SOURCE_DIR}/aclocal.m4") || exit 1 + fi +fi + +if grep "^AC_PROG_LIBTOOL" "${CONFIGURE_FILE}" >/dev/null 2>&1; then + (echo "Running ${XDT_PROG_LIBTOOLIZE} --force --copy..." && + ${XDT_PROG_LIBTOOLIZE} --force --copy) || exit 1 +fi + +if grep "^GTK_DOC_CHECK" "${CONFIGURE_FILE}" >/dev/null 2>&1; then + (echo "Running ${XDT_PROG_GTKDOCIZE} --copy..." && + ${XDT_PROG_GTKDOCIZE} --copy) || exit 1 +fi + +(echo "Running ${XDT_PROG_ACLOCAL} ${ACLOCAL_FLAGS}..." && + ${XDT_PROG_ACLOCAL} ${ACLOCAL_FLAGS}) || exit 1 + +if grep "^AM_CONFIG_HEADER" "${CONFIGURE_FILE}" >/dev/null 2>&1; then + (echo "Running ${XDT_PROG_AUTOHEADER}..." && + ${XDT_PROG_AUTOHEADER}) || exit 1 +fi + +(echo "Running ${XDT_PROG_AUTOMAKE} --add-missing --copy --gnu..." && + ${XDT_PROG_AUTOMAKE} --add-missing --copy --gnu) || exit 1 + +(echo "Running ${XDT_PROG_AUTOCONF}..." && + ${XDT_PROG_AUTOCONF}) || exit 1 + + +## +## Run configure +## +(echo "Running ${SOURCE_DIR}/configure ${CONFIGURE_FLAGS}..." && + cd "${SOURCE_DIR}" && + ./configure ${CONFIGURE_FLAGS} && + echo "Now type \"make\" to compile.") || exit 1 + + +# vi:set ts=2 sw=2 et ai: |