>From 24e3759f852b4a39190ec17ead4998095a88cf15 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <i...@extreme.hu>
Date: Thu, 8 Apr 2010 21:38:03 +0200
Subject: [PATCH] Fix out-of-tree builds

- The throwing out of autogen.sh in favor of autoreconf comes from
  
http://www.gnu.org/software/automake/manual/autoconf/autoreconf-Invocation.html#autoreconf-Invocation
- 'think that instead of the exit, some better way should be put in
  to control whether or not to automatically run configure. Or maybe
  just don't even run it.
---
 Makefile.am                |    2 -
 WINGs/Examples/Makefile.am |    2 +-
 WINGs/Extras/Makefile.am   |    2 +-
 WINGs/Makefile.am          |    2 +-
 WINGs/Tests/Makefile.am    |    2 +-
 WPrefs.app/Makefile.am     |    2 +-
 autogen.sh                 |   45 ++-----------------------------------------
 configure.ac               |    9 +------
 src/Makefile.am            |    2 +-
 util/Makefile.am           |    2 +-
 wrlib/Makefile.am          |    2 +-
 11 files changed, 13 insertions(+), 59 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a0985d5..3ad745d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-ACLOCAL_AMFLAGS = -I m4
-
 SUBDIRS = wrlib WINGs src util po WindowMaker WPrefs.app doc
 
 EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N FAQ.I18N.cs FAQ.I18N.sk \
diff --git a/WINGs/Examples/Makefile.am b/WINGs/Examples/Makefile.am
index bfd4b8d..a8783f7 100644
--- a/WINGs/Examples/Makefile.am
+++ b/WINGs/Examples/Makefile.am
@@ -28,7 +28,7 @@ server_LDADD = $(top_builddir)/WINGs/libWUtil.la 
@LIBRARY_SEARCH_PATH@ @INTLIBS@
 INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
        -DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
 
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
        $(QUIET)$(COMPILE) -c $<
diff --git a/WINGs/Extras/Makefile.am b/WINGs/Extras/Makefile.am
index 58aeb7e..291ed94 100644
--- a/WINGs/Extras/Makefile.am
+++ b/WINGs/Extras/Makefile.am
@@ -35,7 +35,7 @@ LDADD= $(top_builddir)/WINGs/libWINGs.la 
$(top_builddir)/wrlib/libwraster.la \
 
 test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
 
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
        $(QUIET)$(COMPILE) -c $<
diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am
index 5bd535d..4db12fe 100644
--- a/WINGs/Makefile.am
+++ b/WINGs/Makefile.am
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = no-dependencies
 
 SUBDIRS = WINGs . po Documentation Resources
 
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 libWINGs_a_AR = $(QUIET_AR) $(AR) $(ARFLAGS)
 
diff --git a/WINGs/Tests/Makefile.am b/WINGs/Tests/Makefile.am
index c838c22..f8aecd4 100644
--- a/WINGs/Tests/Makefile.am
+++ b/WINGs/Tests/Makefile.am
@@ -20,7 +20,7 @@ INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib 
-I$(top_srcdir)/src \
        -DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@ \
        -DDEBUG
        
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
        $(QUIET)$(COMPILE) -c $<
diff --git a/WPrefs.app/Makefile.am b/WPrefs.app/Makefile.am
index cf1f044..1163381 100644
--- a/WPrefs.app/Makefile.am
+++ b/WPrefs.app/Makefile.am
@@ -57,7 +57,7 @@ WPrefs_LDADD = \
        @XFTLIBS@ \
        @INTLIBS@
 
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
        $(QUIET)$(COMPILE) -c $<
diff --git a/autogen.sh b/autogen.sh
index ddeedfa..98d5ba9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,48 +1,8 @@
 #!/bin/sh
-# Run this to generate all the initial makefiles, etc.
 
-DIE=0
+autoreconf -vfis -I m4
 
-echo "Generating configuration files for WindowMaker, please wait...."
-
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
-       echo
-        echo "You must have autoconf installed to compile WindowMaker."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-        DIE=1
-}
-
-(libtool --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have libtool installed to compile WindowMaker."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-        DIE=1
-}
-
-(automake --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have automake installed to compile WindowMaker."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-        DIE=1
-}
-
-if test "$DIE" -eq 1; then
-        exit 1
-fi
-
-echo "  libtoolize --copy --force --automake"
-libtoolize --copy --force --automake
-echo "  aclocal -I m4 $ACLOCAL_FLAGS"
-aclocal -I m4 $ACLOCAL_FLAGS
-echo "  autoheader"
-autoheader
-echo "  automake --add-missing --gnu --include-deps"
-automake --add-missing --gnu --include-deps
-echo "  autoconf"
-autoconf
+exit 0
 
 if [ -x config.status -a -z "$*" ]; then
   ./config.status --recheck
@@ -56,3 +16,4 @@ else
   fi
   ./configure "$@"
 fi
+
diff --git a/configure.ac b/configure.ac
index 6244bc7..9a63d82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,11 +14,8 @@ dnl
 AC_INIT(src/WindowMaker.h)
 
 
-
+AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE(WindowMaker, 0.94.0-crm)
-
-AC_PROG_LIBTOOL
-
 AM_CONFIG_HEADER(src/config.h)
 
 
@@ -31,11 +28,9 @@ dnl Checks for programs.
 dnl ===================
 AC_ISC_POSIX
 AC_PROG_CC
-dnl AC_PROG_MAKE_SET -- already done by AM_INIT_AUTOMAKE
-#AC_PROG_RANLIB
-dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
 AC_PROG_LN_S
 AC_PROG_GCC_TRADITIONAL
+AC_PROG_LIBTOOL
 
 AX_CFLAGS_GCC_OPTION(-Wall)
 AX_CFLAGS_GCC_OPTION(-Wextra)
diff --git a/src/Makefile.am b/src/Makefile.am
index ae65870..cfd04cd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -120,7 +120,7 @@ wmaker_LDADD = \
        @XLIBS@ \
        @INTLIBS@
 
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
        $(QUIET)$(COMPILE) -c $<
diff --git a/util/Makefile.am b/util/Makefile.am
index 6305a41..ba4c8db 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -73,7 +73,7 @@ wmaker.inst: $(srcdir)/wmaker.inst.in ./Makefile
 
        chmod 755 wmaker.inst
        
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
        $(QUIET)$(COMPILE) -c $<
diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am
index 8b5e648..78551cc 100644
--- a/wrlib/Makefile.am
+++ b/wrlib/Makefile.am
@@ -8,7 +8,7 @@ lib_LTLIBRARIES = libwraster.la
 
 libwraster_la_LDFLAGS = -version-info 4:0:1
 
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 bin_SCRIPTS = get-wraster-flags
 
-- 
1.7.0


-- 
[-]

mkdir /nonexistent
From 24e3759f852b4a39190ec17ead4998095a88cf15 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <i...@extreme.hu>
Date: Thu, 8 Apr 2010 21:38:03 +0200
Subject: [PATCH] Fix out-of-tree builds

- The throwing out of autogen.sh in favor of autoreconf comes from
  http://www.gnu.org/software/automake/manual/autoconf/autoreconf-Invocation.html#autoreconf-Invocation
- 'think that instead of the exit, some better way should be put in
  to control whether or not to automatically run configure. Or maybe
  just don't even run it.
---
 Makefile.am                |    2 -
 WINGs/Examples/Makefile.am |    2 +-
 WINGs/Extras/Makefile.am   |    2 +-
 WINGs/Makefile.am          |    2 +-
 WINGs/Tests/Makefile.am    |    2 +-
 WPrefs.app/Makefile.am     |    2 +-
 autogen.sh                 |   45 ++-----------------------------------------
 configure.ac               |    9 +------
 src/Makefile.am            |    2 +-
 util/Makefile.am           |    2 +-
 wrlib/Makefile.am          |    2 +-
 11 files changed, 13 insertions(+), 59 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a0985d5..3ad745d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-ACLOCAL_AMFLAGS = -I m4
-
 SUBDIRS = wrlib WINGs src util po WindowMaker WPrefs.app doc
 
 EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N FAQ.I18N.cs FAQ.I18N.sk \
diff --git a/WINGs/Examples/Makefile.am b/WINGs/Examples/Makefile.am
index bfd4b8d..a8783f7 100644
--- a/WINGs/Examples/Makefile.am
+++ b/WINGs/Examples/Makefile.am
@@ -28,7 +28,7 @@ server_LDADD = $(top_builddir)/WINGs/libWUtil.la @LIBRARY_SEARCH_PATH@ @INTLIBS@
 INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
 	-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
 
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
 	$(QUIET)$(COMPILE) -c $<
diff --git a/WINGs/Extras/Makefile.am b/WINGs/Extras/Makefile.am
index 58aeb7e..291ed94 100644
--- a/WINGs/Extras/Makefile.am
+++ b/WINGs/Extras/Makefile.am
@@ -35,7 +35,7 @@ LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
 
 test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
 
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
 	$(QUIET)$(COMPILE) -c $<
diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am
index 5bd535d..4db12fe 100644
--- a/WINGs/Makefile.am
+++ b/WINGs/Makefile.am
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = no-dependencies
 
 SUBDIRS = WINGs . po Documentation Resources
 
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 libWINGs_a_AR = $(QUIET_AR) $(AR) $(ARFLAGS)
 
diff --git a/WINGs/Tests/Makefile.am b/WINGs/Tests/Makefile.am
index c838c22..f8aecd4 100644
--- a/WINGs/Tests/Makefile.am
+++ b/WINGs/Tests/Makefile.am
@@ -20,7 +20,7 @@ INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
 	-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@ \
 	-DDEBUG
 	
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
 	$(QUIET)$(COMPILE) -c $<
diff --git a/WPrefs.app/Makefile.am b/WPrefs.app/Makefile.am
index cf1f044..1163381 100644
--- a/WPrefs.app/Makefile.am
+++ b/WPrefs.app/Makefile.am
@@ -57,7 +57,7 @@ WPrefs_LDADD = \
 	@XFTLIBS@ \
 	@INTLIBS@
 
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
 	$(QUIET)$(COMPILE) -c $<
diff --git a/autogen.sh b/autogen.sh
index ddeedfa..98d5ba9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,48 +1,8 @@
 #!/bin/sh
-# Run this to generate all the initial makefiles, etc.
 
-DIE=0
+autoreconf -vfis -I m4
 
-echo "Generating configuration files for WindowMaker, please wait...."
-
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
-	echo
-        echo "You must have autoconf installed to compile WindowMaker."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-        DIE=1
-}
-
-(libtool --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have libtool installed to compile WindowMaker."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-        DIE=1
-}
-
-(automake --version) < /dev/null > /dev/null 2>&1 || {
-        echo
-        echo "You must have automake installed to compile WindowMaker."
-        echo "Download the appropriate package for your distribution,"
-        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-        DIE=1
-}
-
-if test "$DIE" -eq 1; then
-        exit 1
-fi
-
-echo "  libtoolize --copy --force --automake"
-libtoolize --copy --force --automake
-echo "  aclocal -I m4 $ACLOCAL_FLAGS"
-aclocal -I m4 $ACLOCAL_FLAGS
-echo "  autoheader"
-autoheader
-echo "  automake --add-missing --gnu --include-deps"
-automake --add-missing --gnu --include-deps
-echo "  autoconf"
-autoconf
+exit 0
 
 if [ -x config.status -a -z "$*" ]; then
   ./config.status --recheck
@@ -56,3 +16,4 @@ else
   fi
   ./configure "$@"
 fi
+
diff --git a/configure.ac b/configure.ac
index 6244bc7..9a63d82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,11 +14,8 @@ dnl
 AC_INIT(src/WindowMaker.h)
 
 
-
+AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE(WindowMaker, 0.94.0-crm)
-
-AC_PROG_LIBTOOL
-
 AM_CONFIG_HEADER(src/config.h)
 
 
@@ -31,11 +28,9 @@ dnl Checks for programs.
 dnl ===================
 AC_ISC_POSIX
 AC_PROG_CC
-dnl AC_PROG_MAKE_SET -- already done by AM_INIT_AUTOMAKE
-#AC_PROG_RANLIB
-dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
 AC_PROG_LN_S
 AC_PROG_GCC_TRADITIONAL
+AC_PROG_LIBTOOL
 
 AX_CFLAGS_GCC_OPTION(-Wall)
 AX_CFLAGS_GCC_OPTION(-Wextra)
diff --git a/src/Makefile.am b/src/Makefile.am
index ae65870..cfd04cd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -120,7 +120,7 @@ wmaker_LDADD = \
 	@XLIBS@ \
 	@INTLIBS@
 
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
 	$(QUIET)$(COMPILE) -c $<
diff --git a/util/Makefile.am b/util/Makefile.am
index 6305a41..ba4c8db 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -73,7 +73,7 @@ wmaker.inst: $(srcdir)/wmaker.inst.in ./Makefile
 
 	chmod 755 wmaker.inst
 	
-LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
 	$(QUIET)$(COMPILE) -c $<
diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am
index 8b5e648..78551cc 100644
--- a/wrlib/Makefile.am
+++ b/wrlib/Makefile.am
@@ -8,7 +8,7 @@ lib_LTLIBRARIES = libwraster.la
 
 libwraster_la_LDFLAGS = -version-info 4:0:1
 
-LIBTOOL = $(QUIET) $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
+LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
 
 bin_SCRIPTS = get-wraster-flags
 
-- 
1.7.0

Reply via email to