File slang-2.1.1-autoconf.dif of Package slang
--- autoconf/aclocal.m4
+++ autoconf/aclocal.m4
@@ -306,18 +306,18 @@ dnl#}}}
AC_DEFUN(JD_GCC_WARNINGS, dnl#{{{
[
AC_ARG_ENABLE(warnings,
- [ --enable-warnings turn on GCC compiler warnings],
+ AC_HELP_STRING([--enable-warnings],[turn on GCC compiler warnings]),
[gcc_warnings=$enableval])
-if test -n "$GCC"
+if test -n "$GCC" && test -n "$gcc_warnings"
then
- #CFLAGS="$CFLAGS -fno-strength-reduce"
- if test -n "$gcc_warnings"
- then
- CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \
- -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes"
- # Now trim excess whitespace
- CFLAGS=`echo $CFLAGS`
- fi
+ CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \
+ -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes \
+ -Wformat -Wformat-security"
+ ELF_CFLAGS="$ELF_CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \
+ -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes \
+ -Wformat -Wformat-security"
+ # Now trim excess whitespace
+ CFLAGS=`echo $CFLAGS`
fi
])
@@ -480,7 +480,7 @@ do
done
if test "$TERMCAP"; then
AC_MSG_RESULT(no)
- AC_DEFINE(USE_TERMCAP)
+ AC_DEFINE(USE_TERMCAP,1,[Define to use termcap])
fi
AC_SUBST(TERMCAP)dnl
AC_SUBST(MISC_TERMINFO_DIRS)dnl
@@ -491,9 +491,9 @@ dnl#}}}
AC_DEFUN(JD_ANSI_CC, dnl#{{{
[
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_GCC_TRADITIONAL
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CPP])
+AC_REQUIRE([AC_PROG_GCC_TRADITIONAL])
AC_ISC_POSIX
AC_AIX
@@ -506,7 +506,7 @@ AC_EGREP_CPP(yes,
yes
#endif
], [
-AC_DEFINE(_HPUX_SOURCE)
+AC_DEFINE(_HPUX_SOURCE,1,[Special define needed for HPUX])
if test "$CC" = cc; then CC="cc -Ae"; fi
])dnl
dnl
@@ -530,8 +530,11 @@ dnl #-----------------------------------
dnl # Check for dynamic linker
dnl #-------------------------------------------------------------------------
DYNAMIC_LINK_LIB=""
+
+AH_TEMPLATE([HAVE_DLOPEN],[Define if you have dlopen])
+
AC_CHECK_HEADER(dlfcn.h,[
- AC_DEFINE(HAVE_DLFCN_H)
+ AC_DEFINE(HAVE_DLFCN_H,1,[Define if you have the dlfcn.h header])
AC_CHECK_LIB(dl,dlopen,[
DYNAMIC_LINK_LIB="-ldl"
AC_DEFINE(HAVE_DLOPEN)
@@ -562,7 +565,7 @@ case "$host_os" in
*linux*|*gnu*|k*bsd*-gnu )
DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic"
ELF_CC="\$(CC)"
- ELF_CFLAGS="\$(CFLAGS) -fPIC"
+ ELF_CFLAGS="$ELF_CFLAGS -fPIC"
ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)"
ELF_DEP_LIBS="\$(DL_LIB) -lm -lc"
CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC"
--- autoconf/configure.ac
+++ autoconf/configure.ac
@@ -17,6 +17,62 @@ dnl fi
AC_CONFIG_AUX_DIR(autoconf)
AC_CANONICAL_HOST
+AH_TOP([
+/* -*- c -*- */
+/* Note: this is for unix only. */
+
+#ifndef SL_CONFIG_H
+#define SL_CONFIG_H
+])
+
+AH_BOTTOM([
+#if defined(HAVE_SIGADDSET) && defined(HAVE_SIGEMPTYSET)
+# if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK)
+# define SLANG_POSIX_SIGNALS
+# endif
+#endif
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+#ifdef _AIX
+# ifndef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# endif
+# ifndef _ALL_SOURCE
+# define _ALL_SOURCE
+# endif
+/* This may generate warnings but the fact is that without it, xlc will
+ * INCORRECTLY inline many str* functions. */
+# undef __STR__
+#endif
+
+/* define USE_TERMCAP if you want to use it instead of terminfo. */
+#if defined(sequent) || defined(NeXT)
+# ifndef USE_TERMCAP
+# define USE_TERMCAP
+# endif
+#endif
+
+#if defined(ultrix) && !defined(__GNUC__)
+# ifndef NO_PROTOTYPES
+# define NO_PROTOTYPES
+# endif
+#endif
+
+#ifndef unix
+# define unix 1
+#endif
+
+#ifndef __unix__
+# define __unix__ 1
+#endif
+
+#define _SLANG_SOURCE_ 1
+#endif /* SL_CONFIG_H */
+])
+
+
JD_INIT
JD_ANSI_CC
@@ -112,16 +168,16 @@ AC_CACHE_CHECK([for nl_langinfo and CODE
])
if test $jd_cv_nl_langinfo_codeset = yes
then
- AC_DEFINE(HAVE_NL_LANGINFO_CODESET, 1)
+ AC_DEFINE(HAVE_NL_LANGINFO_CODESET, 1, [Define to 1 if you have the nl_langinfo(CODESET) function])
fi
-AC_CHECK_LIB(m, acosh, [AC_DEFINE(HAVE_ACOSH)])
-AC_CHECK_LIB(m, asinh, [AC_DEFINE(HAVE_ASINH)])
-AC_CHECK_LIB(m, atanh, [AC_DEFINE(HAVE_ATANH)])
-AC_CHECK_LIB(m, hypot, [AC_DEFINE(HAVE_HYPOT)])
-AC_CHECK_LIB(m, atan2, [AC_DEFINE(HAVE_ATAN2)])
-AC_CHECK_LIB(m, feclearexcept, [AC_DEFINE(HAVE_FECLEAREXCEPT)])
-AC_CHECK_LIB(m, fpsetsticky, [AC_DEFINE(HAVE_FPSETSTICKY)])
+AC_CHECK_LIB(m, acosh, [AC_DEFINE(HAVE_ACOSH,1,[Define to 1 if you have the `acosh' function])])
+AC_CHECK_LIB(m, asinh, [AC_DEFINE(HAVE_ASINH,1,[Define to 1 if you have the `asinh' function])])
+AC_CHECK_LIB(m, atanh, [AC_DEFINE(HAVE_ATANH,1,[Define to 1 if you have the `atanh' function])])
+AC_CHECK_LIB(m, hypot, [AC_DEFINE(HAVE_HYPOT,1,[Define to 1 if you have the `hypot' function])])
+AC_CHECK_LIB(m, atan2, [AC_DEFINE(HAVE_ATAN2,1,[Define to 1 if you have the `atan2' function])])
+AC_CHECK_LIB(m, feclearexcept, [AC_DEFINE(HAVE_FECLEAREXCEPT,1,[Define to 1 if you have the `feclearexcept' function])])
+AC_CHECK_LIB(m, fpsetsticky, [AC_DEFINE(HAVE_FPSETSTICKY,1,[Define to 1 if you have the `fpsetsticky' function])])
JD_ELF_COMPILER
JD_IEEE_CFLAGS
@@ -149,7 +205,7 @@ JD_CHECK_FOR_LIBRARY(pcre)
if test $jd_with_pcre_library = yes
then
PCRE_MODULE="pcre-module.so"
- AC_DEFINE(HAVE_PCRE_H)
+ AC_DEFINE(HAVE_PCRE_H,1,[Define to 1 if you have the pcre.h header])
else
PCRE_MODULE=""
fi
@@ -159,7 +215,7 @@ JD_CHECK_FOR_LIBRARY(onig,oniguruma.h)
if test $jd_with_onig_library = yes
then
ONIG_MODULE="onig-module.so"
- AC_DEFINE(HAVE_ONIGURUMA_H)
+ AC_DEFINE(HAVE_ONIGURUMA_H,1,[Define to 1 if you have the oniguruma.h header])
else
ONIG_MODULE=""
fi
@@ -169,20 +225,20 @@ JD_CHECK_FOR_LIBRARY(png)
if test $jd_with_png_library = yes
then
PNG_MODULE="png-module.so"
- AC_DEFINE(HAVE_PNG_H)
+ AC_DEFINE(HAVE_PNG_H,1,[Define to 1 if you have the png.h header])
else
PNG_MODULE=""
fi
AC_SUBST(PNG_MODULE)
-m4_include([./iconv.m4])
+dnl m4_include([./iconv.m4])
ICONV_MODULE=""
JD_CHECK_FOR_LIBRARY(iconv)
if test $jd_with_iconv_library = yes
then
ICONV_MODULE="iconv-module.so"
- AC_DEFINE(HAVE_ICONV_H)
+ AC_DEFINE(HAVE_ICONV_H, 1, [Define to 1 if you have the iconv library])
ICONV_LIB="$ICONV_LIB -liconv"
else
SLANG_AM_ICONV