summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-02-17 23:11:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:45 -0500
commitc52fb55903fc68dd6e9d13f618277b2c12e17aa6 (patch)
treed71b34db517d01b847a30454536270b3c3d79999 /source4/build
parenta2aa220709eca6dd260d9eeecf918f9bb129d8ed (diff)
downloadsamba-c52fb55903fc68dd6e9d13f618277b2c12e17aa6.tar.gz
samba-c52fb55903fc68dd6e9d13f618277b2c12e17aa6.tar.bz2
samba-c52fb55903fc68dd6e9d13f618277b2c12e17aa6.zip
r5437: Allow Samba4 to be compiled by tcc (www.tinycc.org). It still crashes when linking though.
(This used to be commit 2e1e8db6dc877eb32b51cfc3d9c8f463d14530ec)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/smb_build/public.m417
1 files changed, 13 insertions, 4 deletions
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)