summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorBenjamin Reed <ranger@Sin.local>2008-01-28 13:25:56 -0500
committerJohn (J5) Palmieri <johnp@redhat.com>2008-03-04 10:31:28 -0500
commitee4a0dce33a556bac188cc382c28e2acb75b1a5d (patch)
tree8b5d4451963975b51cb878048a5108751133515f /configure.in
parent9f48c74cb6f24bcbac63bed2aac4483034e5e843 (diff)
Platform build fixes for Mac OS X
- the Darwin linker does not understand the -z option; wrap it in a check for $with_gnu_ld. - environ is only available at runtime, so you need to make a reference to _NSGetEnviron instead for symbols to resolve properly.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 20 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 53fa59e5..bb28708c 100644
--- a/configure.in
+++ b/configure.in
@@ -214,7 +214,9 @@ if test "x$GCC" = "xyes"; then
*[\ \ ]-fPIC[\ \ ]*) ;;
*) if cc_supports_flag -fPIC; then
PIC_CFLAGS="-fPIC"
- PIC_LDFLAGS="-Wl,-z,relro"
+ if [ "x$with_gnu_ld" = "xyes" ]; then
+ PIC_LDFLAGS="-Wl,-z,relro"
+ fi
fi
;;
esac
@@ -223,7 +225,11 @@ if test "x$GCC" = "xyes"; then
*[\ \ ]-fPIE[\ \ ]*) ;;
*) if cc_supports_flag -fPIE; then
PIE_CFLAGS="-fPIE"
- PIE_LDFLAGS="-pie -Wl,-z,relro"
+ if [ "x$with_gnu_ld" = "xyes" ]; then
+ PIE_LDFLAGS="-pie -Wl,-z,relro"
+ else
+ PIE_LDFLAGS="-pie"
+ fi
fi
;;
esac
@@ -1273,6 +1279,18 @@ AC_SUBST(DBUS_SESSION_SOCKET_DIR)
AC_DEFINE_UNQUOTED(DBUS_UNIX, "1", [Defined on UNIX and Linux systems and not on Windows])
+# darwin needs this to initialize the environment
+AC_CHECK_HEADERS(crt_externs.h)
+AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
+AH_VERBATIM(_DARWIN_ENVIRON,
+[
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+# include <sys/time.h>
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+])
+
AC_OUTPUT([
Doxyfile
dbus/dbus-arch-deps.h