aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-08-09 05:45:11 +0200
committerYang Tse <yangsita@gmail.com>2010-08-09 05:45:11 +0200
commit50a1d5ee1c127d76ea3316f86d53accb66bc0b22 (patch)
tree374e309bb4c1dbfe4e9fbbac5cdbc4ca91d01e6b
parent6ccbd1bee4470da4fc73e46dd27c809dbcdf8e2e (diff)
build: libhostname and chkhostname linkage adjustments followup
-rw-r--r--configure.ac4
-rw-r--r--tests/libtest/Makefile.inc2
-rw-r--r--tests/libtest/sethostname.h9
3 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index fe57875d9..a43b2863a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -764,6 +764,8 @@ ac_cv_func_strcasecmp="no"
CURL_CHECK_LIBS_CONNECT
+CURL_NETWORK_LIBS=$LIBS
+
dnl **********************************************************************
dnl In case that function clock_gettime with monotonic timer is available,
dnl check for additional required libraries.
@@ -2651,6 +2653,7 @@ LIBCURL_LIBS=$LIBS
AC_SUBST(LIBCURL_LIBS)
AC_SUBST(CURL_LIBS)
AC_SUBST(TEST_SERVER_LIBS)
+AC_SUBST(CURL_NETWORK_LIBS)
LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
@@ -2775,6 +2778,7 @@ squeeze LIBS
squeeze CURL_LIBS
squeeze LIBCURL_LIBS
squeeze TEST_SERVER_LIBS
+squeeze CURL_NETWORK_LIBS
squeeze SUPPORT_FEATURES
squeeze SUPPORT_PROTOCOLS
diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
index f5a5ddeb4..ce230c12a 100644
--- a/tests/libtest/Makefile.inc
+++ b/tests/libtest/Makefile.inc
@@ -15,7 +15,7 @@ noinst_PROGRAMS = lib500 lib501 lib502 lib503 lib504 lib505 lib506 \
lib568 lib569 lib570 lib571 lib572 lib573 chkhostname
chkhostname_SOURCES = chkhostname.c $(top_srcdir)/lib/curl_gethostname.c
-chkhostname_LDADD =
+chkhostname_LDADD = @CURL_NETWORK_LIBS@
chkhostname_DEPENDENCIES =
chkhostname_CFLAGS = $(AM_CFLAGS)
diff --git a/tests/libtest/sethostname.h b/tests/libtest/sethostname.h
index 458a8f0cf..83034a536 100644
--- a/tests/libtest/sethostname.h
+++ b/tests/libtest/sethostname.h
@@ -21,5 +21,12 @@
# endif
#endif
-LIBHOSTNAME_EXTERN int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen);
+#ifdef USE_WINSOCK
+# define FUNCALLCONV __stdcall
+#else
+# define FUNCALLCONV
+#endif
+
+LIBHOSTNAME_EXTERN int FUNCALLCONV
+ gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen);