llvm.org GIT mirror llvm / 46e6bcf
Add support for detecting libxml for Dmitri's work. He'll commit code in clang that uses this shortly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161252 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
4 changed file(s) with 174 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
346346 # bfd ld / gold --version-script=file
347347 HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@
348348
349 # Flags to control using libxml2
350 LIBXML2_LIBS := @LIBXML2_LIBS@
351 LIBXML2_INC := @LIBXML2_INC@
352
349353 # Flags to control building support for Intel JIT Events API
350354 USE_INTEL_JITEVENTS := @USE_INTEL_JITEVENTS@
351355 INTEL_JITEVENTS_INCDIR := @INTEL_JITEVENTS_INCDIR@
12911291 AC_DEFINE_UNQUOTED([LLVM_USE_INTEL_JITEVENTS],$USE_INTEL_JITEVENTS,
12921292 [Define if we have the Intel JIT API runtime support library])
12931293
1294 dnl Check for libxml2
1295 dnl Right now we're just checking for the existence, we could also check for a
1296 dnl particular version via --version on xml2-config
1297 AC_CHECK_PROGS(XML2CONFIG, xml2-config)
1298
1299 AC_MSG_CHECKING(for libxml2 includes)
1300 if test "x$XML2CONFIG" = "x"; then
1301 AC_MSG_RESULT(xml2-config not found)
1302 else
1303 LIBXML2_INC=`$XML2CONFIG --cflags`
1304 AC_MSG_RESULT($LIBXML2_INC)
1305 AC_CHECK_LIB(xml2, xmlReadFile,[AC_DEFINE([CLANG_HAVE_LIBXML],1,[Define if we have libxml2])
1306 LIBXML2_LIBS="-lxml2"])
1307 fi
1308 AC_SUBST(LIBXML2_LIBS)
1309 AC_SUBST(LIBXML2_INC)
1310
12941311 dnl===-----------------------------------------------------------------------===
12951312 dnl===
12961313 dnl=== SECTION 6: Check for header files
765765 USE_INTEL_JITEVENTS
766766 INTEL_JITEVENTS_INCDIR
767767 INTEL_JITEVENTS_LIBDIR
768 XML2CONFIG
769 LIBXML2_LIBS
770 LIBXML2_INC
768771 HAVE_PTHREAD
769772 HUGE_VAL_SANITY
770773 MMAP_FILE
1023010233 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1023110234 lt_status=$lt_dlunknown
1023210235 cat > conftest.$ac_ext <
10233 #line 10234 "configure"
10236 #line 10237 "configure"
1023410237 #include "confdefs.h"
1023510238
1023610239 #if HAVE_DLFCN_H
1380313806 cat >>confdefs.h <<_ACEOF
1380413807 #define LLVM_USE_INTEL_JITEVENTS $USE_INTEL_JITEVENTS
1380513808 _ACEOF
13809
13810
13811 for ac_prog in xml2-config
13812 do
13813 # Extract the first word of "$ac_prog", so it can be a program name with args.
13814 set dummy $ac_prog; ac_word=$2
13815 { echo "$as_me:$LINENO: checking for $ac_word" >&5
13816 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
13817 if test "${ac_cv_prog_XML2CONFIG+set}" = set; then
13818 echo $ECHO_N "(cached) $ECHO_C" >&6
13819 else
13820 if test -n "$XML2CONFIG"; then
13821 ac_cv_prog_XML2CONFIG="$XML2CONFIG" # Let the user override the test.
13822 else
13823 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13824 for as_dir in $PATH
13825 do
13826 IFS=$as_save_IFS
13827 test -z "$as_dir" && as_dir=.
13828 for ac_exec_ext in '' $ac_executable_extensions; do
13829 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
13830 ac_cv_prog_XML2CONFIG="$ac_prog"
13831 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
13832 break 2
13833 fi
13834 done
13835 done
13836 IFS=$as_save_IFS
13837
13838 fi
13839 fi
13840 XML2CONFIG=$ac_cv_prog_XML2CONFIG
13841 if test -n "$XML2CONFIG"; then
13842 { echo "$as_me:$LINENO: result: $XML2CONFIG" >&5
13843 echo "${ECHO_T}$XML2CONFIG" >&6; }
13844 else
13845 { echo "$as_me:$LINENO: result: no" >&5
13846 echo "${ECHO_T}no" >&6; }
13847 fi
13848
13849
13850 test -n "$XML2CONFIG" && break
13851 done
13852
13853
13854 { echo "$as_me:$LINENO: checking for libxml2 includes" >&5
13855 echo $ECHO_N "checking for libxml2 includes... $ECHO_C" >&6; }
13856 if test "x$XML2CONFIG" = "x"; then
13857 { echo "$as_me:$LINENO: result: xml2-config not found" >&5
13858 echo "${ECHO_T}xml2-config not found" >&6; }
13859 else
13860 LIBXML2_INC=`$XML2CONFIG --cflags`
13861 { echo "$as_me:$LINENO: result: $LIBXML2_INC" >&5
13862 echo "${ECHO_T}$LIBXML2_INC" >&6; }
13863 { echo "$as_me:$LINENO: checking for xmlReadFile in -lxml2" >&5
13864 echo $ECHO_N "checking for xmlReadFile in -lxml2... $ECHO_C" >&6; }
13865 if test "${ac_cv_lib_xml2_xmlReadFile+set}" = set; then
13866 echo $ECHO_N "(cached) $ECHO_C" >&6
13867 else
13868 ac_check_lib_save_LIBS=$LIBS
13869 LIBS="-lxml2 $LIBS"
13870 cat >conftest.$ac_ext <<_ACEOF
13871 /* confdefs.h. */
13872 _ACEOF
13873 cat confdefs.h >>conftest.$ac_ext
13874 cat >>conftest.$ac_ext <<_ACEOF
13875 /* end confdefs.h. */
13876
13877 /* Override any GCC internal prototype to avoid an error.
13878 Use char because int might match the return type of a GCC
13879 builtin and then its argument prototype would still apply. */
13880 #ifdef __cplusplus
13881 extern "C"
13882 #endif
13883 char xmlReadFile ();
13884 int
13885 main ()
13886 {
13887 return xmlReadFile ();
13888 ;
13889 return 0;
13890 }
13891 _ACEOF
13892 rm -f conftest.$ac_objext conftest$ac_exeext
13893 if { (ac_try="$ac_link"
13894 case "(($ac_try" in
13895 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13896 *) ac_try_echo=$ac_try;;
13897 esac
13898 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
13899 (eval "$ac_link") 2>conftest.er1
13900 ac_status=$?
13901 grep -v '^ *+' conftest.er1 >conftest.err
13902 rm -f conftest.er1
13903 cat conftest.err >&5
13904 echo "$as_me:$LINENO: \$? = $ac_status" >&5
13905 (exit $ac_status); } &&
13906 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
13907 { (case "(($ac_try" in
13908 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13909 *) ac_try_echo=$ac_try;;
13910 esac
13911 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
13912 (eval "$ac_try") 2>&5
13913 ac_status=$?
13914 echo "$as_me:$LINENO: \$? = $ac_status" >&5
13915 (exit $ac_status); }; } &&
13916 { ac_try='test -s conftest$ac_exeext'
13917 { (case "(($ac_try" in
13918 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
13919 *) ac_try_echo=$ac_try;;
13920 esac
13921 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
13922 (eval "$ac_try") 2>&5
13923 ac_status=$?
13924 echo "$as_me:$LINENO: \$? = $ac_status" >&5
13925 (exit $ac_status); }; }; then
13926 ac_cv_lib_xml2_xmlReadFile=yes
13927 else
13928 echo "$as_me: failed program was:" >&5
13929 sed 's/^/| /' conftest.$ac_ext >&5
13930
13931 ac_cv_lib_xml2_xmlReadFile=no
13932 fi
13933
13934 rm -f core conftest.err conftest.$ac_objext \
13935 conftest$ac_exeext conftest.$ac_ext
13936 LIBS=$ac_check_lib_save_LIBS
13937 fi
13938 { echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlReadFile" >&5
13939 echo "${ECHO_T}$ac_cv_lib_xml2_xmlReadFile" >&6; }
13940 if test $ac_cv_lib_xml2_xmlReadFile = yes; then
13941
13942 cat >>confdefs.h <<\_ACEOF
13943 #define CLANG_HAVE_LIBXML 1
13944 _ACEOF
13945
13946 LIBXML2_LIBS="-lxml2"
13947 fi
13948
13949 fi
13950
1380613951
1380713952
1380813953
2208022225 USE_INTEL_JITEVENTS!$USE_INTEL_JITEVENTS$ac_delim
2208122226 INTEL_JITEVENTS_INCDIR!$INTEL_JITEVENTS_INCDIR$ac_delim
2208222227 INTEL_JITEVENTS_LIBDIR!$INTEL_JITEVENTS_LIBDIR$ac_delim
22228 XML2CONFIG!$XML2CONFIG$ac_delim
22229 LIBXML2_LIBS!$LIBXML2_LIBS$ac_delim
22230 LIBXML2_INC!$LIBXML2_INC$ac_delim
2208322231 HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim
2208422232 HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim
2208522233 MMAP_FILE!$MMAP_FILE$ac_delim
2210522253 LTLIBOBJS!$LTLIBOBJS$ac_delim
2210622254 _ACEOF
2210722255
22108 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
22256 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 93; then
2210922257 break
2211022258 elif $ac_last_try; then
2211122259 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
44
55 /* Bug report URL. */
66 #undef BUG_REPORT_URL
7
8 /* Define if we have libxml2 */
9 #undef CLANG_HAVE_LIBXML
710
811 /* Relative directory for resource files */
912 #undef CLANG_RESOURCE_DIR