<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39520 >

 Ok, this time I figured out what this configure option really is - or
is meant to be. In the process I fixed some of the most obvious bugs.
And once I had fixed most problems with it, it no longer made sense to
leave it halfway.
 In addition to fixing bugs I renamed it as --disable-auto-deps, since
I found its old name really confusing. It has nothing to do with
version control!

 Not that I can be sure that it helps where it is meant to be used, ie
when compiler lacks certain properties. I only know that it seems to
modify Makefiles as it should and using those modified Makefiles it is
possible to compile freeciv using gcc.


 - ML

diff -Nurd -X.diff_ignore freeciv/bootstrap/undep.sh.in freeciv/bootstrap/undep.sh.in
--- freeciv/bootstrap/undep.sh.in	2007-08-04 18:37:57.000000000 +0300
+++ freeciv/bootstrap/undep.sh.in	2007-08-10 00:25:38.000000000 +0300
@@ -4,30 +4,30 @@
 #
 # This script gets run at the end of configure, to modify
 # the Makefile's produced by configure to remove deps stuff 
-# which can (for cvs sources and snapshots) upset some make 
+# which can (for svn sources and snapshots) upset some make 
 # programs and C compilers.  (GNU make and gcc work, maybe 
 # some others work too...)
 #
 # Whether anything is actually modified depends on how configure
-# sets CVS_DEPS; see configure.in; if CVS_DEPS is set to "yes",
+# sets AUTO_DEPS; see configure.ac; if AUTO_DEPS is set to "yes",
 # this script does nothing.   For a "release" distribution
 # of freeciv (where the deps are done differently and are portable) 
 # this script will in effect do nothing because the sed regex's 
 # won't match. 
 
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
 
-if test "$CVS_DEPS" = "yes"; then
+if test "$AUTO_DEPS" = "yes"; then
     exit
 fi
 
 @[EMAIL PROTECTED]"client client/agents client/@gui_sources@"
 @[EMAIL PROTECTED]""
 
[EMAIL PROTECTED]@SSUBDIRS="ai server"
[EMAIL PROTECTED]@SSUBDIRS="ai server server/generator server/scripting"
 @[EMAIL PROTECTED]""
 
-SUBDIRS="common common/aicore $SSUBDIRS $CSUBDIRS"
+SUBDIRS="common common/aicore utility $SSUBDIRS $CSUBDIRS manual"
 
 for subdir in $SUBDIRS ; do
 
@@ -43,19 +43,27 @@
     continue
 fi
 
-echo "removing cvs-deps from $name"
+echo "removing auto-deps from $name"
 
 mv -f $name $name.bak
 
+# These are known to match if automake version used is 1.4
 sed '
 s/^DEPS_MAGIC.*//
 s/^-include $(DEP_FILES)//
 s/^%\.o: %\.c/.c.o:/
 s/[EMAIL PROTECTED] '"'"'$(COMPILE) -c $<'"'"'; \\/$(COMPILE) -c $</
 s/	$(COMPILE) -Wp,-MD,\.deps\/$(\*F)\.pp -c $</junknever:/
-' $name.bak > $name
+' $name.bak > $name.bak2
 
-# Above, COMPILE substitution line is appropriate for automake 1.4
-# It has an embedded tab character after the s/
+# These are known to match if automake version used is 1.9.6
+# There is several tab characters. Don't get fooled if they appear as one space!
+sed '
+s/^DEPDIR = .*//
+s/^include .\/$(DEPDIR)\/.*//
+s/^	if $(COMPILE) -MT $@ -MD -MP -MF \"$(DEPDIR).*/	$(COMPILE) -c -o $@ $</
+s/^	then mv -f \"$(DEPDIR).*//
+s/^	-rm -rf \.\/$(DEPDIR)//
+' $name.bak2 > $name
 
 done
diff -Nurd -X.diff_ignore freeciv/configure.ac freeciv/configure.ac
--- freeciv/configure.ac	2007-08-09 11:35:00.000000000 +0300
+++ freeciv/configure.ac	2007-08-09 23:54:12.000000000 +0300
@@ -138,12 +138,14 @@
 esac], [make_include=false])
 AM_CONDITIONAL(MAKE_CLIENT_INCLUDE, test "$make_include" = "true")
 
-AC_ARG_ENABLE(cvs_deps,
- 	[  --disable-cvs-deps      remove cvs-source deps calcs, which require gmake,gcc],,
-	enable_cvs_deps="maybe"
-)
-CVS_DEPS=$enable_cvs_deps
-AC_SUBST(CVS_DEPS)
+AC_ARG_ENABLE([auto_deps],
+[  --disable-auto-deps     remove automatic deps calcs, which require gmake,gcc],
+[case "${enableval}" in
+  yes) enable_auto_deps=true ;;
+  no)  enable_auto_deps=false;;
+  *)   AC_MSG_ERROR([bad value ${enableval} for --enable-auto-deps]) ;;
+esac], [enable_auto_deps="maybe"])
+AUTO_DEPS=$enable_auto_deps
 
 AC_ARG_WITH(efence,
 	[  --with-efence           use Electric Fence, malloc debugger ],
@@ -307,14 +309,15 @@
 AC_C99_INITIALIZERS
 AC_C99_STDINT_H
 
-if test "$CVS_DEPS" = "maybe"; then
+if test "$AUTO_DEPS" = "maybe"; then
    dnl Should also check for gmake?
    if test -n "$GCC"; then
-      CVS_DEPS="yes"
+      AUTO_DEPS="yes"
    else
-      CVS_DEPS="no"
+      AUTO_DEPS="no"
    fi
 fi
+AC_SUBST([AUTO_DEPS])
 
 dnl BeOS-specific settings
 if test x`$UNAME -s` = xBeOS ; then
diff -Nurd -X.diff_ignore freeciv/INSTALL freeciv/INSTALL
--- freeciv/INSTALL	2007-08-04 18:39:15.000000000 +0300
+++ freeciv/INSTALL	2007-08-09 23:48:02.000000000 +0300
@@ -55,7 +55,7 @@
    project's excellent C compiler.  Releases can be compiled with gcc
    or most other compilers (such as the unbundled Solaris C compiler).
    Development releases and svn snapshots will not work without gcc,
-   unless you give configure the "--disable-cvs-deps" option.  See
+   unless you give configure the "--disable-auto-deps" option.  See
    the section below for more information.
    Note that there have been reports that gcc with -O3 miscompiled
    freeciv. No problems have been reported with -O2.
@@ -68,7 +68,7 @@
    makefiles which work with most make programs.  Development releases
    and CVS snapshots contain things (like dependencies) which use
    gmake's enhanced features, so gmake is necessary for development,
-   unless you give configure the "--disable-cvs-deps" option.  See the
+   unless you give configure the "--disable-auto-deps" option.  See the
    section below for more information.
 
    You can check if you have GNU make installed on your system by
@@ -318,7 +318,7 @@
 
 If you're compiling a development release or a svn snapshot, and you
 don't have both GNU make AND gcc, then pass configure the
-"--disable-cvs-deps" option.  You'll especially need to do this if
+"--disable-auto-deps" option.  You'll especially need to do this if
 you're using the Solaris cc and make programs.
 
 Note that if you do this, dependency checking is disabled.  If you
@@ -326,7 +326,7 @@
 a "make clean" before doing "make" to ensure everything is compiled
 correctly.
 
-"--disable-cvs-deps" has no effect when run with a stable release.
+"--disable-auto-deps" has no effect when run with a stable release.
 
 By default the configure script will choose the Gtk+ client if the 
 required libraries are found. If you prefer to override this default,
@@ -531,10 +531,10 @@
   % setenv PATH /opt/SUNWspro/bin:/usr/ccs/bin:/bin
   % unsetenv LD_LIBRARY_PATH
   % ./configure --with-xpm-prefix=/path/to/xpm
-                --disable-cvs-deps --with-included-gettext
+                --disable-auto-deps
   % make
 
-The "--disable-cvs-deps" prevents ./configure from creating Makefiles
+The "--disable-auto-deps" prevents ./configure from creating Makefiles
 specific to GNU make.  The symptoms of this happening are:
 
   make: Fatal error in reader:
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to