From 2b02c9fd5dbc0acb417eacc905335afafe191f39 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Sun, 25 May 2008 17:23:49 +0000 Subject: [PATCH] Add fail for required X libraries git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@26572 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 ++++ configure | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 9 +++++- 3 files changed, 89 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a7fbfc..91c942a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-25 Adam Fedor + + * configure.ac: Fail if libXext or libXt not found when building + x11 server. Set have_freetype variable. + 2008-05-25 Nicola Pero * Tools/GNUmakefile.postamble: Use GNUSTEP_DOC instead of diff --git a/configure b/configure index 23bcc49..04c523b 100755 --- a/configure +++ b/configure @@ -5182,6 +5182,71 @@ _ACEOF fi +{ echo "$as_me:$LINENO: checking for main in -lXt" >&5 +echo $ECHO_N "checking for main in -lXt... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xt_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXt $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_Xt_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xt_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xt_main" >&5 +echo "${ECHO_T}$ac_cv_lib_Xt_main" >&6; } +if test $ac_cv_lib_Xt_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXT 1 +_ACEOF + + LIBS="-lXt $LIBS" + +fi + + { echo "$as_me:$LINENO: checking for main in -lXmu" >&5 echo $ECHO_N "checking for main in -lXmu... $ECHO_C" >&6; } if test "${ac_cv_lib_Xmu_main+set}" = set; then @@ -5449,11 +5514,11 @@ else fi +have_freetype=no if test $with_freetype = yes; then FREETYPE_LIBS="`freetype-config --libs`" FREETYPE_CFLAGS="`freetype-config --cflags`" - have_freetype=no if test x"$FREETYPE_LIBS" != x; then save_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} ${FREETYPE_CFLAGS}" @@ -9008,6 +9073,16 @@ if test $BUILD_SERVER = x11; then echo "$as_me: error: No X11 libraries/headers for building x11 server" >&2;} { (exit 1); exit 1; }; } fi + if test "$ac_cv_lib_Xt_main" = no; then + { { echo "$as_me:$LINENO: error: libXt not found - required for building x11 server" >&5 +echo "$as_me: error: libXt not found - required for building x11 server" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$ac_cv_lib_Xext" = no; then + { { echo "$as_me:$LINENO: error: libXext not found - required for building x11 server" >&5 +echo "$as_me: error: libXext not found - required for building x11 server" >&2;} + { (exit 1); exit 1; }; } + fi if test "x$WITH_GLX" = "xyes"; then LIBS="$LIBS $GLX_LIBS" CPPFLAGS="$CPPFLAGS $GLX_CFLAGS" diff --git a/configure.ac b/configure.ac index 0cada6a..5ab5d37 100644 --- a/configure.ac +++ b/configure.ac @@ -138,6 +138,7 @@ if test $set_x_paths = yes; then LIBS="-lX11 $X_EXTRA_LIBS $LIBS" AC_CHECK_LIB(Xext, main) + AC_CHECK_LIB(Xt, main) AC_CHECK_LIB(Xmu, main) LIBS="$X_LIBS $LIBS" fi @@ -177,11 +178,11 @@ AC_ARG_WITH(freetype, [ --without-freetype Do not check for or include freetype], , with_freetype=yes) +have_freetype=no if test $with_freetype = yes; then FREETYPE_LIBS="`freetype-config --libs`" FREETYPE_CFLAGS="`freetype-config --cflags`" - have_freetype=no if test x"$FREETYPE_LIBS" != x; then save_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} ${FREETYPE_CFLAGS}" @@ -562,6 +563,12 @@ if test $BUILD_SERVER = x11; then if test $set_x_paths = no; then AC_MSG_ERROR([No X11 libraries/headers for building x11 server]) fi + if test "$ac_cv_lib_Xt_main" = no; then + AC_MSG_ERROR([libXt not found - required for building x11 server]) + fi + if test "$ac_cv_lib_Xext" = no; then + AC_MSG_ERROR([libXext not found - required for building x11 server]) + fi if test "x$WITH_GLX" = "xyes"; then LIBS="$LIBS $GLX_LIBS" CPPFLAGS="$CPPFLAGS $GLX_CFLAGS"