X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=51d15402702d422b63b7214285f6fe3d0e55c3f8;hp=b1679f5935a1b50d31cebf60e81bd9d30d324e6e;hb=808858ace09b9bf60f7154e33cb6572f49347101;hpb=b802d89ac4a8abdc19fd39ec9bdc9a300c3dd181 diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index b1679f59..51d15402 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 2010-2012,2013 Free Software Foundation, Inc. * +dnl Copyright (c) 2010-2013,2014 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.71 2013/09/07 18:07:26 Alexey.Pavlov Exp $ +dnl $Id: aclocal.m4,v 1.94 2014/12/21 00:19:39 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -39,7 +39,7 @@ dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl @@ -48,7 +48,7 @@ dnl $2 = code to use if AC_ACVERSION is at least as high as $1. dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ -ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( @@ -65,7 +65,7 @@ define([CF_ACVERSION_COMPARE], [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 +dnl CF_ADA_INCLUDE_DIRS version: 8 updated: 2013/10/14 04:24:07 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 dnl binding. @@ -79,7 +79,7 @@ if test "$GCC" != yes; then ACPPFLAGS="$ACPPFLAGS -I\${includedir}" elif test "$includedir" != "/usr/include"; then if test "$includedir" = '${prefix}/include' ; then - if test $prefix != /usr ; then + if test x$prefix != x/usr ; then ACPPFLAGS="$ACPPFLAGS -I\${includedir}" fi else @@ -97,7 +97,7 @@ AC_DEFUN([CF_ADD_ADAFLAGS],[ AC_SUBST(ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 +dnl CF_ADD_CFLAGS version: 11 updated: 2014/07/22 05:32:57 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -122,7 +122,7 @@ no) -D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes @@ -159,7 +159,7 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; @@ -286,15 +286,33 @@ if test -n "$1" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 +dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27 dnl ----------- -dnl Add one or more libraries, used to enforce consistency. +dnl Add one or more libraries, used to enforce consistency. Libraries are +dnl prepended to an existing list, since their dependencies are assumed to +dnl already exist in the list. dnl dnl $1 = libraries to add, with the "-l", etc. dnl $2 = variable to update (default $LIBS) -AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl +AC_DEFUN([CF_ADD_LIBS],[ +cf_add_libs="$1" +# Filter out duplicates - this happens with badly-designed ".pc" files... +for cf_add_1lib in [$]ifelse($2,,LIBS,[$2]) +do + for cf_add_2lib in $cf_add_libs + do + if test "x$cf_add_1lib" = "x$cf_add_2lib" + then + cf_add_1lib= + break + fi + done + test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib" +done +ifelse($2,,LIBS,[$2])="$cf_add_libs" +])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 +dnl CF_ADD_SUBDIR_PATH version: 4 updated: 2013/10/08 17:47:05 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -304,9 +322,9 @@ dnl $4 = the directory under which we will test for subdirectories dnl $5 = a directory that we do not want $4 to match AC_DEFUN([CF_ADD_SUBDIR_PATH], [ -test "$4" != "$5" && \ +test "x$4" != "x$5" && \ test -d "$4" && \ -ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { +ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d $4/$3 && $1="[$]$1 $4/$3" test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" @@ -605,7 +623,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39 +dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does @@ -616,7 +634,7 @@ dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX -dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS +dnl $2 = CLANG_COMPILER (default) dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_CLANG_COMPILER],[ ifelse([$2],,CLANG_COMPILER,[$2])=no @@ -709,7 +727,18 @@ AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_PC_FILES version: 9 updated: 2012/08/04 13:59:54 +dnl CF_DISABLE_GNAT_PROJECTS version: 1 updated: 2014/06/01 11:34:00 +dnl ------------------------ +AC_DEFUN([CF_DISABLE_GNAT_PROJECTS],[ +AC_MSG_CHECKING(if we want to use GNAT projects) +CF_ARG_DISABLE(gnat-projects, + [ --disable-gnat-projects test: disable GNAT projects even if usable], + [enable_gnat_projects=no], + [enable_gnat_projects=yes]) +AC_MSG_RESULT($enable_gnat_projects) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_PC_FILES version: 10 updated: 2014/12/13 18:48:46 dnl ------------------ dnl This is the "--enable-pc-files" option, which is available if there is a dnl pkg-config configuration on the local machine. @@ -717,20 +746,26 @@ AC_DEFUN([CF_ENABLE_PC_FILES],[ AC_REQUIRE([CF_PKG_CONFIG]) AC_REQUIRE([CF_WITH_PKG_CONFIG_LIBDIR]) -if test "$PKG_CONFIG" != none ; then +if test "x$PKG_CONFIG" != xnone +then AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) - AC_ARG_ENABLE(pc-files, - [ --enable-pc-files generate and install .pc files for pkg-config], - [enable_pc_files=$enableval], - [enable_pc_files=no]) - AC_MSG_RESULT($enable_pc_files) - if test "$enable_pc_files" != no - then - CF_PATH_SYNTAX(PKG_CONFIG_LIBDIR) - fi else - enable_pc_files=no + AC_MSG_CHECKING(if we should install .pc files) fi + +AC_ARG_ENABLE(pc-files, + [ --enable-pc-files generate and install .pc files for pkg-config], + [enable_pc_files=$enableval], + [enable_pc_files=no]) +AC_MSG_RESULT($enable_pc_files) +if test "x$enable_pc_files" != xno +then + CF_PATH_SYNTAX(PKG_CONFIG_LIBDIR) + MAKE_PC_FILES= +else + MAKE_PC_FILES="#" +fi +AC_SUBST(MAKE_PC_FILES) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 @@ -1056,7 +1091,7 @@ if test "$GCC" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 29 updated: 2012/06/16 14:55:39 +dnl CF_GCC_WARNINGS version: 31 updated: 2013/11/19 19:23:35 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: @@ -1128,10 +1163,14 @@ then EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" + cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs" + test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings= for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ + Wdeclaration-after-statement \ + Wextra \ Winline \ Wmissing-declarations \ Wmissing-prototypes \ @@ -1139,7 +1178,7 @@ then Wpointer-arith \ Wshadow \ Wstrict-prototypes \ - Wundef $cf_warn_CONST $1 + Wundef $cf_gcc_warnings $cf_warn_CONST $1 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if AC_TRY_EVAL(ac_compile); then @@ -1173,6 +1212,17 @@ rm -rf conftest* AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_GNATPREP_OPT_T version: 1 updated: 2014/08/02 18:37:25 +dnl ----------------- +AC_DEFUN([CF_GNATPREP_OPT_T],[ +AC_CACHE_CHECK(if GNATPREP supports -T option,cf_cv_gnatprep_opt_t,[ +cf_cv_gnatprep_opt_t=no +gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes +]) +test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS" +AC_SUBST(GNATPREP_OPTS) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_GNAT_GENERICS version: 2 updated: 2011/03/23 20:24:41 dnl ---------------- AC_DEFUN([CF_GNAT_GENERICS], @@ -1203,46 +1253,19 @@ AC_SUBST(cf_compile_generics) AC_SUBST(cf_generic_objects) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_PRAGMA_UNREF version: 1 updated: 2010/06/19 15:22:18 -dnl -------------------- -dnl Check if the gnat pragma "Unreferenced" works. -AC_DEFUN([CF_GNAT_PRAGMA_UNREF],[ -AC_CACHE_CHECK(if GNAT pragma Unreferenced works,cf_cv_pragma_unreferenced,[ -CF_GNAT_TRY_LINK([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is - test : Integer; - pragma Unreferenced (test); -begin - test := 1; - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;], - [cf_cv_pragma_unreferenced=yes], - [cf_cv_pragma_unreferenced=no])]) - -# if the pragma is supported, use it (needed in the Trace code). -if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE -else - PRAGMA_UNREF=FALSE -fi -AC_SUBST(PRAGMA_UNREF) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GNAT_PROJECTS version: 4 updated: 2013/09/07 14:05:46 +dnl CF_GNAT_PROJECTS version: 7 updated: 2014/06/01 10:46:34 dnl ---------------- dnl GNAT projects are configured with ".gpr" project files. dnl GNAT libraries are a further development, using the project feature. AC_DEFUN([CF_GNAT_PROJECTS], [ AC_REQUIRE([CF_GNAT_VERSION]) +AC_REQUIRE([CF_DISABLE_GNAT_PROJECTS]) cf_gnat_libraries=no cf_gnat_projects=no +if test "$enable_gnat_projects" != no ; then AC_MSG_CHECKING(if GNAT supports project files) case $cf_gnat_version in #(vi 3.[[0-9]]*) #(vi @@ -1266,14 +1289,6 @@ project Library is for Library_Dir use External("BUILD_DIR"); Source_Dir := External ("SOURCE_DIR"); for Source_Dirs use (Source_Dir); - package Compiler is - for Default_Switches ("Ada") use - ("-g", - "-O2", - "-gnatafno", - "-gnatVa", -- All validity checks - "-gnatwa"); -- Activate all optional errors - end Compiler; end Library; CF_EOF cat >>confpackage.ads </dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in - .*k) + .*k|.*kw) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= @@ -1973,7 +1980,7 @@ AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MIXEDCASE_FILENAMES version: 5 updated: 2013/09/07 13:54:05 +dnl CF_MIXEDCASE_FILENAMES version: 6 updated: 2013/10/08 17:47:05 dnl ---------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. @@ -1982,7 +1989,7 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES], AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ if test "$cross_compiling" = yes ; then case $target_alias in #(vi - *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw32*|*-uwin*) #(vi + *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi cf_cv_mixedcase=no ;; *) @@ -2535,7 +2542,7 @@ case ".[$]$1" in #(vi esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 7 updated: 2011/04/29 04:53:22 +dnl CF_PKG_CONFIG version: 8 updated: 2014/12/13 18:48:46 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. AC_DEFUN([CF_PKG_CONFIG], @@ -2564,6 +2571,8 @@ esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then CF_PATH_SYNTAX(PKG_CONFIG) +else + AC_MSG_WARN(pkg-config is not installed) fi AC_SUBST(PKG_CONFIG) @@ -2658,7 +2667,7 @@ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55 +dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name @@ -2668,7 +2677,7 @@ CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) -CF_CC_ENV_FLAGS +CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37 @@ -2836,7 +2845,7 @@ define([CF_REMOVE_LIB], $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 82 updated: 2013/09/07 13:54:05 +dnl CF_SHARED_OPTS version: 84 updated: 2013/11/03 06:26:10 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -2871,6 +2880,12 @@ AC_DEFUN([CF_SHARED_OPTS], INSTALL_LIB="-m 644" : ${rel_builddir:=.} + shlibdir=$libdir + AC_SUBST(shlibdir) + + MAKE_DLLS="#" + AC_SUBST(MAKE_DLLS) + cf_cv_do_symlinks=no cf_ld_rpath_opt= test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" @@ -2933,6 +2948,8 @@ AC_DEFUN([CF_SHARED_OPTS], RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=cygdll cf_cv_shlib_version_infix=cygdll + shlibdir=$bindir + MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF #!/bin/sh SHARED_LIB=\[$]1 @@ -2953,6 +2970,8 @@ CF_EOF RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=msysdll cf_cv_shlib_version_infix=msysdll + shlibdir=$bindir + MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF #!/bin/sh SHARED_LIB=\[$]1 @@ -3040,6 +3059,8 @@ CF_EOF mingw*) #(vi cf_cv_shlib_version=mingw cf_cv_shlib_version_infix=mingw + shlibdir=$bindir + MAKE_DLLS= if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-Wl,--enable-auto-import" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" @@ -3087,7 +3108,7 @@ CF_EOF EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -soname=`basename $[@]` -o $[@]' + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]' ;; netbsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" @@ -3276,7 +3297,7 @@ dnl Remove "-g" option from the compiler options AC_DEFUN([CF_STRIP_G_OPT], [$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl dnl --------------------------------------------------------------------------- -dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 +dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -3286,11 +3307,18 @@ AC_DEFUN([CF_SUBDIR_PATH], [ $1= -CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) -CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix) -CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix) -CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix) + +for cf_subdir_prefix in \ + /usr \ + /usr/local \ + /usr/pkg \ + /opt \ + /opt/local \ + [$]HOME +do + CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix) +done ])dnl dnl --------------------------------------------------------------------------- dnl CF_TERM_HEADER version: 3 updated: 2012/10/06 08:57:51 @@ -3498,14 +3526,14 @@ AC_SUBST(ADA_OBJECTS) AC_MSG_RESULT($ADA_OBJECTS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58 +dnl CF_WITH_ADA_SHAREDLIB version: 4 updated: 2014/05/31 21:08:37 dnl --------------------- dnl Command-line option to specify if an Ada95 shared-library should be built, dnl and optionally what its soname should be. AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ AC_MSG_CHECKING(if an Ada95 shared-library should be built) AC_ARG_WITH(ada-sharedlib, - [ --with-ada-sharedlib=XX build Ada95 shared-library], + [ --with-ada-sharedlib=soname build shared-library (requires GNAT projects)], [with_ada_sharedlib=$withval], [with_ada_sharedlib=no]) AC_MSG_RESULT($with_ada_sharedlib) @@ -3597,45 +3625,70 @@ eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 2 updated: 2011/12/10 18:58:47 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 3 updated: 2014/12/13 18:48:46 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[ -if test "$PKG_CONFIG" != none ; then - AC_MSG_CHECKING(for $PKG_CONFIG library directory) - AC_ARG_WITH(pkg-config-libdir, - [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], - [PKG_CONFIG_LIBDIR=$withval], - [PKG_CONFIG_LIBDIR=yes]) - - case x$PKG_CONFIG_LIBDIR in #(vi - x/*) #(vi - ;; - xyes) #(vi - # look for the library directory using the same prefix as the executable +AC_MSG_CHECKING(for $PKG_CONFIG library directory) +AC_ARG_WITH(pkg-config-libdir, + [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], + [PKG_CONFIG_LIBDIR=$withval], + [PKG_CONFIG_LIBDIR=yes]) + +case x$PKG_CONFIG_LIBDIR in #(vi +x/*) #(vi + ;; +xyes) #(vi + # Look for the library directory using the same prefix as the executable + if test "x$PKG_CONFIG" = xnone + then + cf_path=$prefix + else cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'` - case x`(arch) 2>/dev/null` in #(vi - *64) #(vi - for cf_config in $cf_path/share $cf_path/lib64 $cf_path/lib32 $cf_path/lib - do - if test -d $cf_config/pkgconfig - then - PKG_CONFIG_LIBDIR=$cf_config/pkgconfig - break - fi - done - ;; - *) - PKG_CONFIG_LIBDIR=$cf_path/lib/pkgconfig - ;; - esac + fi + + # If you don't like using the default architecture, you have to specify the + # intended library directory and corresponding compiler/linker options. + # + # This case allows for Debian's 2014-flavor of multiarch, along with the + # most common variations before that point. Some other variants spell the + # directory differently, e.g., "pkg-config", and put it in unusual places. + # pkg-config has always been poorly standardized, which is ironic... + case x`(arch) 2>/dev/null` in #(vi + *64) #(vi + cf_search_path="\ + $cf_path/lib/*64-linux-gnu \ + $cf_path/share \ + $cf_path/lib64 \ + $cf_path/lib32 \ + $cf_path/lib" ;; *) + cf_search_path="\ + $cf_path/lib/*-linux-gnu \ + $cf_path/share \ + $cf_path/lib32 \ + $cf_path/lib" ;; esac - AC_MSG_RESULT($PKG_CONFIG_LIBDIR) -fi + CF_VERBOSE(list...) + for cf_config in $cf_search_path + do + CF_VERBOSE(checking $cf_config/pkgconfig) + if test -d $cf_config/pkgconfig + then + PKG_CONFIG_LIBDIR=$cf_config/pkgconfig + AC_MSG_CHECKING(done) + break + fi + done + ;; +*) + ;; +esac + +AC_MSG_RESULT($PKG_CONFIG_LIBDIR) AC_SUBST(PKG_CONFIG_LIBDIR) ])dnl @@ -3702,7 +3755,7 @@ AC_ARG_WITH(system-type, ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 45 updated: 2013/09/07 14:06:25 +dnl CF_XOPEN_SOURCE version: 48 updated: 2014/09/01 12:29:14 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -3753,6 +3806,9 @@ irix[[56]].*) #(vi linux*|gnu*|mint*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; +minix*) #(vi + cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... + ;; mirbsd*) #(vi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= @@ -3780,6 +3836,11 @@ sco*) #(vi ;; solaris2.*) #(vi cf_xopen_source="-D__EXTENSIONS__" + cf_cv_xopen_source=broken + ;; +sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) + cf_XOPEN_SOURCE= + cf_POSIX_C_SOURCE= ;; *) CF_TRY_XOPEN_SOURCE @@ -3788,7 +3849,7 @@ solaris2.*) #(vi esac if test -n "$cf_xopen_source" ; then - CF_ADD_CFLAGS($cf_xopen_source) + CF_ADD_CFLAGS($cf_xopen_source,true) fi dnl In anything but the default case, we may have system-specific setting