iprutils: Add support for Autotools build system.

This commit adds support to build iprutils using GNU Autools.  It
replaces the old Makefile and version.mk file with Automake.  Now, the
version information is available at the configure.ac file.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This commit is contained in:
Gabriel Krisman Bertazi 2015-02-25 13:38:24 -03:00 committed by Brian King
commit dd589511af
6 changed files with 122 additions and 1 deletions

34
Makefile.am Normal file
View file

@ -0,0 +1,34 @@
# IBM IPR adapter configuration utility
#
# (C) Copyright 2015
# International Business Machines Corporation and others.
# All Rights Reserved. This program and the accompanying
# materials are made available under the terms of the
# Common Public License v1.0 which accompanies this distribution.
#
lib_LTLIBRARIES = libipr.la
libipr_la_SOURCES = iprlib.c
include_HEADERS = iprlib.h
sbin_PROGRAMS = iprconfig iprdump iprupdate iprinit iprdbg
iprconfig_SOURCES = iprconfig.c iprconfig.h
iprconfig_LDADD= libipr.la
iprdump_SOURCES = iprdump.c
iprdump_LDADD= libipr.la
iprupdate_SOURCES = iprupdate.c
iprupdate_LDADD= libipr.la
iprinit_SOURCES = iprinit.c
iprinit_LDADD= libipr.la
iprdbg_SOURCES = iprdbg.c
iprdbg_LDADD= libipr.la
dist_man_MANS = iprconfig.8 iprdump.8 iprinit.8 iprupdate.8
SUBDIRS = . systemd init.d

11
bootstrap.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
set -x
AUX_DIR=build-aux
test -d $AUX_DIR || mkdir -p $AUX_DIR
libtoolize
aclocal
autoconf
automake --add-missing

52
configure.ac Normal file
View file

@ -0,0 +1,52 @@
#
# IBM IPR adapter configuration utility
#
# (C) Copyright 2015
# International Business Machines Corporation and others.
# All Rights Reserved. This program and the accompanying
# materials are made available under the terms of the
# Common Public License v1.0 which accompanies this distribution.
AC_PREREQ([2.63])
AC_INIT([iprutils], [2.4.5], [iprdd-devel@lists.sourceforge.net])
AM_INIT_AUTOMAKE([1.9 foreign])
AC_CONFIG_MACRO_DIR([build-aux])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
LT_INIT
# Check for Libraries.
AC_CHECK_LIB([form], [free_form], [], [AC_ERROR("libform not found.")])
AC_CHECK_LIB([m], [matherr], [], [AC_ERROR("libm not found.")])
AC_CHECK_LIB([menu], [new_menu], [], [AC_ERROR("libmenu not found.")])
AC_CHECK_LIB([panel], [show_panel], [], [AC_ERROR("libpanel not found.")])
AC_CHECK_LIB([ncurses], [curses_version], [],
[AC_ERROR("libncurses not found.")])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h libintl.h locale.h netinet/in.h nl_types.h \
paths.h stddef.h stdint.h stdlib.h string.h sys/file.h \
sys/ioctl.h sys/mount.h sys/socket.h syslog.h \
unistd.h ncurses.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([getcwd isascii memset mkdir munmap pow setenv setlocale \
socket strcasecmp strchr strncasecmp strrchr strstr \
strtol strtoul strtoull])
AC_CONFIG_FILES([Makefile systemd/Makefile init.d/Makefile])
AC_OUTPUT

13
init.d/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
# IBM IPR adapter configuration utility
#
# (C) Copyright 2015
# International Business Machines Corporation and others.
# All Rights Reserved. This program and the accompanying
# materials are made available under the terms of the
# Common Public License v1.0 which accompanies this distribution.
#
dist_pkgdata_DATA = iprdump iprinit iprupdate
sysconfdir=@sysconfdir@/ha.d/resource.d
dist_sysconf_DATA = iprha

View file

@ -1419,7 +1419,7 @@ int handle_events(void (*poll_func) (void), int poll_delay,
int parse_option(char *opt)
{
if (strcmp(opt, "--version") == 0) {
printf("%s: %s\n", tool_name, IPR_VERSION_STR);
printf("%s: %s\n", tool_name, PACKAGE_VERSION);
exit(0);
}

11
systemd/Makefile.am Normal file
View file

@ -0,0 +1,11 @@
# IBM IPR adapter configuration utility
#
# (C) Copyright 2015
# International Business Machines Corporation and others.
# All Rights Reserved. This program and the accompanying
# materials are made available under the terms of the
# Common Public License v1.0 which accompanies this distribution.
#
#
dist_pkgdata_DATA = iprdump.service iprinit.service iprupdate.service