A little configure change help needed for the mingw/msys port.

Alexandre Julliard julliard at winehq.com
Wed May 8 14:57:32 CDT 2002


"Steven Edwards" <Steven_Ed4153 at yahoo.com> writes:

> After the recent patch for cygwin I found the 2 changes I need to make
> to configure/configure.ac 
> for a mingw host/target but I'm having trouble with the syntax of
> configure to get it to do what 
> I need it to do. My current porting work has been based on some dirty
> hacks to configure that didn't
> Really fix the problem without breaking the checks for other platforms.
> Now I just need some help making
> These 2 changes.

I'd suggest something like that:

Index: configure.ac
===================================================================
RCS file: /opt/cvs-commit/wine/configure.ac,v
retrieving revision 1.33
diff -u -r1.33 configure.ac
--- configure.ac	7 May 2002 18:33:47 -0000	1.33
+++ configure.ac	8 May 2002 19:53:09 -0000
@@ -95,18 +95,6 @@
 dnl Check for -lmmap for OS/2
 AC_CHECK_LIB(mmap,mmap)
 
-DLLIBS=""
-AC_SUBST(DLLIBS)
-AC_CHECK_HEADERS(dlfcn.h,
-    [AC_CHECK_FUNCS(dlopen,,
-        [AC_CHECK_LIB(dl,dlopen,
-                     [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
-                     DLLIBS="-ldl"],
-                     LIBEXT="a")]
- 	)],
- 	LIBEXT="a"
-    )
-
 JPEGLIB=""
 AC_SUBST(JPEGLIB)
 AC_CHECK_HEADERS(jpeglib.h,
@@ -710,19 +698,29 @@
 
 LDSHARED=""
 LDDLLFLAGS=""
-if test "$LIBEXT" = "so"
-then
-  case $target_os in
-    *cygwin*)
-      AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
-      if test "$DLLWRAP" = "dllwrap"; then
-        dnl FIXME - check whether dllwrap works correctly...
-        LIBEXT="dll"
-      else
-        LIBEXT="a"
-      fi
-      ;;
-    *)
+DLLIBS=""
+
+case $target_os in
+  *cygwin*|*mingw*)
+    AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
+    if test "$DLLWRAP" = "dllwrap"; then
+      dnl FIXME - check whether dllwrap works correctly...
+      LIBEXT="dll"
+    else
+      LIBEXT="a"
+    fi
+    ;;
+  *)
+    AC_CHECK_HEADERS(dlfcn.h,
+        [AC_CHECK_FUNCS(dlopen,,
+            [AC_CHECK_LIB(dl,dlopen,
+                         [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
+                          DLLIBS="-ldl"],
+                         [LIBEXT="a"])])],
+        [LIBEXT="a"])
+
+    if test "$LIBEXT" = "so"
+    then
       AC_CACHE_CHECK([whether we can build a GNU style ELF dll],ac_cv_c_dll_gnuelf,
       [saved_cflags=$CFLAGS
       CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
@@ -747,9 +745,9 @@
           LDDLLFLAGS="-Wl,-B,symbolic"
         fi
       fi
-      ;;
-  esac
-fi
+    fi
+    ;;
+esac
 
 if test "$LIBEXT" = "a"; then
   AC_MSG_ERROR(
@@ -773,6 +771,7 @@
     LDPATH="PATH=\"\$(TOPOBJDIR)/library:\$(TOPOBJDIR)/unicode:\$\$PATH\""
 fi
 
+AC_SUBST(DLLIBS)
 AC_SUBST(DLLFLAGS)
 AC_SUBST(DLLEXT)
 AC_SUBST(LDSHARED)

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list