Fix compilation of libfuse-lite on Solaris/OpenIndiana.

The OpenSolaris port of libfuse, from which our Solaris-port of
libfuse-lite originated, had to be supplied with some additional
compiler flags in order to compile.
The configure script now detects whether it is running on a Solaris
system. If that is the case it passes the proper compiler flags to
libfuse-lite, so it can compile properly.

Tested on:
- OpenIndiana oi_151a3 / gcc 3.4.3
- OpenIndiana oi_151a7 / gcc 4.3.3
- Solaris 11.1 / gcc 4.5.2
This commit is contained in:
Erik Larsson 2012-10-28 05:23:39 +01:00
parent 941a22e7f8
commit 72bea99a8f
2 changed files with 23 additions and 0 deletions

View File

@ -274,6 +274,27 @@ if test "${with_fuse}" = "internal"; then
[1],
[Define to 1 if using internal fuse]
)
AC_MSG_CHECKING([Solaris OS])
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE(
[
AC_LANG_SOURCE(
[[#if !((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)))]]
[[#error "Not a Solaris system."]]
[[#endif]]
)
],
[
AC_MSG_RESULT([yes])
LIBFUSE_LITE_CFLAGS="${LIBFUSE_LITE_CFLAGS} -std=c99 -D__SOLARIS__ -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
LIBFUSE_LITE_LIBS="${LIBFUSE_LITE_LIBS} -lxnet"
],
[
AC_MSG_RESULT([no])
]
)
AC_LANG_POP([C])
elif test "${with_fuse}" = "external"; then
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
@ -499,6 +520,7 @@ AC_SUBST([rootbindir])
AC_SUBST([rootsbindir])
AC_SUBST([rootlibdir])
AC_SUBST([LIBNTFS_3G_VERSION])
AC_SUBST([LIBFUSE_LITE_CFLAGS])
AC_SUBST([LIBFUSE_LITE_LIBS])
AC_SUBST([MKNTFS_CPPFLAGS])
AC_SUBST([MKNTFS_LIBS])

View File

@ -7,6 +7,7 @@ endif
libfuse_lite_la_CFLAGS= \
$(AM_CFLAGS) \
$(LIBFUSE_LITE_CFLAGS) \
-I$(top_srcdir)/include/fuse-lite
libfuse_lite_la_LIBADD = $(LIBFUSE_LITE_LIBS)