diff options
-rw-r--r-- | Makefile.in | 24 | ||||
-rw-r--r-- | TODO | 22 | ||||
-rwxr-xr-x | autoconf/install-sh | 276 | ||||
-rwxr-xr-x | autogen.sh | 4 | ||||
-rw-r--r-- | configure.ac | 286 | ||||
-rw-r--r-- | rules/Kconfig.in | 2 | ||||
-rw-r--r-- | scripts/ptxdistvars.sh | 15 | ||||
-rw-r--r-- | scripts/ptxdistvars.sh.in | 13 |
8 files changed, 602 insertions, 40 deletions
diff --git a/Makefile.in b/Makefile.in index e13017c67..6e71f9d4d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,16 +1,18 @@ -prefix=@PREFIX@ -topdir=@TOPDIR@ -instdir=@INSTDIR@ -version=@VERSION@ +prefix := @prefix@ +abs_srcdir := @abs_srcdir@ +libdir := ${prefix}/lib +bindir := ${prefix}/bin +version := @PACKAGE_VERSION@ +instdir := ${libdir}/ptxdist-${version} all: @echo "building lxdialog..." - cp ${topdir}/scripts/ptx-modifications/Makefile.lxdialog.ptx ${topdir}/scripts/lxdialog/Makefile - cd ${topdir}/scripts/lxdialog && make + cp ${abs_srcdir}/scripts/ptx-modifications/Makefile.lxdialog.ptx ${abs_srcdir}/scripts/lxdialog/Makefile + cd ${abs_srcdir}/scripts/lxdialog && make @echo "building conf..." - cd ${topdir}/scripts/kconfig && make conf + cd ${abs_srcdir}/scripts/kconfig && make conf @echo "building mconf..." - cd ${topdir}/scripts/kconfig && make mconf + cd ${abs_srcdir}/scripts/kconfig && make mconf @echo "done." @touch .done @@ -21,7 +23,7 @@ install: all @test -d ${DESTDIR}${instdir} || exit 1 @touch ${DESTDIR}${instdir} || exit 1 @echo "installing PTXdist to ${DESTDIR}${prefix}/bin..." - tar -C ${topdir} -cf - --exclude .svn --exclude state --exclude debian . | tar -C ${DESTDIR}${instdir} -xvf - + tar -C ${abs_srcdir} -cf - --exclude .svn --exclude state --exclude debian . | tar -C ${DESTDIR}${instdir} -xvf - @mkdir -p ${DESTDIR}${prefix}/bin @rm -f ${DESTDIR}${prefix}/bin/ptxdist @ln -sf ${instdir}/bin/ptxdist ${DESTDIR}${prefix}/bin/ptxdist-${version} @@ -63,4 +65,8 @@ deb: distclean: clean rm -fr build-stamp rm -fr debian/ptxdist + rm -fr config.log config.status autom4te.cache + +maintainer-clean: distclean + rm -f configure @@ -1,8 +1,11 @@ -TODO for PTXdist 0.10 Series -============================ +TODO for PTXdist 0.10 Series - High Priority +============================================ +[ ] add prerequisite checks to configure script; find out which + prerequisites we really need. +[ ] check if ${PTXCONF_PREFIX} can be written to and barf if not [ ] add sanity checks for all user configurable variables (especially - pathes) + paths) [ ] audit project files for CROSS_AUTOCONF [ ] Problem: When doing things like "PKG_CONFIG_PATH=bla something", something does not inherit the environment variable PKG_CONFIG_PATH. @@ -124,11 +127,6 @@ Current TODO List [ ] JBE: more help texts -[ ] RSC: Test on SuSE 10.0: the following packets have to be installed: - - ncurses-dev - - bison - - ipkg for the host needs python distutils - [ ] RSC: make projects doesn't find local_projects/something, if something is a softlink and not a directory. @@ -138,8 +136,6 @@ Current TODO List [ ] RSC: in NATIVE=1 mode libpthread.so.0 is not copied; find out why -[ ] RSC: write back .config after make menuconfig (with oldconfig applied) - [ ] MKL: let get stages depend on the actual makefile [ ] RSC: Finish autotoolisation of chrony. The old features from the @@ -153,8 +149,6 @@ Current TODO List [ ] RSC:is "select GLIBC_DEBUG" in gdb.in necessary?? -[ ] RSC:check bash (doesn't compile according to Lisa Hsu) - [ ] sandeep: add a script to setup a new project interactively [ ] RSC: do module stuff in kernel only when modules are enabled @@ -201,9 +195,7 @@ Current TODO List [ ] MKL: test betaftp, old breaks due to a patch from DKE -[ ] MKL: test qte, wxwindows - -[ ] MKL: teach qte to crosscompile +[ ] MKL: test wxwindows [ ] MKL: gawk fix prefix, due to hard coded path diff --git a/autoconf/install-sh b/autoconf/install-sh new file mode 100755 index 000000000..36f96f3e0 --- /dev/null +++ b/autoconf/install-sh @@ -0,0 +1,276 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# 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. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "$0: no input file specified" >&2 + exit 1 +else + : +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d "$dst" ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f "$src" ] || [ -d "$src" ] + then + : + else + echo "$0: $src does not exist" >&2 + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "$0: no destination specified" >&2 + exit 1 + else + : + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d "$dst" ] + then + dst=$dst/`basename "$src"` + else + : + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' + ' +IFS="${IFS-$defaultIFS}" + +oIFS=$IFS +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS=$oIFS + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp=$pathcomp$1 + shift + + if [ ! -d "$pathcomp" ] ; + then + $mkdirprog "$pathcomp" + else + : + fi + + pathcomp=$pathcomp/ +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd "$dst" && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename "$dst"` + else + : + fi + +# Make a couple of temp file names in the proper directory. + + dsttmp=$dstdir/#inst.$$# + rmtmp=$dstdir/#rm.$$# + +# Trap to clean up temp files at exit. + + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + +# Move or copy the file name to the temp name + + $doit $instcmd "$src" "$dsttmp" && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && + +# Now remove or move aside any old file at destination location. We try this +# two ways since rm can't unlink itself on some systems and the destination +# file might be busy for other reasons. In this case, the final cleanup +# might fail but the new file should still install successfully. + +{ + if [ -f "$dstdir/$dstfile" ] + then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || + $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || + { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi +} && + +# Now rename the file to the real destination. + + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + +fi && + +# The final little trick to "correctly" pass the exit status to the exit trap. + +{ + (exit 0); exit +} diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 000000000..8a7b0208b --- /dev/null +++ b/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +autoconf + diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..60b1ae5ac --- /dev/null +++ b/configure.ac @@ -0,0 +1,286 @@ +dnl +dnl Process this file with autoconf to produce a configure script. +dnl Most parts of this configure script have been borrowed from quilt. +dnl +dnl FIXME: how to have the version number only in one place? +dnl + +AC_INIT([ptxdist],[0.10.2-svn],[ptxdist@pengutronix.de]) +AC_CONFIG_AUX_DIR(autoconf) +AC_PREREQ(2.59) +AC_REVISION ($Revision: 1.38 $) + +PACKAGE_RELEASE=1 +AC_SUBST(PACKAGE_RELEASE) + +dnl +dnl Check header files, mostly for lxdialog & kconfig +dnl + +AC_HEADER_STDC +AC_CHECK_HEADER( + [ncurses.h], + [], + AC_MSG_ERROR([Cannot find ncurses.h. Please install the ncurses development packet.]) +) + +AC_PROG_INSTALL + +AC_SYS_INTERPRETER +if test "$interpval" != yes ; then + AC_MSG_WARN([no + +bash scripts may not be invoked correctly due to problems with your +systems implementation of #! being either broken or non-existant. +]) +fi + +dnl Check for Bourne-Again Shell +unset BASH # bash sets this itself! +AC_ARG_WITH(bash, AC_HELP_STRING( + [--with-bash], [name of the bash executable to use]), + [ + BASH="$withval" + AC_SUBST(BASH) + AC_MSG_NOTICE([Using bash executable $BASH]) + ],[ + AC_PATH_PROG(BASH, bash) + ]) +if test -z "$BASH" ; then + AC_MSG_ERROR([Please specify the location of bash with the option '--with-bash']) +fi + +# It would be nice not to have to use backticks, but too many retarded sh +# implementations still don't support $( ) +# BEWARE: There is a distinct possibility that we are currently running under +# bash in this configure script (/bin/sh being a symlink to /bin/bash). Even +# though the result /could/ be available to us directly as $BASH_VERSION we +# don't want to use, or trust it, incase the user is specifying a different +# bash executable. +if `$BASH -c '[[ "$BASH_VERSION" \< "2.04" ]]'` ; then + AC_MSG_ERROR([ +$PACKAGE_NAME requires at least version 2.04 of bash, you can download a current +version of bash from ftp.gnu.org +]) +fi + +dnl Check for sed +dnl FIXME: which version do we need and how do we find out if it +dnl supports inplace? +AC_ARG_WITH(sed, AC_HELP_STRING( + [--with-sed], [name of the sed executable to use]), + [ + SED="$withval" + AC_SUBST(SED) + AC_MSG_NOTICE([Using sed executable $SED]) + ],[ + SED="sed" + AC_SUBST(SED) + ]) + +dnl Check for awk +AC_ARG_WITH(awk, AC_HELP_STRING( + [--with-awk], [name of the awk executable to use]), + [ + AWK="$withval" + AC_SUBST(AWK) + AC_MSG_NOTICE([Using awk executable $AWK]) + ],[ + AC_PATH_PROGS(AWK, [gawk awk]) + ]) + +dnl Test for awk features that may be mising? + +dnl Checks for mktemp (for creating temporary files and directories) +AC_ARG_WITH(mktemp, AC_HELP_STRING( + [--with-mktemp], [name of the mktemp executable to use (or 'none' + to use a quilt internal mechanism)]), + [ + MKTEMP="$withval" + AC_SUBST(MKTEMP) + AC_MSG_NOTICE([Using mktemp executable $MKTEMP]) + ],[ + AC_PATH_PROG(MKTEMP, mktemp) + ]) +if test -z "$MKTEMP" -o "$MKTEMP" = "none" ; then + MKTEMP=internal_mktemp +else + AC_MSG_CHECKING(whether $MKTEMP -d works) + if tempdir=`$MKTEMP -d /tmp/$PACKAGE_NAME.XXXXXX 2>/dev/null` && \ + rmdir "$tempdir" ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + AC_MSG_ERROR([ +'$MKTEMP -d' does not create temporary directories. +If you don't have a version of mktemp that can create directories, you +can specify '--with-mktemp=none' and $PACKAGE_NAME will use its own +internal tempfile generation mechanism. +]) + fi +fi + +dnl +dnl Checks for python, needed for ipkg-utils +dnl +AC_ARG_WITH(python, AC_HELP_STRING( + [--with-python], [name of the python executable to use]), + [ + PYTHON="$withval" + AC_SUBST(PYTHON) + AC_MSG_NOTICE([Using python executable $PYTHON]) + ],[ + PYTHON="python" + AC_SUBST(PYTHON) + ]) +dnl +dnl We need the Python distutils +dnl +AC_MSG_CHECKING(whether $PYTHON finds distutils) +if test "`$PYTHON -c "import distutils" 2> /dev/null && echo yes`" = "yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Please install the Python distutils package) +fi + + +dnl +dnl Check for bison +dnl +AC_ARG_WITH(bison, AC_HELP_STRING( + [--with-bison], [name of the bison executable to use]), + [ + BISON="$withval" + AC_SUBST(BISON) + AC_MSG_NOTICE([Using bison executable $BISON]) + ],[ + BISON="bison" + AC_SUBST(BISON) + ]) +AC_MSG_CHECKING(for $BISON) +if test "`type $BISON 2>&1 > /dev/null && echo yes`" = "yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Please install bison.) +fi + + +dnl Check for patch +AC_ARG_WITH(patch, AC_HELP_STRING( + [--with-patch], [name of the patch executable to use]), + [ + PATCH="$withval" + AC_SUBST(PATCH) + AC_MSG_NOTICE([Using patch executable $PATCH]) + ],[ + AC_PATH_PROG(PATCH, patch) + ]) +if test -z "$PATCH"; then + AC_MSG_ERROR([Please specify the location of patch with the option '--with-patch']) +fi + +# Sun's patch is a mess, issue a warning. But we are going to continue with +# the build because you might just be lucky. +AC_MSG_CHECKING([whether $PATCH will work]) +if $PATCH -v 2>&1 | grep -q "Sun" >/dev/null 2>&1; then + AC_MSG_RESULT(no) + AC_MSG_WARN([ +Sorry, you have a Sun version of patch which is notoriously buggy. $PACKAGE_NAME +may function correctly, or minor errors may occur due to Sun's patch tool. +Please consider upgrading to GNU patch, if you already have GNU patch then you +can supply its path with the '--with-patch=' option. +]) +elif $PATCH --version 2>&1 | grep -q "patch 2.0" >/dev/null 2>&1; then + AC_MSG_RESULT(no) + AC_MSG_WARN([ +Sorry, the version of patch you are using can cause severe problems when a patch +creates a directory. $PACKAGE_NAME may well function correctly with this version +of patch or small problems could creep in. +Please consider upgrading your patch to a more recent version, if you already +have a more recent version of patch then you can supply its path with the +'--with-patch=' option. +]) +else + AC_MSG_RESULT(yes) +fi + +dnl Check for rpmbuild (v4) vs. rpm (v3) +dnl AC_PATH_PROGS(RPMBUILD, [rpmbuild rpm]) +dnl AC_SUBST(RPMBUILD) + +AC_MSG_CHECKING([for dirname]) +if test "`type dirname 2>&1 > /dev/null && echo yes`" = "yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Please install dirname.) +fi + +AC_MSG_CHECKING([for cat]) +if test "`type cat 2>&1 > /dev/null && echo yes`" = "yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Please install cat.) +fi + +AC_MSG_CHECKING([for find]) +if test "`type find 2>&1 > /dev/null && echo yes`" = "yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Please install find.) +fi + +AC_MSG_CHECKING([for sort]) +if test "`type sort 2>&1 > /dev/null && echo yes`" = "yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(Please install sort.) +fi + + +dnl +dnl versions +dnl + +VERSION_MAJOR=` echo "$PACKAGE_VERSION" | \ + sed -e "s/-/./g" | \ + (IFS=. read VERSION_MAJOR VERSION_MINOR VERSION_MICRO VERSION_EXTRA; echo $VERSION_MAJOR)` +VERSION_MINOR=` echo "$PACKAGE_VERSION" | \ + sed -e "s/-/./g" | \ + (IFS=. read VERSION_MAJOR VERSION_MINOR VERSION_MICRO VERSION_EXTRA; echo $VERSION_MINOR)` +VERSION_MICRO=` echo "$PACKAGE_VERSION" | \ + sed -e "s/-/./g" | \ + (IFS=. read VERSION_MAJOR VERSION_MINOR VERSION_MICRO VERSION_EXTRA; echo $VERSION_MICRO)` +VERSION_EXTRA=` echo "$PACKAGE_VERSION" | \ + sed -e "s/-/./g" | \ + (IFS=. read VERSION_MAJOR VERSION_MINOR VERSION_MICRO VERSION_EXTRA; echo $VERSION_EXTRA)` + +AC_SUBST(PACKAGE_VERSION) +AC_SUBST(VERSION_MAJOR) +AC_SUBST(VERSION_MINOR) +AC_SUBST(VERSION_MICRO) +AC_SUBST(VERSION_EXTRA) + +AC_MSG_RESULT([]) +AC_CONFIG_FILES(Makefile scripts/ptxdistvars.sh rules/Kconfig) +AC_OUTPUT +AC_MSG_RESULT([]) + +dnl Print results +AC_MSG_RESULT([$PACKAGE_NAME version $PACKAGE_VERSION configured.]) +AC_MSG_RESULT([Using '$prefix' for installation prefix.]) + +# we don't need to see this just for the backup-files command +# but we may as well spec it for the future +#AC_MSG_RESULT([Using '$CC' for C compiler.]) +#AC_MSG_RESULT([Building with '$CFLAGS' for C compiler flags.]) +#AC_MSG_RESULT([Building with '$LIBS' for linker flags.]) + +AC_MSG_RESULT([]) +AC_MSG_RESULT([Report bugs to $PACKAGE_BUGREPORT]) +AC_MSG_RESULT([]) diff --git a/rules/Kconfig.in b/rules/Kconfig.in index 500673d54..a711aae9c 100644 --- a/rules/Kconfig.in +++ b/rules/Kconfig.in @@ -5,7 +5,7 @@ config CONFIGFILE_VERSION string - default "@VERSION@" + default "@PACKAGE_VERSION@" comment "----------------------------------" diff --git a/scripts/ptxdistvars.sh b/scripts/ptxdistvars.sh deleted file mode 100644 index d8af211e2..000000000 --- a/scripts/ptxdistvars.sh +++ /dev/null @@ -1,15 +0,0 @@ -# -# Static Variable Definitions for PTXdist -# - -PROJECT=PTXdist - -VERSION=0 -PATCHLEVEL=10 -SUBLEVEL=2 -EXTRAVERSION=-svn - -FULLVERSION=${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION} - -export PROJECT VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION FULLVERSION - diff --git a/scripts/ptxdistvars.sh.in b/scripts/ptxdistvars.sh.in new file mode 100644 index 000000000..162275b34 --- /dev/null +++ b/scripts/ptxdistvars.sh.in @@ -0,0 +1,13 @@ +# +# Version Definitions for PTXdist +# + +PROJECT=PTXdist +FULLVERSION=@PACKAGE_VERSION@ +VERSION=@VERSION_MAJOR@ +PATCHLEVEL=@VERSION_MINOR@ +SUBLEVEL=@VERSION_MICRO@ +EXTRAVERSION=-@VERSION_EXTRA@ + +export PROJECT VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION FULLVERSION + |