"Fossies" - the Fresh Open Source Software Archive

Member "pkg-config-0.29.2/configure.ac" (20 Mar 2017, 8585 Bytes) of package /linux/misc/pkg-config-0.29.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 0.29.1_vs_0.29.2.

    1 AC_PREREQ([2.62])
    2 AC_INIT([pkg-config],
    3         [0.29.2],
    4         [https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config],
    5         [pkg-config])
    6 
    7 AC_CONFIG_HEADERS([config.h])
    8 AC_CONFIG_SRCDIR([main.c])
    9 
   10 dnl Initialize automake. Sadly, we have to kludge around the automake
   11 dnl test driver here. We need to use the serial driver (for now), but
   12 dnl the parallel driver is the default in 1.13. So, we want to specify
   13 dnl the serial driver. Unfortunately, the option to specify that driver
   14 dnl didn't exist until 1.12.
   15 m4_define([automake_version],
   16     [m4_esyscmd([${AUTOMAKE-automake} --version |
   17                  awk '/^automake/{print $NF}'])])
   18 m4_define([automake_serial_tests],
   19     [m4_if(m4_version_compare(automake_version, [1.12]), [-1],
   20                                [], [serial-tests])])
   21 AM_INIT_AUTOMAKE([1.11 ]automake_serial_tests)
   22 
   23 dnl Initialize libtool
   24 LT_PREREQ([2.2])
   25 LT_INIT
   26 
   27 dnl Support silent build rules, requires at least automake-1.11. Disable
   28 dnl by either passing --disable-silent-rules to configure or passing V=1
   29 dnl to make
   30 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
   31 
   32 dnl Enable large file support
   33 AC_SYS_LARGEFILE
   34 
   35 dnl Check for programs
   36 AC_PROG_CC
   37 AC_CHECK_PROG([LN], [ln], [ln], [cp -Rp])
   38 
   39 dnl Check for headers
   40 AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h])
   41 
   42 dnl A POSIX shell is required for the tests. If TEST_SHELL hasn't been
   43 dnl set on the command line then we try to find bash or ksh or sh from
   44 dnl the path. If none of those are available, we just use whatever
   45 dnl autoconf detected for configure.
   46 AC_ARG_VAR([TESTS_SHELL], [Path to a POSIX shell to be used for testing])
   47 conf_path="$PATH:`getconf PATH 2>/dev/null`"
   48 AC_PATH_PROGS([TESTS_SHELL], [bash ksh sh], [$CONFIG_SHELL], [$conf_path])
   49 
   50 dnl The built pkg-config to use for testing. This allows it to be set
   51 dnl from the make command line if necessary.
   52 AC_SUBST([TESTS_PKG_CONFIG], ['${top_builddir}/pkg-config${EXEEXT}'])
   53 
   54 dnl
   55 dnl Default pkg-config search path
   56 dnl
   57 AC_MSG_CHECKING([for default search path for .pc files])
   58 AC_ARG_WITH([pc_path],
   59   [AS_HELP_STRING([--with-pc-path],
   60     [default search path for .pc files])],
   61   [pc_path="$withval"],
   62   [
   63 # This is slightly wrong, but hopefully causes less confusion than
   64 # people being unable to find their .pc files in the standard location.
   65 if test "${prefix}" = "NONE"; then
   66 	pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig'
   67 else
   68 	pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig'
   69 fi
   70 ])
   71 AC_MSG_RESULT([$pc_path])
   72 AC_SUBST([pc_path])
   73 
   74 dnl
   75 dnl System default -I paths
   76 dnl
   77 AC_MSG_CHECKING([for system include path to avoid -I flags])
   78 AC_ARG_WITH([system_include_path],
   79   [AS_HELP_STRING([--with-system-include-path],
   80     [avoid -I flags from the given path])],
   81   [system_include_path="$withval"],
   82   [system_include_path="/usr/include"])
   83 AC_MSG_RESULT([$system_include_path])
   84 AC_SUBST([system_include_path])
   85 
   86 dnl
   87 dnl System default -L paths
   88 dnl
   89 AC_MSG_CHECKING([for system library path to avoid -L flags])
   90 AC_ARG_WITH([system_library_path],
   91   [AS_HELP_STRING([--with-system-library-path],
   92     [avoid -L flags from the given path])],
   93   [system_library_path="$withval"],
   94   [
   95 pc_lib_sfx=`echo "$libdir" | sed 's:.*/lib::'`
   96 case "$pc_lib_sfx" in
   97 */*|"")
   98   system_library_path="/usr/lib:/lib"
   99   ;;
  100 *)
  101   system_library_path="/usr/lib$pc_lib_sfx:/lib$pc_lib_sfx:/usr/lib:/lib"
  102   ;;
  103 esac
  104 ])
  105 AC_MSG_RESULT([$system_library_path])
  106 AC_SUBST([system_library_path])
  107 
  108 dnl Code taken from gtk+-2.0's configure.in.
  109 dnl
  110 dnl This causes pkg-config to not list private dependencies (a very
  111 dnl common example is libm) on platforms which support inter-library
  112 dnl dependencies.
  113 dnl
  114 dnl When using libtool 2.x, we need to force libtool to be created
  115 dnl early so we can use it here.
  116 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
  117 
  118 AC_ARG_ENABLE([indirect-deps],
  119     [AS_HELP_STRING([--enable-indirect-deps],
  120                     [list both direct and indirect dependencies.])
  121      AS_HELP_STRING([--disable-indirect-deps],
  122                     [only list direct dependencies.])
  123     [default=auto]],
  124     [use_indirect_deps=$enableval],
  125     [use_indirect_deps=auto])
  126 echo use_indirect_deps=$use_indirect_deps >&AS_MESSAGE_LOG_FD
  127 AC_MSG_CHECKING([whether to list both direct and indirect dependencies])
  128 case $use_indirect_deps in
  129   auto)
  130     deplibs_check_method=`(./libtool --config; echo eval echo '\"$deplibs_check_method\"') | sh`
  131     if test "X$deplibs_check_method" = Xnone; then
  132     echo "foo: $deplibs_check_method" >&AS_MESSAGE_LOG_FD
  133       use_indirect_deps=yes
  134     else
  135       use_indirect_deps=no
  136     fi
  137   ;;
  138   yes|no)
  139   ;;
  140   *) AC_MSG_ERROR([Value given to --enable-indirect-deps must be one of yes, no
  141 or auto])
  142   ;;
  143 esac
  144 AC_MSG_RESULT($use_indirect_deps)
  145 AC_DEFINE_UNQUOTED([ENABLE_INDIRECT_DEPS],
  146     [`test $use_indirect_deps = yes && echo TRUE || echo FALSE`],
  147     [Link library to all dependent libraries, not only directly needed ones])
  148 AC_SUBST([use_indirect_deps])
  149 
  150 dnl
  151 dnl Choose default CFLAGS and warnings depending on compiler.
  152 dnl
  153 WARN_CFLAGS=""
  154 if test "${GCC}" = "yes" && test "${ac_env_CFLAGS_set}" != "set"; then
  155    WARN_CFLAGS="-g -Wall -O2"
  156 fi
  157 AC_SUBST(WARN_CFLAGS)
  158 
  159 AC_MSG_CHECKING([for Win32])
  160 case "$host" in
  161   *-*-mingw*)
  162     native_win32=yes
  163   ;;
  164   *)
  165     native_win32=no
  166   ;;
  167 esac
  168 AC_MSG_RESULT([$native_win32])
  169 AC_SUBST([native_win32])
  170 AM_CONDITIONAL(NATIVE_WIN32, [test "x$native_win32" = xyes])
  171 
  172 dnl When cross compiling to Windows, Wine might be available to help
  173 dnl for testing.
  174 if test "$cross_compiling" = yes && test "$native_win32" = yes; then
  175    AC_CHECK_PROG([WINE], [wine], [wine])
  176    test "x$WINE" != x && TESTS_PKG_CONFIG='${WINE} '"$TESTS_PKG_CONFIG"
  177 fi
  178 
  179 dnl On Windows, the prefix variable in .pc files can be redfined at
  180 dnl runtime. Allow the default behavior to be controlled.
  181 AC_MSG_CHECKING([if prefix should be redefined at runtime])
  182 AC_ARG_ENABLE([define_prefix],
  183   [AS_HELP_STRING([--enable-define-prefix],
  184     [redefine prefix in .pc files @<:@default=yes on Win32@:>@])],
  185   [],
  186   [enable_define_prefix=$native_win32])
  187 AC_MSG_RESULT([$enable_define_prefix])
  188 AC_DEFINE_UNQUOTED([ENABLE_DEFINE_PREFIX],
  189   [`test "x$enable_define_prefix" = xyes && echo TRUE || echo FALSE`],
  190   [Define ${prefix} in .pc files at runtime])
  191 
  192 dnl
  193 dnl Find glib or use internal copy. Required version is 2.16 for
  194 dnl g_win32_get_package_installation_directory_of_module().
  195 dnl
  196 dnl Pull in pkg-config macros to find external glib.
  197 dnl
  198 m4_include([pkg.m4.in])
  199 m4_define([glib_module], [glib-2.0 >= 2.16])
  200 AC_ARG_WITH([internal-glib],
  201   [AS_HELP_STRING([--with-internal-glib], [use internal glib])],
  202   [with_internal_glib="$withval"],
  203   [with_internal_glib=no])
  204 AM_CONDITIONAL([INTERNAL_GLIB], [test "x$with_internal_glib" = xyes])
  205 AC_MSG_CHECKING([if internal glib should be used])
  206 if test "x$with_internal_glib" = xyes; then
  207   AC_MSG_RESULT([yes])
  208   GLIB_CFLAGS='-I$(top_srcdir)/glib -I$(top_srcdir)/glib/glib \
  209     -I$(top_builddir)/glib/glib'
  210   GLIB_LIBS='$(top_builddir)/glib/glib/libglib-2.0.la'
  211   AC_CONFIG_SUBDIRS([glib])
  212 else
  213   AC_MSG_RESULT([no])
  214   PKG_CHECK_MODULES([GLIB], glib_module, [], [AC_MSG_ERROR([]dnl
  215 [m4_normalize([Either a previously installed pkg-config or "]glib_module["
  216               could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to
  217               the correct values or pass --with-internal-glib to configure
  218               to use the bundled copy.])])])
  219 fi
  220 AC_SUBST(GLIB_LIBS)
  221 AC_SUBST(GLIB_CFLAGS)
  222 
  223 dnl
  224 dnl Optional gcov test coverage usage
  225 dnl
  226 AC_ARG_WITH([gcov],
  227   [AS_HELP_STRING([--with-gcov], [gcov test coverage @<:@default=no@:>@])],
  228   [],
  229   [with_gcov=no])
  230 if test "x$with_gcov" = xyes; then
  231   if test "$GCC" = no; then
  232     AC_MSG_ERROR([gcov test coverage can only be used with GCC])
  233   fi
  234 
  235   AC_PATH_PROG([GCOV], [gcov], [AC_MSG_ERROR([could not find gcov program])])
  236   GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
  237 
  238   # Ensure there's no optimizing since last -O wins and CFLAGS is used
  239   # at the end of COMPILE/LTCOMPILE.
  240   CFLAGS="${CFLAGS+$CFLAGS }-O0"
  241 fi
  242 AC_SUBST([GCOV_CFLAGS])
  243 
  244 dnl See if the user wants a host- prefixed tool
  245 dnl (e.g. i686-pc-linux-gnu-pkg-config) to be installed.
  246 dnl
  247 AC_MSG_CHECKING([if host- prefixed tool should be installed])
  248 AC_ARG_ENABLE([host-tool],
  249   [AS_HELP_STRING([--disable-host-tool],
  250     [install link to pkg-config with $host- prefix @<:@default=yes@:>@])],
  251   [],
  252   [enable_host_tool=yes])
  253 AC_MSG_RESULT([$enable_host_tool])
  254 AM_CONDITIONAL([HOST_TOOL], [test "x$enable_host_tool" = xyes])
  255 
  256 AC_CONFIG_FILES([
  257 Makefile
  258 pkg.m4
  259 check/Makefile
  260 check/config.sh
  261 config.h.win32
  262 ])
  263 AC_OUTPUT