From c52fb55903fc68dd6e9d13f618277b2c12e17aa6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Feb 2005 23:11:26 +0000 Subject: r5437: Allow Samba4 to be compiled by tcc (www.tinycc.org). It still crashes when linking though. (This used to be commit 2e1e8db6dc877eb32b51cfc3d9c8f463d14530ec) --- source4/build/smb_build/public.m4 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'source4/build/smb_build') diff --git a/source4/build/smb_build/public.m4 b/source4/build/smb_build/public.m4 index 74f98b1c15..6ce57b0083 100644 --- a/source4/build/smb_build/public.m4 +++ b/source4/build/smb_build/public.m4 @@ -172,16 +172,25 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG], elif $PKG_CONFIG --exists '$2' ; then AC_MSG_RESULT(yes) - SMB_EXT_LIB_ENABLE($1, YES) + + $1_CFLAGS="`$PKG_CONFIG --cflags '$2'`" + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $$1_CFLAGS" + AC_MSG_CHECKING([that the C compiler can use the $1_CFLAGS]) + AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"], + SMB_EXT_LIB_ENABLE($1, YES) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no), + AC_MSG_WARN([cannot run when cross-compiling])) + + CFLAGS="$OLD_CFLAGS" + SMB_EXT_LIB($1, [`$PKG_CONFIG --libs-only-l '$2'`], [`$PKG_CONFIG --cflags-only-other '$2'`], [`$PKG_CONFIG --cflags-only-I '$2'`], [`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`]) - # FIXME: Dirty hack - $1_CFLAGS="`$PKG_CONFIG --cflags '$2'`" - CFLAGS="$CFLAGS $$1_CFLAGS" else SMB_EXT_LIB($1) SMB_EXT_LIB_ENABLE($1, NO) -- cgit