[PATCH 4/4] Remove a bunch of unused includes and tests for headers

David Shea dshea at redhat.com
Mon Feb 24 14:27:05 UTC 2014


Most of isys.c is no longer relevant, and a fair amount of the autoconf
tests are for things that used to be in isys or loader or other code
that is no longer with us. Also anaconda barely links to anything
through C, so there's no need to pull in a bunch of CFLAGS and LDFLAGS
for various packages. Moved the one actual bit of information from all
that--the required Gtk version--to widgets, where the newer Gtk
functionality is actually used.
---
 configure.ac                | 50 ++-------------------------------------------
 pyanaconda/isys/Makefile.am |  6 ++----
 pyanaconda/isys/isys.c      | 47 +-----------------------------------------
 widgets/configure.ac        |  2 +-
 4 files changed, 6 insertions(+), 99 deletions(-)

diff --git a/configure.ac b/configure.ac
index dd7efd6..97b78cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,62 +68,23 @@ AM_GNU_GETTEXT([external])
 # Also update in gettextver in anaconda.spec.in
 AM_GNU_GETTEXT_VERSION([0.18.3])
 
-# Checks for libraries.
-AC_CHECK_LIB([X11], [XGetWindowAttributes],
-             [AC_SUBST(X11_LIBS, [-lX11])],
-             [AC_MSG_FAILURE([*** libX11 not usable.])])
-
-AC_CHECK_LIB([audit], [audit_open],
-             [AC_SUBST(AUDIT_LIBS, [-laudit])],
-             [AC_MSG_FAILURE([*** libaudit not usable.])])
-
-AC_CHECK_LIB([z], [zlibVersion],
-             [AC_SUBST(ZLIB_LIBS, [-lz])],
-             [AC_MSG_FAILURE([*** libz not usable.])])
-
 # Checks for header files.
 AC_PATH_X
-AC_FUNC_ALLOCA
-AC_HEADER_RESOLV
-AC_HEADER_MAJOR
-AC_CHECK_HEADERS([argz.h arpa/inet.h fcntl.h inttypes.h libintl.h limits.h \
-                  malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h \
-                  string.h strings.h sys/ioctl.h sys/mount.h sys/param.h \
-                  sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h \
-                  unistd.h utime.h wchar.h],
+AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h],
                  [],
                  [AC_MSG_FAILURE([*** Header file $ac_header not found.])],
                  [])
 
 # Checks for typedefs, structures, and compiler characteristics.
-AC_TYPE_UID_T
-AC_C_INLINE
-AC_TYPE_INT32_T
-AC_TYPE_MODE_T
-AC_TYPE_OFF_T
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_SSIZE_T
-AC_CHECK_MEMBERS([struct stat.st_rdev])
-AC_TYPE_UINT16_T
 AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-AC_TYPE_UINT8_T
 AC_TYPE_INT64_T
 
 # Checks for library functions.
-AC_FUNC_CHOWN
-AC_FUNC_ERROR_AT_LINE
 AC_FUNC_FORK
-AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
-AC_FUNC_MALLOC
-AC_FUNC_MMAP
-AC_FUNC_REALLOC
-AC_CHECK_FUNCS([dup2 fdatasync ftruncate getcwd gethostbyname gettimeofday \
-                lchown memmove memset mkdir mkfifo munmap realpath select \
-                setenv sethostname socket strcasecmp strchr strcspn strdup \
-                strerror strncasecmp strndup strrchr strstr strtol strtoul \
-                strverscmp uname utime wcwidth],
+AC_CHECK_FUNCS([getcwd memset mkdir strchr strdup],
                [],
                [AC_MSG_FAILURE([*** Required function $ac_func not found.])])
 
@@ -144,13 +105,6 @@ PKG_CHECK_MODULES([PYTHON], [python], [
 
 # Check for libraries we need that provide pkg-config scripts
 PKG_PROG_PKG_CONFIG([0.23])
-PKG_CHECK_MODULES([X11], [x11 >= 1.3])
-PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite >= 0.4.1])
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16.1])
-PKG_CHECK_MODULES([GTK_X11], [gtk+-x11-3.0 >= 3.11.3])
-PKG_CHECK_MODULES([GDK], [gdk-3.0])
-PKG_CHECK_MODULES([NETWORKMANAGER], [NetworkManager >= 0.7.1])
-PKG_CHECK_MODULES([LIBNM_GLIB], [libnm-glib >= 0.7.1 libnm-util >= 0.7.1])
 PKG_CHECK_MODULES([RPM], [rpm >= 4.10.0])
 PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4])
 
diff --git a/pyanaconda/isys/Makefile.am b/pyanaconda/isys/Makefile.am
index 0253491..bd3e36f 100644
--- a/pyanaconda/isys/Makefile.am
+++ b/pyanaconda/isys/Makefile.am
@@ -21,9 +21,7 @@ pkgpyexecdir = $(pyexecdir)/py$(PACKAGE_NAME)
 
 dist_noinst_HEADERS = $(srcdir)/*.h
 
-ISYS_CFLAGS = -DVERSION_RELEASE='"$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)"' \
-              $(LIBNL_CFLAGS) $(GLIB_CFLAGS)
-ISYS_LIBS   = $(DEVMAPPER_LIBS) $(LIBNL_LIBS) $(GLIB_LIBS)
+ISYS_CFLAGS = -DVERSION_RELEASE='"$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)"'
 
 isysdir     = $(pkgpyexecdir)/isys
 isys_PYTHON = $(srcdir)/*.py
@@ -31,7 +29,7 @@ isys_PYTHON = $(srcdir)/*.py
 pkgpyexec_LTLIBRARIES = _isys.la
 _isys_la_CFLAGS       = $(PYTHON_CFLAGS) $(ISYS_CFLAGS)
 _isys_la_LDFLAGS      = -module -avoid-version
-_isys_la_LIBADD       = $(PYTHON_LIBS) $(ISYS_LIBS)
+_isys_la_LIBADD       = $(PYTHON_LIBS)
 _isys_la_SOURCES      = isys.c
 
 auditddir             = $(libexecdir)/$(PACKAGE_NAME)
diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index f20a064..c9a7ff5 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -22,54 +22,12 @@
 #include <Python.h>
 
 #include <stdio.h>
-#include <dirent.h>
-#include <errno.h>
-#define u32 __u32
-#include <fcntl.h>
-/* Need to tell loop.h what the actual dev_t type is. */
-#undef dev_t
-#if defined(__alpha)
-#define dev_t unsigned int
-#else
-#if defined(__x86_64__)
-#define dev_t unsigned long
-#else
-#define dev_t unsigned short
-#endif
-#endif
-#include <linux/loop.h>
-#undef dev_t
-#define dev_t dev_t
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/sysmacros.h>
 #include <sys/time.h>
-#include <sys/utsname.h>
-#include <sys/vfs.h>
 #include <unistd.h>
-#include <sys/vt.h>
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <linux/fb.h>
-#include <libintl.h>
-#include <libgen.h>
-#include <linux/cdrom.h>
-#include <linux/major.h>
 #include <signal.h>
 #include <execinfo.h>
-
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
-#endif
-
-#ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
-#endif
-
-#ifndef CDROMEJECT
-#define CDROMEJECT 0x5309
-#endif
+#include <stdlib.h>
 
 static PyObject * doSync(PyObject * s, PyObject * args);
 static PyObject * doSegvHandler(PyObject *s, PyObject *args);
@@ -84,9 +42,6 @@ static PyMethodDef isysModuleMethods[] = {
     { NULL, NULL, 0, NULL }
 } ;
 
-#define BOOT_SIGNATURE	0xaa55	/* boot signature */
-#define BOOT_SIG_OFFSET	510	/* boot signature offset */
-
 /* cppcheck-suppress unusedFunction */
 void init_isys(void) {
     Py_InitModule("_isys", isysModuleMethods);
diff --git a/widgets/configure.ac b/widgets/configure.ac
index 87ae7fe..d24f8eb 100644
--- a/widgets/configure.ac
+++ b/widgets/configure.ac
@@ -53,7 +53,7 @@ m4_pattern_forbid([GTK_DOC_CHECK])dnl
 GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
 
 PKG_CHECK_MODULES([GLADEUI], [gladeui-2.0 >= 3.10])
-PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.0])
+PKG_CHECK_MODULES([GTK], [gtk+-x11-3.0 >= 3.11.3])
 PKG_CHECK_MODULES([GLIB], [glib-2.0])
 PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier >= 5.2.1])
 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 1.30])
-- 
1.9.0



More information about the anaconda-patches mailing list