aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-12-28 20:15:50 +0200
committerArnold D. Robbins <arnold@skeeve.com>2017-12-28 20:15:50 +0200
commita89622fa57b3cf74e96b9f04c9cae897498155e9 (patch)
treea0da539681ce6fb82db92f799bfa28571ec7fa43
parent9636262b44d59e5263a60e02f2ca1a22cff566b9 (diff)
downloadegawk-a89622fa57b3cf74e96b9f04c9cae897498155e9.tar.gz
egawk-a89622fa57b3cf74e96b9f04c9cae897498155e9.tar.bz2
egawk-a89622fa57b3cf74e96b9f04c9cae897498155e9.zip
Get rid of GLIBC/compile warnings on Fedora in extension directory.
-rw-r--r--extension/ChangeLog13
-rw-r--r--extension/configh.in17
-rwxr-xr-xextension/configure115
-rw-r--r--extension/configure.ac14
-rw-r--r--extension/filefuncs.c12
-rw-r--r--extension/fnmatch.c11
6 files changed, 103 insertions, 79 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 49b156bc..5fd1757e 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,16 @@
+2017-12-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ More configuration fixes, mainly for Fedora. Thanks to
+ Michal Jaegermann <michal.jnn@gmail.com> for the reports
+ and for validating.
+
+ * configure.ac (AC_HEADER_MAJOR): Comment out, no longer works.
+ (sys/sysmacros.h, sys/mkdev.h): Check for header existence.
+ (fmod): Check with AC_SEARCH_LIB instead of AC_CHECK_FUNCS.
+ * filefuncs.c: Rework header inclusion checks and order so
+ that we get the `major' macro without warnings on Fedora.
+ * fnmatch.c: Ditto.
+
2017-12-26 Arnold D. Robbins <arnold@skeeve.com>
* gawkfts.c (fts_safe_changedir): Add check for path not null
diff --git a/extension/configh.in b/extension/configh.in
index 9d3d9919..c2b16d7b 100644
--- a/extension/configh.in
+++ b/extension/configh.in
@@ -27,9 +27,6 @@
/* Define to 1 if you have the `fdopendir' function. */
#undef HAVE_FDOPENDIR
-/* Define to 1 if you have the `fmod' function. */
-#undef HAVE_FMOD
-
/* Define to 1 if you have the `fnmatch' function. */
#undef HAVE_FNMATCH
@@ -88,6 +85,9 @@
*/
#undef HAVE_SYS_DIR_H
+/* Define to 1 if you have the <sys/mkdev.h> header file. */
+#undef HAVE_SYS_MKDEV_H
+
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
@@ -104,6 +104,9 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
+/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+#undef HAVE_SYS_SYSMACROS_H
+
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
@@ -116,14 +119,6 @@
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
-/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
- */
-#undef MAJOR_IN_MKDEV
-
-/* Define to 1 if `major', `minor', and `makedev' are declared in
- <sysmacros.h>. */
-#undef MAJOR_IN_SYSMACROS
-
/* Name of package */
#undef PACKAGE
diff --git a/extension/configure b/extension/configure
index 3666df28..854e296f 100755
--- a/extension/configure
+++ b/extension/configure
@@ -12618,7 +12618,8 @@ else
$as_echo "no" >&6; }
fi
-for ac_header in fnmatch.h limits.h sys/time.h sys/select.h sys/param.h sys/statvfs.h
+for ac_header in fnmatch.h limits.h sys/mkdev.h sys/param.h sys/select.h \
+ sys/statvfs.h sys/sysmacros.h sys/time.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12631,6 +12632,7 @@ fi
done
+
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
@@ -12789,56 +12791,6 @@ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
-$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
-if ${ac_cv_header_sys_types_h_makedev+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-int
-main ()
-{
-return makedev(0, 0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_header_sys_types_h_makedev=yes
-else
- ac_cv_header_sys_types_h_makedev=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5
-$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }
-
-if test $ac_cv_header_sys_types_h_makedev = no; then
-ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
-
-$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
-
-fi
-
-
-
- if test $ac_cv_header_sys_mkdev_h = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
-
-$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
-
-fi
-
-
- fi
-fi
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
if ${ac_cv_header_time+:} false; then :
@@ -12959,8 +12911,9 @@ $as_echo "#define HAVE_MPFR 1" >>confdefs.h
;;
esac
-for ac_func in fdopendir fmod fnmatch getdtablesize \
- gettimeofday nanosleep select statvfs GetSystemTimeAsFileTime
+for ac_func in fdopendir fnmatch getdtablesize \
+ gettimeofday nanosleep select statvfs \
+ GetSystemTimeAsFileTime
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -12972,6 +12925,62 @@ _ACEOF
fi
done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fmod" >&5
+$as_echo_n "checking for library containing fmod... " >&6; }
+if ${ac_cv_search_fmod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fmod ();
+int
+main ()
+{
+return fmod ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_fmod=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_fmod+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_fmod+:} false; then :
+
+else
+ ac_cv_search_fmod=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fmod" >&5
+$as_echo "$ac_cv_search_fmod" >&6; }
+ac_res=$ac_cv_search_fmod
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
diff --git a/extension/configure.ac b/extension/configure.ac
index e1438259..14259333 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -75,9 +75,13 @@ else
AC_MSG_RESULT([no])
fi
-AC_CHECK_HEADERS(fnmatch.h limits.h sys/time.h sys/select.h sys/param.h sys/statvfs.h)
+AC_CHECK_HEADERS(fnmatch.h limits.h sys/mkdev.h sys/param.h sys/select.h \
+ sys/statvfs.h sys/sysmacros.h sys/time.h)
+
AC_HEADER_DIRENT
-AC_HEADER_MAJOR
+dnl 12/2017: AC_HEADER_MAJOR no longer works on recent Fedora / GLIBC.
+dnl Instead we just check for the headers in the call above.
+dnl AC_HEADER_MAJOR
AC_HEADER_TIME
dnl check for mpfr support
@@ -92,8 +96,10 @@ case `uname -m` in
;;
esac
-AC_CHECK_FUNCS(fdopendir fmod fnmatch getdtablesize \
- gettimeofday nanosleep select statvfs GetSystemTimeAsFileTime)
+AC_CHECK_FUNCS(fdopendir fnmatch getdtablesize \
+ gettimeofday nanosleep select statvfs \
+ GetSystemTimeAsFileTime)
+AC_SEARCH_LIBS(fmod, m)
GAWK_FUNC_DIRFD
GAWK_PREREQ_DIRFD
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index 38542115..64016402 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -72,17 +72,17 @@
#include <string.h>
#include <unistd.h>
-#include <sys/types.h>
-
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
-#elif defined(MAJOR_IN_SYSMACROS)
+#if HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
-#endif
+#elif HAVE_SYS_MKDEV_H
+#include <sys/mkdev.h>
+#endif /* HAVE_SYS_MKDEV_H */
+
+#include <sys/types.h>
#include <sys/stat.h>
diff --git a/extension/fnmatch.c b/extension/fnmatch.c
index 9b7640de..5119bfda 100644
--- a/extension/fnmatch.c
+++ b/extension/fnmatch.c
@@ -36,14 +36,15 @@
#include <string.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
-#elif defined(MAJOR_IN_SYSMACROS)
+#if HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
-#endif
+#elif HAVE_SYS_MKDEV_H
+#include <sys/mkdev.h>
+#endif /* HAVE_SYS_MKDEV_H */
+
+#include <sys/types.h>
#include "gawkapi.h"