From 72bea99a8fb37a82ba1db9c3d8e483e43d5091a2 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Sun, 28 Oct 2012 05:23:39 +0100 Subject: [PATCH] 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 --- configure.ac | 22 ++++++++++++++++++++++ libfuse-lite/Makefile.am | 1 + 2 files changed, 23 insertions(+) diff --git a/configure.ac b/configure.ac index 64b16067..219ae47c 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/libfuse-lite/Makefile.am b/libfuse-lite/Makefile.am index 800b412d..d9591ec4 100644 --- a/libfuse-lite/Makefile.am +++ b/libfuse-lite/Makefile.am @@ -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)