comparison configure.ac @ 23005:8e9dd0d6e337

update check for pcre library to use pkg-config (bug #49993) * configure.ac: Use PKG_CONFIG to check for pcre library. Define PCRE_LDFLAGS separately from PCRE_LIBS. Display PCRE_LDFLAGS in summary message. * subst-config-vals.in.sh, subst-cross-config-vals.in.sh: Also substitute PCRE_LDFLAGS. * libinterp/corefcn/toplev.cc (F__octave_config_info__): Also include PCRE_LDFLAGS in the struct. * libinterp/build-env.in.cc, libinterp/build-env.h (PCRE_LDFLAGS): New variable.
author John W. Eaton <jwe@octave.org>
date Fri, 06 Jan 2017 08:08:58 -0500
parents 5fdf29cb4ab8
children b8cef5f05dcd
comparison
equal deleted inserted replaced
23004:71f19f38cbad 23005:8e9dd0d6e337
1337 [AC_DEFINE(HAVE_QHULL, 1, [Define to 1 if Qhull is available.])], 1337 [AC_DEFINE(HAVE_QHULL, 1, [Define to 1 if Qhull is available.])],
1338 [warn_qhull="Qhull library found, but does not seem to work properly. This will result in loss of functionality of some geometry functions. Please try recompiling the library with -fno-strict-aliasing."])]) 1338 [warn_qhull="Qhull library found, but does not seem to work properly. This will result in loss of functionality of some geometry functions. Please try recompiling the library with -fno-strict-aliasing."])])
1339 1339
1340 ### Check for PCRE regex library. 1340 ### Check for PCRE regex library.
1341 1341
1342 PCRE_LIBS= 1342 PKG_CHECK_EXISTS([libpcre],
1343 1343 [AC_CHECK_HEADERS([pcre.h pcre/pcre.h])
1344 pcre_fail_msg="to build Octave, you must have the PCRE library and header files installed" 1344 PCRE_CPPFLAGS=`$PKG_CONFIG --cflags-only-I libpcre`
1345 1345 PCRE_LDFLAGS=`$PKG_CONFIG --libs-only-L libpcre`
1346 AC_CHECK_HEADERS([pcre.h pcre/pcre.h]) 1346 PCRE_LIBS=`$PKG_CONFIG --libs-only-l libpcre`
1347 1347 AC_SUBST(PCRE_CPPFLAGS)
1348 AC_CACHE_CHECK([whether pcre.h defines the macros we need], 1348 AC_SUBST(PCRE_LDFLAGS)
1349 [ac_cv_pcre_h_macros_present], 1349 AC_SUBST(PCRE_LIBS)],
1350 [AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [ 1350 [AC_MSG_ERROR([to build Octave, you must have the PCRE library and header files installed])])
1351 #if defined (HAVE_PCRE_H)
1352 # include <pcre.h>
1353 #elif defined (HAVE_PCRE_PCRE_H)
1354 # include <pcre/pcre.h>
1355 #error "NO PCRE HEADER"
1356 #endif
1357 #if defined (PCRE_INFO_NAMECOUNT) \
1358 && defined (PCRE_INFO_NAMEENTRYSIZE) \
1359 && defined (PCRE_INFO_NAMETABLE)
1360 PCRE_HAS_MACROS_WE_NEED
1361 #endif],
1362 ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)])
1363
1364 if test $ac_cv_pcre_h_macros_present = yes; then
1365 ## check for pcre-config, and if so, get build variables
1366 AC_CHECK_PROG(HAVE_PCRE_CONFIG, pcre-config, [yes], [no])
1367 if test $HAVE_PCRE_CONFIG = yes; then
1368 PCRE_CPPFLAGS=`pcre-config --cflags`
1369 PCRE_LIBS=`pcre-config --libs`
1370 else
1371 PCRE_LIBS="-lpcre"
1372 fi
1373 save_LIBS="$LIBS"
1374 LIBS="$PCRE_LIBS $LIBS"
1375 AC_CHECK_FUNCS([pcre_compile],
1376 [AC_SUBST(PCRE_CPPFLAGS)
1377 AC_SUBST(PCRE_LIBS)],
1378 [AC_MSG_ERROR([$pcre_fail_msg])])
1379 LIBS="$save_LIBS"
1380 else
1381 AC_MSG_ERROR([$pcre_fail_msg])
1382 fi
1383 1351
1384 ### Check for ZLIB library. 1352 ### Check for ZLIB library.
1385 1353
1386 OCTAVE_CHECK_LIB(z, ZLIB, 1354 OCTAVE_CHECK_LIB(z, ZLIB,
1387 [ZLIB library not found. Octave will not be able to save or load compressed data files or HDF5 files.], 1355 [ZLIB library not found. Octave will not be able to save or load compressed data files or HDF5 files.],
1389 1357
1390 ### Also define HAVE_ZLIB if libz is found. 1358 ### Also define HAVE_ZLIB if libz is found.
1391 if test -z "$warn_z"; then 1359 if test -z "$warn_z"; then
1392 AC_DEFINE(HAVE_ZLIB, 1, [Define to 1 if ZLIB is available.]) 1360 AC_DEFINE(HAVE_ZLIB, 1, [Define to 1 if ZLIB is available.])
1393 fi 1361 fi
1394
1395 1362
1396 ### Check for BZIP2 library. 1363 ### Check for BZIP2 library.
1397 1364
1398 OCTAVE_CHECK_LIB(bz2, BZIP2, 1365 OCTAVE_CHECK_LIB(bz2, BZIP2,
1399 [BZIP2 library not found. Octave will not be able to compress or decompress bzip2 files.], 1366 [BZIP2 library not found. Octave will not be able to compress or decompress bzip2 files.],
3022 2989
3023 AC_SUBST(GNULIB_LINK_DEPS) 2990 AC_SUBST(GNULIB_LINK_DEPS)
3024 2991
3025 LIBOCTAVE_LINK_DEPS="$GNULIB_LINK_DEPS $CURL_LIBS $SPARSE_XLIBS $ARPACK_LIBS $QRUPDATE_LIBS $FFTW_XLIBS $LAPACK_LIBS $BLAS_LIBS $READLINE_LIBS $TERM_LIBS $LIBGLOB $PCRE_LIBS $DL_LIBS $PTHREAD_LIBS $FLIBS $LIBS" 2992 LIBOCTAVE_LINK_DEPS="$GNULIB_LINK_DEPS $CURL_LIBS $SPARSE_XLIBS $ARPACK_LIBS $QRUPDATE_LIBS $FFTW_XLIBS $LAPACK_LIBS $BLAS_LIBS $READLINE_LIBS $TERM_LIBS $LIBGLOB $PCRE_LIBS $DL_LIBS $PTHREAD_LIBS $FLIBS $LIBS"
3026 2993
3027 LIBOCTAVE_LINK_OPTS="$CURL_LDFLAGS $SPARSE_XLDFLAGS $ARPACK_LDFLAGS $QRUPDATE_LDFLAGS $FFTW_XLDFLAGS" 2994 LIBOCTAVE_LINK_OPTS="$CURL_LDFLAGS $SPARSE_XLDFLAGS $ARPACK_LDFLAGS $QRUPDATE_LDFLAGS $FFTW_XLDFLAGS $PCRE_LDFLAGS"
3028 2995
3029 AC_SUBST(LIBOCTAVE_LINK_DEPS) 2996 AC_SUBST(LIBOCTAVE_LINK_DEPS)
3030 AC_SUBST(LIBOCTAVE_LINK_OPTS) 2997 AC_SUBST(LIBOCTAVE_LINK_OPTS)
3031 2998
3032 if test $ENABLE_DYNAMIC_LINKING = yes; then 2999 if test $ENABLE_DYNAMIC_LINKING = yes; then
3321 OPENGL libraries: $OPENGL_LIBS 3288 OPENGL libraries: $OPENGL_LIBS
3322 OSMesa CPPFLAGS: $OSMESA_CPPFLAGS 3289 OSMesa CPPFLAGS: $OSMESA_CPPFLAGS
3323 OSMesa LDFLAGS: $OSMESA_LDFLAGS 3290 OSMesa LDFLAGS: $OSMESA_LDFLAGS
3324 OSMesa libraries: $OSMESA_LIBS 3291 OSMesa libraries: $OSMESA_LIBS
3325 PCRE CPPFLAGS: $PCRE_CPPFLAGS 3292 PCRE CPPFLAGS: $PCRE_CPPFLAGS
3293 PCRE LDFLAGS: $PCRE_LDFLAGS
3326 PCRE libraries: $PCRE_LIBS 3294 PCRE libraries: $PCRE_LIBS
3327 PortAudio CPPFLAGS: $PORTAUDIO_CPPFLAGS 3295 PortAudio CPPFLAGS: $PORTAUDIO_CPPFLAGS
3328 PortAudio LDFLAGS: $PORTAUDIO_LDFLAGS 3296 PortAudio LDFLAGS: $PORTAUDIO_LDFLAGS
3329 PortAudio libraries: $PORTAUDIO_LIBS 3297 PortAudio libraries: $PORTAUDIO_LIBS
3330 PTHREAD flags: $PTHREAD_CFLAGS 3298 PTHREAD flags: $PTHREAD_CFLAGS