[GRASS5] Fw: [DebianGIS-dev] Bug#336498: grass: broken macro LOC_CHECK_VERSION (also FTBFS on GNU/FreeBSD)

Glynn Clements glynn at gclements.plus.com
Sat Nov 5 12:35:53 EST 2005


Markus Neteler wrote:

> >Please split macro LOC_CHECK_VERSION from aclocal
> >into LOC_CHECK_VERSION_STRING and LOC_CHECK_VERSION_NUMBER
> >and use them appropriate in configure.in.

> Does anyone know how to modify 'configure.in' for this problem?

I've committed the following changes:

1. In aclocal.m4, replace LOC_CHECK_VERSION with:

AC_DEFUN(LOC_CHECK_VERSION_STRING,[
AC_MSG_CHECKING($3 version)
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$5 $CPPFLAGS"
AC_TRY_RUN([
#include <stdio.h> 
#include <$1>
int main(void) {
 FILE *fp = fopen("conftestdata","w");
 fputs($2, fp);
 return 0;
}
],
[   $4=`cat conftestdata`
    AC_MSG_RESULT($$4)],
[   AC_MSG_ERROR([*** Could not determine $3 version.]) ],
[   $4=$6
    AC_MSG_RESULT([unknown (cross-compiling)]) ])
CPPFLAGS=$ac_save_cppflags
])

AC_DEFUN(LOC_CHECK_VERSION_INT,[
AC_MSG_CHECKING($3 version)
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$5 $CPPFLAGS"
AC_TRY_RUN([
#include <stdio.h>
#include <$1>
int main(void) {
 FILE *fp = fopen("conftestdata","w");
 fprintf(fp, "%d", $2);
 return 0;
}
    ],
    [   $4=`cat conftestdata`
        AC_MSG_RESULT($$4)],
    [   AC_MSG_ERROR([*** Could not determine $3 version.]) ],
    [   $4=$6
        AC_MSG_RESULT([unknown (cross-compiling)]) ])
CPPFLAGS=$ac_save_cppflags
])

2. In configure.in:

a) replace:

	LOC_CHECK_VERSION(proj_api.h,PJ_VERSION,External PROJ.4,proj_ver,$PROJINC,UNKNOWN)
with:
	LOC_CHECK_VERSION_INT(proj_api.h,PJ_VERSION,External PROJ.4,proj_ver,$PROJINC,0)

b) replace:

	LOC_CHECK_VERSION(tcl.h,TCL_VERSION,Tcl,tcl_ver,$TCLINCDIR,UNKNOWN)
with:
	LOC_CHECK_VERSION_STRING(tcl.h,TCL_VERSION,Tcl,tcl_ver,$TCLINCDIR,UNKNOWN)

c) replace:

	LOC_CHECK_VERSION(tk.h,TK_VERSION,Tk,tk_ver,$TCLINCDIR $X_CFLAGS,UNKNOWN)
with:
	LOC_CHECK_VERSION_STRING(tk.h,TK_VERSION,Tk,tk_ver,$TCLINCDIR $X_CFLAGS,UNKNOWN)

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list