diff configure.in @ 452:3d3049ae1304 r21-2-41

Import from CVS: tag r21-2-41
author cvs
date Mon, 13 Aug 2007 11:40:21 +0200
parents 98528da0b7fc
children c33ae14dd6d0
line wrap: on
line diff
--- a/configure.in	Mon Aug 13 11:39:21 2007 +0200
+++ b/configure.in	Mon Aug 13 11:40:21 2007 +0200
@@ -369,6 +369,7 @@
 with_dialogs=''
 with_file_coding=''
 cpp='' cppflags='' libs='' ldflags=''
+extra_includes=''
 dynamic=''
 with_x11=''
 with_msw=''
@@ -795,6 +796,7 @@
 	    a | at | ath | athe | athen | athena )	val=athena ;;
 	    n | no | non | none )			val=no     ;;
 	    y | ye | yes )				val=yes    ;;
+	    m | ms | msw )			val=msw    ;;
 	    * ) USAGE_ERROR(["The \`--$optname' option must have one of these values:
   \`lucid', \`motif', \`athena', \`yes', or \`no'."]) ;;
 	  esac
@@ -1864,10 +1866,15 @@
   have_terminfo mail_use_flock mail_use_lockf) && echo ""
 
 dnl Pick up mingw32 include path
-case "$opsys" in mingw*) mingw_include=`eval "gcc -print-file-name=libc.a"` ;
-	mingw_include=`eval "dirname $mingw_include"` ;
-	mingw_include="-I$mingw_include/../include/mingw32" ;
-	XE_APPEND($mingw_include, c_switch_system) ;;
+case "$opsys" in mingw* | cygwin*) 
+  cygwin_include=`eval "gcc -print-file-name=libc.a"` ;
+  cygwin_include=`eval "dirname $cygwin_include"` ;
+  cygwin_include="-I$cygwin_include/../include" ;
+  extra_includes="$cygwin_include/mingw32 $cygwin_include/mingw $cygwin_include" ;
+  case "$opsys" in mingw*) 
+    XE_APPEND($extra_includes, c_switch_system) ;;
+  esac
+  ;;	
 esac
 
 dnl Non-ordinary link usually requires -lc
@@ -4164,8 +4171,16 @@
   else
     dnl Find headers and libraries
     AC_CHECK_HEADER(dlfcn.h, [
-      AC_CHECK_LIB(dl, dlopen, [ have_dl=yes libdl=dl], [
-      AC_CHECK_LIB(c,  dlopen, [ have_dl=yes ])])])
+      AC_MSG_CHECKING([for dlopen in -lc])
+      AC_TRY_LINK([#include <dlfcn.h>],dnl
+	[dlopen ("", 0);], [ have_dl=yes ], [
+      AC_MSG_CHECKING([for dlopen in -ldl])
+      ac_save_LIBS="$LIBS"
+      LIBS="-ldl $LIBS"
+      AC_TRY_LINK([#include <dlfcn.h>],dnl
+	[dlopen ("", 0);], [ have_dl=yes ],
+	[LIBS="$ac_save_LIBS"])
+      ac_save_LIBS=])])
     if test -n "$have_dl"; then
       AC_DEFINE(HAVE_DLOPEN)
     else
@@ -4339,6 +4354,7 @@
 AC_SUBST(statedir)
 AC_SUBST(libdir)
 AC_SUBST(mandir)
+AC_SUBST(extra_includes)
 
 AC_SUBST(prefix)
 AC_SUBST(PREFIX_USER_DEFINED)