Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure script : check for <ifaddrs.h> #523

Merged
merged 3 commits into from Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion platforms/Cross/vm/sqCogStackAlignment.h
Expand Up @@ -17,7 +17,7 @@
/* getReturnAddress optionally defined here rather than in sqPlatformSpecific.h
* to reduce duplication. The GCC intrinics are provided by other compilers too.
*/
#if !defined(getReturnAddress)
#if COGVM && !defined(getReturnAddress)
# if _MSC_VER
# define getReturnAddress() _ReturnAddress()
# include <intrin.h>
Expand Down
3 changes: 3 additions & 0 deletions platforms/unix/config/config.h.in
Expand Up @@ -114,6 +114,9 @@
/* Define to 1 if you have the <iconv.h> header file. */
#undef HAVE_ICONV_H

/* Define to 1 if you have the <ifaddrs.h> header file. */
#undef HAVE_IFADDRS_H

/* Interpreter header file present */
#undef HAVE_INTERP_H

Expand Down
1 change: 1 addition & 0 deletions platforms/unix/config/configure.ac
Expand Up @@ -292,6 +292,7 @@ AC_HEADER_STDC
AC_CHECK_HEADERS_ONCE([unistd.h string.h fcntl.h sys/file.h sys/param.h])
AC_CHECK_HEADERS_ONCE([sys/time.h sys/filio.h sys/select.h])
AC_CHECK_HEADERS_ONCE([features.h])
AC_CHECK_HEADERS_ONCE([ifaddrs.h]) # sqUnixSocket.c
AC_CHECK_HEADERS_ONCE([alloca.h]) # SunOS5
AC_HEADER_TIME
AC_HEADER_DIRENT
Expand Down
6 changes: 4 additions & 2 deletions platforms/unix/plugins/SocketPlugin/sqUnixSocket.c
Expand Up @@ -92,7 +92,9 @@
# include <netinet/tcp.h>
# include <arpa/inet.h>
# include <netdb.h>
#include <ifaddrs.h>
#ifdef HAVE_IFADDRS_H
# include <ifaddrs.h>
#endif
# include <errno.h>
# include <unistd.h>

Expand Down Expand Up @@ -1499,7 +1501,7 @@ sqInt sqResolverStatus(void)
sqInt sqResolverAddrLookupResultSize(void) { return strlen(lastName); }
sqInt sqResolverError(void) { return lastError; }
sqInt sqResolverLocalAddress(void)
#if 0
#ifndef HAVE_IFADDRS_H
/* old code */
{ sqInt localaddr = nameToAddr(localHostName);
if (!localaddr)
Expand Down
26 changes: 26 additions & 0 deletions platforms/unix/plugins/UnicodePlugin/README.UnicodePlugin
@@ -1 +1,27 @@
In order to build the Unicode plugin on Linux, you'll need a collection of Pango, Cairo, and glib header and library files. These can often be found in the GTK+ development package in the package repository for your version of Linux.

NOTE: on Solaris 11.4 there is an issue that the UnicodePlugin is disabled,
because the XCPPFLAGS are incorrect.

XCPPFLAGS includes -I/usr/lib/glib-2.0/include -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include

The acinclude.m4 macro could be (but this may have other problems):

PKG_CHECK_MODULES(UNICODE_PLUGIN,[glib-2.0 pangocairo],,AC_PLUGIN_DISABLE)

AC_SUBST(UNICODE_PLUGIN_CFLAGS)
AC_SUBST(UNICODE_PLUGIN_LIBS)

The issue is that in the 32bit case

# pkg-config --cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

and in the 64bit (amd64 case)

# PKG_CONFIG_PATH=/usr/lib/64/pkgconfig pkg-config --cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/amd64/glib-2.0/include

There are workarounds such as disabling the Plugin (which is the case now),
or just patch the include path, and then it builds fine.