]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 5.9 - patch 20150214
[ncurses.git] / aclocal.m4
index f58ff3c8ba4aead80f997124a80eee58fe52410f..12c8f5acd76d0e9b4a9fd291b6d2c8e2895b9f27 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.727 2015/01/03 20:48:02 tom Exp $
+dnl $Id: aclocal.m4,v 1.734 2015/01/22 01:13:38 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -1336,7 +1336,7 @@ if test "$cf_disable_rpath_hack" = no ; then
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_ENABLE_PC_FILES version: 10 updated: 2014/12/13 18:48:46
+dnl CF_ENABLE_PC_FILES version: 11 updated: 2015/01/10 17:03:43
 dnl ------------------
 dnl This is the "--enable-pc-files" option, which is available if there is a
 dnl pkg-config configuration on the local machine.
@@ -1356,10 +1356,19 @@ AC_ARG_ENABLE(pc-files,
        [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=
+       case "x$PKG_CONFIG_LIBDIR" in #(vi
+       xno|xyes) #(vi
+               AC_MSG_WARN(no PKG_CONFIG_LIBDIR was found)
+               MAKE_PC_FILES="#"
+               ;;
+       *)
+               CF_PATH_SYNTAX(PKG_CONFIG_LIBDIR)
+               MAKE_PC_FILES=
+               ;;
+       esac
 else
        MAKE_PC_FILES="#"
 fi
@@ -3182,7 +3191,7 @@ ifelse($1,,,[$1=$LIB_PREFIX])
        AC_SUBST(LIB_PREFIX)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_RULES version: 77 updated: 2015/01/03 11:49:39
+dnl CF_LIB_RULES version: 78 updated: 2015/01/21 20:10:54
 dnl ------------
 dnl Append definitions and rules for the given models to the subdirectory
 dnl Makefiles, and the recursion rule for the top-level Makefile.  If the
@@ -3235,13 +3244,24 @@ do
                SHARED_LIB=
                Libs_To_Make=
 
+               cf_sed_options=
                if test -n "${cf_cv_abi_version}" && test "x${cf_cv_abi_version}" != "x5"
+               then
+                       cf_sed_options="$cf_sed_options -e \"s/NCURSES\\([[WT]]\\+\\)\?_/NCURSES\\1${cf_cv_abi_version}_/g\""
+               fi
+
+               if test "x$WILDCARD_SYMS" = xno
+               then
+                       cf_sed_options="$cf_sed_options -e \"s/_\*;//g\""
+               fi
+
+               if test "x$cf_sed_options" != "x"
                then
                        cat >>$cf_dir/Makefile <<CF_EOF
 
 # Generated by CF_LIB_RULES
 resulting.map: $UNALTERED_SYMS
-       sed -e "s/NCURSES\\([[WT]]\\+\\)\?_/NCURSES\\1${cf_cv_abi_version}_/g" < $UNALTERED_SYMS >\[$]@
+       sed $cf_sed_options < $UNALTERED_SYMS >\[$]@
 
 clean::
        rm -f resulting.map
@@ -5439,7 +5459,7 @@ CF_VERBOSE(...checked $1 [$]$1)
 AC_SUBST(EXTRA_LDFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 84 updated: 2013/11/03 06:26:10
+dnl CF_SHARED_OPTS version: 86 updated: 2015/01/21 20:10:54
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -5596,7 +5616,7 @@ CF_EOF
                fi
                ;;
        hpux[[7-8]]*) #(vi
-               # HP-UX 8.07 ld lacks "+b" option used for libdir search-list 
+               # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
                if test "$GCC" != yes; then
                        CC_SHARED_OPTS='+Z'
                fi
@@ -5702,7 +5722,7 @@ CF_EOF
                        EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CF_SHARED_SONAME
-               MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]'
+               MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
                ;;
        netbsd*) #(vi
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
@@ -7176,7 +7196,7 @@ AC_SUBST($3)dnl
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PKG_CONFIG_LIBDIR version: 3 updated: 2014/12/13 18:48:46
+dnl CF_WITH_PKG_CONFIG_LIBDIR version: 5 updated: 2015/01/21 20:10:54
 dnl -------------------------
 dnl Allow the choice of the pkg-config library directory to be overridden.
 AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[
@@ -7203,7 +7223,7 @@ xyes) #(vi
        #
        # 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. 
+       # 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
@@ -7219,7 +7239,8 @@ xyes) #(vi
                        $cf_path/lib/*-linux-gnu \
                        $cf_path/share \
                        $cf_path/lib32 \
-                       $cf_path/lib"
+                       $cf_path/lib \
+                       $cf_path/libdata"
                ;;
        esac
 
@@ -7369,7 +7390,7 @@ CF_NO_LEAKS_OPTION(valgrind,
        [USE_VALGRIND])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_VERSIONED_SYMS version: 3 updated: 2014/12/20 19:16:08
+dnl CF_WITH_VERSIONED_SYMS version: 4 updated: 2015/01/21 20:10:54
 dnl ----------------------
 dnl Use this when building shared library with ELF, to markup symbols with the
 dnl version identifier from the given input file.  Generally that identifier is
@@ -7392,18 +7413,19 @@ AC_MSG_RESULT($with_versioned_syms)
 
 RESULTING_SYMS=
 VERSIONED_SYMS=
+WILDCARD_SYMS=
 
 if test "x$with_versioned_syms" != xno
 then
        RESULTING_SYMS=$with_versioned_syms
        case "x$MK_SHARED_LIB" in
        *-Wl,*) #(vi
-               VERSIONED_SYMS="-Wl,--version-script,\$(RESULTING_SYMS)"
+               VERSIONED_SYMS="-Wl,--version-script,\${RESULTING_SYMS}"
                MK_SHARED_LIB=`echo "$MK_SHARED_LIB" | sed -e "s%-Wl,%\\[$]{VERSIONED_SYMS} -Wl,%"`
                CF_VERBOSE(MK_SHARED_LIB:  $MK_SHARED_LIB)
                ;;
-       *-dy*) #(vi
-               VERSIONED_SYMS="-Wl,-M,\$(RESULTING_SYMS)"
+       *-dy*) #(vi
+               VERSIONED_SYMS="-Wl,-M,\${RESULTING_SYMS}"
                MK_SHARED_LIB=`echo "$MK_SHARED_LIB" | sed -e "s%-dy%\\[$]{VERSIONED_SYMS} -dy%"`
                CF_VERBOSE(MK_SHARED_LIB:  $MK_SHARED_LIB)
                ;;
@@ -7411,9 +7433,88 @@ then
                AC_MSG_WARN(this system does not support versioned-symbols)
                ;;
        esac
+
+       # Linux ld can selectively override scope, e.g., of symbols beginning with
+       # "_" by first declaring some as global, and then using a wildcard to
+       # declare the others as local.  Some other loaders cannot do this.  Check
+       # by constructing a (very) simple shared library and inspecting its
+       # symbols.
+       if test "x$VERSIONED_SYMS" != "x"
+       then
+               AC_MSG_CHECKING(if wildcards can be used to selectively omit symbols)
+               WILDCARD_SYMS=no
+
+               # make sources
+               rm -f conftest.*
+
+               cat >conftest.ver <<EOF
+module_1.0 {
+global:
+       globalf1;
+local:
+       localf1;
+};
+module_2.0 {
+global:
+       globalf2;
+local:
+       localf2;
+       _*;
+} module_1.0;
+submodule_1.0 {
+global:
+       subglobalf1;
+       _ismissing;
+local:
+       sublocalf1;
+};
+submodule_2.0 {
+global:
+       subglobalf2;
+local:
+       sublocalf2;
+       _*;
+} submodule_1.0;
+EOF
+               cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int    _ismissing(void) { return 1; }
+int    _localf1(void) { return 1; }
+int    _localf2(void) { return 2; }
+int    globalf1(void) { return 1; }
+int    globalf2(void) { return 2; }
+int    _sublocalf1(void) { return 1; }
+int    _sublocalf2(void) { return 2; }
+int    subglobalf1(void) { return 1; }
+int    subglobalf2(void) { return 2; }
+EOF
+               cat >conftest.mk <<EOF
+CC=${CC}
+CFLAGS=${CFLAGS}
+CPPFLAGS=${CPPFLAGS}
+LDFLAGS=${LDFLAGS}
+LIBS=${LIBS}
+VERSIONED_SYMS=${VERSIONED_SYMS}
+RESULTING_SYMS=conftest.ver
+MK_SHARED_LIB=${MK_SHARED_LIB}
+conftest.so: conftest.$ac_cv_objext
+               \$(MK_SHARED_LIB) conftest.$ac_cv_objext
+EOF
+
+               # compile source, make library
+               if make -f conftest.mk 2>&AC_FD_CC >/dev/null
+               then
+                       # test for missing symbol
+                       cf_missing=`nm -P conftest.so 2>&AC_FD_CC |fgrep _ismissing | egrep '[[         ]]T[[   ]]'`
+                       test -n "$cf_missing" && WILDCARD_SYMS=yes
+               fi
+               AC_MSG_RESULT($WILDCARD_SYMS)
+               rm -f conftest.*
+       fi
 fi
 AC_SUBST(RESULTING_SYMS)
 AC_SUBST(VERSIONED_SYMS)
+AC_SUBST(WILDCARD_SYMS)
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_XOPEN_SOURCE version: 48 updated: 2014/09/01 12:29:14