Skip to content

Commit 7948bbd

Browse files
committed
Fixed curl failing to build for Windows
Fixes following issue on Windows build ``` 15:44:06 url.c: In function 'zonefrom_url': 15:44:06 url.c:1802:18: error: implicit declaration of function 'if_nametoindex' [-Werror=implicit-function-declaration] 15:44:06 scopeidx = if_nametoindex(zoneid); 15:44:06 ^ ``` Signed-off-by: Lars Erik Wik <[email protected]> (cherry picked from commit 4512cfe)
1 parent 91e05e4 commit 7948bbd

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

deps-packaging/libcurl/debian/rules

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ build: build-stamp
2626
build-stamp:
2727
dh_testdir
2828

29+
# Fixes following issue on Windows build
30+
# 15:44:06 url.c: In function 'zonefrom_url':
31+
# 15:44:06 url.c:1802:18: error: implicit declaration of function 'if_nametoindex' [-Werror=implicit-function-declaration]
32+
# 15:44:06 scopeidx = if_nametoindex(zoneid);
33+
# 15:44:06 ^
34+
if [ "$(OS)" = mingw ]; then patch -p1 < "$(CURDIR)"/fix-curl-windows.patch; fi
35+
2936
./configure --with-sysroot=$(PREFIX) \
3037
--host=$(DEB_HOST_GNU_TYPE) \
3138
$(PTHREAD) \
@@ -54,7 +61,7 @@ build-stamp:
5461
CPPFLAGS="-I$(PREFIX)/include" \
5562

5663
make
57-
64+
5865
touch build-stamp
5966

6067
install: build
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff -ruN curl-8.15.0/configure curl-8.15.0-modified/configure
2+
--- curl-8.15.0/configure 2025-07-16 08:22:04.000000000 +0200
3+
+++ curl-8.15.0-modified/configure 2025-07-21 16:35:32.470568787 +0200
4+
@@ -41895,12 +41895,20 @@
5+
printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
6+
7+
fi
8+
-ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
9+
-if test "x$ac_cv_func_if_nametoindex" = xyes
10+
-then :
11+
- printf "%s\n" "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h
12+
13+
-fi
14+
+# Below causes issues on Windows Build:
15+
+#
16+
+# 15:44:06 url.c: In function 'zonefrom_url':
17+
+# 15:44:06 url.c:1802:18: error: implicit declaration of function 'if_nametoindex' [-Werror=implicit-function-declaration]
18+
+# 15:44:06 scopeidx = if_nametoindex(zoneid);
19+
+# 15:44:06 ^
20+
+
21+
+# ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
22+
+# if test "x$ac_cv_func_if_nametoindex" = xyes
23+
+# then :
24+
+# printf "%s\n" "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h
25+
+#
26+
+# fi
27+
ac_fn_c_check_func "$LINENO" "mach_absolute_time" "ac_cv_func_mach_absolute_time"
28+
if test "x$ac_cv_func_mach_absolute_time" = xyes
29+
then :
30+
@@ -48385,4 +48393,3 @@
31+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${curl_buildinfo}" >&5
32+
printf "%s\n" "$as_me: ${curl_buildinfo}" >&6;}
33+
fi
34+
-

0 commit comments

Comments
 (0)