diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-05-28 13:25:37 +0000 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-05-28 13:25:37 +0000 |
commit | f1bc4e3a093bd98173f047e5b03bdef287b4bcea (patch) | |
tree | 8fb26b8d5526e878cd5905622b025e4cd55fff5c | |
parent | c2471e72e049dfefac6db15174fe866806b133e2 (diff) | |
download | ptxdist-f1bc4e3a093bd98173f047e5b03bdef287b4bcea.tar.gz ptxdist-f1bc4e3a093bd98173f047e5b03bdef287b4bcea.tar.xz |
clean up ptxdist's build system
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10595 33e552b5-05e3-0310-8538-816dae2090ed
-rw-r--r-- | Makefile.in | 77 | ||||
-rwxr-xr-x | autogen.sh | 3 | ||||
-rw-r--r-- | configure.ac | 25 | ||||
-rw-r--r-- | scripts/kconfig/Makefile | 14 |
4 files changed, 66 insertions, 53 deletions
diff --git a/Makefile.in b/Makefile.in index c2250c1b..df455b9e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,47 +1,67 @@ -prefix := @prefix@ -abs_srcdir := @abs_srcdir@ -libdir := ${prefix}/lib -bindir := ${prefix}/bin -version := @PACKAGE_VERSION@ -instdir := ${libdir}/ptxdist-${version} +prefix := @prefix@ +exec_prefix := @exec_prefix@ +abs_srcdir := @abs_srcdir@ +libdir := @libdir@ +bindir := @bindir@ +version := @PACKAGE_VERSION@ +instdir := $(libdir)/ptxdist-$(version) + +CC := @CC@ +CXX := @CXX@ +CFLAGS := @CFLAGS@ +CXXFLAGS := @CXXFLAGS@ +CPPFLAGS := @CPPFLAGS@ +LDFLAGS := @LDFLAGS@ + +SHELL := @BASH@ -# make sure we use bash, even if the user has some other standard shell -SHELL=bash export SHELL all: - @echo "building conf..." - cd "${abs_srcdir}/scripts/kconfig" && \ - ${MAKE} conf "CONF_LIBS=@CONF_LIBS@" - @echo "building mconf..." - cd "${abs_srcdir}/scripts/kconfig" && \ - ${MAKE} mconf CURSES_LOC='@CURSES_LOC@' "MCONF_LIBS=@MCONF_LIBS@" + @echo "building conf and mconf ..." + @CC="$(CC)" \ + CXX="$(CXX)" \ + CFLAGS="$(CFLAGS)" \ + CXXFLAGS="$(CXXFLAGS)" \ + CPPFLAGS="$(CPPFLAGS)" \ + LDFLAGS="$(LDFLAGS)" \ + $(MAKE) -C "$(abs_srcdir)/scripts/kconfig" \ + CONF_LIBS="@CONF_LIBS@" \ + MCONF_LIBS="@MCONF_LIBS@" \ + CURSES_LOC="@CURSES_LOC@" \ + conf mconf @echo "done." @touch .done install: all - @echo "installing PTXdist to ${DESTDIR}${prefix}..." - @rm -fr ${DESTDIR}${instdir} - @mkdir -p ${DESTDIR}${instdir} - @test -d ${DESTDIR}${instdir} || exit 1 - @touch ${DESTDIR}${instdir} || exit 1 - @echo "installing PTXdist to ${DESTDIR}${prefix}/bin..." - tar -C ${abs_srcdir} -cf - --exclude .git --exclude .svn --exclude state --exclude debian --exclude .pc . | tar -o -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} - @ln -sf ${instdir}/bin/ptxdist ${DESTDIR}${prefix}/bin/ptxdist - -@[ -d "@BASH_COMPLETION_DIR@" ] && cp scripts/bash_completion "@BASH_COMPLETION_DIR@/ptxdist" + @echo "installing PTXdist to $(DESTDIR)$(prefix)..." + @rm -fr "$(DESTDIR)$(instdir)" + @mkdir -p "$(DESTDIR)$(instdir)" + @tar -C $(abs_srcdir) -cf - \ + --exclude .git \ + --exclude .pc \ + --exclude .svn \ + --exclude debian \ + --exclude state \ + . | \ + tar -o -C "$(DESTDIR)$(instdir)" -xvf - + + @mkdir -p "$(DESTDIR)$(bindir)" + @rm -f "$(DESTDIR)$(bindir)/ptxdist" + @ln -sf "$(instdir)/bin/ptxdist" "$(DESTDIR)$(bindir)/ptxdist-$(version)" + @ln -sf "$(instdir)/bin/ptxdist" "$(DESTDIR)$(bindir)/bin/ptxdist" + -@[ -d "@BASH_COMPLETION_DIR@" ] && \ + cp scripts/bash_completion "@BASH_COMPLETION_DIR@/ptxdist" clean: - @cd "${abs_srcdir}/scripts/kconfig" && ${MAKE} clean @rm -f .done + @$(MAKE) -C "$(abs_srcdir)/scripts/kconfig" clean dist: PTXDIST_TOPDIR=$(shell pwd); \ tmpdir=`mktemp -d /tmp/ptxdist.XXXXXX`; \ cp -a $$PTXDIST_TOPDIR $$tmpdir/ptxdist-$(version); \ - cd $$tmpdir/ptxdist-$(version); ${MAKE} distclean; \ + cd $$tmpdir/ptxdist-$(version); $(MAKE) distclean; \ find $$tmpdir/ptxdist-$(version) -name ".svn" | xargs rm -fr; \ rm -f $$tmpdir/ptxdist-$(version)/.done; \ cd $$tmpdir; \ @@ -67,4 +87,3 @@ distclean: clean maintainer-clean: distclean rm -f configure - @@ -1,4 +1,3 @@ #!/bin/sh -aclocal -autoconf +autoreconf -f -i diff --git a/configure.ac b/configure.ac index c7ba1ee1..c910edb4 100644 --- a/configure.ac +++ b/configure.ac @@ -2,33 +2,29 @@ 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 - -AC_INIT([ptxdist],[1.99.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) +AC_INIT([ptxdist],[1.99.svn],[ptxdist@pengutronix.de]) +AC_CONFIG_AUX_DIR(scripts/autoconf) +AC_CANONICAL_BUILD +AC_CANONICAL_HOST dnl dnl Check if the user has extracted the patches archive dnl - AC_MSG_CHECKING(for ptxdist patches) if test -d `dirname $0`/patches then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) - AC_MSG_ERROR([install the ptxdist-patches archive into the same directory as ptxdist.],[1]) + AC_MSG_ERROR([install the ptxdist-patches archive into the same directory as ptxdist.]) fi dnl dnl Check header files, mostly for lxdialog & kconfig dnl - AC_HEADER_STDC AC_CHECK_HEADER([regex.h], [], AC_MSG_ERROR([Cannot find regex.h.])) @@ -38,7 +34,7 @@ AC_SEARCH_LIBS(regcomp, [regex gnuregex],, CONF_LIBS=${LIBS} AC_SUBST(CONF_LIBS) -AC_SEARCH_LIBS(mvaddch, [ncurses curses pdcurses], CURSES_LIB=$ac_lib, +AC_SEARCH_LIBS(mvaddch, [ncurses curses pdcurses], [CURSES_LIB=$ac_lib], [AC_MSG_ERROR([ncurses development library not found, please install libncurses-dev])]) MCONF_LIBS=${LIBS} AC_SUBST(MCONF_LIBS) @@ -70,8 +66,7 @@ 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]), +AC_ARG_WITH(bash, AS_HELP_STRING([--with-bash],[name of the bash executable to use]), [ BASH="$withval" AC_SUBST(BASH) @@ -312,8 +307,7 @@ AC_PATH_PROGS(GCC, gcc,, $PATH) 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]), +AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executable to use]), [ PYTHON="$withval" AC_SUBST(PYTHON) @@ -345,8 +339,7 @@ else fi dnl Check for patch -AC_ARG_WITH(patch, AC_HELP_STRING( - [--with-patch], [name of the patch executable to use]), +AC_ARG_WITH(patch, AS_HELP_STRING([--with-patch],[name of the patch executable to use]), [ PATCH="$withval" AC_SUBST(PATCH) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index ba5456c5..19156a13 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -12,8 +12,10 @@ ifndef CURSES_LOC CURSES_LOC := <ncurses.h> endif -CFLAGS += "-DCURSES_LOC=$(CURSES_LOC)" -CFLAGS += -DKBUILD_NO_NLS + +CPPFLAGS += \ + -DCURSES_LOC="$(CURSES_LOC)" \ + -DKBUILD_NO_NLS ifndef MCONF_LIBS MCONF_LIBS := -lncurses @@ -42,19 +44,19 @@ mconf-objs := \ $(lxdialog-objs) conf: $(conf-objs) - $(CC) $^ -o $@ $(conf-libs) + $(CC) $^ $(LDFLAGS) -o $@ $(conf-libs) mconf: $(mconf-objs) - $(CC) $^ -o $@ $(mconf-libs) + $(CC) $^ $(LDFLAGS) -o $@ $(mconf-libs) %.moc: %.h $(MOC) -i $< -o $@ %.o: %.c - $(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ %.o: %.cc - $(CXX) $(CXXFLAGS) -c $< -o $@ + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ %.moc: %.h $(KC_QT_MOC) -i $< -o $@ |