diff --git a/configure b/configure
index 0da63ad57fbe2af51f8e60e1018cd0b9afd5cd64..9b37d278450925d492e9013e13c7c1bf477dec2a 100755
--- a/configure
+++ b/configure
@@ -1391,7 +1391,8 @@ case $host_os in
  freebsd*) template=freebsd ;;
     hpux*) template=hpux ;;
     irix*) template=irix ;;
-   linux*) template=linux ;;
+ linux*|gnu*|k*bsd*-gnu)
+           template=linux ;;
    mingw*) template=win32 ;;
   netbsd*) template=netbsd ;;
 nextstep*) template=nextstep ;;
diff --git a/configure.in b/configure.in
index 84a7a5e7a37e1c43a03361f105ace6bd4051d077..06577702680b328343597598dc922b10c206fe5e 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.376 2004/09/10 13:53:40 momjian Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.377 2004/09/17 22:31:59 petere Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -57,7 +57,8 @@ case $host_os in
  freebsd*) template=freebsd ;;
     hpux*) template=hpux ;;
     irix*) template=irix ;;
-   linux*) template=linux ;;
+ linux*|gnu*|k*bsd*-gnu)
+           template=linux ;;
    mingw*) template=win32 ;;
   netbsd*) template=netbsd ;;
 nextstep*) template=nextstep ;;