diff --git a/configure b/configure
index 54aabb9f7725467ee60f4bc06fdec4e48f64b5ab..b04d091b171609975dd5e6eb8f20a2877e97f316 100755
--- a/configure
+++ b/configure
@@ -13614,6 +13614,7 @@ fi
 
 
 
+
 
 
 for ac_func in \
@@ -13656,6 +13657,7 @@ for ac_func in \
 	settimeofday \
 	sigaltstack \
 	snprintf \
+	spawnvp \
 	statfs \
 	strcasecmp \
 	strerror \
diff --git a/configure.ac b/configure.ac
index 11b597e66627b883360401d3c652f513d4dec092..98fceceae884a54cfbb71e71b204d98587b27ad8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -971,6 +971,7 @@ AC_CHECK_FUNCS(\
 	settimeofday \
 	sigaltstack \
 	snprintf \
+	spawnvp \
 	statfs \
 	strcasecmp \
 	strerror \
diff --git a/include/config.h.in b/include/config.h.in
index e655c14bd926d592f75f593d7dd3e54452cb7a1d..ec61e7efafb8ff18282c2186f34b29462d8f5b76 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -458,6 +458,9 @@
 /* Define to 1 if you have the <soundcard.h> header file. */
 #undef HAVE_SOUNDCARD_H
 
+/* Define to 1 if you have the `spawnvp' function. */
+#undef HAVE_SPAWNVP
+
 /* Define to 1 if the system has the type `ssize_t'. */
 #undef HAVE_SSIZE_T
 
diff --git a/include/wine/port.h b/include/wine/port.h
index 90c3798fd5326248084dbdfc35e27bd8f445530c..fb96b39900ac466f7176e5f7e305a2697223bf67 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -276,7 +276,9 @@ extern int mkstemps(char *template, int suffix_len);
 # define _P_NOWAITO 3
 # define _P_DETACH  4
 #endif
+#ifndef HAVE_SPAWNVP
 extern int spawnvp(int mode, const char *cmdname, char *const argv[]);
+#endif
 
 /* Interlocked functions */
 
diff --git a/libs/port/spawn.c b/libs/port/spawn.c
index 09b65581420572c384735db0a8655c6a8f8827b6..ed44a1e9c18e6fab9a647b153af6cbaa908b43c9 100644
--- a/libs/port/spawn.c
+++ b/libs/port/spawn.c
@@ -31,6 +31,7 @@
 # include <unistd.h>
 #endif
 
+#ifndef HAVE_SPAWNVP
 int spawnvp(int mode, const char *cmdname, char *const argv[])
 {
 #ifndef HAVE__SPAWNVP
@@ -72,3 +73,4 @@ int spawnvp(int mode, const char *cmdname, char *const argv[])
     return _spawnvp(mode, cmdname, argv);
 #endif  /* HAVE__SPAWNVP */
 }
+#endif  /* HAVE_SPAWNVP */