File: configure.ac

package info (click to toggle)
iprutils 2.4.17.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,564 kB
  • sloc: ansic: 26,363; sh: 11,495; makefile: 79; python: 10
file content (173 lines) | stat: -rw-r--r-- 4,667 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#
# 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])
# For RC releases, version should be set to 2.4.10.0.rc1, 2.4.10.0.rc2, etc.
# For GA releases, version should be set to 2.4.10.1, 2.4.10.2, etc.
AC_INIT([iprutils], [2.4.17.1], [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

AC_ARG_ENABLE([build_static],
              [--enable-build-static Generate statically linked binaries],
[case "${enableval}" in
  yes)
     build_static=true
     CFLAGS="-static ${CFLAGS}"
     ;;
  no)
     build_static=false
     ;;
  *)
    AC_MSG_ERROR([bad value ${enableval} for --static])
    ;;
 esac], [build_static=false])
AM_CONDITIONAL([STATIC_BUILD], [test "x${build_static}" = xtrue])

# --enable-sosreport.
AC_ARG_ENABLE([sosreport],
              [--enable-sosreport Install sosreport plugin],
[case "${enableval}" in
  yes)
     sosreport=true
     ;;
  no)
     sosreport=false
     ;;
  *)
    AC_MSG_ERROR([bad value ${enableval} for --enable-sosreport])
    ;;
 esac], [sosreport=false])
AM_CONDITIONAL([SOSREPORT], [test "x${sosreport}" = xtrue])

# --enable-iprdumpfmt.
AC_ARG_ENABLE([iprdumpfmt],
              [--enable-iprdumpfmt Install iprdumpfmt tool],
[case "${enableval}" in
  yes)
     iprdumpfmt=true
     ;;
  no)
     iprdumpfmt=false
     ;;
  *)
    AC_MSG_ERROR([bad value ${enableval} for --enable-iprdumpfmt])
    ;;
 esac], [iprdumpfmt=false])
AM_CONDITIONAL([IPRDUMPFMT], [test "x${iprdumpfmt}" = xtrue])

# --with-systemd
systemdunitdir='${exec_prefix}/lib/systemd/system/'
udevrulesdir='${exec_prefix}/lib/udev/rules.d/'
AC_ARG_WITH([systemd],
	    [--without-systemd Disable systemd service files.],
[case $withval in
     yes)
        systemd=true;
	;;
     no)
	systemd=false;
	;;
     *)
	systemd=true;
	systemdunitdir="$withval"
	;;
 esac], [systemd=true])
AM_CONDITIONAL([SYSTEMD], [test "x${systemd}" = xtrue])
AC_SUBST(systemdunitdir, ${systemdunitdir})
AC_SUBST(udevrulesdir, ${udevrulesdir})

# --with-initd
initddir="${prefix}/etc/init.d/"
AC_ARG_WITH([initscripts],
	    [--with-initscripts Enable initd files.],
[case $withval in
     yes)
        initd=true;
	;;
     no)
	initd=false;
	;;
     *)
	initd=true;
	initddir="$withval"
	;;
 esac], [initd=false])
AM_CONDITIONAL([INITD], [test "x${initd}" = xtrue])
AC_SUBST(initddir, ${initddir})

## Check for python if building with sosreport.
if test "x${SOSREPORT_TRUE}" = "x"; then
   AM_PATH_PYTHON([2.6])
fi

# Check for Libraries.
if test "x${STATIC_BUILD_TRUE}" = "x"; then
 AC_CHECK_LIB(dl, dlopen, [],
	      [AC_ERROR("glibc-static required")])
 AC_CHECK_LIB(tinfo, tgetent, [],
	      [AC_ERROR("libtinfo not found.
	      It should be provided by ncurses")])
fi

save_LIBS="$LIBS"
AC_CHECK_LIB([ncurses], [curses_version], [],
	     [AC_ERROR("libncurses not found.")])
AC_CHECK_LIB([form], [free_form], [], [AC_ERROR("libform not found.")])
AC_CHECK_LIB([m], [pow], [], [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([z], [zlibVersion], [], [AC_ERROR("zlib not found.")])
IPRCONFIG_LIBS="$LIBS"
AC_SUBST([IPRCONFIG_LIBS])
LIBS="$save_LIBS"

ncurses_config=$(which ncurses5-config 2> /dev/null)
if ! test -n ${ncurses_config}; then
  ncurses_config=$(which ncurses6-config 2> /dev/null)
fi

if test -n ${ncurses_config}; then
  ncurses_include=$(${ncurses_config} --cflags)

  if test -n "${ncurses_include}"; then
    CFLAGS="${CFLAGS} ${ncurses_include}"
  fi
fi

# Checks for header files.
AC_CHECK_HEADERS([fcntl.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 form.h menu.h zlib.h], [],
		 [AC_ERROR(["Missing headers."])])

# Checks for typedefs, structures, and compiler characteristics.
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 spec/Makefile udev/Makefile])
AC_OUTPUT