summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-07-12 18:46:17 +0000
committer <>2013-09-20 16:06:02 +0000
commit050cf5c3c31fec08c7ab96e18056bc72fec1def7 (patch)
tree35148b79cdbdbed9643069cee22ef38e52a993cc /acinclude.m4
downloadeditline-tarball-050cf5c3c31fec08c7ab96e18056bc72fec1def7.tar.gz
Imported from /home/lorry/working-area/delta_editline-tarball/libedit-20130712-3.1.tar.gz.HEADlibedit-20130712-3.1master
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m485
1 files changed, 85 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..4a58189
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,85 @@
+
+dnl
+dnl read lib version from file (and trim trailing newline)
+dnl
+define([EL_RELEASE], [patsubst(esyscmd([. src/shlib_version; echo $major.$minor]), [
+])])
+
+dnl
+dnl read cvsexport timestamp from file (and trim trailing newline)
+dnl
+define([EL_TIMESTAMP], [patsubst(esyscmd([date +"%Y%m%d"]), [
+])])
+
+
+dnl
+dnl NetBSD use the -mdoc macro package for manpages, but e.g.
+dnl AIX and Solaris only support the -man package.
+dnl
+AC_DEFUN([EL_MANTYPE],
+[
+ MANTYPE=
+ TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
+ AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
+ if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then
+ MANTYPE=mdoc
+ fi
+ AC_SUBST(MANTYPE)
+])
+
+
+dnl
+dnl Check if getpwnam_r and getpwuid_r are POSIX.1 compatible
+dnl POSIX draft version returns 'struct passwd *' (used on Solaris)
+dnl NOTE: getpwent_r is not POSIX so we always use getpwent
+dnl
+AC_DEFUN([EL_GETPW_R_POSIX],
+[
+ AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix like])
+ # The prototype for the POSIX version is:
+ # int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **)
+ # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
+ AC_TRY_LINK([#include <stdlib.h>
+ #include <sys/types.h>
+ #include <pwd.h>],
+ [getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL);
+ getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
+ [AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.])
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+])
+
+AC_DEFUN([EL_GETPW_R_DRAFT],
+[
+ AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix _draft_ like])
+ # The prototype for the POSIX draft version is:
+ # struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
+ # struct passwd *getpwnam_r(char *, struct passwd *, char *, int);
+ AC_TRY_LINK([#include <stdlib.h>
+ #include <sys/types.h>
+ #include <pwd.h>],
+ [getpwnam_r(NULL, NULL, NULL, (size_t)0);
+ getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);],
+ [AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.])
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+])
+
+
+dnl
+dnl use option --enable-widec to turn on use of wide-character support
+dnl
+AC_DEFUN([EL_ENABLE_WIDEC],
+[
+ AC_MSG_CHECKING(if you want wide-character code)
+ AC_ARG_ENABLE(widec,
+ [ --enable-widec compile with wide-char/UTF-8 code],
+ [with_widec=$enableval],
+ [with_widec=no])
+ AC_MSG_RESULT($with_widec)
+ if test "$with_widec" = yes ; then
+ AC_DEFINE(WIDECHAR, 1, [Define to 1 if you want wide-character code])
+ fi
+ AM_CONDITIONAL([WIDECHAR], [test "$with_widec" = yes])
+])
+