summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:41 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-11-06 01:42:41 +0100
commitee6c7128ed0d58cb1812049463a13bba9cfb31b7 (patch)
tree39b80b4d29c70262a7a6f3443e4acb6bd592b287 /configure.ac
parentb18f5bf2db0fba2e7e539f68645836036d940d26 (diff)
Imported Upstream version 2.9.7upstream/2.9.7
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac149
1 files changed, 86 insertions, 63 deletions
diff --git a/configure.ac b/configure.ac
index 98a7024..344b27a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(ipmiutil,2.9.6)
+AC_INIT(ipmiutil,2.9.7)
AC_CONFIG_SRCDIR(util/ipmiutil.c)
echo "ipmiutil version ${PACKAGE_VERSION}"
AM_CONFIG_HEADER(config.h)
@@ -50,7 +50,7 @@ fi
tmpspec=/tmp/iuspec.tmp$$
archm=`uname -m`
-archp=`uname -p`
+archp=`uname -p 2>/dev/null`
sysname=`uname -s`
LIB_DIR="/usr/lib"
isredhat=0
@@ -195,19 +195,23 @@ AC_ARG_ENABLE([systemd],
if test "x$enable_systemd" = "xyes"; then
GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD"
# if systemd enabled, install service scripts in unitdir
- SYSTEMD_DIR=`rpm --eval "%{_unitdir}"`
+ which rpm >/dev/null 2>&1
+ if test $? -eq 0 ; then
+ SYSTEMD_DIR=`rpm --eval "%{_unitdir}"`
+ else
+ SYSTEMD_DIR=/usr/share/ipmiutil
+ fi
else
# otherwise install the systemd service scripts in the data dir
- if test "x$sysname" = "xDarwin" ; then
- # MacOS 'which' command returns 0 always
- SYSTEMD_DIR=/usr/share/ipmiutil
- else
- which rpm >/dev/null 2>&1
- if test $? -eq 0 ; then
- datad=`rpm --eval "%{_datadir}"`
- SYSTEMD_DIR=${datad}/ipmiutil
- else
- SYSTEMD_DIR=/usr/share/ipmiutil
+ SYSTEMD_DIR=/usr/share/ipmiutil
+ if test "x$sysname" != "xDarwin" ; then
+ if test "x$os" != "xhpux" ; then
+ # MacOS and HP-UX: 'which' command returns 0 always
+ which rpm >/dev/null 2>&1
+ if test $? -eq 0 ; then
+ datad=`rpm --eval "%{_datadir}"`
+ SYSTEMD_DIR=${datad}/ipmiutil
+ fi
fi
fi
fi
@@ -276,13 +280,13 @@ fi
PKG_DIR=/usr/src/packages
INS_LIB=""
-SHR_LINK="libipmiutil.so"
+SHR_LINK="libipmiutil.so.1"
init0=
if test "x$sysname" = "xSunOS"; then
echo "Detected Solaris"
os=solaris
# archp=`uname -p`
- if test -d "/usr/sfw/lib"; then
+ if test -d "/usr/sfw/lib"; then
sfwdir=/usr/sfw
else
sfwdir=/usr/local
@@ -306,10 +310,10 @@ else
os=linux
tmpc=/tmp/tmp.c
tmpo=/tmp/tmp.o
- echo $ECHO_N "checking compile warning flags ... $ECHO_C"
- cfwarn="-Wno-pointer-sign -Wno-sign-conversion -Wunused-result -Wgnu-designator"
+ echo $ECHO_N "checking compile sign warning flags ... $ECHO_C"
+ cfwarn="-Wno-pointer-sign -Wno-sign-conversion -Wunused-result"
echo "int main() { return(1); }" >$tmpc
- gcc -o $tmpo -c $cfwarn $tmpc >/dev/null 2>&1
+ $CC -o $tmpo -c $cfwarn $tmpc >/dev/null 2>&1
if test $? -ne 0 ; then
cfwarn=
echo "skip"
@@ -317,10 +321,21 @@ else
echo "ok, suppress excess warnings"
fi
rm -f $tmpc $tmpo >/dev/null 2>&1
+ echo $ECHO_N "checking compile gnu warning flags ... $ECHO_C"
+ cfgnu="-Wgnu-designator"
+ echo "int main() { return(1); }" >$tmpc
+ $CC -o $tmpo -c $cfgnu $tmpc >/dev/null 2>&1
+ if test $? -ne 0 ; then
+ cfgnu=
+ echo "skip"
+ else
+ echo "ok, suppress excess warnings"
+ fi
+ rm -f $tmpc $tmpo >/dev/null 2>&1
echo $ECHO_N "checking compile fortify flags ... $ECHO_C"
cfhard="-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
echo "int main() { return(1); }" >$tmpc
- gcc -o $tmpo -c $cfhard $tmpc >/dev/null 2>&1
+ $CC -o $tmpo $cfhard $tmpc >/dev/null 2>&1
if test $? -ne 0 ; then
cfhard=
echo "skip"
@@ -337,24 +352,24 @@ else
else
which rpm >/dev/null 2>&1
if test $? -eq 0; then
- pkgtop=`rpm --eval "%{_topdir}"`
- PKG_DIR=$pkgtop
+ pkgtop=`rpm --eval "%{_topdir}"`
+ PKG_DIR=$pkgtop
fi
fi
if test -f "/etc/redhat-release"; then
- echo "Detected Red Hat Linux"
- os=redhat
- isredhat=1
- fi
+ echo "Detected Red Hat Linux"
+ os=redhat
+ isredhat=1
+ fi
if test -f "/etc/SuSE-release"; then
- echo "Detected SuSE Linux"
- os=suse
- sed -e 's/# POST_INSTALL/if [ ! -f \/etc\/snmp\/snmpd.conf ]; then\n if [ -f \/etc\/ucdsnmpd.conf ]; then\n mkdir -p \/etc\/snmp; ln -s \/etc\/ucdsnmpd.conf \/etc\/snmp\/snmpd.conf\n fi\nif [ -f \/etc\/snmpd.conf ]; then\nmkdir -p \/etc\/snmp; ln -s \/etc\/snmpd.conf \/etc\/snmp\/snmpd.conf\nfi\nfi\n#/' -e 's/make install DEST/make install-strip DEST/' doc/ipmiutil.spec >$tmpspec
- cp -f $tmpspec doc/ipmiutil.spec
- fi
- if test -f "/etc/mvl-release"; then
- echo "Detected MontaVista Linux"
- os=montavista
+ echo "Detected SuSE Linux"
+ os=suse
+ sed -e 's/# POST_INSTALL/if [ ! -f \/etc\/snmp\/snmpd.conf ]; then\n if [ -f \/etc\/ucdsnmpd.conf ]; then\n mkdir -p \/etc\/snmp; ln -s \/etc\/ucdsnmpd.conf \/etc\/snmp\/snmpd.conf\n fi\nif [ -f \/etc\/snmpd.conf ]; then\nmkdir -p \/etc\/snmp; ln -s \/etc\/snmpd.conf \/etc\/snmp\/snmpd.conf\nfi\nfi\n#/' -e 's/make install DEST/make install-strip DEST/' doc/ipmiutil.spec >$tmpspec
+ cp -f $tmpspec doc/ipmiutil.spec
+ fi
+ if test -f "/etc/mvl-release"; then
+ echo "Detected MontaVista Linux"
+ os=montavista
init0=/etc/init.d
sed -e 's/openssl-devel/openssl-dev\n%ifarch x86_pentium3 x86_pentium4\nAutoReqProv: No\n%endif/' -e 's/%{_mandir}/\/usr\/share\/man/' -e 's/%{_initrddir}/\/etc\/init.d/' -e 's/%{_sysconfdir}/\/etc/' -e 's/# POST_INSTALL/newcrypto=%{_libdir}\/libcrypto.so.4\nif [ ! -f $newcrypto ]; then\n cp -f %{_libdir}\/libcrypto.so.0 $newcrypto\nfi\n#/' -e 's/make install DEST/make install-strip DEST/' doc/ipmiutil.spec >$tmpspec
cp -f $tmpspec doc/ipmiutil.spec
@@ -379,7 +394,7 @@ else
sed -i 's/# Default-Start:/# Default-Start: 3 4 5/' $init_scripts
sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts
fi
- if test -f "$LIB_DIR/libcrypto.so"; then
+ if test -f "$LIB_DIR/libcrypto.so"; then
strings $LIB_DIR/libcrypto.so | grep EVP_md2 >/dev/null 2>&1
if test $? -ne 0; then
echo "No MD2 detected in openssl libcrypto.so"
@@ -389,50 +404,52 @@ else
echo "No openssl $LIB_DIR/libcrypto.so detected"
MD2_CFLAGS="-DSKIP_MD2"
fi
- OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfhard"
+ OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfhard"
else
+ macos=1 # =1 means not mac
# usually "x$sysname" = "xFreeBSD", but allow NetBSD
# echo $sysname | grep 'BSD' >/dev/null 2>&1
- macos=1
echo $sysname | grep -q BSD
bsd=$?
if test "x$sysname" = "xDarwin" ; then
if test "$archp" = "powerpc" ; then
macos=0
- else
+ else
+ # else treat Darwin like BSD
bsd=0
fi
fi
uname -a | grep -i HP-UX >/dev/null 2>&1
hpux=$?
- if test $bsd -eq 0; then
- os=bsd
- OS_CFLAGS="-DBSD -fPIC"
- OS_LFLAGS=""
- OS_DRIVERS="ipmimv.c ipmidir.c"
- drivers="open direct"
+ if test $hpux -eq 0; then
+ echo "Detected HP-UX"
+ os=hpux
+ MD2_CFLAGS="-DSKIP_MD2"
+ OS_CFLAGS="-DHPUX $MD2_CFLAGS"
+ OS_LFLAGS=""
+ OS_DRIVERS="imbapi.c ipmimv.c ipmidir.c"
+ drivers="imb open direct"
+ SHR_LINK=""
else
- if test $hpux -eq 0; then
- echo "Detected HP-UX"
- os=hpux
- MD2_CFLAGS="-DSKIP_MD2"
- OS_CFLAGS="-DHPUX $MD2_CFLAGS"
- OS_LFLAGS=""
- OS_DRIVERS="ipmimv.c"
- drivers="open"
- SHR_LINK=""
+ if test $bsd -eq 0; then
+ echo "Detected BSD"
+ os=bsd
+ OS_CFLAGS="-DBSD -fPIC"
+ OS_LFLAGS=""
+ OS_DRIVERS="ipmimv.c ipmidir.c"
+ drivers="open direct"
elif test $macos -eq 0; then
echo "Detected MacOSX"
os=macos
MD2_CFLAGS="-DSKIP_MD2"
OS_CFLAGS="-DMACOS $MD2_CFLAGS -fPIC"
OS_LFLAGS=""
- OS_DRIVERS="ipmimv.c ipmidir.c"
- drivers="open direct"
- SHR_LINK=""
- # optionally check for AppleBMC.kext here?
+ OS_DRIVERS="ipmimv.c ipmidir.c"
+ drivers="open direct"
+ SHR_LINK=""
+ # optionally check for AppleBMC.kext here?
else
- # not Solaris, Linux, BSD, or HP-UX = error
+ # not Solaris, Linux, BSD, or HP-UX = error
echo "OS $sysname not yet supported"
exit 1
fi
@@ -443,12 +460,14 @@ fi
dnl determine where the init.d directory is
if test "x$init0" = "x" ; then
if test "x$os" != "xmacos" ; then
- which rpmbuild >/dev/null 2>&1
- if test $? -eq 0 ; then
- init1=`rpmbuild --showrc |grep " _initrddir" | cut -d'}' -f2`
- if test "x$init1" != "x" ; then
- init0=/etc/${init1}
- fi
+ if test "x$os" != "xhpux" ; then
+ which rpmbuild >/dev/null 2>&1
+ if test $? -eq 0 ; then
+ init1=`rpmbuild --showrc |grep " _initrddir" | cut -d'}' -f2`
+ if test "x$init1" != "x" ; then
+ init0=/etc/${init1}
+ fi
+ fi
fi
fi
fi
@@ -492,6 +511,10 @@ if test "x$sysname" = "xSunOS"; then
# -e 's/ipmidir.c/ipmibmc.c/'
cp -f /tmp/make util/Makefile
fi
+if test "x$os" = "xhpux" ; then
+ sed -e 's/^.NOEXPORT:/#.NOEXPORT:/' util/Makefile >/tmp/make
+ cp -f /tmp/make util/Makefile
+fi
AC_MSG_RESULT([])
AC_MSG_RESULT([ipmiutil $VERSION])