PageRenderTime 19ms CodeModel.GetById 17ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/crypto/heimdal/cf/check-x.m4

https://bitbucket.org/freebsd/freebsd-head/
m4 | 53 lines | 48 code | 2 blank | 3 comment | 0 complexity | 8c714552dfe6e4e1b8389f2781270f9e MD5 | raw file
 1dnl 
 2dnl See if there is any X11 present
 3dnl
 4dnl $Id: check-x.m4 15435 2005-06-16 19:45:52Z lha $
 5
 6AC_DEFUN([KRB_CHECK_X],[
 7AC_PATH_XTRA
 8
 9# try to figure out if we need any additional ld flags, like -R
10# and yes, the autoconf X test is utterly broken
11if test "$no_x" != yes; then
12	AC_CACHE_CHECK(for special X linker flags,krb_cv_sys_x_libs_rpath,[
13	ac_save_libs="$LIBS"
14	ac_save_cflags="$CFLAGS"
15	CFLAGS="$CFLAGS $X_CFLAGS"
16	krb_cv_sys_x_libs_rpath=""
17	krb_cv_sys_x_libs=""
18	for rflag in "" "-R" "-R " "-rpath "; do
19		if test "$rflag" = ""; then
20			foo="$X_LIBS"
21		else
22			foo=""
23			for flag in $X_LIBS; do
24			case $flag in
25			-L*)
26				foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`"
27				;;
28			*)
29				foo="$foo $flag"
30				;;
31			esac
32			done
33		fi
34		LIBS="$ac_save_libs $foo $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
35		AC_RUN_IFELSE([
36		#include <X11/Xlib.h>
37		foo(void)
38		{
39		XOpenDisplay(NULL);
40		}
41		main(int argc, char **argv)
42		{
43		return 0;
44		}
45		],krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:,
46		krb_cv_sys_x_libs_rpath="" ; krb_cv_sys_x_libs="" ; break)
47	done
48	LIBS="$ac_save_libs"
49	CFLAGS="$ac_save_cflags"
50	])
51	X_LIBS="$krb_cv_sys_x_libs"
52fi
53])