Revert to previous handling of getaddrinfo()

Use the system gettaddrinfo function when possible as before.  Tested on
GNU, Cygwin, MinGW on Linux, and MinGW on Windows.  Under MinGW the
replacement getaddrinfo is used.  Perhaps this is an area for
investigation to be certain MinGW really doesn't supply getaddrinfo.
This reverts some of the patches from Remi Chateauneu in commit
60019c9.  This fixes build issues encountered building the Windows
binary daily snapshots.

Enabled static library build by default at configure time.

Fixed pthread library linking for the ars backend on MinGW.
Hamlib-3.0
Nate Bargmann 2013-09-15 19:47:49 -05:00
rodzic 6fc7bedb6e
commit 36f5f4cf6a
8 zmienionych plików z 12 dodań i 32 usunięć

Wyświetl plik

@ -4,6 +4,8 @@ noinst_LTLIBRARIES = libhamlib-ars.la
libhamlib_ars_la_SOURCES = ars.c
libhamlib_ars_la_CFLAGS = -DIN_HAMLIB $(AM_CFLAGS)
# libhamlib_ars_la_LDFLAGS = -no-undefined -module -avoid-version $(PTHREAD_LIBS)
libhamlib_ars_la_LDFLAGS = $(PTHREAD_LIBS)
#hamlib_ars_la_LIBADD = $(top_builddir)/lib/libmisc.la \
# $(top_builddir)/src/libhamlib.la

Wyświetl plik

@ -34,7 +34,7 @@ AC_CONFIG_AUX_DIR([build-aux])
dnl Passing AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION to AM_INIT_AUTOMAKE is
dnl obsolete as these values are obtained from the AC_INIT macro.
AM_INIT_AUTOMAKE([-Wall])
AM_INIT_AUTOMAKE([-Wall subdir-objects])
dnl Clean compilation output makes compiler warnings more visible
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@ -255,7 +255,7 @@ dnl N.B. LT_INIT([dlopen], [win32-dll]) does not work for older libtool
dnl so require new enough version above. Disable static library builds as
dnl the frontend and backend libs are not linked. May need a recipe outside
dnl of Libtool if these are needed.
LT_INIT([dlopen win32-dll disable-static])
LT_INIT([dlopen win32-dll])
dnl Enable building of the convenience libltdl library recursively
dnl (requires --with-included-ltdl be given to configure for the included
@ -263,7 +263,7 @@ dnl libltdl to be used instead of an installed version), useful on systems
dnl where libltdl-dev is not installed.
LTDL_INIT([convenience recursive])
## dnl Ugly hack to work around libtool LT_CONFIG_H bug #12262
dnl Ugly hack to work around libtool LT_CONFIG_H bug #12262
dnl http://lists.gnu.org/archive/html/bug-libtool/2012-08/msg00007.html
AC_CONFIG_COMMANDS_PRE([LT_CONFIG_H=`expr "$LT_CONFIG_H" : '.*/\(.*\)'`])

Wyświetl plik

@ -1725,10 +1725,6 @@ extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s);
extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s);
extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s);
struct addrinfo;
extern HAMLIB_EXPORT(int) rig_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res);
extern HAMLIB_EXPORT(void) rig_freeaddrinfo(struct addrinfo *res);
__END_DECLS

Wyświetl plik

@ -53,7 +53,6 @@
# endif
#endif
#include <hamlib/rig.h>
/*
* Replacement for getaddrinfo. Only one addrinfo is returned.
@ -61,7 +60,7 @@
* Return 0 when success, otherwise -1.
*/
#ifndef HAVE_GETADDRINFO
int HAMLIB_API getaddrinfo(const char *node, const char *service,
int getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res)
{
struct addrinfo *p;
@ -120,7 +119,7 @@ int HAMLIB_API getaddrinfo(const char *node, const char *service,
return 0;
}
void HAMLIB_API freeaddrinfo(struct addrinfo *res)
void freeaddrinfo(struct addrinfo *res)
{
free(res->ai_addr);
free(res);
@ -133,4 +132,3 @@ const char *gai_strerror(int errcode)
return strerror(errcode);
}
#endif /* !HAVE_DECL_GAI_STRERROR */

Wyświetl plik

@ -842,18 +842,4 @@ void HAMLIB_API rig_force_cache_timeout(struct timeval *tv)
}
int HAMLIB_API rig_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res)
{
return getaddrinfo(node, service, hints, res);
}
void HAMLIB_API rig_freeaddrinfo(struct addrinfo *res)
{
freeaddrinfo(res);
}
/** @} */

Wyświetl plik

@ -25,9 +25,7 @@ noinst_HEADERS = sprintflst.h rigctl_parse.h rotctl_parse.h uthash.h
# all the programs need this
########## LDADD = $(top_builddir)/src/libhamlib.la $(top_builddir)/lib/libmisc.la
### No, because libmisc is already in libhamlib.
LDADD = $(top_builddir)/src/libhamlib.la
LDADD = $(top_builddir)/src/libhamlib.la $(top_builddir)/lib/libmisc.la
DEPENDENCIES = $(top_builddir)/src/libhamlib.la
rigmem_CFLAGS = $(AM_CFLAGS) @LIBXML2_CFLAGS@

Wyświetl plik

@ -383,7 +383,7 @@ int main (int argc, char *argv[])
hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */
hints.ai_protocol = 0; /* Any protocol */
retcode = rig_getaddrinfo(src_addr, portno, &hints, &result);
retcode = getaddrinfo(src_addr, portno, &hints, &result);
if (retcode != 0) {
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(retcode));
exit(2);
@ -406,7 +406,7 @@ int main (int argc, char *argv[])
exit (1);
}
rig_freeaddrinfo(result); /* No longer needed */
freeaddrinfo(result); /* No longer needed */
if (listen(sock_listen, 4) < 0) {
rig_debug(RIG_DEBUG_ERR, "listening: %s\n", strerror(errno));

Wyświetl plik

@ -295,7 +295,7 @@ int main (int argc, char *argv[])
hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */
hints.ai_protocol = 0; /* Any protocol */
retcode = rig_getaddrinfo(src_addr, portno, &hints, &result);
retcode = getaddrinfo(src_addr, portno, &hints, &result);
if (retcode != 0) {
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(retcode));
exit(2);
@ -318,7 +318,7 @@ int main (int argc, char *argv[])
exit (1);
}
rig_freeaddrinfo(result); /* No longer needed */
freeaddrinfo(result); /* No longer needed */
if (listen(sock_listen,4) < 0) {
rig_debug(RIG_DEBUG_ERR, "listening: %s\n", strerror(errno));