aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macros/ChangeLog11
-rw-r--r--macros/Makefile.am19
-rw-r--r--macros/gnome-support.m411
-rw-r--r--macros/need-declaration.m442
4 files changed, 71 insertions, 12 deletions
diff --git a/macros/ChangeLog b/macros/ChangeLog
index 73dce0126f..bd76fc01fd 100644
--- a/macros/ChangeLog
+++ b/macros/ChangeLog
@@ -1,3 +1,14 @@
+1998-07-15 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (MACROS): Add `need-declaration.m4'.
+
+ * gnome-support.m4 (AC_REPLACE_FUNCS): Add memmove, strtod,
+ strtol, strtoul.
+ (GCC_NEED_DECLARATIONS): New check. Check whether `gethostname'
+ needs to be declared.
+
+ * need-declaration.m4: New file. Stolen from EGCS.
+
1998-07-13 Raja R Harinath <harinath@cs.umn.edu>
* gnome-support.m4 (AC_REPLACE_FUNCS): Add check for `mkstemp'.
diff --git a/macros/Makefile.am b/macros/Makefile.am
index 5d1b1e378b..28dc457462 100644
--- a/macros/Makefile.am
+++ b/macros/Makefile.am
@@ -1,16 +1,17 @@
## Please update this variable if any new macros are created
-MACROS= \
+MACROS= \
aclocal-include.m4 \
- curses.m4 \
- gnome-fileutils.m4 \
+ curses.m4 \
+ gnome-fileutils.m4 \
gnome-guile-checks.m4 \
- gnome-libgtop-check.m4 \
- gnome-libgtop-sysdeps.m4 \
+ gnome-libgtop-check.m4 \
+ gnome-libgtop-sysdeps.m4 \
gnome-objc-checks.m4 \
- gnome-pthread-check.m4 \
- gnome-support.m4 \
- gnome-x-checks.m4 \
- gnome.m4
+ gnome-pthread-check.m4 \
+ gnome-support.m4 \
+ gnome-x-checks.m4 \
+ gnome.m4 \
+ need-declaration.m4
EXTRA_DIST=$(MACROS) autogen.sh macros.dep
MAINTAINERCLEANFILES=macros.dep
diff --git a/macros/gnome-support.m4 b/macros/gnome-support.m4
index 738c175a41..7d5fdbe1b1 100644
--- a/macros/gnome-support.m4
+++ b/macros/gnome-support.m4
@@ -78,10 +78,15 @@ AC_DEFUN([GNOME_SUPPORT_CHECKS],[
LIBOBJS="$LIBOBJS easy-vsnprintf.o",
LIBOBJS="$LIBOBJS vsnprintf.o")])
- AC_REPLACE_FUNCS(mkstemp scandir strcasecmp strerror strndup strnlen)
- AC_REPLACE_FUNCS(strtok_r vasprintf)
+ AC_REPLACE_FUNCS(memmove mkstemp scandir strcasecmp strerror strndup strnlen)
+ AC_REPLACE_FUNCS(strtok_r strtod strtol strtoul vasprintf)
- if test "$LIBOBJS" != ""; then
+ # see if we need to declare some functions. Solaris is notorious for
+ # putting functions into the `libc' but not listing them in the headers
+ AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
+ GCC_NEED_DECLARATIONS(gethostname)
+
+ if test "$LIBOBJS$gcc_need_declarations" != ""; then
need_gnome_support=yes
fi
# Turn our LIBOBJS into libtool objects. This is gross, but it
diff --git a/macros/need-declaration.m4 b/macros/need-declaration.m4
new file mode 100644
index 0000000000..d5b7bc66d5
--- /dev/null
+++ b/macros/need-declaration.m4
@@ -0,0 +1,42 @@
+dnl See whether we need a declaration for a function.
+dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
+AC_DEFUN(GCC_NEED_DECLARATION,
+[AC_MSG_CHECKING([whether $1 must be declared])
+AC_CACHE_VAL(gcc_cv_decl_needed_$1,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+$2],
+[char *(*pfn) = (char *(*)) $1],
+eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
+if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ gcc_need_declarations="$gcc_need_declarations $1"
+ gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED($gcc_tr_decl)
+else
+ AC_MSG_RESULT(no)
+fi
+])dnl
+
+dnl Check multiple functions to see whether each needs a declaration.
+dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
+AC_DEFUN(GCC_NEED_DECLARATIONS,
+[for ac_func in $1
+do
+GCC_NEED_DECLARATION($ac_func, $2)
+done
+]
+)
td class='commitgraph'>* Cache ac_cv_sys_long_file_names conftest result (always yes)marino2016-05-071-0/+3 * Re-apply r400350 which is correct, to remove libutil-provided symbols.bdrewery2015-10-281-3/+0 * Revert recent config.site changes, ports-mgmt/pkg fails to build on FreeBSDantoine2015-10-281-225/+15 * Indent and remove more libutil functions.bdrewery2015-10-281-9/+6 * Fix reversed logic for utmp vs utxbdrewery2015-10-281-1/+1 * Woops, openpty is libutil as fixed before but missed in previous commit.bdrewery2015-10-281-1/+1 * Correct a commentbdrewery2015-10-281-1/+1 * Add more cached values.bdrewery2015-10-281-12/+228 * Remove functions provided by libutil.bdrewery2015-10-281-3/+0 * Add /usr/local/lib/debug for WIP debug symbol splitting started in r399701.bdrewery2015-10-211-0/+2 * Update config.guess and config.sub to the latest version.ed2015-06-212-194/+102 * Remove lib/X11/fonts/* from the default mtreebapt2015-03-221-4/+0 * Remove trailing empty linebapt2014-12-221-1/+0 * Add a template for the port Makefilesbapt2014-12-051-0/+12 * Remove an addition to BSD.local.dist which wasn't intendedbapt2014-08-271-2/+0 * Add etc/libmap.d to the local mtreebapt2014-08-271-0/+2 * Add etc/rc.conf.d to the local mtreebapt2014-08-271-0/+4 * - Add LOCALBASE/etc/newsyslog.conf.d from base r266463bdrewery2014-06-051-0/+2 * Cache a bit more function for autoconf based on texlive config.logsbapt2014-03-261-0/+5 * - Remove PGSQL: Year and Organization must be filled-in by licensor.gahr2014-02-191-28/+0 * - Add PostgreSQL license to the databasegahr2014-02-171-0/+28 * Add GMGPL to license databasemarino2014-02-151-0/+6 * Define GPLv3RLE license (GPLv3 Runtime Library Exception)marino2014-02-131-0/+73 * Register a 'tests' directory under /usr/local.jmmv2014-02-091-0/+2 * - rename AL2 to APACHE20 in Mk/bsd.licenses.db.mkohauer2013-12-311-0/+0 * The RUBY license covers only the second portion of the license. It should noteadler2013-12-131-4/+0 * Templates, Mk/ lang/ruby*: add the RUBY licenseeadler2013-12-121-0/+56 * - This OFL was version 1.1, now replaced by OFL11tabthorpe2013-11-051-97/+0 * - Add license templates for OFL 1.0 and 1.1bdrewery2013-10-292-0/+184 * - Add share/applications to mtree, so it no longer needs to be created/remove...amdmi32013-10-221-0/+2 * - login(3), logout(3), and logwtmp(3) were removed in base r202216bdrewery2013-09-031-3/+0 * Do not cache the openpty function this breaks at least heimdal and rancidbapt2013-09-021-1/+2 * Remove 2 lines for structs which were declared in utmp.hantoine2013-08-311-2/+0 * Remove the utmp.h cache added by mistakebapt2013-08-301-1/+0 * - Cache morebdrewery2013-08-301-1/+5 * Note that this must reflect the oldest supported releasebdrewery2013-08-301-0/+1 * Cache more GNU configure tests, obtained from gettext and openssh configure s...bapt2013-08-301-32/+589 * Add some guidance on what not to addbdrewery2013-08-301-0/+9 * Add a few more headers/functionsbdrewery2013-08-301-0/+25 * Sort pathsbdrewery2013-08-301-6/+6 * Sort each groupbdrewery2013-08-301-184/+174 * Cache more functionsbapt2013-08-241-0/+4 * Cache strlcpy and strlcat testsbapt2013-08-241-0/+2 * Remove unwanted changesbapt2013-06-051-1/+1 * Propertly makes config.sub working as expecting on amd64bapt2013-06-051-8/+2 * Actually commit the right config.subbapt2013-06-051-0/+6 * Update to lastest version from upstreambapt2013-06-042-595/+1013 * Eliminate redundancy in this file which also helps avoids typos.bdrewery2013-05-311-372/+372 * Fix typosbdrewery2013-05-311-2/+2 * Revert as it brings too many breakage, it needs more work before getting syncbapt2013-05-242-1021/+592 * Cache more autotools testsbapt2013-05-241-3/+179 * Sync with latest version from upstreambapt2013-05-242-592/+1021 * All supported FreeBSD have net/if.h and net/if_media.h cache them in config.s...bapt2013-04-301-0/+2 * waitid(2) is only in 10bdrewery2013-04-251-1/+2 * Add a global config.site cache.bapt2013-04-231-0/+215 * Add in many popular licenses used by the ports infrastructure. Thesetabthorpe2012-02-2814-0/+3684 * - Include etc/devd in mtree, as referenced in devd.conf(5)pav2010-11-131-1/+3 * Add the new etc/man.d directory.gordon2010-10-051-1/+3