summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml118
-rw-r--r--.gitignore39
-rw-r--r--ChangeLog333
-rw-r--r--INSTALL74
-rw-r--r--Makefile.am46
-rw-r--r--Makefile.in906
-rw-r--r--README15
-rw-r--r--aclocal.m49780
-rwxr-xr-xbootstrap10
-rwxr-xr-xcompile347
-rwxr-xr-xconfig.guess1420
-rw-r--r--config.h.in246
-rwxr-xr-xconfig.sub1799
-rwxr-xr-xconfigure16365
-rw-r--r--configure.ac152
-rw-r--r--contrib/Makefile.in550
-rw-r--r--contrib/bmc-snmp-proxy138
-rw-r--r--contrib/bmc-snmp-proxy.service2
-rw-r--r--contrib/exchange-bmc-os-info.init.redhat6
-rw-r--r--contrib/exchange-bmc-os-info.service.redhat5
-rwxr-xr-xcontrib/ipmievd.init.debian2
-rw-r--r--contrib/oem_ibm_sel_map2
-rw-r--r--control/Makefile.am4
-rw-r--r--control/Makefile.in503
-rw-r--r--control/ipmitool.spec.in634
-rw-r--r--control/rpmmacros.in12
-rw-r--r--control/rpmrc8
-rwxr-xr-xcsv-revision10
-rwxr-xr-xdepcomp791
-rw-r--r--doc/Makefile.in611
-rw-r--r--doc/ipmievd.8.in (renamed from doc/ipmievd.8)16
-rw-r--r--doc/ipmitool.1.in (renamed from doc/ipmitool.1)466
-rw-r--r--include/Makefile.in666
-rw-r--r--include/ipmitool/Makefile.am3
-rw-r--r--include/ipmitool/Makefile.in563
-rw-r--r--include/ipmitool/bswap.h5
-rw-r--r--include/ipmitool/helper.h120
-rw-r--r--include/ipmitool/hpm2.h2
-rw-r--r--include/ipmitool/ipmi.h18
-rw-r--r--include/ipmitool/ipmi_cc.h6
-rw-r--r--include/ipmitool/ipmi_cfgp.h195
-rw-r--r--include/ipmitool/ipmi_channel.h94
-rw-r--r--include/ipmitool/ipmi_chassis.h5
-rw-r--r--include/ipmitool/ipmi_constants.h11
-rw-r--r--include/ipmitool/ipmi_dcmi.h11
-rw-r--r--include/ipmitool/ipmi_delloem.h6
-rw-r--r--include/ipmitool/ipmi_ekanalyzer.h5
-rw-r--r--include/ipmitool/ipmi_entity.h5
-rw-r--r--include/ipmitool/ipmi_event.h32
-rw-r--r--include/ipmitool/ipmi_firewall.h5
-rw-r--r--include/ipmitool/ipmi_fru.h67
-rw-r--r--include/ipmitool/ipmi_fwum.h5
-rw-r--r--include/ipmitool/ipmi_gendev.h5
-rw-r--r--include/ipmitool/ipmi_hpmfwupg.h26
-rw-r--r--[-rwxr-xr-x]include/ipmitool/ipmi_ime.h5
-rw-r--r--include/ipmitool/ipmi_intf.h65
-rw-r--r--include/ipmitool/ipmi_isol.h5
-rw-r--r--include/ipmitool/ipmi_kontronoem.h89
-rw-r--r--include/ipmitool/ipmi_lanp.h86
-rw-r--r--include/ipmitool/ipmi_lanp6.h52
-rw-r--r--include/ipmitool/ipmi_main.h5
-rw-r--r--include/ipmitool/ipmi_mc.h181
-rw-r--r--include/ipmitool/ipmi_oem.h5
-rw-r--r--include/ipmitool/ipmi_pef.h320
-rw-r--r--include/ipmitool/ipmi_picmg.h96
-rw-r--r--include/ipmitool/ipmi_quantaoem.h52
-rw-r--r--include/ipmitool/ipmi_raw.h5
-rw-r--r--include/ipmitool/ipmi_sdr.h112
-rw-r--r--include/ipmitool/ipmi_sdradd.h7
-rw-r--r--include/ipmitool/ipmi_sel.h1070
-rw-r--r--include/ipmitool/ipmi_sel_supermicro.h96
-rw-r--r--include/ipmitool/ipmi_sensor.h4
-rw-r--r--include/ipmitool/ipmi_session.h5
-rw-r--r--include/ipmitool/ipmi_sol.h23
-rw-r--r--include/ipmitool/ipmi_strings.h18
-rw-r--r--include/ipmitool/ipmi_sunoem.h6
-rw-r--r--include/ipmitool/ipmi_time.h90
-rw-r--r--include/ipmitool/ipmi_tsol.h5
-rw-r--r--include/ipmitool/ipmi_user.h8
-rw-r--r--include/ipmitool/ipmi_vita.h5
-rw-r--r--include/ipmitool/log.h9
-rwxr-xr-xinstall-sh527
-rw-r--r--ipmitool.spec404
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/Makefile.in713
-rw-r--r--lib/dimm_spd.c71
-rw-r--r--lib/helper.c398
-rw-r--r--lib/ipmi_cfgp.c546
-rw-r--r--lib/ipmi_channel.c467
-rw-r--r--lib/ipmi_chassis.c1577
-rw-r--r--[-rwxr-xr-x]lib/ipmi_dcmi.c1265
-rw-r--r--lib/ipmi_delloem.c766
-rw-r--r--lib/ipmi_ekanalyzer.c405
-rw-r--r--lib/ipmi_event.c218
-rw-r--r--lib/ipmi_firewall.c104
-rw-r--r--lib/ipmi_fru.c1062
-rw-r--r--lib/ipmi_fwum.c64
-rw-r--r--lib/ipmi_gendev.c65
-rw-r--r--lib/ipmi_hpmfwupg.c184
-rw-r--r--[-rwxr-xr-x]lib/ipmi_ime.c90
-rw-r--r--lib/ipmi_isol.c51
-rw-r--r--lib/ipmi_kontronoem.c75
-rw-r--r--lib/ipmi_lanp.c684
-rw-r--r--lib/ipmi_lanp6.c1238
-rw-r--r--lib/ipmi_main.c331
-rw-r--r--lib/ipmi_mc.c809
-rw-r--r--lib/ipmi_oem.c49
-rw-r--r--lib/ipmi_pef.c1556
-rw-r--r--lib/ipmi_picmg.c280
-rw-r--r--lib/ipmi_quantaoem.c184
-rw-r--r--lib/ipmi_raw.c33
-rw-r--r--lib/ipmi_sdr.c877
-rw-r--r--lib/ipmi_sdradd.c34
-rw-r--r--lib/ipmi_sel.c750
-rw-r--r--lib/ipmi_sensor.c394
-rw-r--r--lib/ipmi_session.c58
-rw-r--r--lib/ipmi_sol.c116
-rw-r--r--lib/ipmi_strings.c1213
-rw-r--r--lib/ipmi_sunoem.c207
-rw-r--r--lib/ipmi_time.c243
-rw-r--r--lib/ipmi_tsol.c33
-rw-r--r--lib/ipmi_user.c138
-rw-r--r--lib/ipmi_vita.c86
-rw-r--r--lib/log.c16
-rw-r--r--ltmain.sh9661
-rwxr-xr-xmissing215
-rw-r--r--src/Makefile.in860
-rw-r--r--src/ipmievd.c84
-rw-r--r--src/ipmishell.c79
-rw-r--r--src/ipmitool.c4
-rw-r--r--src/plugins/Makefile.am5
-rw-r--r--src/plugins/Makefile.in757
-rw-r--r--src/plugins/bmc/Makefile.in640
-rw-r--r--src/plugins/bmc/bmc.c11
-rw-r--r--src/plugins/bmc/bmc.h5
-rw-r--r--src/plugins/bmc/bmc_intf.h5
-rw-r--r--src/plugins/dbus/Makefile.am41
-rw-r--r--src/plugins/dbus/dbus.c241
-rw-r--r--src/plugins/dummy/Makefile.in607
-rw-r--r--src/plugins/dummy/dummy.c16
-rw-r--r--src/plugins/dummy/dummy.h7
-rw-r--r--src/plugins/free/Makefile.in612
-rw-r--r--src/plugins/free/free.c16
-rw-r--r--src/plugins/imb/Makefile.in638
-rw-r--r--src/plugins/imb/imb.c6
-rw-r--r--src/plugins/imb/imbapi.c2838
-rw-r--r--src/plugins/imb/imbapi.h12
-rw-r--r--src/plugins/ipmi_intf.c133
-rw-r--r--src/plugins/lan/Makefile.in639
-rw-r--r--src/plugins/lan/asf.h19
-rw-r--r--src/plugins/lan/auth.c13
-rw-r--r--src/plugins/lan/auth.h5
-rw-r--r--src/plugins/lan/lan.c213
-rw-r--r--src/plugins/lan/lan.h5
-rw-r--r--src/plugins/lan/rmcp.h18
-rw-r--r--src/plugins/lanplus/Makefile.in649
-rw-r--r--src/plugins/lanplus/README.lanplus74
-rw-r--r--src/plugins/lanplus/README.sol76
-rw-r--r--src/plugins/lanplus/asf.h19
-rw-r--r--src/plugins/lanplus/lanplus.c470
-rw-r--r--src/plugins/lanplus/lanplus.h25
-rw-r--r--src/plugins/lanplus/lanplus_crypt.c232
-rw-r--r--src/plugins/lanplus/lanplus_crypt.h8
-rw-r--r--src/plugins/lanplus/lanplus_crypt_impl.c71
-rw-r--r--src/plugins/lanplus/lanplus_crypt_impl.h7
-rw-r--r--src/plugins/lanplus/lanplus_dump.c39
-rw-r--r--src/plugins/lanplus/lanplus_dump.h7
-rw-r--r--src/plugins/lanplus/rmcp.h18
-rw-r--r--src/plugins/lipmi/Makefile.in637
-rw-r--r--src/plugins/lipmi/lipmi.c12
-rw-r--r--src/plugins/lipmi/lipmi.h43
-rw-r--r--src/plugins/open/Makefile.in637
-rw-r--r--src/plugins/open/open.c422
-rw-r--r--src/plugins/open/open.h5
-rw-r--r--src/plugins/serial/Makefile.in638
-rw-r--r--src/plugins/serial/serial_basic.c32
-rw-r--r--src/plugins/serial/serial_terminal.c41
-rw-r--r--src/plugins/usb/Makefile.in637
-rw-r--r--src/plugins/usb/usb.c14
179 files changed, 17489 insertions, 63801 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..0ae024c
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,118 @@
+# vi: set et ts=2 sw=2 :
+name: build
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ linux:
+ strategy:
+ matrix:
+ os: [ ubuntu-18.04, ubuntu-20.04 ]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - name: install dependencies
+ run: |
+ sudo apt install \
+ automake \
+ gcc \
+ git \
+ libssl-dev \
+ libtool \
+ make \
+ wget
+ - name: install extra libraries
+ # This build job tries to verify as much of ipmitool code
+ # as possible, hence these libraries. They aren't usually
+ # needed for normal user builds:
+ run: |
+ sudo apt update
+ sudo apt install \
+ libsystemd-dev \
+ libreadline-dev \
+ libfreeipmi-dev \
+ libusb-dev
+ - uses: actions/checkout@v2
+ - name: bootstrap
+ run: ./bootstrap
+ - name: configure
+ run: |
+ # For Linux, build as many extra interfaces as possible
+ # to verify the code
+ ./configure --enable-intf-dummy \
+ --enable-intf-dbus \
+ --enable-intf-usb \
+ --enable-intf-free
+ - name: make
+ run: make
+ - name: make check
+ run: make check
+ - name: make distcheck
+ run: make distcheck
+
+ macos-catalina:
+ strategy:
+ matrix:
+ os: [ macos-10.15, macos-11 ]
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: install dependencies
+ run: brew install automake openssl libtool freeipmi wget
+ - uses: actions/checkout@v2
+ - name: bootstrap
+ run: ./bootstrap
+ - name: configure
+ run: |
+ ./configure --enable-intf-dummy \
+ LDFLAGS=-L/usr/local/opt/openssl@1.1/lib \
+ CFLAGS=-I/usr/local/opt/openssl@1.1/include
+ - name: make
+ run: make
+ - name: make check
+ run: make check
+ - name: make distcheck
+ run: make distcheck
+
+ win-srv-2019:
+
+ runs-on: windows-2019
+
+ steps:
+ - name: install dependencies
+ run: |-
+ choco install cygwin -y
+ choco install cyg-get -y
+ # Line continuation in PowerShell is backtick. Weird as Windows.
+ cyg-get gcc-g++ `
+ make `
+ automake `
+ autoconf `
+ m4 `
+ libtool `
+ libncurses-devel `
+ libreadline-devel `
+ libssl-devel `
+ dos2unix `
+ wget
+ echo "C:/tools/cygwin/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ echo "C:/tools/cygwin/usr/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ - uses: actions/checkout@v2
+ - name: convert line ends
+ # checkout action on Windows apparently converts line ends
+ # so we have to convert them back because cygwin bash can't
+ # can't handle Windows line ends
+ run: dos2unix bootstrap configure.ac csv-revision
+ - name: bootstrap
+ run: bash -c "./bootstrap"
+ - name: configure
+ run: bash -c "./configure"
+ - name: make
+ run: make
+ - name: make check
+ run: make check
+ - name: make distcheck
+ run: make distcheck
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..bedbed2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,39 @@
+.deps
+.dirstamp
+.libs
+.*.swp
+*.log
+*.rej
+*.orig
+*.o
+*.lo
+*.la
+*.*~
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+ltmain.sh
+libtool
+missing
+stamp-h1
+control/ipmitool.spec
+control/pkginfo
+control/prototype
+control/rpmmacros
+src/ipmievd
+src/ipmitool
+doc/ipmievd.8
+doc/ipmitool.1
+cscope.out
+tags
diff --git a/ChangeLog b/ChangeLog
index 767891c..f072a63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,302 @@
+version 1.8.19 2022-08-31
+ * Cast type before the left shift
+ * sel: Fix the deasserted thresholds inequality
+ * man: Update the text for -C option
+ * chassis restart_cause: Add new causes
+ * sel: Remove redundant "Reserve SEL"
+ * zero initialize the recv structure on the stack
+ * zero initialize the recv structure on the stack
+ * ci: Add support for MacOS-11
+ * ci: Remove ubuntu-16.04 support
+ * sdr: Fix modifier unit
+ * Fix compile error
+ * Refactor bridging level detection to dedicated function
+ * Fix double bridge detection in get_max_(req|rsp)_data_size()
+ * ipmi_mc: Fix the IPM_DEV_FWREV1_MAJOR_MASK
+ * helper: Fix stderr file descriptor
+ * Fix codefactor-io / CodeFactor warnings
+ * Use /run instead of /var/run
+ * oem: Update product IDs for YADRO
+ * lan: Add processing of get/set specific CCs
+ * lan: Refactor pointer style
+ * doc: update lanplus doc to reflect default cipher suite change
+ * ekanalyzer: Fix internal use area off-by-one bug
+ * ekanalyzer frushow: Fix internal area size calc
+ * sel: Fix "power supply inactive" flag offset
+ * ci: Add support for Ubuntu 20.04
+ * ci: Fix Ubuntu builds
+ * Fix compiler warning
+ * Fix compiler warning
+ * Fix compiler warning
+ * ci: Update for GitHub Actions v2.274.2
+ * free: Fix implicit function declarations
+ * Use "#pragma once" for headers
+ * Remove unneeded execution bits from C source files and a header file
+ * Convert line endings to LF
+ * Fixed compiler warning.
+ * RPM support: fixed broken build due to use of headers from kernel
+ * imbapi: replace __FUNCTION__ to eleminate compiler warnings
+ * lanplus: remove unused variable
+ * hpmfwupg: Clean up / refactor
+ * fru: Fix crashes on 6-bit ASCII strings
+ * oem: Add product ID for YADRO VEGMAN
+ * configure.ac: add '--location' for curl to follow location
+ * configure.ac: replace '-#' by '--progress-bar' with curl
+ * Add version info to debug output
+ * doc, ci: Fix an error in package name for Windows
+ * doc: Fix a small typo in INSTALL
+ * RPM support: updated spec file changelog
+ * RPM support: simplified build process
+ * RPM support: fixed broken RPM build
+ * doc: Update INSTALL with Windows info
+ * ci: Add Windows/cygwin config
+ * doc: Update INSTALL for new CI
+ * ci: Add github workflow, drop travis
+ * Fix compatibility with OpenBSD and macOS
+ * dist: Fix dependencies and cleanup
+ * dist: Add missing ipmi_time.h header to packaging
+ * configure: Fix compatibility with non-bash systems
+ * Finalize refactoring of string comparisons
+ * channel: Refactor set_user_access option processing
+ * Refactor string comparisons
+ * sel: Fix OEM record definition example
+ * sdr: harden against bad records
+ * fru: fix memory leak in ipmi_spd_print_fru
+ * ipmi_sel_set_time: fix strptime() return check
+ * hpm: use portable __max() in hpmfwupg
+ * hpmfwupg: move variable definition to .c file
+ * sel: time: fix null pointer dereference in set
+ * fru, sdr: Fix id_string buffer overflows
+ * lanp: Fix buffer overflows in get_lan_param_select
+ * channel: Fix buffer overflow
+ * session: Fix buffer overflow in ipmi_get_session_info
+ * fru: Fix buffer overflow in ipmi_spd_print_fru
+ * fru: Fix buffer overflow vulnerabilities
+ * configure: Drop requirement for curses et. al libs
+ * configure: remove some duplicate code
+ * doc: Update INSTALL to fix installation errors
+ * ipmi_dcmi: fix typo in nm_policy_options initialization.
+ * Docs: Add info on packages to install on Ubuntu 16.04
+ * chassis: Refactor to get rid of strncmp()
+ * chassis: Refactor main for centralized exiting
+ * chassis: bootdev: Refactor more
+ * chassis: bootdev: Refactor to reduce nesting
+ * chassis: bootdev: Fix help message and its formatting
+ * chassis: bootparam/bootdev: Refactor for less magic
+ * oem: supermicro: Add product codes from IPMICFG
+ * doc: Update man page regarding `user set password`
+ * user: Cleanup/refactor ipmi_user_password()
+ * user: Improve password length handling
+ * user: Alter "set password" usage information
+ * intf: Add missing function declarations
+ * doc: fix URL in README
+ * event: Clean up event sending from a file
+ * event: Clean up the event sending code
+ * event: Fix event submission via SSIF
+ * make: Use DESTDIR to install IANA PEN database
+ * lanplus: Fix embedded bridged responses handling
+ * Update .gitignore
+ * mc: Fix reporting of manufacturers > 64K
+ * Add installation of enterprise-numbers database
+ * Update documentation in regard to IANA PEN registry
+ * Use configurable path to IANA PEN registry
+ * Load IANA PEN registry from a file
+ * dbus: Replace obsolete INCLUDES with AM_CPPFLAGS
+ * oem: name change from Newisys to Viking Enterprise Solutions
+ * Fix default interface to behave as it did before
+ * man: Add documentation for chassis bootmbox
+ * man: Update the chassis bootparam section
+ * chassis: Add boot initiator mailbox support
+ * chassis: Use command-specific completion code parser
+ * Add support for command-specific completion codes
+ * Add a helper htoipmi24() function
+ * Add a helper args2buf() function
+ * man: Cleanup the manpage formatting tags
+ * create_pen_list: only print if values are set
+ * chassis: Refactor to reduce code duplication
+ * chassis: Refactor to reduce code duplication
+ * sdr: Fix segfault on invalid unit types
+ * vendor: Add YADRO TATLIN Storage Controller ID
+ * exchange-bmc-os-info: Remove dependency on ipmi.service
+ * Add mechanism to configure to set the default interface
+ * ci: Update INSTALL to reflect recent changes
+ * ci: Set up matrix builds with Travis CI
+ * Enable Travis build of D-Bus interface
+ * add OpenBMC D-Bus interface
+ * Fix "ipmitool pef {status,info}" not printing final newline
+ * Remove unused include
+ * Fix IPMI DCMI message typo
+ * open: swap free() calls for free_n()
+ * open: checking received msg id against expectation
+ * open: fix whitespace
+ * Refactor free_n() function
+ * fru: swap free() calls for free_n()
+ * fru: Fix write chunk reduction code
+ * fru: add macro FRU_AREA macros
+ * fru: replace magic return codes with macros
+ * fru header: add return error codes specific to fru
+ * fru: fix ipmi_fru_picmg_ext_edit as bool
+ * fru: use bool with ipmi_fru_oemkontron_edit
+ * fru: change ipmi_fru_query_new_value to return bool
+ * fru: mark ipmi_fru_query_new_value as static
+ * fru: add fru_cc_rq2big helper method for code checks
+ * fru: cleanup ipmi_fru_upg_ekeying
+ * fru: use ipmi_cc defined maros for return codes
+ * fru: drop extraneous parentheses on negative returns
+ * fru: delete unused variable matchInstance
+ * fru: cleanup ipmi_fru_oemkontron_get
+ * fru: fixup array bounds checking
+ * hpm: Adhere to centralized exiting
+ * hpm: Minor refactoring
+ * hpm: Fix resource leak
+ * sol: Make interface timeout obey the -N option
+ * helper: add free_n method to handle clearing pointers
+ * cygwin: imb: Fix build error (wchar_t)
+ * lanplus: Fix segfault for truncated dcmi response
+ * Move led color static array to source file
+ * drop unused static arrays
+ * move static objects to source file
+ * cleanup all unused-parameter warnings
+ * use __UNUSED__ macro instead of gcc specific attribute
+ * implement __UNUSED__ macro for marking unused
+ * Add .dirstamp to .gitignore
+ * fru: Fix processing of unspecified board mfg. date
+ * [compiler-warnings-fixes] use correct fall through comment
+ * [compiler-warnings-fixes] ipmi_start_daemon: check return values
+ * [compiler-warnings-fixes] ipmi_sdr.c: remove unused function parameters
+ * lan: Fix processing disabled VLAN
+ * Make ipmitool respect system locale settings
+ * Fix strftime() non-literal argument warning
+ * Refactor timestamp handling
+ * doc: Update manpage with new contact info
+ * lanplus: Refactoring
+ * lanplus: Fix -C option processing
+ * lanplus: Auto-select 'best' cipher suite available
+ * lanplus: Fix compile with deprecated APIs disabled.
+ * doc: Update home page links
+ * doc: Update formatting of ipmitool man page
+ * sensor: Refactor ipmi_sensor_print_fc_threshold()
+ * sensor: Add support for csv output
+ * plugins: open: Properly enable event receiver (#35)
+ * lan: Refactoring: Remove unused function
+ * general: Get rid of some unused parameter warnings
+ * mc: guid: Implement encoding autodetection
+ * mc: guid: Fix timestamp decoding
+ * mc: guid: Add support for non-standard encodings
+ * mc: guid: Fix byte ordering to follow IPMI spec
+ * Refactoring: optimize pointer checks
+ * imb: Refactoring: remove duplicate code
+ * Refactoring: get rid of superfluous comparisons
+ * Refactoring. Improve code reuse ratio.
+ * general: Fix several misspellings
+ * mc: Fix compiler warnings
+ * general: Add array_byteswap() to helper
+ * lanplus: Make byteswapping generic
+ * framework: Update .gitignore
+ * framework: Switch to C11 standard with GNU extensions
+ * framework: ci: Add support for Travis CI
+ * oem: Add basic support for Quanta
+ * intf: Refactoring. Remove unused sendrsp()
+ * dummy: Add default dummy socket
+ * mc: Fix manufacturer ID masking
+ * Refactoring. Remove useless feature test macros.
+ * general: Make byteswapping arch-independent
+ * sel: Minor refactoring
+ * sdr: Refactor/optimize code. No functional changes.
+ * Add an option to display all dates in UTC
+ * mc: Code refactor to reduce copy-paste ratio
+ * mc: watchdog set: Refactor to reduce complexity
+ * mc: watchdog set: Fix intr setting
+ * mc: watchdog get: Update to match IPMI 2.0 spec
+ * mc: watchdog: Add `set` command
+ * framework: Make git ignore cscope.out
+ * plugins/open: Fix for interrupted select
+ * nm: Fix policy range (#12)
+ * Replace user_id masks with a macro (#8)
+ * fru: internaluse: Fix segmentation fault (#9)
+ * dcmi: Refactor
+ * ID:508 - Fix segfaults in dcmi command handlers
+ * vendor: Add YADRO VESNIN identification
+ * ID:491 - Fetch vendor IDs from IANA
+ * ID:472 - Fix The Most recent Addition/Erase date
+ * ID:480 - Call EVP_CIPHER_CTX_free() instead of EVP_CIPHER_CTX_cleanup()
+ * ID:480 - ipmitool coredumps in EVP_CIPHER_CTX_init
+ * Make git revision more descriptive
+ * ID:477 - fru: Fix decoding of non-text data in get_fru_area_str()
+ * ID:479 - ekanalyzer: fix processing of custom mfg. fields
+ * ID:478 - ekanalyzer: Fixed decoding of FRU fields
+ * Add some more configure/build/editor byproducts to .gitignore
+ * Add git hash and dirty mark to ipmitool version
+ * Prevent autoreconf from complaining about missing NEWS
+ * Add bootstrap support for Mac
+ * ID:474 - Compile fix on nonlinux systems
+ * ID:461 - Make compiler happier about changes related to OpenSSL 1.1
+ * ID:461 - OpenSSL 1.1 compatibility - "error: storage size of 'ctx' isn't known"
+
+version 1.8.18 2016-10-08
+ * Add mac2str() and str2mac() to print/parse MAC address
+ * Change formatting, remove commented-out code in
+ src/plugins/imb/imbapi.c
+ * Export find_lan_channel() as global
+ * Expose _ipmi_get_channel_info()
+ * Extend buf2str to allow separator
+ * Fix indentation of #define in src/plugins/imb/imbapi.c
+ * Fix missing `goto out_free;` when ipmi_parse_hex() returns (-1)
+ * Fix warning for buf2str argument
+ * ID 408 - fix sel list last X listing
+ * ID: 38 - Protocol violating SOL retries when talking to
+ SIMSO-HTC
+ * ID: 459 - Fix reading FRU on Artesyn (Emerson) shelf manager,
+ MF105.
+ * ID: 464 - ipmievd crash fix in log_event
+ * ID:230 - check return value of malloc() in lib/ipmi_ekanalyzer.c
+ * ID:261 - Fix err. output consistency for % ipmitool chassis
+ INV_PARAM;
+ * ID:287 - Fix print-out of DDR3 SDRAM Serial Number
+ * ID:287 - Remove trailing white-spaces from dimm_spd.c
+ * ID:289 - bmx-snmp-proxy: PEF alerting does not work for
+ multiple destinations
+ * ID:312 - BREAKING CHANGE - Re-design of PEF user interface
+ * ID:312 - Fix bitmask in _ipmi_set_pef_policy_entry()
+ * ID:335 - Check return value of fseek(), prevent segfault
+ * ID:335 - Check return value of fseek(), prevent segfault
+ * ID:355 - Comment out statement without effect in lib/ipmi_sel.c
+ * ID:355 - Fix 'missing initializer' in struct lan_param
+ * ID:355 - Fix ``warning: ISO C forbids zero-size array 'data'''
+ * ID:355 - Fix different pointer type in lib/ipmi_picmg.c
+ * ID:355 - Fix missing struct initializers in lib/ipmi_firewall.c
+ * ID:355 - Fix printf format in lib/ipmi_sunoem.c
+ * ID:355 - Fix printf() related warnings in lib/ipmi_delloem.c
+ * ID:355 - Fix signedness warnings in lib/ipmi_sdr.c
+ * ID:355 - Fix statements without effect in lib/ipmi_ekanalyzer.c
+ * ID:355 - Move section_id from ipmi_fru. to ipmi_fru.c
+ * ID:355 - Replace DEBUG() macro with lprintf(LOG_DEBUG, ...)
+ * ID:375 - Add lan6 subcommand to handle IPv6 LAN parameters
+ * ID:400 - Add support for VITA-specific sensor types and events.
+ * ID:441 - Add support for HMAC_MD5 and HMAC_SHA256
+ * ID:443 - Disable USB driver by default on non-Linux systems
+ * ID:444 - Cleanup of defaults in configure.ac
+ * ID:445 - Fix of compilation on FreeBSD
+ * ID:446 - Fix broken firewall reset iterator
+ * ID:447 - Fix access beyond array limits in serial_terminal
+ * ID:449 - ipmitool close console session for sol deactivate
+ command
+ * ID:451 - Modify the memory ecc error display of SEL for new
+ supermicro motherboards.
+ * ID:452 - Add PICMG extension 5.x for PICMG extension check
+ * ID:454 - Add support for PICMG 3.1 R2.0 Link Types and Link
+ Classes.
+ * ID:456 - Unable to disable the VLAN ID using ipmitool
+ * ID:457 - Display User ID enable/disable status
+ * ID:463 - Removal of Nokia Siemens Networks
+ * ID:465 - Supermicro memory ecc Modify the memory ecc error
+ display of SEL for new supermicro boards.
+ * Moved ipmi_parse_hex() to helper.c
+ * Re-work ipmi_mc_get_guid() and turn it into reusable code
+ * Revert "ID:335 - Check return value of fseek(), prevent
+ segfault"
+ * Rewrite code with the notion that Kg is binary data, not string
+
version 1.8.17 2016-05-01
* Add INSTALL and NEWS, mandated by autoconf
* Added missing ipmi_sel_supermicro.h to template Makefile.am
@@ -583,7 +882,7 @@ version 1.8.11 released 2009-02-25
* Patch ID 1990560 to get readings from non-linear analog sensors
* Add support for SOL payload status command
* SOL set parameter range checking added
- * Fixed SOL activate options usage
+ * Fixed SOL activate options usage
* Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
* Added retries to SOL keepalive
* Fixed wrong mask values for Front Panel disable/enable status
@@ -599,14 +898,14 @@ version 1.8.11 released 2009-02-25
* Fix occasional SDR dump segfault; #1793076
* Allow ipmitool sel delete to accept hex list entry numbers
* Fix SEL total space reporting.
- * Fix for garbage sensor threshold values reported when none
+ * Fix for garbage sensor threshold values reported when none
returned. Tracker Bug #863748
* ipmievd change to Monitor %used in SEL buffer and log warnings when
the buffer is 80% and 100% full
version 1.8.10 released 2008-08-08
* Added support for BULL IANA number.
- * Fixed contrib build so the oem_ibm_sel_map file gets included in
+ * Fixed contrib build so the oem_ibm_sel_map file gets included in
rpm builds again.
* Added support for Debian packages to be built from CVS
* Fix for sdr and sel timestamp reporting issues
@@ -615,11 +914,11 @@ version 1.8.10 released 2008-08-08
* Change ipmi_chassis_status() to non-static so it can be used
externally
* Added retries to SOL keepalive
- * Fix to stop sensor list command from reporting a failure due
+ * Fix to stop sensor list command from reporting a failure due
to missing sensor
* Fix bug in sdr free space reporting
* Add support for IANA number to vendor name conversion for many
- vendors
+ vendors
* Fix segfault bug in lan set command
* Fix bug in population of raw i2c wdata buffer
* Fix bug in ipmb sensor reading
@@ -633,7 +932,7 @@ version 1.8.10 released 2008-08-08
* Add more JEDEC support info for DIMMs; decrease request size
for DIMM FRU info to 16 bytes at a time to allow more
DIMM FRUs to respond.
- * Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg
+ * Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg
buffer length more aggressively when no response from iol
* Fix HPM firmware activation via IOL; fake a timeout after IOL
session re-open to force get upgrade status retry;
@@ -642,11 +941,11 @@ version 1.8.10 released 2008-08-08
* Fix for oemval2str size
* Add support for product name resolution in mc info
* Fix FRU display format
- * Added PICMG ekeying analyzer module support (ekanalyzer);
- display point to point physical connectivity and power
- supply information between carriers and AMC modules;
- display matched results of ekeying match between an
- on-carrier device and AMC module or between 2 AMC modules
+ * Added PICMG ekeying analyzer module support (ekanalyzer);
+ display point to point physical connectivity and power
+ supply information between carriers and AMC modules;
+ display matched results of ekeying match between an
+ on-carrier device and AMC module or between 2 AMC modules
* Fix AMC GUID display support
* Improved amcportstate operations
* Added resolution for new sensor types
@@ -659,8 +958,8 @@ version 1.8.10 released 2008-08-08
* Added SPD support for parms: channel number, max read size
* Add SDR support for adding SDR records from a dumped file,
clearing SDR, adding partial SDR records
- * Add updates and fixes to hpmfwupg: upload block size to 32 bytes
- for KCS, handle long response option, implement rollback
+ * Add updates and fixes to hpmfwupg: upload block size to 32 bytes
+ for KCS, handle long response option, implement rollback
override, garbage output fix
* Add double bridge lan support , fix bridging issue
* Add HPM support to pre-check which components need to be skipped
@@ -694,7 +993,7 @@ version 1.8.9 released 2007-03-06
* Added edit support for AMC activation "Maximum Internal Current"
* Fix bug generating garbage on the screen when handling GetDeviceId
and sol traffic occurs
- * Added ability to map OEM sensor types to OEM description string using
+ * Added ability to map OEM sensor types to OEM description string using
IANA number; moved IANA number table
* Fix lan set access command to use value already saved within
parameters for PEF and authentication
@@ -712,13 +1011,13 @@ version 1.8.9 released 2007-03-06
* Fix SOL set errors when commit-write not supported
* Fix reset of session timeout for lanplus interface
* Fixed lan interface accessibility timeout handling
- * Fix bug with Function Get Channel Cipher Suites command when
+ * Fix bug with Function Get Channel Cipher Suites command when
more than 1 page used.
* Fix missing firmware firewall top-level command
* Fix bug in SOL keepalive functionality
* Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
* Added ipmi_sel_get_oem_sensor* APIs
- * Added HPM.1 support
+ * Added HPM.1 support
* Fix segfault when incorrect oem option supplied
* Fix bus problem with spd command
* Fix segfault in SOL when remote BMC does not return packet
@@ -732,7 +1031,7 @@ version 1.8.9 released 2007-03-06
* Add freeipmi interface support
* Add remote spd printing
* Add better detection of linux/compiler.h to config
- * Makefile changes to fix makedistcheck, etc.
+ * Makefile changes to fix makedistcheck, etc.
version 1.8.8
* Fix segfaults in sensor data repository list
diff --git a/INSTALL b/INSTALL
index 2099840..b54ea39 100644
--- a/INSTALL
+++ b/INSTALL
@@ -9,17 +9,75 @@ are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
+Prerequisites
+=============
+
+ This project requires at least gcc 4.8.1 as it uses some GNU
+extensions and some C11 features. For `lanplus` interface the OpenSSL
+library and development headers are required. As of July 2020, the
+project is tested automatically to build cleanly for the following
+64-bit operating systems using GitHub Actions workflow:
+
+ - Ubuntu 16.04 Xenial Xerus
+ - Ubuntu 18.04 Bionic Beaver
+ - Ubuntu 20.04 Focal Fossa
+ - MacOS X 10.15 Catalina
+ - Microsoft Windows Server 2019
+
+ It is also known to build successfully on Ubuntu 14.04 and Fedora 31,
+but that is not automatically verified.
+
+ For Ubuntu 14.04+ it is recommended to do the following before building:
+
+ $ sudo apt install automake gcc git libreadline-dev libssl-dev \
+ libtool make wget
+
+ For Ubuntu 20.04+ you will also need this:
+
+ $ sudo apt install musl-dev
+
+ For Fedora 31 it is recommended to do the following before building:
+
+ $ sudo dnf install automake gcc git libtool make openssl-devel \
+ readline-devel wget
+
+ For MacOS X 10.15 with Xcode and homebrew installed, it is
+recommended to do the following before building:
+
+ $ brew install automake openssl libtool freeipmi wget
+ $ export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
+ $ export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
+
+ To prepare for building in Windows it is recommended to use Chocolatey
+and do the following using PowerShell:
+
+ PS C:\ipmitool> choco install cygwin -y
+ PS C:\ipmitool> choco install cyg-get -y
+ PS C:\ipmitool> cyg-get gcc-g++ make automake autoconf `
+ # m4 libtool libncurses-devel libreadline-devel libssl-devel `
+ # dos2unix wget
+ PS C:\ipmitool> $env:path="C:\tools\cygwin\usr\bin;$env:path"
+ PS C:\ipmitool> $env:path="C:\tools\cygwin\bin;$env:path"
+ PS C:\ipmitool> dos2unix bootstrap configure.ac csv-revision
+
Basic Installation
==================
- Briefly, the shell command `./configure && make && make install'
-should configure, build, and install this package. The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package. Some packages provide this
-`INSTALL' file but do not implement all of the features documented
-below. The lack of an optional feature in a given package is not
-necessarily a bug. More recommendations for GNU packages can be found
-in *note Makefile Conventions: (standards)Makefile Conventions.
+ Briefly, the followong shell command should configure, build, and
+install this package:
+
+ ./bootstrap && ./configure && make && sudo make install
+
+ For Windows the above command must be run inside a cygwin bash
+shell.
+
+ The following more-detailed instructions are generic; see the
+`README' file for instructions specific to this package. Some
+packages provide this `INSTALL' file but do not implement all of the
+features documented below. The lack of an optional feature in a given
+package is not necessarily a bug. More recommendations for GNU
+packages can be found in *note Makefile Conventions:
+(standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
diff --git a/Makefile.am b/Makefile.am
index c809131..ce3267f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,15 +41,49 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure configure-stamp \
$(distdir).tar.gz $(distdir).tar.bz2
SUBDIRS = lib src include doc contrib control
+IANA_PEN = http://www.iana.org/assignments/enterprise-numbers
dist-hook:
cp control/ipmitool.spec $(distdir)
-install-data-local:
+.PHONY: install-pen-database uninstall-pen-database
+.INTERMEDIATE: %.o %.la enterprise-numbers
+
+if DOWNLOAD
+
+enterprise-numbers:
+ @echo Downloading IANA PEN database...
+ @$(DOWNLOAD) "$(IANA_PEN)" > tmpfile.$$PPID || {\
+ echo "FAILED to download the IANA PEN database"; \
+ rm tmpfile.$$PPID; \
+ false; \
+ }
+ @mv tmpfile.$$PPID $@
+
+install-pen-database: enterprise-numbers
+ mkdir -m 755 -p $(DESTDIR)$(IANADIR)
+ $(INSTALL_DATA) $< $(DESTDIR)$(IANADIR)/
+
+uninstall-pen-database:
+ -rm -rf $(DESTDIR)$(IANADIR)/enterprise-numbers
+
+else
+
+install-pen-database:
+ @echo "*** NOT installing the IANA PEN database."
+ @echo "*** Don't know how to download it."
+
+uninstall-pen-database:
+ @echo "*** NOT uninstalling the IANA PEN database."
+ @echo "*** It was installed manually (if ever)."
+
+endif
+
+install-data-local: install-pen-database
mkdir -p $(DESTDIR)$(DOCDIR)
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
-uninstall-local:
+uninstall-local: uninstall-pen-database
-rm -rf $(DESTDIR)$(DOCDIR)
.PHONY: pkg
@@ -67,12 +101,8 @@ SRCDIR = ${shell cd $(top_srcdir) ; pwd | sed -e 's,^[^:\\/]:[\\/],/,'}
RPMDIR = $(BUILDDIR)/rpmbuild
.PHONY: rpm
-rpm: control/ipmitool.spec dist
- mkdir -p $(RPMDIR)/{BUILD,RPMS,SRPMS,SOURCES,SPECS,tmp}
- cp control/ipmitool.spec $(RPMDIR)/SPECS
- BUILDDIR=$(RPMDIR) CONFIGDIR=$(BUILDDIR)/control \
- @RPMBUILD@ -ba --rcfile $(SRCDIR)/control/rpmrc \
- $(RPMDIR)/SPECS/ipmitool.spec
+rpm: dist
+ @RPMBUILD@ -ta --define "_topdir $(RPMDIR)" $(distdir).tar.gz
.PHONY: clean-rpm
clean-rpm:
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index 8074d84..0000000
--- a/Makefile.in
+++ /dev/null
@@ -1,906 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \
- README compile config.guess config.sub depcomp install-sh \
- missing ltmain.sh
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.h.in
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__post_remove_distdir = $(am__remove_distdir)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
-GZIP_ENV = --best
-DIST_TARGETS = dist-bzip2 dist-gzip
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-DOCDIR = $(datadir)/doc/$(PACKAGE)
-DOCLIST = $(top_srcdir)/README $(top_srcdir)/COPYING $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog
-EXTRA_DIST = $(DOCLIST) bootstrap
-AUTOMAKE_OPTIONS = dist-bzip2
-MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure configure-stamp \
- config.guess config.sub depcomp install-sh ltmain.sh missing \
- mkinstalldirs config.h.in stamp-h.in \
- $(distdir).tar.gz $(distdir).tar.bz2
-
-SUBDIRS = lib src include doc contrib control
-BUILDDIR = ${shell cd $(top_builddir) ; pwd | sed -e 's,^[^:\\/]:[\\/],/,'}
-SRCDIR = ${shell cd $(top_srcdir) ; pwd | sed -e 's,^[^:\\/]:[\\/],/,'}
-RPMDIR = $(BUILDDIR)/rpmbuild
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-config.h: stamp-h1
- @test -f $@ || rm -f stamp-h1
- @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool config.lt
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscope: cscope.files
- test ! -s cscope.files \
- || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-clean-cscope:
- -rm -f cscope.files
-cscope.files: clean-cscope cscopelist
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
- -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" distdir="$(distdir)" \
- dist-hook
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__post_remove_distdir)
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__post_remove_distdir)
-
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__post_remove_distdir)
-
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__post_remove_distdir)
-
-dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
- @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__post_remove_distdir)
-
-dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
- @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__post_remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__post_remove_distdir)
-
-dist dist-all:
- $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
- $(am__post_remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir)
- chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
- chmod a-w $(distdir)
- test -d $(distdir)/_build || exit 0; \
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
- $(am__post_remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile config.h
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-hdr \
- distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-data-local
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-local
-
-.MAKE: $(am__recursive_targets) all install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
- am--refresh check check-am clean clean-cscope clean-generic \
- clean-libtool cscope cscopelist-am ctags ctags-am dist \
- dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
- dist-tarZ dist-xz dist-zip distcheck distclean \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-data-local install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-am uninstall uninstall-am uninstall-local
-
-
-dist-hook:
- cp control/ipmitool.spec $(distdir)
-
-install-data-local:
- mkdir -p $(DESTDIR)$(DOCDIR)
- $(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
-
-uninstall-local:
- -rm -rf $(DESTDIR)$(DOCDIR)
-
-.PHONY: pkg
-pkg: PKG := ipmitool-@VERSION@-@OS@-@ARCH@
-pkg: control/pkginfo
- $(STRIP) src/ipmitool
- $(STRIP) src/ipmitool
- (cd control ; pkgmk -o -d /tmp)
- pkgtrans -s /tmp $(PKG) ipmitool
- gzip -c /tmp/$(PKG) > $(PKG).gz
- -rm -rf /tmp/ipmitool /tmp/$(PKG)
-
-.PHONY: rpm
-rpm: control/ipmitool.spec dist
- mkdir -p $(RPMDIR)/{BUILD,RPMS,SRPMS,SOURCES,SPECS,tmp}
- cp control/ipmitool.spec $(RPMDIR)/SPECS
- BUILDDIR=$(RPMDIR) CONFIGDIR=$(BUILDDIR)/control \
- @RPMBUILD@ -ba --rcfile $(SRCDIR)/control/rpmrc \
- $(RPMDIR)/SPECS/ipmitool.spec
-
-.PHONY: clean-rpm
-clean-rpm:
- -rm -rf $(RPMDIR)
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/README b/README
index 7494f80..bfdef96 100644
--- a/README
+++ b/README
@@ -42,8 +42,8 @@ Requirements
============
Obviously the largest requirement is hardware with a service processor
that supports the IPMI specification. Many x86-based servers are now
-comming with IPMI support, check with your preferred hardware vendor
-about available prodcuts.
+coming with IPMI support, check with your preferred hardware vendor
+about available products.
Once you are certain you have the required hardware, you then need to
decide how you want to access the BMC. The most common case involve
@@ -126,7 +126,7 @@ hardware will come with a utility (often a DOS bootable CD) for configuring
enabling the LAN interface as well.
In order to support the IPMIv2.0 interface you must have an OpenSSL library
-with the required encrytion functions. Recent distributions should have
+with the required encryption functions. Recent distributions should have
no problems. The IPMIv1.5 interface will attempt to use OpenSSL for MD5
hash function at compile time but if that is not found it will use an
internal library.
@@ -396,16 +396,13 @@ ipmievd: Memory Sensor 01 - Correctable ECC
Resources
=========
IPMItool homepage
-http://ipmitool.sourceforge.net
+http://github.com/ipmitool/ipmitool
IPMItool manpage
-http://ipmitool.sourceforge.net/manpage.html
-
-IPMItool overview paper from Linux.conf.au 2004
-http://ipmitool.sourceforge.net/lca2004_ipmitool.pdf
+https://github.com/ipmitool/ipmitool/blob/master/doc/ipmitool.1.in
Intelligent Platform Management Interface specification
-http://www.intel.com/design/servers/ipmi/spec.htm
+https://www.intel.com/content/www/us/en/servers/ipmi/ipmi-home.html
OpenIPMI project: Linux IPMI kernel driver and userland library
http://openipmi.sourceforge.net
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index b58e5e4..0000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,9780 +0,0 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- _LT_PATH_MAGIC
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
- [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME. Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
- [m4_ifval([$1], [$1], [$2])])
- lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
- m4_ifval([$4],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
- lt_dict_add_subkey([lt_decl_dict], [$2],
- [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
- [0], [m4_fatal([$0: too few arguments: $#])],
- [1], [m4_fatal([$0: too few arguments: $#: $1])],
- [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
- [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
- [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
- m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_if([$2], [],
- m4_quote(lt_decl_varnames),
- m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
- lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'. VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly. In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
- [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-# # Some comment about what VAR is for.
-# visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
- [description])))[]dnl
-m4_pushdef([_libtool_name],
- m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
- [0], [_libtool_name=[$]$1],
- [1], [_libtool_name=$lt_[]$1],
- [2], [_libtool_name=$lt_[]$1],
- [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
- m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'. Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
- dnl If the libtool generation code has been placed in $CONFIG_LT,
- dnl instead of duplicating it all over again into config.status,
- dnl then we will have config.status run $CONFIG_LT later, so it
- dnl needs to know what name is stored there:
- [AC_CONFIG_COMMANDS([libtool],
- [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
- dnl If the libtool generation code is destined for config.status,
- dnl expand the accumulated commands and init code now:
- [AC_CONFIG_COMMANDS([libtool],
- [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable. If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins. After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script. The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
- echo
- AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
-
-Report bugs to <bug-libtool@gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
- case $[1] in
- --version | --v* | -V )
- echo "$lt_cl_version"; exit 0 ;;
- --help | --h* | -h )
- echo "$lt_cl_help"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --quiet | --q* | --silent | --s* | -q )
- lt_cl_silent=: ;;
-
- -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
- *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
- esac
- shift
-done
-
-if $lt_cl_silent; then
- exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure. Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test "$silent" = yes &&
- lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars. Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
- m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
- m4_if(_LT_TAG, [C], [
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
- _LT_PROG_LTMAIN
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- _LT_PROG_REPLACE_SHELLFNS
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
- RM='$RM'
- ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-# autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
- [C], [_LT_LANG(C)],
- [C++], [_LT_LANG(CXX)],
- [Go], [_LT_LANG(GO)],
- [Java], [_LT_LANG(GCJ)],
- [Fortran 77], [_LT_LANG(F77)],
- [Fortran], [_LT_LANG(FC)],
- [Windows Resource], [_LT_LANG(RC)],
- [m4_ifdef([_LT_LANG_]$1[_CONFIG],
- [_LT_LANG($1)],
- [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
- [LT_SUPPORTED_TAG([$1])dnl
- m4_append([_LT_TAGS], [$1 ])dnl
- m4_define([_LT_LANG_]$1[_enabled], [])dnl
- _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_GO. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC], [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
- if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
- fi
-fi
-if test -z "$GOC"; then
- AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [LT_LANG(CXX)],
- [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
- [LT_LANG(F77)],
- [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
- [LT_LANG(FC)],
- [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
- [LT_LANG(GCJ)],
- [m4_ifdef([AC_PROG_GCJ],
- [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([A][M_PROG_GCJ],
- [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([LT_PROG_GCJ],
- [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
- [LT_LANG(GO)],
- [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
- [LT_LANG(RC)],
- [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
- case $host_os in
- rhapsody* | darwin*)
- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
- AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
- AC_CHECK_TOOL([LIPO], [lipo], [:])
- AC_CHECK_TOOL([OTOOL], [otool], [:])
- AC_CHECK_TOOL([OTOOL64], [otool64], [:])
- _LT_DECL([], [DSYMUTIL], [1],
- [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
- _LT_DECL([], [NMEDIT], [1],
- [Tool to change global to local symbols on Mac OS X])
- _LT_DECL([], [LIPO], [1],
- [Tool to manipulate fat objects and archives on Mac OS X])
- _LT_DECL([], [OTOOL], [1],
- [ldd/readelf like tool for Mach-O binaries on Mac OS X])
- _LT_DECL([], [OTOOL64], [1],
- [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
- [lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi])
-
- AC_CACHE_CHECK([for -exported_symbols_list linker flag],
- [lt_cv_ld_exported_symbols_list],
- [lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [lt_cv_ld_exported_symbols_list=yes],
- [lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
- ])
-
- AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
- [lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
- echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
- $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
- ])
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
- m4_require([_LT_REQUIRED_DARWIN_CHECKS])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_automatic, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
- m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
- [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=''
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- m4_if([$1], [CXX],
-[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- fi
-],[])
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
- lt_aix_libpath_sed='[
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }]'
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi],[])
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
- fi
- ])
- aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-case "$ECHO" in
- printf*) AC_MSG_RESULT([printf]) ;;
- print*) AC_MSG_RESULT([print -r]) ;;
- *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
- test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test "X`printf %s $ECHO`" = "X$ECHO" \
- || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[ --with-sysroot[=DIR] Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted. We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
- if test "$GCC" = yes; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- AC_MSG_RESULT([${with_sysroot}])
- AC_MSG_ERROR([The sysroot must be an absolute path.])
- ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
- *x86-64*)
- LD="${LD-ld} -m elf32_x86_64"
- ;;
- *)
- LD="${LD-ld} -m elf_i386"
- ;;
- esac
- ;;
- powerpc64le-*)
- LD="${LD-ld} -m elf32lppclinux"
- ;;
- powerpc64-*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- powerpcle-*)
- LD="${LD-ld} -m elf64lppc"
- ;;
- powerpc-*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
- [lt_cv_ar_at_file=no
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
- [echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
- AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -eq 0; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -ne 0; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
- ])
- ])
-
-if test "x$lt_cv_ar_at_file" = xno; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
- [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
- [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
- [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
- [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$5], , :, [$5])
-else
- m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$4], , :, [$4])
-else
- m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
- [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}]
-_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
- [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
- [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
- [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
- [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
- [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
- test -n "$_LT_TAGVAR(runpath_var, $1)" ||
- test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
- test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
- [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
- [], [
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[[4-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec="$LIB"
- if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[23]].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[[3-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
- [lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
- LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
- [lt_cv_shlibpath_overrides_runpath=yes])])
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
- ])
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
- [Variables whose values should be saved in libtool wrapper scripts and
- restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
- [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
- [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
- [[List of archive names. First name is the real one, the rest are links.
- The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
- [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
- [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
- [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
- [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
- [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
- [[As "finish_cmds", except a single script fragment to be evaled but
- not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
- [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
- [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
- [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="m4_if([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
- [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
- [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
- [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
- [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
- AC_SUBST([DUMPBIN])
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
- [lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
- cat conftest.out >&AS_MESSAGE_LOG_FD
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
- ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
- [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
- [lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&AS_MESSAGE_LOG_FD
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
- MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- case $cc_basename in
- nvcc*)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
- esac
-
- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
- [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK ['"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx]"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT@&t@_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT@&t@_DLSYM_CONST
-#else
-# define LT@&t@_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT@&t@_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
- [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
- [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
- [lt_cv_sys_global_symbol_to_c_name_address], [1],
- [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
- [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
- [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([], [nm_file_list_spec], [1],
- [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[[4-9]]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
- # IBM XL 8.0, 9.0 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Intel*\ [[CF]]*Compiler*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- *Portland\ Group*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-AC_CACHE_CHECK([for $compiler option to produce PIC],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
- [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
- [Additional compiler flags for building library objects])
-
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
- [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- case $host_os in
- aix[[4-9]]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw* | cegcc*)
- case $cc_basename in
- cl*)
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-], [
- runpath_var=
- _LT_TAGVAR(allow_undefined_flag, $1)=
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(archive_cmds, $1)=
- _LT_TAGVAR(archive_expsym_cmds, $1)=
- _LT_TAGVAR(compiler_needs_object, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(hardcode_automatic, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_TAGVAR(hardcode_minus_L, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(inherit_rpath, $1)=no
- _LT_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_TAGVAR(module_cmds, $1)=
- _LT_TAGVAR(module_expsym_cmds, $1)=
- _LT_TAGVAR(old_archive_from_new_cmds, $1)=
- _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- esac
-
- _LT_TAGVAR(ld_shlibs, $1)=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
- *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test "$lt_use_gnu_ld_interface" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[[3-9]]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- tmp_sharedflag='--shared' ;;
- xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- bsdi[[45]]*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- m4_if($1, [], [
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- _LT_LINKER_OPTION([if $CC understands -b],
- _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
- [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
- [lt_cv_irix_exported_symbol],
- [save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- AC_LINK_IFELSE(
- [AC_LANG_SOURCE(
- [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
- [C++], [[int foo (void) { return 0; }]],
- [Fortran 77], [[
- subroutine foo
- end]],
- [Fortran], [[
- subroutine foo
- end]])])],
- [lt_cv_irix_exported_symbol=yes],
- [lt_cv_irix_exported_symbol=no])
- LDFLAGS="$save_LDFLAGS"])
- if test "$lt_cv_irix_exported_symbol" = yes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- fi
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
- ;;
- esac
- fi
- fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
- [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_CACHE_CHECK([whether -lc should be explicitly linked in],
- [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
- [$RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
- _LT_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
- then
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- ])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
- ;;
- esac
- fi
- ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
- [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
- [enable_shared_with_static_runtimes], [0],
- [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
- [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
- [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
- [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
- [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
- [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
- [Commands used to build a loadable module if different from building
- a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
- [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
- [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
- [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
- [Flag to hardcode $libdir into a binary during linking.
- This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
- [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting ${shlibpath_var} if the
- library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
- [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
- [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
- [Set to "yes" if building a shared library automatically hardcodes DIR
- into the library and all subsequent libraries and executables linked
- against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
- [Set to yes if linker adds runtime paths of dependent libraries
- to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
- [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
- [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
- [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
- [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
- [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
- [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
- [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
- [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
- LT_SYS_DLOPEN_SELF
- _LT_CMD_STRIPLIB
-
- # Report which library types will actually be built
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-else
- _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_CFLAGS=$CFLAGS
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- CFLAGS=$CXXFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
- else
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
- fi
-
- if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- LT_PATH_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
- _LT_TAGVAR(ld_shlibs, $1)=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- func_to_tool_file "$lt_outputfile"~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # g++
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- freebsd2.*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- freebsd-elf*)
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
- fi
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
- _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
- _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- *) # Version 6 and above use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
- ;;
- xl* | mpixl* | bgxl*)
- # IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd=func_echo_all
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- case $host in
- osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- ;;
- *)
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- case $host in
- osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- fi
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
- '"$_LT_TAGVAR(old_archive_cmds, $1)"
- _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
- '"$_LT_TAGVAR(reload_cmds, $1)"
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
- _LT_TAGVAR(GCC, $1)="$GXX"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer a
- a=0
- return
- end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case ${prev}${p} in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
- prev=$p
- continue
- fi
-
- # Expand the sysroot to ease extracting the directories later.
- if test -z "$prev"; then
- case $p in
- -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
- -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
- -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
- esac
- fi
- case $p in
- =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
- esac
- if test "$pre_test_object_deps_done" = no; then
- case ${prev} in
- -L | -R)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- prev=
- ;;
-
- *.lto.$objext) ;; # Ignore GCC LTO objects
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
- _LT_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_TAGVAR(predep_objects,$1)=
- _LT_TAGVAR(postdep_objects,$1)=
- _LT_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
- [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
- [Dependencies to place before and after the objects being linked to
- create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
- [The library search path used internally by the compiler when linking
- a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
- _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${F77-"f77"}
- CFLAGS=$FFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
- GCC=$G77
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$G77"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
- CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test "X$FC" = "Xno"; then
- _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${FC-"f95"}
- CFLAGS=$FCFLAGS
- compiler=$CC
- GCC=$ac_cv_fc_compiler_gnu
-
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
- :
- _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
- [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
- [AC_CHECK_TOOL(GCJ, gcj,)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
- [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
- func_split_long_opt_name=${1%%=*}
- func_split_long_opt_arg=${1#*=}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
- func_split_short_opt_arg=${1#??}
- func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
-
- _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
-
- _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
- func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
- eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine which file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
- [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
- [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
-
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
- _LT_DECL([build_old_libs], [enable_static], [0],
- [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
- [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
- [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
- [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
- [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
- [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
- [m4_define([_LTDL_TYPE], [convenience])])
-
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
-
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
-
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
-
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.14.1], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
-# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is '.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ([2.52])dnl
- m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-
-# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
- [$1], [CXX], [depcc="$CXX" am_compiler_list=],
- [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
- [$1], [UPC], [depcc="$UPC" am_compiler_list=],
- [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE([dependency-tracking], [dnl
-AS_HELP_STRING(
- [--enable-dependency-tracking],
- [do not reject slow dependency extractors])
-AS_HELP_STRING(
- [--disable-dependency-tracking],
- [speeds up one-time build])])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Older Autoconf quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
-m4_define([AC_PROG_CC],
-m4_defn([AC_PROG_CC])
-[_AM_PROG_CC_C_O
-])
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.65])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[AC_DIAGNOSE([obsolete],
- [$0: two- and three-arguments forms are deprecated.])
-m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
- [ok:ok],,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
- AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
-AM_MISSING_PROG([AUTOCONF], [autoconf])
-AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
-AM_MISSING_PROG([AUTOHEADER], [autoheader])
-AM_MISSING_PROG([MAKEINFO], [makeinfo])
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES([CC])],
- [m4_define([AC_PROG_CC],
- m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES([CXX])],
- [m4_define([AC_PROG_CXX],
- m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES([OBJC])],
- [m4_define([AC_PROG_OBJC],
- m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
- [_AM_DEPENDENCIES([OBJCXX])],
- [m4_define([AC_PROG_OBJCXX],
- m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
-])
-AC_REQUIRE([AM_SILENT_RULES])dnl
-dnl The testsuite driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
-dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes. So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
- cat >&2 <<'END'
-Oops!
-
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present. This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-
-Please tell bug-automake@gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message. This
-can help us improve future automake versions.
-
-END
- if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
- echo 'Configuration will proceed anyway, since you have set the' >&2
- echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
- echo >&2
- else
- cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
- AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
- fi
-fi
-])
-
-dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST([install_sh])])
-
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it is modern enough.
-# If it is, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
- am_missing_run="$MISSING "
-else
- am_missing_run=
- AC_MSG_WARN(['missing' script is too old or missing])
-fi
-])
-
-# -*- Autoconf -*-
-# Obsolete and "removed" macros, that must however still report explicit
-# error messages when used, to smooth transition.
-#
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
-AC_CONFIG_HEADERS($@)])
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should simply use the 'AC][_PROG_CC' macro instead.
-Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
-but upon 'ac_cv_prog_cc_stdc'.])])
-
-AC_DEFUN([AM_C_PROTOTYPES],
- [AC_FATAL([automatic de-ANSI-fication support has been removed])])
-AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# _AM_PROG_CC_C_O
-# ---------------
-# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
-# to automatically call this.
-AC_DEFUN([_AM_PROG_CC_C_O],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-AC_LANG_PUSH([C])dnl
-AC_CACHE_CHECK(
- [whether $CC understands -c and -o together],
- [am_cv_prog_cc_c_o],
- [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
- # Make sure it works both with $CC and with simple cc.
- # Following AC_PROG_CC_C_O, we do the test twice because some
- # compilers refuse to overwrite an existing .o file with -o,
- # though they will create one.
- am_cv_prog_cc_c_o=yes
- for am_i in 1 2; do
- if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
- && test -f conftest2.$ac_objext; then
- : OK
- else
- am_cv_prog_cc_c_o=no
- break
- fi
- done
- rm -f core conftest*
- unset am_i])
-if test "$am_cv_prog_cc_c_o" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-AC_LANG_POP([C])])
-
-# For backward compatibility.
-AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_RUN_LOG(COMMAND)
-# -------------------
-# Run COMMAND, save the exit status in ac_status, and log it.
-# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
-AC_DEFUN([AM_RUN_LOG],
-[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
- ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- (exit $ac_status); }])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
- alias in your environment])
- fi
- if test "$[2]" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT([yes])
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-AC_CONFIG_COMMANDS_PRE(
- [AC_MSG_CHECKING([that generated files are newer than configure])
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- AC_MSG_RESULT([done])])
-rm -f conftest.file
-])
-
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_SILENT_RULES([DEFAULT])
-# --------------------------
-# Enable less verbose build rules; with the default set to DEFAULT
-# ("yes" being less verbose, "no" or empty being verbose).
-AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules], [dnl
-AS_HELP_STRING(
- [--enable-silent-rules],
- [less verbose build output (undo: "make V=1")])
-AS_HELP_STRING(
- [--disable-silent-rules],
- [verbose build output (undo: "make V=0")])dnl
-])
-case $enable_silent_rules in @%:@ (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
-esac
-dnl
-dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
-dnl do not support nested variable expansions.
-dnl See automake bug#9928 and bug#10237.
-am_make=${MAKE-make}
-AC_CACHE_CHECK([whether $am_make supports nested variables],
- [am_cv_make_support_nested_variables],
- [if AS_ECHO([['TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi])
-if test $am_cv_make_support_nested_variables = yes; then
- dnl Using '$V' instead of '$(V)' breaks IRIX make.
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AC_SUBST([AM_V])dnl
-AM_SUBST_NOTMAKE([AM_V])dnl
-AC_SUBST([AM_DEFAULT_V])dnl
-AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
-AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
-AM_BACKSLASH='\'
-AC_SUBST([AM_BACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
-])
-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor 'install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in "make install-strip", and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of 'v7', 'ustar', or 'pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-#
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-
- [m4_case([$1],
- [ustar],
- [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
- # There is notably a 21 bits limit for the UID and the GID. In fact,
- # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
- # and bug#13588).
- am_max_uid=2097151 # 2^21 - 1
- am_max_gid=$am_max_uid
- # The $UID and $GID variables are not portable, so we need to resort
- # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
- # below are definitely unexpected, so allow the users to see them
- # (that is, avoid stderr redirection).
- am_uid=`id -u || echo unknown`
- am_gid=`id -g || echo unknown`
- AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
- if test $am_uid -le $am_max_uid; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- _am_tools=none
- fi
- AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
- if test $am_gid -le $am_max_gid; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- _am_tools=none
- fi],
-
- [pax],
- [],
-
- [m4_fatal([Unknown tar format])])
-
- AC_MSG_CHECKING([how to create a $1 tar archive])
-
- # Go ahead even if we have the value already cached. We do so because we
- # need to set the values for the 'am__tar' and 'am__untar' variables.
- _am_tools=${am_cv_prog_tar_$1-$_am_tools}
-
- for _am_tool in $_am_tools; do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar; do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works.
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- AM_RUN_LOG([cat conftest.dir/file])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
- done
- rm -rf conftest.dir
-
- AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
- AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
diff --git a/bootstrap b/bootstrap
index 6347427..c38b12b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -31,7 +31,15 @@
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
aclocal
-libtoolize --automake --copy
+
+case `uname` in
+ Darwin*)
+ glibtoolize --automake --copy
+ ;;
+ *)
+ libtoolize --automake --copy
+ ;;
+esac
autoheader
automake --foreign --add-missing --copy
diff --git a/compile b/compile
deleted file mode 100755
index 531136b..0000000
--- a/compile
+++ /dev/null
@@ -1,347 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2012-10-14.11; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" "" $nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
- file=$1
- case $file in
- / | /[!/]*) # absolute file, and not a UNC file
- if test -z "$file_conv"; then
- # lazily determine how to convert abs files
- case `uname -s` in
- MINGW*)
- file_conv=mingw
- ;;
- CYGWIN*)
- file_conv=cygwin
- ;;
- *)
- file_conv=wine
- ;;
- esac
- fi
- case $file_conv/,$2, in
- *,$file_conv,*)
- ;;
- mingw/*)
- file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
- ;;
- cygwin/*)
- file=`cygpath -m "$file" || echo "$file"`
- ;;
- wine/*)
- file=`winepath -w "$file" || echo "$file"`
- ;;
- esac
- ;;
- esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
- func_file_conv "$1"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
- lib=$1
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- lib=$dir/$lib.dll.lib
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- lib=$dir/$lib.lib
- break
- fi
- if test -f "$dir/lib$lib.a"; then
- found=yes
- lib=$dir/lib$lib.a
- break
- fi
- done
- IFS=$save_IFS
-
- if test "$found" != yes; then
- lib=$lib.lib
- fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
- # Assume a capable shell
- lib_path=
- shared=:
- linker_opts=
- for arg
- do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- eat=1
- case $2 in
- *.o | *.[oO][bB][jJ])
- func_file_conv "$2"
- set x "$@" -Fo"$file"
- shift
- ;;
- *)
- func_file_conv "$2"
- set x "$@" -Fe"$file"
- shift
- ;;
- esac
- ;;
- -I)
- eat=1
- func_file_conv "$2" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -I*)
- func_file_conv "${1#-I}" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -l)
- eat=1
- func_cl_dashl "$2"
- set x "$@" "$lib"
- shift
- ;;
- -l*)
- func_cl_dashl "${1#-l}"
- set x "$@" "$lib"
- shift
- ;;
- -L)
- eat=1
- func_cl_dashL "$2"
- ;;
- -L*)
- func_cl_dashL "${1#-L}"
- ;;
- -static)
- shared=false
- ;;
- -Wl,*)
- arg=${1#-Wl,}
- save_ifs="$IFS"; IFS=','
- for flag in $arg; do
- IFS="$save_ifs"
- linker_opts="$linker_opts $flag"
- done
- IFS="$save_ifs"
- ;;
- -Xlinker)
- eat=1
- linker_opts="$linker_opts $2"
- ;;
- -*)
- set x "$@" "$1"
- shift
- ;;
- *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
- func_file_conv "$1"
- set x "$@" -Tp"$file"
- shift
- ;;
- *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
- func_file_conv "$1" mingw
- set x "$@" "$file"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
- done
- if test -n "$linker_opts"; then
- linker_opts="-link$linker_opts"
- fi
- exec "$@" $linker_opts
- exit 1
-}
-
-eat=
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand '-c -o'.
-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file 'INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit $?
- ;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
- func_cl_wrapper "$@" # Doesn't return...
- ;;
-esac
-
-ofile=
-cfile=
-
-for arg
-do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- # So we strip '-o arg' only if arg is an object.
- eat=1
- case $2 in
- *.o | *.obj)
- ofile=$2
- ;;
- *)
- set x "$@" -o "$2"
- shift
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- set x "$@" "$1"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
- # If no '-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # '.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
-# that we are using for the .o file. Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
-while true; do
- if mkdir "$lockdir" >/dev/null 2>&1; then
- break
- fi
- sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
- test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
- test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/config.guess b/config.guess
deleted file mode 100755
index 1f5c50c..0000000
--- a/config.guess
+++ /dev/null
@@ -1,1420 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2014 Free Software Foundation, Inc.
-
-timestamp='2014-03-23'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2014 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
- ;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[4567])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- *:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- aarch64_be:Linux:*:*)
- UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- else
- if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_PCS_VFP
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
- else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
- fi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- ;;
- openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
- esac
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
- x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
- elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
- fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
- x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
-esac
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/config.h.in b/config.h.in
deleted file mode 100644
index dc91f49..0000000
--- a/config.h.in
+++ /dev/null
@@ -1,246 +0,0 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define to 1 to enable all command line options. */
-#undef ENABLE_ALL_OPTIONS
-
-/* Define to 1 for extra file security. */
-#undef ENABLE_FILE_SECURITY
-
-/* Define to 1 to enable OpenIPMI interface dual bridge support */
-#undef ENABLE_INTF_OPEN_DUAL_BRIDGE
-
-/* Define to 1 if you have the `alarm' function. */
-#undef HAVE_ALARM
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* Define to 1 if you have the <byteswap.h> header file. */
-#undef HAVE_BYTESWAP_H
-
-/* Define to 1 if libcrypto supports MD2. */
-#undef HAVE_CRYPTO_MD2
-
-/* Define to 1 if libcrypto supports MD5. */
-#undef HAVE_CRYPTO_MD5
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the <sys/ipmi.h> header file. */
-#undef HAVE_FREEBSD_IPMI_H
-
-/* Define to 1 if you have the `getaddrinfo' function. */
-#undef HAVE_GETADDRINFO
-
-/* Define to 1 if you have the `gethostbyname' function. */
-#undef HAVE_GETHOSTBYNAME
-
-/* Define to 1 if you have the `getifaddrs' function. */
-#undef HAVE_GETIFADDRS
-
-/* Define to 1 if you have the `getpassphrase' function. */
-#undef HAVE_GETPASSPHRASE
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <linux/compiler.h> header file. */
-#undef HAVE_LINUX_COMPILER_H
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <linux/ipmi.h> header file. */
-#undef HAVE_OPENIPMI_H
-
-/* Define to 1 if you have the <paths.h> header file. */
-#undef HAVE_PATHS_H
-
-/* Define to 1 if you need to use #pragma pack instead of __attribute__
- ((packed)) */
-#undef HAVE_PRAGMA_PACK
-
-/* Define to 1 if readline present. */
-#undef HAVE_READLINE
-
-/* Define to 1 if you have the `select' function. */
-#undef HAVE_SELECT
-
-/* Define to 1 if you have the `socket' function. */
-#undef HAVE_SOCKET
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
-
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/byteorder.h> header file. */
-#undef HAVE_SYS_BYTEORDER_H
-
-/* Define to 1 if you have the <sys/ioccom.h> header file. */
-#undef HAVE_SYS_IOCCOM_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have <sys/termios.h>. */
-#undef HAVE_SYS_TERMIOS_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have <termios.h>. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 to enable Solaris 10 BMC interface. */
-#undef IPMI_INTF_BMC
-
-/* Define to 1 to enable Dummy interface. */
-#undef IPMI_INTF_DUMMY
-
-/* Define to 1 to enable FreeIPMI interface. */
-#undef IPMI_INTF_FREE
-
-/* Define to 1 for FreeIPMI 0.3.0. */
-#undef IPMI_INTF_FREE_0_3_0
-
-/* Define to 1 for FreeIPMI 0.4.0. */
-#undef IPMI_INTF_FREE_0_4_0
-
-/* Define to 1 for FreeIPMI 0.5.0. */
-#undef IPMI_INTF_FREE_0_5_0
-
-/* Define to 1 for FreeIPMI 0.6.0. */
-#undef IPMI_INTF_FREE_0_6_0
-
-/* Define to 1 to enable FreeIPMI Bridging Support. */
-#undef IPMI_INTF_FREE_BRIDGING
-
-/* Define to 1 to enable Intel IMB interface. */
-#undef IPMI_INTF_IMB
-
-/* Define to 1 to enable LAN IPMIv1.5 interface. */
-#undef IPMI_INTF_LAN
-
-/* Define to 1 to enable LAN+ IPMIv2 interface. */
-#undef IPMI_INTF_LANPLUS
-
-/* Define to 1 to enable Solaris 9 LIPMI interface. */
-#undef IPMI_INTF_LIPMI
-
-/* Define to 1 to enable Linux OpenIPMI interface. */
-#undef IPMI_INTF_OPEN
-
-/* Define to 1 to enable serial interface. */
-#undef IPMI_INTF_SERIAL
-
-/* Define to 1 to enable USB interface. */
-#undef IPMI_INTF_USB
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#undef LT_OBJDIR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to the type of arg 1 for `select'. */
-#undef SELECT_TYPE_ARG1
-
-/* Define to the type of args 2, 3 and 4 for `select'. */
-#undef SELECT_TYPE_ARG234
-
-/* Define to the type of arg 5 for `select'. */
-#undef SELECT_TYPE_ARG5
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
-#endif
diff --git a/config.sub b/config.sub
deleted file mode 100755
index bba4efb..0000000
--- a/config.sub
+++ /dev/null
@@ -1,1799 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2014 Free Software Foundation, Inc.
-
-timestamp='2014-09-11'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2014 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
- ;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -nacl*)
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- c8051-*)
- os=-elf
- ;;
- hexagon-*)
- os=-elf
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -cnk*|-aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/configure b/configure
deleted file mode 100755
index 4c3e65d..0000000
--- a/configure
+++ /dev/null
@@ -1,16365 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ipmitool 1.8.17.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1
-
- test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
- || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='ipmitool'
-PACKAGE_TARNAME='ipmitool'
-PACKAGE_VERSION='1.8.17'
-PACKAGE_STRING='ipmitool 1.8.17'
-PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
-
-ac_unique_file="src/ipmitool.c"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-IPMITOOL_INTF_LIB
-INTF_DUMMY_LIB
-INTF_DUMMY
-INTF_BMC_LIB
-INTF_BMC
-INTF_LIPMI_LIB
-INTF_LIPMI
-INTF_IMB_LIB
-INTF_IMB
-INTF_OPEN_LIB
-INTF_OPEN
-RPM_RELEASE
-DISTRO
-INTF_FREE_LIB
-INTF_FREE
-INTF_SERIAL_LIB
-INTF_SERIAL
-INTF_LANPLUS_LIB
-INTF_LANPLUS
-INTF_USB_LIB
-INTF_USB
-INTF_LAN_LIB
-INTF_LAN
-BASEDIR
-PSTAMP
-OS
-ARCH
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-RANLIB
-ac_ct_AR
-AR
-DLLTOOL
-OBJDUMP
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-LIBTOOL
-LIBOBJS
-POW_LIB
-EGREP
-GREP
-CPP
-SED
-RPMBUILD
-LN_S
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-ac_configure_args
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_silent_rules
-enable_dependency_tracking
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_gnu_ld
-with_sysroot
-enable_libtool_lock
-enable_solaris_opt
-enable_internal_md5
-enable_intf_lan
-enable_intf_usb
-enable_intf_lanplus
-enable_intf_serial
-with_kerneldir
-enable_intf_free
-with_rpm_distro
-with_rpm_release
-enable_intf_open
-enable_intf_imb
-enable_intf_lipmi
-enable_intf_bmc
-enable_intf_dummy
-enable_ipmishell
-enable_buildcheck
-enable_file_security
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures ipmitool 1.8.17 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/ipmitool]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of ipmitool 1.8.17:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-silent-rules less verbose build output (undo: "make V=1")
- --disable-silent-rules verbose build output (undo: "make V=0")
- --enable-dependency-tracking
- do not reject slow dependency extractors
- --disable-dependency-tracking
- speeds up one-time build
- --enable-shared[=PKGS] build shared libraries [default=yes]
- --enable-static[=PKGS] build static libraries [default=yes]
- --enable-fast-install[=PKGS]
- optimize for fast installation [default=yes]
- --disable-libtool-lock avoid locking (might break parallel builds)
- --enable-solaris-opt enable all options for Solaris [default=no]
- --enable-internal-md5 enable internal MD5 library [default=no]
- --enable-intf-lan enable IPMIv1.5 LAN interface [default=yes]
- --enable-intf-usb enable IPMI USB interface [default=auto]
- --enable-intf-lanplus enable IPMIv2.0 RMCP+ LAN interface [default=auto]
- --enable-intf-serial enable direct Serial Basic/Terminal mode interface
- [default=yes]
- --enable-intf-free enable FreeIPMI IPMI interface [default=auto]
- --enable-intf-open enable Linux OpenIPMI interface [default=auto]
- --enable-intf-imb enable Intel IMB driver interface [default=auto]
- --enable-intf-lipmi enable Solaris 9 x86 IPMI interface [default=no]
- --enable-intf-bmc enable Solaris 10 x86 IPMI interface [default=auto]
- --enable-intf-dummy enable Dummy(test) interface [default=no]
- --enable-ipmishell enable IPMI shell interface [default=auto]
- --enable-buildcheck enable -Wall -Werror for build testing [default=no]
- --enable-file-security enable extra security checks on files opened for
- read [default=no]
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-sysroot=DIR Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).
- --with-kerneldir=DIR set kernel include path to DIR
- --with-rpm-distro=DISTRO
- set Linux distribution tag for use in RPM version
- string
- --with-rpm-release=RELEASE
- set release number for RPM release field
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-ipmitool configure 1.8.17
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* 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 $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by ipmitool $as_me 1.8.17, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-am__api_version='1.14'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
- alias in your environment" "$LINENO" 5
- fi
- if test "$2" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-
-rm -f conftest.file
-
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
- am_missing_run="$MISSING "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in # (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=1;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='ipmitool'
- VERSION='1.8.17'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-mkdir_p='$(MKDIR_P)'
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar pax cpio none'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes. So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
- cat >&2 <<'END'
-Oops!
-
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present. This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-
-Please tell bug-automake@gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message. This
-can help us improve future automake versions.
-
-END
- if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
- echo 'Configuration will proceed anyway, since you have set the' >&2
- echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
- echo >&2
- else
- cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
- as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
- fi
-fi
-
-ac_config_headers="$ac_config_headers config.h"
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- # Make sure it works both with $CC and with simple cc.
- # Following AC_PROG_CC_C_O, we do the test twice because some
- # compilers refuse to overwrite an existing .o file with -o,
- # though they will create one.
- am_cv_prog_cc_c_o=yes
- for am_i in 1 2; do
- if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
- ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } \
- && test -f conftest2.$ac_objext; then
- : OK
- else
- am_cv_prog_cc_c_o=no
- break
- fi
- done
- rm -f core conftest*
- unset am_i
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-# Extract the first word of "rpmbuild", so it can be a program name with args.
-set dummy rpmbuild; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RPMBUILD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RPMBUILD"; then
- ac_cv_prog_RPMBUILD="$RPMBUILD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RPMBUILD="rpmbuild"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_RPMBUILD" && ac_cv_prog_RPMBUILD="rpm"
-fi
-fi
-RPMBUILD=$ac_cv_prog_RPMBUILD
-if test -n "$RPMBUILD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPMBUILD" >&5
-$as_echo "$RPMBUILD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Extract the first word of "sed", so it can be a program name with args.
-set dummy sed; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$SED"; then
- ac_cv_prog_SED="$SED" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_SED="sed"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-SED=$ac_cv_prog_SED
-if test -n "$SED"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5
-$as_echo "$SED" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.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"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.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"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/byteorder.h byteswap.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"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this sort of thing. */
- typedef int charset[2];
- const charset cs = { 0, 0 };
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this sort of thing. */
- char tx;
- char *t = &tx;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; } bx;
- struct s *b = &bx; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_const=yes
-else
- ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
-else
- ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-for ac_header in sys/select.h sys/socket.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"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5
-$as_echo_n "checking types of arguments for select... " >&6; }
-if ${ac_cv_func_select_args+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
- for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
- for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-#ifdef HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-
-int
-main ()
-{
-extern int select ($ac_arg1,
- $ac_arg234, $ac_arg234, $ac_arg234,
- $ac_arg5);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
- done
-done
-# Provide a safe default value.
-: "${ac_cv_func_select_args=int,int *,struct timeval *}"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5
-$as_echo "$ac_cv_func_select_args" >&6; }
-ac_save_IFS=$IFS; IFS=','
-set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'`
-IFS=$ac_save_IFS
-shift
-
-cat >>confdefs.h <<_ACEOF
-#define SELECT_TYPE_ARG1 $1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define SELECT_TYPE_ARG234 ($2)
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define SELECT_TYPE_ARG5 ($3)
-_ACEOF
-
-rm -f conftest*
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
-$as_echo_n "checking for working strtod... " >&6; }
-if ${ac_cv_func_strtod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_strtod=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-$ac_includes_default
-#ifndef strtod
-double strtod ();
-#endif
-int
-main()
-{
- {
- /* Some versions of Linux strtod mis-parse strings with leading '+'. */
- char *string = " +69";
- char *term;
- double value;
- value = strtod (string, &term);
- if (value != 69 || term != (string + 4))
- return 1;
- }
-
- {
- /* Under Solaris 2.4, strtod returns the wrong value for the
- terminating character under some conditions. */
- char *string = "NaN";
- char *term;
- strtod (string, &term);
- if (term != string && *(term - 1) == 0)
- return 1;
- }
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_strtod=yes
-else
- ac_cv_func_strtod=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5
-$as_echo "$ac_cv_func_strtod" >&6; }
-if test $ac_cv_func_strtod = no; then
- case " $LIBOBJS " in
- *" strtod.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
- ;;
-esac
-
-ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = xyes; then :
-
-fi
-
-if test $ac_cv_func_pow = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
-$as_echo_n "checking for pow in -lm... " >&6; }
-if ${ac_cv_lib_m_pow+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $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 pow ();
-int
-main ()
-{
-return pow ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_pow=yes
-else
- ac_cv_lib_m_pow=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
-$as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes; then :
- POW_LIB=-lm
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
-$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
-fi
-
-fi
-
-fi
-
-for ac_func in alarm gethostbyname getaddrinfo getifaddrs socket select
-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"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-for ac_func in memmove memset strchr strdup strerror
-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"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-for ac_func in getpassphrase
-do :
- ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase"
-if test "x$ac_cv_func_getpassphrase" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPASSPHRASE 1
-_ACEOF
-
-fi
-done
-
-
-CFLAGS="$CFLAGS -Wall -Wextra -std=gnu99 -pedantic -Wformat -Wformat-nonliteral"
-
-case `pwd` in
- *\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.2'
-macro_revision='1.3337'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO ""
-}
-
-case "$ECHO" in
- printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
- print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
- { ac_script=; unset ac_script;}
- if test -z "$SED"; then
- ac_path_SED_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
- # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
- ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
- "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_SED="$ac_path_SED"
- ac_path_SED_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_SED_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_SED"; then
- as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
- fi
-else
- ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
- rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
- then ac_cv_path_FGREP="$GREP -F"
- else
- if test -z "$FGREP"; then
- ac_path_FGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in fgrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
- # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'FGREP' >> "conftest.nl"
- "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_FGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_FGREP="$ac_path_FGREP"
- ac_path_FGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_FGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_FGREP"; then
- as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_FGREP=$FGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in dumpbin "link -dump"
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DUMPBIN"; then
- ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$DUMPBIN" && break
- done
-fi
-if test -z "$DUMPBIN"; then
- ac_ct_DUMPBIN=$DUMPBIN
- for ac_prog in dumpbin "link -dump"
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DUMPBIN"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_DUMPBIN" && break
-done
-
- if test "x$ac_ct_DUMPBIN" = x; then
- DUMPBIN=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DUMPBIN=$ac_ct_DUMPBIN
- fi
-fi
-
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
-
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: output\"" >&5)
- cat conftest.out >&5
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
- ac_ct_OBJDUMP=$OBJDUMP
- # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OBJDUMP"; then
- ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OBJDUMP" = x; then
- OBJDUMP="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OBJDUMP=$ac_ct_OBJDUMP
- fi
-else
- OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[3-9]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
- ac_ct_DLLTOOL=$DLLTOOL
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DLLTOOL"; then
- ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DLLTOOL" = x; then
- DLLTOOL="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DLLTOOL=$ac_ct_DLLTOOL
- fi
-else
- DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- for ac_prog in ar
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AR" && break
- done
-fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_AR" && break
-done
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-fi
-
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ar_at_file=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -ne 0; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
-
-if test "x$lt_cv_ar_at_file" = xno; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK '"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
- withval=$with_sysroot;
-else
- with_sysroot=no
-fi
-
-
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
- if test "$GCC" = yes; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
- as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
- ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
-
-
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line '$LINENO' "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
- *x86-64*)
- LD="${LD-ld} -m elf32_x86_64"
- ;;
- *)
- LD="${LD-ld} -m elf_i386"
- ;;
- esac
- ;;
- powerpc64le-*)
- LD="${LD-ld} -m elf32lppclinux"
- ;;
- powerpc64-*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- powerpcle-*)
- LD="${LD-ld} -m elf64lppc"
- ;;
- powerpc-*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_cc_needs_belf=yes
-else
- lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks="$enable_libtool_lock"
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$MANIFEST_TOOL"; then
- ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
- ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
- # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_MANIFEST_TOOL"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_MANIFEST_TOOL" = x; then
- MANIFEST_TOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
- fi
-else
- MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-fi
-
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&5
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
- MANIFEST_TOOL=:
-fi
-
-
-
-
-
-
- case $host_os in
- rhapsody* | darwin*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DSYMUTIL"; then
- ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
- ac_ct_DSYMUTIL=$DSYMUTIL
- # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DSYMUTIL"; then
- ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DSYMUTIL" = x; then
- DSYMUTIL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DSYMUTIL=$ac_ct_DSYMUTIL
- fi
-else
- DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NMEDIT"; then
- ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
- ac_ct_NMEDIT=$NMEDIT
- # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_NMEDIT"; then
- ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_NMEDIT="nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_NMEDIT" = x; then
- NMEDIT=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- NMEDIT=$ac_ct_NMEDIT
- fi
-else
- NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$LIPO"; then
- ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
- ac_ct_LIPO=$LIPO
- # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_LIPO"; then
- ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_LIPO="lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_LIPO" = x; then
- LIPO=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- LIPO=$ac_ct_LIPO
- fi
-else
- LIPO="$ac_cv_prog_LIPO"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL"; then
- ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
- ac_ct_OTOOL=$OTOOL
- # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL"; then
- ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL="otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL" = x; then
- OTOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL=$ac_ct_OTOOL
- fi
-else
- OTOOL="$ac_cv_prog_OTOOL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL64"; then
- ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
- ac_ct_OTOOL64=$OTOOL64
- # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL64"; then
- ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL64="otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL64" = x; then
- OTOOL64=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL64=$ac_ct_OTOOL64
- fi
-else
- OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&5
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&5
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_ld_exported_symbols_list=yes
-else
- lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
- echo "$RANLIB libconftest.a" >&5
- $RANLIB libconftest.a 2>&5
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&5
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&5
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
- case $host_os in
- rhapsody* | darwin1.[012])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[012]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-# Set options
-
-
-
- enable_dlopen=no
-
-
- enable_win32_dll=no
-
-
- # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
- # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
- withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- pic_mode=default
-fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
-
-
-
-
-
-
- # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- else
- MAGIC_CMD=:
- fi
-fi
-
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
- case $cc_basename in
- nvcc*)
- lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
- *)
- lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
- esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-
-
-
-
-
- lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_static='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- lt_prog_compiler_pic='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- lt_prog_compiler_static=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- lt_prog_compiler_wl='-Xlinker '
- if test -n "$lt_prog_compiler_pic"; then
- lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- else
- lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='--shared'
- lt_prog_compiler_static='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- lt_prog_compiler_wl='-Wl,-Wl,,'
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-qpic'
- lt_prog_compiler_static='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Wl,'
- ;;
- *Intel*\ [CF]*Compiler*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- *Portland\ Group*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- lt_prog_compiler_wl='-Qoption ld ';;
- *)
- lt_prog_compiler_wl='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl='-Qoption ld '
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic='-Kconform_pic'
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_can_build_shared=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic='-pic'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared=no
- ;;
- esac
- fi
-
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_pic_works=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
- case $lt_prog_compiler_pic in
- "" | " "*) ;;
- *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
- esac
-else
- lt_prog_compiler_pic=
- lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_static_works=yes
- fi
- else
- lt_cv_prog_compiler_static_works=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- runpath_var=
- allow_undefined_flag=
- always_export_symbols=no
- archive_cmds=
- archive_expsym_cmds=
- compiler_needs_object=no
- enable_shared_with_static_runtimes=no
- export_dynamic_flag_spec=
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- hardcode_automatic=no
- hardcode_direct=no
- hardcode_direct_absolute=no
- hardcode_libdir_flag_spec=
- hardcode_libdir_separator=
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- inherit_rpath=no
- link_all_deplibs=unknown
- module_cmds=
- module_expsym_cmds=
- old_archive_from_new_cmds=
- old_archive_from_expsyms_cmds=
- thread_safe_flag_spec=
- whole_archive_flag_spec=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- linux* | k*bsd*-gnu | gnu*)
- link_all_deplibs=no
- ;;
- esac
-
- ld_shlibs=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
- *\ \(GNU\ Binutils\)\ [3-9]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test "$lt_use_gnu_ld_interface" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[3-9]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- export_dynamic_flag_spec='${wl}--export-all-symbols'
- allow_undefined_flag=unsupported
- always_export_symbols=no
- enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- haiku*)
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- link_all_deplibs=yes
- ;;
-
- interix[3-9]*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- whole_archive_flag_spec=
- tmp_sharedflag='--shared' ;;
- xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- compiler_needs_object=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
- compiler_needs_object=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs" = no; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix[4-9]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds=''
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- file_list_spec='${wl}-f,'
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- link_all_deplibs=no
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- export_dynamic_flag_spec='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag=' ${wl}-bernotok'
- allow_undefined_flag=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
- # We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- fi
- archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- file_list_spec='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
- enable_shared_with_static_runtimes=yes
- exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- old_postinstall_cmds='chmod 644 $oldlib'
- postlink_cmds='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- enable_shared_with_static_runtimes=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
-
-
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
- else
- whole_archive_flag_spec=''
- fi
- link_all_deplibs=yes
- allow_undefined_flag="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-
- else
- ld_shlibs=no
- fi
-
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
-
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler__b=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -b"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler__b=yes
- fi
- else
- lt_cv_prog_compiler__b=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test x"$lt_cv_prog_compiler__b" = xyes; then
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_irix_exported_symbol=yes
-else
- lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
- if test "$lt_cv_irix_exported_symbol" = yes; then
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- fi
- else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- inherit_rpath=yes
- link_all_deplibs=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- hardcode_direct_absolute=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_shlibpath_var=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds='$CC -r -o $output$reload_objs'
- hardcode_direct=no
- ;;
- motorola)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='${wl}-z,text'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-R,$libdir'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- ;;
- esac
- fi
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- lt_cv_archive_cmds_need_lc=no
- else
- lt_cv_archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
- archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
- ;;
- esac
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[lt_foo]++; }
- if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([A-Za-z]:\),\1,g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec="$LIB"
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[23].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
-fi
-
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
- test -n "$runpath_var" ||
- test "X$hardcode_automatic" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$hardcode_direct" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink ||
- test "$inherit_rpath" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-
-
-
-
- if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $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 dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- *)
- ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $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 shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_shl_load=yes
-else
- ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
-else
- ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $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 dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $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 dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_svld_dlopen=yes
-else
- ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $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 dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_dld_link=yes
-else
- ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
- # Report which library types will actually be built
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[4-9]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-LIBTOOL="$LIBTOOL --silent"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
-$as_echo_n "checking for library containing gethostbyname... " >&6; }
-if ${ac_cv_search_gethostbyname+:} 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 gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' nsl; 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_gethostbyname=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_gethostbyname+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_gethostbyname+:} false; then :
-
-else
- ac_cv_search_gethostbyname=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
-$as_echo "$ac_cv_search_gethostbyname" >&6; }
-ac_res=$ac_cv_search_gethostbyname
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
-$as_echo_n "checking for library containing getaddrinfo... " >&6; }
-if ${ac_cv_search_getaddrinfo+:} 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 getaddrinfo ();
-int
-main ()
-{
-return getaddrinfo ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' nsl; 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_getaddrinfo=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_getaddrinfo+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_getaddrinfo+:} false; then :
-
-else
- ac_cv_search_getaddrinfo=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5
-$as_echo "$ac_cv_search_getaddrinfo" >&6; }
-ac_res=$ac_cv_search_getaddrinfo
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getifaddrs" >&5
-$as_echo_n "checking for library containing getifaddrs... " >&6; }
-if ${ac_cv_search_getifaddrs+:} 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 getifaddrs ();
-int
-main ()
-{
-return getifaddrs ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' nsl; 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_getifaddrs=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_getifaddrs+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_getifaddrs+:} false; then :
-
-else
- ac_cv_search_getifaddrs=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getifaddrs" >&5
-$as_echo "$ac_cv_search_getifaddrs" >&6; }
-ac_res=$ac_cv_search_getifaddrs
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-$as_echo_n "checking for library containing socket... " >&6; }
-if ${ac_cv_search_socket+:} 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 socket ();
-int
-main ()
-{
-return socket ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' socket; 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_socket=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_socket+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_socket+:} false; then :
-
-else
- ac_cv_search_socket=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-$as_echo "$ac_cv_search_socket" >&6; }
-ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnsl" >&5
-$as_echo_n "checking for socket in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl -lsocket $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 socket ();
-int
-main ()
-{
-return socket ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nsl_socket=yes
-else
- ac_cv_lib_nsl_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_socket" >&5
-$as_echo "$ac_cv_lib_nsl_socket" >&6; }
-if test "x$ac_cv_lib_nsl_socket" = xyes; then :
- LIBS="$LIBS -lsocket -lnsl"
-fi
-
-fi
-
-
-if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
-fi
-
-if test "x$exec_prefix" = "xNONE"; then
- exec_prefix="$prefix"
-fi
-
-
-xenable_intf_bmc=no
-xenable_intf_imb=yes
-xenable_intf_open=yes
-xenable_intf_usb=yes
-xenable_intf_lipmi=yes
-#xenable_intf_serial=yes
-xenable_intf_dummy=no
-xenable_all_options=yes
-xenable_ipmishell=yes
-
-case "$host_os" in
-solaris*)
- MAKE=gmake
- STRIP=gstrip
- LD=gld
- AR=gar
- # openssl libs are in /usr/sfw/lib on solaris 10
- LIBS="$LIBS -R/usr/sfw/lib"
- # disable the linux-specific interfaces
- xenable_intf_bmc=yes
- xenable_intf_imb=no
- xenable_intf_open=no
- xenable_intf_lipmi=no
- xenable_ipmishell=no
- xenable_all_options=no
- ;;
-*cygwin*)
- # disable the linux and solaris-specific interfaces
- xenable_intf_imb=no
- xenable_intf_open=no
- xenable_intf_lipmi=no
- xenable_intf_bmc=no
- xenable_intf_usb=no
- ;;
-*darwin*|aix*)
- # disable the linux and solaris-specific interfaces
- xenable_intf_imb=no
- xenable_intf_open=no
- xenable_intf_lipmi=no
- xenable_intf_bmc=no
- xenable_ipmishell=no
- xenable_intf_usb=no
- ;;
-*freebsd*)
- xenable_intf_imb=no
- xenable_intf_lipmi=no
- xenable_intf_bmc=no
- ;;
-*netbsd*)
- xenable_intf_imb=no
- xenable_intf_lipmi=no
- xenable_intf_bmc=no
- xenable_intf_open=no
- ;;
-gnu*)
- # disable the linux and solaris-specific interfaces on Hurd
- xenable_intf_imb=no
- xenable_intf_open=no
- ;;
-esac
-
-ARCH=$host_cpu
-
-OS=$host_os
-
-PSTAMP=$host
-
-BASEDIR=$prefix
-
-
-# Check whether --enable-solaris-opt was given.
-if test "${enable_solaris_opt+set}" = set; then :
- enableval=$enable_solaris_opt; xenable_solaris_opt=$enableval
-else
- xenable_solaris_opt=no
-fi
-
-if test "x$xenable_all_options" = "xyes" || test "x$xenable_solaris_opt" = "xyes"; then
-
-$as_echo "#define ENABLE_ALL_OPTIONS 1" >>confdefs.h
-
-fi
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h>
-
-int
-main ()
-{
-
- struct test {
- union {
- int a;
- unsigned int b;
- };
- } test;
-
- printf("a is %d", test.a);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_need_fms_extension=no
-else
- ac_need_fms_extension=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test "x$ac_need_fms_extension" = "xyes"; then
- CFLAGS="$CFLAGS -fms-extensions"
-
-fi
-
-# Check whether --enable-internal-md5 was given.
-if test "${enable_internal_md5+set}" = set; then :
- enableval=$enable_internal_md5; xenable_internal_md5=$enableval
-else
- xenable_internal_md5=no
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_cbc in -lcrypto" >&5
-$as_echo_n "checking for EVP_aes_128_cbc in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_EVP_aes_128_cbc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto -lcrypto $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 EVP_aes_128_cbc ();
-int
-main ()
-{
-return EVP_aes_128_cbc ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_EVP_aes_128_cbc=yes
-else
- ac_cv_lib_crypto_EVP_aes_128_cbc=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_cbc" >&5
-$as_echo "$ac_cv_lib_crypto_EVP_aes_128_cbc" >&6; }
-if test "x$ac_cv_lib_crypto_EVP_aes_128_cbc" = xyes; then :
- if test "x$xenable_internal_md5" != "xyes"; then
- have_crypto=yes; LIBS="$LIBS -lcrypto"
- fi
-else
- have_crypto=no
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Init in -lcrypto" >&5
-$as_echo_n "checking for MD5_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_MD5_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto -lcrypto $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 MD5_Init ();
-int
-main ()
-{
-return MD5_Init ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_MD5_Init=yes
-else
- ac_cv_lib_crypto_MD5_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Init" >&5
-$as_echo "$ac_cv_lib_crypto_MD5_Init" >&6; }
-if test "x$ac_cv_lib_crypto_MD5_Init" = xyes; then :
- if test "x$xenable_internal_md5" != "xyes"; then
- if test "x$have_crypto" != "xyes"; then
- LIBS="$LIBS -lcrypto"
- have_md5=yes
- fi
-
-$as_echo "#define HAVE_CRYPTO_MD5 1" >>confdefs.h
-
- fi
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD2_Init in -lcrypto" >&5
-$as_echo_n "checking for MD2_Init in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_MD2_Init+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto -lcrypto $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 MD2_Init ();
-int
-main ()
-{
-return MD2_Init ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_crypto_MD2_Init=yes
-else
- ac_cv_lib_crypto_MD2_Init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD2_Init" >&5
-$as_echo "$ac_cv_lib_crypto_MD2_Init" >&6; }
-if test "x$ac_cv_lib_crypto_MD2_Init" = xyes; then :
- if test "x$xenable_internal_md5" != "xyes"; then
- if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
- LIBS="$LIBS -lcrypto"
- have_md2=yes
- fi
-
-$as_echo "#define HAVE_CRYPTO_MD2 1" >>confdefs.h
-
- fi
-fi
-
-
-# Check whether --enable-intf-lan was given.
-if test "${enable_intf_lan+set}" = set; then :
- enableval=$enable_intf_lan; xenable_intf_lan=$enableval
-else
- xenable_intf_lan=yes
-fi
-
-if test "x$xenable_intf_lan" = "xstatic" || test "x$xenable_intf_lan" = "xplugin"; then
- xenable_intf_lan=yes
-fi
-if test "x$xenable_intf_lan" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_LAN 1" >>confdefs.h
-
- INTF_LAN=lan
-
- INTF_LAN_LIB=libintf_lan.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
-fi
-
-# Check whether --enable-intf-usb was given.
-if test "${enable_intf_usb+set}" = set; then :
- enableval=$enable_intf_usb; xenable_intf_usb=$enableval
-else
- xenable_intf_usb=$xenable_intf_usb
-fi
-
-if test "x$xenable_intf_usb" = "xstatic" || test "x$xenable_intf_usb" = "xplugin"; then
- xenable_intf_usb=yes
-fi
-if test "x$xenable_intf_usb" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_USB 1" >>confdefs.h
-
- INTF_USB=usb
-
- INTF_USB_LIB=libintf_usb.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB usb/libintf_usb.la"
-fi
-
-# Check whether --enable-intf-lanplus was given.
-if test "${enable_intf_lanplus+set}" = set; then :
- enableval=$enable_intf_lanplus; xenable_intf_lanplus=$enableval
-else
- xenable_intf_lanplus=$have_crypto
-fi
-
-if test "x$xenable_intf_lanplus" = "xstatic" || test "x$xenable_intf_lanplus" = "xplugin"; then
- xenable_intf_lanplus=yes
-fi
-if test "x$xenable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
- echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
- xenable_intf_lanplus=no
-fi
-if test "x$xenable_intf_lanplus" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_LANPLUS 1" >>confdefs.h
-
- INTF_LANPLUS=lanplus
-
- INTF_LANPLUS_LIB=libintf_lanplus.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
-else
- xenable_intf_lanplus=no
-fi
-
-ORIG_CPPFLAGS=$CPPFLAGS
-
-# Check whether --enable-intf-serial was given.
-if test "${enable_intf_serial+set}" = set; then :
- enableval=$enable_intf_serial; xenable_intf_serial=$enableval
-else
- xenable_intf_serial=yes
-fi
-
-if test "x$enable_intf_serial" = "xstatic" || test "x$enable_intf_serial" = "xplugin"; then
- xenable_intf_serial=yes
-fi
-if test "x$xenable_intf_serial" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_SERIAL 1" >>confdefs.h
-
- INTF_SERIAL=serial
-
- INTF_SERIAL_LIB=libintf_serial.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB serial/libintf_serial.la"
-else
- xenable_intf_serial=no
-fi
-
-
-# Check whether --with-kerneldir was given.
-if test "${with_kerneldir+set}" = set; then :
- withval=$with_kerneldir; if test "x$with_kerneldir" = "xyes"; then
- with_kerneldir="/lib/modules/`uname -r`/build"
- fi
- CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
-
- CPPFLAGS="$CPPFLAGS -I ${with_kerneldir}/include"
-
- if test -s ${with_kerneldir}/include/linux/version.h ; then
- kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
- sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
- if test "x$kernelver" = "x2.6"; then
- CPPFLAGS="$CPPFLAGS -D__user="
-
- fi
- fi
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linux/compiler.h" >&5
-$as_echo_n "checking for linux/compiler.h... " >&6; }
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <linux/compiler.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-$as_echo "#define HAVE_LINUX_COMPILER_H 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-CPPFLAGS=$ORIG_CPPFLAGS
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/ioccom.h" "ac_cv_header_sys_ioccom_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ioccom_h" = xyes; then :
-
-$as_echo "#define HAVE_SYS_IOCCOM_H 1" >>confdefs.h
-
-fi
-
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "linux/ipmi.h" "ac_cv_header_linux_ipmi_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_ipmi_h" = xyes; then :
-
-$as_echo "#define HAVE_OPENIPMI_H 1" >>confdefs.h
-
-else
- ac_fn_c_check_header_mongrel "$LINENO" "sys/ipmi.h" "ac_cv_header_sys_ipmi_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_ipmi_h" = xyes; then :
-
-$as_echo "#define HAVE_FREEBSD_IPMI_H 1" >>confdefs.h
-
-else
- echo "** Unable to find OpenIPMI header files. Using internal version."
-fi
-
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipmi_open_inband in -lfreeipmi" >&5
-$as_echo_n "checking for ipmi_open_inband in -lfreeipmi... " >&6; }
-if ${ac_cv_lib_freeipmi_ipmi_open_inband+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreeipmi $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 ipmi_open_inband ();
-int
-main ()
-{
-return ipmi_open_inband ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_freeipmi_ipmi_open_inband=yes
-else
- ac_cv_lib_freeipmi_ipmi_open_inband=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freeipmi_ipmi_open_inband" >&5
-$as_echo "$ac_cv_lib_freeipmi_ipmi_open_inband" >&6; }
-if test "x$ac_cv_lib_freeipmi_ipmi_open_inband" = xyes; then :
- have_free=yes
-else
- have_free=no
-fi
-
-if test "x$have_free" != "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipmi_ctx_open_inband in -lfreeipmi" >&5
-$as_echo_n "checking for ipmi_ctx_open_inband in -lfreeipmi... " >&6; }
-if ${ac_cv_lib_freeipmi_ipmi_ctx_open_inband+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreeipmi $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 ipmi_ctx_open_inband ();
-int
-main ()
-{
-return ipmi_ctx_open_inband ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_freeipmi_ipmi_ctx_open_inband=yes
-else
- ac_cv_lib_freeipmi_ipmi_ctx_open_inband=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freeipmi_ipmi_ctx_open_inband" >&5
-$as_echo "$ac_cv_lib_freeipmi_ipmi_ctx_open_inband" >&6; }
-if test "x$ac_cv_lib_freeipmi_ipmi_ctx_open_inband" = xyes; then :
- have_free=yes
-else
- have_free=no
-fi
-
-fi
-# Check whether --enable-intf-free was given.
-if test "${enable_intf_free+set}" = set; then :
- enableval=$enable_intf_free; xenable_intf_free=$enableval
-else
- xenable_intf_free=$have_free
-fi
-
-if test "x$xenable_intf_free" = "xstatic" || test "x$xenable_intf_free" = "xplugin"; then
- xenable_intf_free=yes
-fi
-if test "x$xenable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
- echo "** Unable to build FreeIPMI interface support!"
- xenable_intf_free=no
-fi
-if test "x$xenable_intf_free" = "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfreeipmi version 0.3.0" >&5
-$as_echo_n "checking for libfreeipmi version 0.3.0... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h> /* For size_t */
-#include <stdio.h> /* For NULL */
-#include <freeipmi/freeipmi.h>
-#include <freeipmi/udm/ipmi-udm.h>
-
-int
-main ()
-{
-
- ipmi_device_t dev;
- dev = ipmi_open_inband(IPMI_DEVICE_KCS,
- 0,
- 0,
- 0,
- NULL,
- 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_free_version_0_3_0=yes
-else
- ac_free_version_0_3_0=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_free_version_0_3_0" >&5
-$as_echo "$ac_free_version_0_3_0" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfreeipmi version 0.4.0" >&5
-$as_echo_n "checking for libfreeipmi version 0.4.0... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h> /* For size_t */
-#include <stdio.h> /* For NULL */
-#include <freeipmi/freeipmi.h>
-#include <freeipmi/udm/ipmi-udm.h>
-
-int
-main ()
-{
-
- ipmi_device_t dev = NULL;
- int rv;
- dev = ipmi_device_create();
- rv = ipmi_open_inband(dev,
- IPMI_DEVICE_KCS,
- 0,
- 0,
- 0,
- NULL,
- 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_free_version_0_4_0=yes
-else
- ac_free_version_0_4_0=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_free_version_0_4_0" >&5
-$as_echo "$ac_free_version_0_4_0" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfreeipmi version 0.5.0" >&5
-$as_echo_n "checking for libfreeipmi version 0.5.0... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h> /* For size_t */
-#include <stdio.h> /* For NULL */
-#include <freeipmi/freeipmi.h>
-#include <freeipmi/udm/ipmi-udm.h>
-
-int
-main ()
-{
-
- ipmi_device_t dev = NULL;
- int rv;
- dev = ipmi_device_create();
- rv = ipmi_open_inband(dev,
- IPMI_DEVICE_KCS,
- 0,
- 0,
- 0,
- NULL,
- 0,
- 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_free_version_0_5_0=yes
-else
- ac_free_version_0_5_0=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_free_version_0_5_0" >&5
-$as_echo "$ac_free_version_0_5_0" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfreeipmi version 0.6.0" >&5
-$as_echo_n "checking for libfreeipmi version 0.6.0... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdio.h> /* For NULL */
-#include <freeipmi/freeipmi.h>
-
-int
-main ()
-{
-
- ipmi_ctx_t ctx = NULL;
- int rv;
- ctx = ipmi_ctx_create();
- rv = ipmi_ctx_open_inband(ctx,
- IPMI_DEVICE_KCS,
- 0,
- 0,
- 0,
- NULL,
- 0,
- 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_free_version_0_6_0=yes
-else
- ac_free_version_0_6_0=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_free_version_0_6_0" >&5
-$as_echo "$ac_free_version_0_6_0" >&6; }
-
- if test "x$ac_free_version_0_3_0" = "xyes" \
- || test "x$ac_free_version_0_4_0" = "xyes" \
- || test "x$ac_free_version_0_5_0" = "xyes" \
- || test "x$ac_free_version_0_6_0" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_FREE 1" >>confdefs.h
-
- INTF_FREE=free
-
- INTF_FREE_LIB=libintf_free.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB free/libintf_free.la"
- if test "x$ac_free_version_0_3_0" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_FREE_0_3_0 1" >>confdefs.h
-
- fi
- if test "x$ac_free_version_0_4_0" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_FREE_0_4_0 1" >>confdefs.h
-
- fi
- if test "x$ac_free_version_0_5_0" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_FREE_0_5_0 1" >>confdefs.h
-
- fi
- if test "x$ac_free_version_0_6_0" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_FREE_0_6_0 1" >>confdefs.h
-
- fi
- else
- xenable_intf_free=no
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipmi_cmd_raw_ipmb in -lfreeipmi" >&5
-$as_echo_n "checking for ipmi_cmd_raw_ipmb in -lfreeipmi... " >&6; }
-if ${ac_cv_lib_freeipmi_ipmi_cmd_raw_ipmb+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreeipmi $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 ipmi_cmd_raw_ipmb ();
-int
-main ()
-{
-return ipmi_cmd_raw_ipmb ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_freeipmi_ipmi_cmd_raw_ipmb=yes
-else
- ac_cv_lib_freeipmi_ipmi_cmd_raw_ipmb=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freeipmi_ipmi_cmd_raw_ipmb" >&5
-$as_echo "$ac_cv_lib_freeipmi_ipmi_cmd_raw_ipmb" >&6; }
-if test "x$ac_cv_lib_freeipmi_ipmi_cmd_raw_ipmb" = xyes; then :
-
-$as_echo "#define IPMI_INTF_FREE_BRIDGING 1" >>confdefs.h
-
-fi
-
-fi
-
-ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default"
-if test "x$ac_cv_header_termios_h" = xyes; then :
-
-$as_echo "#define HAVE_TERMIOS_H 1" >>confdefs.h
-
-else
- ac_fn_c_check_header_mongrel "$LINENO" "sys/termios.h" "ac_cv_header_sys_termios_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_termios_h" = xyes; then :
-
-$as_echo "#define HAVE_SYS_TERMIOS_H 1" >>confdefs.h
-
-else
- echo "** Unable to find termios header file."
-fi
-
-
-fi
-
-
-
-
-# Check whether --with-rpm-distro was given.
-if test "${with_rpm_distro+set}" = set; then :
- withval=$with_rpm_distro; DISTRO=$with_rpm_distro
-
-fi
-
-
-
-# Check whether --with-rpm-release was given.
-if test "${with_rpm_release+set}" = set; then :
- withval=$with_rpm_release;
-else
- with_rpm_release=1
-fi
-
-RPM_RELEASE=$with_rpm_release
-
-
-# Check whether --enable-intf-open was given.
-if test "${enable_intf_open+set}" = set; then :
- enableval=$enable_intf_open; xenable_intf_open=$enableval
-fi
-
-if test "x$xenable_intf_open" = "xstatic" || test "x$xenable_intf_open" = "xplugin"; then
- xenable_intf_open=yes
-fi
-if test "x$xenable_intf_open" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_OPEN 1" >>confdefs.h
-
- INTF_OPEN=open
-
- INTF_OPEN_LIB=libintf_open.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenIPMI dual bridge support" >&5
-$as_echo_n "checking for OpenIPMI dual bridge support... " >&6; }
- have_openipmi_dual_bridge=no
- ORIG_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -Isrc/plugins/open -DENABLE_INTF_OPEN_DUAL_BRIDGE"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #if defined(HAVE_OPENIPMI_H)
- # if defined(HAVE_LINUX_COMPILER_H)
- # include <linux/compiler.h>
- # endif
- # include <linux/ipmi.h>
- #elif defined(HAVE_FREEBSD_IPMI_H)
- # include <sys/ipmi.h>
- #else
- # include "open.h"
- #endif
-
-int
-main ()
-{
-
- struct ipmi_ipmb_addr a;
- a.transit_slave_addr = 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- have_openipmi_dual_bridge=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test x"$have_openipmi_dual_bridge" = x"yes"; then
-
-$as_echo "#define ENABLE_INTF_OPEN_DUAL_BRIDGE 1" >>confdefs.h
-
- fi
- CPPFLAGS="$ORIG_CPPFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_openipmi_dual_bridge" >&5
-$as_echo "$have_openipmi_dual_bridge" >&6; }
-fi
-
-# Check whether --enable-intf-imb was given.
-if test "${enable_intf_imb+set}" = set; then :
- enableval=$enable_intf_imb; xenable_intf_imb=$enableval
-fi
-
-if test "x$xenable_intf_imb" = "xstatic" || test "x$xenable_intf_imb" = "xplugin"; then
- xenable_intf_imb=yes
-fi
-if test "x$xenable_intf_imb" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_IMB 1" >>confdefs.h
-
- INTF_IMB=imb
-
- INTF_IMB_LIB=libintf_imb.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
-fi
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/lipmi/lipmi_intf.h" "ac_cv_header_sys_lipmi_lipmi_intf_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_lipmi_lipmi_intf_h" = xyes; then :
- have_lipmi=yes
-else
- have_lipmi=no
-fi
-
-
-# Check whether --enable-intf-lipmi was given.
-if test "${enable_intf_lipmi+set}" = set; then :
- enableval=$enable_intf_lipmi; xenable_intf_lipmi=$enableval
-fi
-
-if test "x$xenable_intf_lipmi" = "xstatic" || test "x$xenable_intf_lipmi" = "xplugin"; then
- xenable_intf_lipmi=yes
-fi
-if test "x$xenable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
- echo "** Unable to build Solaris 9 x86 IPMI interface support!"
- xenable_intf_lipmi=no
-fi
-if test "x$xenable_intf_lipmi" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_LIPMI 1" >>confdefs.h
-
- INTF_LIPMI=lipmi
-
- INTF_LIPMI_LIB=libintf_lipmi.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
-fi
-
-# Check whether --enable-intf-bmc was given.
-if test "${enable_intf_bmc+set}" = set; then :
- enableval=$enable_intf_bmc; xenable_intf_bmc=$enableval
-else
- xenable_intf_bmc=no
-fi
-
-if test "x$xenable_intf_bmc" = "xstatic" || test "x$xenable_intf_bmc" = "xplugin"; then
- xenable_intf_bmc=yes
-fi
-if test "x$xenable_intf_bmc" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_BMC 1" >>confdefs.h
-
- INTF_BMC=bmc
-
- INTF_BMC_LIB=libintf_bmc.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
-fi
-
-# Check whether --enable-intf-dummy was given.
-if test "${enable_intf_dummy+set}" = set; then :
- enableval=$enable_intf_dummy; xenable_intf_dummy=$enableval
-else
- xenable_intf_dummy=no
-fi
-
-if test "x$xenable_intf_dummy" = "xyes"; then
-
-$as_echo "#define IPMI_INTF_DUMMY 1" >>confdefs.h
-
- INTF_DUMMY=dummy
-
- INTF_DUMMY_LIB=libintf_dummy.la
-
- IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dummy/libintf_dummy.la"
-fi
-
-
-
-if test "x$xenable_ipmishell" = "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
-$as_echo_n "checking for library containing tgetent... " >&6; }
-if ${ac_cv_search_tgetent+:} 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 tgetent ();
-int
-main ()
-{
-return tgetent ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' tinfo ncurses curses readline termcap; 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_tgetent=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_tgetent+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_tgetent+:} false; then :
-
-else
- ac_cv_search_tgetent=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5
-$as_echo "$ac_cv_search_tgetent" >&6; }
-ac_res=$ac_cv_search_tgetent
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5
-$as_echo_n "checking for library containing initscr... " >&6; }
-if ${ac_cv_search_initscr+:} 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 initscr ();
-int
-main ()
-{
-return initscr ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' ncurses curses; 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_initscr=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_initscr+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_initscr+:} false; then :
-
-else
- ac_cv_search_initscr=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_initscr" >&5
-$as_echo "$ac_cv_search_initscr" >&6; }
-ac_res=$ac_cv_search_initscr
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- have_curses=yes
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
-$as_echo_n "checking for library containing readline... " >&6; }
-if ${ac_cv_search_readline+:} 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 readline ();
-int
-main ()
-{
-return readline ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' readline edit; 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_readline=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_readline+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_readline+:} false; then :
-
-else
- ac_cv_search_readline=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_readline" >&5
-$as_echo "$ac_cv_search_readline" >&6; }
-ac_res=$ac_cv_search_readline
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- have_readline=yes
-fi
-
- if test "x$have_curses" != "xyes" || test "x$have_readline" != "xyes"; then
- xenable_ipmishell=no
- fi
-fi
-
-# Check whether --enable-ipmishell was given.
-if test "${enable_ipmishell+set}" = set; then :
- enableval=$enable_ipmishell; xenable_ipmishell=$enableval
-fi
-
-if test "x$xenable_ipmishell" = "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
-$as_echo_n "checking for library containing tgetent... " >&6; }
-if ${ac_cv_search_tgetent+:} 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 tgetent ();
-int
-main ()
-{
-return tgetent ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' tinfo ncurses curses readline termcap; 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_tgetent=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_tgetent+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_tgetent+:} false; then :
-
-else
- ac_cv_search_tgetent=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5
-$as_echo "$ac_cv_search_tgetent" >&6; }
-ac_res=$ac_cv_search_tgetent
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5
-$as_echo_n "checking for library containing initscr... " >&6; }
-if ${ac_cv_search_initscr+:} 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 initscr ();
-int
-main ()
-{
-return initscr ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' ncurses curses; 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_initscr=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_initscr+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_initscr+:} false; then :
-
-else
- ac_cv_search_initscr=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_initscr" >&5
-$as_echo "$ac_cv_search_initscr" >&6; }
-ac_res=$ac_cv_search_initscr
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- have_curses=yes
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
-$as_echo_n "checking for library containing readline... " >&6; }
-if ${ac_cv_search_readline+:} 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 readline ();
-int
-main ()
-{
-return readline ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' readline edit; 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_readline=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_readline+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_readline+:} false; then :
-
-else
- ac_cv_search_readline=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_readline" >&5
-$as_echo "$ac_cv_search_readline" >&6; }
-ac_res=$ac_cv_search_readline
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- have_readline=yes
-fi
-
- if test "x$have_curses" != "xyes"; then
- as_fn_error $? "** Unable to find curses required by ipmishell." "$LINENO" 5
- fi
- if test "x$have_readline" != "xyes"; then
- as_fn_error $? "** Unable to find readline required by ipmishell." "$LINENO" 5
- fi
-
-$as_echo "#define HAVE_READLINE 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-buildcheck was given.
-if test "${enable_buildcheck+set}" = set; then :
- enableval=$enable_buildcheck; xenable_buildcheck=$enableval
-else
- xenable_buildcheck=no
-fi
-
-if test "x$xenable_buildcheck" != "xno"; then
- CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes"
-fi
-
-
-# Check whether --enable-file-security was given.
-if test "${enable_file_security+set}" = set; then :
- enableval=$enable_file_security; xenable_file_security=$enableval
-else
- xenable_file_security=no
-fi
-
-if test "x$xenable_file_security" != "xno"; then
-
-$as_echo "#define ENABLE_FILE_SECURITY 1" >>confdefs.h
-
-fi
-
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- #include <stdio.h>
-
- struct packstruct {
- unsigned char t0 :5;
- unsigned char t1 :5;
- unsigned char t2 :5;
- unsigned char t3 :5;
- unsigned char t4 :4;
- } __attribute__ ((packed));
-
- int
- main(int argc, char ** argv)
- {
- if(sizeof(struct packstruct) != 3)
- return(1);
- else
- return(0);
- }
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-
-$as_echo "#define HAVE_PRAGMA_PACK 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-
-ac_config_files="$ac_config_files Makefile doc/Makefile contrib/Makefile control/Makefile control/pkginfo control/prototype control/rpmmacros control/ipmitool.spec lib/Makefile include/Makefile include/ipmitool/Makefile src/Makefile src/plugins/Makefile src/plugins/lan/Makefile src/plugins/lanplus/Makefile src/plugins/open/Makefile src/plugins/free/Makefile src/plugins/imb/Makefile src/plugins/bmc/Makefile src/plugins/usb/Makefile src/plugins/lipmi/Makefile src/plugins/serial/Makefile src/plugins/dummy/Makefile"
-
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
- if test -n "$EXEEXT"; then
- am__EXEEXT_TRUE=
- am__EXEEXT_FALSE='#'
-else
- am__EXEEXT_TRUE='#'
- am__EXEEXT_FALSE=
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by ipmitool $as_me 1.8.17, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-ipmitool config.status 1.8.17
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in SHELL \
-ECHO \
-PATH_SEPARATOR \
-SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-OBJDUMP \
-deplibs_check_method \
-file_magic_cmd \
-file_magic_glob \
-want_nocaseglob \
-DLLTOOL \
-sharedlib_from_linklib_cmd \
-AR \
-AR_FLAGS \
-archiver_list_spec \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-nm_file_list_spec \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_pic \
-lt_prog_compiler_wl \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-MANIFEST_TOOL \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_separator \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postlink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
- RM='$RM'
- ofile='$ofile'
-
-
-
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
- "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
- "control/Makefile") CONFIG_FILES="$CONFIG_FILES control/Makefile" ;;
- "control/pkginfo") CONFIG_FILES="$CONFIG_FILES control/pkginfo" ;;
- "control/prototype") CONFIG_FILES="$CONFIG_FILES control/prototype" ;;
- "control/rpmmacros") CONFIG_FILES="$CONFIG_FILES control/rpmmacros" ;;
- "control/ipmitool.spec") CONFIG_FILES="$CONFIG_FILES control/ipmitool.spec" ;;
- "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
- "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
- "include/ipmitool/Makefile") CONFIG_FILES="$CONFIG_FILES include/ipmitool/Makefile" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "src/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/Makefile" ;;
- "src/plugins/lan/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/lan/Makefile" ;;
- "src/plugins/lanplus/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/lanplus/Makefile" ;;
- "src/plugins/open/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/open/Makefile" ;;
- "src/plugins/free/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/free/Makefile" ;;
- "src/plugins/imb/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/imb/Makefile" ;;
- "src/plugins/bmc/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/bmc/Makefile" ;;
- "src/plugins/usb/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/usb/Makefile" ;;
- "src/plugins/lipmi/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/lipmi/Makefile" ;;
- "src/plugins/serial/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/serial/Makefile" ;;
- "src/plugins/dummy/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/dummy/Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Older Autoconf quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
- "libtool":C)
-
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags=""
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# convert \$build file names to \$host format.
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-
-# convert \$build files to toolchain format.
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-
-# An object symbol dumper.
-OBJDUMP=$lt_OBJDUMP
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=$lt_file_magic_glob
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob=$lt_want_nocaseglob
-
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-
-# The archiver.
-AR=$lt_AR
-
-# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=$lt_archiver_list_spec
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# Specify filename containing input files for \$NM.
-nm_file_list_spec=$lt_nm_file_list_spec
-
-# The root where to search for dependent libraries,and in which our libraries should be installed.
-lt_sysroot=$lt_sysroot
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Manifest tool.
-MANIFEST_TOOL=$lt_MANIFEST_TOOL
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- if test x"$xsi_shell" = xyes; then
- sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\ # positional parameters, so assign one to ordinary parameter first.\
-\ func_stripname_result=${3}\
-\ func_stripname_result=${func_stripname_result#"${1}"}\
-\ func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\ func_split_long_opt_name=${1%%=*}\
-\ func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\ func_split_short_opt_arg=${1#??}\
-\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\ case ${1} in\
-\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\ *) func_lo2o_result=${1} ;;\
-\ esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
- func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
- func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
- func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
- sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
- eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\ func_quote_for_eval "${2}"\
-\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
-$as_echo "" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ipmitool $VERSION" >&5
-$as_echo "ipmitool $VERSION" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
-$as_echo "" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Interfaces" >&5
-$as_echo "Interfaces" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: lan : $xenable_intf_lan" >&5
-$as_echo " lan : $xenable_intf_lan" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: lanplus : $xenable_intf_lanplus" >&5
-$as_echo " lanplus : $xenable_intf_lanplus" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: open : $xenable_intf_open" >&5
-$as_echo " open : $xenable_intf_open" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: free : $xenable_intf_free" >&5
-$as_echo " free : $xenable_intf_free" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: imb : $xenable_intf_imb" >&5
-$as_echo " imb : $xenable_intf_imb" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: bmc : $xenable_intf_bmc" >&5
-$as_echo " bmc : $xenable_intf_bmc" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: usb : $xenable_intf_usb" >&5
-$as_echo " usb : $xenable_intf_usb" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: lipmi : $xenable_intf_lipmi" >&5
-$as_echo " lipmi : $xenable_intf_lipmi" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: serial : $xenable_intf_serial" >&5
-$as_echo " serial : $xenable_intf_serial" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: dummy : $xenable_intf_dummy" >&5
-$as_echo " dummy : $xenable_intf_dummy" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
-$as_echo "" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Extra tools" >&5
-$as_echo "Extra tools" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ipmievd : yes" >&5
-$as_echo " ipmievd : yes" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ipmishell : $xenable_ipmishell" >&5
-$as_echo " ipmishell : $xenable_ipmishell" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
-$as_echo "" >&6; }
-
diff --git a/configure.ac b/configure.ac
index 16c8305..d6ba62b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,12 @@
dnl
dnl autoconf for ipmitool
dnl
-AC_INIT([ipmitool], [1.8.17])
+m4_define([git_suffix], m4_esyscmd_s(./csv-revision))
+AC_INIT([ipmitool], [1.8.19git_suffix])
AC_CONFIG_SRCDIR([src/ipmitool.c])
+AC_CONFIG_COMMANDS_PRE([export prefix=$prefix])
AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([foreign])
AM_CONFIG_HEADER(config.h)
AC_PREREQ(2.50)
AC_SUBST(ac_configure_args)
@@ -16,6 +18,8 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
AC_CHECK_PROG([SED], [sed], [sed])
+AC_CHECK_PROG([WGET], [wget], [wget])
+AC_CHECK_PROG([CURL], [curl], [curl])
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
@@ -32,7 +36,7 @@ AC_CHECK_FUNCS([alarm gethostbyname getaddrinfo getifaddrs socket select])
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
AC_CHECK_FUNCS([getpassphrase])
-CFLAGS="$CFLAGS -Wall -Wextra -std=gnu99 -pedantic -Wformat -Wformat-nonliteral"
+CFLAGS="$CFLAGS -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral"
AM_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
@@ -52,18 +56,36 @@ if test "x$exec_prefix" = "xNONE"; then
exec_prefix="$prefix"
fi
+if test "x$WGET" = "x"; then
+ if test "x$CURL" = "x"; then
+ AC_MSG_WARN([** Neither wget nor curl could be found.])
+ AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !])
+ else
+ DOWNLOAD="$CURL --location --progress-bar"
+ AM_CONDITIONAL([DOWNLOAD], [true])
+ fi
+else
+ DOWNLOAD="$WGET -c -nd -O -"
+ AM_CONDITIONAL([DOWNLOAD], [true])
+fi
+
+AC_MSG_WARN([** Download is:])
+AC_MSG_WARN($DOWNLOAD)
+AC_SUBST(DOWNLOAD, $DOWNLOAD)
+
dnl
dnl set default option values
dnl
+xenable_all_options=yes
xenable_intf_bmc=no
+xenable_intf_dbus=no
+xenable_intf_dummy=no
xenable_intf_imb=yes
-xenable_intf_open=yes
-xenable_intf_usb=yes
xenable_intf_lipmi=yes
+xenable_intf_open=yes
#xenable_intf_serial=yes
-xenable_intf_dummy=no
-xenable_all_options=yes
+xenable_intf_usb=no
xenable_ipmishell=yes
dnl set some things so we build with GNU tools on Solaris
@@ -88,33 +110,29 @@ solaris*)
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_lipmi=no
- xenable_intf_bmc=no
- xenable_intf_usb=no
;;
*darwin*|aix*)
# disable the linux and solaris-specific interfaces
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_lipmi=no
- xenable_intf_bmc=no
xenable_ipmishell=no
- xenable_intf_usb=no
;;
*freebsd*)
xenable_intf_imb=no
xenable_intf_lipmi=no
- xenable_intf_bmc=no
+ CFLAGS="$CFLAGS -D__BSD_VISIBLE"
;;
*netbsd*)
xenable_intf_imb=no
xenable_intf_lipmi=no
- xenable_intf_bmc=no
xenable_intf_open=no
;;
gnu*)
# disable the linux and solaris-specific interfaces on Hurd
xenable_intf_imb=no
xenable_intf_open=no
+ xenable_intf_usb=yes
;;
esac
@@ -164,6 +182,16 @@ AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
fi],
[have_crypto=no], [-lcrypto])
+AC_CHECK_LIB([crypto], [EVP_sha256],
+ [if test "x$xenable_internal_sha256" != "xyes"; then
+ if test "x$have_crypto" != "xyes"; then
+ LIBS="$LIBS -lcrypto"
+ have_sha256=yes
+ fi
+ AC_DEFINE(HAVE_CRYPTO_SHA256, [1], [Define to 1 if libcrypto supports SHA256.])
+ fi],
+ [], [-lcrypto])
+
AC_CHECK_LIB([crypto], [MD5_Init],
[if test "x$xenable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes"; then
@@ -184,6 +212,14 @@ AC_CHECK_LIB([crypto], [MD2_Init],
fi],
[], [-lcrypto])
+dnl check for libsystemd in case dbus-intf is requested
+AC_CHECK_LIB([systemd], [sd_bus_default],
+ [
+ LIBS="$LIBS -lsystemd"
+ have_systemd=yes
+ ],
+ [ have_systemd=no],[])
+
dnl enable IPMIv1.5 LAN interface
AC_ARG_ENABLE([intf-lan],
[AC_HELP_STRING([--enable-intf-lan],
@@ -547,6 +583,25 @@ if test "x$xenable_intf_bmc" = "xyes"; then
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
fi
+dnl enable IPMI dbus interface
+AC_ARG_ENABLE([intf-dbus],
+ [AC_HELP_STRING([--enable-intf-dbus],
+ [enable IPMI dbus interface [default=no]])],
+ [xenable_intf_dbus=$enableval],
+ [xenable_intf_dbus=no])
+if test "x$xenable_intf_dbus" != "xno"; then
+ if test "x$have_systemd" != "xyes"; then
+ AC_MSG_ERROR([** Unable to find libsystemd required by dbus-intf.])
+ xenable_intf_dbus=no
+ fi
+fi
+if test "x$xenable_intf_dbus" = "xyes"; then
+ AC_DEFINE(IPMI_INTF_DBUS, [1], [Define to 1 to enable dbus interface.])
+ AC_SUBST(INTF_DBUS, [dbus])
+ AC_SUBST(INTF_DBUS_LIB, [libintf_dbus.la])
+ IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dbus/libintf_dbus.la"
+fi
+
dnl enable Dummy interface for testing
AC_ARG_ENABLE([intf-dummy],
[AC_HELP_STRING([--enable-intf-dummy],
@@ -561,30 +616,18 @@ fi
AC_SUBST(IPMITOOL_INTF_LIB)
-if test "x$xenable_ipmishell" = "xyes"; then
- AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
- AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
- AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
- if test "x$have_curses" != "xyes" || test "x$have_readline" != "xyes"; then
- xenable_ipmishell=no
- fi
-fi
-
-dnl check for readline library to enable ipmi shell
AC_ARG_ENABLE([ipmishell],
[AC_HELP_STRING([--enable-ipmishell],
[enable IPMI shell interface [default=auto]])],
[xenable_ipmishell=$enableval],
[])
+
+dnl check for readline library to enable ipmi shell
if test "x$xenable_ipmishell" = "xyes"; then
- AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
- AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
- if test "x$have_curses" != "xyes"; then
- AC_MSG_ERROR([** Unable to find curses required by ipmishell.])
- fi
if test "x$have_readline" != "xyes"; then
AC_MSG_ERROR([** Unable to find readline required by ipmishell.])
+ xenable_ipmishell=no
fi
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
fi
@@ -636,6 +679,50 @@ AC_TRY_COMPILE([],[
[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
)
+dnl if no environment variable is set, set the default value for the default intf
+if test "${xenable_intf_open}" = "yes"; then
+ DEFAULT_INTF_NO_ENV=open
+else dnl macOS does not build open interface, it defaults to lan
+ DEFAULT_INTF_NO_ENV=lan
+fi
+dnl allow for a default interface to be set on configure
+AC_ARG_VAR(DEFAULT_INTF, [Set the default interface to use (default='open' if available, 'lan' otherwise)])
+
+dnl set the default value for the default interface environment variable
+if test "x${DEFAULT_INTF}" = "x"; then
+ echo "DEFAULT_INTF not found in environment; setting to ${DEFAULT_INTF_NO_ENV}"
+ DEFAULT_INTF=${DEFAULT_INTF_NO_ENV}
+fi
+
+if test "x"`eval "echo \\\${xenable_intf_${DEFAULT_INTF}}"` != "xyes"; then
+ AC_MSG_ERROR([** Cannot set ${DEFAULT_INTF} as default; intf-${DEFAULT_INTF} is not enabled.])
+fi
+
+AC_ARG_VAR(IANADIR, [Configure the path to IANA PEN dictionary (default=DATAROOTDIR/misc)])
+AC_ARG_VAR(IANAUSERDIR, [Configure the path to IANA PEN dictionary wihtin the user's HOME directory (default=.local/usr/share/misc)])
+
+if test "x${IANADIR}" = "x"; then
+ IANADIR=`eval echo "${datarootdir}/misc"`
+ echo Set IANA PEN dictionary search path to ${IANADIR}
+fi
+
+if test "x${IANAUSERDIR}" = "x"; then
+ IANAUSERDIR=".local/usr/share/misc"
+ echo Set user\'s IANA PEN dictionary search path to ${IANAUSERDIR}
+fi
+
+AH_TEMPLATE([IANADIR],[The path to system IANA PEN dictionary])
+AC_DEFINE_UNQUOTED(IANADIR, "`eval "echo ${IANADIR}"`", [])
+
+AH_TEMPLATE([IANAUSERDIR],[The subpath to user IANA PEN dictionary within the user's HOME])
+AC_DEFINE_UNQUOTED(IANAUSERDIR, "`eval "echo ${IANAUSERDIR}"`", [])
+
+AH_TEMPLATE([PATH_SEPARATOR], [The path separator string])
+#if defined _WIN32 || defined __CYGWIN__
+AC_DEFINE(PATH_SEPARATOR, "\\")
+#else
+AC_DEFINE(PATH_SEPARATOR, "/")
+#endif
dnl Generate files for build
AC_CONFIG_FILES([Makefile
@@ -644,7 +731,6 @@ AC_CONFIG_FILES([Makefile
control/Makefile
control/pkginfo
control/prototype
- control/rpmmacros
control/ipmitool.spec
lib/Makefile
include/Makefile
@@ -657,23 +743,27 @@ AC_CONFIG_FILES([Makefile
src/plugins/free/Makefile
src/plugins/imb/Makefile
src/plugins/bmc/Makefile
+ src/plugins/dbus/Makefile
src/plugins/usb/Makefile
src/plugins/lipmi/Makefile
src/plugins/serial/Makefile
- src/plugins/dummy/Makefile])
+ src/plugins/dummy/Makefile
+ doc/ipmitool.1
+ doc/ipmievd.8])
AC_OUTPUT
AC_MSG_RESULT([])
AC_MSG_RESULT([ipmitool $VERSION])
AC_MSG_RESULT([])
-AC_MSG_RESULT([Interfaces])
+AC_MSG_RESULT([Interfaces (default=$DEFAULT_INTF)])
AC_MSG_RESULT([ lan : $xenable_intf_lan])
AC_MSG_RESULT([ lanplus : $xenable_intf_lanplus])
AC_MSG_RESULT([ open : $xenable_intf_open])
AC_MSG_RESULT([ free : $xenable_intf_free])
AC_MSG_RESULT([ imb : $xenable_intf_imb])
AC_MSG_RESULT([ bmc : $xenable_intf_bmc])
+AC_MSG_RESULT([ dbus : $xenable_intf_dbus])
AC_MSG_RESULT([ usb : $xenable_intf_usb])
AC_MSG_RESULT([ lipmi : $xenable_intf_lipmi])
AC_MSG_RESULT([ serial : $xenable_intf_serial])
diff --git a/contrib/Makefile.in b/contrib/Makefile.in
deleted file mode 100644
index 868dd15..0000000
--- a/contrib/Makefile.in
+++ /dev/null
@@ -1,550 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = contrib
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(dist_pkgdata_DATA) README
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(pkgdatadir)"
-DATA = $(dist_pkgdata_DATA)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-dist_pkgdata_DATA = oem_ibm_sel_map
-EXTRA_DIST = README \
- bmclanconf ipmi.init.basic ipmi.init.redhat \
- exchange-bmc-os-info.init.redhat exchange-bmc-os-info.service.redhat \
- exchange-bmc-os-info.sysconf log_bmc.sh\
- ipmievd.init.redhat ipmievd.init.suse ipmievd.init.debian \
- collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh \
- bmc-snmp-proxy bmc-snmp-proxy.service bmc-snmp-proxy.sysconf
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign contrib/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
- @$(NORMAL_INSTALL)
- @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \
- done
-
-uninstall-dist_pkgdataDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(DATA)
-installdirs:
- for dir in "$(DESTDIR)$(pkgdatadir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-dist_pkgdataDATA
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-dist_pkgdataDATA
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- cscopelist-am ctags-am distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-dist_pkgdataDATA install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
- uninstall-am uninstall-dist_pkgdataDATA
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/contrib/bmc-snmp-proxy b/contrib/bmc-snmp-proxy
index 1704ef3..6e69e61 100644
--- a/contrib/bmc-snmp-proxy
+++ b/contrib/bmc-snmp-proxy
@@ -3,7 +3,7 @@
#
# bmc-snmp-proxy: Set SNMP proxy to BMC (Baseboard Management Controller)
#
-# version: 0.6
+# version: 0.62
#
# Authors: Charles Rose <charles_rose@dell.com>
# Jordan Hargrave <jordan_hargrave@dell.com>
@@ -20,16 +20,16 @@
SYSCONF_DIR="/etc/sysconfig"
CONFIG="${SYSCONF_DIR}/bmc-snmp-proxy"
-SNMPD_LOCAL_CONF_DIR="/etc/snmp/bmc"
-SNMPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmpd.local.conf"
-TRAPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmptrapd.local.conf"
+SNMPD_BMC_CONF_DIR="/etc/snmp/bmc"
+SNMPD_BMC_CONF="${SNMPD_BMC_CONF_DIR}/snmpd.local.conf"
+TRAPD_BMC_CONF="${SNMPD_BMC_CONF_DIR}/snmptrapd.local.conf"
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
LOCKFILE="/var/lock/subsys/bmc-snmp-proxy"
-BMC_INFO="/var/run/bmc-info"
+BMC_INFO="/run/bmc-info"
-IPMITOOL=`which ipmitool`
+IPMITOOL=$(which ipmitool)
#Default config
BMC_COMMUNITY="public"
@@ -57,14 +57,16 @@ bmc_info_exists()
else
RETVAL=2
fi
+
return $RETVAL
}
check_snmp()
{
- if [ ! -d /etc/snmp ] && [ ! -x /usr/sbin/snmpd ]; then
+ if [ ! -d /etc/snmp ] || [ ! -x /usr/sbin/snmpd ]; then
RETVAL=12
fi
+
return $RETVAL
}
@@ -77,11 +79,12 @@ write_snmp_conf()
printf "###############################################\n"
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
printf "###############################################\n"
- printf "view bmcview included %s 80\n" "${BMC_OID}"
- printf "com2sec -Cn bmc_ctx bmc_sec default bmc_cmty\n"
- printf "group bmc_grp v1 bmc_sec\n"
- printf "access bmc_grp bmc_ctx any noauth exact bmcview none none\n"
- printf "proxy -Cn bmc_ctx -v 1 %s\n" "${PROXY_TOKEN}"
+ printf "#view bmcview included %s 80\n" "${BMC_OID}"
+ printf "#com2sec -Cn bmc_ctx bmc_sec default bmc_cmty\n"
+ printf "#group bmc_grp v1 bmc_sec\n"
+ printf "#access bmc_grp bmc_ctx any noauth exact bmcview none none\n"
+ printf "#proxy -Cn bmc_ctx -v 1 %s\n" "${PROXY_TOKEN}"
+ printf "proxy -v 1 %s\n" "${PROXY_TOKEN}"
printf "###############################################\n"
}
@@ -92,6 +95,7 @@ valid_ip()
printf -- "%s" "${1}"| grep -Eq \
"^${octet}\\.${octet}\\.${octet}\\.${octet}$"
+
return $?
}
@@ -112,37 +116,38 @@ set_snmp_proxy()
if check_vars; then
PROXY_TOKEN="-c ${BMC_COMMUNITY} ${BMC_IPv4} ${BMC_OID}"
- if [ ! -d ${SNMPD_LOCAL_CONF_DIR} ] && \
- mkdir ${SNMPD_LOCAL_CONF_DIR}; then
- write_snmp_conf > ${SNMPD_LOCAL_CONF}
- [ $? -ne 0 ] && RETVAL=4
+ if [ -d ${SNMPD_BMC_CONF_DIR} ]; then
+ write_snmp_conf > ${SNMPD_BMC_CONF} || RETVAL=4
fi
else
RETVAL=3
fi
}
-
set_snmpd_conf_path()
{
- for SYSCONF in ${SYSCONF_DIR}/snmp*d;
+ if [ ! -d ${SNMPD_BMC_CONF_DIR} ]; then
+ mkdir ${SNMPD_BMC_CONF_DIR} || RETVAL=7
+ fi
+
+ # We need SNMPCONFPATH set for both snmpd and snmptrapd
+ for sysconf in ${SYSCONF_DIR}/snmp*d;
do
- if grep -q "${SNMPD_LOCAL_CONF_DIR}" "${SYSCONF}" > \
- /dev/null 2>&1; then
- continue
- else
- printf "SNMPCONFPATH=%s\n" "${SNMPD_LOCAL_CONF_DIR}" \
- >> ${SYSCONF} || RETVAL=7
+ if ! grep -q "^SNMPCONFPATH.*${SNMPD_BMC_CONF_DIR}" \
+ "${sysconf}" > /dev/null 2>&1; then
+ printf "SNMPCONFPATH=/etc/snmp:%s\n" \
+ "${SNMPD_BMC_CONF_DIR}" >> ${sysconf} || \
+ RETVAL=7
fi
done
+
return $RETVAL
}
disable_snmp_proxy()
{
- if [ -f ${SNMPD_LOCAL_CONF} ]; then
- rm -f ${SNMPD_LOCAL_CONF}
- [ $? -ne 0 ] && RETVAL=5
+ if [ -f ${SNMPD_BMC_CONF} ]; then
+ rm -f ${SNMPD_BMC_CONF} || RETVAL=5
fi
}
#############################################################################
@@ -152,7 +157,8 @@ disable_snmp_proxy()
pick_alert_dest()
{
test_ip="$1"
- for ALERT_DEST in `seq 1 4`
+ # We have 4 IPv4 and 4 IPv6 alert dest. We will set IPv4 for now.
+ for ALERT_DEST in $(seq 1 4)
do
temp_ip=$(${IPMITOOL} lan alert print ${CHANNEL} ${ALERT_DEST}\
2>/dev/null| sed -n "s#^Alert IP Address.*: ##p")
@@ -165,14 +171,14 @@ pick_alert_dest()
set_alert_dest_ip()
{
${IPMITOOL} lan alert set ${CHANNEL} ${ALERT_DEST} ipaddr ${1} \
- retry 4 type pet >/dev/null 2>&1
- [ $? -ne 0 ] && RETVAL=8
+ retry 4 type pet >/dev/null 2>&1 || RETVAL=8
}
-bmc_alert_dest()
+config_bmc_alert_dest()
{
+ # call with enable|disable
# Pick the first active LAN channel
- for CHANNEL in `seq 1 14`
+ for CHANNEL in $(seq 1 14)
do
[ $(${IPMITOOL} -I open channel info ${CHANNEL} 2>/dev/null \
| grep -q "802\.3") ] || break
@@ -180,12 +186,12 @@ bmc_alert_dest()
# If TRAPD_IP is already set as an alert dest,
if pick_alert_dest "${TRAPD_IP}"; then
- # reset: reset it if we are called with reset
- [ "${1}" = "reset" ] && \
+ # disable: reset it if we are called with disable
+ [ "${1}" = "disable" ] && \
set_alert_dest_ip "0.0.0.0"
# else, find the next free alert dest,
elif pick_alert_dest "0.0.0.0"; then
- [ "${1}" = "reset" ] && \
+ [ "${1}" = "disable" ] && \
return $RETVAL
# set: the TRAPD_IP
set_alert_dest_ip "${TRAPD_IP}"
@@ -193,42 +199,54 @@ bmc_alert_dest()
# No free alert destinations
RETVAL=9
fi
+
return $RETVAL
}
-set_ipmi_alert()
+set_ipmi_pef()
{
- ${IPMITOOL} lan set ${CHANNEL} alert "${1}" >/dev/null 2>&1
- [ $? -ne 0 ] && RETVAL=10
+ # Needs ipmitool-1.8.13 + patches
+ ${IPMITOOL} pef policy set ${ALERT_DEST} "${1}" >/dev/null 2>&1 || \
+ RETVAL=10
}
get_host_ip()
{
- # Get host's IP that the BMC can reach.
+ # Get host's IP that the BMC can reach. This is at best a hack.
IFACE=$(/usr/sbin/ip -o -f inet address |awk '!/: lo/ {print $2}')
+
for dev in ${IFACE}
do
- ping -c 1 -I ${dev} ${BMC_IPv4} > /dev/null 2>&1
+ temp_ping=$(ping -c 1 -I ${dev} ${BMC_IPv4})
+ [ $? -ne 0 ] && continue
+
+ printf -- "%s" "$temp_ping"| awk 'NR==1{print $5}' && break
done
}
config_bmc_alert()
{
+ # Do two things
+ # Set/Reset TRAP IP in BMC
+ # Enable/Disable PEF alerting in BMC for TRAP
+
# Get Host's IP that the BMC can send traps to
TRAPD_IP=$(get_host_ip)
# Set Host's IP as the alert destination in the BMC
- valid_ip ${TRAPD_IP} && bmc_alert_dest "${ACTION}"
+ valid_ip ${TRAPD_IP} && config_bmc_alert_dest "${ACTION}"
+
+ # Enable/Disable alerting on the LAN channel
+ [ $RETVAL -eq 0 ] && set_ipmi_pef "${ACTION}"
- # Enable alerting on the LAN channel
- [ $RETVAL -eq 0 ] && set_ipmi_alert "${ACTION}"
+ return $RETVAL
}
write_trapd_conf()
{
printf "###############################################\n"
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
- printf "forward %s %s\n" "${BMC_OID}*" "${FORWARD_HOST}"
+ printf "forward default %s\n" "${FORWARD_HOST}"
printf "###############################################\n"
}
@@ -236,10 +254,9 @@ config_trapd()
{
# Proceed only if snmptrapd is available on the system
if [ -f ${TRAPD_CONF} ]; then
- write_trapd_conf > ${TRAPD_LOCAL_CONF}
- [ $? -ne 0 ] && RETVAL=11
+ write_trapd_conf > ${TRAPD_BMC_CONF} || RETVAL=11
else
- return 1
+ RETVAL=11
fi
}
@@ -249,6 +266,7 @@ trap_sink_exists()
# multiple
FORWARD_HOST=$(awk '/^trap.*sink/{print $2}; /^informsink/{print $2}' \
/etc/snmp/snmpd*conf | head -1)
+
if [ -z "${FORWARD_HOST}" ]; then
# there is no trapsink setup.
return 1
@@ -261,19 +279,20 @@ trap_sink_exists()
trap_forward()
{
NO_TRAP=0
- ACTION=${1} # set or reset
+ ACTION=${1} # enable or disable
- if [ "${ACTION}" = "set" ]; then
+ if [ "${ACTION}" = "enable" ]; then
# Get trapd config,
if trap_sink_exists; then
- config_trapd && config_bmc_alert
+ config_bmc_alert && config_trapd
else
# exit silently if there is no sink
NO_TRAP=1
fi
else
- if [ -f ${TRAPD_LOCAL_CONF} ]; then
- rm -f ${TRAPD_LOCAL_CONF} >/dev/null 2>&1
+ if [ -f ${TRAPD_BMC_CONF} ]; then
+ rm -f ${TRAPD_BMC_CONF} >/dev/null 2>&1
+ config_bmc_alert
else
NO_TRAP=1
fi
@@ -288,7 +307,6 @@ service_reload()
service $1 reload
[ $? -ne 0 ] && RETVAL=6
fi
- return
}
#############################################################################
@@ -296,11 +314,12 @@ start()
{
if bmc_info_exists && check_snmp; then
touch ${LOCKFILE}
+
set_snmpd_conf_path && set_snmp_proxy
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
- trap_forward "set"
+ trap_forward "enable"
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
@@ -316,10 +335,11 @@ stop()
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
- trap_forward "reset"
+ trap_forward "disable"
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
+
rm -f ${LOCKFILE}
fi
}
@@ -329,12 +349,13 @@ status()
{
eval_gettext "${SCRIPT_NAME}: snmp proxy to BMC is "
# Checking for lockfile is better.
- #if grep -q "^proxy" "${SNMPD_LOCAL_CONF}" > /dev/null 2>&1 ; then
+ #if grep -q "^proxy" "${SNMPD_BMC_CONF}" > /dev/null 2>&1 ; then
if [ -f ${LOCKFILE} ]; then
eval_gettext "set"
else
eval_gettext "not set"
fi
+
echo
RETVAL=0
}
@@ -360,10 +381,10 @@ case "$RETVAL" in
0|1) ;;
2) eval_gettext "${SCRIPT_NAME}: failed to read ${BMC_INFO} " 1>&2 ;;
3) eval_gettext "${SCRIPT_NAME}: failed to get proxy config." 1>&2 ;;
- 4) eval_gettext "${SCRIPT_NAME}: failed to set ${SNMPD_LOCAL_CONF}." 1>&2 ;;
+ 4) eval_gettext "${SCRIPT_NAME}: failed to set ${SNMPD_BMC_CONF}." 1>&2 ;;
5) eval_gettext "${SCRIPT_NAME}: failed to disable snmp proxy." 1>&2 ;;
6) eval_gettext "${SCRIPT_NAME}: failed to reload snmpd." 1>&2 ;;
- 7) eval_gettext "${SCRIPT_NAME}: failed to update ${SYSCONF}." 1>&2 ;;
+ 7) eval_gettext "${SCRIPT_NAME}: failed to set snmpd config." 1>&2 ;;
8) eval_gettext "${SCRIPT_NAME}: failed to set IPMI alert dest." 1>&2 ;;
9) eval_gettext "${SCRIPT_NAME}: no free IPMI alert dest." 1>&2 ;;
10) eval_gettext "${SCRIPT_NAME}: failed to set IPMI PEF." 1>&2 ;;
@@ -375,6 +396,7 @@ esac
if [ ${RETVAL} -gt 1 ]; then
eval_gettext " Return code: ${RETVAL}"; echo
fi
+
exit ${RETVAL}
#############################################################################
# end of file
diff --git a/contrib/bmc-snmp-proxy.service b/contrib/bmc-snmp-proxy.service
index 247137a..b244b4d 100644
--- a/contrib/bmc-snmp-proxy.service
+++ b/contrib/bmc-snmp-proxy.service
@@ -5,7 +5,7 @@ After=exchange-bmc-os-info.service
Requires=exchange-bmc-os-info.service
PartOf=exchange-bmc-os-info.service
-ConditionPathExists=/var/run/bmc-info
+ConditionPathExists=/run/bmc-info
[Service]
Type=oneshot
diff --git a/contrib/exchange-bmc-os-info.init.redhat b/contrib/exchange-bmc-os-info.init.redhat
index b7ec43f..8975c2e 100644
--- a/contrib/exchange-bmc-os-info.init.redhat
+++ b/contrib/exchange-bmc-os-info.init.redhat
@@ -12,10 +12,10 @@
# Description: Script to set OS information in the BMC; fetch BMC IP/URL
# and set in the OS for use by other scripts/user.
#
-# BMC IP and URL are made available in /var/run/bmc-info
+# BMC IP and URL are made available in /run/bmc-info
#
# Example to launch BMC web-interface:
-# # . /var/run/bmc-info
+# # . /run/bmc-info
# # xdg-open $BMC_URL
#
# See here for details:
@@ -42,7 +42,7 @@
#############################################################################
CONFIGFILE=/etc/sysconfig/exchange-bmc-os-info
IPMI_TOOL=/usr/bin/ipmitool
-BMC_INFO=/var/run/bmc-info
+BMC_INFO=/run/bmc-info
# BMC Manufacturer ID used in 'oem_set_os_version' and 'oem_get_bmc_url'
DELL="674"
diff --git a/contrib/exchange-bmc-os-info.service.redhat b/contrib/exchange-bmc-os-info.service.redhat
index 100493b..eb28ffe 100644
--- a/contrib/exchange-bmc-os-info.service.redhat
+++ b/contrib/exchange-bmc-os-info.service.redhat
@@ -1,7 +1,8 @@
[Unit]
Description=Exchange Information between BMC and OS
-After=ipmi.service network.target
-Requires=ipmi.service
+After=network.target
+AssertFileIsExecutable=/usr/bin/ipmitool
+AssertPathExistsGlob=/dev/ipmi*
[Service]
Type=oneshot
diff --git a/contrib/ipmievd.init.debian b/contrib/ipmievd.init.debian
index 1783d1a..1a2fc63 100755
--- a/contrib/ipmievd.init.debian
+++ b/contrib/ipmievd.init.debian
@@ -22,7 +22,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="IPMI event daemon"
NAME=ipmievd
DAEMON=/usr/sbin/$NAME
-PIDFILE=/var/run/$NAME.pid
+PIDFILE=/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
diff --git a/contrib/oem_ibm_sel_map b/contrib/oem_ibm_sel_map
index 330d362..e4b7a4a 100644
--- a/contrib/oem_ibm_sel_map
+++ b/contrib/oem_ibm_sel_map
@@ -1,4 +1,4 @@
-"0xC1","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","Chassis Number","R","R","0x00","CPU shutdown - Potential cause "triple fault" a software address problem"
+"0xC1","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","Chassis Number","R","R","0x00","CPU shutdown - Potential cause 'triple fault' a software address problem"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x01","Chassis Number","Failed Memory Card","Spare Memory Card","0x00","Memory Mirrored Failover Occurred - System running from mirrored memory image"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x04","Chassis Number","Memory Card","Completion Code (0x00=Success)","0x00","Memory hot replace event"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x05","Chassis Number","Memory Card","Memory Size (in 512MB units)","0x00","Memory hot add event"
diff --git a/control/Makefile.am b/control/Makefile.am
index 91950d6..7913312 100644
--- a/control/Makefile.am
+++ b/control/Makefile.am
@@ -31,7 +31,7 @@
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = pkginfo.in prototype.in \
- ipmitool.spec.in rpmmacros.in rpmrc
+ ipmitool.spec.in
-dist-hook: pkginfo prototype rpmmacros
+dist-hook: pkginfo prototype
diff --git a/control/Makefile.in b/control/Makefile.in
deleted file mode 100644
index 3c1ae92..0000000
--- a/control/Makefile.in
+++ /dev/null
@@ -1,503 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = control
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(srcdir)/pkginfo.in $(srcdir)/prototype.in \
- $(srcdir)/rpmmacros.in $(srcdir)/ipmitool.spec.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = pkginfo prototype rpmmacros ipmitool.spec
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-EXTRA_DIST = pkginfo.in prototype.in \
- ipmitool.spec.in rpmmacros.in rpmrc
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign control/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign control/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-pkginfo: $(top_builddir)/config.status $(srcdir)/pkginfo.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-prototype: $(top_builddir)/config.status $(srcdir)/prototype.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-rpmmacros: $(top_builddir)/config.status $(srcdir)/rpmmacros.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-ipmitool.spec: $(top_builddir)/config.status $(srcdir)/ipmitool.spec.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" distdir="$(distdir)" \
- dist-hook
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- cscopelist-am ctags-am dist-hook distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags-am uninstall uninstall-am
-
-
-dist-hook: pkginfo prototype rpmmacros
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/control/ipmitool.spec.in b/control/ipmitool.spec.in
index 85e61f9..6b5127a 100644
--- a/control/ipmitool.spec.in
+++ b/control/ipmitool.spec.in
@@ -1,10 +1,13 @@
+%define debug_package %{nil}
+
Name: ipmitool
Summary: ipmitool - Utility for IPMI control
Version: @VERSION@
Release: @RPM_RELEASE@%{?_distro:.%{_distro}}
License: BSD
Group: Utilities
-Packager: Jim Mankovich <jmank@hp.com>
+#Packager: PackagerName <packager@example.com>
+Distribution: GitHub Build
Source: %{name}-%{version}.tar.gz
Buildroot: /var/tmp/ipmitool-root
@@ -31,7 +34,7 @@ fi
%setup
%build
-./configure --with-kerneldir \
+./configure \
--with-rpm-distro=@DISTRO@ \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
@@ -56,11 +59,632 @@ fi
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/*
%{_datadir}/ipmitool/*
+%{_datadir}/misc/*
%{_mandir}/man*/*
%doc %{_datadir}/doc/ipmitool
%changelog
+* Sat Oct 8 2016 <gilles.buloz@kontron.com> 1.8.18-1
+- Add mac2str() and str2mac() to print/parse MAC address
+- Change formatting, remove commented-out code in
+ src/plugins/imb/imbapi.c
+- Export find_lan_channel() as global
+- Expose _ipmi_get_channel_info()
+- Extend buf2str to allow separator
+- Fix indentation of #define in src/plugins/imb/imbapi.c
+- Fix missing `goto out_free;` when ipmi_parse_hex() returns (-1)
+- Fix warning for buf2str argument
+- ID 408 - fix sel list last X listing
+- ID: 38 - Protocol violating SOL retries when talking to
+ SIMSO-HTC
+- ID: 459 - Fix reading FRU on Artesyn (Emerson) shelf manager,
+ MF105.
+- ID: 464 - ipmievd crash fix in log_event
+- ID:230 - check return value of malloc() in lib/ipmi_ekanalyzer.c
+- ID:261 - Fix err. output consistency for % ipmitool chassis
+ INV_PARAM;
+- ID:287 - Fix print-out of DDR3 SDRAM Serial Number
+- ID:287 - Remove trailing white-spaces from dimm_spd.c
+- ID:289 - bmx-snmp-proxy: PEF alerting does not work for
+ multiple destinations
+- ID:312 - BREAKING CHANGE - Re-design of PEF user interface
+- ID:312 - Fix bitmask in _ipmi_set_pef_policy_entry()
+- ID:335 - Check return value of fseek(), prevent segfault
+- ID:335 - Check return value of fseek(), prevent segfault
+- ID:355 - Comment out statement without effect in lib/ipmi_sel.c
+- ID:355 - Fix 'missing initializer' in struct lan_param
+- ID:355 - Fix ``warning: ISO C forbids zero-size array 'data'''
+- ID:355 - Fix different pointer type in lib/ipmi_picmg.c
+- ID:355 - Fix missing struct initializers in lib/ipmi_firewall.c
+- ID:355 - Fix printf format in lib/ipmi_sunoem.c
+- ID:355 - Fix printf() related warnings in lib/ipmi_delloem.c
+- ID:355 - Fix signedness warnings in lib/ipmi_sdr.c
+- ID:355 - Fix statements without effect in lib/ipmi_ekanalyzer.c
+- ID:355 - Move section_id from ipmi_fru. to ipmi_fru.c
+- ID:355 - Replace DEBUG() macro with lprintf(LOG_DEBUG, ...)
+- ID:375 - Add lan6 subcommand to handle IPv6 LAN parameters
+- ID:400 - Add support for VITA-specific sensor types and events.
+- ID:441 - Add support for HMAC_MD5 and HMAC_SHA256
+- ID:443 - Disable USB driver by default on non-Linux systems
+- ID:444 - Cleanup of defaults in configure.ac
+- ID:445 - Fix of compilation on FreeBSD
+- ID:446 - Fix broken firewall reset iterator
+- ID:447 - Fix access beyond array limits in serial_terminal
+- ID:449 - ipmitool close console session for sol deactivate
+ command
+- ID:451 - Modify the memory ecc error display of SEL for new
+ supermicro motherboards.
+- ID:452 - Add PICMG extension 5.x for PICMG extension check
+- ID:454 - Add support for PICMG 3.1 R2.0 Link Types and Link
+ Classes.
+- ID:456 - Unable to disable the VLAN ID using ipmitool
+- ID:457 - Display User ID enable/disable status
+- ID:463 - Removal of Nokia Siemens Networks
+- ID:465 - Supermicro memory ecc Modify the memory ecc error
+ display of SEL for new supermicro boards.
+- Moved ipmi_parse_hex() to helper.c
+- Re-work ipmi_mc_get_guid() and turn it into reusable code
+- Revert "ID:335 - Check return value of fseek(), prevent segfault"
+- Rewrite code with the notion that Kg is binary data, not string
+
+* Sun May 1 2016 <gilles.buloz@kontron.com> 1.8.17-1
+- Add INSTALL and NEWS, mandated by autoconf
+- Added missing ipmi_sel_supermicro.h to template Makefile.am
+- Check rsp->data_len in ipmi_sel_get_info()
+- Fix "redirecting incorrect #include <sys/poll.h> to <poll.h>"
+ warning with musl libc
+- Fix automake compatibility warnings
+- Fix implicit declaration of function
+ 'get_nic_selection_mode_12g' in lib/ipmi_delloem.c
+- Fix implicit declaration of function 'ipmi_get_oem' in
+ src/plugins/imb/imb.c
+- Fix implicit declaration of function 'ipmi_get_oem' in
+ src/plugins/lanplus/lanplus.c
+- Fix implicit declaration of function 'ipmi_get_oem' in
+ src/plugins/open/open.c
+- Fix implicit declarations of functions 'HpmfwupgPreUpgradeCheck'
+ and 'ipmi_intf_get_max_request_data_size' in lib/ipmi_hpmfwupg.c
+- Fix implicit declarations of functions
+ 'ipmi_intf_set_max_request_data_size' and
+ 'ipmi_intf_set_max_response_data_size' in lib/hpm2.c
+- Fix implicit function declaration of
+ ipmi_intf_get_max_response_data_size in lib/ipmi_sdr.c
+- Fix several implicit declarations of functions in
+ lib/ipmi_main.c
+- Fix several implicit function declarations in lib/ipmi_fru.c
+- Fix warning: suggest parentheses around '+' inside '<<'
+ in lib/ipmi_main.c
+- Fix warning: suggest parentheses around arithmetic in operand of
+ '|' in include/ipmitool/hpm2
+- Get rid of old INCLUDES macro, use AM_CPPFLAGS instead.
+- ID 440 - Fix 'unknown type name fd_set error.
+- ID 440 - remove obsolete headers from lib/ipmi_sunoem.c
+- ID:322 - let 'ekanalyzer frushow' run without a working
+ IPMI target
+- ID:355 - Add #include <strings.h> to lib/ipmi_sel.c
+- ID:355 - Add macros and #include and reduce number of warnings
+- ID:355 - Change CFLAG -std=c99 to -std=gnu99
+- ID:355 - Move Super Micro stuff into dedicated header file
+- ID:355 - Remove declared, but not used variables
+- ID:404 - Edit FRU information update problem
+- ID:405 - Use meaningful Generator ID for "ipmitool sel add"
+- ID:407 - Avoid assert on mismatched session ID
+- ID:409 - Fix IPv6 socket creation on Windows/Cygwin.
+- ID:410 - Disable USB interface for Windows/Cygwin by default.
+- ID:410 - Enable/disable USB interface by "auto"
+- ID:411 - Fix HPM.2 revision check for R1.1 and subsequent
+ specification revisions.
+- ID:412 - Check errors when setting a user password.
+- ID:413 - Print new line chne character when setting user
+ privilege.
+- ID:414 - ekanalyzer frushow fails to show 'Product Info'
+ correctly
+- ID:417 - Fix some typos
+- ID:418 - Fix Compiling under Mac OS X
+- ID:419 - List dummy.h in Makefile.am, so it gets included in
+ a release tarball
+- ID:421 - Fix memleak for sol output
+- ID:423 - Don't assume internal use area is present in ekanalyzer
+- ID:424 - Update dimm_spd.c with data from the latest JEDEC List
+- ID:425 - Disable USB interface for OS X/darwin
+- ID:426 - Fallback to run-time detection of PAGESIZE if
+ compile-time detection is not supported
+- ID:426 - Include sys/socket.h instead of asm/socket.h
+- ID:426 - Include wchar.h instead of defining wchar_t ourselves
+- ID:427 - Cleanup comment in ipmi_sdr_get_header()
+- ID:427 - The first two bytes of dumped raw SDR data is wrong.
+- ID:428 - Update IANA numbers / Product Name for IBM and ADLINK
+- ID:430 - Change Nokia Siemens Networks to Nokia Solutions
+ and Networks
+- ID:431 - Fix correct interpretation of led states
+- ID:437 - sel: Fix "sel time set <time>"
+- Make bootstrap script part of dist packages
+- Remove #if 0 code aka not-compiled-in
+- Remove trailing white-spaces in lib/log.c
+- git-ignore autoconf-generated files
+
+* Sun Nov 22 2015 <gilles.buloz@kontron.com> 1.8.16-1
+- Add _ipmi_get_channel_access() and _ipmi_get_channel_info()
+- Add _ipmi_get_user_access() and _ipmi_set_user_access()
+- Add _ipmi_get_user_name()
+- Add _ipmi_set_channel_access() function
+- Add _ipmi_set_user_password() function
+- Add limits check in get_cmdline_macaddr()
+- Change expression in ipmi_pef_get_info() in order to silence Coverity
+- Change expression in ipmi_pef_list_policies() in order to silence Coverity
+- Code cleanup in ipmi_user_main()
+- Create ask_password() and re-use code
+- Delete dead code from ipmi_sunoem_echo() - CID#1261338
+- Don't output pidfile before parsing command line arguments
+- Don't use tmp variable since it's not necessary in ipmi_user_test()
+- Fix 'user help' output
+- Fix Assign instead of compare in KfwumGetDeviceInfo() - CID#1149034
+- Fix Identical code for different branches in ipmi_tsol_main() -
+ CID#1261346
+- Fix big parameter passed by value in ipmi_sel_oem_match() - CID#1261347
+- Fix dead code in ipmi_firewall_reset() - CID#1261342
+- Fix eval logic in ipmi_user_priv()
+- Fix file descriptor leak in ipmi_exec_main() - CID#1149040
+- Fix identical code for diff branches in DellOEM - CID#1261326
+- Fix memory leak in get_supermicro_evt_desc()
+- Fix memory leak in ipmi_ek_display_board_info_area() - CID#1149051
+- Fix missing return in ipmi_kontronoem_main() - CID#1261317
+- Fix of previous commit - memset() expects pointer
+- Fix out-of-bound-reads in get_supermicro_evt_desc()
+- Fix resource leak in fru_area_print_board() - CDI#1149048
+- Fix resource leak in fru_area_print_chassis() - CID#1149047
+- Fix resource leak in fru_area_print_product() - CID#1149046
+- Fix resource leak in ipmi_kontron_set_serial_number() - CID#1149041
+- Fix typo vlan->VLAN in ipmi_lan_set_vlan_id() and
+ ipmi_lan_set_vlan_priority()
+- Fix uninitialized struct in ipmi_fru_upg_ekeying() - CID#1149065
+- Fix user input validation in Channel and User sub-commands
+- Fix wrong size argument in ipmi_sdr_list_cache_fromfile() - CID#1149056
+- Fix/remove pointer cast in _ipmi_set_user_access()
+- Hook functions in ipmi_user to _ipmi_set_user_password()
+- Hook ipmi_get_channel_info() to _ipmi_get_*()
+- Hook ipmi_get_channel_medium() to new _ipmi_get_*() functions
+- Hook ipmi_lan_set_password() to _ipmi_set_user_password()
+- Hook ipmi_print_user_list() and friends to _ipmi_* functions
+- Hook ipmi_set_alert_enable() to _ipmi_*()
+- Hook ipmi_set_user_access() to _ipmi_set_user_access()
+- Hook ipmi_user_priv() to _ipmi_set_user_access()
+- ID:307 - Intel I82751 super pass through mode fixup
+- ID:355 - Fix compiler warnings for Dummy Interface
+- ID:380 - raw commands override retry and timeout values
+- ID:319 - Interface safe re-open
+- ID:320 - Add VITA 46.11 support
+- ID:333 - Set read timeout to 15s in OpenIPMI interface
+- ID:336 - ipmitool does not fall back to IPv4 for IPMI v2 / RMCP+ sessions
+- ID:343 - Print actual sensor thresholds in 'sensors' comand
+- ID:343 - Remove AC_FUNC_MALLOC
+- ID:344 - Fix HPM.2 long message support
+- ID:345 - Do not do several close session retries when catching SIGINT
+- ID:346 - lib/ipmi_sdradd.c ipmi_sdr_read_record has a file descriptor leak
+- ID:347 - Incorrect reserved channel number
+- ID:348 - Add support for the "System Firmware Version"
+- ID:349 - user set password - add option to choose 16/20 byte password
+- ID:354 - Replace obsolete u_int with uint32_t in dimm_spd.c
+- ID:354 - Replace obsolete u_int[0-9]+_t with standardized types in Free
+ iface
+- ID:354 - forcefully switch to C99 and more strict CFLAGS
+- ID:354 - replace/drop caddr_t in IMB
+- ID:354 - struct member h_addr has been replaced
+- ID:354 - uint8_t >= 0 is always true, don't test it
+- ID:355 - Fix Enumeration value not handled in ipmi_get_event_desc()
+- ID:355 - Fix ``ISO C forbids omitting the middle term of a ?: expression''
+- ID:355 - Fix ``obsolete use of designated initializer with ¿:¿'' warning
+- ID:355 - Fix comparison of unsigned expression
+- ID:355 - Fix compiler warnings
+- ID:355 - Fix compiler warnings in dimm_spd.c
+- ID:355 - Fix couple compiler warnings in ipmi_lanp.h
+- ID:355 - Fix formatting warning in get_cmdline_ipaddr()
+- ID:355 - Fix zero-length format string warning in
+ get_supermicro_evt_desc()
+- ID:355 - Remove defined but unused variable in _set_command_enables()
+- ID:355 - remove unused variables from ipmi_dcmi.c
+- ID:357 - out-of-bound access in DDR4 code ID:356 - DIMM4 Die Count is
+ unreachable
+- ID:357 - out-of-bound access in DDR4 code
+- ID:358 - check data length in else branch of ipmi_spd_print()
+- ID:361 - Add a OEM IANA information
+- ID:363 - Node Manager feature patch.
+- ID:363 - fix Coverity issues in NM implementation
+- ID:364 - Fix for serial-basic interface bridging
+- ID:365 - Fix for ipmitool crash when using serial-terminal interface
+- ID:366 - Properly clean LAN and LAN+ interfaces on close
+- ID:367 - Fix building of non-bridged LAN interface commands
+- ID:368 - Fix handling of bridging-related parameters
+- ID:369 - Fix lanplus interface bridging and response matching
+- ID:370 - add anonymous union support in CFLAGS for older gcc
+- ID:371 - add ericsson oem
+- ID:373 - Fix compilation of IMB on Windows
+- ID:374 - Check/set LED Duration correctly
+- ID:376 - Add means to configure "Bad Password Threshold"
+- ID:381 - Script to log installation status as SEL events
+- ID:382 - Fix memcpy() params in HpmFwupgActionUploadFirmware()
+- ID:383 - Fix compile-time error in src/plugins/lan/lan.c
+- ID:384 - Fix compilation under cygwin64
+- ID:388 - Fix Error message always printed if BMC does not support VITA
+- ID:388 - Handle ccode 0xCC as well in VITA discovery
+- ID:388 - Turn all messages into LOG_INFO in VITA discovery
+- ID:389 - Add on of Advantech IANA number
+- ID:390 - Support for new Communication Interface (USB Medium)
+- ID:391 - changing data_len from 17 to 16 according to ipmi spec 22.29,
+ first byte is completion code
+- ID:392 - _ipmi_get_user_name() work-around for some BMCs
+- ID:393 - ipmitool man page addition for Node Manager support.
+- ID:394 - close fp if isn't NULL and set it NULL afterwards in USB plugin
+- ID:394 - plugins/usb: Fix probe for SCSI devices
+- ID:395 - Fix fru string without resizing it
+- ID:396 - Fixed invalid length check in picmg led cap command.
+- ID:397 - Fixed picmg policy set command.
+- ID:398 - Fixed channel setaccess command.
+- ID:399 - Fixed channel getciphers command.
+- ID:401 - Fixed 30 second delay when activating SOL on 'dumb' Intel MACs.
+- ID:402 - Misguiding error print-out when using some 'lan' commands.
+- Init user_access_t struct in ipmi_user_priv()
+- Make user User Privilege Limit is within range
+- Node Manager Feature, correct 1268194 missing break.
+- Output pidfile only in verbose mode
+- Print error message to STDERR in ipmi_channel.c
+- Re-work 'channel getaccess' and 'channel setaccess'
+- Re-work ccode eval in ipmi_get_channel_medium()
+- Remove commented-out code in ipmi_picmg_clk_set() - CID#1261339
+- Remove dead code - rsp can't be NULL at this point - CID#1149005
+- Remove dead code in fru_area_print_board() - CID#1149001
+- Remove dead code in fru_area_print_chassis() - CID#1149000
+- Remove dead code in fru_area_print_product() - CID#1148999
+- Remove dead(duplicate) code from ipmi_sol_main() - CID#1148996
+- Remove get_channel_access_rsp and get_channel_info_rsp structs
+- Remove ipmi_user_set_password()
+- Remove length checks in get_supermicro_evt_desc()
+- Remove redundant user-input conversion from ipmi_sel_delete()
+- Remove trailing white-spaces in ipmi_user.c
+- Remove trailing white-spaces in ipmi_user.c
+- Remove trailing white-spaces in src/plugins/dummy/dummy.c
+- Remove unused variable from ipmi_get_channel_cipher_suites()
+- Replace deprecated bzero() with memset()
+- Replace s6_addr16 with s6_addr since Mac OS X does not have it
+- Rewrite ipmi_set_channel_access()
+- Split ipmi_user_main() into smaller functions
+- ipmi_print_user_summary() to utilize _ipmi_get_user_access()
+- ipmitool delloem: ipmitool delloem extension always return success - fix
+ it
+
+* Mon Nov 24 2014 <gilles.buloz@kontron.com> 1.8.15-1
+- ID: 340 - ipmitool sol session improperly closes on packet retry
+- ID: 277 - support for hostnames longer than 64 chars
+- ID: 313 - ipmitool doesn't support hostname long than 64 symbols
+- ID: 277 - Minor issue with ipmi_intf_session_set_hostname()
+- ID: 247 - 'sensor thresh' help output is wrong
+- ID: 324 - conflicting declaration write_fru_area()
+- ID: 337 - Add support for 13G Dell PowerEdge
+- ID: 325 - DDR4 DIMM Decoding Logic
+- ID: 328 - HPM.2 fixes
+- ID: 329 - hpm.1 upgrade fixes
+- ID: 103 - picmg discover messages should be DEBUG, not INFO
+- ID: 331 - Passwords provided in file (-f option) truncated on space
+- ID: 318 - ipmi_tsol.c: fix buffer overflow
+- ID: 306 - "fru print" command prints the FRU #0 twice
+- ID: 305 - HPM.1 deferred activation support fixup
+- ID: 317 - ipmi_fwum.c: fix typo
+- ID: 315 - buildsystem: configure.in is deprecated
+- ID: 316 - Directory debian is outdated
+- ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
+- ID: 46 - SEL OEM record corner case
+
+* Mon May 5 2014 <gilles.buloz@kontron.com> 1.8.14-1
+- ID: 299 - openipmi plugin writes zero to wrong byte
+- ID: 301 - Add OS/Hypervisor installation status events
+- ID: 298 - fix LANplus retry
+- ID: 295 - inform user if SOL session disconnected
+- ID: 297 - don't print-out SEL entry if ID not present
+- ID: 296 - Fix PSD size decoding
+- ID: 293 - Use of uninitialized variable in ipmi_main()
+- ID: 278 - Error in sol looptest
+- ID: 290 - ipmi_sol.c needs a clean-up
+- ID: 85 - Supermicro memory ECC error display
+- ID: 290 - ipmi_sol.c needs a clean-up
+- ID: 286 - Open session retries hit assert in ipmi_lanplus_send_payload
+- ID: 285 - Fix SEGV in ipmi_lanplus_open_session
+- ID: 284 - Fix SEGV in ipmi_main
+- ID: 283 - ipmi_intf_socket_connect fails with IPv4 hosts
+- ID: 46 - ipmi_fwum needs some re-work
+- ID: 50 - ipmi_hpmfwupg needs a clean up
+- ID: 279 - ipmitool sdr list broken
+- ID: 44 - dummy interface support - fake-ipmistack project
+- ID: 48 - Remove hard-coded FRU inventory access length restriction
+- ID: 276 - HPM.1 upgrade combined patch
+- ID: 90 - Add options to chassis bootparam set bootflag
+- ID: 292 -Properly handle plugin non-zero target adddress with -t
+- Numerous Fixes based on running Coverity
+- Use TIOCFLUSH if TCFLSH is missing to get the serial plugin building on
+ Hurd.
+- Disable imb and open plugins by default on Hurd. The platform lack
+ the required kernel support.
+- Change serial plugin to only try to disable the IUCLC serial line flag on
+ platforms supporting it. Fixes build problem on Hurd and FreeBSD.
+- PA: 83 - Revised IPv6 patch
+- FR: 24 - Exchange OS Name Hostname BMC URL during startup
+- ID: 304 - Incorect byteswap in SOL maximum payload
+- ID: 303 - Fix build error in HPM.2 code
+- ID: 300 - new sunoem functionality
+- ID: 144 - Fix 'dcmi power set_limit action <value>'
+- ID: 302 - HPM.2 long message support
+- ID: 309 - Add new SEL entries for ipmi 2.0 rev 1.1
+- ID: 280 - man page cleanup
+- ID: 311 - man page update for new sunoem commands
+
+* Mon Sep 9 2013 <gilles.buloz@kontron.com> 1.8.13-1
+- ID: 3611905 - Direct Serial Basic/Terminal Mode Interface drivers
+- ID: 3577766 - configure's knobs and switches don't work
+- ID: 3611253 - do not override OS-default values for interfaces
+- ID: 65 - Fixes for configure.in for cross compilation
+- ID: 3571153 - OpenIPMI/ipmievd fails to compile on Solaris
+- numerous ipmitool man page updates
+- ID: 3611226 - Bridging support for PICMG Platforms
+- Add support for getsysinfo/setsysinfo commands to ipmi mc
+- Cleanup Dell OEM code to use new sysinfo interface
+- ID: 93 - str-to-int conversion is weak
+- ID: 3582307 - ipmi_fru - ipmi_fru_main() return codes
+- ID: 3582310 - ipmi_fru - ipmi_fru_main() - misuse of printf()
+- ID: 3576213 - ipmi_fru - unused variable
+- ID: 3578276 - ipmi_fru - free() on freed memory possible
+- ID: 3578275 - ipmi_fru - memory leaks
+- ID: 3528271 - ipmi_fru - possible *flow via FRUID
+- ID: 3578277 - ipmi_fru - possible NULL pointer
+- ID: 3612372 - Recognize Broadcom IANA number and BCM5725 product
+- ID: 3608758 - add IPMI_NETFN_OEM
+- ID: 143 - Reversed 'channel authcap' capabilities
+ Fixes reversed IPMIv1.5/2.0 'channel authcap' capabilities
+- ID: 3587318 - "dcmi discover" is not DCMI 1.5 compatible
+- ID: 3608757 - ipmi_fru - various fixes
+- ID: 3598203 - 'mc getsysinfo|setsysinfo' needs a bit of re-work
+- ID: 3597782 - ipmi_mc - sysinfo_param() has two consecutive returns
+- ID: 3597781 - 'mc getsysinfo|setsysinfo' help has typos
+- ID: 3608763 - ipmi_sdr - code cleanup & output display cleanup
+- ID: 3610286 - ipmi_sdr - ipmi_sdr_print_type - incorrect eval
+- ID: 3600930 - ipmi_sdr - code cleanup
+- ID: 3602439 - ipmi_sdr - memory leaks
+- ID: 3595199 - ipmi_sdr - Add support for 'ipmitool sdr <list|elist> help'
+- ID: 3592773 - 'ipmitool sdr info'; prints incorrect info
+- ID: 3592770 - 'ipmitool sdr list|elist INV_INPUT' return code
+- ID: 3577159 - ipmi_sdr - uint32_t cast to uint8_t and back
+- ID: 3528368 - ipmi_sdr - possible int *flow
+- ID: 226 - ipmi_sdradd - typo
+- ID: 258 - ipmi_sdradd - error printed on STDOUT
+- Fixed ipmievd start under systemd.
+- ID: 3608760 - Add bswap.h to ipmi_chassis.c and ipmi_pef.c
+- ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures
+- ID: 3600907 - defined value for "Chassis may not support Force Identify"
+- ID: 256 - ipmitool could crash when IPv6 address is returned
+- ID: 211 - 'lib/ipmi_dcmi.c' - typo & error printed on STDOUT
+- ID: 3612237 - If DCMI command fails, incorrect completion code is printed
+- ID: 3608149 - ipmitool - set pointer to NULL after free()
+- ID: 3603419 - DCMI - waste of resources
+- ID: 3600908 - DMCI - crash in ipmi_print_sensor_info(), NULL ref
+- ID: 3609985 - delloem : Wrong MAC returned when flex addressing is enabled
+- ID: 113 - delloem exec file won't handle more than one command
+- ID: 28 - delloem - clean up the code
+- ID: 3608261 - delloem - code formatting
+- ID: 3528247 - delloem - fix possible *int flows
+- ID: 3600910 - delloem - code cleanup
+- ID: 3576211 - delloem - unused variable
+- ID: 3578022 - delloem - fix typos
+- ID: 263 - ipmi_ek* - cleanup
+- ID: 3308765 - ipmi_ek* - cleanup
+- ID: 3586228 - ipmi_ek* - ipmi_ekanalyzer_usage() rework
+- ID: 3528388 - ipmi_ek* - a typo in error message
+- ID: 3576212 - ipmi_event - better rsp handling
+- ID: 3607393 - ipmi_event - redundant '\n' in error message
+- ID: 153 - ipmi_firewall - printf() used instead of lprintf()
+- ID: 3608003 - ipmi_fru - atol() should be replaced with str2*()
+- ID: 3600911 - ipmi_fru - fix multiple increments in args to printf
+- ID: 3600914 - no more crash on no response. allow more send/recv loops of waiting.
+- ID: 70 - Fixes and updates for ipmitool hpm
+- ID: 3528308 - ipmi_hpmfwupg - possible int *flow
+- ID: 3608762 - ipmi_hpmfwup - Fixed help messages for hpm command
+- ID: 3607981 - ipmi_lanp - replace atoi() calls
+- ID: 3607320 - ipmi_lanp - possible NULL reference
+- ID: 3600926 - ipmi_lanp - code cleanup
+- ID: 3613575 - memory leak - ipmi_password_file_read()
+- ID: 3522740 - reading password from file is limited to 16byte passwords
+- ID: 3613605 - ipmi_main - call free() on pointer to static data
+- ID: 3608761 - ipmi_main - PICMG Get Device Locator was never run
+- ID: 3577155 - ipmi_main' - memory leaks
+- ID: 239 - typo in 'mc selftest', add details
+- ID: 3597471 - ipmi_mc - needs a bit of re-work - rc, inv. options
+- ID: 3597468 - ipmi_mc - print_mc_usage() prints to STDOUT
+- ID: 3597469 - 'mc watchdog off' prints on STDERR, should be STDOUT
+- ID: 3597470 - 'mc watchdog reset' prints on STDERR, should be STDOUT
+- ID: 3611254 - OEM handle for Intel 82751 in SPT mode
+- ID: 3600927 - change eval order of input param in ipmi_oem_setup()
+- ID: 3600928 - ipmi_pef - code cleanup
+- ID: 3592732 - ipmi_picmg.c - printf() misuse
+- ID: 3528310 - ipmi_picmg.c - NULL reference
+- ID: 3528347 - ipmi_raw.c - possible int *flow
+- ID: 3587913 - Command % ipmitool raw help; returns 1
+- Added code to support sensors on other luns (On behalf of Kontron Germany)
+- ID: 3611912 - Add missing newlines when cvs output is specified
+- ID: 244 - ipmi_sel - "0.0" displayed for unspecified threshold values
+- ID: 3612371 - Typo in impi_sel debug output
+- ID: 3016359 - ipmi_sel - Get SEL Alloc Information is incorrect
+- ID: 3568976 - 'sel set time' behaviour is inconsistent
+- ID: 3528371 - ipmi_sensor - possible int *flow
+- ID: 3601265 - 'ipmitool sensor get' leaks memory
+- ID: 3601106 - 'ipmitool sensor get NACname' output incorrect/inconsistent
+- ID: 3608007 - ipmi_session - typo in error message
+- ID: 101 - ipmi_sol - possible int *flow
+- ID: 3600933 - ipmi_sol - use of deprecated bzero()
+- ID: 3609472 - ipmi_sol - Add the instance to the SOL commands
+- ID: 3588726 - 'ipmitool sol payload status ...;'segfaults on no rsp
+- ID: 3522731 - ipmi_sol - ipmi_get_sol_info() returns always 0
+- ID: 3613042 - add missing Entity IDs
+- ID: 3611306 - ipmi_tsol - fix always fail in case of error
+- ID: 259 - ipmi_user - memory leak
+- ID: 260 - ipmi_user - replace atoi() call
+- ID: 2871903 - ipmitool user priv incorrectly sets Link Auth
+- ID: 3600960 - check the copy of password exists
+- ID: 3609473 - Add assertion/deassertion to threshold events
+- ID: 104 - ipmishell - possible int *flow
+- ID: 262 - 'set' segfaults when no IPMI inf present
+- ID: 257 ipmitool exec segfaults if invalid input given
+- ID: 254 - Fix retry of authentication capabilities retrieval
+- ID: 3611303 - lan - error check is missing braces
+- ID: 253 - Fix lanplus retransmission
+- ID: 212 - 'lib/ipmi_dcmi.c' - possible int *flow
+- ID: 264 - incorrect array index in get_lan_param_select()
+- ID: 269 - Fixes for configure.in for cross compilation
+- ID: 267 - Corruption in "lan alert print" output
+- ID: 41 - ipmi_sel_interpret() - clean up formatting, indentation
+- ID: 242 - Incorrect DCMI Power Reading "IPMI timestamp" interpretation
+- ID: 229 - 'lib/ipmi_ekanalyzer.c' - a typo ``Too few argument!''
+- ID: 266 - file descriptor leak in ipmi_fwum and ipmi_ekanalyzer
+- ID: 99 - 'lib/ipmi_sel.c' - possible int *flow
+- ID: 222 - 'lib/ipmi_sdr.c' - a typo 'Not Reading' -> 'No Reading'
+- ID: 35 - Script to setup redirection of SNMP to/from BMC
+- ID: 273 - Reduce SOL Input buffer size by SOL header size
+
+
+* Thu Aug 9 2012 <gilles.buloz@kontron.com> 1.8.12-1
+- Added IPMB dual bridge support (no need for driver support)
+- Enable compiler warnings and resolve all compiler warning so that
+ ipmitool compiles and links with no warning or error messages
+- add ipmishell line to configure
+- fail configure when no curses or readline is found
+- support sensor bridging in free interface
+- applied fix for issue #2865160 (AIX build)
+- Document the ipmitool dcmi commands in the ipmitool man page
+- Document that some commands are blocked by OpenIPMI. ID 2962306
+- Document the -N and -R options per tracker ID 3489643
+- fix manpage misdocumentation on cipher suite privilige configuration
+- Add build support for Dell OEM commands
+- Add new Dell OEM commands and update man page
+- added hpm and fwum in man page
+- man page update for fwum and hpm commands
+- Added documentation for 'ime' operating mode, used to update Intel ME.
+- add new -Y option to prompt user to enter kgkey
+- Add DCMI module (Data Center Management Interface)
+- fixed oem/iana data type to allow 24 bits definition
+- Fixed AMC point-to-point record parsing in FRU
+- Fixed detection of packing support in GCC
+- Added packing support detection magic on all packed structures
+ in project
+- Dell specific mac sub command is updated to support the latest 12G
+ Dell servers. Support for virtual mac is also implemented.
+- Use consistent netfn/cmd for getsysinfo command
+- Add Dell OEM network commands
+- Resolve incorect Board Mfg Data due to incorrect date constant
+- Update ipmi_fru.h to SMBIOS spec 2.6.1 - ID 2916398
+- Support for analog readings in discrete sensors on HP platforms.
+- Change device id mask (IPM_DEV_DEVICE_ID_REV_MASK) 0x07 for 0x0F.
+ As per in IPMI spec V2:
+- Added PICMG clock e-keying and bused resource control identifiers
+- Added PICMG major version (ATCA/AMC/uTCA) identifiers
+- Correct Threshold/Discrete Sensor Display - Patch Tracker ID 3508759
+- Sensor units now handle percentage units - ID 3014014
+- Fixes ID 3421347 Sensor list command should use channel field from SDR
+- Added packing directive for ARM cross compile with GCC 3.4.5,
+ otherwise the sdr structures gets padded and the pointer cast
+ result in incorrect alignement
+- Added 'sdr fill sensors nosats' support to speed up SDR discovery
+- Added SDR name display during discovery (with -v)
+- Added support for sensor types - Processor related sensor
+ type 0x07, system incharectorization 0x20, Memory sensor type.
+- Give more description for SEL which is generated for Uncorrectable
+ ECC and errors with respect to each Memory Bank,Card or DIMM.
+ The Sensor type supporting this are 0x0C and 0x10.
+- Add more details about Version Change event (source of
+ firmware update)
+- enhanced PICMG fru control
+- Integrated Andy Wray's DDR3 SPD parser patch
+- Adds function str2uint() to convert from string to uint32_t with
+ checks for valid input.
+- Fix possible buffer overflow in buf2str()
+- Fixes ID 3485004 - misuse of strtol()
+- Replaces calls to strtol() with str2uchar() calls and adds error
+ messages if invalid input is given.
+- Don't overwite the iflags bits prior to setting the boot parameters.
+ This fixes ipmitool so that
+ chassis bootdev bios clear-cmos=yes
+ will correctly clear the bios cmos.
+- Clarify DCMI get limit activation (add if activate or not).
+- Bug fixes for delloem lan command. This includes the support for 12G
+ Dell license and 12G LAN Specific command.
+- delloem commands should not be executed before parsing command line.
+- Fix stack overflow in delloem setled
+- Fix delloem powermonitor on big-endian platforms.
+- ipmitool delloem powermonitor command should convert data from
+ network-format to the native one, otherwise it shows garbage
+ on ppc/ppc64 platform.
+- Add ipmi_getsysinfo command
+- Add support for drive backplane SetLED functionality
+- Fix for Platform Event Message incorrect Generator ID
+- Fix fru print so that it will display FRU info from satellite
+ controllers.
+- Add support for AMC type 17h record.
+- Fix in fru edit. It is now possible to edit field 0 of sections
+- New FRU get OEM record command
+- fixed segfault for fru edit when "field id" is not supported and
+ added user feedback for string substitution(success or failure)
+- Improvement to hpm upgrade during activation. This resolves issue
+ where activation seems to have failed because ipmitool received
+ an unsupported completion code.
+- hpm Fixes for multi-platform support.
+- hpm Fix for timeouts during firmware rollback. If completion code
+ is C3, wait till timeout has expired before reporting it.
+- hpm During manual rollback, code now gets target capabilities
+ instead of using a default timeout of 60 seconds.
+- Added firmware auxilliary bytes to hpm outputs
+- hpm Add support for BIG Buffer (Use when -z option is used)
+- Fix the case where ipmitool loses the iol connection during the upload
+ block process. Once IPMITool was successfully sent the first
+ byte, IPMITool will not resize the block size.
+- Fix the problem when we try to upgrade specific component and the
+ component is already updated,
+- updated HPM firmware agent to version 1.04
+- Fix exit code to return zero on '-o list' or '-o help' option
+- limit length of user name and password that can be supplied by user.
+ Password is limited to 16 bytes, resp. 20 bytes, for LAN, resp.
+ LAN+, interface. User name is limited to 16 bytes, no interface
+ limitations. ID 3184687, ID 3001519
+- Add retry / timeout options for LAN
+- Changed default cipher suite to 1 instead of 3 for iol20
+- added fix for tracker ID 2849300 "Incorrect Firmware Revision"
+- avoid reopening the interface when already opened
+- Remove message for unsupported PEF capabilities that return valid
+ CC (80h)
+- Added OEM byte (47) to verbose output
+- Add option to provide a list when filling sdr repository
+- SDR discovery speedups
+- Added support for Dell specific sensors
+- Fix segmentation fault on unrecognize OEM events.
+- changed SEL timestamp formatting for 'preinit' SEL entries, allowing
+ the number of seconds to be displayed.
+- Added sensor raw data in verbose mode. Useful for OEM sensor type.
+- Add sensor hysteresis (positive & negative) to the following command
+ ipmitool sensor -v
+- Fixes bug ID 3484936 - missing user input validation
+- Add missing RMCP+ auth type strings
+- Add new Kontron Product in ipmi_strings for product ID. Kontron
+ KTC5520/EATX Server Motherboard with integrated iBMC/KVM/VM
+ added identification support for Kontron AT8050 ATCA board
+- Constrain setting of the username to no greater than 16 characters
+ per the IPMI specification. ID 3001519
+- Constrain User ID between 1 and 63. ID 3519225
+- Fixes ID 3485340 - user input not handled in 'lib/ipmi_user.c'
+- Fixes ignorance of existing daemon PID file which results in PID being
+ overwritten. Adds proper umask() before writing PID file.
+- applied fix for ID 2865111 (AIX build)
+- Fix a proplem when using bridged IPMI commands on the lanplus
+ interface (-I lanplus with -b -t or -m switches) resulting in
+ "Close Session command failure".
+- Add fix with usage of CFh (duplicate request). Usefull for
+ slow commands
+- Fix issue with sequence number. (Speed up transfer)
+
* Wed Feb 25 2009 <pere@hungry.com> 1.8.11-1
- Fix new GCC compilation issues in regards to Packing
- Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
@@ -257,7 +881,7 @@ fi
- Make ipmievd generate pidfile
- Add initscripts for ipmievd
-* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
+* Tue Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
- Fix memory corruption when sending encrypted SOL traffic
- Add keepalive timer to IPMIv2 SOL sessions
@@ -325,7 +949,7 @@ fi
- new "shell" and "exec" commands
- lots of other contributed patches
-* Sat May 27 2004 <duncan@iceblink.org> 1.5.9-1
+* Thu May 27 2004 <duncan@iceblink.org> 1.5.9-1
- Add ability to get a particular sensor by name
- Add ability to set a particular sensor threshold
- Add support for displaying V2 channel authentication levels
@@ -359,7 +983,7 @@ fi
- Fix SEL event decoding for generic events
- Handle empty SEL gracefully when doing "sel list"
- Fix sdr handling of sensors that do not return a reading
- - Fix for CSV display of sensor readings/units from Fredrik Öhrn
+ - Fix for CSV display of sensor readings/units from Fredrik Öhrn
* Tue Nov 25 2003 <duncan@iceblink.org> 1.5.5-1
- Add -U option for setting LAN username
diff --git a/control/rpmmacros.in b/control/rpmmacros.in
deleted file mode 100644
index 429e098..0000000
--- a/control/rpmmacros.in
+++ /dev/null
@@ -1,12 +0,0 @@
-%_topdir %(echo $BUILDDIR)
-%_sourcedir %{_topdir}/..
-%_specdir %{_sourcedir}
-%_tmppath %{_topdir}/tmp
-%_builddir %{_topdir}/BUILD
-%_buildroot %{_topdir}/%{_tmppath}/%{name}-%{version}-root
-%_rpmdir %{_topdir}/RPMS
-%_srcrpmdir %{_topdir}/SRPMS
-%_distro @DISTRO@
-%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
-%packager jmank@hp.com
-%distribution Sourceforge Build
diff --git a/control/rpmrc b/control/rpmrc
deleted file mode 100644
index 0a99ecb..0000000
--- a/control/rpmrc
+++ /dev/null
@@ -1,8 +0,0 @@
-macrofiles: /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros:/etc/rpm/%{_target}/macros:%(echo $CONFIGDIR)/rpmmacros
-
-buildarchtranslate: athlon: i386
-buildarchtranslate: i686: i386
-buildarchtranslate: i586: i386
-buildarchtranslate: i486: i386
-buildarchtranslate: i386: i386
-
diff --git a/csv-revision b/csv-revision
new file mode 100755
index 0000000..289c133
--- /dev/null
+++ b/csv-revision
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+git describe --first-parent --tags 2>/dev/null | (
+ IFS=- read tag rev hash
+ if [ $? ] && [ -n "$rev" ]; then
+ echo .$rev.$hash
+ elif [ -d .git ]; then
+ echo .0.gsnapshot
+ fi
+)
diff --git a/depcomp b/depcomp
deleted file mode 100755
index 4ebd5b3..0000000
--- a/depcomp
+++ /dev/null
@@ -1,791 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2013-05-30.07; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by 'PROGRAMS ARGS'.
- object Object file output by 'PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputting dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-# Get the directory component of the given path, and save it in the
-# global variables '$dir'. Note that this directory component will
-# be either empty or ending with a '/' character. This is deliberate.
-set_dir_from ()
-{
- case $1 in
- */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
- *) dir=;;
- esac
-}
-
-# Get the suffix-stripped basename of the given path, and save it the
-# global variable '$base'.
-set_base_from ()
-{
- base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
-}
-
-# If no dependency file was actually created by the compiler invocation,
-# we still have to create a dummy depfile, to avoid errors with the
-# Makefile "include basename.Plo" scheme.
-make_dummy_depfile ()
-{
- echo "#dummy" > "$depfile"
-}
-
-# Factor out some common post-processing of the generated depfile.
-# Requires the auxiliary global variable '$tmpdepfile' to be set.
-aix_post_process_depfile ()
-{
- # If the compiler actually managed to produce a dependency file,
- # post-process it.
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependency.h'.
- # Do two passes, one to just change these to
- # $object: dependency.h
- # and one to simply output
- # dependency.h:
- # which is needed to avoid the deleted-header problem.
- { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
- } > "$depfile"
- rm -f "$tmpdepfile"
- else
- make_dummy_depfile
- fi
-}
-
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
-# Character ranges might be problematic outside the C locale.
-# These definitions help.
-upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
-lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
-alpha=${upper}${lower}
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Avoid interferences from the environment.
-gccflag= dashmflag=
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
-fi
-
-if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
-fi
-
-if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
-## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
-## (see the conditional assignment to $gccflag above).
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say). Also, it might not be
-## supported by the other compilers which use the 'gcc' depmode.
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The second -e expression handles DOS-style file names with drive
- # letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the "deleted header file" problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
-## Some versions of gcc put a space before the ':'. On the theory
-## that the space means something, we add a space to the output as
-## well. hp depmode also adds that space, but also prefixes the VPATH
-## to the object. Take care to not repeat it in the output.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like '#:fec' to the end of the
- # dependency line.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
- | tr "$nl" ' ' >> "$depfile"
- echo >> "$depfile"
- # The second pass generates a dummy entry for each header file.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile"
- ;;
-
-xlc)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts '$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
- "$@" -Wc,-M
- else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
- "$@" -M
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- aix_post_process_depfile
- ;;
-
-tcc)
- # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
- # FIXME: That version still under development at the moment of writing.
- # Make that this statement remains true also for stable, released
- # versions.
- # It will wrap lines (doesn't matter whether long or short) with a
- # trailing '\', as in:
- #
- # foo.o : \
- # foo.c \
- # foo.h \
- #
- # It will put a trailing '\' even on the last line, and will use leading
- # spaces rather than leading tabs (at least since its commit 0394caf7
- # "Emit spaces for -MD").
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
- # We have to change lines of the first kind to '$object: \'.
- sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
- # And for each line of the second kind, we have to emit a 'dep.h:'
- # dummy dependency, to avoid the deleted-header problem.
- sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-## The order of this option in the case statement is important, since the
-## shell code in configure will try each of these formats in the order
-## listed in this file. A plain '-MD' option would be understood by many
-## compilers, so we must ensure this comes after the gcc and icc options.
-pgcc)
- # Portland's C compiler understands '-MD'.
- # Will always output deps to 'file.d' where file is the root name of the
- # source file under compilation, even if file resides in a subdirectory.
- # The object file name does not affect the name of the '.d' file.
- # pgcc 10.2 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\' :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
- set_dir_from "$object"
- # Use the source, not the object, to determine the base name, since
- # that's sadly what pgcc will do too.
- set_base_from "$source"
- tmpdepfile=$base.d
-
- # For projects that build the same source file twice into different object
- # files, the pgcc approach of using the *source* file root name can cause
- # problems in parallel builds. Use a locking strategy to avoid stomping on
- # the same $tmpdepfile.
- lockdir=$base.d-lock
- trap "
- echo '$0: caught signal, cleaning up...' >&2
- rmdir '$lockdir'
- exit 1
- " 1 2 13 15
- numtries=100
- i=$numtries
- while test $i -gt 0; do
- # mkdir is a portable test-and-set.
- if mkdir "$lockdir" 2>/dev/null; then
- # This process acquired the lock.
- "$@" -MD
- stat=$?
- # Release the lock.
- rmdir "$lockdir"
- break
- else
- # If the lock is being held by a different process, wait
- # until the winning process is done or we timeout.
- while test -d "$lockdir" && test $i -gt 0; do
- sleep 1
- i=`expr $i - 1`
- done
- fi
- i=`expr $i - 1`
- done
- trap - 1 2 13 15
- if test $i -le 0; then
- echo "$0: failed to acquire lock after $numtries attempts" >&2
- echo "$0: check lockdir '$lockdir'" >&2
- exit 1
- fi
-
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add 'dependent.h:' lines.
- sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in 'foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- set_dir_from "$object"
- set_base_from "$object"
-
- if test "$libtool" = yes; then
- # Libtool generates 2 separate objects for the 2 libraries. These
- # two compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir$base.o.d # libtool 1.5
- tmpdepfile2=$dir.libs/$base.o.d # Likewise.
- tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- # Same post-processing that is required for AIX mode.
- aix_post_process_depfile
- ;;
-
-msvc7)
- if test "$libtool" = yes; then
- showIncludes=-Wc,-showIncludes
- else
- showIncludes=-showIncludes
- fi
- "$@" $showIncludes > "$tmpdepfile"
- stat=$?
- grep -v '^Note: including file: ' "$tmpdepfile"
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The first sed program below extracts the file names and escapes
- # backslashes for cygpath. The second sed program outputs the file
- # name when reading, but also accumulates all include files in the
- # hold buffer in order to output them again at the end. This only
- # works with sed implementations that can handle large buffers.
- sed < "$tmpdepfile" -n '
-/^Note: including file: *\(.*\)/ {
- s//\1/
- s/\\/\\\\/g
- p
-}' | $cygpath_u | sort -u | sed -n '
-s/ /\\ /g
-s/\(.*\)/'"$tab"'\1 \\/p
-s/.\(.*\) \\/\1:/
-H
-$ {
- s/.*/'"$tab"'/
- G
- p
-}' >> "$depfile"
- echo >> "$depfile" # make sure the fragment doesn't end with a backslash
- rm -f "$tmpdepfile"
- ;;
-
-msvc7msys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for ':'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
- "$@" $dashmflag |
- sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this sed invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no eat=no
- for arg
- do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- if test $eat = yes; then
- eat=no
- continue
- fi
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -arch)
- eat=yes ;;
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix=`echo "$object" | sed 's/^.*\././'`
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- # makedepend may prepend the VPATH from the source file name to the object.
- # No need to regex-escape $object, excess matching of '.' is harmless.
- sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process the last invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed '1,2d' "$tmpdepfile" \
- | tr ' ' "$nl" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E \
- | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- | sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- IFS=" "
- for arg
- do
- case "$arg" in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E 2>/dev/null |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
- echo "$tab" >> "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvcmsys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/doc/Makefile.in b/doc/Makefile.in
deleted file mode 100644
index fb184ec..0000000
--- a/doc/Makefile.in
+++ /dev/null
@@ -1,611 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-man1dir = $(mandir)/man1
-am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"
-man8dir = $(mandir)/man8
-NROFF = nroff
-MANS = $(man_MANS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-man_MANS = ipmitool.1 ipmievd.8
-EXTRA_DIST = $(man_MANS)
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign doc/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-man1: $(man_MANS)
- @$(NORMAL_INSTALL)
- @list1=''; \
- list2='$(man_MANS)'; \
- test -n "$(man1dir)" \
- && test -n "`echo $$list1$$list2`" \
- || exit 0; \
- echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
- { for i in $$list1; do echo "$$i"; done; \
- if test -n "$$list2"; then \
- for i in $$list2; do echo "$$i"; done \
- | sed -n '/\.1[a-z]*$$/p'; \
- fi; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
- fi; \
- done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
- done; }
-
-uninstall-man1:
- @$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man1dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.1[a-z]*$$/p'; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-install-man8: $(man_MANS)
- @$(NORMAL_INSTALL)
- @list1=''; \
- list2='$(man_MANS)'; \
- test -n "$(man8dir)" \
- && test -n "`echo $$list1$$list2`" \
- || exit 0; \
- echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
- { for i in $$list1; do echo "$$i"; done; \
- if test -n "$$list2"; then \
- for i in $$list2; do echo "$$i"; done \
- | sed -n '/\.8[a-z]*$$/p'; \
- fi; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
- fi; \
- done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
- done; }
-
-uninstall-man8:
- @$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man8dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.8[a-z]*$$/p'; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(MANS)
-installdirs:
- for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man1 install-man8
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-man
-
-uninstall-man: uninstall-man1 uninstall-man8
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- cscopelist-am ctags-am distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-man1 install-man8 install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
- uninstall-am uninstall-man uninstall-man1 uninstall-man8
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/doc/ipmievd.8 b/doc/ipmievd.8.in
index a39dce0..6792a0d 100644
--- a/doc/ipmievd.8
+++ b/doc/ipmievd.8.in
@@ -145,7 +145,7 @@ placed at the end of commands to get option usage help.
> ipmievd help
.br
Commands:
- open Use OpenIPMI for asyncronous notification of events
+ open Use OpenIPMI for asynchronous notification of events
sel Poll SEL for notification of events
.TP
@@ -174,7 +174,7 @@ Do NOT become a daemon, instead log all messages to stderr.
.TP
\fIpidfile\fP=<\fBfilename\fR>
Save process ID to this file when in daemon mode. Defaults to
-/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
+/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
number -- defaults to 0).
.RE
@@ -197,7 +197,7 @@ Do NOT become a daemon, instead log all messages to stderr.
.TP
\fIpidfile\fP=<\fBfilename\fR>
Save process ID to this file when in daemon mode. Defaults to
-/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
+/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
number -- defaults to 0).
.TP
\fItimeout\fP=<\fBseconds\fR>
@@ -217,6 +217,16 @@ Reading Sensors...
.br
Waiting for Events...
.br
+
+.SH FILES
+.TP
+.B @IANADIR@/enterprise-numbers
+system IANA PEN registry taken from http://www.iana.org/assignments/enterprise-numbers
+.TP
+.B ~/@IANAUSERDIR@/enterprise-numbers
+user's override for the system IANA PEN registry, this file if it exists is loaded instead
+of the system registry (see above).
+
.SH "AUTHOR"
Duncan Laurie <duncan@iceblink.org>
.SH "SEE ALSO"
diff --git a/doc/ipmitool.1 b/doc/ipmitool.1.in
index 2e39fad..13ab35e 100644
--- a/doc/ipmitool.1
+++ b/doc/ipmitool.1.in
@@ -3,12 +3,13 @@
ipmitool \- utility for controlling IPMI\-enabled devices
.SH "SYNOPSIS"
-ipmitool [ <options> ] <command> [ <sub-commands and sub-options> ]
+.BR ipmitool
+[ <options> ] <command> [ <sub-commands and sub-options> ]
<options> := [ <general-options> | <conditional-opts> ]
-.br
-Any recognized option is accepted. Conditional options may be ignored or it's usage postponed until shell or exec processes relevant command.
-.br
+
+Any recognized option is accepted. Conditional options may be ignored or it's
+usage postponed until shell or exec processes relevant command.
<general\-options> := [ \-h | \-V | \-v | \-I <interface> | \-H <address> |
\-d <N> | \-p <port> | \-c | \-U <username> |
@@ -66,8 +67,9 @@ called \fIOpenIPMI\fP and it is included in standard distributions.
On Solaris this driver is called \fIBMC\fP and is included in Solaris 10.
Management of a remote station requires the IPMI\-over\-LAN interface to be
enabled and configured. Depending on the particular requirements of each
-system it may be possible to enable the LAN interface using ipmitool over
-the system interface.
+system it may be possible to enable the LAN interface using
+.BR ipmitool
+over the system interface.
.SH "OPTIONS"
.TP
\fB\-a\fR
@@ -95,9 +97,14 @@ This is not available with all commands.
.TP
\fB\-C\fR <\fIciphersuite\fP>
The remote server authentication, integrity, and encryption algorithms
-to use for IPMIv2.0 \fIlanplus\fP connections. See table 22\-19 in the
-IPMIv2.0 specification. The default is 3 which specifies RAKP\-HMAC\-SHA1
-authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128 encryption algorithms.
+to use for IPMIv2.0 \fIlanplus\fP connections. See table 22\-20 in the
+IPMI v2.0 specification. The default is 17 which specifies RAKP\-HMAC\-SHA256
+authentication, HMAC\-SHA256\-128 integrity, and AES\-CBC\-128 encryption algorithms.
+
+NOTE: In
+.BR ipmitool
+1.8.18 and earlier the default was 3, which was insecure and was not supported
+by some more recent BMC implementations.
.TP
\fB\-d \fIN\fP\fR
Use device number N to specify the /dev/ipmiN (or
@@ -212,7 +219,7 @@ Increase verbose output level. This option may be specified
multiple times to increase the level of debug output. If given
three times you will get hexdumps of all incoming and
outgoing packets. Using it five times provides details
-on request and expected reply procesing. The \fIhpm\fP commands
+on request and expected reply processing. The \fIhpm\fP commands
\fItargetcap\fP \fIcompprop\fP \fIabort\fP \fIupgstatus\fP
\fIrollback\fP \fIrollbackstatus\fP \fIselftestresult\fP increases
the verbosity level
@@ -234,8 +241,9 @@ Prompt for the Kg key for IPMIv2.0 authentication.
Change Size of Communication Channel. (OEM)
.LP
-If no password method is specified then ipmitool will prompt the
-user for a password. If no password is entered at the prompt,
+If no password method is specified then
+.BR ipmitool
+will prompt the user for a password. If no password is entered at the prompt,
the remote server password will default to NULL.
.SH "SECURITY"
There are several security issues be be considered before enabling the
@@ -256,19 +264,23 @@ system. It is thus recommended that IPMI password management only be done
over IPMIv2.0 \fIlanplus\fP interface or the system interface on the
local station.
-For IPMI v1.5, the maximum password length is 16 characters.
-Passwords longer than 16 characters will be truncated.
+For IPMI v1.5, the maximum password length is 16 characters; longer
+passwords might be truncated or rejected by the server, or rejected
+by
+.BR ipmitool .
+
+For IPMI v2.0, the maximum password length is 20 characters; longer
+passwords will be rejected by
+.BR ipmitool .
-For IPMI v2.0, the maximum password length is 20 characters;
-longer passwords are truncated.
.SH "COMMANDS"
.TP
\fIhelp\fP
-This can be used to get command\-line help on ipmitool
-commands. It may also be placed at the end of commands
-to get option usage help.
+This can be used to get command\-line help on
+.BR ipmitool
+commands. It may also be placed at the end of commands to get option usage help.
-ipmitool help
+> ipmitool help
.br
Commands:
bmc Deprecated. Use mc
@@ -381,39 +393,23 @@ application (ipmi or sol) on the given channel.
\fIstatus\fP
Status information related to power, buttons, cooling, drives and faults.
-.RS
-.RE
.TP
\fIpower\fP
.RS
.TP
\fIstatus\fP
-.RS
-.RE
.TP
\fIon\fP
-.RS
-.RE
.TP
\fIoff\fP
-.RS
-.RE
.TP
\fIcycle\fP
-.RS
-.RE
.TP
\fIreset\fP
-.RS
-.RE
.TP
\fIdiag\fP
-.RS
-.RE
.TP
\fIsoft\fP
-.RS
-.RE
.RE
.TP
\fIidentify\fP [<seconds>|force]
@@ -425,8 +421,6 @@ Default is 15 seconds.
0 - Off
.br
force - To turn on indefinitely
-.RS
-.RE
.TP
\fIpolicy\fP
@@ -436,34 +430,22 @@ What to do when power is restored.
\fIlist\fP
Show available options.
-.RS
-.RE
.TP
\fIalways-on\fP
-.RS
-.RE
.TP
\fIprevious\fP
-.RS
-.RE
.TP
\fIalways-off\fP
-.RS
-.RE
.RE
.TP
\fIrestart_cause\fP
Last restart cause.
-.RS
-.RE
.TP
\fIpoh\fP
Get power on hours.
-.RS
-.RE
.TP
\fIbootdev\fP
.RS
@@ -471,95 +453,123 @@ Get power on hours.
\fInone\fP
Do not change boot device order.
-.RS
-.RE
.TP
\fIpxe\fP
Force PXE boot.
-.RS
-.RE
.TP
\fIdisk\fP
Force boot from default Hard-drive.
-.RS
-.RE
.TP
\fIsafe\fP
Force boot from default Hard-drive, request Safe Mode.
-.RS
-.RE
.TP
\fIdiag\fP
Force boot from Diagnostic Partition.
-.RS
-.RE
.TP
\fIcdrom\fP
Force boot from CD/DVD.
-.RS
-.RE
.TP
\fIbios\fP
Force boot into BIOS Setup.
-.RS
-.RE
.TP
\fIfloppy\fP
Force boot from Floppy/primary removable media.
-.RS
-.RE
.RE
+
+.TP
+\fIbootmbox\fP \fIget\fP [text] [block <\fBblock#\fP>]
+
+Read the Boot Initiator Mailbox in hex dump or in text mode.
+
+By default the whole mailbox is read. If block number is specified,
+that particular block is read. For block 0 or when the whole
+mailbox is read, the Boot Initiator IANA Enterprise Number and
+the corresponding enterprise name are printed.
+
+.TP
+\fIbootmbox\fP \fIset\fP text [block <\fBblock#\fP>] <\fBIANA_PEN\fP> "<\fBdata_string\fP>"
+
+Write the specified <block> or the entire Boot Initiator Mailbox in text mode.
+It is required to specify a decimal IANA Enterprise Number recognized
+by the boot initiator on the target system. Refer to your target system
+manufacturer for details. The rest of the arguments are a text string.
+
+When single block write is requested, the total length of <data> may not
+exceed 13 bytes for block 0, or 16 bytes otherwise.
+
+.TP
+\fIbootmbox\fP \fIset\fP [block <\fBblock#\fP>] <\fBIANA_PEN\fP> <\fBdata_byte\fP> [<\fBdata_byte\fP> ...]
+
+Same as above, but the arguments after IANA PEN are separate
+data byte values separated by spaces.
+
.TP
-\fIbootparam\fP
-.RS
+\fIbootparam\fP \fIget\fP <\fBopt_id\fR> [<\fBopt_param\fR>]
+
+Get value of system boot option number <\fBopt_id\fR>. Some boot
+options (e.g. option 7) can also take an optional numeric parameter.
+
.TP
-\fIforce_pxe\fP
+\fIbootparam\fP \fIset\fP bootflag <\fBdevice\fR> [options=...]
+
+Set a boot flag. Valid devices are:
-Force PXE boot
.RS
-.RE
-.TP
-\fIforce_disk\fP
+.IP \fIforce_pxe\fP
+
+Force PXE boot
+.IP \fIforce_disk\fP
Force boot from default Hard-drive
-.RS
-.RE
-.TP
-\fIforce_safe\fP
+.IP \fIforce_safe\fP
Force boot from default Hard-drive, request Safe Mode
-.RS
-.RE
-.TP
-\fIforce_diag\fP
+.IP \fIforce_diag\fP
Force boot from Diagnostic Partition
-.RS
-.RE
-.TP
-\fIforce_cdrom\fP
+.IP \fIforce_cdrom\fP
Force boot from CD/DVD
-.RS
-.RE
-.TP
-\fIforce_bios\fP
+.IP \fIforce_bios\fP
Force boot into BIOS Setup
-.RS
-.RE
+
+.PP
+Valid options are:
+
+.IP \fIPEF\fP
+
+Clear valid bit on reset/power cycle cause by PEF
+
+.IP \fItimeout\fP
+
+Automatically clear boot flag valid bit on timeout
+
+.IP \fIwatchdog\fP
+
+Clear valid bit on reset/power cycle cause by watchdog
+
+.IP \fIreset\fP
+
+Clear valid bit on push button reset/soft reset
+
+.IP \fIpower\fP
+
+Clear valid bit on power up via power push button or wake event
.RE
+
.TP
\fIselftest\fP
-.RS
-.RE
+
+Get the chassis self-test results
+
.RE
.TP
\fIdcmi\fP
@@ -954,8 +964,6 @@ Shows Extended SD Card information.
\fIecho\fP
For echoing lines to stdout in scripts.
-.RS
-.RE
.TP
\fIekanalyzer\fP <\fBcommand\fR> <\fBxx=filename1\fR> <\fBxx=filename2\fR> [<\fBrc=filename3\fR>] \fB...\fR
.RS
@@ -1215,12 +1223,13 @@ Get a list of all the possible Sensor States and pre-defined Sensor State
Shortcuts available for a particular sensor. \fBsensorid\fR is the character
string representation of the sensor and must be enclosed in double quotes
if it includes white space. Several different commands including
-\fIipmitool sensor list\fP may be used to obtain a list that includes
+.BR ipmitool
+\fIsensor list\fP may be used to obtain a list that includes
the \fBsensorid\fR strings representing the sensors on a given system.
.RS
.PP
> ipmitool \-I open event "PS 2T Fan Fault" list
-.br
+.br
Finding sensor PS 2T Fan Fault... ok
.br
Sensor States:
@@ -1277,7 +1286,9 @@ Finding sensor PS 2T Fan Fault... ok
\fIexec\fP <\fBfilename\fR>
.RS
-Execute ipmitool commands from \fIfilename\fR. Each line is a
+Execute
+.BR ipmitool
+commands from \fIfilename\fR. Each line is a
complete command. The syntax of the commands are defined by the
COMMANDS section in this manpage. Each line may have an optional
comment at the end of the line, delimited with a `#' symbol.
@@ -1504,20 +1515,14 @@ Show firmware upgrade log.
\fIlist\fP
List All Generic Device Locators.
-.RS
-.RE
.TP
\fIread\fP <\fBsdr name\fR> <\fBfile\fR>
Read to file eeprom specify by Generic Device Locators.
-.RS
-.RE
.TP
\fIwrite\fP <\fBsdr name\fR> <\fBfile\fR>
Write from file eeprom specify by Generic Device Locators
-.RS
-.RE
.RE
.TP
\fIhpm\fP
@@ -1692,7 +1697,9 @@ user, operator, admin, oem.
\fIactivate\fP
.br
-Causes ipmitool to enter Intel IPMI v1.5 Serial Over LAN mode. An RMCP+
+Causes
+.BR ipmitool
+to enter Intel IPMI v1.5 Serial Over LAN mode. An RMCP+
connection is made to the BMC, the terminal is set to raw mode, and user
input is sent to the serial console on the remote server. On exit,
the SOL payload mode is deactivated and the terminal is reset to its
@@ -1704,9 +1711,9 @@ Special escape sequences are provided to control the SOL session:
.TP
\fI~.\fP Terminate connection
.TP
-\fI~^Z\fP Suspend ipmitool
+\fI~^Z\fP Suspend \fBipmitool\fR
.TP
-\fI~^X\fP Suspend ipmitool, but don't restore tty on restart
+\fI~^X\fP Suspend \fBipmitool\fR, but don't restore tty on restart
.TP
\fI~B\fP Send break
.TP
@@ -1744,7 +1751,8 @@ Select the next boot order on the Kontron CP6012.
.RS
These commands will allow you to configure IPMI LAN channels
-with network information so they can be used with the ipmitool
+with network information so they can be used with the
+..BR ipmitool
\fIlan\fP and \fIlanplus\fP interfaces. \fINOTE\fR: To
determine on which channel the LAN interface is located, issue
the `channel info \fInumber\fR' command until you come across
@@ -2017,9 +2025,74 @@ The default will clear statistics on the first found LAN channel.
Instructs the BMC to perform a warm or cold reset.
.TP
-\fIguid\fP
+\fIguid\fP [\fBsmbios\fR|\fBrfc4122\fR|\fBipmi\fR|\fBdump\fR]
Display the Management Controller Globally Unique IDentifier.
+
+.RS
+.TP
+\fIauto\fP
+.br
+
+This is the default behavior for
+.BR ipmitool (1).
+
+Try to automatically detect the encoding based on the value of the
+version field and (for version 1) the timestamp. The version is
+considered valid if it is 1 through 5, and the timestamp is valid
+if the year is past or equal to UNIX Epoch (1970) and is before or
+equal to the current year.
+
+If multiple encodings happen to have valid version fields, then
+precedence takes the one with version 1 and a valid timestamp. If
+neither one has that, then the precedence order is as follows:
+\fIsmbios\fP, \fIipmi\fP, \fIrfc4122\fP.
+
+If neither encoding yields a valid version field, then
+.BR ipmitool (1)
+defaults to \fIdump\fP mode.
+
+If this option is in use, then
+.BR ipmitool (1)
+will also print out the detected encoding and warn
+regarding IPMI specification violation if the encoding isn't \fIipmi\fP.
+
+.TP
+\fIsmbios\fP
+.br
+
+Decode GUID as if it was sent by BMC as prescribed by SMBIOS specification.
+
+\fBNOTE:\fR This is a violation of IPMI specification, but many BMC implementations do
+it this way. If your BMC's GUID is shown correctly using this option, you
+may want to inform your BMC manufacturer that they have a bug.
+
+.TP
+\fIipmi\fP
+.br
+
+Decode GUID according to IPMI specification. It MUST show the correct GUID.
+If it doesn't, try other options and inform your BMC manufacturer of the bug.
+
+.TP
+\fIrfc4122\fP or \fIrfc\fP
+.br
+
+Decode GUID as if it was sent by BMC as prescribed by RFC4122 specification.
+
+\fBNOTE:\fR This is a violation of IPMI specification.
+If your BMC's GUID is shown correctly using this option, you
+may want to inform your BMC manufacturer that they have a bug.
+
+.TP
+\fIdump\fP
+.br
+
+Dump as hex the data received from BMC in response to Get Device GUID command.
+No decoding or interpretation is performed. First received byte is dumped first.
+
+.RE
+
.TP
\fIinfo\fP
.br
@@ -2886,7 +2959,9 @@ A list of all entity ids can be found in the IPMI specifications.
Dumps raw SDR data to a file. This data file can then be used as
a local SDR cache of the remote managed system with the \fI\-S <file>\fP
-option on the ipmitool command line. This can greatly improve performance
+option on the
+.BR ipmitool
+command line. This can greatly improve performance
over system interface or remote LAN.
.TP
\fIfill\fP \fIsensors\fP
@@ -2969,7 +3044,9 @@ Print information on the specified SEL Record entry.
\fIsave\fP <\fBfile\fR>
Save SEL records to a text file that can be fed back into the
-\fIevent file\fP ipmitool command. This can be useful for
+\fIevent file\fP
+.BR ipmitool
+command. This can be useful for
testing Event generation by building an appropriate Platform
Event Message file based on existing events. Please see the
available help for the 'event file ...' command for a description of
@@ -2978,12 +3055,16 @@ the format of this file.
\fIwriteraw\fP <\fBfile\fR>
Save SEL records to a file in raw, binary format. This file can
-be fed back to the \fIsel readraw\fP ipmitool command for viewing.
+be fed back to the \fIsel readraw\fP
+.BR ipmitool
+command for viewing.
.TP
\fIreadraw\fP <\fBfile\fR>
Read and display SEL records from a binary file. Such a file can
-be created using the \fIsel writeraw\fP ipmitool command.
+be created using the \fIsel writeraw\fP
+.BR ipmitool
+command.
.TP
\fItime\fP
.RS
@@ -3068,50 +3149,34 @@ or by using the keyword `all' to specify all sessions.
\fIhostname\fP <\fBhost\fR>
Session hostname.
-.RS
-.RE
.TP
\fIusername\fP <\fBuser\fR>
Session username.
-.RS
-.RE
.TP
\fIpassword\fP <\fBpass\fR>
Session password.
-.RS
-.RE
.TP
\fIprivlvl\fP <\fBlevel\fR>
Session privilege level force.
-.RS
-.RE
.TP
\fIauthtype\fP <\fBtype\fR>
Authentication type force.
-.RS
-.RE
.TP
\fIlocaladdr\fP <\fBaddr\fR>
Local IPMB address.
-.RS
-.RE
.TP
\fItargetaddr\fP <\fBaddr\fR>
Remote target IPMB address.
-.RS
-.RE
.TP
\fIport\fP <\fBport\fR>
Remote RMCP port.
-.RS
-.RE
.TP
\fIcsv\fP [\fBlevel\fR]
@@ -3119,22 +3184,21 @@ Enable output in comma separated format.
Affects following commands:
\fIuser\fP, \fIchannel\fP, \fIisol\fP, \fIsunoem\fP,
\fIsol\fP, \fIsensor\fP, \fIsdr\fP, \fIsel\fP, \fIsession\fP.
-.RS
-.RE
.TP
\fIverbose\fP [\fBverbose\fR]
Verbosity level.
-.RS
-.RE
.RE
.TP
\fIshell\fP
.RS
This command will launch an interactive shell which you can use
-to send multiple ipmitool commands to a BMC and see the responses.
-This can be useful instead of running the full ipmitool command each
-time. Some commands will make use of a Sensor Data Record cache
+to send multiple
+.BR ipmitool
+commands to a BMC and see the responses. This can be useful instead of
+running the full
+.BR ipmitool
+command each time. Some commands will make use of a Sensor Data Record cache
and you will see marked improvement in speed if these commands
are able to reuse the same cache in a shell session. LAN sessions
will send a periodic keepalive command to keep the IPMI session
@@ -3210,7 +3274,9 @@ by the IPMI over serial channel.
\fIactivate\fP [\fIusesolkeepalive\fP | \fInokeepalive\fP] [\fIinstance=<number>\fP]
.br
-Causes ipmitool to enter Serial Over LAN
+Causes
+.BR ipmitool
+to enter Serial Over LAN
mode, and is only available when using the lanplus
interface. An RMCP+ connection is made to the BMC,
the terminal is set to raw mode, and user input is
@@ -3469,12 +3535,13 @@ Displays a list of user information for all defined userids.
Sets the username associated with the given userid.
.TP
-\fIpassword\fP <\fBuserid\fR> [<\fBpassword\fR>]
+\fIpassword\fP <\fBuserid\fR> [<\fBpassword\fR> [<\fB16|20\fR>]]
.br
Sets the password for the given userid. If no password is given,
the password is cleared (set to the NULL password). Be careful when
-removing passwords from administrator\-level accounts.
+removing passwords from administrator\-level accounts. If specified,
+16 or 20 determines the maximum password length.
.RE
.TP
\fIdisable\fP <\fBuserid\fR>
@@ -3500,7 +3567,9 @@ Determine whether a password has been stored as 16 or 20 bytes.
.RE
.SH "OPEN INTERFACE"
-The ipmitool \fIopen\fP interface utilizes the OpenIPMI
+The
+.BR ipmitool
+\fIopen\fP interface utilizes the OpenIPMI
kernel device driver. This driver is present in all modern
2.4 and all 2.6 kernels and it should be present in recent
Linux distribution kernels. There are also IPMI driver
@@ -3509,7 +3578,9 @@ the OpenIPMI homepage.
The required kernel modules is different for 2.4 and 2.6
kernels. The following kernel modules must be loaded on
-a 2.4\-based kernel in order for ipmitool to work:
+a 2.4\-based kernel in order for
+.BR ipmitool
+to work:
.TP
.B ipmi_msghandler
Incoming and outgoing message handler for IPMI interfaces.
@@ -3521,7 +3592,9 @@ An IPMI Keyboard Controller Style (KCS) interface driver for the message handler
Linux character device interface for the message handler.
.LP
The following kernel modules must be loaded on
-a 2.6\-based kernel in order for ipmitool to work:
+a 2.6\-based kernel in order for
+.BR ipmitool
+to work:
.TP
.B ipmi_msghandler
Incoming and outgoing message handler for IPMI interfaces.
@@ -3549,19 +3622,22 @@ entry with:
.I mknod /dev/ipmi0 c 254 0
-ipmitool includes some sample initialization scripts that
+.BR ipmitool
+includes some sample initialization scripts that
can perform this task automatically at start\-up.
-In order to have ipmitool use the OpenIPMI device interface
+In order to have
+.BR ipmitool
+use the OpenIPMI device interface
you can specify it on the command line:
.PP
-ipmitool \fB\-I\fR \fIopen\fP <\fIcommand\fP>
+> ipmitool \fB\-I\fR \fIopen\fP <\fIcommand\fP>
.SH "BMC INTERFACE"
The ipmitool bmc interface utilizes the \fIbmc\fP device driver as
provided by Solaris 10 and higher. In order to force ipmitool to make
use of this interface you can specify it on the command line:
.PP
-ipmitool \fB\-I\fR \fIbmc\fP <\fIcommand\fP>
+> ipmitool \fB\-I\fR \fIbmc\fP <\fIcommand\fP>
The following files are associated with the bmc driver:
@@ -3575,13 +3651,18 @@ The following files are associated with the bmc driver:
.B /dev/bmc
Character device node used to communicate with the bmc driver.
.SH "LIPMI INTERFACE"
-The ipmitool \fIlipmi\fP interface uses the Solaris 9 IPMI kernel device driver.
+The
+.BR ipmitool
+\fIlipmi\fP interface uses the Solaris 9 IPMI kernel device driver.
It has been superceeded by the \fIbmc\fP interface on Solaris 10. You can tell
-ipmitool to use this interface by specifying it on the command line.
+.BR ipmitool
+to use this interface by specifying it on the command line.
-ipmitool \fB\-I\fR \fIlipmi\fP <\fIexpression\fP>
+> ipmitool \fB\-I\fR \fIlipmi\fP <\fIexpression\fP>
.SH "LAN INTERFACE"
-The ipmitool \fIlan\fP interface communicates with the BMC
+The
+.BR ipmitool
+\fIlan\fP interface communicates with the BMC
over an Ethernet LAN connection using UDP under IPv4. UDP
datagrams are formatted to contain IPMI request/response
messages with a IPMI session headers and RMCP headers.
@@ -3594,20 +3675,24 @@ datagrams to port 623.
The LAN interface is an authentication multi\-session connection;
messages delivered to the BMC can (and should) be authenticated
with a challenge/response protocol with either straight
-password/key or MD5 message\-digest algorithm. ipmitool will
-attempt to connect with administrator privilege level as this
+password/key or MD5 message\-digest algorithm.
+.BR ipmitool
+will attempt to connect with administrator privilege level as this
is required to perform chassis power functions.
-You can tell ipmitool to use the lan interface with the
+You can tell
+.BR ipmitool
+to use the lan interface with the
\fB\-I\fR \fIlan\fP option:
.PP
-ipmitool \fB\-I\fR \fIlan\fP \fB\-H\fR <\fIhostname\fP>
+> ipmitool \fB\-I\fR \fIlan\fP \fB\-H\fR <\fIhostname\fP>
[\fB\-U\fR <\fIusername\fP>] [\fB\-P\fR <\fIpassword\fP>] <\fIcommand\fP>
A hostname must be given on the command line in order to use the
-lan interface with ipmitool. The password field is optional;
-if you do not provide a password on the command line, ipmitool
+lan interface with \fBipmitool\fR. The password field is optional;
+if you do not provide a password on the command line,
+.BR ipmitool
will attempt to connect without authentication. If you specify a
password it will use MD5 authentication if supported by the BMC
and straight password/key otherwise, unless overridden with a
@@ -3620,63 +3705,78 @@ interface uses the RMCP+ protocol as described in the IPMI v2.0
specification. RMCP+ allows for improved authentication and data
integrity checks, as well as encryption and the ability to carry
multiple types of payloads. Generic Serial Over LAN support
-requires RMCP+, so the ipmitool \fIsol activate\fP command
+requires RMCP+, so the
+.BR ipmitool
+\fIsol activate\fP command
requires the use of the \fIlanplus\fP interface.
RMCP+ session establishment uses a symmetric challenge\-response
protocol called RAKP (\fBRemote Authenticated Key\-Exchange Protocol\fR)
-which allows the negotiation of many options. ipmitool does not
+which allows the negotiation of many options.
+.BR ipmitool
+does not
yet allow the user to specify the value of every option, defaulting
to the most obvious settings marked as required in the v2.0
specification. Authentication and integrity HMACS are produced with
SHA1, and encryption is performed with AES\-CBC\-128. Role\-level logins
are not yet supported.
-ipmitool must be linked with the \fIOpenSSL\fP library in order to
+.BR ipmitool
+must be linked with the \fIOpenSSL\fP library in order to
perform the encryption functions and support the \fIlanplus\fP
interface. If the required packages are not found it will not be
compiled in and supported.
-You can tell ipmitool to use the lanplus interface with the
+You can tell
+.BR ipmitool
+to use the lanplus interface with the
\fB\-I\fR \fIlanplus\fP option:
.PP
-ipmitool \fB\-I\fR \fIlanplus\fP
+> ipmitool \fB\-I\fR \fIlanplus\fP
\fB\-H\fR <\fIhostname\fP>
[\fB\-U\fR <\fIusername\fP>]
[\fB\-P\fR <\fIpassword\fP>]
<\fIcommand\fP>
A hostname must be given on the command line in order to use the
-lan interface with ipmitool. With the exception of the \fB\-A\fR and
+lan interface with \fBipmitool\fR. With the exception of the \fB\-A\fR and
\fB\-C\fR options the rest of the command line options are identical to
those available for the \fIlan\fP interface.
The \fB\-C\fR option allows you specify the authentication, integrity,
and encryption algorithms to use for for \fIlanplus\fP session based
on the cipher suite ID found in the IPMIv2.0 specification in table
-22\-19. The default cipher suite is \fI3\fP which specifies
-RAKP\-HMAC\-SHA1 authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128
-encryption algorightms.
+22\-20. The default cipher suite is \fI17\fP which specifies
+RAKP\-HMAC\-SHA256 authentication, HMAC\-SHA256\-128 integrity, and
+AES\-CBC\-128 encryption algorightms.
.SH "FREE INTERFACE"
.LP
-The ipmitool \fIfree\fP interface utilizes the FreeIPMI libfreeipmi
+The
+.BR ipmitool
+\fIfree\fP interface utilizes the FreeIPMI libfreeipmi
drivers.
.LP
-You can tell ipmitool to use the FreeIPMI interface with the \-I option:
+You can tell
+.BR ipmitool
+to use the FreeIPMI interface with the \-I option:
.PP
-ipmitool \fB\-I\fR \fIfree\fP <\fIcommand\fP>
+> ipmitool \fB\-I\fR \fIfree\fP <\fIcommand\fP>
.SH "IMB INTERFACE"
.LP
-The ipmitool \fIimb\fP interface supports the Intel IMB (Intel
+The
+.BR ipmitool
+\fIimb\fP interface supports the Intel IMB (Intel
Inter-module Bus) Interface through the /dev/imb device.
.LP
-You can tell ipmitool to use the IMB interface with the \-I option:
+You can tell
+.BR ipmitool
+to use the IMB interface with the \-I option:
.PP
-ipmitool \fB\-I\fR \fIimb\fP <\fIcommand\fP>
+> ipmitool \fB\-I\fR \fIimb\fP <\fIcommand\fP>
.SH "EXAMPLES"
.TP
@@ -3727,13 +3827,29 @@ Chassis Power is on
> ipmitool \-I lan \-H 1.2.3.4 \-f passfile chassis power on
.br
Chassis Power Control: Up/On
-
-.SH "AUTHOR"
-Duncan Laurie <duncan@iceblink.org>
+
+.SH FILES
+.TP
+.B @IANADIR@/enterprise-numbers
+system IANA PEN registry taken from http://www.iana.org/assignments/enterprise-numbers
+.TP
+.B ~/@IANAUSERDIR@/enterprise-numbers
+user's override for the system IANA PEN registry, this file if it exists is loaded instead
+of the system registry (see above).
+
+.SH "AUTHORS"
+Originally written by Duncan Laurie <duncan@iceblink.org>.
+.br
+Numerous contributors over time.
+
+.SH "BUGS"
+Any bugs found in \fIipmitool\fP please report via \fIGitHub\fP issue system at
+https://github.com/ipmitool/ipmitool/issues
+
.SH "SEE ALSO"
.TP
IPMItool Homepage
-http://ipmitool.sourceforge.net
+http://github.com/ipmitool/ipmitool
.TP
Intelligent Platform Management Interface Specification
http://www.intel.com/design/servers/ipmi
diff --git a/include/Makefile.in b/include/Makefile.in
deleted file mode 100644
index 023ae85..0000000
--- a/include/Makefile.in
+++ /dev/null
@@ -1,666 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = include
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-SUBDIRS = ipmitool
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign include/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-generic clean-libtool cscopelist-am ctags \
- ctags-am distclean distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/include/ipmitool/Makefile.am b/include/ipmitool/Makefile.am
index 160e354..bb34920 100644
--- a/include/ipmitool/Makefile.am
+++ b/include/ipmitool/Makefile.am
@@ -38,5 +38,6 @@ noinst_HEADERS = log.h bswap.h hpm2.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
ipmi_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \
- ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h
+ ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h \
+ ipmi_cfgp.h ipmi_lanp6.h ipmi_quantaoem.h ipmi_time.h
diff --git a/include/ipmitool/Makefile.in b/include/ipmitool/Makefile.in
deleted file mode 100644
index 5c55d42..0000000
--- a/include/ipmitool/Makefile.in
+++ /dev/null
@@ -1,563 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = include/ipmitool
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(noinst_HEADERS)
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-HEADERS = $(noinst_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-noinst_HEADERS = log.h bswap.h hpm2.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
- ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_hpmfwupg.h ipmi_lanp.h \
- ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_mc.h ipmi_raw.h \
- ipmi_channel.h ipmi_sensor.h ipmi_event.h ipmi_session.h \
- ipmi_strings.h ipmi_constants.h ipmi_user.h ipmi_pef.h \
- ipmi_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
- ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
- ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \
- ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ipmitool/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign include/ipmitool/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(HEADERS)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool cscopelist-am ctags ctags-am distclean \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/include/ipmitool/bswap.h b/include/ipmitool/bswap.h
index 9948208..968de7e 100644
--- a/include/ipmitool/bswap.h
+++ b/include/ipmitool/bswap.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_BSWAP_H
-#define IPMI_BSWAP_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
@@ -49,5 +48,3 @@
# define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) |\
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#endif
-
-#endif /* IPMI_BSWAP_H */
diff --git a/include/ipmitool/helper.h b/include/ipmitool/helper.h
index b7ad628..79a5c5b 100644
--- a/include/ipmitool/helper.h
+++ b/include/ipmitool/helper.h
@@ -30,13 +30,16 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_HELPER_H
-#define IPMI_HELPER_H
+#pragma once
#include <sys/types.h>
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h> /* For free() */
+#include <stdbool.h>
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#ifndef TRUE
#define TRUE 1
@@ -50,6 +53,12 @@
#define tboolean int
#endif
+#ifdef __GNUC__
+ #define __UNUSED__(x) x __attribute__((unused))
+#else
+ #define __UNUSED__(x) x
+#endif
+
/* IPMI spec. - UID 0 reserved, 63 maximum UID which can be used */
#ifndef IPMI_UID_MIN
# define IPMI_UID_MIN 1
@@ -61,7 +70,7 @@
struct ipmi_intf;
struct valstr {
- uint16_t val;
+ uint32_t val;
const char * str;
};
struct oemvalstr {
@@ -70,8 +79,12 @@ struct oemvalstr {
const char * str;
};
-const char * val2str(uint16_t val, const struct valstr * vs);
-const char * oemval2str(uint32_t oem,uint16_t val, const struct oemvalstr * vs);
+const char *
+specific_val2str(uint32_t val,
+ const struct valstr *specific,
+ const struct valstr *generic);
+const char *val2str(uint32_t val, const struct valstr * vs);
+const char *oemval2str(uint32_t oem, uint32_t val, const struct oemvalstr * vs);
int str2double(const char * str, double * double_ptr);
int str2long(const char * str, int64_t * lng_ptr);
@@ -83,6 +96,8 @@ int str2ushort(const char * str, uint16_t * ushrt_ptr);
int str2char(const char * str, int8_t * chr_ptr);
int str2uchar(const char * str, uint8_t * uchr_ptr);
+bool args2buf(int argc, char *argv[], uint8_t *out, size_t len);
+
int eval_ccode(const int ccode);
int is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr);
@@ -90,20 +105,109 @@ int is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr);
int is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr);
int is_ipmi_user_priv_limit(const char *argv_ptr, uint8_t *ipmi_priv_limit_ptr);
-uint16_t str2val(const char * str, const struct valstr * vs);
+uint32_t str2val32(const char *str, const struct valstr *vs);
+static inline uint16_t str2val(const char *str, const struct valstr *vs)
+{
+ return (uint16_t)str2val32(str, vs);
+}
void print_valstr(const struct valstr * vs, const char * title, int loglevel);
void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel);
uint16_t buf2short(uint8_t * buf);
uint32_t buf2long(uint8_t * buf);
-const char * buf2str(uint8_t * buf, int len);
+#define BUF2STR_MAXIMUM_OUTPUT_SIZE (3*1024 + 1)
+const char * buf2str_extended(const uint8_t *buf, int len, const char *sep);
+const char * buf2str(const uint8_t *buf, int len);
+int str2mac(const char *arg, uint8_t *buf);
+const char * mac2str(const uint8_t *buf);
+int ipmi_parse_hex(const char *str, uint8_t *out, int size);
void printbuf(const uint8_t * buf, int len, const char * desc);
uint8_t ipmi_csum(uint8_t * d, int s);
FILE * ipmi_open_file(const char * file, int rw);
void ipmi_start_daemon(struct ipmi_intf *intf);
uint16_t ipmi_get_oem_id(struct ipmi_intf *intf);
+#define IS_SET(v, b) ((v) & (1 << (b)))
+
+/**
+ * Free the memory and clear the pointer.
+ * @param[in] ptr - a pointer to your pointer to free.
+ */
+static inline void free_n(void *ptr) {
+ void **pptr = (void **)ptr;
+
+ if (pptr && *pptr) {
+ free(*pptr);
+ *pptr = NULL;
+ }
+}
+
+/* le16toh(), hto16le(), et. al. don't exist for Windows or Apple */
+/* For portability, let's simply define our own versions here */
+
+/* IPMI is always little-endian */
+static inline uint16_t ipmi16toh(void *ipmi16)
+{
+ uint8_t *ipmi = (uint8_t *)ipmi16;
+ uint16_t h;
+
+ h = (uint16_t)ipmi[1] << 8; /* MSB */
+ h |= ipmi[0]; /* LSB */
+
+ return h;
+}
+
+static inline void htoipmi16(uint16_t h, uint8_t *ipmi)
+{
+ ipmi[0] = h & 0xFF; /* LSB */
+ ipmi[1] = h >> 8; /* MSB */
+}
+
+static inline uint32_t ipmi24toh(void *ipmi24)
+{
+ uint8_t *ipmi = (uint8_t *)ipmi24;
+ uint32_t h = 0;
+
+ h = (uint32_t)ipmi[2] << 16; /* MSB */
+ h |= ipmi[1] << 8;
+ h |= ipmi[0]; /* LSB */
+
+ return h;
+}
+
+static inline void htoipmi24(uint32_t h, uint8_t *ipmi)
+{
+ ipmi[0] = h & 0xFF; /* LSB */
+ ipmi[1] = (h >> 8) & 0xFF;
+ ipmi[2] = (h >> 16) & 0xFF; /* MSB */
+}
+
+static inline uint32_t ipmi32toh(void *ipmi32)
+{
+ uint8_t *ipmi = ipmi32;
+ uint32_t h;
+
+ h = (uint32_t)ipmi[3] << 24; /* MSB */
+ h |= ipmi[2] << 16;
+ h |= ipmi[1] << 8;
+ h |= ipmi[0]; /* LSB */
+
+ return h;
+}
+
+static inline void htoipmi32(uint32_t h, uint8_t *ipmi)
+{
+ ipmi[0] = h & 0xFF; /* LSB */
+ ipmi[1] = (h >> 8) & 0xFF;
+ ipmi[2] = (h >> 16) & 0xFF;
+ ipmi[3] = (h >> 24) & 0xFF; /* MSB */
+}
+
+uint8_t *array_byteswap(uint8_t *buffer, size_t length);
+uint8_t *array_ntoh(uint8_t *buffer, size_t length);
+uint8_t *array_letoh(uint8_t *buffer, size_t length);
+
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
@@ -122,5 +226,3 @@ uint16_t ipmi_get_oem_id(struct ipmi_intf *intf);
#ifndef __maxlen
# define __maxlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x > y) ? x : y;})
#endif
-
-#endif /* IPMI_HELPER_H */
diff --git a/include/ipmitool/hpm2.h b/include/ipmitool/hpm2.h
index 09b6237..ebf9842 100644
--- a/include/ipmitool/hpm2.h
+++ b/include/ipmitool/hpm2.h
@@ -30,6 +30,8 @@
* EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#pragma once
+
#include <stdint.h>
#include <ipmitool/ipmi_intf.h>
diff --git a/include/ipmitool/ipmi.h b/include/ipmitool/ipmi.h
index e978bfc..7555596 100644
--- a/include/ipmitool/ipmi.h
+++ b/include/ipmitool/ipmi.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_H
-#define IPMI_H
+#pragma once
#include <stdlib.h>
#include <stdio.h>
@@ -46,6 +45,7 @@
#endif
#define IPMI_BUF_SIZE 1024
+#define IPMI_MAX_MD_SIZE 0x20
#if HAVE_PRAGMA_PACK
#define ATTRIBUTE_PACKING
@@ -211,13 +211,13 @@ struct ipmi_rs {
uint32_t console_id;
uint8_t bmc_rand[16]; /* Random number generated by the BMC */
uint8_t bmc_guid[16];
- uint8_t key_exchange_auth_code[20];
+ uint8_t key_exchange_auth_code[IPMI_MAX_MD_SIZE];
} rakp2_message;
struct {
uint8_t message_tag;
uint8_t rakp_return_code;
uint32_t console_id;
- uint8_t integrity_check_value[20];
+ uint8_t integrity_check_value[IPMI_MAX_MD_SIZE];
} rakp4_message;
struct {
uint8_t packet_sequence_number;
@@ -258,6 +258,8 @@ struct ipmi_rs {
typedef enum IPMI_OEM {
IPMI_OEM_UNKNOWN = 0,
+ IPMI_OEM_DEBUG = 0xFFFFFE, /* Hoping IANA won't hit this soon */
+ IPMI_OEM_RESERVED = 0x0FFFFF, /* As per IPMI 2.0 specification */
/* 2 for [IBM] */
IPMI_OEM_IBM_2 = 2,
IPMI_OEM_HP = 11,
@@ -280,7 +282,7 @@ typedef enum IPMI_OEM {
IPMI_OEM_MAGNUM = 5593,
IPMI_OEM_TYAN = 6653,
IPMI_OEM_QUANTA = 7244,
- IPMI_OEM_NEWISYS = 9237,
+ IPMI_OEM_VIKING = 9237,
IPMI_OEM_ADVANTECH = 10297,
IPMI_OEM_FUJITSU_SIEMENS = 10368,
IPMI_OEM_AVOCENT = 10418,
@@ -298,9 +300,9 @@ typedef enum IPMI_OEM {
/* 24339 for [ADLINK TECHNOLOGY INC.] */
IPMI_OEM_ADLINK_24339 = 24339,
IPMI_OEM_NOKIA_SOLUTIONS_AND_NETWORKS = 28458,
- IPMI_OEM_SUPERMICRO_47488 = 47488
+ IPMI_OEM_VITA = 33196,
+ IPMI_OEM_SUPERMICRO_47488 = 47488,
+ IPMI_OEM_YADRO = 49769,
} IPMI_OEM;
extern const struct valstr completion_code_vals[];
-
-#endif /* IPMI_H */
diff --git a/include/ipmitool/ipmi_cc.h b/include/ipmitool/ipmi_cc.h
index 237b1ee..99ba231 100644
--- a/include/ipmitool/ipmi_cc.h
+++ b/include/ipmitool/ipmi_cc.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_CC_H
-#define IPMI_CC_H
+#pragma once
/*
Thu Jan 11 09:32:41 2007
@@ -71,6 +70,3 @@
#define IPMI_CC_NOT_SUPPORTED_PRESENT_STATE 0xd5
#define IPMI_CC_ILLEGAL_COMMAND_DISABLED 0xd6
#define IPMI_CC_UNSPECIFIED_ERROR 0xff
-
-
-#endif /*IPMI_CC_H*/
diff --git a/include/ipmitool/ipmi_cfgp.h b/include/ipmitool/ipmi_cfgp.h
new file mode 100644
index 0000000..479e91e
--- /dev/null
+++ b/include/ipmitool/ipmi_cfgp.h
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2016 Pentair Technical Products. All right reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Pentair Technical Products or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * PENTAIR TECHNICAL SOLUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <stdio.h>
+
+/* Forward declarations. */
+struct ipmi_cfgp;
+struct ipmi_cfgp_ctx;
+
+/*
+ * Action types.
+ */
+enum {
+ /* parse dumped parameter data */
+ CFGP_PARSE,
+ /* get parameter from BMC */
+ CFGP_GET,
+ /* set parameter to BMC */
+ CFGP_SET,
+ /* output parameter data in form that can be parsed back */
+ CFGP_SAVE,
+ /* print parameter in user-friendly format */
+ CFGP_PRINT
+};
+
+/*
+ * Action-specific information.
+ */
+struct ipmi_cfgp_action {
+ /* Action type. */
+ int type;
+
+ /* Set selector. */
+ int set;
+
+ /* Block selector. */
+ int block;
+
+ /* No error output needed. */
+ int quiet;
+
+ /* Number of command line arguments (only for parse action). */
+ int argc;
+
+ /* Command line arguments (only for parse action). */
+ const char **argv;
+
+ /* Output file (only for dump/print actions). */
+ FILE *file;
+};
+
+/*
+ * Access types.
+ */
+enum {
+ CFGP_RDWR,
+ CFGP_RDONLY,
+ CFGP_WRONLY,
+ CFGP_RESERVED
+};
+
+/*
+ * Configuration parameter descriptor.
+ */
+struct ipmi_cfgp {
+ /* Parameter name. */
+ const char *name;
+
+ /* Parameter format description. */
+ const char *format;
+
+ /* Various parameter traits. */
+ unsigned int size; /* block size */
+ unsigned int access:2; /* read-write/read-only/write-only */
+ unsigned int is_set:1; /* takes non-zero set selectors */
+ unsigned int first_set:1; /* 1 = 1-based set selector */
+ unsigned int has_blocks:1; /* takes non-zero block selectors */
+ unsigned int first_block:1; /* 1 = 1-based block selector */
+
+ /* Parameter-specific data. */
+ int specific;
+};
+
+/* Parameter callback. */
+typedef int (*ipmi_cfgp_handler_t)(void *priv,
+ const struct ipmi_cfgp *p, const struct ipmi_cfgp_action *action,
+ unsigned char *data);
+
+/*
+ * Parameter selector.
+ */
+struct ipmi_cfgp_sel {
+ int param;
+ int set;
+ int block;
+};
+
+/*
+ * Configuration parameter data.
+ */
+struct ipmi_cfgp_data {
+ struct ipmi_cfgp_data *next;
+ struct ipmi_cfgp_sel sel;
+ unsigned char data[];
+};
+
+/*
+ * Configuration parameter operation context.
+ */
+struct ipmi_cfgp_ctx {
+ /* Set of parameters. */
+ const struct ipmi_cfgp *set;
+
+ /* Descriptor count. */
+ int count;
+
+ /* Parameter action handler. */
+ ipmi_cfgp_handler_t handler;
+
+ /* ipmitool cmd name */
+ const char *cmdname;
+
+ /* List of parameter values. */
+ struct ipmi_cfgp_data *v;
+
+ /* Private data. */
+ void *priv;
+};
+
+/* Initialize configuration context. */
+extern int ipmi_cfgp_init(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp *set, unsigned int count,
+ const char *cmdname,
+ ipmi_cfgp_handler_t handler, void *priv);
+
+/* Uninitialize context, free allocated memory. */
+extern int ipmi_cfgp_uninit(struct ipmi_cfgp_ctx *ctx);
+
+/* Print parameter usage. */
+void ipmi_cfgp_usage(const struct ipmi_cfgp *set, int count, int write);
+
+/* Parse parameter selector from command line. */
+extern int ipmi_cfgp_parse_sel(struct ipmi_cfgp_ctx *ctx,
+ int argc, const char **argv, struct ipmi_cfgp_sel *sel);
+
+/* Parse parameter data from command line. */
+extern int ipmi_cfgp_parse_data(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel, int argc, const char **argv);
+
+/* Get parameter data from BMC. */
+extern int ipmi_cfgp_get(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel);
+
+/* Set parameter data to BMC. */
+extern int ipmi_cfgp_set(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel);
+
+/* Write parameter data to file. */
+extern int ipmi_cfgp_save(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel, FILE *file);
+
+/* Print parameter data in user-friendly format. */
+extern int ipmi_cfgp_print(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel, FILE *file);
diff --git a/include/ipmitool/ipmi_channel.h b/include/ipmitool/ipmi_channel.h
index 89e4738..d9be57e 100644
--- a/include/ipmitool/ipmi_channel.h
+++ b/include/ipmitool/ipmi_channel.h
@@ -30,13 +30,13 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_CHANNEL_H
-#define IPMI_CHANNEL_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_intf.h>
#define IPMI_GET_CHANNEL_AUTH_CAP 0x38
@@ -56,6 +56,28 @@
#define IPMI_CHANNEL_SESSION_MULTI 0x80
#define IPMI_CHANNEL_SESSION_BASED 0xC0
+/* Fixed channel numbers as per Table 6-1 */
+typedef enum {
+ CH_PRIMARY_IPMB,
+ CH_IMP_SPECIFIC_1,
+ CH_IMP_SPECIFIC_2,
+ CH_IMP_SPECIFIC_3,
+ CH_IMP_SPECIFIC_4,
+ CH_IMP_SPECIFIC_5,
+ CH_IMP_SPECIFIC_6,
+ CH_IMP_SPECIFIC_7,
+ CH_IMP_SPECIFIC_8,
+ CH_IMP_SPECIFIC_9,
+ CH_IMP_SPECIFIC_A,
+ CH_IMP_SPECIFIC_B,
+ CH_RSVD1,
+ CH_RSVD2,
+ CH_CURRENT,
+ CH_SYSTEM,
+ CH_TOTAL,
+ CH_UNKNOWN = UINT8_MAX
+} ipmi_channel_num_t;
+
/* (22.24) Get Channel Info */
struct channel_info_t {
uint8_t channel;
@@ -78,6 +100,50 @@ struct channel_access_t {
};
/*
+ * The Cipher Suite Record Format from table 22-18 of the IPMI v2.0 spec
+ */
+enum cipher_suite_format_tag {
+ STANDARD_CIPHER_SUITE = 0xc0,
+ OEM_CIPHER_SUITE = 0xc1,
+};
+#ifdef HAVE_PRAGMA_PACK
+#pragma pack(1)
+#endif
+struct std_cipher_suite_record_t {
+ uint8_t start_of_record;
+ uint8_t cipher_suite_id;
+ uint8_t auth_alg;
+ uint8_t integrity_alg;
+ uint8_t crypt_alg;
+} ATTRIBUTE_PACKING;
+struct oem_cipher_suite_record_t {
+ uint8_t start_of_record;
+ uint8_t cipher_suite_id;
+ uint8_t iana[3];
+ uint8_t auth_alg;
+ uint8_t integrity_alg;
+ uint8_t crypt_alg;
+} ATTRIBUTE_PACKING;
+#ifdef HAVE_PRAGMA_PACK
+#pragma pack(0)
+#endif
+#define CIPHER_ALG_MASK 0x3f
+#define MAX_CIPHER_SUITE_RECORD_OFFSET 0x40
+#define MAX_CIPHER_SUITE_DATA_LEN 0x10
+#define LIST_ALGORITHMS_BY_CIPHER_SUITE 0x80
+
+/* Below is the theoretical maximum number of cipher suites that could be
+ * reported by a BMC. That is with the Get Channel Cipher Suites Command, at 16
+ * bytes at a time and 0x40 requests, it can report 1024 bytes, which is about
+ * 204 standard records or 128 OEM records. Really, we probably don't need more
+ * than about 20, which is the full set of standard records plus a few OEM
+ * records.
+ */
+#define MAX_CIPHER_SUITE_COUNT (MAX_CIPHER_SUITE_RECORD_OFFSET * \
+ MAX_CIPHER_SUITE_DATA_LEN / \
+ sizeof(struct std_cipher_suite_record_t))
+
+/*
* The Get Authentication Capabilities response structure
* From table 22-15 of the IPMI v2.0 spec
*/
@@ -129,16 +195,24 @@ struct get_channel_auth_cap_rsp {
#endif
int _ipmi_get_channel_access(struct ipmi_intf *intf,
- struct channel_access_t *channel_access,
- uint8_t get_volatile_settings);
+ struct channel_access_t *channel_access,
+ uint8_t get_volatile_settings);
+int ipmi_get_channel_cipher_suites(struct ipmi_intf *intf,
+ const char *payload_type,
+ uint8_t channel,
+ struct cipher_suite_info *suites,
+ size_t *count);
+int _ipmi_get_channel_info(struct ipmi_intf *intf,
+ struct channel_info_t *channel_info);
int _ipmi_set_channel_access(struct ipmi_intf *intf,
- struct channel_access_t channel_access, uint8_t access_option,
- uint8_t privilege_option);
+ struct channel_access_t channel_access,
+ uint8_t access_option,
+ uint8_t privilege_option);
uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel);
-uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf);
+void ipmi_current_channel_info(struct ipmi_intf *intf,
+ struct channel_info_t *chinfo);
int ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv);
-int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, uint8_t channel, uint8_t priv);
+int ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
+ uint8_t channel, uint8_t priv);
int ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel);
-
-#endif /*IPMI_CHANNEL_H*/
diff --git a/include/ipmitool/ipmi_chassis.h b/include/ipmitool/ipmi_chassis.h
index 3f56924..31d4141 100644
--- a/include/ipmitool/ipmi_chassis.h
+++ b/include/ipmitool/ipmi_chassis.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_CHASSIS_H
-#define IPMI_CHASSIS_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -51,5 +50,3 @@ int ipmi_chassis_power_status(struct ipmi_intf * intf);
int ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl);
int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv);
int ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv);
-
-#endif /*IPMI_CHASSIS_H*/
diff --git a/include/ipmitool/ipmi_constants.h b/include/ipmitool/ipmi_constants.h
index 2aad2cf..1a91940 100644
--- a/include/ipmitool/ipmi_constants.h
+++ b/include/ipmitool/ipmi_constants.h
@@ -30,9 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_CONSTANTS_H
-#define IPMI_CONSTANTS_H
-
+#pragma once
/*
* COMMANDS
@@ -74,6 +72,7 @@
#define IPMI_SESSION_PRIV_OPERATOR 0x3
#define IPMI_SESSION_PRIV_ADMIN 0x4
#define IPMI_SESSION_PRIV_OEM 0x5
+#define IPMI_SESSION_PRIV_NOACCESS 0xF
#define IPMI_SET_IN_PROGRESS_SET_COMPLETE 0x00
#define IPMI_SET_IN_PROGRESS_IN_PROGRESS 0x01
@@ -118,17 +117,17 @@
#define IPMI_AUTH_RAKP_NONE 0x00
#define IPMI_AUTH_RAKP_HMAC_SHA1 0x01
#define IPMI_AUTH_RAKP_HMAC_MD5 0x02
+#define IPMI_AUTH_RAKP_HMAC_SHA256 0x03
/* From table 13-18 of the IPMI v2 specification */
#define IPMI_INTEGRITY_NONE 0x00
#define IPMI_INTEGRITY_HMAC_SHA1_96 0x01
#define IPMI_INTEGRITY_HMAC_MD5_128 0x02
#define IPMI_INTEGRITY_MD5_128 0x03
+#define IPMI_INTEGRITY_HMAC_SHA256_128 0x04
-/* From table 13-19 of the IPMI v2 specfication */
+/* From table 13-19 of the IPMI v2 specification */
#define IPMI_CRYPT_NONE 0x00
#define IPMI_CRYPT_AES_CBC_128 0x01
#define IPMI_CRYPT_XRC4_128 0x02
#define IPMI_CRYPT_XRC4_40 0x03
-
-#endif /*IPMI_CONSTANTS_H*/
diff --git a/include/ipmitool/ipmi_dcmi.h b/include/ipmitool/ipmi_dcmi.h
index 15a959f..c872f56 100644
--- a/include/ipmitool/ipmi_dcmi.h
+++ b/include/ipmitool/ipmi_dcmi.h
@@ -16,9 +16,7 @@
*
*/
-
-#ifndef IPMI_DCMI_H
-#define IPMI_DCMI_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -129,7 +127,7 @@ struct power_reading {
uint8_t state;
} __attribute__ ((packed));
-/* make a struct for the return from the capabilites command */
+/* make a struct for the return from the capabilities command */
struct capabilities {
uint8_t grp_id; /* first byte: Group Extension ID */
uint16_t conformance;
@@ -183,7 +181,7 @@ struct nm_discover {
uint8_t minor_rev;
} __attribute__ ((packed));
-/* Node Manager get capabilites command */
+/* Node Manager get capabilities command */
struct nm_capability {
uint8_t intel_id[3];
uint8_t max_settings;
@@ -236,7 +234,7 @@ struct nm_get_policy {
/* Node Manager set alert destination */
struct nm_set_alert {
uint8_t intel_id[3];
- uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert reciever =1 invalidate */
+ uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert receiver =1 invalidate */
uint8_t dest; /* lan destination */
uint8_t string; /* alert string selector */
} __attribute__ ((packed));
@@ -267,4 +265,3 @@ struct nm_suspend {
} __attribute__ ((packed));
int ipmi_nm_main(struct ipmi_intf * intf, int argc, char ** argv);
-#endif /*IPMI_DCMI_H*/
diff --git a/include/ipmitool/ipmi_delloem.h b/include/ipmitool/ipmi_delloem.h
index 7543e4f..915a36c 100644
--- a/include/ipmitool/ipmi_delloem.h
+++ b/include/ipmitool/ipmi_delloem.h
@@ -26,8 +26,8 @@ POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
-#ifndef IPMI_DELLOEM_H
-#define IPMI_DELLOEM_H
+
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
@@ -366,5 +366,3 @@ typedef struct _SensorReadingType
}SensorReadingType;
uint16_t compareinputwattage(IPMI_POWER_SUPPLY_INFO* powersupplyinfo, uint16_t inputwattage);
int ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv);
-
-#endif /*IPMI_DELLOEM_H*/
diff --git a/include/ipmitool/ipmi_ekanalyzer.h b/include/ipmitool/ipmi_ekanalyzer.h
index 7c43220..08698e4 100644
--- a/include/ipmitool/ipmi_ekanalyzer.h
+++ b/include/ipmitool/ipmi_ekanalyzer.h
@@ -33,8 +33,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_EKANALYZER_H
-#define IPMI_EKANALYZER_H
+#pragma once
#include <inttypes.h>
#include <ipmitool/ipmi.h>
@@ -64,5 +63,3 @@
#define FRU_RADIAL_IPMB0_LINK_MAPPING 0x15
int ipmi_ekanalyzer_main(struct ipmi_intf *, int, char **);
-
-#endif /* IPMI_EKANALYZER_H */
diff --git a/include/ipmitool/ipmi_entity.h b/include/ipmitool/ipmi_entity.h
index 6e5198c..e439560 100644
--- a/include/ipmitool/ipmi_entity.h
+++ b/include/ipmitool/ipmi_entity.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_ENTITY_H
-#define IPMI_ENTITY_H
+#pragma once
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -49,5 +48,3 @@ struct entity_id {
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
-
-#endif /* IPMI_ENTITY_H */
diff --git a/include/ipmitool/ipmi_event.h b/include/ipmitool/ipmi_event.h
index 2ba2fa5..375eb3d 100644
--- a/include/ipmitool/ipmi_event.h
+++ b/include/ipmitool/ipmi_event.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_EVENT_H
-#define IPMI_EVENT_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
@@ -61,6 +60,31 @@ struct platform_event_msg {
#pragma pack(0)
#endif
-int ipmi_event_main(struct ipmi_intf *, int, char **);
+/* See IPMI 2.0 Specification, Appendix G, Table G-1, "Event Commands" */
+typedef enum {
+ IPMI_CMD_SET_EVENT_RCVR = 0,
+ IPMI_CMD_GET_EVENT_RCVR,
+ IPMI_CMD_PLATFORM_EVENT
+} ipmi_event_cmd_t;
+
+typedef enum {
+ PLATFORM_EVENT_DATA_LEN_NON_SI = sizeof(struct platform_event_msg),
+ PLATFORM_EVENT_DATA_LEN_SI, /* System interfaces require generator ID */
+ PLATFORM_EVENT_DATA_LEN_MAX = PLATFORM_EVENT_DATA_LEN_SI
+} ipmi_platform_event_data_len_t;
+
+/* See Table 5-4 */
+typedef enum {
+ EVENT_SWID_BIOS_BASE = 0x00, /* BIOS */
+ EVENT_SWID_SMI_BASE = 0x10, /* SMI Handler */
+ EVENT_SWID_SMS_BASE = 0x20, /* System Management Software */
+ EVENT_SWID_OEM_BASE = 0x30, /* OEM */
+ EVENT_SWID_REMOTE_CONSOLE_BASE = 0x40, /* Remote Console SW */
+ EVENT_SWID_TERMINAL_MODE_BASE = 0x47 /* Terminal Mode RC SW */
+} ipmi_event_swid_t;
+#define EVENT_SWID(base, index) ((EVENT_SWID_##base##_BASE + index) & 0x7F)
-#endif /*IPMI_EVENT_H*/
+/* See Figure 29-2, Table 32-1 */
+#define EVENT_GENERATOR(base, index) (EVENT_SWID(base,index) << 1 | 1)
+
+int ipmi_event_main(struct ipmi_intf *, int, char **);
diff --git a/include/ipmitool/ipmi_firewall.h b/include/ipmitool/ipmi_firewall.h
index f18770e..da48d79 100644
--- a/include/ipmitool/ipmi_firewall.h
+++ b/include/ipmitool/ipmi_firewall.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_FIREWALL_H
-#define IPMI_FIREWALL_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -102,5 +101,3 @@ static inline int bit_test(const unsigned char * bf, int n) {
static inline void bit_set(unsigned char * bf, int n, int v) {
bf[n>>3] = (bf[n>>3] & ~(1<<(n%8))) | ((v?1:0)<<(n%8));
}
-
-#endif /*IPMI_FIREWALL_H */
diff --git a/include/ipmitool/ipmi_fru.h b/include/ipmitool/ipmi_fru.h
index 4d255a8..4d4d6c6 100644
--- a/include/ipmitool/ipmi_fru.h
+++ b/include/ipmitool/ipmi_fru.h
@@ -30,17 +30,19 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_FRU_H
-#define IPMI_FRU_H
+#pragma once
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
+#include <ipmitool/ipmi_time.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
+#define FRU_END_OF_FIELDS 0xc1
+
#define GET_FRU_INFO 0x10
#define GET_FRU_DATA 0x11
#define SET_FRU_DATA 0x12
@@ -193,9 +195,6 @@ struct fru_multirec_powersupply {
#pragma pack(0)
#endif
-static const char * combined_voltage_desc[] __attribute__((unused)) = {
-"12 V", "-12 V", "5 V", "3.3 V"};
-
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
@@ -297,22 +296,24 @@ struct fru_picmgext_link_desc {
unsigned int desig_channel:6;
unsigned int desig_if:2;
unsigned int desig_port:4;
-#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
+#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
-#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
-#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
+#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int ext:4;
unsigned int grouping:8;
#else
unsigned int grouping:8;
unsigned int ext:4;
-#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
+#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
-#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
-#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
+#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int desig_port:4;
unsigned int desig_if:2;
@@ -588,20 +589,28 @@ struct fru_picmgext_amc_link_desc_record {
#pragma pack(0)
#endif
+/* IPMI Return codes for Get FRU Inventory Area and Write FRU Inventory Area */
+/* PROTECTED_OFFSET Only expected on write command failures. */
+#define IPMI_CC_FRU_WRITE_PROTECTED_OFFSET 0x80
+#define IPMI_CC_FRU_DEVICE_BUSY 0x81
+
/* FRU Board manufacturing date */
-static const uint64_t secs_from_1970_1996 = 820454400;
-static const char * chassis_type_desc[] __attribute__((unused)) = {
- "Unspecified", "Other", "Unknown",
- "Desktop", "Low Profile Desktop", "Pizza Box",
- "Mini Tower", "Tower",
- "Portable", "LapTop", "Notebook", "Hand Held",
- "Docking Station", "All in One", "Sub Notebook",
- "Space-saving", "Lunch Box", "Main Server Chassis",
- "Expansion Chassis", "SubChassis", "Bus Expansion Chassis",
- "Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis",
- "Sealed-case PC", "Multi-system Chassis", "CompactPCI",
- "AdvancedTCA", "Blade", "Blade Enclosure"
-};
+#define FRU_BOARD_DATE_UNSPEC 0 /* IPMI FRU Information Storage Definition
+ v1.0 rev 1.3, Table 11-1 */
+static inline time_t ipmi_fru2time_t(void *mfg_date) {
+ const uint64_t secs_from_1970_1996 = 820454400;
+ uint32_t fru_ts = ipmi24toh(mfg_date);
+ time_t ts;
+
+ if (FRU_BOARD_DATE_UNSPEC == fru_ts) {
+ ts = IPMI_TIME_UNSPECIFIED;
+ }
+ else {
+ ts = fru_ts * 60 + secs_from_1970_1996;
+ }
+
+ return ts;
+}
typedef struct ipmi_fru_bloc {
struct ipmi_fru_bloc * next;
@@ -610,14 +619,6 @@ typedef struct ipmi_fru_bloc {
uint8_t blocId[32];
} t_ipmi_fru_bloc;
-static const char *section_id[4] = {
- "Internal Use Section",
- "Chassis Section",
- "Board Section",
- "Product Section"
-};
-
int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv);
int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru);
-
-#endif /* IPMI_FRU_H */
+char *get_fru_area_str(uint8_t *data, uint32_t *offset);
diff --git a/include/ipmitool/ipmi_fwum.h b/include/ipmitool/ipmi_fwum.h
index c19a582..e15b517 100644
--- a/include/ipmitool/ipmi_fwum.h
+++ b/include/ipmitool/ipmi_fwum.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_KFWUM_H
-# define IPMI_KFWUM_H
+#pragma once
#include <inttypes.h>
#include <ipmitool/ipmi.h>
@@ -239,5 +238,3 @@ struct KfwumFinishFirmwareDownloadReq {
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
-
-#endif /* IPMI_KFWUM_H */
diff --git a/include/ipmitool/ipmi_gendev.h b/include/ipmitool/ipmi_gendev.h
index cb18699..9291b30 100644
--- a/include/ipmitool/ipmi_gendev.h
+++ b/include/ipmitool/ipmi_gendev.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_GENDEV_H
-#define IPMI_GENDEV_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
@@ -44,5 +43,3 @@
#include <ipmitool/ipmi_entity.h>
int ipmi_gendev_main(struct ipmi_intf *, int, char **);
-
-#endif /* IPMI_GENDEV_H */
diff --git a/include/ipmitool/ipmi_hpmfwupg.h b/include/ipmitool/ipmi_hpmfwupg.h
index 71ec565..5ac8299 100644
--- a/include/ipmitool/ipmi_hpmfwupg.h
+++ b/include/ipmitool/ipmi_hpmfwupg.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_HPMFWUPG_H
-#define IPMI_HPMFWUPG_H
+#pragma once
#include <inttypes.h>
#include <ipmitool/ipmi.h>
@@ -72,23 +71,6 @@ int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **);
#define HPMFWUPG_FW_MISMATCH 0x83
#define HPMFWUPG_ROLLBACK_DENIED 0x83
-/*
- * This error code is used as a temporary PATCH to
- * the latest Open ipmi driver. This PATCH
- * will be removed once a new Open IPMI driver is released.
- * (Buggy version = 39)
- */
-#define ENABLE_OPENIPMI_V39_PATCH
-
-#ifdef ENABLE_OPENIPMI_V39_PATCH
-# define RETRY_COUNT_MAX 3
-static int errorCount;
-# define HPMFWUPG_IS_RETRYABLE(error) \
- ((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++<RETRY_COUNT_MAX))?TRUE:FALSE)
-#else
-# define HPMFWUPG_IS_RETRYABLE(error) FALSE
-#endif
-
/* HPM FIRMWARE UPGRADE GENERAL DEFINITIONS */
#define HPMFWUPG_PICMG_IDENTIFIER 0
#define HPMFWUPG_VERSION_SIZE 6
@@ -437,7 +419,7 @@ struct HpmfwupgInitiateUpgradeActionCtx {
struct HpmfwupgUploadFirmwareBlockReq {
unsigned char picmgId;
unsigned char blockNumber;
- unsigned char data[0];
+ unsigned char data[];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
@@ -800,10 +782,6 @@ typedef struct _VERSIONINFO {
char descString[HPMFWUPG_DESC_STRING_LENGTH + 1];
}VERSIONINFO, *PVERSIONINFO;
-VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX];
-
#define TARGET_VER (0x01)
#define ROLLBACK_VER (0x02)
#define IMAGE_VER (0x04)
-
-#endif /* IPMI_KFWUM_H */
diff --git a/include/ipmitool/ipmi_ime.h b/include/ipmitool/ipmi_ime.h
index 734ddb3..b92aea2 100755..100644
--- a/include/ipmitool/ipmi_ime.h
+++ b/include/ipmitool/ipmi_ime.h
@@ -33,13 +33,10 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_IME_H
-#define IPMI_IME_H
+#pragma once
#include <inttypes.h>
#include <ipmitool/ipmi.h>
int ipmi_ime_main(struct ipmi_intf *, int, char **);
-
-#endif /* IPMI_IME_H */
diff --git a/include/ipmitool/ipmi_intf.h b/include/ipmitool/ipmi_intf.h
index 67f6019..49a9ecd 100644
--- a/include/ipmitool/ipmi_intf.h
+++ b/include/ipmitool/ipmi_intf.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_INTF_H
-#define IPMI_INTF_H
+#pragma once
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_oem.h>
@@ -59,16 +58,48 @@ enum LANPLUS_SESSION_STATE {
#define IPMI_AUTHCODE_BUFFER_SIZE 20
-#define IPMI_SIK_BUFFER_SIZE 20
+#define IPMI_SIK_BUFFER_SIZE IPMI_MAX_MD_SIZE
#define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */
+enum cipher_suite_ids {
+ IPMI_LANPLUS_CIPHER_SUITE_0 = 0,
+ IPMI_LANPLUS_CIPHER_SUITE_1 = 1,
+ IPMI_LANPLUS_CIPHER_SUITE_2 = 2,
+ IPMI_LANPLUS_CIPHER_SUITE_3 = 3,
+ IPMI_LANPLUS_CIPHER_SUITE_4 = 4,
+ IPMI_LANPLUS_CIPHER_SUITE_5 = 5,
+ IPMI_LANPLUS_CIPHER_SUITE_6 = 6,
+ IPMI_LANPLUS_CIPHER_SUITE_7 = 7,
+ IPMI_LANPLUS_CIPHER_SUITE_8 = 8,
+ IPMI_LANPLUS_CIPHER_SUITE_9 = 9,
+ IPMI_LANPLUS_CIPHER_SUITE_10 = 10,
+ IPMI_LANPLUS_CIPHER_SUITE_11 = 11,
+ IPMI_LANPLUS_CIPHER_SUITE_12 = 12,
+ IPMI_LANPLUS_CIPHER_SUITE_13 = 13,
+ IPMI_LANPLUS_CIPHER_SUITE_14 = 14,
+#ifdef HAVE_CRYPTO_SHA256
+ IPMI_LANPLUS_CIPHER_SUITE_15 = 15,
+ IPMI_LANPLUS_CIPHER_SUITE_16 = 16,
+ IPMI_LANPLUS_CIPHER_SUITE_17 = 17,
+#endif /* HAVE_CRYPTO_SHA256 */
+ IPMI_LANPLUS_CIPHER_SUITE_RESERVED = 0xff,
+};
+
+struct cipher_suite_info {
+ enum cipher_suite_ids cipher_suite_id;
+ uint8_t auth_alg;
+ uint8_t integrity_alg;
+ uint8_t crypt_alg;
+ uint32_t iana;
+};
+
struct ipmi_session_params {
char * hostname;
uint8_t username[17];
uint8_t authcode_set[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t authtype_set;
uint8_t privlvl;
- uint8_t cipher_suite_id;
+ enum cipher_suite_ids cipher_suite_id;
char sol_escape_char;
int password;
int port;
@@ -119,7 +150,7 @@ struct ipmi_session {
uint32_t bmc_id;
/*
- * Values required for RAKP mesages
+ * Values required for RAKP messages
*/
/* Random number generated byt the console */
@@ -131,10 +162,13 @@ struct ipmi_session {
uint8_t requested_role; /* As sent in the RAKP 1 message */
uint8_t rakp2_return_code;
- uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */
- uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
- uint8_t k1[20]; /* Used for Integrity checking? */
- uint8_t k2[20]; /* First 16 bytes used for AES */
+ uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */
+ uint8_t sik_len; /* Session Integrity key length */
+ uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
+ uint8_t k1[IPMI_MAX_MD_SIZE]; /* Used for Integrity checking? */
+ uint8_t k1_len; /* K1 key length */
+ uint8_t k2[IPMI_MAX_MD_SIZE]; /* First 16 bytes used for AES */
+ uint8_t k2_len; /* K2 key length */
} v2_data;
@@ -198,7 +232,6 @@ struct ipmi_intf {
int (*open)(struct ipmi_intf * intf);
void (*close)(struct ipmi_intf * intf);
struct ipmi_rs *(*sendrecv)(struct ipmi_intf * intf, struct ipmi_rq * req);
- int (*sendrsp)(struct ipmi_intf * intf, struct ipmi_rs * rsp);
struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf);
struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload);
int (*keepalive)(struct ipmi_intf * intf);
@@ -207,6 +240,10 @@ struct ipmi_intf {
void (*set_max_response_data_size)(struct ipmi_intf * intf, uint16_t size);
};
+uint16_t ipmi_intf_get_max_request_data_size(struct ipmi_intf *intf);
+uint16_t ipmi_intf_get_max_response_data_size(struct ipmi_intf *intf);
+uint8_t ipmi_intf_get_bridging_level(const struct ipmi_intf *intf);
+
struct ipmi_intf * ipmi_intf_load(char * name);
void ipmi_intf_print(struct ipmi_intf_support * intflist);
@@ -215,9 +252,12 @@ void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password);
void ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t privlvl);
void ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit);
-void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id);
+#ifdef IPMI_INTF_LANPLUS
+void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf,
+ enum cipher_suite_ids cipher_suite_id);
+#endif /* IPMI_INTF_LANPLUS */
void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char);
-void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey);
+void ipmi_intf_session_set_kgkey(struct ipmi_intf *intf, const uint8_t *kgkey);
void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port);
void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype);
void ipmi_intf_session_set_timeout(struct ipmi_intf * intf, uint32_t timeout);
@@ -228,4 +268,3 @@ void ipmi_cleanup(struct ipmi_intf * intf);
#if defined(IPMI_INTF_LAN) || defined (IPMI_INTF_LANPLUS)
int ipmi_intf_socket_connect(struct ipmi_intf * intf);
#endif
-#endif /* IPMI_INTF_H */
diff --git a/include/ipmitool/ipmi_isol.h b/include/ipmitool/ipmi_isol.h
index e52279e..5514c21 100644
--- a/include/ipmitool/ipmi_isol.h
+++ b/include/ipmitool/ipmi_isol.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_ISOL_H
-#define IPMI_ISOL_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -53,5 +52,3 @@ struct isol_config_parameters {
};
int ipmi_isol_main(struct ipmi_intf *, int, char **);
-
-#endif /* IPMI_SOL_H */
diff --git a/include/ipmitool/ipmi_kontronoem.h b/include/ipmitool/ipmi_kontronoem.h
index d3925df..10222bd 100644
--- a/include/ipmitool/ipmi_kontronoem.h
+++ b/include/ipmitool/ipmi_kontronoem.h
@@ -1,46 +1,43 @@
-/*
- * Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
- *
- * Base on code from
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistribution in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind.
- * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
- * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
- * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
- * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
- * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
- * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
- * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
- * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
- * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef IPMI_KONTRONOEM_H
-#define IPMI_KONTRONOEM_H
-
-#include <inttypes.h>
-#include <ipmitool/ipmi.h>
-
-
-int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
-int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size);
-
-#endif /* IPMI_KONTRONOEM_H */
+/*
+ * Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
+ *
+ * Base on code from
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
+ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
+ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
+ * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
+ * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
+ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
+ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#pragma once
+
+#include <inttypes.h>
+#include <ipmitool/ipmi.h>
+
+
+int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
+int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size);
diff --git a/include/ipmitool/ipmi_lanp.h b/include/ipmitool/ipmi_lanp.h
index ba25582..e312b25 100644
--- a/include/ipmitool/ipmi_lanp.h
+++ b/include/ipmitool/ipmi_lanp.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LANP_H
-#define IPMI_LANP_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -50,6 +49,13 @@
#define IPMI_LANP_WRITE_LOCK 1
#define IPMI_LANP_WRITE_COMMIT 2
+#define IPMI_LANP_VLAN_ID_MAX 4094
+#define IPMI_LANP_VLAN_ID_MIN 1
+#define IPMI_LANP_VLAN_DISABLE 0 /* ID 0 = VLAN is disabled for the channel */
+
+#define IPMI_LANP_IS_VLAN_VALID(x) \
+ ((x) >= IPMI_LANP_VLAN_ID_MIN && (x) <= IPMI_LANP_VLAN_ID_MAX)
+
enum {
IPMI_LANP_SET_IN_PROGRESS,
IPMI_LANP_AUTH_TYPE,
@@ -78,6 +84,37 @@ enum {
IPMI_LANP_RMCP_PRIV_LEVELS,
IPMI_LANP_VLAN_TAGS,
IPMI_LANP_BAD_PASS_THRESH,
+ IPMI_LANP_IP6_SUPPORT=50,
+ IPMI_LANP_IP6_ENABLES,
+ IPMI_LANP_IP6_TRAFFIC_CLASS,
+ IPMI_LANP_IP6_STATIC_HOPS,
+ IPMI_LANP_IP6_FLOW_LABEL,
+ IPMI_LANP_IP6_STATUS,
+ IPMI_LANP_IP6_STATIC_ADDR,
+ IPMI_LANP_IP6_STATIC_DUID_STG,
+ IPMI_LANP_IP6_STATIC_DUID,
+ IPMI_LANP_IP6_DYNAMIC_ADDR,
+ IPMI_LANP_IP6_DYNAMIC_DUID_STG,
+ IPMI_LANP_IP6_DYNAMIC_DUID,
+ IPMI_LANP_IP6_DHCP6_CFG_SUP,
+ IPMI_LANP_IP6_DHCP6_CFG,
+ IPMI_LANP_IP6_ROUTER_CFG,
+ IPMI_LANP_IP6_STATIC_RTR1_ADDR,
+ IPMI_LANP_IP6_STATIC_RTR1_MAC,
+ IPMI_LANP_IP6_STATIC_RTR1_PFX_LEN,
+ IPMI_LANP_IP6_STATIC_RTR1_PFX,
+ IPMI_LANP_IP6_STATIC_RTR2_ADDR,
+ IPMI_LANP_IP6_STATIC_RTR2_MAC,
+ IPMI_LANP_IP6_STATIC_RTR2_PFX_LEN,
+ IPMI_LANP_IP6_STATIC_RTR2_PFX,
+ IPMI_LANP_IP6_NUM_DYNAMIC_RTRS,
+ IPMI_LANP_IP6_DYNAMIC_RTR_ADDR,
+ IPMI_LANP_IP6_DYNAMIC_RTR_MAC,
+ IPMI_LANP_IP6_DYNAMIC_RTR_PFX_LEN,
+ IPMI_LANP_IP6_DYNAMIC_RTR_PFX,
+ IPMI_LANP_IP6_DYNAMIC_HOPS,
+ IPMI_LANP_IP6_NDSLAAC_CFG_SUP,
+ IPMI_LANP_IP6_NDSLAAC_CFG,
IPMI_LANP_OEM_ALERT_STRING=96,
IPMI_LANP_ALERT_RETRY=97,
IPMI_LANP_UTC_OFFSET=98,
@@ -87,49 +124,6 @@ enum {
IPMI_LANP_CHAN_ACCESS_MODE=201,
};
-static struct lan_param {
- int cmd;
- int size;
- char desc[24];
- uint8_t * data;
- int data_len;
-} ipmi_lan_params[] __attribute__((unused)) = {
- { IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress", NULL, 0 },
- { IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support", NULL, 0 },
- { IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable", NULL, 0 },
- { IPMI_LANP_IP_ADDR, 4, "IP Address", NULL, 0 },
- { IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source", NULL, 0 },
- { IPMI_LANP_MAC_ADDR, 6, "MAC Address", NULL, 0 }, /* 5 */
- { IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask", NULL, 0 },
- { IPMI_LANP_IP_HEADER, 3, "IP Header", NULL, 0 },
- { IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port", NULL, 0 },
- { IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port", NULL, 0 },
- { IPMI_LANP_BMC_ARP, 1, "BMC ARP Control", NULL, 0}, /* 10 */
- { IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl", NULL, 0 },
- { IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP", NULL, 0 },
- { IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC", NULL, 0 },
- { IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP", NULL, 0 },
- { IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC", NULL, 0 }, /* 15 */
- { IPMI_LANP_SNMP_STRING, 18, "SNMP Community String", NULL, 0 },
- { IPMI_LANP_NUM_DEST, 1, "Number of Destinations", NULL, 0 },
- { IPMI_LANP_DEST_TYPE, 4, "Destination Type", NULL, 0 },
- { IPMI_LANP_DEST_ADDR, 13, "Destination Addresses", NULL, 0 },
- { IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID", NULL, 0 }, /* 20 */
- { IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority", NULL, 0 },
- { IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count", NULL, 0 },
- { IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites", NULL, 0 },
- { IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max", NULL, 0 },
- { IPMI_LANP_BAD_PASS_THRESH, 6, "Bad Password Threshold", NULL, 0 },
- { IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String", NULL, 0 }, /* 25 */
- { IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm", NULL, 0 },
- { IPMI_LANP_UTC_OFFSET, 3, "UTC Offset", NULL, 0 },
- { IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP", NULL, 0 },
- { IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC", NULL, 0},
- { IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable", NULL, 0 }, /* 30 */
- { IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode", NULL, 0 },
- { -1 }
-};
-
int ipmi_lanp_main(struct ipmi_intf *, int, char **);
-#endif /*IPMI_LANP_H*/
+uint8_t find_lan_channel(struct ipmi_intf *intf, uint8_t start);
diff --git a/include/ipmitool/ipmi_lanp6.h b/include/ipmitool/ipmi_lanp6.h
new file mode 100644
index 0000000..fe987d3
--- /dev/null
+++ b/include/ipmitool/ipmi_lanp6.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2016 Pentair Technical Products. All right reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Pentair Technical Products or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * PENTAIR TECHNICAL SOLUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <ipmitool/ipmi_intf.h>
+
+/*
+ * LAN configuration parameter.
+ */
+struct ipmi_lanp {
+ int selector;
+ const char *name;
+ int size;
+};
+
+/*
+ * Private data for LAN configuration.
+ */
+struct ipmi_lanp_priv {
+ struct ipmi_intf *intf;
+ int channel;
+};
diff --git a/include/ipmitool/ipmi_main.h b/include/ipmitool/ipmi_main.h
index e32360a..76fe602 100644
--- a/include/ipmitool/ipmi_main.h
+++ b/include/ipmitool/ipmi_main.h
@@ -30,13 +30,10 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_MAIN_H
-#define IPMI_MAIN_H
+#pragma once
#include <ipmitool/ipmi_intf.h>
int ipmi_main(int argc, char ** argv, struct ipmi_cmd * cmdlist, struct ipmi_intf_support * intflist);
void ipmi_cmd_print(struct ipmi_cmd * cmdlist);
int ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv);
-
-#endif /* IPMI_MAIN_H */
diff --git a/include/ipmitool/ipmi_mc.h b/include/ipmitool/ipmi_mc.h
index a840f78..65cba84 100644
--- a/include/ipmitool/ipmi_mc.h
+++ b/include/ipmitool/ipmi_mc.h
@@ -30,10 +30,19 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_MC_H
-#define IPMI_MC_H
+#pragma once
+
+#include <stdbool.h>
#include <ipmitool/ipmi.h>
+#include <ipmitool/helper.h>
+#include <ipmitool/ipmi_strings.h>
+
+#define OEM_MFG_STRING(oem) val2str(IPM_DEV_MANUFACTURER_ID(oem),\
+ ipmi_oem_info)
+#define OEM_PROD_STRING(oem, p) oemval2str(IPM_DEV_MANUFACTURER_ID(oem),\
+ ipmi16toh(p),\
+ ipmi_oem_product_info)
#define BMC_GET_DEVICE_ID 0x01
#define BMC_COLD_RESET 0x02
@@ -74,7 +83,7 @@ struct ipm_devid_rsp {
#define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* BCD-enoded */
#define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */
-#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */
+#define IPM_DEV_FWREV1_MAJOR_MASK (0x7f) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */
@@ -84,11 +93,126 @@ struct ipm_devid_rsp {
#define IPM_DEV_IPMI_VERSION_MINOR(x) \
((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT)
-#define IPM_DEV_MANUFACTURER_ID(x) \
- ((uint32_t) ((x[2] & 0x0F) << 16 | x[1] << 8 | x[0]))
+#define IPM_DEV_MANUFACTURER_ID_RESERVED 0x0FFFFF
+#define IPM_DEV_MANUFACTURER_ID(x) ipmi24toh(x)
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
+/* There are lots of BMC implementations that don't follow the IPMI
+ * specification for GUID encoding. Some send data encoded as in
+ * RFC4122, some follow SMBIOS specification. We support all users
+ * of those buggy implementations here.
+ *
+ * Most implementations like AMI MegaRAC do it the SMBIOS way.
+ * This is the legacy behavior we don't want to break yet.
+ * That's why the last real mode is GUID_SMBIOS. If automatic
+ * detection finds more than one possible candidate, and
+ * GUID_SMBIOS is one of them, then it will take precedence.
+ *
+ * For the same reason GUID_IPMI is right before GUID_SMBIOS.
+ * If both RFC4122 and IPMI encodings have a valid version
+ * field, then IPMI takes precedence.
+ */
+typedef enum {
+ /* Real modes, in reverse precedence order */
+ GUID_RFC4122,
+ GUID_IPMI,
+ GUID_SMBIOS,
+ GUID_REAL_MODES, /* Real mode count*/
+ /* Pseudo modes start here */
+ GUID_AUTO = GUID_REAL_MODES, /* Automatically detect mode */
+ GUID_DUMP, /* Just dump the data */
+ GUID_TOTAL_MODES
+} ipmi_guid_mode_t;
+
+#define GUID_NODE_SZ 6
+
+#define GUID_VER_MASK 0x0F
+#define GUID_VER_SHIFT 12
+#define GUID_VERSION(t_hi) (((t_hi) >> GUID_VER_SHIFT) & GUID_VER_MASK)
+#define GUID_TIME_HI(t_hi) ((t_hi) & ~(GUID_VER_MASK << GUID_VER_SHIFT))
+
+typedef enum {
+ GUID_VERSION_UNKNOWN = 0, /* Not valid according to any specification */
+
+ /* The following are according to IPMI/SMBIOS/RFC4122 */
+ GUID_VERSION_TIME, /* Time-based, recommended for IPMI */
+ GUID_VERSION_DCE, /* DCE Security with POSIX UIDs, not for IPMI */
+ GUID_VERSION_MD5, /* Name-based, using MD5 */
+ GUID_VERSION_RND, /* Randomly generated */
+ GUID_VERSION_SHA1, /* Name-based, using SHA-1 */
+
+ GUID_VERSION_MAX = GUID_VERSION_SHA1, /* The maximum supported version */
+ GUID_VERSION_COUNT /* The number of supported versions */
+} guid_version_t;
+
+static inline bool is_guid_version_valid(guid_version_t ver)
+{
+ return (ver > GUID_VERSION_UNKNOWN) && (ver <= GUID_VERSION_MAX);
+}
+
+/* The structure follows IPMI v2.0, rev 1.1
+ * See section 20.8 */
+#ifdef HAVE_PRAGMA_PACK
+#pragma pack(1)
+#endif
+typedef struct {
+ uint8_t node[GUID_NODE_SZ]; /* Byte 0 is LSB */
+ union {
+ struct {
+ uint8_t clock_seq_low; /* clock sequence low field */
+ uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */
+ };
+ uint16_t clock_seq_and_rsvd;
+ };
+ uint16_t time_hi_and_version; /* timestamp high field and version number */
+ uint16_t time_mid; /* timestamp middle field */
+ uint32_t time_low; /* timestamp low field */
+} ATTRIBUTE_PACKING ipmi_guid_t;
+#ifdef HAVE_PRAGMA_PACK
+#pragma pack(0)
+#endif
+
+/* The structure follows RFC4122 (section 4.1.2)
+ * and SMBIOS v3.0.0 (section 7.2.1) */
+#ifdef HAVE_PRAGMA_PACK
+#pragma pack(1)
+#endif
+typedef struct {
+ uint32_t time_low; /* timestamp low field */
+ uint16_t time_mid; /* timestamp middle field */
+ uint16_t time_hi_and_version; /* timestamp high field and version number */
+ union {
+ struct {
+ uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */
+ uint8_t clock_seq_low; /* clock sequence low field */
+ };
+ uint16_t clock_seq_and_rsvd;
+ };
+ uint8_t node[GUID_NODE_SZ]; /* Byte 0 is MSB */
+} ATTRIBUTE_PACKING rfc_guid_t;
+#ifdef HAVE_PRAGMA_PACK
+#pragma pack(0)
+#endif
+
+/* Parsed GUID structure */
+typedef struct {
+ uint8_t node[GUID_NODE_SZ]; /* MSB first */
+ /* These are architecture-specific for easy output with printf() */
+ uint16_t clock_seq_and_rsvd;
+ uint64_t time_hi_and_version;
+ uint64_t time_mid;
+ uint64_t time_low;
+ /* These are the parsed values */
+ time_t time;
+ ipmi_guid_mode_t mode;
+ guid_version_t ver; /* Version from time_hi_and_version, if valid */
+} parsed_guid_t;
+
+parsed_guid_t ipmi_parse_guid(void *guid, ipmi_guid_mode_t guid_mode);
+
+int _ipmi_mc_get_guid(struct ipmi_intf *intf, ipmi_guid_t *guid);
+
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
@@ -119,14 +243,24 @@ struct ipm_selftest_rsp {
#pragma pack(1)
#endif
struct ipm_get_watchdog_rsp {
- unsigned char timer_use;
- unsigned char timer_actions;
+ unsigned char use;
+ unsigned char intr_action;
unsigned char pre_timeout;
- unsigned char timer_use_exp;
- unsigned char initial_countdown_lsb;
- unsigned char initial_countdown_msb;
- unsigned char present_countdown_lsb;
- unsigned char present_countdown_msb;
+ unsigned char exp_flags;
+ union {
+ struct {
+ unsigned char initial_countdown_lsb;
+ unsigned char initial_countdown_msb;
+ };
+ uint16_t init_cnt_le;
+ };
+ union {
+ struct {
+ unsigned char present_countdown_lsb;
+ unsigned char present_countdown_msb;
+ };
+ uint16_t pres_cnt_le;
+ };
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@@ -151,6 +285,25 @@ struct ipm_get_watchdog_rsp {
#define IPM_WATCHDOG_CLEAR_BIOS_POST 0x04
#define IPM_WATCHDOG_CLEAR_BIOS_FRB2 0x02
+/* Use */
+#define IPMI_WDT_USE_NOLOG_SHIFT 7
+#define IPMI_WDT_USE_DONTSTOP_SHIFT 6 /* For 'set' */
+#define IPMI_WDT_USE_RUNNING_SHIFT 6 /* For 'get' */
+#define IPMI_WDT_USE_SHIFT 0
+#define IPMI_WDT_USE_MASK 0x07
+
+/* Pre-timeout interrupt type */
+#define IPMI_WDT_INTR_SHIFT 4
+#define IPMI_WDT_INTR_MASK 0x07 /* Apply to the intr value, not to the data byte */
+
+/* Action */
+#define IPMI_WDT_ACTION_SHIFT 0
+#define IPMI_WDT_ACTION_MASK 0x07
+
+#define IPMI_WDT_GET(b, s) (((b) >> (IPMI_WDT_##s##_SHIFT)) & (IPMI_WDT_##s##_MASK))
+
+#define IS_WDT_BIT(b, s) IS_SET((b), IPMI_WDT_##s##_SHIFT)
+
/* IPMI 2.0 command for system information*/
#define IPMI_SET_SYS_INFO 0x58
#define IPMI_GET_SYS_INFO 0x59
@@ -165,9 +318,9 @@ struct ipm_get_watchdog_rsp {
#define IPMI_SYSINFO_OS_NAME 0x04
#define IPMI_SYSINFO_DELL_OS_VERSION 0xe4
#define IPMI_SYSINFO_DELL_URL 0xde
+#define IPMI_SYSINFO_DELL_IPV6_COUNT 0xe6
+#define IPMI_SYSINFO_DELL_IPV6_DESTADDR 0xf0
int ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
int len, void *buffer);
int ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer);
-
-#endif /*IPMI_MC_H */
diff --git a/include/ipmitool/ipmi_oem.h b/include/ipmitool/ipmi_oem.h
index ad22fde..4d4c518 100644
--- a/include/ipmitool/ipmi_oem.h
+++ b/include/ipmitool/ipmi_oem.h
@@ -28,8 +28,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_OEM_H
-#define IPMI_OEM_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -43,5 +42,3 @@ struct ipmi_oem_handle {
void ipmi_oem_print(void);
int ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype);
int ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype);
-
-#endif /*IPMI_OEM_H*/
diff --git a/include/ipmitool/ipmi_pef.h b/include/ipmitool/ipmi_pef.h
index cdea4ec..a324997 100644
--- a/include/ipmitool/ipmi_pef.h
+++ b/include/ipmitool/ipmi_pef.h
@@ -30,8 +30,7 @@
* EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_PEF_H
-#define IPMI_PEF_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -40,7 +39,7 @@
struct pef_capabilities { /* "get pef capabilities" response */
uint8_t version;
uint8_t actions; /* mapped by PEF_ACTION_xxx */
- uint8_t tblsize;
+ uint8_t event_filter_count;
};
typedef enum {
@@ -111,224 +110,6 @@ struct bit_desc_map { /* description text container */
struct desc_map desc_maps[128];
};
-static struct bit_desc_map
-pef_b2s_actions __attribute__((unused)) = {
-BIT_DESC_MAP_ALL,
-{ {"Alert", PEF_ACTION_ALERT},
- {"Power-off", PEF_ACTION_POWER_DOWN},
- {"Reset", PEF_ACTION_RESET},
- {"Power-cycle", PEF_ACTION_POWER_CYCLE},
- {"OEM-defined", PEF_ACTION_OEM},
- {"Diagnostic-interrupt", PEF_ACTION_DIAGNOSTIC_INTERRUPT},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_severities __attribute__((unused)) = {
-BIT_DESC_MAP_ANY,
-{ {"Non-recoverable", PEF_SEVERITY_NON_RECOVERABLE},
- {"Critical", PEF_SEVERITY_CRITICAL},
- {"Warning", PEF_SEVERITY_WARNING},
- {"OK", PEF_SEVERITY_OK},
- {"Information", PEF_SEVERITY_INFORMATION},
- {"Monitor", PEF_SEVERITY_MONITOR},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_sensortypes __attribute__((unused)) = {
-BIT_DESC_MAP_LIST,
-{ {"Any", 255},
- {"Temperature", 1},
- {"Voltage", 2},
- {"Current", 3},
- {"Fan", 4},
- {"Chassis Intrusion", 5},
- {"Platform security breach", 6},
- {"Processor", 7},
- {"Power supply", 8},
- {"Power Unit", 9},
- {"Cooling device", 10},
- {"Other (units-based)", 11},
- {"Memory", 12},
- {"Drive Slot", 13},
- {"POST memory resize", 14},
- {"POST error", 15},
- {"Logging disabled", 16},
- {"Watchdog 1", 17},
- {"System event", 18},
- {"Critical Interrupt", 19},
- {"Button", 20},
- {"Module/board", 21},
- {"uController/coprocessor", 22},
- {"Add-in card", 23},
- {"Chassis", 24},
- {"Chipset", 25},
- {"Other (FRU)", 26},
- {"Cable/interconnect", 27},
- {"Terminator", 28},
- {"System boot", 29},
- {"Boot error", 30},
- {"OS boot", 31},
- {"OS critical stop", 32},
- {"Slot/connector", 33},
- {"ACPI power state", 34},
- {"Watchdog 2", 35},
- {"Platform alert", 36},
- {"Entity presence", 37},
- {"Monitor ASIC/IC", 38},
- {"LAN", 39},
- {"Management subsytem health",40},
- {"Battery", 41},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_1 = {
-BIT_DESC_MAP_LIST,
-{ {"<LNC", 0}, /* '<' : getting worse */
- {">LNC", 1}, /* '>' : getting better */
- {"<LC", 2},
- {">LC", 3},
- {"<LNR", 4},
- {">LNR", 5},
- {">UNC", 6},
- {"<UNC", 7},
- {">UC", 8},
- {"<UC", 9},
- {">UNR", 10},
- {"<UNR", 11},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_2 = {
-BIT_DESC_MAP_LIST,
-{ {"transition to idle", 0},
- {"transition to active", 1},
- {"transition to busy", 2},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_3 = {
-BIT_DESC_MAP_LIST,
-{ {"state deasserted", 0},
- {"state asserted", 1},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_4 = {
-BIT_DESC_MAP_LIST,
-{ {"predictive failure deasserted", 0},
- {"predictive failure asserted", 1},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_5 = {
-BIT_DESC_MAP_LIST,
-{ {"limit not exceeded", 0},
- {"limit exceeded", 1},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_6 = {
-BIT_DESC_MAP_LIST,
-{ {"performance met", 0},
- {"performance lags", 1},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_7 = {
-BIT_DESC_MAP_LIST,
-{ {"ok", 0},
- {"<warn", 1}, /* '<' : getting worse */
- {"<fail", 2},
- {"<dead", 3},
- {">warn", 4}, /* '>' : getting better */
- {">fail", 5},
- {"dead", 6},
- {"monitor", 7},
- {"informational", 8},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_8 = {
-BIT_DESC_MAP_LIST,
-{ {"device removed/absent", 0},
- {"device inserted/present", 1},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_9 = {
-BIT_DESC_MAP_LIST,
-{ {"device disabled", 0},
- {"device enabled", 1},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_10 = {
-BIT_DESC_MAP_LIST,
-{ {"transition to running", 0},
- {"transition to in test", 1},
- {"transition to power off", 2},
- {"transition to online", 3},
- {"transition to offline", 4},
- {"transition to off duty", 5},
- {"transition to degraded", 6},
- {"transition to power save", 7},
- {"install error", 8},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_11 = {
-BIT_DESC_MAP_LIST,
-{ {"fully redundant", 0},
- {"redundancy lost", 1},
- {"redundancy degraded", 2},
- {"<non-redundant/sufficient", 3}, /* '<' : getting worse */
- {">non-redundant/sufficient", 4}, /* '>' : getting better */
- {"non-redundant/insufficient", 5},
- {"<redundancy degraded", 6},
- {">redundancy degraded", 7},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_gentype_12 = {
-BIT_DESC_MAP_LIST,
-{ {"D0 power state", 0},
- {"D1 power state", 1},
- {"D2 power state", 2},
- {"D3 power state", 3},
- {NULL}
-} };
-
-static struct bit_desc_map *
-pef_b2s_generic_ER[] __attribute__((unused)) = {
- &pef_b2s_gentype_1,
- &pef_b2s_gentype_2,
- &pef_b2s_gentype_3,
- &pef_b2s_gentype_4,
- &pef_b2s_gentype_5,
- &pef_b2s_gentype_6,
- &pef_b2s_gentype_7,
- &pef_b2s_gentype_8,
- &pef_b2s_gentype_9,
- &pef_b2s_gentype_10,
- &pef_b2s_gentype_11,
- &pef_b2s_gentype_12,
-};
-#define PEF_B2S_GENERIC_ER_ENTRIES \
- (sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0]))
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -336,6 +117,7 @@ pef_b2s_generic_ER[] __attribute__((unused)) = {
struct pef_policy_entry {
#define PEF_POLICY_ID_MASK 0xf0
#define PEF_POLICY_ID_SHIFT 4
+#define PEF_POLICY_DISABLED 0xF7
#define PEF_POLICY_ENABLED 0x08
#define PEF_POLICY_FLAGS_MASK 0x07
#define PEF_POLICY_FLAGS_MATCH_ALWAYS 0
@@ -355,46 +137,6 @@ struct pef_policy_entry {
#pragma pack(0)
#endif
-static struct bit_desc_map
-pef_b2s_policies __attribute__((unused)) = {
-BIT_DESC_MAP_LIST,
-{ {"Match-always", PEF_POLICY_FLAGS_MATCH_ALWAYS},
- {"Try-next-entry", PEF_POLICY_FLAGS_PREV_OK_SKIP},
- {"Try-next-set", PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET},
- {"Try-next-channel", PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET},
- {"Try-next-destination", PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET},
- {NULL}
-} };
-
-static struct bit_desc_map
-pef_b2s_ch_medium __attribute__((unused)) = {
-#define PEF_CH_MEDIUM_TYPE_IPMB 1
-#define PEF_CH_MEDIUM_TYPE_ICMB_10 2
-#define PEF_CH_MEDIUM_TYPE_ICMB_09 3
-#define PEF_CH_MEDIUM_TYPE_LAN 4
-#define PEF_CH_MEDIUM_TYPE_SERIAL 5
-#define PEF_CH_MEDIUM_TYPE_XLAN 6
-#define PEF_CH_MEDIUM_TYPE_PCI_SMBUS 7
-#define PEF_CH_MEDIUM_TYPE_SMBUS_V1X 8
-#define PEF_CH_MEDIUM_TYPE_SMBUS_V2X 9
-#define PEF_CH_MEDIUM_TYPE_USB_V1X 10
-#define PEF_CH_MEDIUM_TYPE_USB_V2X 11
-#define PEF_CH_MEDIUM_TYPE_SYSTEM 12
-BIT_DESC_MAP_LIST,
-{ {"IPMB (I2C)", PEF_CH_MEDIUM_TYPE_IPMB},
- {"ICMB v1.0", PEF_CH_MEDIUM_TYPE_ICMB_10},
- {"ICMB v0.9", PEF_CH_MEDIUM_TYPE_ICMB_09},
- {"802.3 LAN", PEF_CH_MEDIUM_TYPE_LAN},
- {"Serial/Modem (RS-232)", PEF_CH_MEDIUM_TYPE_SERIAL},
- {"Other LAN", PEF_CH_MEDIUM_TYPE_XLAN},
- {"PCI SMBus", PEF_CH_MEDIUM_TYPE_PCI_SMBUS},
- {"SMBus v1.0/1.1", PEF_CH_MEDIUM_TYPE_SMBUS_V1X},
- {"SMBus v2.0", PEF_CH_MEDIUM_TYPE_SMBUS_V2X},
- {"USB 1.x", PEF_CH_MEDIUM_TYPE_USB_V1X},
- {"USB 2.x", PEF_CH_MEDIUM_TYPE_USB_V2X},
- {"System I/F (KCS,SMIC,BT)", PEF_CH_MEDIUM_TYPE_SYSTEM},
- {NULL}
-} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -449,15 +191,6 @@ struct pef_cfgparm_control {
#pragma pack(0)
#endif
-static struct bit_desc_map
-pef_b2s_control __attribute__((unused)) = {
-BIT_DESC_MAP_ALL,
-{ {"PEF", PEF_CONTROL_ENABLE},
- {"PEF event messages", PEF_CONTROL_ENABLE_EVENT_MESSAGES},
- {"PEF startup delay", PEF_CONTROL_ENABLE_STARTUP_DELAY},
- {"Alert startup delay", PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY},
- {NULL}
-} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -510,7 +243,9 @@ struct pef_cfgparm_filter_table_size {
#pragma pack(1)
#endif
struct pef_cfgparm_filter_table_entry {
-#define PEF_FILTER_TABLE_ID_MASK 0x7f
+# define PEF_FILTER_DISABLED 0x7F
+# define PEF_FILTER_ENABLED 0x80
+# define PEF_FILTER_TABLE_ID_MASK 0x7F
uint8_t data1;
struct pef_table_entry entry;
} ATTRIBUTE_PACKING;
@@ -522,8 +257,8 @@ struct pef_cfgparm_filter_table_entry {
#pragma pack(1)
#endif
struct pef_cfgparm_filter_table_data_1 {
- uint8_t data1;
- uint8_t data2;
+ uint8_t id;
+ uint8_t cfg;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@@ -653,15 +388,6 @@ struct pef_lan_cfgparm_dest_type {
#pragma pack(0)
#endif
-static struct bit_desc_map
-pef_b2s_lan_desttype __attribute__((unused)) = {
-BIT_DESC_MAP_LIST,
-{ {"Acknowledged", PEF_LAN_DEST_TYPE_ACK},
- {"PET", PEF_LAN_DEST_TYPE_PET},
- {"OEM 1", PEF_LAN_DEST_TYPE_OEM_1},
- {"OEM 2", PEF_LAN_DEST_TYPE_OEM_2},
- {NULL}
-} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -752,18 +478,6 @@ struct pef_serial_cfgparm_dest_info {
#pragma pack(0)
#endif
-static struct bit_desc_map
-pef_b2s_serial_desttype __attribute__((unused)) = {
-BIT_DESC_MAP_LIST,
-{ {"Acknowledged", PEF_SERIAL_DEST_TYPE_ACK},
- {"TAP page", PEF_SERIAL_DEST_TYPE_TAP},
- {"PPP PET", PEF_SERIAL_DEST_TYPE_PPP},
- {"Basic callback", PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK},
- {"PPP callback", PEF_SERIAL_DEST_TYPE_PPP_CALLBACK},
- {"OEM 1", PEF_SERIAL_DEST_TYPE_OEM_1},
- {"OEM 2", PEF_SERIAL_DEST_TYPE_OEM_2},
- {NULL}
-} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -832,14 +546,6 @@ struct pef_serial_cfgparm_tap_svc_settings {
#pragma pack(0)
#endif
-static struct bit_desc_map
-pef_b2s_tap_svc_confirm __attribute__((unused)) = {
-BIT_DESC_MAP_LIST,
-{ {"ACK", PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX},
- {"211+ACK", PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX},
- {"{211|213}+ACK", PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX},
- {NULL}
-} };
#if 0 /* FYI : config parm groupings */
struct pef_config_parms { /* PEF */
@@ -936,6 +642,7 @@ BIT_DESC_MAP_LIST,
#endif
#define IPMI_CMD_GET_PEF_CAPABILITIES 0x10
+#define IPMI_CMD_SET_PEF_CONFIG_PARMS 0x12
#define IPMI_CMD_GET_PEF_CONFIG_PARMS 0x13
#define IPMI_CMD_GET_LAST_PROCESSED_EVT_ID 0x15
#define IPMI_CMD_GET_SYSTEM_GUID 0x37
@@ -943,6 +650,13 @@ BIT_DESC_MAP_LIST,
#define IPMI_CMD_LAN_GET_CONFIG 0x02
#define IPMI_CMD_SERIAL_GET_CONFIG 0x11
+struct pef_cfgparm_set_policy_table_entry
+{
+ uint8_t param_selector;
+ uint8_t policy_id;
+ struct pef_policy_entry entry;
+} ATTRIBUTE_PACKING;
+
const char * ipmi_pef_bit_desc(struct bit_desc_map * map, uint32_t val);
void ipmi_pef_print_flags(struct bit_desc_map * map, flg_e type, uint32_t val);
void ipmi_pef_print_dec(const char * text, uint32_t val);
@@ -952,5 +666,3 @@ void ipmi_pef_print_2xd(const char * text, uint8_t u1, uint8_t u2);
void ipmi_pef_print_str(const char * text, const char * val);
int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv);
-
-#endif /* IPMI_PEF_H */
diff --git a/include/ipmitool/ipmi_picmg.h b/include/ipmitool/ipmi_picmg.h
index 3d70454..f1b4963 100644
--- a/include/ipmitool/ipmi_picmg.h
+++ b/include/ipmitool/ipmi_picmg.h
@@ -3,8 +3,7 @@
(C) Kontron
*/
-#ifndef _IPMI_PICMG_H_
-#define _IPMI_PICMG_H_
+#pragma once
#include <ipmitool/ipmi.h>
@@ -12,6 +11,7 @@
#define PICMG_CPCI_MAJOR_VERSION 1
#define PICMG_ATCA_MAJOR_VERSION 2
#define PICMG_AMC_MAJOR_VERSION 4
+#define PICMG_UTCA_MAJOR_VERSION 5
/* PICMG commands */
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
@@ -91,95 +91,7 @@ typedef enum picmg_busres_resource_id {
PICMG_BUSRES_SYNC_CLOCK_GROUP_3
} t_picmg_busres_resource_id;
-/* the LED color capabilities */
-static const char* led_color_str[] __attribute__((unused)) = {
- "reserved",
- "BLUE",
- "RED",
- "GREEN",
- "AMBER",
- "ORANGE",
- "WHITE",
- "reserved"
-};
-
-
-static const char* amc_link_type_str[] __attribute__((unused)) = {
- "RESERVED",
- "RESERVED1",
- "PCI EXPRESS",
- "ADVANCED SWITCHING1",
- "ADVANCED SWITCHING2",
- "ETHERNET",
- "RAPIDIO",
- "STORAGE",
-};
-
-static const char* amc_link_type_ext_str[][16] __attribute__((unused)) = {
- /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */
- {
- "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
- },
- /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */
- {
- "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
- },
- /* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */
- {
- "Gen 1 - NSSC",
- "Gen 1 - SSC",
- "Gen 2 - NSSC",
- "Gen 2 - SSC",
- "", "", "", "",
- "", "", "", "",
- "", "", "", ""
- },
- /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */
- {
- "Gen 1 - NSSC",
- "Gen 1 - SSC",
- "Gen 2 - NSSC",
- "Gen 2 - SSC",
- "", "", "", "",
- "", "", "", "",
- "", "", "", ""
- },
- /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */
- {
- "Gen 1 - NSSC",
- "Gen 1 - SSC",
- "Gen 2 - NSSC",
- "Gen 2 - SSC",
- "", "", "", "",
- "", "", "", "",
- "", "", "", ""
- },
- /* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */
- {
- "1000BASE-BX (SerDES Gigabit)",
- "10GBASE-BX410 Gigabit XAUI",
- "", "",
- "", "", "", "",
- "", "", "", "",
- "", "", "", ""
- },
- /* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */
- {
- "1.25 Gbaud transmission rate",
- "2.5 Gbaud transmission rate",
- "3.125 Gbaud transmission rate",
- "", "", "", "", "",
- "", "", "", "", "", "", "", ""
- },
- /* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */
- {
- "Fibre Channel",
- "Serial ATA",
- "Serial Attached SCSI",
- "", "", "", "", "",
- "", "", "", "", "", "", "", ""
- }
-};
+const char *picmg_led_color_str(int color);
struct sAmcPortState {
#ifndef WORDS_BIGENDIAN
@@ -207,5 +119,3 @@ struct sAmcPortState {
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
uint8_t picmg_discover(struct ipmi_intf *intf);
uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf);
-
-#endif
diff --git a/include/ipmitool/ipmi_quantaoem.h b/include/ipmitool/ipmi_quantaoem.h
new file mode 100644
index 0000000..a222320
--- /dev/null
+++ b/include/ipmitool/ipmi_quantaoem.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018 Quanta Computer Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Quanta Computer Inc. or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE
+ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
+ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
+ * Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
+ * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
+ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
+ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#pragma once
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_sdr.h>
+
+#define OEM_QCT_NETFN 0x36
+#define OEM_QCT_GET_INFO 0x65
+
+typedef enum
+{
+ OEM_QCT_PLATFORM_UNKNOWN = 0,
+ OEM_QCT_PLATFORM_GRANTLEY,
+ OEM_QCT_PLATFORM_PURLEY
+} qct_platform_t;
+
+qct_platform_t oem_qct_get_platform_id(struct ipmi_intf *intf);
+char *oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec);
diff --git a/include/ipmitool/ipmi_raw.h b/include/ipmitool/ipmi_raw.h
index f4364f3..45fdd6b 100644
--- a/include/ipmitool/ipmi_raw.h
+++ b/include/ipmitool/ipmi_raw.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_RAW_H
-#define IPMI_RAW_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -40,5 +39,3 @@ struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, ui
uint8_t * wdata, uint8_t wsize, uint8_t rsize);
int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv);
int ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv);
-
-#endif /* IPMI_RAW_H */
diff --git a/include/ipmitool/ipmi_sdr.h b/include/ipmitool/ipmi_sdr.h
index ccf0cf0..85231c6 100644
--- a/include/ipmitool/ipmi_sdr.h
+++ b/include/ipmitool/ipmi_sdr.h
@@ -30,13 +30,13 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_SDR_H
-#define IPMI_SDR_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
#endif
+#include <stdbool.h>
#include <inttypes.h>
#include <math.h>
#include <ipmitool/bswap.h>
@@ -381,6 +381,29 @@ struct sdr_record_common_sensor {
struct sdr_record_mask mask;
+/* IPMI 2.0, Table 43-1, byte 21[7:6] Analog (numeric) Data Format */
+#define SDR_UNIT_FMT_UNSIGNED 0 /* unsigned */
+#define SDR_UNIT_FMT_1S_COMPL 1 /* 1's complement (signed) */
+#define SDR_UNIT_FMT_2S_COMPL 2 /* 2's complement (signed) */
+#define SDR_UNIT_FMT_NA 3 /* does not return analog (numeric) reading */
+/* IPMI 2.0, Table 43-1, byte 21[5:3] Rate */
+#define SDR_UNIT_RATE_NONE 0 /* none */
+#define SDR_UNIT_RATE_MICROSEC 1 /* per us */
+#define SDR_UNIT_RATE_MILLISEC 2 /* per ms */
+#define SDR_UNIT_RATE_SEC 3 /* per s */
+#define SDR_UNIT_RATE_MIN 4 /* per min */
+#define SDR_UNIT_RATE_HR 5 /* per hour */
+#define SDR_UNIT_RATE_DAY 6 /* per day */
+#define SDR_UNIT_RATE_RSVD 7 /* reserved */
+/* IPMI 2.0, Table 43-1, byte 21[2:1] Modifier Unit */
+#define SDR_UNIT_MOD_NONE 0 /* none */
+#define SDR_UNIT_MOD_DIV 1 /* Basic Unit / Modifier Unit */
+#define SDR_UNIT_MOD_MUL 2 /* Basic Unit * Mofifier Unit */
+#define SDR_UNIT_MOD_RSVD 3 /* Reserved */
+/* IPMI 2.0, Table 43-1, byte 21[0] Percentage */
+#define SDR_UNIT_PCT_NO 0
+#define SDR_UNIT_PCT_YES 1
+
struct {
#if WORDS_BIGENDIAN
uint8_t analog:2;
@@ -394,8 +417,8 @@ struct sdr_record_common_sensor {
uint8_t analog:2;
#endif
struct {
- uint8_t base;
- uint8_t modifier;
+ uint8_t base; /* Base unit type code per IPMI 2.0 Table 43-15 */
+ uint8_t modifier; /* Modifier unit type code per Table 43-15 */
} ATTRIBUTE_PACKING type;
} ATTRIBUTE_PACKING unit;
} ATTRIBUTE_PACKING;
@@ -773,50 +796,7 @@ struct sdr_record_list {
#pragma pack(0)
#endif
-
-/* unit description codes (IPMI v1.5 section 37.16) */
-#define UNIT_MAX 0x90
-static const char *unit_desc[] __attribute__ ((unused)) = {
-"unspecified",
- "degrees C", "degrees F", "degrees K",
- "Volts", "Amps", "Watts", "Joules",
- "Coulombs", "VA", "Nits",
- "lumen", "lux", "Candela",
- "kPa", "PSI", "Newton",
- "CFM", "RPM", "Hz",
- "microsecond", "millisecond", "second", "minute", "hour",
- "day", "week", "mil", "inches", "feet", "cu in", "cu feet",
- "mm", "cm", "m", "cu cm", "cu m", "liters", "fluid ounce",
- "radians", "steradians", "revolutions", "cycles",
- "gravities", "ounce", "pound", "ft-lb", "oz-in", "gauss",
- "gilberts", "henry", "millihenry", "farad", "microfarad",
- "ohms", "siemens", "mole", "becquerel", "PPM", "reserved",
- "Decibels", "DbA", "DbC", "gray", "sievert",
- "color temp deg K", "bit", "kilobit", "megabit", "gigabit",
- "byte", "kilobyte", "megabyte", "gigabyte", "word", "dword",
- "qword", "line", "hit", "miss", "retry", "reset",
- "overflow", "underrun", "collision", "packets", "messages",
- "characters", "error", "correctable error", "uncorrectable error",};
-
-/* sensor type codes (IPMI v1.5 table 36.3)
- / Updated to v2.0 Table 42-3, Sensor Type Codes */
#define SENSOR_TYPE_MAX 0x2C
-static const char *sensor_type_desc[] __attribute__ ((unused)) = {
-"reserved",
- "Temperature", "Voltage", "Current", "Fan",
- "Physical Security", "Platform Security", "Processor",
- "Power Supply", "Power Unit", "Cooling Device", "Other",
- "Memory", "Drive Slot / Bay", "POST Memory Resize",
- "System Firmwares", "Event Logging Disabled", "Watchdog1",
- "System Event", "Critical Interrupt", "Button",
- "Module / Board", "Microcontroller", "Add-in Card",
- "Chassis", "Chip Set", "Other FRU", "Cable / Interconnect",
- "Terminator", "System Boot Initiated", "Boot Error",
- "OS Boot", "OS Critical Stop", "Slot / Connector",
- "System ACPI Power State", "Watchdog2", "Platform Alert",
- "Entity Presence", "Monitor ASIC", "LAN",
- "Management Subsys Health", "Battery", "Session Audit",
- "Version Change", "FRU State" };
struct sensor_reading {
char s_id[17]; /* name of the sensor */
@@ -864,11 +844,10 @@ struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf,
struct ipmi_sdr_iterator *i);
uint8_t *ipmi_sdr_get_record(struct ipmi_intf *intf, struct sdr_get_rs *header,
struct ipmi_sdr_iterator *i);
-void ipmi_sdr_end(struct ipmi_intf *intf, struct ipmi_sdr_iterator *i);
+void ipmi_sdr_end(struct ipmi_sdr_iterator *i);
int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type);
-int ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf,uint16_t id,
- uint8_t type,uint8_t * raw);
+int ipmi_sdr_print_name_from_rawentry(uint16_t id, uint8_t type,uint8_t * raw);
int ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type, uint8_t * raw,
int len);
int ipmi_sdr_print_listentry(struct ipmi_intf *intf,
@@ -877,8 +856,8 @@ void ipmi_sdr_print_sensor_hysteresis(struct sdr_record_common_sensor *sensor,
struct sdr_record_full_sensor *full,
uint8_t hysteresis_value,
const char *hdrstr);
-const char *ipmi_sdr_get_unit_string(uint8_t pct, uint8_t type,
- uint8_t base, uint8_t modifier);
+const char *ipmi_sdr_get_unit_string(bool pct, uint8_t type,
+ uint8_t base, uint8_t modifier);
struct sensor_reading *
ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
struct sdr_record_common_sensor *sensor,
@@ -907,21 +886,14 @@ struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf,
struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf,
uint8_t sensor,
uint8_t target, uint8_t lun, uint8_t channel);
-const char *ipmi_sdr_get_sensor_type_desc(const uint8_t type);
int ipmi_sdr_get_reservation(struct ipmi_intf *intf, int use_builtin,
uint16_t * reserve_id);
int ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
struct sdr_record_eventonly_sensor *sensor);
-int ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf,
- struct sdr_record_generic_locator
- *fru);
-int ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf,
- struct sdr_record_fru_locator *fru);
-int ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf,
- struct sdr_record_mc_locator *mc);
-int ipmi_sdr_print_sensor_entity_assoc(struct ipmi_intf *intf,
- struct sdr_record_entity_assoc *assoc);
+int ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *fru);
+int ipmi_sdr_print_sensor_fru_locator(struct sdr_record_fru_locator *fru);
+int ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc);
struct sdr_record_list *ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf,
struct entity_id *entity);
@@ -934,13 +906,15 @@ struct sdr_record_list *ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf,
struct sdr_record_list *ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf,
uint8_t type);
int ipmi_sdr_list_cache(struct ipmi_intf *intf);
-int ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile);
-void ipmi_sdr_list_empty(struct ipmi_intf *intf);
+int ipmi_sdr_list_cache_fromfile(const char *ifile);
+void ipmi_sdr_list_empty(void);
int ipmi_sdr_print_info(struct ipmi_intf *intf);
-void ipmi_sdr_print_discrete_state(const char *desc, uint8_t sensor_type,
- uint8_t event_type, uint8_t state1,
- uint8_t state2);
-void ipmi_sdr_print_discrete_state_mini(const char *header, const char *separator,
+void ipmi_sdr_print_discrete_state(struct ipmi_intf *intf,
+ const char *desc, uint8_t sensor_type,
+ uint8_t event_type, uint8_t state1,
+ uint8_t state2);
+void ipmi_sdr_print_discrete_state_mini(struct ipmi_intf *intf,
+ const char *header, const char *separator,
uint8_t sensor_type, uint8_t event_type,
uint8_t state1, uint8_t state2);
int ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,
@@ -951,5 +925,3 @@ int ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf,
uint8_t sensor_num, uint8_t sensor_type,
uint8_t event_type, int numeric_fmt,
uint8_t target, uint8_t lun, uint8_t channel);
-
-#endif /* IPMI_SDR_H */
diff --git a/include/ipmitool/ipmi_sdradd.h b/include/ipmitool/ipmi_sdradd.h
index b39e82b..032246f 100644
--- a/include/ipmitool/ipmi_sdradd.h
+++ b/include/ipmitool/ipmi_sdradd.h
@@ -27,9 +27,8 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-
-#ifndef IPMI_SDRADD_H
-#define IPMI_SDRADD_H
+
+#pragma once
/*
* Methods to add SDRs to repository from built-in sensors or files
@@ -42,5 +41,3 @@ ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile);
int
ipmi_sdr_add_from_list(struct ipmi_intf *intf, const char *rangeList);
-
-#endif /* IPMI_SDRADD_H */
diff --git a/include/ipmitool/ipmi_sel.h b/include/ipmitool/ipmi_sel.h
index 9778784..8a5354f 100644
--- a/include/ipmitool/ipmi_sel.h
+++ b/include/ipmitool/ipmi_sel.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_SEL_H
-#define IPMI_SEL_H
+#pragma once
#include <inttypes.h>
#include <ipmitool/ipmi.h>
@@ -142,551 +141,533 @@ struct ipmi_event_sensor_types {
uint8_t offset;
#define ALL_OFFSETS_SPECIFIED 0xff
uint8_t data;
- uint8_t class;
- const char * type;
const char * desc;
};
-/* The sel module uses the "iana" number to select the appropriate array at run time
- This table if for iana number 15000 ( Kontron ), you can add you own OEM sensor types
- using a similar constuct, look for switch(iana) in ipmi_sel.c
- */
-static struct ipmi_event_sensor_types oem_kontron_event_types[] __attribute__((unused)) = {
-
- /* event type details uses an oem event type */
- { 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
- { 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
-
- { 0xC1 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Push Button" },
- { 0xC1 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Bridge Reset" },
- { 0xC1 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Backplane" },
- { 0xC1 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Fault" },
- { 0xC1 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Healty" },
- { 0xC1 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Unknown" },
- { 0xC1 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "ITP" },
- { 0xC1 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hardware Watchdog" },
- { 0xC1 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Software Reset" },
-
- /* Uses standard digital reading type */
- { 0xC2 , 0xFF , 0xff, IPMI_EVENT_CLASS_DIGITAL , "SDRR Init Agent", NULL },
-
- /* based on PICMG IPMB-0 Link state sensor */
- { 0xC3 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Disabled" },
- { 0xC3 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Enabled" },
-
- { 0xC4 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Push Button" },
- { 0xC4 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Power Failure" },
- { 0xC4 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Unknown" },
- { 0xC4 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Watchdog" },
- { 0xC4 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Soft Reset" },
- { 0xC4 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Warm Reset" },
- { 0xC4 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Cold Reset" },
- { 0xC4 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "IPMI Command" },
- { 0xC4 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Setup Reset (Save CMOS)" },
- { 0xC4 , 0x09 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Power Up Reset" },
-
- /* event type details uses a standard */
- { 0xC5 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Information Agent", NULL },
-
- { 0xC6 , 0x0E , 0xff, IPMI_EVENT_CLASS_DISCRETE , "POST Value", "Post Error (see data2)" },
-
- { 0xC7 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Upgrade" },
- { 0xC7 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Rollback(error)" },
- { 0xC7 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Errors (watchdog)" },
- { 0xC7 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Manual Rollback" },
- { 0xC7 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "Firmware Watchdog Bite, reset occurred" },
-
- { 0xC8 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Not Loaded" },
- { 0xC8 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Initializing" },
- { 0xC8 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Ready" },
- { 0xC8 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Failure (see data2)" },
-
- { 0xC9 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Started" },
- { 0xC9 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Pass" },
- { 0xC9 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Fail" },
-
- { 0xCA , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "In progress"},
- { 0xCA , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Success"},
- { 0xCA , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Failure"},
-
- { 0xCB , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Asserted"},
- { 0xCB , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Deasserted"},
-
- { 0xCC , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Asserted"},
- { 0xCC , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Deasserted"},
-
- { 0xCD , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Asserted"},
- { 0xCD , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Deasserted"},
-
- { 0xCF , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Asserted"},
- { 0xCF , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Deasserted"},
-
- /* END */
- { 0x00, 0x00, 0xff, 0x00, NULL, NULL },
+static const struct ipmi_event_sensor_types generic_event_types[] = {
+ /* Threshold Based States */
+ { 0x01, 0x00, 0xff, "Lower Non-critical going low " },
+ { 0x01, 0x01, 0xff, "Lower Non-critical going high" },
+ { 0x01, 0x02, 0xff, "Lower Critical going low " },
+ { 0x01, 0x03, 0xff, "Lower Critical going high" },
+ { 0x01, 0x04, 0xff, "Lower Non-recoverable going low " },
+ { 0x01, 0x05, 0xff, "Lower Non-recoverable going high" },
+ { 0x01, 0x06, 0xff, "Upper Non-critical going low " },
+ { 0x01, 0x07, 0xff, "Upper Non-critical going high" },
+ { 0x01, 0x08, 0xff, "Upper Critical going low " },
+ { 0x01, 0x09, 0xff, "Upper Critical going high" },
+ { 0x01, 0x0a, 0xff, "Upper Non-recoverable going low " },
+ { 0x01, 0x0b, 0xff, "Upper Non-recoverable going high" },
+ /* DMI-based "usage state" States */
+ { 0x02, 0x00, 0xff, "Transition to Idle" },
+ { 0x02, 0x01, 0xff, "Transition to Active" },
+ { 0x02, 0x02, 0xff, "Transition to Busy" },
+ /* Digital-Discrete Event States */
+ { 0x03, 0x00, 0xff, "State Deasserted" },
+ { 0x03, 0x01, 0xff, "State Asserted" },
+ { 0x04, 0x00, 0xff, "Predictive Failure Deasserted" },
+ { 0x04, 0x01, 0xff, "Predictive Failure Asserted" },
+ { 0x05, 0x00, 0xff, "Limit Not Exceeded" },
+ { 0x05, 0x01, 0xff, "Limit Exceeded" },
+ { 0x06, 0x00, 0xff, "Performance Met" },
+ { 0x06, 0x01, 0xff, "Performance Lags" },
+ /* Severity Event States */
+ { 0x07, 0x00, 0xff, "Transition to OK" },
+ { 0x07, 0x01, 0xff, "Transition to Non-critical from OK" },
+ { 0x07, 0x02, 0xff, "Transition to Critical from less severe" },
+ { 0x07, 0x03, 0xff, "Transition to Non-recoverable from less severe" },
+ { 0x07, 0x04, 0xff, "Transition to Non-critical from more severe" },
+ { 0x07, 0x05, 0xff, "Transition to Critical from Non-recoverable" },
+ { 0x07, 0x06, 0xff, "Transition to Non-recoverable" },
+ { 0x07, 0x07, 0xff, "Monitor" },
+ { 0x07, 0x08, 0xff, "Informational" },
+ /* Availability Status States */
+ { 0x08, 0x00, 0xff, "Device Absent" },
+ { 0x08, 0x01, 0xff, "Device Present" },
+ { 0x09, 0x00, 0xff, "Device Disabled" },
+ { 0x09, 0x01, 0xff, "Device Enabled" },
+ { 0x0a, 0x00, 0xff, "Transition to Running" },
+ { 0x0a, 0x01, 0xff, "Transition to In Test" },
+ { 0x0a, 0x02, 0xff, "Transition to Power Off" },
+ { 0x0a, 0x03, 0xff, "Transition to On Line" },
+ { 0x0a, 0x04, 0xff, "Transition to Off Line" },
+ { 0x0a, 0x05, 0xff, "Transition to Off Duty" },
+ { 0x0a, 0x06, 0xff, "Transition to Degraded" },
+ { 0x0a, 0x07, 0xff, "Transition to Power Save" },
+ { 0x0a, 0x08, 0xff, "Install Error" },
+ /* Redundancy States */
+ { 0x0b, 0x00, 0xff, "Fully Redundant" },
+ { 0x0b, 0x01, 0xff, "Redundancy Lost" },
+ { 0x0b, 0x02, 0xff, "Redundancy Degraded" },
+ { 0x0b, 0x03, 0xff, "Non-Redundant: Sufficient from Redundant" },
+ { 0x0b, 0x04, 0xff, "Non-Redundant: Sufficient from Insufficient" },
+ { 0x0b, 0x05, 0xff, "Non-Redundant: Insufficient Resources" },
+ { 0x0b, 0x06, 0xff, "Redundancy Degraded from Fully Redundant" },
+ { 0x0b, 0x07, 0xff, "Redundancy Degraded from Non-Redundant" },
+ /* ACPI Device Power States */
+ { 0x0c, 0x00, 0xff, "D0 Power State" },
+ { 0x0c, 0x01, 0xff, "D1 Power State" },
+ { 0x0c, 0x02, 0xff, "D2 Power State" },
+ { 0x0c, 0x03, 0xff, "D3 Power State" },
+ /* END */
+ { 0x00, 0x00, 0xff, NULL },
};
-static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = {
- /* Threshold Based States */
- { 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " },
- { 0x01, 0x01, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going high" },
- { 0x01, 0x02, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going low " },
- { 0x01, 0x03, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going high" },
- { 0x01, 0x04, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going low " },
- { 0x01, 0x05, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going high" },
- { 0x01, 0x06, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going low " },
- { 0x01, 0x07, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going high" },
- { 0x01, 0x08, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going low " },
- { 0x01, 0x09, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going high" },
- { 0x01, 0x0a, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going low " },
- { 0x01, 0x0b, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going high" },
- /* DMI-based "usage state" States */
- { 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Idle" },
- { 0x02, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Active" },
- { 0x02, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Busy" },
- /* Digital-Discrete Event States */
- { 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Deasserted" },
- { 0x03, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Asserted" },
- { 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Deasserted" },
- { 0x04, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Asserted" },
- { 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Not Exceeded" },
- { 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Exceeded" },
- { 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Met" },
- { 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Lags" },
- /* Severity Event States */
- { 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to OK" },
- { 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from OK" },
- { 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from less severe" },
- { 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable from less severe" },
- { 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from more severe" },
- { 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from Non-recoverable" },
- { 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable" },
- { 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Monitor" },
- { 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Informational" },
- /* Availability Status States */
- { 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Absent" },
- { 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Present" },
- { 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Disabled" },
- { 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Enabled" },
- { 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Running" },
- { 0x0a, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to In Test" },
- { 0x0a, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Off" },
- { 0x0a, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to On Line" },
- { 0x0a, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Line" },
- { 0x0a, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Duty" },
- { 0x0a, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Degraded" },
- { 0x0a, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Save" },
- { 0x0a, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Install Error" },
- /* Redundancy States */
- { 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Fully Redundant" },
- { 0x0b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Lost" },
- { 0x0b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded" },
- { 0x0b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Redundant" },
- { 0x0b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Insufficient" },
- { 0x0b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Insufficient Resources" },
- { 0x0b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Fully Redundant" },
- { 0x0b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Non-Redundant" },
- /* ACPI Device Power States */
- { 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D0 Power State" },
- { 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D1 Power State" },
- { 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D2 Power State" },
- { 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D3 Power State" },
- /* END */
- { 0x00, 0x00, 0xff, 0x00, NULL, NULL },
+static const struct ipmi_event_sensor_types sensor_specific_event_types[] = {
+ /* Physical Security */
+ { 0x05, 0x00, 0xff, "General Chassis intrusion" },
+ { 0x05, 0x01, 0xff, "Drive Bay intrusion" },
+ { 0x05, 0x02, 0xff, "I/O Card area intrusion" },
+ { 0x05, 0x03, 0xff, "Processor area intrusion" },
+ { 0x05, 0x04, 0xff, "System unplugged from LAN" },
+ { 0x05, 0x05, 0xff, "Unauthorized dock" },
+ { 0x05, 0x06, 0xff, "FAN area intrusion" },
+ /* Platform Security */
+ { 0x06, 0x00, 0xff, "Front Panel Lockout violation attempted" },
+ { 0x06, 0x01, 0xff, "Pre-boot password violation - user password" },
+ { 0x06, 0x02, 0xff, "Pre-boot password violation - setup password" },
+ { 0x06, 0x03, 0xff, "Pre-boot password violation - network boot password" },
+ { 0x06, 0x04, 0xff, "Other pre-boot password violation" },
+ { 0x06, 0x05, 0xff, "Out-of-band access password violation" },
+ /* Processor */
+ { 0x07, 0x00, 0xff, "IERR" },
+ { 0x07, 0x01, 0xff, "Thermal Trip" },
+ { 0x07, 0x02, 0xff, "FRB1/BIST failure" },
+ { 0x07, 0x03, 0xff, "FRB2/Hang in POST failure" },
+ { 0x07, 0x04, 0xff, "FRB3/Processor startup/init failure" },
+ { 0x07, 0x05, 0xff, "Configuration Error" },
+ { 0x07, 0x06, 0xff, "SM BIOS Uncorrectable CPU-complex Error" },
+ { 0x07, 0x07, 0xff, "Presence detected" },
+ { 0x07, 0x08, 0xff, "Disabled" },
+ { 0x07, 0x09, 0xff, "Terminator presence detected" },
+ { 0x07, 0x0a, 0xff, "Throttled" },
+ { 0x07, 0x0b, 0xff, "Uncorrectable machine check exception" },
+ { 0x07, 0x0c, 0xff, "Correctable machine check error" },
+ /* Power Supply */
+ { 0x08, 0x00, 0xff, "Presence detected" },
+ { 0x08, 0x01, 0xff, "Failure detected" },
+ { 0x08, 0x02, 0xff, "Predictive failure" },
+ { 0x08, 0x03, 0xff, "Power Supply AC lost" },
+ { 0x08, 0x04, 0xff, "AC lost or out-of-range" },
+ { 0x08, 0x05, 0xff, "AC out-of-range, but present" },
+ { 0x08, 0x06, 0x00, "Config Error: Vendor Mismatch" },
+ { 0x08, 0x06, 0x01, "Config Error: Revision Mismatch" },
+ { 0x08, 0x06, 0x02, "Config Error: Processor Missing" },
+ { 0x08, 0x06, 0x03, "Config Error: Power Supply Rating Mismatch" },
+ { 0x08, 0x06, 0x04, "Config Error: Voltage Rating Mismatch" },
+ { 0x08, 0x06, 0xff, "Config Error" },
+ { 0x08, 0x07, 0xff, "Power Supply Inactive" },
+ /* Power Unit */
+ { 0x09, 0x00, 0xff, "Power off/down" },
+ { 0x09, 0x01, 0xff, "Power cycle" },
+ { 0x09, 0x02, 0xff, "240VA power down" },
+ { 0x09, 0x03, 0xff, "Interlock power down" },
+ { 0x09, 0x04, 0xff, "AC lost" },
+ { 0x09, 0x05, 0xff, "Soft-power control failure" },
+ { 0x09, 0x06, 0xff, "Failure detected" },
+ { 0x09, 0x07, 0xff, "Predictive failure" },
+ /* Memory */
+ { 0x0c, 0x00, 0xff, "Correctable ECC" },
+ { 0x0c, 0x01, 0xff, "Uncorrectable ECC" },
+ { 0x0c, 0x02, 0xff, "Parity" },
+ { 0x0c, 0x03, 0xff, "Memory Scrub Failed" },
+ { 0x0c, 0x04, 0xff, "Memory Device Disabled" },
+ { 0x0c, 0x05, 0xff, "Correctable ECC logging limit reached" },
+ { 0x0c, 0x06, 0xff, "Presence Detected" },
+ { 0x0c, 0x07, 0xff, "Configuration Error" },
+ { 0x0c, 0x08, 0xff, "Spare" },
+ { 0x0c, 0x09, 0xff, "Throttled" },
+ { 0x0c, 0x0a, 0xff, "Critical Overtemperature" },
+ /* Drive Slot */
+ { 0x0d, 0x00, 0xff, "Drive Present" },
+ { 0x0d, 0x01, 0xff, "Drive Fault" },
+ { 0x0d, 0x02, 0xff, "Predictive Failure" },
+ { 0x0d, 0x03, 0xff, "Hot Spare" },
+ { 0x0d, 0x04, 0xff, "Parity Check In Progress" },
+ { 0x0d, 0x05, 0xff, "In Critical Array" },
+ { 0x0d, 0x06, 0xff, "In Failed Array" },
+ { 0x0d, 0x07, 0xff, "Rebuild In Progress" },
+ { 0x0d, 0x08, 0xff, "Rebuild Aborted" },
+ /* System Firmware Error */
+ { 0x0f, 0x00, 0x00, "Unspecified" },
+ { 0x0f, 0x00, 0x01, "No system memory installed" },
+ { 0x0f, 0x00, 0x02, "No usable system memory" },
+ { 0x0f, 0x00, 0x03, "Unrecoverable IDE device failure" },
+ { 0x0f, 0x00, 0x04, "Unrecoverable system-board failure" },
+ { 0x0f, 0x00, 0x05, "Unrecoverable diskette failure" },
+ { 0x0f, 0x00, 0x06, "Unrecoverable hard-disk controller failure" },
+ { 0x0f, 0x00, 0x07, "Unrecoverable PS/2 or USB keyboard failure" },
+ { 0x0f, 0x00, 0x08, "Removable boot media not found" },
+ { 0x0f, 0x00, 0x09, "Unrecoverable video controller failure" },
+ { 0x0f, 0x00, 0x0a, "No video device selected" },
+ { 0x0f, 0x00, 0x0b, "BIOS corruption detected" },
+ { 0x0f, 0x00, 0x0c, "CPU voltage mismatch" },
+ { 0x0f, 0x00, 0x0d, "CPU speed mismatch failure" },
+ { 0x0f, 0x00, 0xff, "Unknown Error" },
+ /* System Firmware Hang */
+ { 0x0f, 0x01, 0x00, "Unspecified" },
+ { 0x0f, 0x01, 0x01, "Memory initialization" },
+ { 0x0f, 0x01, 0x02, "Hard-disk initialization" },
+ { 0x0f, 0x01, 0x03, "Secondary CPU Initialization" },
+ { 0x0f, 0x01, 0x04, "User authentication" },
+ { 0x0f, 0x01, 0x05, "User-initiated system setup" },
+ { 0x0f, 0x01, 0x06, "USB resource configuration" },
+ { 0x0f, 0x01, 0x07, "PCI resource configuration" },
+ { 0x0f, 0x01, 0x08, "Option ROM initialization" },
+ { 0x0f, 0x01, 0x09, "Video initialization" },
+ { 0x0f, 0x01, 0x0a, "Cache initialization" },
+ { 0x0f, 0x01, 0x0b, "SMBus initialization" },
+ { 0x0f, 0x01, 0x0c, "Keyboard controller initialization" },
+ { 0x0f, 0x01, 0x0d, "Management controller initialization" },
+ { 0x0f, 0x01, 0x0e, "Docking station attachment" },
+ { 0x0f, 0x01, 0x0f, "Enabling docking station" },
+ { 0x0f, 0x01, 0x10, "Docking station ejection" },
+ { 0x0f, 0x01, 0x11, "Disabling docking station" },
+ { 0x0f, 0x01, 0x12, "Calling operating system wake-up vector" },
+ { 0x0f, 0x01, 0x13, "System boot initiated" },
+ { 0x0f, 0x01, 0x14, "Motherboard initialization" },
+ { 0x0f, 0x01, 0x15, "reserved" },
+ { 0x0f, 0x01, 0x16, "Floppy initialization" },
+ { 0x0f, 0x01, 0x17, "Keyboard test" },
+ { 0x0f, 0x01, 0x18, "Pointing device test" },
+ { 0x0f, 0x01, 0x19, "Primary CPU initialization" },
+ { 0x0f, 0x01, 0xff, "Unknown Hang" },
+ /* System Firmware Progress */
+ { 0x0f, 0x02, 0x00, "Unspecified" },
+ { 0x0f, 0x02, 0x01, "Memory initialization" },
+ { 0x0f, 0x02, 0x02, "Hard-disk initialization" },
+ { 0x0f, 0x02, 0x03, "Secondary CPU Initialization" },
+ { 0x0f, 0x02, 0x04, "User authentication" },
+ { 0x0f, 0x02, 0x05, "User-initiated system setup" },
+ { 0x0f, 0x02, 0x06, "USB resource configuration" },
+ { 0x0f, 0x02, 0x07, "PCI resource configuration" },
+ { 0x0f, 0x02, 0x08, "Option ROM initialization" },
+ { 0x0f, 0x02, 0x09, "Video initialization" },
+ { 0x0f, 0x02, 0x0a, "Cache initialization" },
+ { 0x0f, 0x02, 0x0b, "SMBus initialization" },
+ { 0x0f, 0x02, 0x0c, "Keyboard controller initialization" },
+ { 0x0f, 0x02, 0x0d, "Management controller initialization" },
+ { 0x0f, 0x02, 0x0e, "Docking station attachment" },
+ { 0x0f, 0x02, 0x0f, "Enabling docking station" },
+ { 0x0f, 0x02, 0x10, "Docking station ejection" },
+ { 0x0f, 0x02, 0x11, "Disabling docking station" },
+ { 0x0f, 0x02, 0x12, "Calling operating system wake-up vector" },
+ { 0x0f, 0x02, 0x13, "System boot initiated" },
+ { 0x0f, 0x02, 0x14, "Motherboard initialization" },
+ { 0x0f, 0x02, 0x15, "reserved" },
+ { 0x0f, 0x02, 0x16, "Floppy initialization" },
+ { 0x0f, 0x02, 0x17, "Keyboard test" },
+ { 0x0f, 0x02, 0x18, "Pointing device test" },
+ { 0x0f, 0x02, 0x19, "Primary CPU initialization" },
+ { 0x0f, 0x02, 0xff, "Unknown Progress" },
+ /* Event Logging Disabled */
+ { 0x10, 0x00, 0xff, "Correctable memory error logging disabled" },
+ { 0x10, 0x01, 0xff, "Event logging disabled" },
+ { 0x10, 0x02, 0xff, "Log area reset/cleared" },
+ { 0x10, 0x03, 0xff, "All event logging disabled" },
+ { 0x10, 0x04, 0xff, "Log full" },
+ { 0x10, 0x05, 0xff, "Log almost full" },
+ /* Watchdog 1 */
+ { 0x11, 0x00, 0xff, "BIOS Reset" },
+ { 0x11, 0x01, 0xff, "OS Reset" },
+ { 0x11, 0x02, 0xff, "OS Shut Down" },
+ { 0x11, 0x03, 0xff, "OS Power Down" },
+ { 0x11, 0x04, 0xff, "OS Power Cycle" },
+ { 0x11, 0x05, 0xff, "OS NMI/Diag Interrupt" },
+ { 0x11, 0x06, 0xff, "OS Expired" },
+ { 0x11, 0x07, 0xff, "OS pre-timeout Interrupt" },
+ /* System Event */
+ { 0x12, 0x00, 0xff, "System Reconfigured" },
+ { 0x12, 0x01, 0xff, "OEM System boot event" },
+ { 0x12, 0x02, 0xff, "Undetermined system hardware failure" },
+ { 0x12, 0x03, 0xff, "Entry added to auxiliary log" },
+ { 0x12, 0x04, 0xff, "PEF Action" },
+ { 0x12, 0x05, 0xff, "Timestamp Clock Sync" },
+ /* Critical Interrupt */
+ { 0x13, 0x00, 0xff, "NMI/Diag Interrupt" },
+ { 0x13, 0x01, 0xff, "Bus Timeout" },
+ { 0x13, 0x02, 0xff, "I/O Channel check NMI" },
+ { 0x13, 0x03, 0xff, "Software NMI" },
+ { 0x13, 0x04, 0xff, "PCI PERR" },
+ { 0x13, 0x05, 0xff, "PCI SERR" },
+ { 0x13, 0x06, 0xff, "EISA failsafe timeout" },
+ { 0x13, 0x07, 0xff, "Bus Correctable error" },
+ { 0x13, 0x08, 0xff, "Bus Uncorrectable error" },
+ { 0x13, 0x09, 0xff, "Fatal NMI" },
+ { 0x13, 0x0a, 0xff, "Bus Fatal Error" },
+ { 0x13, 0x0b, 0xff, "Bus Degraded" },
+ /* Button */
+ { 0x14, 0x00, 0xff, "Power Button pressed" },
+ { 0x14, 0x01, 0xff, "Sleep Button pressed" },
+ { 0x14, 0x02, 0xff, "Reset Button pressed" },
+ { 0x14, 0x03, 0xff, "FRU Latch" },
+ { 0x14, 0x04, 0xff, "FRU Service" },
+ /* Chip Set */
+ { 0x19, 0x00, 0xff, "Soft Power Control Failure" },
+ { 0x19, 0x01, 0xff, "Thermal Trip" },
+ /* Cable/Interconnect */
+ { 0x1b, 0x00, 0xff, "Connected" },
+ { 0x1b, 0x01, 0xff, "Config Error" },
+ /* System Boot Initiated */
+ { 0x1d, 0x00, 0xff, "Initiated by power up" },
+ { 0x1d, 0x01, 0xff, "Initiated by hard reset" },
+ { 0x1d, 0x02, 0xff, "Initiated by warm reset" },
+ { 0x1d, 0x03, 0xff, "User requested PXE boot" },
+ { 0x1d, 0x04, 0xff, "Automatic boot to diagnostic" },
+ { 0x1d, 0x05, 0xff, "OS initiated hard reset" },
+ { 0x1d, 0x06, 0xff, "OS initiated warm reset" },
+ { 0x1d, 0x07, 0xff, "System Restart" },
+ /* Boot Error */
+ { 0x1e, 0x00, 0xff, "No bootable media" },
+ { 0x1e, 0x01, 0xff, "Non-bootable disk in drive" },
+ { 0x1e, 0x02, 0xff, "PXE server not found" },
+ { 0x1e, 0x03, 0xff, "Invalid boot sector" },
+ { 0x1e, 0x04, 0xff, "Timeout waiting for selection" },
+ /* OS Boot */
+ { 0x1f, 0x00, 0xff, "A: boot completed" },
+ { 0x1f, 0x01, 0xff, "C: boot completed" },
+ { 0x1f, 0x02, 0xff, "PXE boot completed" },
+ { 0x1f, 0x03, 0xff, "Diagnostic boot completed" },
+ { 0x1f, 0x04, 0xff, "CD-ROM boot completed" },
+ { 0x1f, 0x05, 0xff, "ROM boot completed" },
+ { 0x1f, 0x06, 0xff, "boot completed - device not specified" },
+ { 0x1f, 0x07, 0xff, "Installation started" },
+ { 0x1f, 0x08, 0xff, "Installation completed" },
+ { 0x1f, 0x09, 0xff, "Installation aborted" },
+ { 0x1f, 0x0a, 0xff, "Installation failed" },
+ /* OS Stop/Shutdown */
+ { 0x20, 0x00, 0xff, "Error during system startup" },
+ { 0x20, 0x01, 0xff, "Run-time critical stop" },
+ { 0x20, 0x02, 0xff, "OS graceful stop" },
+ { 0x20, 0x03, 0xff, "OS graceful shutdown" },
+ { 0x20, 0x04, 0xff, "PEF initiated soft shutdown" },
+ { 0x20, 0x05, 0xff, "Agent not responding" },
+ /* Slot/Connector */
+ { 0x21, 0x00, 0xff, "Fault Status" },
+ { 0x21, 0x01, 0xff, "Identify Status" },
+ { 0x21, 0x02, 0xff, "Device Installed" },
+ { 0x21, 0x03, 0xff, "Ready for Device Installation" },
+ { 0x21, 0x04, 0xff, "Ready for Device Removal" },
+ { 0x21, 0x05, 0xff, "Slot Power is Off" },
+ { 0x21, 0x06, 0xff, "Device Removal Request" },
+ { 0x21, 0x07, 0xff, "Interlock" },
+ { 0x21, 0x08, 0xff, "Slot is Disabled" },
+ { 0x21, 0x09, 0xff, "Spare Device" },
+ /* System ACPI Power State */
+ { 0x22, 0x00, 0xff, "S0/G0: working" },
+ { 0x22, 0x01, 0xff, "S1: sleeping with system hw & processor context maintained" },
+ { 0x22, 0x02, 0xff, "S2: sleeping, processor context lost" },
+ { 0x22, 0x03, 0xff, "S3: sleeping, processor & hw context lost, memory retained" },
+ { 0x22, 0x04, 0xff, "S4: non-volatile sleep/suspend-to-disk" },
+ { 0x22, 0x05, 0xff, "S5/G2: soft-off" },
+ { 0x22, 0x06, 0xff, "S4/S5: soft-off" },
+ { 0x22, 0x07, 0xff, "G3: mechanical off" },
+ { 0x22, 0x08, 0xff, "Sleeping in S1/S2/S3 state" },
+ { 0x22, 0x09, 0xff, "G1: sleeping" },
+ { 0x22, 0x0a, 0xff, "S5: entered by override" },
+ { 0x22, 0x0b, 0xff, "Legacy ON state" },
+ { 0x22, 0x0c, 0xff, "Legacy OFF state" },
+ { 0x22, 0x0e, 0xff, "Unknown" },
+ /* Watchdog 2 */
+ { 0x23, 0x00, 0xff, "Timer expired" },
+ { 0x23, 0x01, 0xff, "Hard reset" },
+ { 0x23, 0x02, 0xff, "Power down" },
+ { 0x23, 0x03, 0xff, "Power cycle" },
+ { 0x23, 0x04, 0xff, "reserved" },
+ { 0x23, 0x05, 0xff, "reserved" },
+ { 0x23, 0x06, 0xff, "reserved" },
+ { 0x23, 0x07, 0xff, "reserved" },
+ { 0x23, 0x08, 0xff, "Timer interrupt" },
+ /* Platform Alert */
+ { 0x24, 0x00, 0xff, "Platform generated page" },
+ { 0x24, 0x01, 0xff, "Platform generated LAN alert" },
+ { 0x24, 0x02, 0xff, "Platform Event Trap generated" },
+ { 0x24, 0x03, 0xff, "Platform generated SNMP trap, OEM format" },
+ /* Entity Presence */
+ { 0x25, 0x00, 0xff, "Present" },
+ { 0x25, 0x01, 0xff, "Absent" },
+ { 0x25, 0x02, 0xff, "Disabled" },
+ /* LAN */
+ { 0x27, 0x00, 0xff, "Heartbeat Lost" },
+ { 0x27, 0x01, 0xff, "Heartbeat" },
+ /* Management Subsystem Health */
+ { 0x28, 0x00, 0xff, "Sensor access degraded or unavailable" },
+ { 0x28, 0x01, 0xff, "Controller access degraded or unavailable" },
+ { 0x28, 0x02, 0xff, "Management controller off-line" },
+ { 0x28, 0x03, 0xff, "Management controller unavailable" },
+ { 0x28, 0x04, 0xff, "Sensor failure" },
+ { 0x28, 0x05, 0xff, "FRU failure" },
+ /* Battery */
+ { 0x29, 0x00, 0xff, "Low" },
+ { 0x29, 0x01, 0xff, "Failed" },
+ { 0x29, 0x02, 0xff, "Presence Detected" },
+ /* Version Change */
+ { 0x2b, 0x00, 0xff, "Hardware change detected" },
+ { 0x2b, 0x01, 0x00, "Firmware or software change detected" },
+ { 0x2b, 0x01, 0x01, "Firmware or software change detected, Mngmt Ctrl Dev Id" },
+ { 0x2b, 0x01, 0x02, "Firmware or software change detected, Mngmt Ctrl Firm Rev" },
+ { 0x2b, 0x01, 0x03, "Firmware or software change detected, Mngmt Ctrl Dev Rev" },
+ { 0x2b, 0x01, 0x04, "Firmware or software change detected, Mngmt Ctrl Manuf Id" },
+ { 0x2b, 0x01, 0x05, "Firmware or software change detected, Mngmt Ctrl IPMI Vers" },
+ { 0x2b, 0x01, 0x06, "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" },
+ { 0x2b, 0x01, 0x07, "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" },
+ { 0x2b, 0x01, 0x08, "Firmware or software change detected, Mngmt Ctrl Other" },
+ { 0x2b, 0x01, 0x09, "Firmware or software change detected, BIOS/EFI change" },
+ { 0x2b, 0x01, 0x0A, "Firmware or software change detected, SMBIOS change" },
+ { 0x2b, 0x01, 0x0B, "Firmware or software change detected, O/S change" },
+ { 0x2b, 0x01, 0x0C, "Firmware or software change detected, O/S loader change" },
+ { 0x2b, 0x01, 0x0D, "Firmware or software change detected, Service Diag change" },
+ { 0x2b, 0x01, 0x0E, "Firmware or software change detected, Mngmt SW agent change" },
+ { 0x2b, 0x01, 0x0F, "Firmware or software change detected, Mngmt SW App change" },
+ { 0x2b, 0x01, 0x10, "Firmware or software change detected, Mngmt SW Middle" },
+ { 0x2b, 0x01, 0x11, "Firmware or software change detected, Prog HW Change (FPGA)" },
+ { 0x2b, 0x01, 0x12, "Firmware or software change detected, board/FRU module change" },
+ { 0x2b, 0x01, 0x13, "Firmware or software change detected, board/FRU component change" },
+ { 0x2b, 0x01, 0x14, "Firmware or software change detected, board/FRU replace equ ver" },
+ { 0x2b, 0x01, 0x15, "Firmware or software change detected, board/FRU replace new ver" },
+ { 0x2b, 0x01, 0x16, "Firmware or software change detected, board/FRU replace old ver" },
+ { 0x2b, 0x01, 0x17, "Firmware or software change detected, board/FRU HW conf change" },
+ { 0x2b, 0x02, 0xff, "Hardware incompatibility detected" },
+ { 0x2b, 0x03, 0xff, "Firmware or software incompatibility detected" },
+ { 0x2b, 0x04, 0xff, "Invalid or unsupported hardware version" },
+ { 0x2b, 0x05, 0xff, "Invalid or unsupported firmware or software version" },
+ { 0x2b, 0x06, 0xff, "Hardware change success" },
+ { 0x2b, 0x07, 0x00, "Firmware or software change success" },
+ { 0x2b, 0x07, 0x01, "Firmware or software change success, Mngmt Ctrl Dev Id" },
+ { 0x2b, 0x07, 0x02, "Firmware or software change success, Mngmt Ctrl Firm Rev" },
+ { 0x2b, 0x07, 0x03, "Firmware or software change success, Mngmt Ctrl Dev Rev" },
+ { 0x2b, 0x07, 0x04, "Firmware or software change success, Mngmt Ctrl Manuf Id" },
+ { 0x2b, 0x07, 0x05, "Firmware or software change success, Mngmt Ctrl IPMI Vers" },
+ { 0x2b, 0x07, 0x06, "Firmware or software change success, Mngmt Ctrl Aux Firm Id" },
+ { 0x2b, 0x07, 0x07, "Firmware or software change success, Mngmt Ctrl Firm Boot Block" },
+ { 0x2b, 0x07, 0x08, "Firmware or software change success, Mngmt Ctrl Other" },
+ { 0x2b, 0x07, 0x09, "Firmware or software change success, BIOS/EFI change" },
+ { 0x2b, 0x07, 0x0A, "Firmware or software change success, SMBIOS change" },
+ { 0x2b, 0x07, 0x0B, "Firmware or software change success, O/S change" },
+ { 0x2b, 0x07, 0x0C, "Firmware or software change success, O/S loader change" },
+ { 0x2b, 0x07, 0x0D, "Firmware or software change success, Service Diag change" },
+ { 0x2b, 0x07, 0x0E, "Firmware or software change success, Mngmt SW agent change" },
+ { 0x2b, 0x07, 0x0F, "Firmware or software change success, Mngmt SW App change" },
+ { 0x2b, 0x07, 0x10, "Firmware or software change success, Mngmt SW Middle" },
+ { 0x2b, 0x07, 0x11, "Firmware or software change success, Prog HW Change (FPGA)" },
+ { 0x2b, 0x07, 0x12, "Firmware or software change success, board/FRU module change" },
+ { 0x2b, 0x07, 0x13, "Firmware or software change success, board/FRU component change" },
+ { 0x2b, 0x07, 0x14, "Firmware or software change success, board/FRU replace equ ver" },
+ { 0x2b, 0x07, 0x15, "Firmware or software change success, board/FRU replace new ver" },
+ { 0x2b, 0x07, 0x16, "Firmware or software change success, board/FRU replace old ver" },
+ { 0x2b, 0x07, 0x17, "Firmware or software change success, board/FRU HW conf change" },
+ /* FRU State */
+ { 0x2c, 0x00, 0xff, "Not Installed" },
+ { 0x2c, 0x01, 0xff, "Inactive" },
+ { 0x2c, 0x02, 0xff, "Activation Requested" },
+ { 0x2c, 0x03, 0xff, "Activation in Progress" },
+ { 0x2c, 0x04, 0xff, "Active" },
+ { 0x2c, 0x05, 0xff, "Deactivation Requested" },
+ { 0x2c, 0x06, 0xff, "Deactivation in Progress" },
+ { 0x2c, 0x07, 0xff, "Communication lost" },
+ /* PICMG FRU Hot Swap */
+ { 0xF0, 0x00, 0xFF, "Transition to M0" },
+ { 0xF0, 0x01, 0xFF, "Transition to M1" },
+ { 0xF0, 0x02, 0xFF, "Transition to M2" },
+ { 0xF0, 0x03, 0xFF, "Transition to M3" },
+ { 0xF0, 0x04, 0xFF, "Transition to M4" },
+ { 0xF0, 0x05, 0xFF, "Transition to M5" },
+ { 0xF0, 0x06, 0xFF, "Transition to M6" },
+ { 0xF0, 0x07, 0xFF, "Transition to M7" },
+ /* PICMG IPMB Physical Link */
+ { 0xF1, 0x00, 0xff, "IPMB-A disabled, IPMB-B disabled" },
+ { 0xF1, 0x01, 0xff, "IPMB-A enabled, IPMB-B disabled" },
+ { 0xF1, 0x02, 0xff, "IPMB-A disabled, IPMB-B enabled" },
+ { 0xF1, 0x03, 0xff, "IPMB-A enabled, IPMB-B enabled" },
+ /* PICMG Module Hot Swap */
+ { 0xF2, 0x00, 0xff, "Module Handle Closed" },
+ { 0xF2, 0x01, 0xff, "Module Handle Opened" },
+ { 0xF2, 0x02, 0xff, "Quiesced" },
+ { 0x00, 0x00, 0xff, NULL },
};
-static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unused)) = {
- { 0x00, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Reserved", NULL },
- { 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Temperature", NULL },
- { 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Voltage", NULL },
- { 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Current", NULL },
- { 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Fan", NULL },
-
- { 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "General Chassis intrusion" },
- { 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Drive Bay intrusion" },
- { 0x05, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "I/O Card area intrusion" },
- { 0x05, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Processor area intrusion" },
- { 0x05, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "System unplugged from LAN" },
- { 0x05, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Unauthorized dock" },
- { 0x05, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "FAN area intrusion" },
-
- { 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Front Panel Lockout violation attempted" },
- { 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - user password" },
- { 0x06, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - setup password" },
- { 0x06, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - network boot password" },
- { 0x06, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Other pre-boot password violation" },
- { 0x06, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Out-of-band access password violation" },
-
- { 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "IERR" },
- { 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Thermal Trip" },
- { 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB1/BIST failure" },
- { 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB2/Hang in POST failure" },
- { 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB3/Processor startup/init failure" },
- { 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Configuration Error" },
- { 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "SM BIOS Uncorrectable CPU-complex Error" },
- { 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Presence detected" },
- { 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Disabled" },
- { 0x07, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Terminator presence detected" },
- { 0x07, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Throttled" },
- { 0x07, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Uncorrectable machine check exception" },
- { 0x07, 0x0c, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Correctable machine check error" },
-
- { 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Presence detected" },
- { 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Failure detected" },
- { 0x08, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Predictive failure" },
- { 0x08, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply AC lost" },
- { 0x08, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC lost or out-of-range" },
- { 0x08, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC out-of-range, but present" },
- { 0x08, 0x06, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Vendor Mismatch" },
- { 0x08, 0x06, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Revision Mismatch" },
- { 0x08, 0x06, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Processor Missing" },
- { 0x08, 0x06, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Power Supply Rating Mismatch" },
- { 0x08, 0x06, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Voltage Rating Mismatch" },
- { 0x08, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error" },
- { 0x08, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply Inactive" },
-
- { 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power off/down" },
- { 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power cycle" },
- { 0x09, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "240VA power down" },
- { 0x09, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Interlock power down" },
- { 0x09, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "AC lost" },
- { 0x09, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Soft-power control failure" },
- { 0x09, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Failure detected" },
- { 0x09, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Predictive failure" },
-
- { 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cooling Device", NULL },
- { 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other Units-based Sensor", NULL },
-
- { 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC" },
- { 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Uncorrectable ECC" },
- { 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Parity" },
- { 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Scrub Failed" },
- { 0x0c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Device Disabled" },
- { 0x0c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC logging limit reached" },
- { 0x0c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Presence Detected" },
- { 0x0c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Configuration Error" },
- { 0x0c, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Spare" },
- { 0x0c, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Throttled" },
- { 0x0c, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Critical Overtemperature" },
-
- { 0x0d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Present" },
- { 0x0d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Fault" },
- { 0x0d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Predictive Failure" },
- { 0x0d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Hot Spare" },
- { 0x0d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Parity Check In Progress" },
- { 0x0d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Critical Array" },
- { 0x0d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Failed Array" },
- { 0x0d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild In Progress" },
- { 0x0d, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild Aborted" },
-
- { 0x0e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "POST Memory Resize", NULL },
-
- { 0x0f, 0x00, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unspecified" },
- { 0x0f, 0x00, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No system memory installed" },
- { 0x0f, 0x00, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No usable system memory" },
- { 0x0f, 0x00, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable IDE device failure" },
- { 0x0f, 0x00, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable system-board failure" },
- { 0x0f, 0x00, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable diskette failure" },
- { 0x0f, 0x00, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable hard-disk controller failure" },
- { 0x0f, 0x00, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable PS/2 or USB keyboard failure" },
- { 0x0f, 0x00, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Removable boot media not found" },
- { 0x0f, 0x00, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable video controller failure" },
- { 0x0f, 0x00, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No video device selected" },
- { 0x0f, 0x00, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "BIOS corruption detected" },
- { 0x0f, 0x00, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU voltage mismatch" },
- { 0x0f, 0x00, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU speed mismatch failure" },
- { 0x0f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unknown Error" },
-
- { 0x0f, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unspecified" },
- { 0x0f, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Memory initialization" },
- { 0x0f, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Hard-disk initialization" },
- { 0x0f, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Secondary CPU Initialization" },
- { 0x0f, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User authentication" },
- { 0x0f, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User-initiated system setup" },
- { 0x0f, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "USB resource configuration" },
- { 0x0f, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "PCI resource configuration" },
- { 0x0f, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Option ROM initialization" },
- { 0x0f, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Video initialization" },
- { 0x0f, 0x01, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Cache initialization" },
- { 0x0f, 0x01, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "SMBus initialization" },
- { 0x0f, 0x01, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard controller initialization" },
- { 0x0f, 0x01, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Management controller initialization" },
- { 0x0f, 0x01, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station attachment" },
- { 0x0f, 0x01, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Enabling docking station" },
- { 0x0f, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station ejection" },
- { 0x0f, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Disabling docking station" },
- { 0x0f, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Calling operating system wake-up vector" },
- { 0x0f, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "System boot initiated" },
- { 0x0f, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Motherboard initialization" },
- { 0x0f, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "reserved" },
- { 0x0f, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Floppy initialization" },
- { 0x0f, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard test" },
- { 0x0f, 0x01, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Pointing device test" },
- { 0x0f, 0x01, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Primary CPU initialization" },
- { 0x0f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unknown Hang" },
-
- { 0x0f, 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unspecified" },
- { 0x0f, 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Memory initialization" },
- { 0x0f, 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Hard-disk initialization" },
- { 0x0f, 0x02, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Secondary CPU Initialization" },
- { 0x0f, 0x02, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User authentication" },
- { 0x0f, 0x02, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User-initiated system setup" },
- { 0x0f, 0x02, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "USB resource configuration" },
- { 0x0f, 0x02, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "PCI resource configuration" },
- { 0x0f, 0x02, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Option ROM initialization" },
- { 0x0f, 0x02, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Video initialization" },
- { 0x0f, 0x02, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Cache initialization" },
- { 0x0f, 0x02, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "SMBus initialization" },
- { 0x0f, 0x02, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard controller initialization" },
- { 0x0f, 0x02, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Management controller initialization" },
- { 0x0f, 0x02, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station attachment" },
- { 0x0f, 0x02, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Enabling docking station" },
- { 0x0f, 0x02, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station ejection" },
- { 0x0f, 0x02, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Disabling docking station" },
- { 0x0f, 0x02, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Calling operating system wake-up vector" },
- { 0x0f, 0x02, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "System boot initiated" },
- { 0x0f, 0x02, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Motherboard initialization" },
- { 0x0f, 0x02, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "reserved" },
- { 0x0f, 0x02, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Floppy initialization" },
- { 0x0f, 0x02, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard test" },
- { 0x0f, 0x02, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Pointing device test" },
- { 0x0f, 0x02, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Primary CPU initialization" },
- { 0x0f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unknown Progress" },
-
- { 0x10, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Correctable memory error logging disabled" },
- { 0x10, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Event logging disabled" },
- { 0x10, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log area reset/cleared" },
- { 0x10, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "All event logging disabled" },
- { 0x10, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log full" },
- { 0x10, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log almost full" },
-
- { 0x11, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "BIOS Reset" },
- { 0x11, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Reset" },
- { 0x11, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Shut Down" },
- { 0x11, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Down" },
- { 0x11, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Cycle" },
- { 0x11, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS NMI/Diag Interrupt" },
- { 0x11, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Expired" },
- { 0x11, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS pre-timeout Interrupt" },
-
- { 0x12, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "System Reconfigured" },
- { 0x12, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "OEM System boot event" },
- { 0x12, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Undetermined system hardware failure" },
- { 0x12, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Entry added to auxiliary log" },
- { 0x12, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "PEF Action" },
- { 0x12, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Timestamp Clock Sync" },
-
- { 0x13, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "NMI/Diag Interrupt" },
- { 0x13, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Timeout" },
- { 0x13, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "I/O Channel check NMI" },
- { 0x13, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Software NMI" },
- { 0x13, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI PERR" },
- { 0x13, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI SERR" },
- { 0x13, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "EISA failsafe timeout" },
- { 0x13, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Correctable error" },
- { 0x13, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Uncorrectable error" },
- { 0x13, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Fatal NMI" },
- { 0x13, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Fatal Error" },
- { 0x13, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Degraded" },
-
- { 0x14, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Power Button pressed" },
- { 0x14, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Sleep Button pressed" },
- { 0x14, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Reset Button pressed" },
- { 0x14, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Latch" },
- { 0x14, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Service" },
-
- { 0x15, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module/Board", NULL },
- { 0x16, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Microcontroller/Coprocessor", NULL },
- { 0x17, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Add-in Card", NULL },
- { 0x18, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chassis", NULL },
- { 0x19, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", NULL },
- { 0x19, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", "Thermal Trip" },
- { 0x1a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other FRU", NULL },
-
- { 0x1b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Connected" },
- { 0x1b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Config Error" },
-
- { 0x1c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Terminator", NULL },
-
- { 0x1d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by power up" },
- { 0x1d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by hard reset" },
- { 0x1d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by warm reset" },
- { 0x1d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "User requested PXE boot" },
- { 0x1d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Automatic boot to diagnostic" },
- { 0x1d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated hard reset" },
- { 0x1d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated warm reset" },
- { 0x1d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "System Restart" },
-
- { 0x1e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "No bootable media" },
- { 0x1e, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Non-bootable disk in drive" },
- { 0x1e, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "PXE server not found" },
- { 0x1e, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Invalid boot sector" },
- { 0x1e, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Timeout waiting for selection" },
-
- { 0x1f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "A: boot completed" },
- { 0x1f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "C: boot completed" },
- { 0x1f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "PXE boot completed" },
- { 0x1f, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Diagnostic boot completed" },
- { 0x1f, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "CD-ROM boot completed" },
- { 0x1f, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "ROM boot completed" },
- { 0x1f, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "boot completed - device not specified" },
- { 0x1f, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation started" },
- { 0x1f, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation completed" },
- { 0x1f, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation aborted" },
- { 0x1f, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation failed" },
-
- { 0x20, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Error during system startup" },
- { 0x20, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Run-time critical stop" },
- { 0x20, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful stop" },
- { 0x20, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful shutdown" },
- { 0x20, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "PEF initiated soft shutdown" },
- { 0x20, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Agent not responding" },
-
- { 0x21, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Fault Status" },
- { 0x21, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Identify Status" },
- { 0x21, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Installed" },
- { 0x21, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Installation" },
- { 0x21, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Removal" },
- { 0x21, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot Power is Off" },
- { 0x21, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Removal Request" },
- { 0x21, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Interlock" },
- { 0x21, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot is Disabled" },
- { 0x21, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Spare Device" },
-
- { 0x22, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S0/G0: working" },
- { 0x22, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S1: sleeping with system hw & processor context maintained" },
- { 0x22, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S2: sleeping, processor context lost" },
- { 0x22, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S3: sleeping, processor & hw context lost, memory retained" },
- { 0x22, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4: non-volatile sleep/suspend-to-disk" },
- { 0x22, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5/G2: soft-off" },
- { 0x22, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4/S5: soft-off" },
- { 0x22, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G3: mechanical off" },
- { 0x22, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Sleeping in S1/S2/S3 state" },
- { 0x22, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G1: sleeping" },
- { 0x22, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5: entered by override" },
- { 0x22, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy ON state" },
- { 0x22, 0x0c, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy OFF state" },
- { 0x22, 0x0e, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Unknown" },
-
- { 0x23, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer expired" },
- { 0x23, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Hard reset" },
- { 0x23, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power down" },
- { 0x23, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power cycle" },
- { 0x23, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
- { 0x23, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
- { 0x23, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
- { 0x23, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
- { 0x23, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer interrupt" },
-
- { 0x24, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated page" },
- { 0x24, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated LAN alert" },
- { 0x24, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform Event Trap generated" },
- { 0x24, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated SNMP trap, OEM format" },
-
- { 0x25, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Present" },
- { 0x25, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Absent" },
- { 0x25, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Disabled" },
-
- { 0x26, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Monitor ASIC/IC", NULL },
-
- { 0x27, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat Lost" },
- { 0x27, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat" },
-
- { 0x28, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor access degraded or unavailable" },
- { 0x28, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Controller access degraded or unavailable" },
- { 0x28, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller off-line" },
- { 0x28, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller unavailable" },
- { 0x28, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor failure" },
- { 0x28, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "FRU failure" },
-
- { 0x29, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Low" },
- { 0x29, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Failed" },
- { 0x29, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Presence Detected" },
-
- { 0x2b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change detected" },
- { 0x2b, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" },
- { 0x2b, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Id" },
- { 0x2b, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Rev" },
- { 0x2b, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Rev" },
- { 0x2b, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Manuf Id" },
- { 0x2b, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl IPMI Vers" },
- { 0x2b, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" },
- { 0x2b, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" },
- { 0x2b, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Other" },
- { 0x2b, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, BIOS/EFI change" },
- { 0x2b, 0x01, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, SMBIOS change" },
- { 0x2b, 0x01, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S change" },
- { 0x2b, 0x01, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S loader change" },
- { 0x2b, 0x01, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Service Diag change" },
- { 0x2b, 0x01, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW agent change" },
- { 0x2b, 0x01, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW App change" },
- { 0x2b, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW Middle" },
- { 0x2b, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Prog HW Change (FPGA)" },
- { 0x2b, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU module change" },
- { 0x2b, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU component change" },
- { 0x2b, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace equ ver" },
- { 0x2b, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace new ver" },
- { 0x2b, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace old ver" },
- { 0x2b, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU HW conf change" },
- { 0x2b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware incompatibility detected" },
- { 0x2b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software incompatibility detected" },
- { 0x2b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported hardware version" },
- { 0x2b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported firmware or software version" },
- { 0x2b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change success" },
- { 0x2b, 0x07, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" },
- { 0x2b, 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Id" },
- { 0x2b, 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Rev" },
- { 0x2b, 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Rev" },
- { 0x2b, 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Manuf Id" },
- { 0x2b, 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl IPMI Vers" },
- { 0x2b, 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Aux Firm Id" },
- { 0x2b, 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Boot Block" },
- { 0x2b, 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Other" },
- { 0x2b, 0x07, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, BIOS/EFI change" },
- { 0x2b, 0x07, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, SMBIOS change" },
- { 0x2b, 0x07, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S change" },
- { 0x2b, 0x07, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S loader change" },
- { 0x2b, 0x07, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Service Diag change" },
- { 0x2b, 0x07, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW agent change" },
- { 0x2b, 0x07, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW App change" },
- { 0x2b, 0x07, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW Middle" },
- { 0x2b, 0x07, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Prog HW Change (FPGA)" },
- { 0x2b, 0x07, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU module change" },
- { 0x2b, 0x07, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU component change" },
- { 0x2b, 0x07, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace equ ver" },
- { 0x2b, 0x07, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace new ver" },
- { 0x2b, 0x07, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace old ver" },
- { 0x2b, 0x07, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU HW conf change" },
-
- { 0x2c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Not Installed" },
- { 0x2c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Inactive" },
- { 0x2c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation Requested" },
- { 0x2c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation in Progress" },
- { 0x2c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Active" },
- { 0x2c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation Requested" },
- { 0x2c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation in Progress" },
- { 0x2c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Communication lost" },
-
- { 0xF0, 0x00, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M0" },
- { 0xF0, 0x01, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M1" },
- { 0xF0, 0x02, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M2" },
- { 0xF0, 0x03, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M3" },
- { 0xF0, 0x04, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M4" },
- { 0xF0, 0x05, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M5" },
- { 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M6" },
- { 0xF0, 0x07, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M7" },
-
- { 0xF1, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B disabled" },
- { 0xF1, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMB-B disabled" },
- { 0xF1, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B enabled" },
- { 0xF1, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMP-B enabled" },
-
- { 0xF2, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Closed" },
- { 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" },
- { 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" },
-
- { 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" },
+static const struct ipmi_event_sensor_types vita_sensor_event_types[] = {
+ /* VITA FRU State */
+ { 0xF0, 0x00, 0xFF, "Transition to M0" },
+ { 0xF0, 0x01, 0xFF, "Transition to M1" },
+ { 0xF0, 0x04, 0xFF, "Transition to M4" },
+ { 0xF0, 0x05, 0xFF, "Transition to M5" },
+ { 0xF0, 0x06, 0xFF, "Transition to M6" },
+ { 0xF0, 0x07, 0xFF, "Transition to M7" },
+ /* VITA System IPMB Link */
+ { 0xF1, 0x00, 0xFF, "IPMB-A disabled, IPMB-B disabled" },
+ { 0xF1, 0x01, 0xFF, "IPMB-A enabled, IPMB-B disabled" },
+ { 0xF1, 0x02, 0xFF, "IPMB-A disabled, IPMB-B enabled" },
+ { 0xF1, 0x03, 0xFF, "IPMB-A enabled, IPMB-B enabled" },
+ /* VITA FRU Temperature */
+ { 0xF3, 0x00, 0xff, "At or below Lower Non-critical" },
+ { 0xF3, 0x01, 0xff, "At or below Lower Critical" },
+ { 0xF3, 0x02, 0xff, "At or below Lower Non-recoverable" },
+ { 0xF3, 0x03, 0xff, "At or above Upper Non-critical" },
+ { 0xF3, 0x04, 0xff, "At or above Upper Critical" },
+ { 0xF3, 0x05, 0xff, "At or above Upper Non-recoverable" },
+ { 0x00, 0x00, 0xff, NULL }
+};
- { 0x00, 0x00, 0x00, 0x00, NULL, NULL },
+static const struct ipmi_event_sensor_types oem_kontron_event_types[] = {
+ /* Board Reset(cPCI) */
+ { 0xC1, 0x00, 0xff, "Push Button" },
+ { 0xC1, 0x01, 0xff, "Bridge Reset" },
+ { 0xC1, 0x02, 0xff, "Backplane" },
+ { 0xC1, 0x03, 0xff, "Hotswap Fault" },
+ { 0xC1, 0x04, 0xff, "Hotswap Healty" },
+ { 0xC1, 0x05, 0xff, "Unknown" },
+ { 0xC1, 0x06, 0xff, "ITP" },
+ { 0xC1, 0x07, 0xff, "Hardware Watchdog" },
+ { 0xC1, 0x08, 0xff, "Software Reset" },
+ /* IPMB-L Link State, based on PICMG IPMB-0 Link state sensor */
+ { 0xC3, 0x02, 0xff, "IPMB L Disabled" },
+ { 0xC3, 0x03, 0xff, "IPMB L Enabled" },
+ /* Board Reset */
+ { 0xC4, 0x00, 0xff, "Push Button" },
+ { 0xC4, 0x01, 0xff, "Hardware Power Failure" },
+ { 0xC4, 0x02, 0xff, "Unknown" },
+ { 0xC4, 0x03, 0xff, "Hardware Watchdog" },
+ { 0xC4, 0x04, 0xff, "Soft Reset" },
+ { 0xC4, 0x05, 0xff, "Warm Reset" },
+ { 0xC4, 0x06, 0xff, "Cold Reset" },
+ { 0xC4, 0x07, 0xff, "IPMI Command" },
+ { 0xC4, 0x08, 0xff, "Setup Reset (Save CMOS)" },
+ { 0xC4, 0x09, 0xff, "Power Up Reset" },
+ /* POST Value */
+ { 0xC6, 0x0E, 0xff, "Post Error (see data2)" },
+ /* FWUM Status */
+ { 0xC7, 0x00, 0xff, "First Boot After Upgrade" },
+ { 0xC7, 0x01, 0xff, "First Boot After Rollback(error)" },
+ { 0xC7, 0x02, 0xff, "First Boot After Errors (watchdog)" },
+ { 0xC7, 0x03, 0xff, "First Boot After Manual Rollback" },
+ { 0xC7, 0x08, 0xff, "Firmware Watchdog Bite, reset occurred" },
+ /* Switch Mngt Software Status */
+ { 0xC8, 0x00, 0xff, "Not Loaded" },
+ { 0xC8, 0x01, 0xff, "Initializing" },
+ { 0xC8, 0x02, 0xff, "Ready" },
+ { 0xC8, 0x03, 0xff, "Failure (see data2)" },
+ /* Diagnostic Status */
+ { 0xC9, 0x00, 0xff, "Started" },
+ { 0xC9, 0x01, 0xff, "Pass" },
+ { 0xC9, 0x02, 0xff, "Fail" },
+ { 0xCA, 0x00, 0xff, "In progress"},
+ { 0xCA, 0x01, 0xff, "Success"},
+ { 0xCA, 0x02, 0xff, "Failure"},
+ /* FRU Over Current */
+ { 0xCB, 0x00, 0xff, "Asserted"},
+ { 0xCB, 0x01, 0xff, "Deasserted"},
+ /* FRU Sensor Error */
+ { 0xCC, 0x00, 0xff, "Asserted"},
+ { 0xCC, 0x01, 0xff, "Deasserted"},
+ /* FRU Power Denied */
+ { 0xCD, 0x00, 0xff, "Asserted"},
+ { 0xCD, 0x01, 0xff, "Deasserted"},
+ /* Reset */
+ { 0xCF, 0x00, 0xff, "Asserted"},
+ { 0xCF, 0x01, 0xff, "Deasserted"},
+ /* END */
+ { 0x00, 0x00, 0xff, NULL },
};
int ipmi_sel_main(struct ipmi_intf *, int, char **);
@@ -695,12 +676,13 @@ void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_
void ipmi_sel_print_extended_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc);
-const char * ipmi_sel_get_sensor_type(uint8_t code);
-const char * ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset);
+const char * ipmi_get_sensor_type(struct ipmi_intf *intf, uint8_t code);
uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel_event_record * evt);
-char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
+char * get_viking_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf);
char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
int ipmi_sel_oem_init(const char * filename);
-
-#endif /* IPMI_SEL_H */
+const struct ipmi_event_sensor_types *
+ipmi_get_first_event_sensor_type(struct ipmi_intf *intf, uint8_t sensor_type, uint8_t event_type);
+const struct ipmi_event_sensor_types *
+ipmi_get_next_event_sensor_type(const struct ipmi_event_sensor_types *evt);
diff --git a/include/ipmitool/ipmi_sel_supermicro.h b/include/ipmitool/ipmi_sel_supermicro.h
index a058a8c..55f04d7 100644
--- a/include/ipmitool/ipmi_sel_supermicro.h
+++ b/include/ipmitool/ipmi_sel_supermicro.h
@@ -30,9 +30,38 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#pragma once
+
+static uint16_t supermicro_x11[] = {
+ 0x0958, 0x0955, 0x0953, 0x0952, 0x0941, 0x093A, 0x0939, 0x0938, 0x0937, 0x0930, 0x0927, 0x091D,
+ 0x091C, 0x0917, 0x090D, 0x0909, 0x0907, 0x0901, 0x089F, 0x089C, 0x089B, 0x089A, 0x0898, 0x0896,
+ 0x0895, 0x0894, 0x0891, 0x0890, 0x0888, 0x0886, 0x0885, 0x0884, 0xFFFF
+};
+
+static uint16_t supermicro_b11[] = {
+ 0xFFFF
+};
+
+static uint16_t supermicro_b2[] = {
+ 0x0951, 0x094E, 0x0931, 0x092E, 0x092A, 0x0928, 0x0908, 0xFFFF
+};
+
+static uint16_t supermicro_x10OBi[] = {
+ 0x0923, 0xFFFF
+};
+
+static uint16_t supermicro_x10QRH[] = {
+ 0x0872, 0xFFFF
+};
+
+static uint16_t supermicro_x10QBL[] = {
+ 0x0853, 0xFFFF
+};
+
+static uint16_t supermicro_brickland[] = {
+ 0x0726, 0x083A, 0xFFFF
+};
-#ifndef IPMI_SEL_SUPERMICRO_H
-# define IPMI_SEL_SUPERMICRO_H
static uint16_t supermicro_x9dal[] = {
0x0635, 0xFFFF
@@ -50,38 +79,73 @@ static uint16_t supermicro_x9[] = {
0x0635, 0x0733, 0x0722, 0x0703, 0x0721, 0x0716, 0x0637, 0x0651, 0xFFFF
};
+static uint16_t supermicro_romely[] = {
+ 0x0841, 0x0732, 0x0731, 0x0730, 0x0727, 0x0725, 0x0724, 0x0723, 0x0720, 0x0718, 0x0717, 0x0715,
+ 0x0713, 0x0711, 0x070E, 0x070A, 0x0709, 0x0708, 0x0706, 0x0705, 0x0704, 0x0702, 0x0701, 0x0700,
+ 0x066F, 0x066E, 0x066D, 0x0669, 0x0667, 0x0666, 0x0665, 0x0664, 0x0662, 0x0660, 0x0636, 0x0630,
+ 0x062F, 0x062C, 0x0628, 0x0626, 0x0827, 0x070F, 0x0707, 0x0840, 0x0729, 0x0719, 0x0712, 0x070D,
+ 0x066C, 0x066A, 0x0625, 0x0714, 0x0710, 0x070C, 0x070B, 0x0668, 0x0663, 0x0661, 0x062B, 0x062A,
+ 0x0629, 0x093E, 0x0932, 0x092D, 0x092B, 0x0924, 0x0922, 0x0921, 0x091E, 0x0919, 0x0916, 0x089D,
+ 0x0899, 0x0893, 0x0892, 0x0882, 0x0881, 0x0880, 0x087F, 0x087D, 0x0879, 0x0877, 0x086F, 0x086E,
+ 0x086D, 0x086C, 0x086B, 0x085C, 0x085B, 0x084B, 0x0865, 0x0864, 0x0860, 0x0859, 0x0858, 0x0857,
+ 0x0854, 0x0852, 0x0845, 0x0844, 0x0843, 0x0842, 0x083B, 0x0838, 0x0837, 0x0836, 0x0835, 0x0834,
+ 0x0833, 0x0832, 0x0831, 0x0830, 0x0826, 0x0825, 0x0824, 0x0822, 0x0821, 0x0819, 0x0818, 0x0817,
+ 0x0816, 0x0815, 0x0814, 0x0728, 0x0813, 0x0812, 0x0810, 0x0807, 0x0806, 0x0805, 0x0804, 0x0803,
+ 0x0802, 0x0801, 0x0889, 0x0861, 0x083E, 0x0846, 0x0946, 0x0950, 0xFFFF
+};
+
static uint16_t supermicro_b8[] = {
0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xFFFF
};
static uint16_t supermicro_h8[] = {
0xa111, 0x0408, 0x0811, 0x1411, 0x0911, 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11,
- 0xbc11, 0xa911, 0xaa11, 0xbd11, 0xcb11, 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611,
- 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211,
- 0xa311, 0x1311, 0xba11, 0xa711, 0xd111, 0x1711, 0xcf11, 0x2011, 0x1811, 0xFFFF
+ 0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511,
+ 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311,
+ 0x1311, 0xba11, 0xa711, 0xd111, 0x1711, 0xcf11, 0x2011, 0x1811, 0xFFFF
};
static uint16_t supermicro_p8[] = {
- 0x6480, 0x7380, 0x6280, 0x7480, 0x5980, 0xFFFF
+ 0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xFFFF
};
static uint16_t supermicro_x8[] = {
0xa880, 0x0403, 0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006,
0x040a, 0xf280, 0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614,
- 0x060c, 0x0003, 0x040b, 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e,
- 0x061a, 0xf580, 0x062e, 0x0009, 0xFFFF
+ 0x0003, 0x040b, 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a,
+ 0xf580, 0x062e, 0x0009, 0xFFFF
};
static uint16_t supermicro_X8[] = {
0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xa111, 0x0408, 0x0811, 0x1411, 0x0911,
- 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11, 0xbc11, 0xa911, 0xaa11, 0xbd11, 0xcb11,
- 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411,
- 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311, 0x1311, 0xba11, 0xa711, 0xd111,
- 0x1711, 0xcf11, 0x2011, 0x1811, 0x6480, 0x7380, 0x6280, 0x7480, 0x5980, 0xa880, 0x0403, 0x0100,
- 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006, 0x040a, 0xf280, 0x060f,
- 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614, 0x060c, 0x0003, 0x040b,
- 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a, 0xf580, 0x062e,
+ 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11, 0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11,
+ 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911,
+ 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311, 0x1311, 0xba11, 0xa711, 0xd111, 0x1711,
+ 0xcf11, 0x2011, 0x1811, 0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xa880, 0x0403,
+ 0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006, 0x040a, 0xf280,
+ 0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614, 0x0003, 0x040b,
+ 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a, 0xf580, 0x062e,
0x0009, 0xFFFF
};
-#endif /* IPMI_SEL_SUPERMICRO_H */
+static uint16_t supermicro_older[] = {
+ 0x8080, 0x8180, 0x8280, 0x8480, 0x8580, 0x8680, 0x8780, 0x8880, 0x8980, 0x9080, 0x9180, 0x9280,
+ 0x9380, 0x9480, 0x9580, 0x9680, 0x9780, 0xA080, 0x9880, 0x9980, 0xB080, 0xB180, 0xB280, 0xB380,
+ 0xB480, 0xA280, 0xB580, 0xB680, 0xA580, 0xB780, 0xD180, 0xA380, 0xA480, 0xD680, 0xBA80, 0xD280,
+ 0x2111, 0xD380, 0xBC80, 0xBD80, 0xBE80, 0xC080, 0xC180, 0xAA80, 0xBE80, 0xBF80, 0xAB80, 0xD480,
+ 0xD580, 0xAF80, 0xAE80, 0xC280, 0xAC80, 0xD080, 0xDA80, 0xDB80, 0xDC80, 0xDD80, 0xA680, 0xDE80,
+ 0xAA80, 0xDF80, 0xBB80, 0xA780, 0xF080, 0xF180, 0xB880, 0xC380, 0xB780, 0x2311, 0xA980, 0xF480,
+ 0xB980, 0x0002, 0xba80, 0x0602, 0x0603, 0x0604, 0x0607, 0x0410, 0xA611, 0x060A, 0x0611, 0xBB11,
+ 0x061D, 0x0622, 0x0623, 0x0624, 0x0627, 0x0631, 0x0633, 0x0634, 0x0690, 0x0691, 0x0640, 0x0641,
+ 0x0642, 0x066B, 0x0743, 0x0644, 0x0645, 0x0645, 0x0646, 0x0647, 0x0648, 0x0647, 0x0650, 0x0652,
+ 0x0653, 0x0654, 0x0655, 0x0808, 0x0809, 0x0656, 0x0657, 0x0658, 0x0659, 0x0820, 0x0820, 0x0734,
+ 0x0823, 0x0828, 0x0829, 0x0839, 0x083C, 0x083D, 0x083F, 0x0847, 0x0848, 0x0849, 0x0850, 0x0851,
+ 0x0855, 0x0856, 0x0862, 0x0863, 0x0866, 0x0867, 0x0868, 0x0869, 0x084A, 0x084C, 0x084D, 0x084F,
+ 0x085A, 0x085D, 0x085E, 0x085F, 0x086A, 0x0870, 0x0873, 0x0874, 0x0875, 0x0876, 0x0878, 0x087A,
+ 0x087B, 0x087C, 0x087E, 0x0883, 0x0887, 0x088A, 0x088B, 0x088C, 0x088D, 0x088E, 0x088F, 0x0897,
+ 0x089E, 0x0902, 0x0903, 0x0904, 0x0905, 0x0906, 0x090A, 0x090B, 0x090C, 0x090E, 0x090F, 0x0910,
+ 0x0912, 0x0913, 0x0914, 0x0915, 0x0918, 0x091A, 0x091B, 0x091F, 0x0920, 0x0925, 0x0926, 0x0929,
+ 0x092C, 0x092F, 0x0934, 0x0935, 0x0936, 0x093B, 0x093C, 0x093D, 0x093F, 0x0940, 0x0942, 0x0943,
+ 0x0944, 0x0945, 0x0947, 0x0948, 0x0949, 0x094A, 0x094B, 0x094C, 0x094D, 0x094E, 0x0954, 0x0956,
+ 0x0957, 0x0959, 0xFFFF
+};
diff --git a/include/ipmitool/ipmi_sensor.h b/include/ipmitool/ipmi_sensor.h
index 63fc4aa..48f7337 100644
--- a/include/ipmitool/ipmi_sensor.h
+++ b/include/ipmitool/ipmi_sensor.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_SENSOR_H
-#define IPMI_SENSOR_H
+#pragma once
#include <math.h>
#include <ipmitool/bswap.h>
@@ -86,4 +85,3 @@ struct sensor_set_thresh_rq {
int ipmi_sensor_main(struct ipmi_intf *, int, char **);
int ipmi_sensor_print_fc(struct ipmi_intf *, struct sdr_record_common_sensor *, uint8_t);
int ipmi_sensor_get_sensor_reading_factors( struct ipmi_intf * intf, struct sdr_record_full_sensor * sensor, uint8_t reading);
-#endif /* IPMI_SENSOR_H */
diff --git a/include/ipmitool/ipmi_session.h b/include/ipmitool/ipmi_session.h
index 21ff12f..b01f9d9 100644
--- a/include/ipmitool/ipmi_session.h
+++ b/include/ipmitool/ipmi_session.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_SESSION_H
-#define IPMI_SESSION_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
@@ -127,5 +126,3 @@ struct get_session_info_rsp
int ipmi_session_main(struct ipmi_intf *, int, char **);
-
-#endif /*IPMI_CHANNEL_H*/
diff --git a/include/ipmitool/ipmi_sol.h b/include/ipmitool/ipmi_sol.h
index 6e2fd24..0cbbe0e 100644
--- a/include/ipmitool/ipmi_sol.h
+++ b/include/ipmitool/ipmi_sol.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_SOL_H
-#define IPMI_SOL_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -92,17 +91,13 @@ struct activate_payload_rsp {
* function will return -1 if value is not valid, or
* will return 0 if valid.
*/
-int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
- const char *name,
- int base,
- uint8_t minval,
- uint8_t maxval,
- uint8_t *out_value);
+int ipmi_sol_set_param_isvalid_uint8_t(const char *strval,
+ const char *name,
+ uint8_t minval,
+ uint8_t maxval,
+ uint8_t *out_value);
int ipmi_sol_main(struct ipmi_intf *, int, char **);
-int ipmi_get_sol_info(struct ipmi_intf * intf,
- uint8_t channel,
- struct sol_config_parameters * params);
-
-
-#endif /* IPMI_SOL_H */
+int ipmi_get_sol_info(struct ipmi_intf *intf,
+ uint8_t channel,
+ struct sol_config_parameters *params);
diff --git a/include/ipmitool/ipmi_strings.h b/include/ipmitool/ipmi_strings.h
index 10ec430..17c37c6 100644
--- a/include/ipmitool/ipmi_strings.h
+++ b/include/ipmitool/ipmi_strings.h
@@ -30,11 +30,12 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_STRINGS_H
-#define IPMI_STRINGS_H
+#pragma once
#include <ipmitool/helper.h>
+#define CC_STRING(cc) val2str(cc, completion_code_vals)
+
extern const struct valstr completion_code_vals[];
extern const struct valstr entity_id_vals[];
extern const struct valstr entity_device_type_vals[];
@@ -48,10 +49,14 @@ extern const struct valstr ipmi_authtype_vals[];
extern const struct valstr ipmi_channel_protocol_vals[];
extern const struct valstr ipmi_channel_medium_vals[];
extern const struct valstr ipmi_chassis_power_control_vals[];
+extern const struct valstr ipmi_chassis_restart_cause_vals[];
extern const struct valstr ipmi_auth_algorithms[];
extern const struct valstr ipmi_integrity_algorithms[];
extern const struct valstr ipmi_encryption_algorithms[];
-extern const struct valstr ipmi_oem_info[];
+extern const struct valstr ipmi_user_enable_status_vals[];
+extern const struct valstr *ipmi_oem_info;
+int ipmi_oem_info_init();
+void ipmi_oem_info_free();
extern const struct valstr picmg_frucontrol_vals[];
extern const struct valstr picmg_clk_family_vals[];
@@ -68,8 +73,5 @@ extern const struct oemvalstr picmg_busres_shmc_status_vals[];
/* these are similar, expect that the lookup takes the IANA number
as first parameter */
extern const struct oemvalstr ipmi_oem_product_info[];
-extern const struct oemvalstr ipmi_oem_sdr_type_vals[];
-
-
-
-#endif /*IPMI_STRINGS_H*/
+extern const char *ipmi_generic_sensor_type_vals[];
+extern const struct oemvalstr ipmi_oem_sensor_type_vals[];
diff --git a/include/ipmitool/ipmi_sunoem.h b/include/ipmitool/ipmi_sunoem.h
index 78afbf2..664bc7d 100644
--- a/include/ipmitool/ipmi_sunoem.h
+++ b/include/ipmitool/ipmi_sunoem.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_SUNOEM_H
-#define IPMI_SUNOEM_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
@@ -68,6 +67,3 @@ typedef enum {
} sunoem_ec_t;
int ipmi_sunoem_main(struct ipmi_intf *, int, char **);
-
-#endif /*IPMI_SUNOEM_H*/
-
diff --git a/include/ipmitool/ipmi_time.h b/include/ipmitool/ipmi_time.h
new file mode 100644
index 0000000..fc7a23a
--- /dev/null
+++ b/include/ipmitool/ipmi_time.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2018 Alexander Amelkin. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of the copyright holder, nor the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * THE COPYRIGHT HOLDER AND ITS LICENSORS SHALL NOT BE LIABLE
+ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
+ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
+ * THE COPYRIGHT HOLDER OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
+ * PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
+ * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
+ * THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS
+ * SOFTWARE, EVEN IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGES.
+ */
+
+#pragma once
+
+#include <time.h>
+#include <stdbool.h>
+
+extern bool time_in_utc;
+
+/* Special values according to IPMI v2.0, rev. 1.1, section 37.1 */
+#define IPMI_TIME_UNSPECIFIED 0xFFFFFFFFu
+#define IPMI_TIME_INIT_DONE 0x20000000u
+
+#define SECONDS_A_DAY (24 * 60 * 60)
+
+/*
+ * Check whether the timestamp is in seconds since Epoch or since
+ * the system startup.
+ */
+static inline bool ipmi_timestamp_is_special(time_t ts)
+{
+ return (ts < IPMI_TIME_INIT_DONE);
+}
+
+/*
+ * Check whether the timestamp is valid at all
+ */
+static inline bool ipmi_timestamp_is_valid(time_t ts)
+{
+ return (ts != IPMI_TIME_UNSPECIFIED);
+}
+
+/*
+ * Just 26 characters are required for asctime_r(), plus timezone info.
+ * However just to be safe locale-wise and assuming that in no locale
+ * the date/time string exceeds the 'standard' legacy terminal width,
+ * the buffer size is set here to 80.
+ */
+#define IPMI_ASCTIME_SZ 80
+typedef char ipmi_datebuf_t[IPMI_ASCTIME_SZ];
+
+/*
+ * These are ipmitool-specific versions that take
+ * in account the command line options
+ */
+char *ipmi_asctime_r(time_t stamp, ipmi_datebuf_t outbuf);
+size_t ipmi_strftime(char *s, size_t max, const char *format, time_t stamp)
+ __attribute__((format(strftime, 3, 0)));
+
+/* These return pointers to static arrays and aren't thread safe */
+char *ipmi_timestamp_fmt(uint32_t stamp, const char *fmt)
+ __attribute__((format(strftime, 2, 0)));
+char *ipmi_timestamp_string(uint32_t stamp); /* Day Mon DD HH:MM:SS YYYY ZZZ */
+char *ipmi_timestamp_numeric(uint32_t stamp); /* MM/DD/YYYY HH:MM:SS ZZZ */
+char *ipmi_timestamp_date(uint32_t stamp); /* MM/DD/YYYY ZZZ */
+char *ipmi_timestamp_time(uint32_t stamp); /* HH:MM:SS ZZZ */
+
+/* Subtract the UTC offset from local time_t */
+time_t ipmi_localtime2utc(time_t local);
diff --git a/include/ipmitool/ipmi_tsol.h b/include/ipmitool/ipmi_tsol.h
index 8157cd8..8baf21e 100644
--- a/include/ipmitool/ipmi_tsol.h
+++ b/include/ipmitool/ipmi_tsol.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_TSOL_H
-#define IPMI_TSOL_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -42,5 +41,3 @@
#define IPMI_TSOL_DEF_PORT 6230
int ipmi_tsol_main(struct ipmi_intf *, int, char **);
-
-#endif /* IPMI_TSOL_H */
diff --git a/include/ipmitool/ipmi_user.h b/include/ipmitool/ipmi_user.h
index fd727ca..a3cebd9 100644
--- a/include/ipmitool/ipmi_user.h
+++ b/include/ipmitool/ipmi_user.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_USER_H
-#define IPMI_USER_H
+#pragma once
#if HAVE_CONFIG_H
# include <config.h>
@@ -48,6 +47,9 @@
#define IPMI_USER_ENABLE_DISABLED 0x80
#define IPMI_USER_ENABLE_RESERVED 0xC0
+#define IPMI_UID_MASK 0x3F /* The user_id is 6-bit and is usually in bits [5:0] */
+#define IPMI_UID(id) ((id) & IPMI_UID_MASK)
+
/* (22.27) Get and (22.26) Set User Access */
struct user_access_t {
uint8_t callin_callback;
@@ -79,5 +81,3 @@ int _ipmi_set_user_access(struct ipmi_intf *intf,
int _ipmi_set_user_password(struct ipmi_intf *intf,
uint8_t user_id, uint8_t operation,
const char *password, uint8_t is_twenty_byte);
-
-#endif /* IPMI_USER_H */
diff --git a/include/ipmitool/ipmi_vita.h b/include/ipmitool/ipmi_vita.h
index 71d471a..b62fb12 100644
--- a/include/ipmitool/ipmi_vita.h
+++ b/include/ipmitool/ipmi_vita.h
@@ -2,8 +2,7 @@
* Copyright (c) Pigeon Point Systems. All right reserved
*/
-#ifndef _IPMI_VITA_H_
-#define _IPMI_VITA_H_
+#pragma once
/* VITA 46.11 commands */
#define VITA_GET_VSO_CAPABILITIES_CMD 0x00
@@ -45,5 +44,3 @@ ipmi_vita_ipmb_address(struct ipmi_intf *intf);
extern int
ipmi_vita_main(struct ipmi_intf * intf, int argc, char ** argv);
-
-#endif /* _IPMI_VITA_H_ */
diff --git a/include/ipmitool/log.h b/include/ipmitool/log.h
index 7199fdb..dcdd760 100644
--- a/include/ipmitool/log.h
+++ b/include/ipmitool/log.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMITOOL_LOG_H
-#define IPMITOOL_LOG_H
+#pragma once
#include <syslog.h>
@@ -54,10 +53,6 @@
void log_init(const char * name, int isdaemon, int verbose);
void log_halt(void);
-void log_level_set(int level);
-int log_level_get(void);
+void log_level_set(int verbose);
void lprintf(int level, const char * format, ...);
void lperror(int level, const char * format, ...);
-
-#endif /*IPMITOOL_LOG_H*/
-
diff --git a/install-sh b/install-sh
deleted file mode 100755
index 377bb86..0000000
--- a/install-sh
+++ /dev/null
@@ -1,527 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2011-11-20.07; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" "" $nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
-
- -T) no_target_directory=true;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call 'install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- do_exit='(exit $ret); exit $ret'
- trap "ret=129; $do_exit" 1
- trap "ret=130; $do_exit" 2
- trap "ret=141; $do_exit" 13
- trap "ret=143; $do_exit" 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names problematic for 'test' and other utilities.
- case $src in
- -* | [=\(\)!]) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
- dst=$dst_arg
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
- esac
-
- eval "$initialize_posix_glob"
-
- oIFS=$IFS
- IFS=/
- $posix_glob set -f
- set fnord $dstdir
- shift
- $posix_glob set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/ipmitool.spec b/ipmitool.spec
deleted file mode 100644
index fbdd549..0000000
--- a/ipmitool.spec
+++ /dev/null
@@ -1,404 +0,0 @@
-Name: ipmitool
-Summary: ipmitool - Utility for IPMI control
-Version: 1.8.17
-Release: 1%{?_distro:.%{_distro}}
-License: BSD
-Group: Utilities
-Packager: Jim Mankovich <jmank@hp.com>
-Source: %{name}-%{version}.tar.gz
-Buildroot: /var/tmp/ipmitool-root
-
-%description
-This package contains a utility for interfacing with devices that support
-the Intelligent Platform Management Interface specification. IPMI is
-an open standard for machine health, inventory, and remote power control.
-
-This utility can communicate with IPMI-enabled devices through either a
-kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in
-the IPMI specification. IPMIv2 adds support for encrypted LAN
-communications and remote Serial-over-LAN functionality.
-
-It provides commands for reading the Sensor Data Repository (SDR) and
-displaying sensor values, displaying the contents of the System Event
-Log (SEL), printing Field Replaceable Unit (FRU) information, reading and
-setting LAN configuration, and chassis power control.
-
-%prep
-if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
- rm -rf $RPM_BUILD_ROOT
-fi
-
-%setup
-
-%build
-./configure --with-kerneldir \
- --with-rpm-distro= \
- --prefix=%{_prefix} \
- --bindir=%{_bindir} \
- --sbindir=%{_sbindir} \
- --datadir=%{_datadir} \
- --includedir=%{_includedir} \
- --libdir=%{_libdir} \
- --mandir=%{_mandir} \
- --sysconfdir=%{_sysconfdir}
-make
-
-%install
-make DESTDIR=$RPM_BUILD_ROOT install-strip
-
-%clean
-if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
- rm -rf $RPM_BUILD_ROOT
-fi
-
-%files
-%defattr(755,root,root)
-%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_sbindir}/*
-%{_datadir}/ipmitool/*
-%{_mandir}/man*/*
-%doc %{_datadir}/doc/ipmitool
-
-
-%changelog
-* Wed Feb 25 2009 <pere@hungry.com> 1.8.11-1
-- Fix new GCC compilation issues in regards to Packing
-- Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
- for 2.4 kernel instead of ipmi_si_drv driver module
-- New -y option added to allow specification of kg keys with
- non-printable characters
-- New -K option added to allow kgkey settings via environmental
- variable IPMI_KGKEY
-- Generic device support added for EEPROM with SDR Type 10h (gendev)
-- Fix to lan-bridging for a double-bridging crash and to fix
- an issue with bridging multiple concurrent requests and
- erroneous handling of raw Send Message
-- Lanplus fix for commands like 'sensor list' without the -t option
- causing wrong double bridged requests of a sensor is located
- on another satellite controller
-- Fix lan and lanplus request list entry removal bugs
-- Fix non-working issue when trying to send a bridge message with
- Cipher 3
-- Change bridge message handling to reuse command ipmi_lan_poll_recv
-- Added PICMG 2.0 and 2.3 support
-- Fix PICMG (ATCA) extension verification and reversal of BCD encoded
- values for "major" and "minor" fields
-- Add IANA support for Pigeon Point
-- Add OEM SW/FW Record identification
-- Fix to include I2C and LUN addresses so sensors are correctly managed
-- Patch ID 1990560 to get readings from non-linear analog sensors
-- Add support for SOL payload status command
-- SOL set parameter range checking added
-- Fixed SOL activate options usage
-- Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
-- Added retries to SOL keepalive
-- Fixed wrong mask values for Front Panel disable/enable status
-- Add support to access fru internal use area
-- Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
- blocks of data within the FRU storage area to be write protected.
-- Fix node reporting in GUID; Tracker bug #2339675
-- Fix watchdog use/action print strings
-- Fix endian bug in SDR add from file; Tracker bug #2075258
-- Fix crash when dumping SDRs in a file and there's an error
- getting an SDR; improve algorithm for optimal packet size
-- Fix occasional SDR dump segfault; #1793076
-- Allow ipmitool sel delete to accept hex list entry numbers
-- Fix SEL total space reporting.
-- Fix for garbage sensor threshold values reported when none
- returned. Tracker Bug #863748
-- ipmievd change to Monitor %used in SEL buffer and log warnings when
- the buffer is 80% and 100% full
-
-* Fri Aug 08 2008 <pere@hungry.com> 1.8.10-1
- - Added support for BULL IANA number.
- - Fixed contrib build so the oem_ibm_sel_map file gets included in rpm
- builds again.
- - Added support for Debian packages to be built from CVS
- - Fix for sdr and sel timestamp reporting issues
- - Fix for discrete sensor state print routines to address state bits 8-14
- - Change ipmi_chassis_status() to non-static so it can be used externally
- - Added retries to SOL keepalive
- - Fix to stop sensor list command from reporting a failure due to missing
- sensor
- - Fix bug in sdr free space reporting
- - Add support for IANA number to vendor name conversion for many vendors
- - Fix segfault bug in lan set command
- - Fix bug in population of raw i2c wdata buffer
- - Fix bug in ipmb sensor reading
- - Fix misspellings, typos, incorrect strncmp lengths, white space
- - Update/fix printed help and usages for many commands
- - Add and update support for all commands in ipmitool man page
- - Fix for lanplus session re-open when the target becomes unavailable following
- a fw upgrade activation
- - Add support for watchdog timer shutoff, reset, and get info
- - Add support for more ibm systems in oem_ibm_sel_map
- - Add more JEDEC support info for DIMMs; decrease request size for DIMM FRU
- info to 16 bytes at a time to allow more DIMM FRUs to respond.
- - Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg buffer
- length more aggressively when no response from iol
- - Fix HPM firmware activation via IOL; fake a timeout after IOL session
- re-open to force get upgrade status retry; Added retries on 0xD3
- completion code
- - Add support for freeipmi 0.6.0; adjust autoconf for changes
- - Fix for oemval2str size
- - Add support for product name resolution in mc info
- - Fix FRU display format
- - Added PICMG ekeying analyzer module support (ekanalyzer); display point
- to point physical connectivity and power supply information between
- carriers and AMC modules; display matched results of ekeying match
- between an on-carrier device and AMC module or between 2 AMC modules
- - Fix AMC GUID display support
- - Improved amcportstate operations
- - Added resolution for new sensor types
- - Fix segfault in SOL
- - Fix bug that caused infinite loop on BMCs with empty SDRs
- - Fix to move out Kontron OEM sensor resolution for other OEMs which could
- lead to bad event descriptions
- - Add new FRU edit mode thereby allowing serial numbers, etc. to be changed;
- improvements to OEM edit mode
- - Added SPD support for parms: channel number, max read size
- - Add SDR support for adding SDR records from a dumped file, clearing SDR,
- adding partial SDR records
- - Add updates and fixes to hpmfwupg: upload block size to 32 bytes for KCS,
- handle long response option, implement rollback override, garbage output fix
- - Add double bridge lan support , fix bridging issue
- - Add HPM support to pre-check which components need to be skipped
- - Fix autodetection of maximum packet size when using IPMB
- - Add new Kontron OEM command to set the BIOS boot option sequence
- - Add support for dual-bridge/ dual send message
- - Add auto-detect for local IPMB address using PICMG 2.X extension
- - Add support for HPM.1 1.0 specification compliance
- - Fix for improper lan/lanplus addressing
- - Added transit_channel and transit_addr to ipmi_intf struct
- - Fix bad password assertion bug due to rakp2 HMAC not being checked properly
- - Added ability to interpret PPS shelf manager clia sel dump
- - Corrected PICMG M7 state event definition macros
- - Added FRU parsing enhancements
- - Added "isol info", "isol set" and "isol activate" commands to support
- Intel IPMI v1.5 SOL functionality. Removed "isol setup" command.
- - Fix bug in ipmi_lan_recv_packet() in lan and lanplus interfaces.
- - Fix bug in "chassis poh" command.
- - Fix HPM.1 upgrade to apply to only given component when instructed to do so
- - Added configure auto-detection if dual bridge extension is supported
- by OpenIPMI
-
-* Tue Mar 6 2007 <pere@hungry.com> 1.8.9-1
- - Added initial AMC ekey query operation support
- - Improvements to ekeying support (PICMG 3.x only)
- - Added initial interactive edition support for multirec; added IANA
- verification before interpreting PICMG records.
- - Added edit support for AMC activation "Maximum Internal Current"
- - Fix bug generating garbage on the screen when handling GetDeviceId
- and sol traffic occurs
- - Added ability to map OEM sensor types to OEM description string using
- IANA number; moved IANA number table
- - Fix lan set access command to use value already saved within parameters
- for PEF and authentication
- - Fix bug in cmd ipmitool lan stats get 1
- - Add support to allow ipmitool/ipmievd to target specific device nodes
- on multi-BMC systems
- - Add support for name+privilege lookup for lanplus sessions
- - Fix time_t conversion bug for 64-bit OS
- - Added prefix of hostname on sel ipmievd sessions
- - Fixed FWUM Get Info
- - Fix ipmievd fd closing bug
- - Add set-in-progress flag support to chassis bootdev
- - Added new chassis bootdev options
- - Add sol payload enable/disable comman
- - Fix SOL set errors when commit-write not supported
- - Fix reset of session timeout for lanplus interface
- - Fixed lan interface accessibility timeout handling
- - Fix bug with Function Get Channel Cipher Suites command when more
- than 1 page used.
- - Fix missing firmware firewall top-level command
- - Fix bug in SOL keepalive functionality
- - Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
- - Added ipmi_sel_get_oem_sensor* APIs
- - Added HPM.1 support
- - Fix segfault when incorrect oem option supplied
- - Fix bus problem with spd command
- - Fix segfault in SOL when remote BMC does not return packet
- - Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
- - Added lan packet size reduction mechanism
- - Fix bug with sendMessage of bad length with different target
- - Fix for big endian (PPC) architecture
- - NetBSD fixes
- - Fix segfault and channel problem with user priv command
- - Add support for bus/chan on i2c raw command
- - Add freeipmi interface support
- - Add remote spd printing
- - Add better detection of linux/compiler.h to config
- - Makefile changes to fix makedistcheck, etc.
-
-* Tue May 02 2006 <duncan@iceblink.org> 1.8.8-1
- - Fix segfaults in sensor data repository list
- - Fix ipmievd to open interface before daemonizing
- - Fix IPMIv1.5 authtype NONE to ignore supplied password
- - Fix cipher suite display bug in lan print
- - Fix typo in IPMIv2 SOL output when sending break
- - Fix improper LUN handling with Tyan SOL
- - Add LUN support to OpenIPMI interface
- - Add support for Kontron OEM commands
- - Update to Kontron Firmware Update command
-
-* Sun Mar 19 2006 <duncan@iceblink.org> 1.8.7-1
- - Add Sun OEM command for blades
- - Increase argument size for raw commands in shell/exec
- - Fix handling of LUNs for LAN interfaces
- - Add IPMIv2 SOL loopback test
- - Add support for IBM OEM SEL messages
- - Disable file paranoia checks on read files by default
- - Support IPMIv2 SOL on older Intel boxes
- - Display message and exit if keepalive fails during SOL
- - Add support for setting VLAN id and priority
- - Add support for FreeBSD OpenIPMI-compatible driver
- - Add support for IPMIv2 Firmware Firewall
- - Fix gcc4 compile warnings
- - Make ipmievd generate pidfile
- - Add initscripts for ipmievd
-
-* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
- - Fix memory corruption when sending encrypted SOL traffic
- - Add keepalive timer to IPMIv2 SOL sessions
-
-* Sat Jan 14 2006 <duncan@iceblink.org> 1.8.5-1
- - Raise privilege level after creating IPMIv2 session
- - Add support for settable SOL escape character with -e option
- - Add support for Kg BMC key for IPMIv2 authentication with -k option
- - Add support for Tyan IPMIv1.5 SOL with tsol command
- - Add support for PICMG devices
- - Add support for OEM SEL event parsing
- - Add support for command bridging over lan and lanplus interfaces
- - New 'chassis selftest' command
- - Many bufxies and patches from contributors
-
-* Wed May 18 2005 <duncan@iceblink.org> 1.8.2-1
- - Fix FRU reading for large (>255 bytes) areas.
- - Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
- - Fix LAN parameter segfault when no Ciphers supported by BMC.
- - Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
- - Separate option parsing code from main ipmitool source file.
- - Add raw I2C support with IPMI Master Read-Write command.
- - Add support for new 'sdr elist' extended output format.
- - Add support for listing sensors by type with 'sdr type' command.
- - Add support for new 'sel elist' extended output format that
- cross-references events with sensors.
- - Add support for sending dynamically generated platform events
- based on existing sensor information.
- - New '-S' argument to read local SDR cache created with 'sdr dump'.
- - Updated manpage for ipmitool and ipmievd.
-
-* Wed Apr 06 2005 <duncan@iceblink.org> 1.8.1-1
- - Install ipmievd into /usr/sbin
-
-* Wed Mar 16 2005 <duncan@iceblink.org> 1.8.0-1
- - Fix IPMIv2.0 issues
- - Fix chassis boot parameter support
- - Add support for linear sensors
- - Update bmc plugin to work with new Solaris bmc driver (new ioctl
- for interface detection and new STREAMS message-based interface)
-
-* Tue Jan 18 2005 <duncan@iceblink.org> 1.7.0-1
- - Propogate errors correctly so exit status will be useful
- - More consistent display of errors including completion code text
- - Errors and debug is send to stderr now
- - New "sel get" command that will print details about SEL entry
- and corresponding SDR records as well as FRUs via entity association
- - Improved event generator, now supports reading events from text file
- - New "-o oemtype" option for specifying OEM boards
- exsting types are "supermicro" and "intelwv2"
- - New PEF subsystem from Tim Murphy at Dell
- - New "bmc" plugin for Solaris 10 x86
- - Many bugfixes and contributed patches
- - Support for Supermicro BMC OEM authentication method
- - Fix minor problem with LAN parameter setting
-
-* Wed Aug 18 2004 <duncan@iceblink.org> 1.6.0-1
- - Add a README
- - Add support for IPMIv2 and Serial-over-LAN from Newisys
- - Add Solaris x86 lipmi interface
- - Add support for building Solaris packages
- - Add support for building RPMs as non-root user
- - Fix segfault when doing "sel list" (from Matthew Braithwaite)
- - Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
- - Add "bmc info" and related output (from ebrower@sourceforge)
- - new "shell" and "exec" commands
- - lots of other contributed patches
-
-* Sat May 27 2004 <duncan@iceblink.org> 1.5.9-1
- - Add ability to get a particular sensor by name
- - Add ability to set a particular sensor threshold
- - Add support for displaying V2 channel authentication levels
- - Add README for rrdtool scripts in contrib directory
- - Improve lan interface retry handling
- - Support prompting for password or reading from environment
- - Move chaninfo command into channel subcommand
- - Fix reservation ID handling when two sessions open to BMC
- - Fix reading of large FRU data
- - Add configure option for changing binary to ipmiadm for Solaris
- - Fix compile problem on Solaris 8
-
-* Tue Jan 27 2004 <duncan@iceblink.org> 1.5.8-1
- - Enable static compilation of interfaces
- - Fix types to be 64-bit safe
- - Fix compilation problems on Solaris
- - Fix multiple big-endian problems for Solaris/SPARC
- - Fix channel access to save settings to NVRAM
- - Set channel privilege limit to ADMIN during "access on"
- - Enable gratuitous ARP in bmcautoconf.sh
- - Add support for Linux kernel panic messages in SEL output
- - Add support for type 3 SDR records
-
-* Mon Jan 5 2004 <duncan@iceblink.org> 1.5.7-1
- - add IPMIv1.5 eratta fixes
- - additions to FRU printing and FRU multirecords
- - better handling of SDR printing
- - contrib scripts for creating rrdtool graphs
-
-* Thu Dec 4 2003 <duncan@iceblink.org> 1.5.6-1
- - Fix SEL event decoding for generic events
- - Handle empty SEL gracefully when doing "sel list"
- - Fix sdr handling of sensors that do not return a reading
- - Fix for CSV display of sensor readings/units from Fredrik Öhrn
-
-* Tue Nov 25 2003 <duncan@iceblink.org> 1.5.5-1
- - Add -U option for setting LAN username
- - Fix -v usage for plugin interfaces
-
-* Fri Nov 14 2003 <duncan@iceblink.org> 1.5.4-1
- - pull interface plugin api into library
- - fix ipmievd
-
-* Fri Oct 31 2003 <duncan@iceblink.org> 1.5.3-1
- - add -g optin for pedantic ipmi-over-lan communication
-
-* Fri Oct 24 2003 <duncan@iceblink.org> 1.5.2-1
- - add gratuitous arp interval setting
-
-* Wed Oct 8 2003 <duncan@iceblink.org> 1.5.1-1
- - better SEL support
- - fix display bug in SDR list
-
-* Fri Sep 5 2003 <duncan@iceblink.org> 1.5.0-1
- - use automake/autoconf/libtool
- - dynamic loading interface plugins
-
-* Wed May 28 2003 <duncan@iceblink.org> 1.4.0-1
- - make UDP packet handling more robust
- - fix imb driver support
-
-* Thu May 22 2003 <duncan@iceblink.org> 1.3-1
- - update manpage
- - rework of low-level network handling
- - add basic imb driver support
-
-* Wed Apr 2 2003 <duncan@iceblink.org> 1.2-1
- - change command line option parsing
- - support for more chassis commands
-
-* Tue Apr 1 2003 <duncan@iceblink.org> 1.1-1
- - minor fixes.
-
-* Sun Mar 30 2003 <duncan@iceblink.org> 1.0-1
- - Initial release.
-
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 359cb30..49f5a8a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -41,7 +41,7 @@ libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \
ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \
ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c hpm2.c ipmi_vita.c \
- ../src/plugins/lan/md5.c ../src/plugins/lan/md5.h
+ ipmi_lanp6.c ipmi_cfgp.c ipmi_quantaoem.c ipmi_time.c
libipmitool_la_LDFLAGS = -export-dynamic
libipmitool_la_LIBADD = -lm
diff --git a/lib/Makefile.in b/lib/Makefile.in
deleted file mode 100644
index ccb468f..0000000
--- a/lib/Makefile.in
+++ /dev/null
@@ -1,713 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = lib
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-am__dirstamp = $(am__leading_dot)dirstamp
-am_libipmitool_la_OBJECTS = helper.lo ipmi_sdr.lo ipmi_sel.lo \
- ipmi_sol.lo ipmi_pef.lo ipmi_lanp.lo ipmi_fru.lo \
- ipmi_chassis.lo ipmi_mc.lo log.lo dimm_spd.lo ipmi_sensor.lo \
- ipmi_channel.lo ipmi_event.lo ipmi_session.lo ipmi_strings.lo \
- ipmi_user.lo ipmi_raw.lo ipmi_oem.lo ipmi_isol.lo \
- ipmi_sunoem.lo ipmi_fwum.lo ipmi_picmg.lo ipmi_main.lo \
- ipmi_tsol.lo ipmi_firewall.lo ipmi_kontronoem.lo \
- ipmi_hpmfwupg.lo ipmi_sdradd.lo ipmi_ekanalyzer.lo \
- ipmi_gendev.lo ipmi_ime.lo ipmi_delloem.lo ipmi_dcmi.lo \
- hpm2.lo ipmi_vita.lo ../src/plugins/lan/md5.lo
-libipmitool_la_OBJECTS = $(am_libipmitool_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libipmitool_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(libipmitool_la_LDFLAGS) $(LDFLAGS) -o \
- $@
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libipmitool_la_SOURCES)
-DIST_SOURCES = $(libipmitool_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = subdir-objects
-AM_CPPFLAGS = -I$(top_srcdir)/include
-MAINTAINERCLEANFILES = Makefile.in
-noinst_LTLIBRARIES = libipmitool.la
-libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
- ipmi_lanp.c ipmi_fru.c ipmi_chassis.c ipmi_mc.c log.c \
- dimm_spd.c ipmi_sensor.c ipmi_channel.c ipmi_event.c \
- ipmi_session.c ipmi_strings.c ipmi_user.c ipmi_raw.c \
- ipmi_oem.c ipmi_isol.c ipmi_sunoem.c ipmi_fwum.c ipmi_picmg.c \
- ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \
- ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \
- ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c hpm2.c ipmi_vita.c \
- ../src/plugins/lan/md5.c ../src/plugins/lan/md5.h
-
-libipmitool_la_LDFLAGS = -export-dynamic
-libipmitool_la_LIBADD = -lm
-libipmitool_la_DEPENDENCIES =
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign lib/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-../src/plugins/lan/$(am__dirstamp):
- @$(MKDIR_P) ../src/plugins/lan
- @: > ../src/plugins/lan/$(am__dirstamp)
-../src/plugins/lan/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) ../src/plugins/lan/$(DEPDIR)
- @: > ../src/plugins/lan/$(DEPDIR)/$(am__dirstamp)
-../src/plugins/lan/md5.lo: ../src/plugins/lan/$(am__dirstamp) \
- ../src/plugins/lan/$(DEPDIR)/$(am__dirstamp)
-
-libipmitool.la: $(libipmitool_la_OBJECTS) $(libipmitool_la_DEPENDENCIES) $(EXTRA_libipmitool_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libipmitool_la_LINK) $(libipmitool_la_OBJECTS) $(libipmitool_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
- -rm -f ../src/plugins/lan/*.$(OBJEXT)
- -rm -f ../src/plugins/lan/*.lo
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@../src/plugins/lan/$(DEPDIR)/md5.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dimm_spd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hpm2.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_channel.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_chassis.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_dcmi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_delloem.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_ekanalyzer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_event.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_firewall.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_fru.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_fwum.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_gendev.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_hpmfwupg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_ime.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_isol.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_kontronoem.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_lanp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_main.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_mc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_oem.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_pef.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_picmg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_raw.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_sdr.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_sdradd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_sel.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_sensor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_session.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_sol.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_strings.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_sunoem.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_tsol.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_user.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_vita.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
- -rm -rf ../src/plugins/lan/.libs ../src/plugins/lan/_libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -rm -f ../src/plugins/lan/$(DEPDIR)/$(am__dirstamp)
- -rm -f ../src/plugins/lan/$(am__dirstamp)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ../src/plugins/lan/$(DEPDIR) ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ../src/plugins/lan/$(DEPDIR) ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/lib/dimm_spd.c b/lib/dimm_spd.c
index 8b6927c..d496184 100644
--- a/lib/dimm_spd.c
+++ b/lib/dimm_spd.c
@@ -1340,11 +1340,10 @@ ipmi_spd_print(uint8_t *spd_data, int len)
printf(" Memory Type : %s\n",
val2str(spd_data[2], spd_memtype_vals));
-
+
if (spd_data[2] == 0x0B) /* DDR3 SDRAM */
{
int iPN;
- char *pchPN = spd_data+128;
int sdram_cap = 0;
int pri_bus_width = 0;
int sdram_width = 0;
@@ -1353,7 +1352,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
if (len < 148)
return -1; /* we need first 91 bytes to do our thing */
-
+
sdram_cap = ldexp(256,(spd_data[4]&15));
pri_bus_width = ldexp(8,(spd_data[8]&7));
@@ -1366,7 +1365,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
printf(" SDRAM Device Width : %d bits\n", sdram_width );
printf(" Number of Ranks : %d\n", ranks );
printf(" Memory size : %d MB\n", mem_size );
-
+
/* printf(" Memory Density : %s\n", val2str(spd_data[4]&15, ddr3_density_vals)); */
printf(" 1.5 V Nominal Op : %s\n", (((spd_data[6]&1) != 0) ? "No":"Yes" ) );
printf(" 1.35 V Nominal Op : %s\n", (((spd_data[6]&2) != 0) ? "No":"Yes" ) );
@@ -1417,16 +1416,15 @@ ipmi_spd_print(uint8_t *spd_data, int len)
}
- printf(" Manufacture Date : year %c%c week %c%c\n",
+ printf(" Manufacture Date : year %c%c week %c%c\n",
'0'+(spd_data[120]>>4), '0'+(spd_data[120]&15), '0'+(spd_data[121]>>4), '0'+(spd_data[121]&15) );
-
+
printf(" Serial Number : %02x%02x%02x%02x\n",
spd_data[122], spd_data[123], spd_data[124], spd_data[125]);
-
+
printf(" Part Number : ");
- for (iPN=0; iPN < 19; iPN++)
- {
- printf( "%c", *pchPN++ );
+ for (iPN = 128; iPN < 146; iPN++) {
+ printf("%c", spd_data[iPN]);
}
printf("\n");
} else if (spd_data[2] == 0x0C) /* DDR4 SDRAM */
@@ -1552,7 +1550,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
val2str(spd_data[8], spd_voltage_vals));
printf(" Error Detect/Cor : %s\n",
val2str(spd_data[11], spd_config_vals));
-
+
/* handle jedec table bank continuation values */
printf(" Manufacturer : ");
if (spd_data[64] != 0x7f)
@@ -1603,7 +1601,7 @@ ipmi_spd_print(uint8_t *spd_data, int len)
part[18] = 0;
printf(" Part Number : %s\n", part);
}
-
+
printf(" Serial Number : %02x%02x%02x%02x\n",
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
}
@@ -1622,8 +1620,10 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct fru_info fru;
- uint8_t *spd_data, msg_data[4];
- int len, offset;
+ uint8_t *spd_data = NULL;
+ uint8_t msg_data[4];
+ uint32_t len, offset;
+ int rc = -1;
msg_data[0] = id;
@@ -1634,14 +1634,14 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
- return -1;
+ goto end;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
- return -1;
+ goto end;
}
fru.size = (rsp->data[1] << 8) | rsp->data[0];
@@ -1653,15 +1653,15 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
if (fru.size < 1) {
lprintf(LOG_ERR, " Invalid FRU size %d", fru.size);
- return -1;
+ goto end;
}
spd_data = malloc(fru.size);
- if (spd_data == NULL) {
+ if (!spd_data) {
printf(" Unable to malloc memory for spd array of size=%d\n",
fru.size);
- return -1;
+ goto end;
}
memset(&req, 0, sizeof(req));
@@ -1679,34 +1679,39 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
msg_data[3] = FRU_DATA_RQST_SIZE;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
- free(spd_data);
- spd_data = NULL;
- return -1;
+ goto end;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
- free(spd_data);
- spd_data = NULL;
/* Timeouts are acceptable. No DIMM in the socket */
if (rsp->ccode == 0xc3)
- return 1;
+ rc = 1;
- return -1;
+ goto end;
}
len = rsp->data[0];
+ if(rsp->data_len < 1
+ || len > rsp->data_len - 1
+ || len > fru.size - offset)
+ {
+ printf(" Not enough buffer size");
+ goto end;
+ }
memcpy(&spd_data[offset], rsp->data + 1, len);
offset += len;
} while (offset < fru.size);
/* now print spd info */
ipmi_spd_print(spd_data, offset);
- free(spd_data);
- spd_data = NULL;
+ rc = 0;
- return 0;
+end:
+ free_n(&spd_data);
+
+ return rc;
}
diff --git a/lib/helper.c b/lib/helper.c
index 022a9c9..b547123 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -29,12 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _POSIX_SOURCE
-#define /* glibc 2.19 and earlier */ _BSD_SOURCE || \
- /* Since glibc 2.20 */_DEFAULT_SOURCE || \
- _XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
- /* Since glibc 2.10: */ _POSIX_C_SOURCE >= 200112L \
#include <sys/types.h>
#include <sys/stat.h>
@@ -51,6 +45,7 @@
#include <fcntl.h>
#include <errno.h>
#include <assert.h>
+#include <ctype.h>
#if HAVE_CONFIG_H
# include <config.h>
@@ -59,7 +54,7 @@
#ifdef HAVE_PATHS_H
# include <paths.h>
#else
-# define _PATH_VARRUN "/var/run/"
+# define _PATH_RUN "/run/"
#endif
#include <ipmitool/ipmi.h>
@@ -79,22 +74,139 @@ uint16_t buf2short(uint8_t * buf)
return (uint16_t)(buf[1] << 8 | buf[0]);
}
-const char * buf2str(uint8_t * buf, int len)
+/* buf2str_extended - convert sequence of bytes to hexadecimal string with
+ * optional separator
+ *
+ * @param buf - data to convert
+ * @param len - size of data
+ * @param sep - optional separator (can be NULL)
+ *
+ * @returns buf representation in hex, possibly truncated to fit
+ * allocated static memory
+ */
+const char *
+buf2str_extended(const uint8_t *buf, int len, const char *sep)
{
- static char str[2049];
+ static char str[BUF2STR_MAXIMUM_OUTPUT_SIZE];
+ char *cur;
int i;
+ int sz;
+ int left;
+ int sep_len;
- if (len <= 0 || len > 1024)
- return NULL;
+ if (!buf) {
+ snprintf(str, sizeof(str), "<NULL>");
+ return (const char *)str;
+ }
+ cur = str;
+ left = sizeof(str);
+ if (sep) {
+ sep_len = strlen(sep);
+ } else {
+ sep_len = 0;
+ }
+ for (i = 0; i < len; i++) {
+ /* may return more than 2, depending on locale */
+ sz = snprintf(cur, left, "%2.2x", buf[i]);
+ if (sz >= left) {
+ /* buffer overflow, truncate */
+ break;
+ }
+ cur += sz;
+ left -= sz;
+ /* do not write separator after last byte */
+ if (sep && i != (len - 1)) {
+ if (sep_len >= left) {
+ break;
+ }
+ strncpy(cur, sep, left - sz);
+ cur += sep_len;
+ left -= sep_len;
+ }
+ }
+ *cur = '\0';
+
+ return (const char *)str;
+}
- memset(str, 0, 2049);
+const char *
+buf2str(const uint8_t *buf, int len)
+{
+ return buf2str_extended(buf, len, NULL);
+}
- for (i=0; i<len; i++)
- sprintf(str+i+i, "%2.2x", buf[i]);
+/* ipmi_parse_hex - convert hexadecimal numbers to ascii string
+ * Input string must be composed of two-characer
+ * hexadecimal numbers.
+ * There is no separator between the numbers. Each number
+ * results in one byte of the converted string.
+ *
+ * Example: ipmi_parse_hex("50415353574F5244")
+ * returns 'PASSWORD'
+ *
+ * @param str: input string. It must contain only even number
+ * of '0'-'9','a'-'f' and 'A-F' characters.
+ * @param out: pointer to output data
+ * @param size: size of the output buffer
+ * @returns 0 for empty input string
+ * -1 for string with odd length
+ * -2 if out is NULL
+ * -3 if there is non-hexadecimal char in string
+ * >0 length of resulting binary data even if it is > size
+ */
+int
+ipmi_parse_hex(const char *str, uint8_t *out, int size)
+{
+ const char *p;
+ uint8_t *q;
+ uint8_t d = 0;
+ uint8_t b = 0;
+ int shift = 4;
+ int len;
+
+ len = strlen(str);
+ if (len == 0) {
+ return 0;
+ }
- str[len*2] = '\0';
+ if (len % 2 != 0) {
+ return -1;
+ }
- return (const char *)str;
+ len /= 2; /* out bytes */
+ if (!out) {
+ return -2;
+ }
+
+ for (p = str, q = out; *p; p++) {
+ if (!isxdigit(*p)) {
+ return -3;
+ }
+
+ if (*p < 'A') {
+ /* it must be 0-9 */
+ d = *p - '0';
+ } else {
+ /* it's A-F or a-f */
+ /* convert to lowercase and to 10-15 */
+ d = (*p | 0x20) - 'a' + 10;
+ }
+
+ if (q < (out + size)) {
+ /* there is space, store */
+ b += d << shift;
+ if (shift) {
+ shift = 0;
+ } else {
+ shift = 4;
+ *q = b;
+ b = 0;
+ q++;
+ }
+ }
+ }
+
+ return len;
}
void printbuf(const uint8_t * buf, int len, const char * desc)
@@ -116,29 +228,168 @@ void printbuf(const uint8_t * buf, int len, const char * desc)
fprintf(stderr, "\n");
}
-const char * val2str(uint16_t val, const struct valstr *vs)
+/*
+ * Unconditionally reverse the order of arbitrarily long strings of bytes
+ */
+uint8_t *array_byteswap(uint8_t *buffer, size_t length)
{
- static char un_str[32];
- int i;
+ size_t i;
+ uint8_t temp;
+ size_t max = length - 1;
+
+ for (i = 0; i < length / 2; ++i) {
+ temp = buffer[i];
+ buffer[i] = buffer[max - i];
+ buffer[max - i] = temp;
+ }
- for (i = 0; vs[i].str != NULL; i++) {
- if (vs[i].val == val)
- return vs[i].str;
+ return buffer;
+}
+
+/* Convert data array from network (big-endian) to host byte order */
+uint8_t *array_ntoh(uint8_t *buffer, size_t length)
+{
+#if WORDS_BIGENDIAN
+ /* Big-endian host doesn't need conversion from big-endian network */
+ (void)length; /* Silence the compiler */
+ return buffer;
+#else
+ /* Little-endian host needs conversion from big-endian network */
+ return array_byteswap(buffer, length);
+#endif
+}
+
+/* Convert data array from little-endian to host byte order */
+uint8_t *array_letoh(uint8_t *buffer, size_t length)
+{
+#if WORDS_BIGENDIAN
+ /* Big-endian host needs conversion from little-endian IPMI */
+ return array_byteswap(buffer, length);
+#else
+ /* Little-endian host doesn't need conversion from little-endian IPMI */
+ (void)length; /* Silence the compiler */
+ return buffer;
+#endif
+}
+
+/* str2mac - parse-out MAC address from given string and store it
+ * into buffer.
+ *
+ * @arg: string to be parsed.
+ * @buf: buffer of 6 to hold parsed MAC address.
+ *
+ * returns zero on success, (-1) on error and error message is printed-out.
+ */
+int
+str2mac(const char *arg, uint8_t *buf)
+{
+ unsigned int m1 = 0;
+ unsigned int m2 = 0;
+ unsigned int m3 = 0;
+ unsigned int m4 = 0;
+ unsigned int m5 = 0;
+ unsigned int m6 = 0;
+ if (sscanf(arg, "%02x:%02x:%02x:%02x:%02x:%02x",
+ &m1, &m2, &m3, &m4, &m5, &m6) != 6) {
+ lprintf(LOG_ERR, "Invalid MAC address: %s", arg);
+ return -1;
+ }
+ if (m1 > UINT8_MAX || m2 > UINT8_MAX
+ || m3 > UINT8_MAX || m4 > UINT8_MAX
+ || m5 > UINT8_MAX || m6 > UINT8_MAX) {
+ lprintf(LOG_ERR, "Invalid MAC address: %s", arg);
+ return -1;
+ }
+ buf[0] = (uint8_t)m1;
+ buf[1] = (uint8_t)m2;
+ buf[2] = (uint8_t)m3;
+ buf[3] = (uint8_t)m4;
+ buf[4] = (uint8_t)m5;
+ buf[5] = (uint8_t)m6;
+ return 0;
+}
+
+/* mac2str -- return MAC address as a string
+ *
+ * @buf: buffer of 6 to hold parsed MAC address.
+ */
+const char *
+mac2str(const uint8_t *buf)
+{
+ return buf2str_extended(buf, 6, ":");
+}
+
+/**
+ * Find the index of value in a valstr array
+ *
+ * @param[in] val The value to search for
+ * @param[in] vs The valstr array to search in
+ * @return >=0 The index into \p vs
+ * @return -1 Error: value \p val was not found in \p vs
+ */
+static
+inline
+off_t find_val_idx(uint32_t val, const struct valstr *vs)
+{
+ if (vs) {
+ for (off_t i = 0; vs[i].str; ++i) {
+ if (vs[i].val == val) {
+ return i;
+ }
+ }
}
+ return -1;
+}
+
+/**
+ * Generate a statically allocated 'Unknown' string for the provided value.
+ * The function is not thread-safe (as most of ipmitool).
+ *
+ * @param[in] val The value to put into the string
+ * @returns A pointer to a statically allocated string
+ */
+static
+inline
+const char *unknown_val_str(uint32_t val)
+{
+ static char un_str[32];
memset(un_str, 0, 32);
snprintf(un_str, 32, "Unknown (0x%02X)", val);
return un_str;
}
-const char * oemval2str(uint32_t oem, uint16_t val,
- const struct oemvalstr *vs)
+const char *
+specific_val2str(uint32_t val,
+ const struct valstr *specific,
+ const struct valstr *generic)
{
- static char un_str[32];
int i;
- for (i = 0; vs[i].oem != 0xffffff && vs[i].str != NULL; i++) {
+ if (0 <= (i = find_val_idx(val, specific))) {
+ return specific[i].str;
+ }
+
+ if (0 <= (i = find_val_idx(val, generic))) {
+ return generic[i].str;
+ }
+
+ return unknown_val_str(val);
+}
+
+const char *val2str(uint32_t val, const struct valstr *vs)
+{
+ return specific_val2str(val, NULL, vs);
+}
+
+
+const char *oemval2str(uint32_t oem, uint32_t val,
+ const struct oemvalstr *vs)
+{
+ int i;
+
+ for (i = 0; vs[i].oem != 0xffffff && vs[i].str; i++) {
/* FIXME: for now on we assume PICMG capability on all IANAs */
if ( (vs[i].oem == oem || vs[i].oem == IPMI_OEM_PICMG) &&
vs[i].val == val ) {
@@ -146,10 +397,7 @@ const char * oemval2str(uint32_t oem, uint16_t val,
}
}
- memset(un_str, 0, 32);
- snprintf(un_str, 32, "Unknown (0x%X)", val);
-
- return un_str;
+ return unknown_val_str(val);
}
/* str2double - safely convert string to double
@@ -394,12 +642,12 @@ int str2uchar(const char * str, uint8_t * uchr_ptr)
return 0;
} /* str2uchar(...) */
-uint16_t str2val(const char *str, const struct valstr *vs)
+uint32_t str2val32(const char *str, const struct valstr *vs)
{
int i;
- for (i = 0; vs[i].str != NULL; i++) {
- if (strncasecmp(vs[i].str, str, __maxlen(str, vs[i].str)) == 0)
+ for (i = 0; vs[i].str; i++) {
+ if (strcasecmp(vs[i].str, str) == 0)
return vs[i].val;
}
@@ -417,10 +665,10 @@ print_valstr(const struct valstr * vs, const char * title, int loglevel)
{
int i;
- if (vs == NULL)
+ if (!vs)
return;
- if (title != NULL) {
+ if (title) {
if (loglevel < 0)
printf("\n%s:\n\n", title);
else
@@ -435,7 +683,7 @@ print_valstr(const struct valstr * vs, const char * title, int loglevel)
lprintf(loglevel, "==============================================");
}
- for (i = 0; vs[i].str != NULL; i++) {
+ for (i = 0; vs[i].str; i++) {
if (loglevel < 0) {
if (vs[i].val < 256)
printf(" %d\t0x%02x\t%s\n", vs[i].val, vs[i].val, vs[i].str);
@@ -466,18 +714,18 @@ print_valstr_2col(const struct valstr * vs, const char * title, int loglevel)
{
int i;
- if (vs == NULL)
+ if (!vs)
return;
- if (title != NULL) {
+ if (title) {
if (loglevel < 0)
printf("\n%s:\n\n", title);
else
lprintf(loglevel, "\n%s:\n", title);
}
- for (i = 0; vs[i].str != NULL; i++) {
- if (vs[i+1].str == NULL) {
+ for (i = 0; vs[i].str; i++) {
+ if (!vs[i+1].str) {
/* last one */
if (loglevel < 0) {
printf(" %4d %-32s\n", vs[i].val, vs[i].str);
@@ -531,12 +779,12 @@ ipmi_open_file(const char * file, int rw)
struct stat st1, st2;
FILE * fp;
- /* verify existance */
+ /* verify existence */
if (lstat(file, &st1) < 0) {
if (rw) {
/* does not exist, ok to create */
fp = fopen(file, "w");
- if (fp == NULL) {
+ if (!fp) {
lperror(LOG_ERR, "Unable to open file %s "
"for write", file);
return NULL;
@@ -553,7 +801,7 @@ ipmi_open_file(const char * file, int rw)
if (!rw) {
/* on read skip the extra checks */
fp = fopen(file, "r");
- if (fp == NULL) {
+ if (!fp) {
lperror(LOG_ERR, "Unable to open file %s", file);
return NULL;
}
@@ -576,7 +824,7 @@ ipmi_open_file(const char * file, int rw)
}
fp = fopen(file, rw ? "w+" : "r");
- if (fp == NULL) {
+ if (!fp) {
lperror(LOG_ERR, "Unable to open file %s", file);
return NULL;
}
@@ -620,6 +868,7 @@ ipmi_start_daemon(struct ipmi_intf *intf)
{
pid_t pid;
int fd;
+ int ret;
#ifdef SIGHUP
sigset_t sighup;
#endif
@@ -663,7 +912,11 @@ ipmi_start_daemon(struct ipmi_intf *intf)
exit(0);
#endif
- chdir("/");
+ ret = chdir("/");
+ if (ret) {
+ lprintf(LOG_ERR, "chdir failed: %s (%d)", strerror(errno), errno);
+ exit(1);
+ }
umask(0);
for (fd=0; fd<64; fd++) {
@@ -672,9 +925,20 @@ ipmi_start_daemon(struct ipmi_intf *intf)
}
fd = open("/dev/null", O_RDWR);
- assert(0 == fd);
- dup(fd);
- dup(fd);
+ if (fd != STDIN_FILENO) {
+ lprintf(LOG_ERR, "failed to reset stdin: %s (%d)", strerror(errno), errno);
+ exit(1);
+ }
+ ret = dup(fd);
+ if (ret != STDOUT_FILENO) {
+ lprintf(LOG_ERR, "failed to reset stdout: %s (%d)", strerror(errno), errno);
+ exit(1);
+ }
+ ret = dup(fd);
+ if (ret != STDERR_FILENO) {
+ lprintf(LOG_ERR, "failed to reset stderr: %s (%d)", strerror(errno), errno);
+ exit(1);
+ }
}
/* eval_ccode - evaluate return value of _ipmi_* functions and print error error
@@ -687,7 +951,7 @@ ipmi_start_daemon(struct ipmi_intf *intf)
int
eval_ccode(const int ccode)
{
- if (ccode == 0) {
+ if (!ccode) {
return 0;
} else if (ccode < 0) {
switch (ccode) {
@@ -847,11 +1111,11 @@ ipmi_get_oem_id(struct ipmi_intf *intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Board ID command failed");
return 0;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Board ID command failed: %#x %s",
rsp->ccode, val2str(rsp->ccode, completion_code_vals));
return 0;
@@ -861,3 +1125,35 @@ ipmi_get_oem_id(struct ipmi_intf *intf)
return oem_id;
}
+
+/** Parse command line arguments as numeric byte values (dec or hex)
+ * and store them in a \p len sized buffer \p out.
+ *
+ * @param[in] argc Number of arguments
+ * @param[in] argv Array of arguments
+ * @param[out] out The output buffer
+ * @param[in] len Length of the output buffer in bytes (no null-termination
+ * is assumed, the input data is treated as raw byte values,
+ * not as a string.
+ *
+ * @returns A success status indicator
+ * @return false Error
+ * @return true Success
+ */
+bool
+args2buf(int argc, char *argv[], uint8_t *out, size_t len)
+{
+ size_t i;
+
+ for (i = 0; i < len && i < (size_t)argc; ++i) {
+ uint8_t byte;
+
+ if (str2uchar(argv[i], &byte)) {
+ lprintf(LOG_ERR, "Bad byte value: %s", argv[i]);
+ return false;
+ }
+
+ out[i] = byte;
+ }
+ return true;
+}
diff --git a/lib/ipmi_cfgp.c b/lib/ipmi_cfgp.c
new file mode 100644
index 0000000..4131a65
--- /dev/null
+++ b/lib/ipmi_cfgp.c
@@ -0,0 +1,546 @@
+/*
+ * Copyright (c) 2016 Pentair Technical Products. All right reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Pentair Technical Products or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * PENTAIR TECHNICAL SOLUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#else
+# include <stdlib.h>
+#endif
+#include <string.h>
+
+#include <ipmitool/helper.h>
+#include <ipmitool/ipmi_cfgp.h>
+#include <ipmitool/log.h>
+
+/* ipmi_cfgp_init initialize configuration parameter context
+ * @param ctx context to initialize
+ * @param set array of parameter descriptors
+ * @param count amount of descriptors supplied
+ * @param handler function to do real job on parameters from the set
+ * @param priv private data for the handler
+ */
+int
+ipmi_cfgp_init(struct ipmi_cfgp_ctx *ctx, const struct ipmi_cfgp *set,
+ unsigned int count, const char *cmdname,
+ ipmi_cfgp_handler_t handler, void *priv)
+{
+ if (!ctx || !set || !handler || !cmdname) {
+ return -1;
+ }
+
+ memset(ctx, 0, sizeof(struct ipmi_cfgp_ctx));
+
+ ctx->set = set;
+ ctx->count = count;
+ ctx->cmdname = cmdname;
+ ctx->handler = handler;
+ ctx->priv = priv;
+
+ return 0;
+}
+
+/* ipmi_cfgp_uninit destroy data list attached to context
+ * @param ctx parameter context to clear
+ * @returns 0 -- list destroyed
+ * -1 -- ctx is NULL
+ */
+int
+ipmi_cfgp_uninit(struct ipmi_cfgp_ctx *ctx)
+{
+ struct ipmi_cfgp_data *d;
+
+ if (!ctx) {
+ return -1;
+ }
+
+ while (ctx->v) {
+ d = ctx->v;
+ ctx->v = d->next;
+ free(d);
+ d = NULL;
+ }
+
+ return 0;
+}
+
+/* lookup_cfgp -- find a parameter in a set*/
+static const struct ipmi_cfgp *
+lookup_cfgp(const struct ipmi_cfgp_ctx *ctx, const char *name)
+{
+ const struct ipmi_cfgp *p;
+ int i;
+
+ for (i = 0; i < ctx->count; i++) {
+ p = &ctx->set[i];
+
+ if (p->name && !strcasecmp(p->name, name)) {
+ return p;
+ }
+ }
+
+ return NULL;
+}
+
+/* ipmi_cfgp_parse_sel parse parameter selector
+ * (parameter ID, set selector, block selector) from cmdline.
+ *
+ * @param ctx configuration parameter context to use
+ * @param argc elements left in argv
+ * @param argv array of arguments
+ * @param sel where to store parsed selector
+ *
+ * @returns >=0 number of argv elements used
+ * <0 error
+ */
+int
+ipmi_cfgp_parse_sel(struct ipmi_cfgp_ctx *ctx,
+ int argc, const char **argv, struct ipmi_cfgp_sel *sel)
+{
+ const struct ipmi_cfgp *p;
+
+ if (!ctx || !argv || !sel) {
+ return -1;
+ }
+
+ sel->param = -1;
+ sel->set = -1;
+ sel->block = -1;
+
+ if (argc == 0) {
+ /* no parameter specified, good for print, save */
+ return 0;
+ }
+
+ p = lookup_cfgp(ctx, argv[0]);
+ if (!p) {
+ lprintf(LOG_ERR, "invalid parameter");
+ return -1;
+ }
+
+ sel->param = p - ctx->set;
+ sel->set = p->is_set ? -1 : 0;
+ sel->block = p->has_blocks ? -1 : 0;
+
+ if (argc == 1 || !p->is_set) {
+ /* No set and block selector applicable or specified */
+ return 1;
+ }
+
+ if (str2int(argv[1], &sel->set)
+ || sel->set < 0
+ || (sel->set == 0 && p->first_set)) {
+ lprintf(LOG_ERR, "invalid set selector");
+ return -1;
+ }
+
+ if (argc == 2 || !p->has_blocks) {
+ /* No block selector applicable or specified */
+ return 2;
+ }
+
+ if (str2int(argv[2], &sel->block)
+ || sel->block < 0
+ || (sel->block == 0 && p->first_block)) {
+ lprintf(LOG_ERR, "invalid block selector");
+ return -1;
+ }
+
+ return 3;
+}
+
+/* cfgp_add_data adds block of data to list in the configuration
+ * parameter context
+ *
+ * @param ctx context to add data to
+ * @param data parameter data
+ */
+static void
+cfgp_add_data(struct ipmi_cfgp_ctx *ctx, struct ipmi_cfgp_data *data)
+{
+ struct ipmi_cfgp_data **pprev = &ctx->v;
+
+ data->next = NULL;
+
+ while (*pprev) {
+ pprev = &(*pprev)->next;
+ }
+
+ *pprev = data;
+}
+
+/* cfgp_usage prints format for configuration parameter
+ *
+ * @param p configuration parameter descriptor
+ * @param write 0 if no value is expected, !=0 otherwise
+ */
+static void
+cfgp_usage(const struct ipmi_cfgp *p, int write)
+{
+ if (!p->name) {
+ return;
+ }
+
+ if (write && !p->format) {
+ return;
+ }
+
+ printf(" %s%s%s %s\n",
+ p->name, p->is_set ? " <set_sel>" : "",
+ p->has_blocks ? " <block_sel>" : "",
+ write ? p->format : "");
+}
+
+/* ipmi_cfgp_usage prints format for configuration parameter set
+ *
+ * @param set configuration parameter descriptor array
+ * @param count number of elements in set
+ * @param write 0 if no value is expected, !=0 otherwise
+ */
+void
+ipmi_cfgp_usage(const struct ipmi_cfgp *set, int count, int write)
+{
+ const struct ipmi_cfgp *p;
+ int i;
+
+ if (!set) {
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ p = &set[i];
+
+ if (write && p->access == CFGP_RDONLY) {
+ continue;
+ }
+
+ if (!write && p->access == CFGP_WRONLY) {
+ continue;
+ }
+
+ cfgp_usage(p, write);
+ }
+}
+
+/* ipmi_cfgp_parse_data parse parameter data from command line into context
+ * @param ctx context to add data
+ * @param sel parameter selector
+ * @param argc number of elements in argv
+ * @param argv array of unparsed arguments
+ *
+ * @returns 0 on success
+ * <0 on error
+ */
+int
+ipmi_cfgp_parse_data(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel, int argc, const char **argv)
+{
+ const struct ipmi_cfgp *p;
+ struct ipmi_cfgp_data *data;
+ struct ipmi_cfgp_action action;
+
+ if (!ctx || !sel || !argv) {
+ return -1;
+ }
+
+ if (sel->param == -1 || sel->param >= ctx->count) {
+ lprintf(LOG_ERR, "invalid parameter, must be one of:");
+ ipmi_cfgp_usage(ctx->set, ctx->count, 1);
+ return -1;
+ }
+
+ if (sel->set == -1) {
+ lprintf(LOG_ERR, "set selector is not specified");
+ return -1;
+ }
+
+ if (sel->block == -1) {
+ lprintf(LOG_ERR, "block selector is not specified");
+ return -1;
+ }
+
+ p = &ctx->set[sel->param];
+
+ if (p->size == 0) {
+ return -1;
+ }
+
+ data = malloc(sizeof(struct ipmi_cfgp_data) + p->size);
+ if (!data) {
+ return -1;
+ }
+
+ memset(data, 0, sizeof(struct ipmi_cfgp_data) + p->size);
+
+ action.type = CFGP_PARSE;
+ action.set = sel->set;
+ action.block = sel->block;
+ action.argc = argc;
+ action.argv = argv;
+ action.file = NULL;
+
+ if (ctx->handler(ctx->priv, p, &action, data->data) != 0) {
+ ipmi_cfgp_usage(p, 1, 1);
+ free(data);
+ data = NULL;
+ return -1;
+ }
+
+ data->sel = *sel;
+
+ cfgp_add_data(ctx, data);
+ return 0;
+}
+
+/* cfgp_get_param -- get parameter data from MC into data list within context
+ *
+ * @param ctx context
+ * @param p parameter descriptor
+ * @param set parameter set selector, can be -1 to scan all set selectors
+ * @param block parameter block selector, can be -1 to get all blocks
+ * @param quiet set to non-zero to continue on errors
+ * (required for -1 to work)
+ * @returns 0 on success, non-zero otherwise
+ */
+static int
+cfgp_get_param(struct ipmi_cfgp_ctx *ctx, const struct ipmi_cfgp *p,
+ int set, int block, int quiet)
+{
+ struct ipmi_cfgp_data *data;
+ struct ipmi_cfgp_action action;
+ int cset;
+ int cblock;
+ int ret;
+
+ if (p->size == 0) {
+ return -1;
+ }
+
+ action.type = CFGP_GET;
+ action.argc = 0;
+ action.argv = NULL;
+ action.file = NULL;
+
+ if (set == -1 && !p->is_set) {
+ set = 0;
+ }
+
+ if (block == -1 && !p->has_blocks) {
+ block = 0;
+ }
+
+ if (set == -1) {
+ cset = p->first_set;
+ } else {
+ cset = set;
+ }
+
+ action.quiet = quiet;
+
+ do {
+ if (block == -1) {
+ cblock = p->first_block;
+ } else {
+ cblock = block;
+ }
+
+ do {
+ data = malloc(sizeof(struct ipmi_cfgp_data) + p->size);
+ if (!data) {
+ return -1;
+ }
+
+ memset(data, 0, sizeof(struct ipmi_cfgp_data) + p->size);
+
+ action.set = cset;
+ action.block = cblock;
+
+ ret = ctx->handler(ctx->priv, p, &action, data->data);
+ if (ret != 0) {
+ free(data);
+ data = NULL;
+
+ if (!action.quiet) {
+ return ret;
+ }
+ break;
+ }
+
+ data->sel.param = p - ctx->set;
+ data->sel.set = cset;
+ data->sel.block = cblock;
+
+ cfgp_add_data(ctx, data);
+
+ cblock++;
+ action.quiet = 1;
+ } while (block == -1);
+
+ if (ret != 0 && cblock == p->first_block) {
+ break;
+ }
+
+ cset++;
+ } while (set == -1);
+
+ return 0;
+}
+
+/* ipmi_cfgp_get -- get parameters data from MC into data list within context
+ *
+ * @param ctx context
+ * @param sel parameter selector
+ * @returns 0 on success, non-zero otherwise
+ */
+int
+ipmi_cfgp_get(struct ipmi_cfgp_ctx *ctx, const struct ipmi_cfgp_sel *sel)
+{
+ int i;
+ int ret;
+
+ if (!ctx || !sel) {
+ return -1;
+ }
+
+ if (sel->param != -1) {
+ if (sel->param >= ctx->count) {
+ return -1;
+ }
+
+ ret = cfgp_get_param(ctx, &ctx->set[sel->param],
+ sel->set, sel->block, 0);
+ if (ret) {
+ return -1;
+ }
+ return 0;
+ }
+
+ for (i = 0; i < ctx->count; i++) {
+ if (ctx->set[i].access == CFGP_WRONLY) {
+ continue;
+ }
+
+ if (cfgp_get_param(ctx, &ctx->set[i], sel->set, sel->block, 1)) {
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int
+cfgp_do_action(struct ipmi_cfgp_ctx *ctx, int action_type,
+ const struct ipmi_cfgp_sel *sel, FILE *file, int filter)
+{
+ const struct ipmi_cfgp *p;
+ struct ipmi_cfgp_data *data;
+ struct ipmi_cfgp_action action;
+ int ret;
+
+ if (!ctx || !sel) {
+ return -1;
+ }
+
+ action.type = action_type;
+ action.argc = 0;
+ action.argv = NULL;
+ action.file = file;
+
+ for (data = ctx->v; data; data = data->next) {
+ if (sel->param != -1 && sel->param != data->sel.param) {
+ continue;
+ }
+ if (sel->set != -1 && sel->set != data->sel.set) {
+ continue;
+ }
+ if (sel->block != -1 && sel->block != data->sel.block) {
+ continue;
+ }
+ if (ctx->set[data->sel.param].access == filter) {
+ continue;
+ }
+
+ p = &ctx->set[data->sel.param];
+
+ action.set = data->sel.set;
+ action.block = data->sel.block;
+
+ if (action_type == CFGP_SAVE) {
+ fprintf(file, "%s %s ", ctx->cmdname, p->name);
+ if (p->is_set) {
+ fprintf(file, "%d ", data->sel.set);
+ }
+ if (p->has_blocks) {
+ fprintf(file, "%d ", data->sel.block);
+ }
+ }
+
+ ret = ctx->handler(ctx->priv, p, &action, data->data);
+
+ if (action_type == CFGP_SAVE) {
+ fputc('\n', file);
+ }
+
+ if (ret != 0) {
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+ipmi_cfgp_set(struct ipmi_cfgp_ctx *ctx, const struct ipmi_cfgp_sel *sel)
+{
+ return cfgp_do_action(ctx, CFGP_SET, sel, NULL, CFGP_RDONLY);
+}
+
+int
+ipmi_cfgp_save(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel, FILE *file)
+{
+ if (!file) {
+ return -1;
+ }
+
+ return cfgp_do_action(ctx, CFGP_SAVE, sel, file, CFGP_RDONLY);
+}
+
+int
+ipmi_cfgp_print(struct ipmi_cfgp_ctx *ctx,
+ const struct ipmi_cfgp_sel *sel, FILE *file)
+{
+ if (!file) {
+ return -1;
+ }
+
+ return cfgp_do_action(ctx, CFGP_PRINT, sel, file, CFGP_RESERVED);
+}
diff --git a/lib/ipmi_channel.c b/lib/ipmi_channel.c
index 5171644..bb7e60a 100644
--- a/lib/ipmi_channel.c
+++ b/lib/ipmi_channel.c
@@ -75,7 +75,7 @@ _ipmi_get_channel_access(struct ipmi_intf *intf,
struct ipmi_rq req = {0};
uint8_t data[2];
- if (channel_access == NULL) {
+ if (!channel_access) {
return (-3);
}
data[0] = channel_access->channel & 0x0F;
@@ -87,9 +87,9 @@ _ipmi_get_channel_access(struct ipmi_intf *intf,
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
return (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
return rsp->ccode;
} else if (rsp->data_len != 2) {
return (-2);
@@ -118,7 +118,7 @@ _ipmi_get_channel_info(struct ipmi_intf *intf,
struct ipmi_rq req = {0};
uint8_t data[1];
- if (channel_info == NULL) {
+ if (!channel_info) {
return (-3);
}
data[0] = channel_info->channel & 0x0F;
@@ -128,9 +128,9 @@ _ipmi_get_channel_info(struct ipmi_intf *intf,
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
return (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
return rsp->ccode;
} else if (rsp->data_len != 9) {
return (-2);
@@ -202,7 +202,7 @@ _ipmi_set_channel_access(struct ipmi_intf *intf,
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
return (-1);
}
return rsp->ccode;
@@ -225,7 +225,7 @@ iana_string(uint32_t iana)
* ipmi_1_5_authtypes
*
* Create a string describing the supported authentication types as
- * specificed by the parameter n
+ * specified by the parameter n
*/
static const char *
ipmi_1_5_authtypes(uint8_t n)
@@ -244,10 +244,28 @@ ipmi_1_5_authtypes(uint8_t n)
return supportedTypes;
}
-uint8_t
-ipmi_current_channel_medium(struct ipmi_intf *intf)
+void
+ipmi_current_channel_info(struct ipmi_intf *intf,
+ struct channel_info_t *chinfo)
{
- return ipmi_get_channel_medium(intf, 0xE);
+ int ccode = 0;
+
+ chinfo->channel = CH_CURRENT;
+ ccode = _ipmi_get_channel_info(intf, chinfo);
+ if (ccode) {
+ if (ccode != IPMI_CC_INV_DATA_FIELD_IN_REQ) {
+ if (ccode > 0) {
+ lprintf(LOG_ERR, "Get Channel Info command failed: %s",
+ val2str(ccode, completion_code_vals));
+ }
+ else {
+ eval_ccode(ccode);
+ }
+ }
+ chinfo->channel = CH_UNKNOWN;
+ chinfo->medium = IPMI_CHANNEL_MEDIUM_RESERVED;
+ }
+ return;
}
/**
@@ -276,7 +294,7 @@ ipmi_get_channel_auth_cap(struct ipmi_intf *intf, uint8_t channel, uint8_t priv)
rsp = intf->sendrecv(intf, &req);
- if ((rsp == NULL) || (rsp->ccode > 0)) {
+ if (!rsp || rsp->ccode) {
/*
* It's very possible that this failed because we asked for IPMI v2 data
* Ask again, without requesting IPMI v2 data
@@ -284,11 +302,11 @@ ipmi_get_channel_auth_cap(struct ipmi_intf *intf, uint8_t channel, uint8_t priv)
msg_data[0] &= 0x7F;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to Get Channel Authentication Capabilities");
return (-1);
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Channel Authentication Capabilities failed: %s",
val2str(rsp->ccode, completion_code_vals));
return (-1);
@@ -342,86 +360,152 @@ ipmi_get_channel_auth_cap(struct ipmi_intf *intf, uint8_t channel, uint8_t priv)
return 0;
}
-static int
-ipmi_get_channel_cipher_suites(struct ipmi_intf *intf, const char *payload_type,
- uint8_t channel)
+static inline size_t parse_cipher_suite(uint8_t *cipher_suite_data,
+ size_t data_len,
+ uint32_t *iana,
+ uint8_t *auth_alg,
+ uint8_t *integrity_alg,
+ uint8_t *crypt_alg,
+ enum cipher_suite_ids *cipher_suite_id)
+{
+ size_t size = 0;
+ const char *incomplete = "Incomplete data record in cipher suite data";
+
+ if (*cipher_suite_data == STANDARD_CIPHER_SUITE) {
+ struct std_cipher_suite_record_t *record =
+ (struct std_cipher_suite_record_t*)cipher_suite_data;
+
+ /* Verify that we have at least a full record left; id + 3 algs */
+ if (data_len < sizeof(*record)) {
+ lprintf(LOG_INFO, "%s", incomplete);
+ goto out;
+ }
+
+ /* IANA code remains default (0) */
+ *cipher_suite_id = record->cipher_suite_id;
+ *auth_alg = CIPHER_ALG_MASK & record->auth_alg;
+ *integrity_alg = CIPHER_ALG_MASK & record->integrity_alg;
+ *crypt_alg = CIPHER_ALG_MASK & record->crypt_alg;
+ size = sizeof(*record);
+ } else if (*cipher_suite_data == OEM_CIPHER_SUITE) {
+ /* OEM record type */
+ struct oem_cipher_suite_record_t *record =
+ (struct oem_cipher_suite_record_t*)cipher_suite_data;
+ /* Verify that we have at least a full record left
+ * id + iana + 3 algs
+ */
+ if (data_len < sizeof(*record)) {
+ lprintf(LOG_INFO, "%s", incomplete);
+ goto out;
+ }
+
+ /* Grab the IANA */
+ *iana = ipmi24toh(record->iana);
+ *cipher_suite_id = record->cipher_suite_id;
+ *auth_alg = CIPHER_ALG_MASK & record->auth_alg;
+ *integrity_alg = CIPHER_ALG_MASK & record->integrity_alg;
+ *crypt_alg = CIPHER_ALG_MASK & record->crypt_alg;
+ size = sizeof(*record);
+ } else {
+ lprintf(LOG_INFO, "Bad start of record byte in cipher suite data "
+ "(value %x)", *cipher_suite_data);
+ }
+
+out:
+ return size;
+}
+
+static size_t
+parse_channel_cipher_suite_data(uint8_t *cipher_suite_data, size_t data_len,
+ struct cipher_suite_info* suites,
+ size_t nr_suites)
+{
+ size_t count = 0;
+ size_t offset = 0;
+
+ /* Default everything to zeroes */
+ memset(suites, 0, sizeof(*suites) * nr_suites);
+
+ while (offset < data_len && count < nr_suites) {
+ size_t suite_size;
+
+ /* Set non-zero defaults */
+ suites[count].auth_alg = IPMI_AUTH_RAKP_NONE;
+ suites[count].integrity_alg = IPMI_INTEGRITY_NONE;
+ suites[count].crypt_alg = IPMI_CRYPT_NONE;
+
+ /* Update fields from cipher suite data */
+ suite_size = parse_cipher_suite(cipher_suite_data + offset,
+ data_len - offset,
+ &suites[count].iana,
+ &suites[count].auth_alg,
+ &suites[count].integrity_alg,
+ &suites[count].crypt_alg,
+ &suites[count].cipher_suite_id);
+
+ if (!suite_size) {
+ lprintf(LOG_INFO,
+ "Failed to parse cipher suite data at offset %d",
+ offset);
+ break;
+ }
+
+ offset += suite_size;
+ count++;
+ }
+ return count;
+}
+
+int
+ipmi_get_channel_cipher_suites(struct ipmi_intf *intf,
+ const char *payload_type,
+ uint8_t channel,
+ struct cipher_suite_info *suites,
+ size_t *count)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
uint8_t rqdata[3];
- uint32_t iana;
- uint8_t auth_alg, integrity_alg, crypt_alg;
- uint8_t cipher_suite_id;
uint8_t list_index = 0;
/* 0x40 sets * 16 bytes per set */
- uint8_t cipher_suite_data[1024];
- uint16_t offset = 0;
- /* how much was returned, total */
- uint16_t cipher_suite_data_length = 0;
+ uint8_t cipher_suite_data[MAX_CIPHER_SUITE_RECORD_OFFSET *
+ MAX_CIPHER_SUITE_DATA_LEN];
+ size_t offset = 0;
+ size_t nr_suites = 0;
+
+ if (!suites || !count || !*count)
+ return -1;
+ nr_suites = *count;
+ *count = 0;
memset(cipher_suite_data, 0, sizeof(cipher_suite_data));
-
+
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = IPMI_GET_CHANNEL_CIPHER_SUITES;
req.msg.data = rqdata;
- req.msg.data_len = 3;
+ req.msg.data_len = sizeof(rqdata);
rqdata[0] = channel;
- rqdata[1] = ((strncmp(payload_type, "ipmi", 4) == 0)? 0: 1);
- /* Always ask for cipher suite format */
- rqdata[2] = 0x80;
-
- rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
- return -1;
- }
- if (rsp->ccode > 0) {
- lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
- val2str(rsp->ccode, completion_code_vals));
- return -1;
- }
-
-
- /*
- * Grab the returned channel number once. We assume it's the same
- * in future calls.
- */
- if (rsp->data_len >= 1) {
- channel = rsp->data[0];
- }
-
- while ((rsp->data_len > 1) && (rsp->data_len == 17) && (list_index < 0x3F)) {
- /*
- * We got back cipher suite data -- store it.
- * printf("copying data to offset %d\n", offset);
- * printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
- */
- memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
- offset += rsp->data_len - 1;
-
- /*
- * Increment our list for the next call
- */
- ++list_index;
- rqdata[2] = (rqdata[2] & 0x80) + list_index;
+ rqdata[1] = strcmp(payload_type, "ipmi") ? 1 : 0;
+ do {
+ /* Always ask for cipher suite format */
+ rqdata[2] = LIST_ALGORITHMS_BY_CIPHER_SUITE | list_index;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode
+ || rsp->data_len < 1
+ || rsp->data_len > sizeof(uint8_t) + MAX_CIPHER_SUITE_DATA_LEN)
+ {
lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
}
- }
-
- /* Copy last chunk */
- if(rsp->data_len > 1) {
/*
* We got back cipher suite data -- store it.
* printf("copying data to offset %d\n", offset);
@@ -429,88 +513,49 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf *intf, const char *payload_type,
*/
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
offset += rsp->data_len - 1;
- }
- /* We can chomp on all our data now. */
- cipher_suite_data_length = offset;
- offset = 0;
+ /*
+ * Increment our list for the next call
+ */
+ ++list_index;
+ } while ((rsp->data_len == (sizeof(uint8_t) + MAX_CIPHER_SUITE_DATA_LEN))
+ && (list_index < MAX_CIPHER_SUITE_RECORD_OFFSET));
- if (! csv_output) {
- printf("ID IANA Auth Alg Integrity Alg Confidentiality Alg\n");
- }
- while (offset < cipher_suite_data_length) {
- if (cipher_suite_data[offset++] == 0xC0) {
- /* standard type */
- iana = 0;
+ *count = parse_channel_cipher_suite_data(cipher_suite_data, offset, suites,
+ nr_suites);
+ return 0;
+}
- /* Verify that we have at least a full record left; id + 3 algs */
- if ((cipher_suite_data_length - offset) < 4) {
- lprintf(LOG_ERR, "Incomplete data record in cipher suite data");
- return -1;
- }
- cipher_suite_id = cipher_suite_data[offset++];
- } else if (cipher_suite_data[offset++] == 0xC1) {
- /* OEM record type */
- /* Verify that we have at least a full record left
- * id + iana + 3 algs
- */
- if ((cipher_suite_data_length - offset) < 4) {
- lprintf(LOG_ERR, "Incomplete data record in cipher suite data");
- return -1;
- }
+static int
+ipmi_print_channel_cipher_suites(struct ipmi_intf *intf,
+ const char *payload_type,
+ uint8_t channel)
+{
+ int rc;
+ size_t i = 0;
+ struct cipher_suite_info suites[MAX_CIPHER_SUITE_COUNT];
+ size_t nr_suites = sizeof(*suites);
+ const char *header_str =
+"ID IANA Auth Alg Integrity Alg Confidentiality Alg";
- cipher_suite_id = cipher_suite_data[offset++];
+ rc = ipmi_get_channel_cipher_suites(intf, payload_type, channel,
+ suites, &nr_suites);
- /* Grab the IANA */
- iana =
- cipher_suite_data[offset] |
- (cipher_suite_data[offset + 1] << 8) |
- (cipher_suite_data[offset + 2] << 16);
- offset += 3;
- } else {
- lprintf(LOG_ERR, "Bad start of record byte in cipher suite data");
- return -1;
- }
+ if (rc < 0)
+ return rc;
- /*
- * Grab the algorithms for this cipher suite. I guess we can't be
- * sure of what order they'll come in. Also, I suppose we default
- * to the NONE algorithm if one were absent. This part of the spec is
- * poorly written -- I have read the errata document. For now, I'm only
- * allowing one algorithm per type (auth, integrity, crypt) because I
- * don't I understand how it could be otherwise.
- */
- auth_alg = IPMI_AUTH_RAKP_NONE;
- integrity_alg = IPMI_INTEGRITY_NONE;
- crypt_alg = IPMI_CRYPT_NONE;
-
- while (((cipher_suite_data[offset] & 0xC0) != 0xC0) &&
- ((cipher_suite_data_length - offset) > 0))
- {
- switch (cipher_suite_data[offset] & 0xC0)
- {
- case 0x00:
- /* Authentication algorithm specifier */
- auth_alg = cipher_suite_data[offset++] & 0x3F;
- break;
- case 0x40:
- /* Interity algorithm specifier */
- integrity_alg = cipher_suite_data[offset++] & 0x3F;
- break;
- case 0x80:
- /* Confidentiality algorithm specifier */
- crypt_alg = cipher_suite_data[offset++] & 0x3F;
- break;
- }
- }
+ if (!csv_output) {
+ printf("%s\n", header_str);
+ }
+ for (i = 0; i < nr_suites; i++) {
/* We have everything we need to spit out a cipher suite record */
- printf((csv_output? "%d,%s,%s,%s,%s\n" :
- "%-4d %-7s %-15s %-15s %-15s\n"),
- cipher_suite_id,
- iana_string(iana),
- val2str(auth_alg, ipmi_auth_algorithms),
- val2str(integrity_alg, ipmi_integrity_algorithms),
- val2str(crypt_alg, ipmi_encryption_algorithms));
+ printf(csv_output ? "%d,%s,%s,%s,%s\n"
+ : "%-4d %-7s %-15s %-15s %-15s\n",
+ suites[i].cipher_suite_id,
+ iana_string(suites[i].iana),
+ val2str(suites[i].auth_alg, ipmi_auth_algorithms),
+ val2str(suites[i].integrity_alg, ipmi_integrity_algorithms),
+ val2str(suites[i].crypt_alg, ipmi_encryption_algorithms));
}
return 0;
}
@@ -648,8 +693,9 @@ ipmi_get_channel_info(struct ipmi_intf *intf, uint8_t channel)
*
* @channel - IPMI Channel
*
- * returns - IPMI Channel Medium, IPMI_CHANNEL_MEDIUM_RESERVED if ccode > 0,
- * 0 on error.
+ * @returns IPMI Channel Medium
+ * @retval IPMI_CHANNEL_MEDIUM_RESERVED if ccode was not IPMI_CC_OK
+ * @retval 0 on error
*/
uint8_t
ipmi_get_channel_medium(struct ipmi_intf *intf, uint8_t channel)
@@ -659,13 +705,16 @@ ipmi_get_channel_medium(struct ipmi_intf *intf, uint8_t channel)
channel_info.channel = channel;
ccode = _ipmi_get_channel_info(intf, &channel_info);
- if (ccode == 0xCC) {
- return IPMI_CHANNEL_MEDIUM_RESERVED;
- } else if (ccode < 0 && eval_ccode(ccode) != 0) {
- return 0;
- } else if (ccode > 0) {
- lprintf(LOG_ERR, "Get Channel Info command failed: %s",
- val2str(ccode, completion_code_vals));
+ if (ccode) {
+ if (ccode != IPMI_CC_INV_DATA_FIELD_IN_REQ) {
+ if (ccode > 0) {
+ lprintf(LOG_ERR, "Get Channel Info command failed: %s",
+ val2str(ccode, completion_code_vals));
+ }
+ else {
+ eval_ccode(ccode);
+ }
+ }
return IPMI_CHANNEL_MEDIUM_RESERVED;
}
lprintf(LOG_DEBUG, "Channel type: %s",
@@ -734,7 +783,8 @@ ipmi_get_user_access(struct ipmi_intf *intf, uint8_t channel, uint8_t user_id)
(user_access.ipmi_messaging) ? "en" : "dis");
printf("Privilege Level : %s\n",
val2str(user_access.privilege_limit, ipmi_privlvl_vals));
-
+ printf("Enable Status : %s\n",
+ val2str(user_access.enable_status, ipmi_user_enable_status_vals));
curr_uid ++;
} while (!user_id && curr_uid <= max_uid);
@@ -753,9 +803,27 @@ ipmi_set_user_access(struct ipmi_intf *intf, int argc, char **argv)
int ccode = 0;
int i = 0;
uint8_t channel = 0;
- uint8_t priv = 0;
uint8_t user_id = 0;
- if (argc > 0 && strncmp(argv[0], "help", 4) == 0) {
+ struct {
+ const char *option;
+ enum {
+ UA_INTEGER, /* direct integer value */
+ UA_BOOLEAN, /* off/disable = false, on/enable = true */
+ UA_BOOLEAN_INVERSE /* off/disable = true, on/enable = false */
+ } type;
+ uint8_t *val;
+ uint8_t min; /* minimum value for UA_INTEGER options */
+ uint8_t max; /* maximum value for UA_INTEGER options */
+ } options[] = {
+ { "callin=", UA_BOOLEAN_INVERSE, &user_access.callin_callback, 0, 0},
+ { "link=", UA_BOOLEAN, &user_access.link_auth, 0, 0},
+ { "ipmi=", UA_BOOLEAN, &user_access.ipmi_messaging, 0, 0},
+ { "privilege=", UA_INTEGER, &user_access.privilege_limit
+ , IPMI_SESSION_PRIV_CALLBACK
+ , IPMI_SESSION_PRIV_NOACCESS },
+ };
+
+ if (argc > 0 && !strcmp(argv[0], "help")) {
printf_channel_usage();
return 0;
} else if (argc < 3) {
@@ -777,33 +845,46 @@ ipmi_set_user_access(struct ipmi_intf *intf, int argc, char **argv)
return (-1);
}
for (i = 2; i < argc; i ++) {
- if (strncmp(argv[i], "callin=", 7) == 0) {
- if (strncmp(argv[i] + 7, "off", 3) == 0) {
- user_access.callin_callback = 1;
- } else {
- user_access.callin_callback = 0;
- }
- } else if (strncmp(argv[i], "link=", 5) == 0) {
- if (strncmp(argv[i] + 5, "off", 3) == 0) {
- user_access.link_auth = 0;
- } else {
- user_access.link_auth = 1;
- }
- } else if (strncmp(argv[i], "ipmi=", 5) == 0) {
- if (strncmp(argv[i] + 5, "off", 3) == 0) {
- user_access.ipmi_messaging = 0;
- } else {
- user_access.ipmi_messaging = 1;
- }
- } else if (strncmp(argv[i], "privilege=", 10) == 0) {
- if (str2uchar(argv[i] + 10, &priv) != 0) {
- lprintf(LOG_ERR,
- "Numeric value expected, but '%s' given.",
- argv[i] + 10);
- return (-1);
+ size_t j;
+ for (j = 0; j < ARRAY_SIZE(options); ++j) {
+ const char *opt = argv[i];
+ const int optlen = strlen(options[j].option);
+ if (!strncmp(opt, options[j].option, optlen)) {
+ const char *optval = opt + optlen;
+ uint16_t val;
+
+ if (UA_INTEGER != options[j].type) {
+ bool boolval = (UA_BOOLEAN_INVERSE == options[j].type)
+ ? false
+ : true;
+ *options[j].val = boolval;
+ if (!strcmp(optval, "off")
+ || !strcmp(optval, "disable")
+ || !strcmp(optval, "no"))
+ {
+ boolval = !boolval;
+ }
+ } else if (UINT8_MAX
+ != (val = str2val(optval, ipmi_privlvl_vals)))
+ {
+ *options[j].val = (uint8_t)val;
+ } else if (str2uchar(optval, options[j].val)) {
+ lprintf(LOG_ERR
+ , "Numeric [%hhu-%hhu] value expected, "
+ "but '%s' given."
+ , options[j].min
+ , options[j].max
+ , optval);
+ return (-1);
+ }
+ lprintf(LOG_DEBUG
+ , "Option %s=%hhu"
+ , options[j].option
+ , *options[j].val);
+ break;
}
- user_access.privilege_limit = priv;
- } else {
+ }
+ if (ARRAY_SIZE(options) == j) {
lprintf(LOG_ERR, "Invalid option: %s\n", argv[i]);
return (-1);
}
@@ -830,10 +911,10 @@ ipmi_channel_main(struct ipmi_intf *intf, int argc, char **argv)
lprintf(LOG_ERR, "Not enough parameters given.");
printf_channel_usage();
return (-1);
- } else if (strncmp(argv[0], "help", 4) == 0) {
+ } else if (!strcmp(argv[0], "help")) {
printf_channel_usage();
return 0;
- } else if (strncmp(argv[0], "authcap", 7) == 0) {
+ } else if (!strcmp(argv[0], "authcap")) {
if (argc != 3) {
printf_channel_usage();
return (-1);
@@ -843,7 +924,7 @@ ipmi_channel_main(struct ipmi_intf *intf, int argc, char **argv)
return (-1);
}
retval = ipmi_get_channel_auth_cap(intf, channel, priv);
- } else if (strncmp(argv[0], "getaccess", 10) == 0) {
+ } else if (!strcmp(argv[0], "getaccess")) {
uint8_t user_id = 0;
if ((argc < 2) || (argc > 3)) {
lprintf(LOG_ERR, "Not enough parameters given.");
@@ -859,9 +940,9 @@ ipmi_channel_main(struct ipmi_intf *intf, int argc, char **argv)
}
}
retval = ipmi_get_user_access(intf, channel, user_id);
- } else if (strncmp(argv[0], "setaccess", 9) == 0) {
+ } else if (!strcmp(argv[0], "setaccess")) {
return ipmi_set_user_access(intf, (argc - 1), &(argv[1]));
- } else if (strncmp(argv[0], "info", 4) == 0) {
+ } else if (!strcmp(argv[0], "info")) {
channel = 0xE;
if (argc > 2) {
printf_channel_usage();
@@ -873,11 +954,11 @@ ipmi_channel_main(struct ipmi_intf *intf, int argc, char **argv)
}
}
retval = ipmi_get_channel_info(intf, channel);
- } else if (strncmp(argv[0], "getciphers", 10) == 0) {
+ } else if (!strcmp(argv[0], "getciphers")) {
/* channel getciphers <ipmi|sol> [channel] */
channel = 0xE;
if ((argc < 2) || (argc > 3) ||
- (strncmp(argv[1], "ipmi", 4) && strncmp(argv[1], "sol", 3))) {
+ (strcmp(argv[1], "ipmi") && strcmp(argv[1], "sol"))) {
printf_channel_usage();
return (-1);
}
@@ -886,9 +967,9 @@ ipmi_channel_main(struct ipmi_intf *intf, int argc, char **argv)
return (-1);
}
}
- retval = ipmi_get_channel_cipher_suites(intf,
- argv[1], /* ipmi | sol */
- channel);
+ retval = ipmi_print_channel_cipher_suites(intf,
+ argv[1], /* ipmi | sol */
+ channel);
} else {
lprintf(LOG_ERR, "Invalid CHANNEL command: %s\n", argv[0]);
printf_channel_usage();
diff --git a/lib/ipmi_chassis.c b/lib/ipmi_chassis.c
index fb7c27d..7ac6770 100644
--- a/lib/ipmi_chassis.c
+++ b/lib/ipmi_chassis.c
@@ -29,13 +29,13 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE >= 1 || \
- _XOPEN_SOURCE || _POSIX_SOURCE
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
+#include <errno.h>
+#include <limits.h>
#include <ipmitool/bswap.h>
#include <ipmitool/helper.h>
@@ -44,9 +44,132 @@
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/ipmi_chassis.h>
+#include <ipmitool/ipmi_time.h>
+
+#define CHASSIS_BOOT_MBOX_IANA_SZ 3
+#define CHASSIS_BOOT_MBOX_BLOCK_SZ 16
+#define CHASSIS_BOOT_MBOX_BLOCK0_SZ \
+ (CHASSIS_BOOT_MBOX_BLOCK_SZ - CHASSIS_BOOT_MBOX_IANA_SZ)
+#define CHASSIS_BOOT_MBOX_MAX_BLOCK 0xFF
+#define CHASSIS_BOOT_MBOX_MAX_BLOCKS (CHASSIS_BOOT_MBOX_MAX_BLOCK + 1)
+
+/* Get/Set system boot option boot flags bit definitions */
+/* Boot flags byte 1 bits */
+#define BF1_VALID_SHIFT 7
+#define BF1_INVALID 0
+#define BF1_VALID (1 << BF1_VALID_SHIFT)
+#define BF1_VALID_MASK BF1_VALID
+
+#define BF1_PERSIST_SHIFT 6
+#define BF1_ONCE 0
+#define BF1_PERSIST (1 << BF1_PERSIST_SHIFT)
+#define BF1_PERSIST_MASK BF1_PERSIST
+
+#define BF1_BOOT_TYPE_SHIFT 5
+#define BF1_BOOT_TYPE_LEGACY 0
+#define BF1_BOOT_TYPE_EFI (1 << BF1_BOOT_TYPE_SHIFT)
+#define BF1_BOOT_TYPE_MASK BF1_BOOT_TYPE_EFI
+
+/* Boot flags byte 2 bits */
+#define BF2_CMOS_CLEAR_SHIFT 7
+#define BF2_CMOS_CLEAR (1 << BF2_CMOS_CLEAR_SHIFT)
+#define BF2_CMOS_CLEAR_MASK BF2_CMOS_CLEAR
+
+#define BF2_KEYLOCK_SHIFT 6
+#define BF2_KEYLOCK (1 << BF2_KEYLOCK_SHIFT)
+#define BF2_KEYLOCK_MASK BF2_KEYLOCK
+
+#define BF2_BOOTDEV_SHIFT 2
+#define BF2_BOOTDEV_DEFAULT (0 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_PXE (1 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_HDD (2 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_HDD_SAFE (3 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_DIAG_PART (4 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_CDROM (5 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_SETUP (6 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_REMOTE_FDD (7 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_REMOTE_CDROM (8 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_REMOTE_PRIMARY_MEDIA (9 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_REMOTE_HDD (11 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_FDD (15 << BF2_BOOTDEV_SHIFT)
+#define BF2_BOOTDEV_MASK (0xF << BF2_BOOTDEV_SHIFT)
+
+#define BF2_BLANK_SCREEN_SHIFT 1
+#define BF2_BLANK_SCREEN (1 << BF2_BLANK_SCREEN_SHIFT)
+#define BF2_BLANK_SCREEN_MASK BF2_BLANK_SCREEN
+
+#define BF2_RESET_LOCKOUT_SHIFT 0
+#define BF2_RESET_LOCKOUT (1 << BF2_RESET_LOCKOUT_SHIFT)
+#define BF2_RESET_LOCKOUT_MASK BF2_RESET_LOCKOUT
+
+/* Boot flags byte 3 bits */
+#define BF3_POWER_LOCKOUT_SHIFT 7
+#define BF3_POWER_LOCKOUT (1 << BF3_POWER_LOCKOUT_SHIFT)
+#define BF3_POWER_LOCKOUT_MASK BF3_POWER_LOCKOUT
+
+#define BF3_VERBOSITY_SHIFT 5
+#define BF3_VERBOSITY_DEFAULT (0 << BF3_VERBOSITY_SHIFT)
+#define BF3_VERBOSITY_QUIET (1 << BF3_VERBOSITY_SHIFT)
+#define BF3_VERBOSITY_VERBOSE (2 << BF3_VERBOSITY_SHIFT)
+#define BF3_VERBOSITY_MASK (3 << BF3_VERBOSITY_SHIFT)
+
+#define BF3_EVENT_TRAPS_SHIFT 4
+#define BF3_EVENT_TRAPS (1 << BF3_EVENT_TRAPS_SHIFT)
+#define BF3_EVENT_TRAPS_MASK BF3_EVENT_TRAPS
+
+#define BF3_PASSWD_BYPASS_SHIFT 3
+#define BF3_PASSWD_BYPASS (1 << BF3_PASSWD_BYPASS_SHIFT)
+#define BF3_PASSWD_BYPASS_MASK BF3_PASSWD_BYPASS
+
+#define BF3_SLEEP_LOCKOUT_SHIFT 2
+#define BF3_SLEEP_LOCKOUT (1 << BF3_SLEEP_LOCKOUT_SHIFT)
+#define BF3_SLEEP_LOCKOUT_MASK BF3_SLEEP_LOCKOUT
+
+#define BF3_CONSOLE_REDIR_SHIFT 0
+#define BF3_CONSOLE_REDIR_DEFAULT (0 << BF3_CONSOLE_REDIR_SHIFT)
+#define BF3_CONSOLE_REDIR_SUPPRESS (1 << BF3_CONSOLE_REDIR_SHIFT)
+#define BF3_CONSOLE_REDIR_ENABLE (2 << BF3_CONSOLE_REDIR_SHIFT)
+#define BF3_CONSOLE_REDIR_MASK (3 << BF3_CONSOLE_REDIR_SHIFT)
+
+/* Boot flags byte 4 bits */
+#define BF4_SHARED_MODE_SHIFT 3
+#define BF4_SHARED_MODE (1 << BF4_SHARED_MODE_SHIFT)
+#define BF4_SHARED_MODE_MASK BF4_SHARED_MODE
+
+#define BF4_BIOS_MUX_SHIFT 0
+#define BF4_BIOS_MUX_DEFAULT (0 << BF4_BIOS_MUX_SHIFT)
+#define BF4_BIOS_MUX_BMC (1 << BF4_BIOS_MUX_SHIFT)
+#define BF4_BIOS_MUX_SYSTEM (2 << BF4_BIOS_MUX_SHIFT)
+#define BF4_BIOS_MUX_MASK (7 << BF4_BIOS_MUX_SHIFT)
+
+
+typedef struct {
+ uint8_t iana[CHASSIS_BOOT_MBOX_IANA_SZ];
+ uint8_t data[CHASSIS_BOOT_MBOX_BLOCK0_SZ];
+} mbox_b0_data_t;
+
+typedef struct {
+ uint8_t block;
+ union {
+ uint8_t data[CHASSIS_BOOT_MBOX_BLOCK_SZ];
+ mbox_b0_data_t b0;
+ };
+} mbox_t;
extern int verbose;
+static const struct valstr get_bootparam_cc_vals[] = {
+ { 0x80, "Unsupported parameter" },
+ { 0x00, NULL }
+};
+
+static const struct valstr set_bootparam_cc_vals[] = {
+ { 0x80, "Unsupported parameter" },
+ { 0x81, "Attempt to set 'in progress' while not in 'complete' state" },
+ { 0x82, "Parameter is read-only" },
+ { 0x00, NULL }
+};
+
int
ipmi_chassis_power_status(struct ipmi_intf * intf)
{
@@ -59,11 +182,11 @@ ipmi_chassis_power_status(struct ipmi_intf * intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to get Chassis Power Status");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Chassis Power Status failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -98,12 +221,12 @@ ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to set Chassis Power Control to %s",
val2str(ctl, ipmi_chassis_power_control_vals));
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Chassis Power Control to %s failed: %s",
val2str(ctl, ipmi_chassis_power_control_vals),
val2str(rsp->ccode, completion_code_vals));
@@ -131,8 +254,8 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
req.msg.netfn = IPMI_NETFN_CHASSIS;
req.msg.cmd = 0x4;
- if (arg != NULL) {
- if (strncmp(arg, "force", 5) == 0) {
+ if (arg) {
+ if (!strcmp(arg, "force")) {
identify_data.force_on = 1;
} else {
if ( (rc = str2uchar(arg, &identify_data.interval)) != 0) {
@@ -154,11 +277,11 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
}
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to set Chassis Identify");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Chassis Identify failed: %s",
val2str(rsp->ccode, completion_code_vals));
if (identify_data.force_on != 0) {
@@ -172,7 +295,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
}
printf("Chassis identify interval: ");
- if (arg == NULL) {
+ if (!arg) {
printf("default (15 seconds)\n");
} else {
if (identify_data.force_on != 0) {
@@ -202,11 +325,11 @@ ipmi_chassis_poh(struct ipmi_intf * intf)
req.msg.cmd = 0xf;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to get Chassis Power-On-Hours");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Chassis Power-On-Hours failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -245,52 +368,18 @@ ipmi_chassis_restart_cause(struct ipmi_intf * intf)
req.msg.cmd = 0x7;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to get Chassis Restart Cause");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Chassis Restart Cause failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
}
- printf("System restart cause: ");
-
- switch (rsp->data[0] & 0xf) {
- case 0:
- printf("unknown\n");
- break;
- case 1:
- printf("chassis power control command\n");
- break;
- case 2:
- printf("reset via pushbutton\n");
- break;
- case 3:
- printf("power-up via pushbutton\n");
- break;
- case 4:
- printf("watchdog expired\n");
- break;
- case 5:
- printf("OEM\n");
- break;
- case 6:
- printf("power-up due to always-restore power policy\n");
- break;
- case 7:
- printf("power-up due to restore-previous power policy\n");
- break;
- case 8:
- printf("reset via PEF\n");
- break;
- case 9:
- printf("power-cycle via PEF\n");
- break;
- default:
- printf("invalid\n");
- }
+ printf("System restart cause: %s\n",
+ val2str(rsp->data[0] & 0xf, ipmi_chassis_restart_cause_vals));
return 0;
}
@@ -306,11 +395,11 @@ ipmi_chassis_status(struct ipmi_intf * intf)
req.msg.cmd = 0x1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error sending Chassis Status command");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error sending Chassis Status command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -389,11 +478,11 @@ ipmi_chassis_selftest(struct ipmi_intf * intf)
req.msg.cmd = 0x4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error sending Get Self Test command");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error sending Get Self Test command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -447,61 +536,166 @@ ipmi_chassis_selftest(struct ipmi_intf * intf)
}
static int
-ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * data, int len)
+ipmi_chassis_set_bootparam(struct ipmi_intf * intf,
+ uint8_t param, void *data, int len)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
- uint8_t msg_data[16];
+ struct {
+ uint8_t param;
+ uint8_t data[];
+ } *msg_data;
+ int rc = -1;
+ size_t msgsize = 1 + len; /* Single-byte parameter plus the data */
+ static const uint8_t BOOTPARAM_MASK = 0x7F;
+
+ msg_data = malloc(msgsize);
+ if (!msg_data) {
+ goto out;
+ }
+ memset(msg_data, 0, msgsize);
- memset(msg_data, 0, 16);
- msg_data[0] = param & 0x7f;
- memcpy(msg_data+1, data, len);
+ msg_data->param = param & BOOTPARAM_MASK;
+ memcpy(msg_data->data, data, len);
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_CHASSIS;
req.msg.cmd = 0x8;
- req.msg.data = msg_data;
- req.msg.data_len = len + 1;
+ req.msg.data = (uint8_t *)msg_data;
+ req.msg.data_len = msgsize;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error setting Chassis Boot Parameter %d", param);
return -1;
}
- if (rsp->ccode > 0) {
+
+ rc = rsp->ccode;
+ if (rc) {
if (param != 0) {
- lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
- param, val2str(rsp->ccode, completion_code_vals));
+ lprintf(LOG_ERR,
+ "Set Chassis Boot Parameter %d failed: %s",
+ param,
+ specific_val2str(rsp->ccode,
+ set_bootparam_cc_vals,
+ completion_code_vals));
}
- return -1;
+ goto out;
}
lprintf(LOG_DEBUG, "Chassis Set Boot Parameter %d to %s", param, buf2str(data, len));
- return 0;
+
+out:
+ free_n(&msg_data);
+ return rc;
+}
+
+/* Flags to ipmi_chassis_get_bootparam() */
+typedef enum {
+ PARAM_NO_GENERIC_INFO, /* Do not print generic boot parameter info */
+ PARAM_NO_DATA_DUMP, /* Do not dump parameter data */
+ PARAM_NO_RANGE_ERROR, /* Do not report out of range info to user */
+ PARAM_SPECIFIC /* Parameter-specific flags start with this */
+} chassis_bootparam_flags_t;
+
+/* Flags to ipmi_chassis_get_bootparam() for Boot Mailbox parameter (7) */
+typedef enum {
+ MBOX_PARSE_USE_TEXT = PARAM_SPECIFIC, /* Use text output vs. hex */
+ MBOX_PARSE_ALLBLOCKS /* Parse all blocks, not just one */
+} chassis_bootmbox_parse_t;
+
+#define BP_FLAG(x) (1 << (x))
+
+static
+void
+chassis_bootmailbox_parse(void *buf, size_t len, int flags)
+{
+ void *blockdata;
+ size_t datalen;
+ bool use_text = flags & BP_FLAG(MBOX_PARSE_USE_TEXT);
+ bool all_blocks = flags & BP_FLAG(MBOX_PARSE_ALLBLOCKS);
+
+ mbox_t *mbox;
+
+ if (!buf || !len) {
+ return;
+ }
+
+ mbox = buf;
+ blockdata = mbox->data;
+ datalen = len - sizeof(mbox->block);
+ if (!all_blocks) {
+ /* Print block selector only if a single block is printed */
+ printf(" Selector : %d\n", mbox->block);
+ }
+ if (!mbox->block) {
+ uint32_t iana = ipmi24toh(mbox->b0.iana);
+ /* For block zero print the IANA Private Enterprise Number */
+ printf(" IANA PEN : %" PRIu32 " [%s]\n",
+ iana,
+ val2str(iana, ipmi_oem_info));
+ blockdata = mbox->b0.data;
+ datalen -= sizeof(mbox->b0.iana);
+ }
+
+ printf(" Block ");
+ if (all_blocks) {
+ printf("%3" PRIu8 " Data : ", mbox->block);
+ }
+ else {
+ printf("Data : ");
+ }
+ if (use_text) {
+ /* Ensure the data string is null-terminated */
+ unsigned char text[CHASSIS_BOOT_MBOX_BLOCK_SZ + 1] = { 0 };
+ memcpy(text, blockdata, datalen);
+ printf("'%s'\n", text);
+ }
+ else {
+ printf("%s\n", buf2str(blockdata, datalen));
+ }
}
static int
-ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
+ipmi_chassis_get_bootparam(struct ipmi_intf * intf,
+ int argc, char *argv[], int flags)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[3];
uint8_t param_id = 0;
+ bool skip_generic = flags & BP_FLAG(PARAM_NO_GENERIC_INFO);
+ bool skip_data = flags & BP_FLAG(PARAM_NO_DATA_DUMP);
+ bool skip_range = flags & BP_FLAG(PARAM_NO_RANGE_ERROR);
+ int rc = -1;
- if (arg == NULL)
- return -1;
+ if (argc < 1 || !argv[0]) {
+ goto out;
+ }
- if (str2uchar(arg, &param_id) != 0) {
- lprintf(LOG_ERR, "Invalid parameter '%s' given instead of bootparam.",
- arg);
- return (-1);
+ if (str2uchar(argv[0], &param_id)) {
+ lprintf(LOG_ERR,
+ "Invalid parameter '%s' given instead of bootparam.",
+ argv[0]);
+ goto out;
}
+ --argc;
+ ++argv;
+
memset(msg_data, 0, 3);
msg_data[0] = param_id & 0x7f;
- msg_data[1] = 0;
- msg_data[2] = 0;
+
+ if (argc) {
+ if (str2uchar(argv[0], &msg_data[1])) {
+ lprintf(LOG_ERR,
+ "Invalid argument '%s' given to"
+ " bootparam %" PRIu8,
+ argv[0], msg_data[1]);
+ goto out;
+ }
+ }
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_CHASSIS;
@@ -510,13 +704,22 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_ERR, "Error Getting Chassis Boot Parameter %s", arg);
+ if (!rsp) {
+ lprintf(LOG_ERR,
+ "Error Getting Chassis Boot Parameter %" PRIu8,
+ msg_data[0]);
return -1;
}
- if (rsp->ccode > 0) {
- lprintf(LOG_ERR, "Get Chassis Boot Parameter %s failed: %s",
- arg, val2str(rsp->ccode, completion_code_vals));
+ if (IPMI_CC_PARAM_OUT_OF_RANGE == rsp->ccode && skip_range) {
+ return -1;
+ }
+ if (rsp->ccode) {
+ lprintf(LOG_ERR,
+ "Get Chassis Boot Parameter %" PRIu8 " failed: %s",
+ msg_data[0],
+ specific_val2str(rsp->ccode,
+ get_bootparam_cc_vals,
+ completion_code_vals));
return -1;
}
@@ -526,10 +729,17 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
param_id = 0;
param_id = (rsp->data[1] & 0x7f);
- printf("Boot parameter version: %d\n", rsp->data[0]);
- printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
- (rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
- printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
+ if (!skip_generic) {
+ printf("Boot parameter version: %d\n", rsp->data[0]);
+ printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
+ (rsp->data[1] & 0x80)
+ ? "invalid/locked"
+ : "valid/unlocked");
+ if (!skip_data) {
+ printf("Boot parameter data: %s\n",
+ buf2str(rsp->data+2, rsp->data_len - 2));
+ }
+ }
switch(param_id)
{
@@ -622,132 +832,181 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
{
printf( " Boot Flags :\n");
- if((rsp->data[2]&0x80) == 0x80)
+ if(rsp->data[2] & BF1_VALID)
printf(" - Boot Flag Valid\n");
else
printf(" - Boot Flag Invalid\n");
- if((rsp->data[2]&0x40) == 0x40)
+ if(rsp->data[2] & BF1_PERSIST)
printf(" - Options apply to all future boots\n");
else
printf(" - Options apply to only next boot\n");
- if((rsp->data[2]&0x20) == 0x20)
+ if(rsp->data[2] & BF1_BOOT_TYPE_EFI)
printf(" - BIOS EFI boot \n");
else
printf(" - BIOS PC Compatible (legacy) boot \n");
- if((rsp->data[3]&0x80) == 0x80)
+ if(rsp->data[3] & BF2_CMOS_CLEAR)
printf(" - CMOS Clear\n");
- if((rsp->data[3]&0x40) == 0x40)
+ if(rsp->data[3] & BF2_KEYLOCK)
printf(" - Lock Keyboard\n");
printf(" - Boot Device Selector : ");
- switch( ((rsp->data[3]>>2)&0x0f))
+ switch(rsp->data[3] & BF2_BOOTDEV_MASK)
{
- case 0: printf("No override\n"); break;
- case 1: printf("Force PXE\n"); break;
- case 2: printf("Force Boot from default Hard-Drive\n"); break;
- case 3: printf("Force Boot from default Hard-Drive, request Safe-Mode\n"); break;
- case 4: printf("Force Boot from Diagnostic Partition\n"); break;
- case 5: printf("Force Boot from CD/DVD\n"); break;
- case 6: printf("Force Boot into BIOS Setup\n"); break;
- case 15: printf("Force Boot from Floppy/primary removable media\n"); break;
- default: printf("Flag error\n"); break;
+ case BF2_BOOTDEV_DEFAULT:
+ printf("No override\n");
+ break;
+ case BF2_BOOTDEV_PXE:
+ printf("Force PXE\n");
+ break;
+ case BF2_BOOTDEV_HDD:
+ printf("Force Boot from default Hard-Drive\n");
+ break;
+ case BF2_BOOTDEV_HDD_SAFE:
+ printf("Force Boot from default Hard-Drive, "
+ "request Safe-Mode\n");
+ break;
+ case BF2_BOOTDEV_DIAG_PART:
+ printf("Force Boot from Diagnostic Partition\n");
+ break;
+ case BF2_BOOTDEV_CDROM:
+ printf("Force Boot from CD/DVD\n");
+ break;
+ case BF2_BOOTDEV_SETUP:
+ printf("Force Boot into BIOS Setup\n");
+ break;
+ case BF2_BOOTDEV_REMOTE_FDD:
+ printf("Force Boot from remotely connected "
+ "Floppy/primary removable media\n");
+ break;
+ case BF2_BOOTDEV_REMOTE_CDROM:
+ printf("Force Boot from remotely connected "
+ "CD/DVD\n");
+ break;
+ case BF2_BOOTDEV_REMOTE_PRIMARY_MEDIA:
+ printf("Force Boot from primary remote media\n");
+ break;
+ case BF2_BOOTDEV_REMOTE_HDD:
+ printf("Force Boot from remotely connected "
+ "Hard-Drive\n");
+ break;
+ case BF2_BOOTDEV_FDD:
+ printf("Force Boot from Floppy/primary "
+ "removable media\n");
+ break;
+ default:
+ printf("Flag error\n");
+ break;
}
- if((rsp->data[3]&0x02) == 0x02)
+ if(rsp->data[3] & BF2_BLANK_SCREEN)
printf(" - Screen blank\n");
- if((rsp->data[3]&0x01) == 0x01)
+ if(rsp->data[3] & BF2_RESET_LOCKOUT)
printf(" - Lock out Reset buttons\n");
- if((rsp->data[4]&0x80) == 0x80)
- printf(" - Lock out (power off/sleep request) vi Power Button\n");
- printf(" - Console Redirection control : ");
- switch( ((rsp->data[4]>>5)&0x03))
+ if(rsp->data[4] & BF3_POWER_LOCKOUT)
+ printf(" - Lock out (power off/sleep "
+ "request) via Power Button\n");
+
+ printf(" - BIOS verbosity : ");
+ switch(rsp->data[4] & BF3_VERBOSITY_MASK)
{
- case 0: printf("System Default\n"); break;
- case 1: printf("Request Quiet Display\n"); break;
- case 2: printf("Request Verbose Display\n"); break;
- default: printf("Flag error\n"); break;
+ case BF3_VERBOSITY_DEFAULT:
+ printf("System Default\n");
+ break;
+ case BF3_VERBOSITY_QUIET:
+ printf("Request Quiet Display\n");
+ break;
+ case BF3_VERBOSITY_VERBOSE:
+ printf("Request Verbose Display\n");
+ break;
+ default:
+ printf("Flag error\n");
+ break;
}
- if((rsp->data[4]&0x10) == 0x10)
+ if(rsp->data[4] & BF3_EVENT_TRAPS)
printf(" - Force progress event traps\n");
- if((rsp->data[4]&0x08) == 0x08)
+ if(rsp->data[4] & BF3_PASSWD_BYPASS)
printf(" - User password bypass\n");
- if((rsp->data[4]&0x04) == 0x04)
+ if(rsp->data[4] & BF3_SLEEP_LOCKOUT)
printf(" - Lock Out Sleep Button\n");
- if((rsp->data[4]&0x02) == 0x02)
- printf(" - Lock Out Sleep Button\n");
- printf(" - BIOS verbosity : ");
- switch( ((rsp->data[4]>>0)&0x03))
+ printf(" - Console Redirection control : ");
+ switch(rsp->data[4] & BF3_CONSOLE_REDIR_MASK)
{
- case 0: printf("Console redirection occurs per BIOS configuration setting (default)\n"); break;
- case 1: printf("Suppress (skip) console redirection if enabled\n"); break;
- case 2: printf("Request console redirection be enabled\n"); break;
- default: printf("Flag error\n"); break;
+ case BF3_CONSOLE_REDIR_DEFAULT:
+ printf(
+ "Console redirection occurs per BIOS "
+ "configuration setting (default)\n");
+ break;
+ case BF3_CONSOLE_REDIR_SUPPRESS:
+ printf("Suppress (skip) console redirection "
+ "if enabled\n");
+ break;
+ case BF3_CONSOLE_REDIR_ENABLE:
+ printf("Request console redirection be "
+ "enabled\n");
+ break;
+ default:
+ printf("Flag error\n");
+ break;
}
- if((rsp->data[5]&0x08) == 0x08)
+ if(rsp->data[5] & BF4_SHARED_MODE)
printf(" - BIOS Shared Mode Override\n");
printf(" - BIOS Mux Control Override : ");
- switch( ((rsp->data[5]>>0)&0x07))
- {
- case 0: printf("BIOS uses recommended setting of the mux at the end of POST\n"); break;
- case 1: printf("Requests BIOS to force mux to BMC at conclusion of POST/start of OS boot\n"); break;
- case 2: printf("Requests BIOS to force mux to system at conclusion of POST/start of OS boot\n"); break;
- default: printf("Flag error\n"); break;
+ switch (rsp->data[5] & BF4_BIOS_MUX_MASK) {
+ case BF4_BIOS_MUX_DEFAULT:
+ printf("BIOS uses recommended setting of the "
+ "mux at the end of POST\n");
+ break;
+ case BF4_BIOS_MUX_BMC:
+ printf(
+ "Requests BIOS to force mux to BMC at "
+ "conclusion of POST/start of OS boot\n");
+ break;
+ case BF4_BIOS_MUX_SYSTEM:
+ printf(
+ "Requests BIOS to force mux to system "
+ "at conclusion of POST/start of "
+ "OS boot\n");
+ break;
+ default:
+ printf("Flag error\n");
+ break;
}
}
break;
case 6:
{
unsigned long session_id;
- unsigned long timestamp;
- char time_buf[40];
- time_t out_time;
+ uint32_t timestamp;
session_id = ((unsigned long) rsp->data[3]);
session_id |= (((unsigned long) rsp->data[4])<<8);
session_id |= (((unsigned long) rsp->data[5])<<16);
session_id |= (((unsigned long) rsp->data[6])<<24);
- timestamp = ((unsigned long) rsp->data[7]);
- timestamp |= (((unsigned long) rsp->data[8])<<8);
- timestamp |= (((unsigned long) rsp->data[9])<<16);
- timestamp |= (((unsigned long) rsp->data[10])<<24);
-
- memset(time_buf, 0, 40);
- strftime(
- time_buf,
- sizeof(time_buf),
- "%m/%d/%Y %H:%M:%S", localtime(&out_time)
- );
+ timestamp = ipmi32toh(&rsp->data[7]);
printf(" Boot Initiator Info :\n");
printf(" Channel Number : %d\n", (rsp->data[2] & 0x0f));
printf(" Session Id : %08lXh\n",session_id);
- if(timestamp != 0)
- {
- printf(" Timestamp : %08lXh, %s\n",timestamp,time_buf);
- }
- else
- {
- printf(" Timestamp : %08lXh, undefined\n",timestamp);
- }
-
+ printf(" Timestamp : %s\n", ipmi_timestamp_numeric(timestamp));
}
break;
case 7:
- {
- printf(" Selector : %d\n", rsp->data[2] );
- printf(" Block Data : %s\n", buf2str(rsp->data+3, rsp->data_len - 2));
- }
- break;
+ chassis_bootmailbox_parse(rsp->data + 2,
+ rsp->data_len - 2,
+ flags);
+ break;
default:
- printf(" Undefined byte\n");
+ printf(" Unsupported parameter %" PRIu8 "\n", param_id);
break;
}
- return 0;
+ rc = IPMI_CC_OK;
+out:
+ return rc;
}
static int
@@ -777,24 +1036,25 @@ get_bootparam_options(char *optstring,
{NULL} /* End marker */
}, *op;
+ const char *optkw = "options=";
- if (strncmp(optstring, "options=", 8) != 0) {
+ if (strncmp(optstring, optkw, strlen(optkw))) {
lprintf(LOG_ERR, "No options= keyword found \"%s\"", optstring);
return -1;
}
token = strtok_r(optstring + 8, ",", &saveptr);
- while (token != NULL) {
+ while (token) {
int setbit = 0;
- if (strcmp(token, "help") == 0) {
+ if (!strcmp(token, "help")) {
optionError = 1;
break;
}
- if (strncmp(token, "no-", 3) == 0) {
+ if (!strcmp(token, "no-")) {
setbit = 1;
token += 3;
}
- for (op = options; op->name != NULL; ++op) {
- if (strncmp(token, op->name, strlen(op->name)) == 0) {
+ for (op = options; op->name; ++op) {
+ if (!strcmp(token, op->name)) {
if (setbit) {
*set_flag |= op->value;
} else {
@@ -803,7 +1063,7 @@ get_bootparam_options(char *optstring,
break;
}
}
- if (op->name == NULL) {
+ if (!op->name) {
/* Option not found */
optionError = 1;
if (setbit) {
@@ -816,7 +1076,7 @@ get_bootparam_options(char *optstring,
if (optionError) {
lprintf(LOG_NOTICE, " Legal options are:");
lprintf(LOG_NOTICE, " %-8s: print this message", "help");
- for (op = options; op->name != NULL; ++op) {
+ for (op = options; op->name; ++op) {
lprintf(LOG_NOTICE, " %-8s: %s", op->name, op->desc);
}
lprintf(LOG_NOTICE, " Any Option may be prepended with no-"
@@ -846,14 +1106,17 @@ ipmi_chassis_get_bootvalid(struct ipmi_intf * intf)
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Error Getting Chassis Boot Parameter %d", param_id);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Chassis Boot Parameter %d failed: %s",
- param_id, val2str(rsp->ccode, completion_code_vals));
+ param_id,
+ specific_val2str(rsp->ccode,
+ get_bootparam_cc_vals,
+ completion_code_vals));
return -1;
}
@@ -863,77 +1126,97 @@ ipmi_chassis_get_bootvalid(struct ipmi_intf * intf)
return(rsp->data[2]);
}
+typedef enum {
+ SET_COMPLETE,
+ SET_IN_PROGRESS,
+ COMMIT_WRITE,
+ RESERVED
+} progress_t;
+
+
+static
+void
+chassis_bootparam_set_in_progress(struct ipmi_intf *intf, progress_t progress)
+{
+ /*
+ * By default try to set/clear set-in-progress parameter before/after
+ * changing any boot parameters. If setting fails, the code will set
+ * this flag to false and stop trying to fiddle with it for future
+ * requests.
+ */
+ static bool use_progress = true;
+ uint8_t flag = progress;
+ int rc;
+
+ if (!use_progress) {
+ return;
+ }
+
+ rc = ipmi_chassis_set_bootparam(intf,
+ IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
+ &flag, 1);
+
+ /*
+ * Only disable future checks if set in progress status setting failed.
+ * Setting of other statuses may fail legitimately.
+ */
+ if (rc && SET_IN_PROGRESS == progress) {
+ use_progress = false;
+ }
+}
+
+typedef enum {
+ BIOS_POST_ACK = 1 << 0,
+ OS_LOADER_ACK = 1 << 1,
+ OS_SERVICE_PARTITION_ACK = 1 << 2,
+ SMS_ACK = 1 << 3,
+ OEM_ACK = 1 << 4,
+ RESERVED_ACK_MASK = 7 << 5
+} bootinfo_ack_t;
+
+static
+int
+chassis_bootparam_clear_ack(struct ipmi_intf *intf, bootinfo_ack_t flag)
+{
+ uint8_t flags[2] = { flag & ~RESERVED_ACK_MASK,
+ flag & ~RESERVED_ACK_MASK };
+
+ return ipmi_chassis_set_bootparam(intf,
+ IPMI_CHASSIS_BOOTPARAM_INFO_ACK,
+ flags, 2);
+}
+
static int
ipmi_chassis_set_bootvalid(struct ipmi_intf *intf, uint8_t set_flag, uint8_t clr_flag)
{
int bootvalid;
- uint8_t flags[5];
- int rc = 0;
- int use_progress = 1;
- uint8_t param_id = IPMI_CHASSIS_BOOTPARAM_FLAG_VALID;
+ uint8_t flags[2];
+ int rc;
- if (use_progress) {
- /* set set-in-progress flag */
- memset(flags, 0, 5);
- flags[0] = 0x01;
- rc = ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
- if (rc < 0)
- use_progress = 0;
- }
-
- memset(flags, 0, 5);
- flags[0] = 0x01;
- flags[1] = 0x01;
- rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_INFO_ACK,
- flags, 2);
+ chassis_bootparam_set_in_progress(intf, SET_IN_PROGRESS);
+ rc = chassis_bootparam_clear_ack(intf, BIOS_POST_ACK);
- if (rc < 0) {
- if (use_progress) {
- /* set-in-progress = set-complete */
- memset(flags, 0, 5);
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
- }
- return -1;
+ if (rc) {
+ goto out;
}
bootvalid = ipmi_chassis_get_bootvalid(intf);
-
if (bootvalid < 0) {
- if (use_progress) {
- /* set-in-progress = set-complete */
- memset(flags, 0, 5);
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
- }
- return -1;
- }
- flags[0] = (bootvalid & ~clr_flag) | set_flag;
-
- rc = ipmi_chassis_set_bootparam(intf, param_id, flags, 1);
-
- if (rc == 0) {
- if (use_progress) {
- /* set-in-progress = commit-write */
- memset(flags, 0, 5);
- flags[0] = 0x02;
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
- }
+ lprintf(LOG_ERR, "Failed to read boot valid flag");
+ rc = bootvalid;
+ goto out;
}
- if (use_progress) {
- /* set-in-progress = set-complete */
- memset(flags, 0, 5);
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
+ flags[0] = (bootvalid & ~clr_flag) | set_flag;
+ rc = ipmi_chassis_set_bootparam(intf,
+ IPMI_CHASSIS_BOOTPARAM_FLAG_VALID,
+ flags, 1);
+ if (IPMI_CC_OK == rc) {
+ chassis_bootparam_set_in_progress(intf, COMMIT_WRITE);
}
+out:
+ chassis_bootparam_set_in_progress(intf, SET_COMPLETE);
return rc;
}
@@ -941,107 +1224,372 @@ static int
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
{
uint8_t flags[5];
- int rc = 0;
- int use_progress = 1;
+ int rc;
- if (use_progress) {
- /* set set-in-progress flag */
- memset(flags, 0, 5);
- flags[0] = 0x01;
- rc = ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
- if (rc < 0)
- use_progress = 0;
- }
-
- memset(flags, 0, 5);
- flags[0] = 0x01;
- flags[1] = 0x01;
- rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_INFO_ACK,
- flags, 2);
+ chassis_bootparam_set_in_progress(intf, SET_IN_PROGRESS);
+ rc = chassis_bootparam_clear_ack(intf, BIOS_POST_ACK);
if (rc < 0) {
- if (use_progress) {
- /* set-in-progress = set-complete */
- memset(flags, 0, 5);
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
- }
- return -1;
+ goto out;
}
- if (iflags == NULL)
- memset(flags, 0, 5);
+ if (!iflags)
+ memset(flags, 0, sizeof(flags));
else
memcpy(flags, iflags, sizeof (flags));
- if (arg == NULL)
+ if (!arg)
flags[1] |= 0x00;
- else if (strncmp(arg, "none", 4) == 0)
+ else if (!strcmp(arg, "none"))
flags[1] |= 0x00;
- else if (strncmp(arg, "pxe", 3) == 0 ||
- strncmp(arg, "force_pxe", 9) == 0)
+ else if (!strcmp(arg, "pxe") ||
+ !strcmp(arg, "force_pxe"))
+ {
flags[1] |= 0x04;
- else if (strncmp(arg, "disk", 4) == 0 ||
- strncmp(arg, "force_disk", 10) == 0)
+ }
+ else if (!strcmp(arg, "disk") ||
+ !strcmp(arg, "force_disk"))
+ {
flags[1] |= 0x08;
- else if (strncmp(arg, "safe", 4) == 0 ||
- strncmp(arg, "force_safe", 10) == 0)
+ }
+ else if (!strcmp(arg, "safe") ||
+ !strcmp(arg, "force_safe"))
+ {
flags[1] |= 0x0c;
- else if (strncmp(arg, "diag", 4) == 0 ||
- strncmp(arg, "force_diag", 10) == 0)
+ }
+ else if (!strcmp(arg, "diag") ||
+ !strcmp(arg, "force_diag"))
+ {
flags[1] |= 0x10;
- else if (strncmp(arg, "cdrom", 5) == 0 ||
- strncmp(arg, "force_cdrom", 11) == 0)
+ }
+ else if (!strcmp(arg, "cdrom") ||
+ !strcmp(arg, "force_cdrom"))
+ {
flags[1] |= 0x14;
- else if (strncmp(arg, "floppy", 6) == 0 ||
- strncmp(arg, "force_floppy", 12) == 0)
+ }
+ else if (!strcmp(arg, "floppy") ||
+ !strcmp(arg, "force_floppy"))
+ {
flags[1] |= 0x3c;
- else if (strncmp(arg, "bios", 4) == 0 ||
- strncmp(arg, "force_bios", 10) == 0)
+ }
+ else if (!strcmp(arg, "bios") ||
+ !strcmp(arg, "force_bios"))
+ {
flags[1] |= 0x18;
+ }
else {
lprintf(LOG_ERR, "Invalid argument: %s", arg);
- if (use_progress) {
- /* set-in-progress = set-complete */
- memset(flags, 0, 5);
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
- }
- return -1;
+ rc = -1;
+ goto out;
}
/* set flag valid bit */
flags[0] |= 0x80;
- rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
- flags, 5);
- if (rc == 0) {
- if (use_progress) {
- /* set-in-progress = commit-write */
- memset(flags, 0, 5);
- flags[0] = 0x02;
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
+ rc = ipmi_chassis_set_bootparam(intf,
+ IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
+ flags, 5);
+ if (IPMI_CC_OK == rc) {
+ chassis_bootparam_set_in_progress(intf, COMMIT_WRITE);
+ printf("Set Boot Device to %s\n", arg);
+ }
+
+out:
+ chassis_bootparam_set_in_progress(intf, SET_COMPLETE);
+ return rc;
+}
+
+static void chassis_bootmailbox_help()
+{
+ lprintf(LOG_NOTICE,
+"bootmbox get [text] [block <block>]\n"
+" Read the entire Boot Initiator Mailbox or the specified <block>.\n"
+" If 'text' option is specified, the data is output as plain text, otherwise\n"
+" hex dump mode is used.\n"
+"\n"
+"bootmbox set text [block <block>] <IANA_PEN> \"<data_string>\"\n"
+"bootmbox set [block <block>] <IANA_PEN> <data_byte> [<data_byte> ...]\n"
+" Write the specified <block> or the entire Boot Initiator Mailbox.\n"
+" It is required to specify a decimal IANA Enterprise Number recognized\n"
+" by the boot initiator on the target system. Refer to your target system\n"
+" manufacturer for details. The rest of the arguments are either separate\n"
+" data byte values separated by spaces, or a single text string argument.\n"
+"\n"
+" When single block write is requested, the total length of <data> may not\n"
+" exceed 13 bytes for block 0, or 16 bytes otherwise.\n"
+"\n"
+"bootmbox help\n"
+" Show this help.");
+}
+
+static
+int
+chassis_set_bootmailbox(struct ipmi_intf *intf, int16_t block, bool use_text,
+ int argc, char *argv[])
+{
+ int rc = -1;
+ int32_t iana = 0;
+ size_t blocks = 0;
+ size_t datasize = 0;
+ off_t string_offset = 0;
+
+ lprintf(LOG_INFO, "Writing Boot Mailbox...");
+
+ if (argc < 1 || str2int(argv[0], &iana)) {
+ lprintf(LOG_ERR,
+ "No valid IANA PEN specified!\n");
+ chassis_bootmailbox_help();
+ goto out;
+ }
+ ++argv;
+ --argc;
+
+ if (argc < 1) {
+ lprintf(LOG_ERR,
+ "No data provided!\n");
+ chassis_bootmailbox_help();
+ goto out;
+ }
+
+ /*
+ * Initialize the data size. For text mode it is just the
+ * single argument string length plus one byte for \0 termination.
+ * For byte mode the length is the number of byte arguments without
+ * any additional termination.
+ */
+ if (!use_text) {
+ datasize = argc;
+ }
+ else {
+ datasize = strlen(argv[0]) + 1; /* Include the terminator */
+ }
+
+ lprintf(LOG_INFO, "Data size: %u", datasize);
+
+ /* Decide how many blocks we will be writing */
+ if (block >= 0) {
+ blocks = 1;
+ }
+ else {
+ /*
+ * We need to write all data, so calculate the data
+ * size in blocks and set the starting block to zero.
+ */
+ blocks = CHASSIS_BOOT_MBOX_IANA_SZ;
+ blocks += datasize;
+ blocks += CHASSIS_BOOT_MBOX_BLOCK_SZ - 1;
+ blocks /= CHASSIS_BOOT_MBOX_BLOCK_SZ;
+
+ block = 0;
+ }
+
+ lprintf(LOG_INFO, "Blocks to write: %d", blocks);
+
+ if (blocks > CHASSIS_BOOT_MBOX_MAX_BLOCKS) {
+ lprintf(LOG_ERR,
+ "Data size %zu exceeds maximum (%d)",
+ datasize,
+ (CHASSIS_BOOT_MBOX_BLOCK_SZ
+ * CHASSIS_BOOT_MBOX_MAX_BLOCKS)
+ - CHASSIS_BOOT_MBOX_IANA_SZ);
+ goto out;
+ }
+
+ /* Indicate that we're touching the boot parameters */
+ chassis_bootparam_set_in_progress(intf, SET_IN_PROGRESS);
+
+ for (size_t bindex = 0;
+ datasize > 0 && bindex < blocks;
+ ++bindex, ++block)
+ {
+ /* The request data structure */
+ mbox_t mbox = { .block = block, {{0}} };
+
+ /* Destination for input data */
+ uint8_t *data = mbox.data;
+
+ /* The maximum amount of data this block may hold */
+ size_t maxblocksize = sizeof(mbox.data);
+
+ /* The actual amount of data in this block */
+ size_t blocksize;
+ off_t unused = 0;
+
+ /* Block 0 needs special care as it has IANA PEN specifier */
+ if (!block) {
+ data = mbox.b0.data;
+ maxblocksize = sizeof(mbox.b0.data);
+ htoipmi24(iana, mbox.b0.iana);
}
- printf("Set Boot Device to %s\n", arg);
+ /*
+ * Find out how many bytes we are going to write to this
+ * block.
+ */
+ if (datasize > maxblocksize) {
+ blocksize = maxblocksize;
+ }
+ else {
+ blocksize = datasize;
+ }
+
+ /* Remember how much data remains */
+ datasize -= blocksize;
+
+ if (!use_text) {
+ args2buf(argc, argv, data, blocksize);
+ argc -= blocksize;
+ argv += blocksize;
+ }
+ else {
+ memcpy(data, argv[0] + string_offset, blocksize);
+ string_offset += blocksize;
+ }
+
+ lprintf(LOG_INFO, "Block %3" PRId16 ": %s", block,
+ buf2str_extended(data, blocksize, " "));
+
+ unused = maxblocksize - blocksize;
+ rc = ipmi_chassis_set_bootparam(intf,
+ IPMI_CHASSIS_BOOTPARAM_INIT_MBOX,
+ &mbox,
+ sizeof(mbox) - unused);
+ if (IPMI_CC_PARAM_OUT_OF_RANGE == rc) {
+ lprintf(LOG_ERR,
+ "Hit end of mailbox writing block %" PRId16,
+ block);
+ }
+ if (rc) {
+ goto complete;
+ }
}
- if (use_progress) {
- /* set-in-progress = set-complete */
- memset(flags, 0, 5);
- ipmi_chassis_set_bootparam(intf,
- IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
- flags, 1);
+ lprintf(LOG_INFO,
+ "Wrote %zu blocks of Boot Initiator Mailbox",
+ blocks);
+ chassis_bootparam_set_in_progress(intf, COMMIT_WRITE);
+
+ rc = chassis_bootparam_clear_ack(intf, BIOS_POST_ACK | OS_LOADER_ACK);
+
+complete:
+ chassis_bootparam_set_in_progress(intf, SET_COMPLETE);
+out:
+ return rc;
+}
+
+static
+int
+chassis_get_bootmailbox(struct ipmi_intf *intf,
+ int16_t block, bool use_text)
+{
+ int rc = IPMI_CC_UNSPECIFIED_ERROR;
+ char param_str[2]; /* Max "7" */
+ char block_str[4]; /* Max "255" */
+ char *bpargv[] = { param_str, block_str };
+ int flags;
+
+ flags = use_text ? BP_FLAG(MBOX_PARSE_USE_TEXT) : 0;
+
+ snprintf(param_str, sizeof(param_str),
+ "%" PRIu8, IPMI_CHASSIS_BOOTPARAM_INIT_MBOX);
+
+ if (block >= 0) {
+ snprintf(block_str, sizeof(block_str),
+ "%" PRIu8, (uint8_t)block);
+
+ rc = ipmi_chassis_get_bootparam(intf,
+ ARRAY_SIZE(bpargv),
+ bpargv,
+ flags);
+ }
+ else {
+ int currblk;
+
+ flags |= BP_FLAG(MBOX_PARSE_ALLBLOCKS);
+ for (currblk = 0; currblk <= UCHAR_MAX; ++currblk) {
+ snprintf(block_str, sizeof(block_str),
+ "%" PRIu8, (uint8_t)currblk);
+
+ if (currblk) {
+ /*
+ * If block 0 succeeded, we don't want to
+ * print generic info for each next block,
+ * and we don't want range error to be
+ * reported when we hit the end of blocks.
+ */
+ flags |= BP_FLAG(PARAM_NO_GENERIC_INFO);
+ flags |= BP_FLAG(PARAM_NO_RANGE_ERROR);
+ }
+
+ rc = ipmi_chassis_get_bootparam(intf,
+ ARRAY_SIZE(bpargv),
+ bpargv,
+ flags);
+
+ if (rc) {
+ if (currblk) {
+ rc = IPMI_CC_OK;
+ }
+ break;
+ }
+ }
}
return rc;
}
+static
+int
+chassis_bootmailbox(struct ipmi_intf *intf, int argc, char *argv[])
+{
+ int rc = IPMI_CC_UNSPECIFIED_ERROR;
+ bool use_text = false; /* Default to data dump I/O mode */
+ int16_t block = -1; /* By default print all blocks */
+ const char *cmd;
+
+ if ((argc < 1) || !strcmp(argv[0], "help")) {
+ chassis_bootmailbox_help();
+ goto out;
+ } else {
+ cmd = argv[0];
+ ++argv;
+ --argc;
+
+ if (argc > 0 && !strcmp(argv[0], "text")) {
+ use_text = true;
+ ++argv;
+ --argc;
+ }
+
+ if (argc > 0 && !strcmp(argv[0], "block")) {
+ if (argc < 2) {
+ chassis_bootmailbox_help();
+ goto out;
+ }
+ if(str2short(argv[1], &block)) {
+ lprintf(LOG_ERR,
+ "Invalid block %s", argv[1]);
+ goto out;
+ }
+ argv += 2;
+ argc -= 2;
+
+ }
+
+ if (!strcmp(cmd, "get")) {
+ rc = chassis_get_bootmailbox(intf, block, use_text);
+ }
+ else if (!strcmp(cmd, "set")) {
+ rc = chassis_set_bootmailbox(intf, block, use_text,
+ argc, argv);
+ }
+ }
+
+out:
+ return rc;
+}
+
+
static int
ipmi_chassis_power_policy(struct ipmi_intf * intf, uint8_t policy)
{
@@ -1055,11 +1603,11 @@ ipmi_chassis_power_policy(struct ipmi_intf * intf, uint8_t policy)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in Power Restore Policy command");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Power Restore Policy command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1100,25 +1648,25 @@ ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv)
int rc = 0;
uint8_t ctl = 0;
- if ((argc < 1) || (strncmp(argv[0], "help", 4) == 0)) {
+ if (argc < 1 || !strcmp(argv[0], "help")) {
lprintf(LOG_NOTICE, "chassis power Commands: status, on, off, cycle, reset, diag, soft");
return 0;
}
- if (strncmp(argv[0], "status", 6) == 0) {
+ if (!strcmp(argv[0], "status")) {
rc = ipmi_chassis_print_power_status(intf);
return rc;
}
- if ((strncmp(argv[0], "up", 2) == 0) || (strncmp(argv[0], "on", 2) == 0))
+ if (!strcmp(argv[0], "up") || !strcmp(argv[0], "on"))
ctl = IPMI_CHASSIS_CTL_POWER_UP;
- else if ((strncmp(argv[0], "down", 4) == 0) || (strncmp(argv[0], "off", 3) == 0))
+ else if (!strcmp(argv[0], "down") || !strcmp(argv[0], "off"))
ctl = IPMI_CHASSIS_CTL_POWER_DOWN;
- else if (strncmp(argv[0], "cycle", 5) == 0)
+ else if (!strcmp(argv[0], "cycle"))
ctl = IPMI_CHASSIS_CTL_POWER_CYCLE;
- else if (strncmp(argv[0], "reset", 5) == 0)
+ else if (!strcmp(argv[0], "reset"))
ctl = IPMI_CHASSIS_CTL_HARD_RESET;
- else if (strncmp(argv[0], "diag", 4) == 0)
+ else if (!strcmp(argv[0], "diag"))
ctl = IPMI_CHASSIS_CTL_PULSE_DIAG;
- else if ((strncmp(argv[0], "acpi", 4) == 0) || (strncmp(argv[0], "soft", 4) == 0))
+ else if (!strcmp(argv[0], "acpi") || !strcmp(argv[0], "soft"))
ctl = IPMI_CHASSIS_CTL_ACPI_SOFT;
else {
lprintf(LOG_ERR, "Invalid chassis power command: %s", argv[0]);
@@ -1146,55 +1694,270 @@ ipmi_chassis_set_bootflag_help()
get_bootparam_options("options=help", &set_flag, &clr_flag);
}
+/*
+ * Sugar. Macros for internal use by bootdev_parse_options() to make
+ * the structure initialization look better. Can't use scope-limited
+ * static consts for initializers with gcc5, alas.
+ */
+#define BF1_OFFSET 0
+#define BF2_OFFSET 1
+#define BF3_OFFSET 2
+#define BF4_OFFSET 3
+#define BF_BYTE_COUNT 5
+
+/* A helper for ipmi_chassis_main() to parse bootdev options */
+static
+bool
+bootdev_parse_options(char *optstring, uint8_t flags[])
+{
+ char *token;
+ char *saveptr = NULL;
+ int optionError = 0;
+
+ static const struct bootdev_opt_s {
+ char *name;
+ off_t offset;
+ unsigned char mask;
+ unsigned char value;
+ char *desc;
+ } *op;
+ static const struct bootdev_opt_s options[] = {
+ /* data 1 */
+ {
+ "valid",
+ BF1_OFFSET,
+ BF1_VALID_MASK,
+ BF1_VALID,
+ "Boot flags valid"
+ },
+ {
+ "persistent",
+ BF1_OFFSET,
+ BF1_PERSIST_MASK,
+ BF1_PERSIST,
+ "Changes are persistent for "
+ "all future boots"
+ },
+ {
+ "efiboot",
+ BF1_OFFSET,
+ BF1_BOOT_TYPE_MASK,
+ BF1_BOOT_TYPE_EFI,
+ "Extensible Firmware Interface "
+ "Boot (EFI)"
+ },
+ /* data 2 */
+ {
+ "clear-cmos",
+ BF2_OFFSET,
+ BF2_CMOS_CLEAR_MASK,
+ BF2_CMOS_CLEAR,
+ "CMOS clear"
+ },
+ {
+ "lockkbd",
+ BF2_OFFSET,
+ BF2_KEYLOCK_MASK,
+ BF2_KEYLOCK,
+ "Lock Keyboard"
+ },
+ /* data2[5:2] is parsed elsewhere */
+ {
+ "screenblank",
+ BF2_OFFSET,
+ BF2_BLANK_SCREEN_MASK,
+ BF2_BLANK_SCREEN,
+ "Screen Blank"
+ },
+ {
+ "lockoutreset",
+ BF2_OFFSET,
+ BF2_RESET_LOCKOUT_MASK,
+ BF2_RESET_LOCKOUT,
+ "Lock out Reset buttons"
+ },
+ /* data 3 */
+ {
+ "lockout_power",
+ BF3_OFFSET,
+ BF3_POWER_LOCKOUT_MASK,
+ BF3_POWER_LOCKOUT,
+ "Lock out (power off/sleep "
+ "request) via Power Button"
+ },
+ {
+ "verbose=default",
+ BF3_OFFSET,
+ BF3_VERBOSITY_MASK,
+ BF3_VERBOSITY_DEFAULT,
+ "Request quiet BIOS display"
+ },
+ {
+ "verbose=no",
+ BF3_OFFSET,
+ BF3_VERBOSITY_MASK,
+ BF3_VERBOSITY_QUIET,
+ "Request quiet BIOS display"
+ },
+ {
+ "verbose=yes",
+ BF3_OFFSET,
+ BF3_VERBOSITY_MASK,
+ BF3_VERBOSITY_VERBOSE,
+ "Request verbose BIOS display"
+ },
+ {
+ "force_pet",
+ BF3_OFFSET,
+ BF3_EVENT_TRAPS_MASK,
+ BF3_EVENT_TRAPS,
+ "Force progress event traps"
+ },
+ {
+ "upw_bypass",
+ BF3_OFFSET,
+ BF3_PASSWD_BYPASS_MASK,
+ BF3_PASSWD_BYPASS,
+ "User password bypass"
+ },
+ {
+ "lockout_sleep",
+ BF3_OFFSET,
+ BF3_SLEEP_LOCKOUT_MASK,
+ BF3_SLEEP_LOCKOUT,
+ "Lock out the Sleep button"
+ },
+ {
+ "cons_redirect=default",
+ BF3_OFFSET,
+ BF3_CONSOLE_REDIR_MASK,
+ BF3_CONSOLE_REDIR_DEFAULT,
+ "Console redirection occurs per "
+ "BIOS configuration setting"
+ },
+ {
+ "cons_redirect=skip",
+ BF3_OFFSET,
+ BF3_CONSOLE_REDIR_MASK,
+ BF3_CONSOLE_REDIR_SUPPRESS,
+ "Suppress (skip) console "
+ "redirection if enabled"
+ },
+ {
+ "cons_redirect=enable",
+ BF3_OFFSET,
+ BF3_CONSOLE_REDIR_MASK,
+ BF3_CONSOLE_REDIR_ENABLE,
+ "Request console redirection "
+ "be enabled"
+ },
+ /* data 4 */
+ /* data4[7:4] reserved */
+ /* data4[3] BIOS Shared Mode Override, not implemented here */
+ /* data4[2:0] BIOS Mux Control Override, not implemented here */
+
+ /* data5 reserved */
+
+ {NULL} /* End marker */
+ };
+
+ memset(&flags[0], 0, BF_BYTE_COUNT);
+ token = strtok_r(optstring, ",", &saveptr);
+ while (token) {
+ if (!strcmp(token, "help")) {
+ optionError = 1;
+ break;
+ }
+ for (op = options; op->name; ++op) {
+ if (!strcmp(token, op->name)) {
+ flags[op->offset] &= ~(op->mask);
+ flags[op->offset] |= op->value;
+ break;
+ }
+ }
+ if (!op->name) {
+ /* Option not found */
+ optionError = 1;
+ lprintf(LOG_ERR, "Invalid option: %s", token);
+ }
+ token = strtok_r(NULL, ",", &saveptr);
+ }
+ if (optionError) {
+ lprintf(LOG_NOTICE, "Legal options settings are:");
+ lprintf(LOG_NOTICE, " %-22s: %s",
+ "help",
+ "print this message");
+ for (op = options; op->name; ++op) {
+ lprintf(LOG_NOTICE, " %-22s: %s", op->name, op->desc);
+ }
+ return false;
+ }
+
+ return true;
+}
+
int
ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
{
- int rc = 0;
+ int rc = -1;
- if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
- lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest");
+ if (!argc || !strcmp(argv[0], "help")) {
+ lprintf(LOG_NOTICE, "Chassis Commands:\n"
+ " status, power, policy, restart_cause\n"
+ " poh, identify, selftest,\n"
+ " bootdev, bootparam, bootmbox");
}
- else if (strncmp(argv[0], "status", 6) == 0) {
+ else if (!strcmp(argv[0], "status")) {
rc = ipmi_chassis_status(intf);
}
- else if (strncmp(argv[0], "selftest", 8) == 0) {
+ else if (!strcmp(argv[0], "selftest")) {
rc = ipmi_chassis_selftest(intf);
}
- else if (strncmp(argv[0], "power", 5) == 0) {
+ else if (!strcmp(argv[0], "power")) {
uint8_t ctl = 0;
- if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
+ if (argc < 2 || !strcmp(argv[1], "help")) {
lprintf(LOG_NOTICE, "chassis power Commands: status, on, off, cycle, reset, diag, soft");
- return 0;
+ rc = 0;
+ goto out;
}
- if (strncmp(argv[1], "status", 6) == 0) {
+ if (!strcmp(argv[1], "status")) {
rc = ipmi_chassis_print_power_status(intf);
- return rc;
+ goto out;
}
- if ((strncmp(argv[1], "up", 2) == 0) || (strncmp(argv[1], "on", 2) == 0))
+ if (!strcmp(argv[1], "up") ||
+ !strcmp(argv[1], "on"))
+ {
ctl = IPMI_CHASSIS_CTL_POWER_UP;
- else if ((strncmp(argv[1], "down", 4) == 0) || (strncmp(argv[1], "off", 3) == 0))
+ }
+ else if (!strcmp(argv[1], "down") ||
+ !strcmp(argv[1], "off"))
+ {
ctl = IPMI_CHASSIS_CTL_POWER_DOWN;
- else if (strncmp(argv[1], "cycle", 5) == 0)
+ }
+ else if (!strcmp(argv[1], "cycle"))
ctl = IPMI_CHASSIS_CTL_POWER_CYCLE;
- else if (strncmp(argv[1], "reset", 5) == 0)
+ else if (!strcmp(argv[1], "reset"))
ctl = IPMI_CHASSIS_CTL_HARD_RESET;
- else if (strncmp(argv[1], "diag", 4) == 0)
+ else if (!strcmp(argv[1], "diag"))
ctl = IPMI_CHASSIS_CTL_PULSE_DIAG;
- else if ((strncmp(argv[1], "acpi", 4) == 0) || (strncmp(argv[1], "soft", 4) == 0))
+ else if (!strcmp(argv[1], "acpi") ||
+ !strcmp(argv[1], "soft"))
+ {
ctl = IPMI_CHASSIS_CTL_ACPI_SOFT;
+ }
else {
lprintf(LOG_ERR, "Invalid chassis power command: %s", argv[1]);
- return -1;
+ goto out;
}
rc = ipmi_chassis_power_control(intf, ctl);
}
- else if (strncmp(argv[0], "identify", 8) == 0) {
+ else if (!strcmp(argv[0], "identify")) {
if (argc < 2) {
rc = ipmi_chassis_identify(intf, NULL);
}
- else if (strncmp(argv[1], "help", 4) == 0) {
+ else if (!strcmp(argv[1], "help")) {
lprintf(LOG_NOTICE, "chassis identify <interval>");
lprintf(LOG_NOTICE, " default is 15 seconds");
lprintf(LOG_NOTICE, " 0 to turn off");
@@ -1203,14 +1966,14 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = ipmi_chassis_identify(intf, argv[1]);
}
}
- else if (strncmp(argv[0], "poh", 3) == 0) {
+ else if (!strcmp(argv[0], "poh")) {
rc = ipmi_chassis_poh(intf);
}
- else if (strncmp(argv[0], "restart_cause", 13) == 0) {
+ else if (!strcmp(argv[0], "restart_cause")) {
rc = ipmi_chassis_restart_cause(intf);
}
- else if (strncmp(argv[0], "policy", 4) == 0) {
- if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
+ else if (!strcmp(argv[0], "policy")) {
+ if (argc < 2 || !strcmp(argv[1], "help")) {
lprintf(LOG_NOTICE, "chassis policy <state>");
lprintf(LOG_NOTICE, " list : return supported policies");
lprintf(LOG_NOTICE, " always-on : turn on when power is restored");
@@ -1218,13 +1981,13 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, " always-off : stay off after power is restored");
} else {
uint8_t ctl;
- if (strncmp(argv[1], "list", 4) == 0)
+ if (!strcmp(argv[1], "list"))
ctl = IPMI_CHASSIS_POLICY_NO_CHANGE;
- else if (strncmp(argv[1], "always-on", 9) == 0)
+ else if (!strcmp(argv[1], "always-on"))
ctl = IPMI_CHASSIS_POLICY_ALWAYS_ON;
- else if (strncmp(argv[1], "previous", 8) == 0)
+ else if (!strcmp(argv[1], "previous"))
ctl = IPMI_CHASSIS_POLICY_PREVIOUS;
- else if (strncmp(argv[1], "always-off", 10) == 0)
+ else if (!strcmp(argv[1], "always-off"))
ctl = IPMI_CHASSIS_POLICY_ALWAYS_OFF;
else {
lprintf(LOG_ERR, "Invalid chassis policy: %s", argv[1]);
@@ -1233,21 +1996,26 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = ipmi_chassis_power_policy(intf, ctl);
}
}
- else if (strncmp(argv[0], "bootparam", 9) == 0) {
- if ((argc < 3) || (strncmp(argv[1], "help", 4) == 0)) {
+ else if (!strcmp(argv[0], "bootparam")) {
+ if (argc < 3 || !strcmp(argv[1], "help")) {
lprintf(LOG_NOTICE, "bootparam get <param #>");
ipmi_chassis_set_bootflag_help();
}
else {
- if (strncmp(argv[1], "get", 3) == 0) {
- rc = ipmi_chassis_get_bootparam(intf, argv[2]);
+ if (!strcmp(argv[1], "get")) {
+ rc = ipmi_chassis_get_bootparam(intf,
+ argc - 2,
+ argv + 2,
+ 0);
}
- else if (strncmp(argv[1], "set", 3) == 0) {
+ else if (!strcmp(argv[1], "set")) {
unsigned char set_flag=0;
unsigned char clr_flag=0;
- if (strncmp(argv[2], "help", 4) == 0 ||
- argc < 4 || (argc >= 4 &&
- strncmp(argv[2], "bootflag", 8) != 0)) {
+ if (!strcmp(argv[2], "help")
+ || argc < 4
+ || (argc >= 4
+ && strcmp(argv[2], "bootflag")))
+ {
ipmi_chassis_set_bootflag_help();
} else {
if (argc == 5) {
@@ -1263,8 +2031,8 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, "bootparam get|set <option> [value ...]");
}
}
- else if (strncmp(argv[0], "bootdev", 7) == 0) {
- if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
+ else if (!strcmp(argv[0], "bootdev")) {
+ if (argc < 2 || !strcmp(argv[1], "help")) {
lprintf(LOG_NOTICE, "bootdev <device> [clear-cmos=yes|no]");
lprintf(LOG_NOTICE, "bootdev <device> [options=help,...]");
lprintf(LOG_NOTICE, " none : Do not change boot device order");
@@ -1276,114 +2044,39 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, " bios : Force boot into BIOS Setup");
lprintf(LOG_NOTICE, " floppy: Force boot from Floppy/primary removable media");
} else {
- if (argc < 3)
- rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
- else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
- if (strncmp(argv[2]+11, "yes", 3) == 0) {
- uint8_t flags[5] = {0, (1<<7), 0, 0, 0};
- rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
- } else
- rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
- }
- else if (strncmp(argv[2], "options=", 8) == 0) {
- char *token;
- char *saveptr = NULL;
- int optionError = 0;
- unsigned char flags[5];
- static struct {
- char *name;
- int i;
- unsigned char mask;
- unsigned char value;
- char *desc;
- } options[] = {
- /* data 1 */
- {"valid", 0, (1<<7), (1<<7),
- "Boot flags valid"},
- {"persistent", 0, (1<<6), (1<<6),
- "Changes are persistent for all future boots"},
- {"efiboot", 0, (1<<5), (1<<5),
- "Extensible Firmware Interface Boot (EFI)"},
- /* data 2 */
- {"clear-cmos", 1, (1<<7), (1<<7),
- "CMOS clear"},
- {"lockkbd", 1, (1<<6), (1<<6),
- "Lock Keyboard"},
- /* data2[5:2] is parsed elsewhere */
- {"screenblank", 1, (1<<1), (1<<1),
- "Screen Blank"},
- {"lockoutreset", 1, (1<<0), (1<<0),
- "Lock out Resetbuttons"},
- /* data 3 */
- {"lockout_power", 2, (1<<7), (1<<7),
- "Lock out (power off/sleep request) via Power Button"},
- {"verbose=default", 2, (3<<5), (0<<5),
- "Request quiet BIOS display"},
- {"verbose=no", 2, (3<<5), (1<<5),
- "Request quiet BIOS display"},
- {"verbose=yes", 2, (3<<5), (2<<5),
- "Request verbose BIOS display"},
- {"force_pet", 2, (1<<4), (1<<4),
- "Force progress event traps"},
- {"upw_bypass", 2, (1<<3), (1<<3),
- "User password bypass"},
- {"lockout_sleep", 2, (1<<2), (1<<2),
- "Log Out Sleep Button"},
- {"cons_redirect=default", 2, (3<<0), (0<<0),
- "Console redirection occurs per BIOS configuration setting"},
- {"cons_redirect=skip", 2, (3<<0), (1<<0),
- "Suppress (skip) console redirection if enabled"},
- {"cons_redirect=enable", 2, (3<<0), (2<<0),
- "Suppress (skip) console redirection if enabled"},
- /* data 4 */
- /* data4[7:4] reserved */
- /* data4[3] BIOS Shared Mode Override, not implemented here */
- /* data4[2:0] BIOS Mux Control Override, not implemented here */
-
- /* data5 reserved */
-
- {NULL} /* End marker */
- }, *op;
-
- memset(&flags[0], 0, sizeof(flags));
- token = strtok_r(argv[2] + 8, ",", &saveptr);
- while (token != NULL) {
- if (strcmp(token, "help") == 0) {
- optionError = 1;
- break;
- }
- for (op = options; op->name != NULL; ++op) {
- if (strcmp(token, op->name) == 0) {
- flags[op->i] &= op->mask;
- flags[op->i] |= op->value;
- break;
- }
+ static const char *kw = "options=";
+ char *optstr = NULL;
+ uint8_t flags[BF_BYTE_COUNT];
+ bool use_flags = false;
+
+ if (argc >= 3) {
+ if (!strcmp(argv[2], "clear-cmos=yes")) {
+ /* Exclusive clear-cmos, no other flags */
+ optstr = "clear-cmos";
}
- if (op->name == NULL) {
- /* Option not found */
- optionError = 1;
- lprintf(LOG_ERR, "Invalid option: %s", token);
+ else if (!strncmp(argv[2], kw, strlen(kw))) {
+ optstr = argv[2] + strlen(kw);
}
- token = strtok_r(NULL, ",", &saveptr);
}
- if (optionError) {
- lprintf(LOG_NOTICE, "Legal options settings are:");
- lprintf(LOG_NOTICE, "\thelp:\tprint this message");
- for (op = options; op->name != NULL; ++op) {
- lprintf(LOG_NOTICE, "\t%s:\t%s", op->name, op->desc);
- }
- return (-1);
+ if (optstr) {
+ if (!bootdev_parse_options(optstr, flags))
+ goto out;
+
+ use_flags = true;
}
- rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
- }
- else
- rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
+ rc = ipmi_chassis_set_bootdev(intf, argv[1],
+ use_flags
+ ? flags
+ : NULL);
}
}
+ else if (!strcmp(argv[0], "bootmbox")) {
+ rc = chassis_bootmailbox(intf, argc -1, argv + 1);
+ }
else {
- lprintf(LOG_ERR, "Invalid Chassis command: %s", argv[0]);
- return -1;
+ lprintf(LOG_ERR, "Invalid chassis command: %s", argv[0]);
}
+out:
return rc;
}
diff --git a/lib/ipmi_dcmi.c b/lib/ipmi_dcmi.c
index 2cfe48f..8ed87a9 100755..100644
--- a/lib/ipmi_dcmi.c
+++ b/lib/ipmi_dcmi.c
@@ -36,7 +36,6 @@
* This code conforms to the 1.0 DCMI Specification
* released by Hari Ramachandran of the Intel Corporation
*/
-#define _BSD_SOURCE
#include <stdlib.h>
#include <string.h>
@@ -57,6 +56,7 @@
#include <ipmitool/ipmi_entity.h>
#include <ipmitool/ipmi_constants.h>
#include <ipmitool/ipmi_sensor.h>
+#include <ipmitool/ipmi_time.h>
#include "../src/plugins/lanplus/lanplus.h"
@@ -74,31 +74,40 @@ static int ipmi_print_sensor_info(struct ipmi_intf *intf, uint16_t rec_id);
* to change a lot of the code in the main(). *
******************************************************************************/
+/*
+ * This is a termination macro for all struct dcmi_cmd arrays,
+ * def argument is the default value returned by str2val2()
+ * when string is not found in the array
+ */
+#define DCMI_CMD_END(def) { (def), NULL, NULL }
+
/* Main set of DCMI commands */
const struct dcmi_cmd dcmi_cmd_vals[] = {
- { 0x00, "discover", " Used to discover supported DCMI capabilities" },
- { 0x01, "power", " Platform power limit command options" },
- { 0x02, "sensors", " Prints the available DCMI sensors" },
- { 0x03, "asset_tag", " Prints the platform's asset tag" },
- { 0x04, "set_asset_tag", " Sets the platform's asset tag" },
- { 0x05, "get_mc_id_string", " Get management controller ID string" },
- { 0x06, "set_mc_id_string", " Set management controller ID string" },
- { 0x07, "thermalpolicy", " Thermal policy get/set" },
- { 0x08, "get_temp_reading", " Get Temperature Readings" },
- { 0x09, "get_conf_param", " Get DCMI Config Parameters" },
- { 0x0A, "set_conf_param", " Set DCMI Config Parameters" },
- { 0x0B, "oob_discover", " Ping/Pong Message for DCMI Discovery" },
- { 0xFF, NULL, NULL }
+ { 0x00, "discover", "Used to discover supported DCMI capabilities" },
+ { 0x01, "power", "Platform power limit command options" },
+ { 0x02, "sensors", "Prints the available DCMI sensors" },
+ { 0x03, "asset_tag", "Prints the platform's asset tag" },
+ { 0x04, "set_asset_tag", "Sets the platform's asset tag" },
+ { 0x05, "get_mc_id_string", "Get management controller ID string" },
+ { 0x06, "set_mc_id_string", "Set management controller ID string" },
+ { 0x07, "thermalpolicy", "Thermal policy get/set" },
+ { 0x08, "get_temp_reading", "Get Temperature Readings" },
+ { 0x09, "get_conf_param", "Get DCMI Config Parameters" },
+ { 0x0A, "set_conf_param", "Set DCMI Config Parameters" },
+ { 0x0B, "oob_discover", "Ping/Pong Message for DCMI Discovery" },
+
+ DCMI_CMD_END(0xFF)
};
-/* get capabilites */
+/* get capabilities */
const struct dcmi_cmd dcmi_capable_vals[] = {
- { 0x01, "platform", " Lists the system capabilities" },
+ { 0x01, "platform", "Lists the system capabilities" },
{ 0x02, "mandatory_attributes", "Lists SEL, identification and"
- "temperature attributes" },
- { 0x03, "optional_attributes", " Lists power capabilities" },
- { 0x04, "managebility access", " Lists OOB channel information" },
- { 0xFF, NULL, NULL }
+ "temperature attributes" },
+ { 0x03, "optional_attributes", "Lists power capabilities" },
+ { 0x04, "managebility access", "Lists OOB channel information" },
+
+ DCMI_CMD_END(0xFF)
};
/* platform capabilities
@@ -107,54 +116,60 @@ const struct dcmi_cmd dcmi_capable_vals[] = {
*/
const struct dcmi_cmd dcmi_mandatory_platform_capabilities[] = {
{ 0x01, "Identification support available", "" },
- { 0x02, "SEL logging available", "" },
- { 0x03, "Chassis power available", "" },
- { 0x04, "Temperature monitor available", "" },
- { 0xFF, NULL, NULL }
+ { 0x02, "SEL logging available", "" },
+ { 0x03, "Chassis power available", "" },
+ { 0x04, "Temperature monitor available", "" },
+
+ DCMI_CMD_END(0xFF)
};
/* optional capabilities */
const struct dcmi_cmd dcmi_optional_platform_capabilities[] = {
- { 0x01, "Power management available", "" },
- { 0xFF, NULL, NULL }
+ { 0x01, "Power management available", "" },
+
+ DCMI_CMD_END(0xFF)
};
-/* access capabilties */
+/* access capabilities */
const struct dcmi_cmd dcmi_management_access_capabilities[] = {
- { 0x01, "In-band KCS channel available", "" },
- { 0x02, "Out-of-band serial TMODE available", "" },
+ { 0x01, "In-band KCS channel available", "" },
+ { 0x02, "Out-of-band serial TMODE available", "" },
{ 0x03, "Out-of-band secondary LAN channel available", "" },
- { 0x04, "Out-of-band primary LAN channel available", "" },
- { 0x05, "SOL enabled", "" },
- { 0x06, "VLAN capable", "" },
- { 0xFF, NULL, NULL }
+ { 0x04, "Out-of-band primary LAN channel available", "" },
+ { 0x05, "SOL enabled", "" },
+ { 0x06, "VLAN capable", "" },
+
+ DCMI_CMD_END(0xFF)
};
/* identification capabilities */
const struct dcmi_cmd dcmi_id_capabilities_vals[] = {
- { 0x01, "GUID", "" },
+ { 0x01, "GUID", "" },
{ 0x02, "DHCP hostname", "" },
- { 0x03, "Asset tag", "" },
- { 0xFF, NULL, NULL }
+ { 0x03, "Asset tag", "" },
+
+ DCMI_CMD_END(0xFF)
};
/* Configuration parameters*/
const struct dcmi_cmd dcmi_conf_param_vals[] = {
- { 0x01, "activate_dhcp", "\tActivate DHCP"},
- { 0x02, "dhcp_config", "\tDHCP Configuration" },
- { 0x03, "init", "\t\tInitial timeout interval" },
- { 0x04, "timeout", "\t\tServer contact timeout interval" },
- { 0x05, "retry", "\t\tServer contact retry interval" },
- { 0xFF, NULL, NULL }
+ { 0x01, "activate_dhcp", "\tActivate DHCP" },
+ { 0x02, "dhcp_config", "\tDHCP Configuration" },
+ { 0x03, "init", "\t\tInitial timeout interval" },
+ { 0x04, "timeout", "\t\tServer contact timeout interval" },
+ { 0x05, "retry", "\t\tServer contact retry interval" },
+
+ DCMI_CMD_END(0xFF)
};
/* temperature monitoring capabilities */
const struct dcmi_cmd dcmi_temp_monitoring_vals[] = {
- { 0x01, "inlet", " Inlet air temperature sensors" },
- { 0x02, "cpu", " CPU temperature sensors" },
- { 0x03, "baseboard", "Baseboard temperature sensors" },
- { 0xff, NULL, NULL }
+ { 0x01, "inlet", "Inlet air temperature sensors" },
+ { 0x02, "cpu", "CPU temperature sensors" },
+ { 0x03, "baseboard", "Baseboard temperature sensors" },
+
+ DCMI_CMD_END(0xFF)
};
/* These are not comands. These are the DCMI temp sensors and their numbers
@@ -162,113 +177,121 @@ const struct dcmi_cmd dcmi_temp_monitoring_vals[] = {
* sensor number
*/
const struct dcmi_cmd dcmi_discvry_snsr_vals[] = {
- { 0x40, "Inlet", " Inlet air temperature sensors" },
- { 0x41, "CPU", " CPU temperature sensors" },
- { 0x42, "Baseboard", "Baseboard temperature sensors" },
- { 0xff, NULL, NULL }
+ { 0x40, "Inlet", "Inlet air temperature sensors" },
+ { 0x41, "CPU", "CPU temperature sensors" },
+ { 0x42, "Baseboard", "Baseboard temperature sensors" },
+
+ DCMI_CMD_END(0xFF)
};
/* Temperature Readings */
const struct dcmi_cmd dcmi_temp_read_vals[] = {
- { 0x40, "Inlet", "Inlet air temperature(40h) " },
- { 0x41, "CPU", "CPU temperature sensors(41h) " },
- { 0x42, "Baseboard", "Baseboard temperature sensors(42h) " },
- { 0xff, NULL, NULL }
+ { 0x40, "Inlet", "Inlet air temperature(40h)" },
+ { 0x41, "CPU", "CPU temperature sensors(41h)" },
+ { 0x42, "Baseboard", "Baseboard temperature sensors(42h)" },
+
+ DCMI_CMD_END(0xFF)
};
/* power management/control commands */
const struct dcmi_cmd dcmi_pwrmgmt_vals[] = {
- { 0x00, "reading", " Get power related readings from the system" },
- { 0x01, "get_limit", " Get the configured power limits" },
- { 0x02, "set_limit", " Set a power limit option" },
- { 0x03, "activate", " Activate the set power limit" },
- { 0x04, "deactivate", "Deactivate the set power limit" },
- { 0xFF, NULL, NULL }
+ { 0x00, "reading", "Get power related readings from the system" },
+ { 0x01, "get_limit", "Get the configured power limits" },
+ { 0x02, "set_limit", "Set a power limit option" },
+ { 0x03, "activate", "Activate the set power limit" },
+ { 0x04, "deactivate", "Deactivate the set power limit" },
+
+ DCMI_CMD_END(0xFF)
};
/* set power limit commands */
const struct dcmi_cmd dcmi_pwrmgmt_set_usage_vals[] = {
- { 0x00, "action", " <no_action | sel_logging | power_off>" },
- { 0x01, "limit", " <number in Watts>" },
+ { 0x00, "action", "<no_action | sel_logging | power_off>" },
+ { 0x01, "limit", "<number in Watts>" },
{ 0x02, "correction", "<number in milliseconds>" },
- { 0x03, "sample", " <number in seconds>" },
- { 0xFF, NULL, NULL }
+ { 0x03, "sample", "<number in seconds>" },
+
+ DCMI_CMD_END(0xFF)
};
/* power management/get action commands */
const struct dcmi_cmd dcmi_pwrmgmt_get_action_vals[] = {
- { 0x00, "No Action", ""},
- { 0x01, "Hard Power Off & Log Event to SEL", ""},
-
- { 0x02, "OEM reserved (02h)", ""},
- { 0x03, "OEM reserved (03h)", ""},
- { 0x04, "OEM reserved (04h)", ""},
- { 0x05, "OEM reserved (05h)", ""},
- { 0x06, "OEM reserved (06h)", ""},
- { 0x07, "OEM reserved (07h)", ""},
- { 0x08, "OEM reserved (08h)", ""},
- { 0x09, "OEM reserved (09h)", ""},
- { 0x0a, "OEM reserved (0ah)", ""},
- { 0x0b, "OEM reserved (0bh)", ""},
- { 0x0c, "OEM reserved (0ch)", ""},
- { 0x0d, "OEM reserved (0dh)", ""},
- { 0x0e, "OEM reserved (0eh)", ""},
- { 0x0f, "OEM reserved (0fh)", ""},
- { 0x10, "OEM reserved (10h)", ""},
-
- { 0x11, "Log Event to SEL", ""},
- { 0xFF, NULL, NULL }
+ { 0x00, "No Action", "" },
+ { 0x01, "Hard Power Off & Log Event to SEL", "" },
+
+ { 0x02, "OEM reserved (02h)", "" },
+ { 0x03, "OEM reserved (03h)", "" },
+ { 0x04, "OEM reserved (04h)", "" },
+ { 0x05, "OEM reserved (05h)", "" },
+ { 0x06, "OEM reserved (06h)", "" },
+ { 0x07, "OEM reserved (07h)", "" },
+ { 0x08, "OEM reserved (08h)", "" },
+ { 0x09, "OEM reserved (09h)", "" },
+ { 0x0a, "OEM reserved (0ah)", "" },
+ { 0x0b, "OEM reserved (0bh)", "" },
+ { 0x0c, "OEM reserved (0ch)", "" },
+ { 0x0d, "OEM reserved (0dh)", "" },
+ { 0x0e, "OEM reserved (0eh)", "" },
+ { 0x0f, "OEM reserved (0fh)", "" },
+ { 0x10, "OEM reserved (10h)", "" },
+
+ { 0x11, "Log Event to SEL", "" },
+
+ DCMI_CMD_END(0xFF)
};
/* power management/set action commands */
const struct dcmi_cmd dcmi_pwrmgmt_action_vals[] = {
- { 0x00, "no_action", "No Action"},
- { 0x01, "power_off", "Hard Power Off & Log Event to SEL"},
- { 0x11, "sel_logging", "Log Event to SEL"},
-
- { 0x02, "oem_02", "OEM reserved (02h)"},
- { 0x03, "oem_03", "OEM reserved (03h)"},
- { 0x04, "oem_04", "OEM reserved (04h)"},
- { 0x05, "oem_05", "OEM reserved (05h)"},
- { 0x06, "oem_06", "OEM reserved (06h)"},
- { 0x07, "oem_07", "OEM reserved (07h)"},
- { 0x08, "oem_08", "OEM reserved (08h)"},
- { 0x09, "oem_09", "OEM reserved (09h)"},
- { 0x0a, "oem_0a", "OEM reserved (0ah)"},
- { 0x0b, "oem_0b", "OEM reserved (0bh)"},
- { 0x0c, "oem_0c", "OEM reserved (0ch)"},
- { 0x0d, "oem_0d", "OEM reserved (0dh)"},
- { 0x0e, "oem_0e", "OEM reserved (0eh)"},
- { 0x0f, "oem_0f", "OEM reserved (0fh)"},
- { 0x10, "oem_10", "OEM reserved (10h)"},
-
- { 0xFF, NULL, NULL }
+ { 0x00, "no_action", "No Action" },
+ { 0x01, "power_off", "Hard Power Off & Log Event to SEL" },
+ { 0x11, "sel_logging", "Log Event to SEL" },
+
+ { 0x02, "oem_02", "OEM reserved (02h)" },
+ { 0x03, "oem_03", "OEM reserved (03h)" },
+ { 0x04, "oem_04", "OEM reserved (04h)" },
+ { 0x05, "oem_05", "OEM reserved (05h)" },
+ { 0x06, "oem_06", "OEM reserved (06h)" },
+ { 0x07, "oem_07", "OEM reserved (07h)" },
+ { 0x08, "oem_08", "OEM reserved (08h)" },
+ { 0x09, "oem_09", "OEM reserved (09h)" },
+ { 0x0a, "oem_0a", "OEM reserved (0ah)" },
+ { 0x0b, "oem_0b", "OEM reserved (0bh)" },
+ { 0x0c, "oem_0c", "OEM reserved (0ch)" },
+ { 0x0d, "oem_0d", "OEM reserved (0dh)" },
+ { 0x0e, "oem_0e", "OEM reserved (0eh)" },
+ { 0x0f, "oem_0f", "OEM reserved (0fh)" },
+ { 0x10, "oem_10", "OEM reserved (10h)" },
+
+ DCMI_CMD_END(0xFF)
};
/* thermal policy action commands */
const struct dcmi_cmd dcmi_thermalpolicy_vals[] = {
- { 0x00, "get", "Get thermal policy" },
- { 0x01, "set", "Set thermal policy" },
- { 0xFF, NULL, NULL }
+ { 0x00, "get", "Get thermal policy" },
+ { 0x01, "set", "Set thermal policy" },
+
+ DCMI_CMD_END(0xFF)
};
/* thermal policy action commands */
const struct dcmi_cmd dcmi_confparameters_vals[] = {
- { 0x00, "get", "Get configuration parameters" },
- { 0x01, "set", "Set configuration parameters" },
- { 0xFF, NULL, NULL }
+ { 0x00, "get", "Get configuration parameters" },
+ { 0x01, "set", "Set configuration parameters" },
+
+ DCMI_CMD_END(0xFF)
};
/* entityIDs used in thermap policy */
const struct dcmi_cmd dcmi_thermalpolicy_set_parameters_vals[] = {
- { 0x00, "volatile", " Current Power Cycle" },
- { 0x01, "nonvolatile", "Set across power cycles" },
- { 0x01, "poweroff", " Hard Power Off system" },
- { 0x00, "nopoweroff", " No 'Hard Power Off' action" },
- { 0x01, "sel", " Log event to SEL" },
- { 0x00, "nosel", " No 'Log event to SEL' action" },
- { 0x00, "disabled", " Disabled" },
- { 0x00, NULL, NULL }
+ { 0x00, "volatile", "Current Power Cycle" },
+ { 0x01, "nonvolatile", "Set across power cycles" },
+ { 0x01, "poweroff", "Hard Power Off system" },
+ { 0x00, "nopoweroff", "No 'Hard Power Off' action" },
+ { 0x01, "sel", "Log event to SEL" },
+ { 0x00, "nosel", "No 'Log event to SEL' action" },
+ { 0x00, "disabled", "Disabled" },
+
+ DCMI_CMD_END(0)
};
@@ -301,54 +324,59 @@ const struct valstr dcmi_ccode_vals[] = {
*/
const struct dcmi_cmd dcmi_sampling_vals[] = {
- { 0x05, "5_sec", "" },
+ { 0x05, "5_sec", "" },
{ 0x0f, "15_sec", "" },
{ 0x1E, "30_sec", "" },
- { 0x41, "1_min", "" },
- { 0x43, "3_min", "" },
- { 0x47, "7_min", "" },
+ { 0x41, "1_min", "" },
+ { 0x43, "3_min", "" },
+ { 0x47, "7_min", "" },
{ 0x4F, "15_min", "" },
{ 0x5E, "30_min", "" },
- { 0x81, "1_hour", ""},
- { 0x00, NULL, NULL },
+ { 0x81, "1_hour", "" },
+
+ DCMI_CMD_END(0)
};
/* Primary Node Manager commands */
const struct dcmi_cmd nm_cmd_vals[] = {
- { 0x00, "discover", "Discover Node Manager " },
+ { 0x00, "discover", "Discover Node Manager" },
{ 0x01, "capability", "Get Node Manager Capabilities" },
- { 0x02, "control", "Enable/Disable Policy Control" },
- { 0x03, "policy", "Add/Remove Policies" },
+ { 0x02, "control", "Enable/Disable Policy Control" },
+ { 0x03, "policy", "Add/Remove Policies" },
{ 0x04, "statistics", "Get Statistics" },
- { 0x05, "power", "Set Power Draw Range" },
- { 0x06, "suspend", "Set/Get Policy suspend periods" },
- { 0x07, "reset", "Reset Statistics" },
- { 0x08, "alert", "Set/Get/Clear Alert destination" },
- { 0x09, "threshold", "Set/Get Alert Thresholds" },
- { 0xFF, NULL, NULL },
+ { 0x05, "power", "Set Power Draw Range" },
+ { 0x06, "suspend", "Set/Get Policy suspend periods" },
+ { 0x07, "reset", "Reset Statistics" },
+ { 0x08, "alert", "Set/Get/Clear Alert destination" },
+ { 0x09, "threshold", "Set/Get Alert Thresholds" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_ctl_cmds[] = {
- { 0x01, "enable", " <control scope>" },
- { 0x00, "disable", "<control scope>"},
- { 0xFF, NULL, NULL },
+ { 0x01, "enable", "<control scope>" },
+ { 0x00, "disable", "<control scope>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_ctl_domain[] = {
- { 0x00, "global", "" },
+ { 0x00, "global", "" },
{ 0x02, "per_domain", "<platform|CPU|Memory> (default is platform)" },
- { 0x04, "per_policy", "<0-7>" },
- { 0xFF, NULL, NULL },
+ { 0x04, "per_policy", "<0-255>" },
+
+ DCMI_CMD_END(0xFF),
};
/* Node Manager Domain codes */
const struct dcmi_cmd nm_domain_vals[] = {
- { 0x00, "platform", "" },
- { 0x01, "CPU", "" },
- { 0x02, "Memory", "" },
+ { 0x00, "platform", "" },
+ { 0x01, "CPU", "" },
+ { 0x02, "Memory", "" },
{ 0x03, "protection", "" },
- { 0x04, "I/O", "" },
- { 0xFF, NULL, NULL },
+ { 0x04, "I/O", "" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_version_vals[] = {
@@ -357,76 +385,90 @@ const struct dcmi_cmd nm_version_vals[] = {
{ 0x03, "2.0", "" },
{ 0x04, "2.5", "" },
{ 0x05, "3.0", "" },
- { 0xFF, NULL, NULL },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_capability_opts[] = {
- { 0x01, "domain", "<platform|CPU|Memory> (default is platform)" },
- { 0x02, "inlet", "Inlet temp trigger" },
+ { 0x01, "domain", "<platform|CPU|Memory> (default is platform)" },
+ { 0x02, "inlet", "Inlet temp trigger" },
{ 0x03, "missing", "Missing Power reading trigger" },
- { 0x04, "reset", "Time after Host reset trigger" },
- { 0x05, "boot", "Boot time policy" },
- { 0xFF, NULL, NULL },
+ { 0x04, "reset", "Time after Host reset trigger" },
+ { 0x05, "boot", "Boot time policy" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_policy_type_vals[] = {
- { 0x00, "No trigger, use Power Limit", "" },
- { 0x01, "Inlet temp trigger", "" },
- { 0x02, "Missing Power reading trigger", "" },
- { 0x03, "Time after Host reset trigger", "" },
+ { 0x00, "No trigger, use Power Limit", "" },
+ { 0x01, "Inlet temp trigger", "" },
+ { 0x02, "Missing Power reading trigger", "" },
+ { 0x03, "Time after Host reset trigger", "" },
{ 0x04, "number of cores to disable at boot time", "" },
- { 0xFF, NULL, NULL },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_stats_opts[] = {
- { 0x01, "domain", "<platform|CPU|Memory> (default is platform)" },
- { 0x02, "policy_id", "<0-7>" },
- { 0xFF, NULL, NULL },
+ { 0x01, "domain", "<platform|CPU|Memory> (default is platform)" },
+ { 0x02, "policy_id", "<0-255>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_stats_mode[] = {
- { 0x01, "power", "global power" },
- { 0x02, "temps", "inlet temperature" },
- { 0x11, "policy_power", "per policy power" },
- { 0x12, "policy_temps", "per policy inlet temp" },
- { 0x13, "policy_throt", "per policy throttling stats" },
- { 0x1B, "requests", "unhandled requests" },
- { 0x1C, "response", "response time" },
+ { 0x01, "power", "global power" },
+ { 0x02, "temps", "inlet temperature" },
+ { 0x11, "policy_power", "per policy power" },
+ { 0x12, "policy_temps", "per policy inlet temp" },
+ { 0x13, "policy_throt", "per policy throttling stats" },
+ { 0x1B, "requests", "unhandled requests" },
+ { 0x1C, "response", "response time" },
{ 0x1D, "cpu_throttling", "CPU throttling" },
{ 0x1E, "mem_throttling", "memory throttling" },
- { 0x1F, "comm_fail", "host communication failures" },
- { 0xFF, NULL, NULL },
+ { 0x1F, "comm_fail", "host communication failures" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_policy_action[] = {
- { 0x00, "get", "nm policy get policy_id <0-7> [domain <platform|CPU|Memory>]" },
- { 0x04, "add", "nm policy add policy_id <0-7> [domain <platform|CPU|Memory>] correction auto|soft|hard power <watts>|inlet <temp> trig_lim <param> stats <seconds> enable|disable" },
- { 0x05, "remove", "nm policy remove policy_id <0-7> [domain <platform|CPU|Memory>]" },
+ { 0x00, "get", "nm policy get policy_id <0-255> "
+ "[domain <platform|CPU|Memory>]" },
+ { 0x04, "add", "nm policy add policy_id <0-255> "
+ "[domain <platform|CPU|Memory>] "
+ "correction auto|soft|hard power <watts> | "
+ "inlet <temp> trig_lim <param> "
+ "stats <seconds> enable|disable" },
+ { 0x05, "remove", "nm policy remove policy_id <0-255> "
+ "[domain <platform|CPU|Memory>]" },
{ 0x06, "limiting", "nm policy limiting [domain <platform|CPU|Memory>]" },
- { 0xFF, NULL, NULL },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_policy_options[] = {
- { 0x01, "enable", "" },
- { 0x02, "disable", "" },
- { 0x03, "domain", "" },
- { 0x04, "inlet", "inlet air temp full limiting (SCRAM)"},
- { 0x06, "correction", "auto, soft, hard" },
- { 0x08, "power", "power limit in watts" },
- { 0x09, "trig_lim", "time to send alert" },
- { 0x0A, "stats", "moving window averaging time" },
+ { 0x01, "enable", "" },
+ { 0x02, "disable", "" },
+ { 0x03, "domain", "" },
+ { 0x04, "inlet", "inlet air temp full limiting (SCRAM)" },
+ { 0x06, "correction","auto, soft, hard" },
+ { 0x08, "power", "power limit in watts" },
+ { 0x09, "trig_lim", "time to send alert" },
+ { 0x0A, "stats", "moving window averaging time" },
{ 0x0B, "policy_id", "policy number" },
- { 0x0C, "volatile", "save policy in volatiel memory" },
+ { 0x0C, "volatile", "save policy in volatiel memory" },
{ 0x0D, "cores_off", "at boot time, disable N cores" },
- { 0xFF, NULL, NULL },
+
+ DCMI_CMD_END(0xFF),
};
/* if "trigger" command used from nm_policy_options */
const struct dcmi_cmd nm_trigger[] = {
- { 0x00, "none", "" },
- { 0x01, "temp", "" },
+ { 0x00, "none", "" },
+ { 0x01, "temp", "" },
{ 0x02, "reset", "" },
- { 0x03, "boot", "" },
- { 0xFF, NULL, NULL },
+ { 0x03, "boot", "" },
+
+ DCMI_CMD_END(0xFF),
};
/* if "correction" used from nm_policy_options */
@@ -434,86 +476,105 @@ const struct dcmi_cmd nm_correction[] = {
{ 0x00, "auto", "" },
{ 0x01, "soft", "" },
{ 0x02, "hard", "" },
- { 0xFF, NULL, NULL },
+
+ DCMI_CMD_END(0xFF),
};
/* returned codes from get policy */
const struct dcmi_cmd nm_correction_vals[] = {
{ 0x00, "no T-state use", "" },
{ 0x01, "no T-state use", "" },
- { 0x02, "use T-states", "" },
- { 0xFF, NULL, NULL },
+ { 0x02, "use T-states", "" },
+
+ DCMI_CMD_END(0xFF),
};
/* if "exception" used from nm_policy_options */
const struct dcmi_cmd nm_exception[] = {
- { 0x00, "none", "" },
- { 0x01, "alert", "" },
+ { 0x00, "none", "" },
+ { 0x01, "alert", "" },
{ 0x02, "shutdown", "" },
- { 0xFF, NULL, NULL },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_reset_mode[] = {
- { 0x00, "global", "" },
+ { 0x00, "global", "" },
{ 0x01, "per_policy", "" },
- { 0x1B, "requests", "" },
- { 0x1C, "response", "" },
+ { 0x1B, "requests", "" },
+ { 0x1C, "response", "" },
{ 0x1D, "throttling", "" },
- { 0x1E, "memory", "", },
- { 0x1F, "comm", "" },
- { 0xFF, NULL, NULL },
+ { 0x1E, "memory", "" },
+ { 0x1F, "comm", "" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_power_range[] = {
{ 0x01, "domain", "domain <platform|CPU|Memory> (default is platform)" },
- { 0x02, "min", " min <integer value>" },
- { 0x03, "max", "max <integer value>" },
- { 0xFF, NULL, NULL },
+ { 0x02, "min", "min <integer value>" },
+ { 0x03, "max", "max <integer value>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_alert_opts[] = {
- { 0x01, "set", "nm alert set chan <chan> dest <dest> string <string>" },
- { 0x02, "get", "nm alert get" },
+ { 0x01, "set", "nm alert set chan <chan> dest <dest> string <string>" },
+ { 0x02, "get", "nm alert get" },
{ 0x03, "clear", "nm alert clear dest <dest>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_set_alert_param[] = {
- { 0x01, "chan", "chan <channel>" },
- { 0x02, "dest", "dest <destination>" },
+ { 0x01, "chan", "chan <channel>" },
+ { 0x02, "dest", "dest <destination>" },
{ 0x03, "string", "string <string>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_thresh_cmds[] = {
- { 0x01, "set", "nm thresh set [domain <platform|CPU|Memory>] policy_id <policy> thresh_array" },
- { 0x02, "get", "nm thresh get [domain <platform|CPU|Memory>] policy_id <policy>" },
+ { 0x01, "set", "nm thresh set [domain <platform|CPU|Memory>] "
+ "policy_id <policy> thresh_array" },
+ { 0x02, "get", "nm thresh get [domain <platform|CPU|Memory>] "
+ "policy_id <policy>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_thresh_param[] = {
- { 0x01, "domain", "<platform|CPU|Memory> (default is platform)" },
- { 0x02, "policy_id", "<0-7>" },
- { 0xFF, NULL, NULL },
+ { 0x01, "domain", "<platform|CPU|Memory> (default is platform)" },
+ { 0x02, "policy_id", "<0-255>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct dcmi_cmd nm_suspend_cmds[] = {
- { 0x01, "set", "nm suspend set [domain <platform|CPU|Memory]> policy_id <policy> <start> <stop> <pattern>" },
- { 0x02, "get", "nm suspend get [domain <platform|CPU|Memory]> policy_id <policy>" },
+ { 0x01, "set", "nm suspend set [domain <platform|CPU|Memory]> "
+ "policy_id <policy> <start> "
+ "<stop> <pattern>" },
+ { 0x02, "get", "nm suspend get [domain <platform|CPU|Memory]> "
+ "policy_id <policy>" },
+
+ DCMI_CMD_END(0xFF),
};
const struct valstr nm_ccode_vals[] = {
- { 0x80, "Policy ID Invalid"},
- { 0x81, "Domain ID Invalid"},
- { 0x82, "Unknown policy trigger type"},
- { 0x84, "Power Limit out of range"},
- { 0x85, "Correction Time out of range"},
- { 0x86, "Policy Trigger value out of range"},
- { 0x88, "Invalid Mode"},
- { 0x89, "Statistics Reporting Period out of range"},
- { 0x8B, "Invalid value for Aggressive CPU correction field"},
- { 0xA1, "No policy is currently limiting for the specified domain ID"},
- { 0xC4, "No space available"},
- { 0xD4, "Insufficient privledge level due wrong responder LUN"},
- { 0xD5, "Policy exists and param unchangeable while enabled"},
- { 0xD6, "Command subfunction disabled or unavailable"},
+ { 0x80, "Policy ID Invalid" },
+ { 0x81, "Domain ID Invalid" },
+ { 0x82, "Unknown policy trigger type" },
+ { 0x84, "Power Limit out of range" },
+ { 0x85, "Correction Time out of range" },
+ { 0x86, "Policy Trigger value out of range" },
+ { 0x88, "Invalid Mode" },
+ { 0x89, "Statistics Reporting Period out of range" },
+ { 0x8B, "Invalid value for Aggressive CPU correction field" },
+ { 0xA1, "No policy is currently limiting for the specified domain ID" },
+ { 0xC4, "No space available" },
+ { 0xD4, "Insufficient privilege level due wrong responder LUN" },
+ { 0xD5, "Policy exists and param unchangeable while enabled" },
+ { 0xD6, "Command subfunction disabled or unavailable" },
{ 0xFF, NULL },
};
@@ -533,20 +594,20 @@ const struct valstr nm_ccode_vals[] = {
*/
void
print_strs(const struct dcmi_cmd * vs, const char * title, int loglevel,
- int verthorz)
+ int verthorz)
{
int i;
- if (vs == NULL)
+ if (!vs)
return;
- if (title != NULL) {
+ if (title) {
if (loglevel < 0)
printf("\n%s\n", title);
else
lprintf(loglevel, "\n%s", title);
}
- for (i = 0; vs[i].str != NULL; i++) {
+ for (i = 0; vs[i].str; i++) {
if (loglevel < 0) {
if (vs[i].val < 256)
if (verthorz == 0)
@@ -566,7 +627,7 @@ print_strs(const struct dcmi_cmd * vs, const char * title, int loglevel,
/* Check to see if this is NOT the last element in vs.str if true
* print the | else don't print anything.
*/
- if ((verthorz == 1) && (vs[i+1].str != NULL))
+ if (verthorz == 1 && vs[i+1].str)
printf(" | ");
}
if (verthorz == 0) {
@@ -590,14 +651,12 @@ uint16_t
str2val2(const char *str, const struct dcmi_cmd *vs)
{
int i;
- if (vs == NULL || str == NULL) {
+ if (!vs || !str) {
return 0;
}
- for (i = 0; vs[i].str != NULL; i++) {
- if (strncasecmp(vs[i].str, str,
- __maxlen(str, vs[i].str)) == 0) {
+ for (i = 0; vs[i].str; i++) {
+ if (strcasecmp(vs[i].str, str) == 0)
return vs[i].val;
- }
}
return vs[i].val;
}
@@ -616,10 +675,10 @@ val2str2(uint16_t val, const struct dcmi_cmd *vs)
static char un_str[32];
int i;
- if (vs == NULL)
+ if (!vs)
return NULL;
- for (i = 0; vs[i].str != NULL; i++) {
+ for (i = 0; vs[i].str; i++) {
if (vs[i].val == val)
return vs[i].str;
}
@@ -637,7 +696,7 @@ chk_rsp(struct ipmi_rs * rsp)
/* if the response from the intf is NULL then the BMC is experiencing
* some issue and cannot complete the command
*/
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "\n Unable to get DCMI information");
return 1;
}
@@ -647,16 +706,17 @@ chk_rsp(struct ipmi_rs * rsp)
*/
if ((rsp->ccode >= 0x80) && (rsp->ccode <= 0x8F)) {
lprintf(LOG_ERR, "\n DCMI request failed because: %s (%x)",
- val2str(rsp->ccode, dcmi_ccode_vals), rsp->ccode);
+ val2str(rsp->ccode, dcmi_ccode_vals), rsp->ccode);
return 1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "\n DCMI request failed because: %s (%x)",
- val2str(rsp->ccode, completion_code_vals), rsp->ccode);
+ val2str(rsp->ccode, completion_code_vals), rsp->ccode);
return 1;
}
/* check to make sure this is a DCMI firmware */
if(rsp->data[0] != IPMI_DCMI) {
- printf("\n A valid DCMI command was not returned! (%x)", rsp->data[0]);
+ printf("\n A valid DCMI command was not returned! (%x)",
+ rsp->data[0]);
return 1;
}
return 0;
@@ -671,7 +731,7 @@ chk_nm_rsp(struct ipmi_rs * rsp)
/* if the response from the intf is NULL then the BMC is experiencing
* some issue and cannot complete the command
*/
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "\n No response to NM request");
return 1;
}
@@ -683,7 +743,7 @@ chk_nm_rsp(struct ipmi_rs * rsp)
lprintf(LOG_ERR, "\n NM request failed because: %s (%x)",
val2str(rsp->ccode, nm_ccode_vals), rsp->ccode);
return 1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "\n NM request failed because: %s (%x)",
val2str(rsp->ccode, completion_code_vals), rsp->ccode);
return 1;
@@ -753,11 +813,11 @@ ipmi_dcmi_prnt_oobDiscover(struct ipmi_intf * intf)
# else
struct ipmi_session_params *p;
- if (intf->opened == 0 && intf->open != NULL) {
+ if (intf->opened == 0 && intf->open) {
if (intf->open(intf) < 0)
return (-1);
}
- if (intf == NULL || intf->session == NULL)
+ if (!intf || !intf->session)
return -1;
p = &intf->ssn_params;
@@ -771,7 +831,7 @@ ipmi_dcmi_prnt_oobDiscover(struct ipmi_intf * intf)
if (p->retry == 0)
p->retry = IPMI_LAN_RETRY;
- if (p->hostname == NULL || strlen((const char *)p->hostname) == 0) {
+ if (!p->hostname || strlen((const char *)p->hostname) == 0) {
lprintf(LOG_ERR, "No hostname specified!");
return -1;
}
@@ -786,7 +846,7 @@ ipmi_dcmi_prnt_oobDiscover(struct ipmi_intf * intf)
if (intf->fd < 0) {
lperror(LOG_ERR, "Connect to %s failed",
- p->hostname);
+ p->hostname);
intf->close(intf);
return -1;
}
@@ -822,16 +882,17 @@ ipmi_dcmi_prnt_getcapabilities(struct ipmi_intf * intf, uint8_t selector)
memcpy(&reply, rsp->data, sizeof (reply));
/* check to make sure that this is a 1.0/1.1/1.5 command */
if ((cape.conformance != IPMI_DCMI_CONFORM)
- && (cape.conformance != IPMI_DCMI_1_1_CONFORM)
- && (cape.conformance != IPMI_DCMI_1_5_CONFORM)) {
+ && (cape.conformance != IPMI_DCMI_1_1_CONFORM)
+ && (cape.conformance != IPMI_DCMI_1_5_CONFORM))
+ {
lprintf(LOG_ERR,
- "ERROR! This command is not available on this platform");
+ "ERROR! This command is not available on this platform");
return -1;
}
/* check to make sure that this is a rev .01 or .02 */
if (cape.revision != 0x01 && cape.revision != 0x02) {
lprintf(LOG_ERR,
- "ERROR! This command is not compatible with this version");
+ "ERROR! This command is not compatible with this version");
return -1;
}
/* 0x01 - platform capabilities
@@ -847,21 +908,21 @@ ipmi_dcmi_prnt_getcapabilities(struct ipmi_intf * intf, uint8_t selector)
/* loop through each of the entries in the first byte from the
* struct
*/
- printf("\n Mandatory platform capabilties\n");
- display_capabilities_attributes(
- dcmi_mandatory_platform_capabilities, cape.data_byte1);
+ printf("\n Mandatory platform capabilities\n");
+ display_capabilities_attributes(dcmi_mandatory_platform_capabilities,
+ cape.data_byte1);
/* loop through each of the entries in the second byte from the
* struct
*/
- printf("\n Optional platform capabilties\n");
- display_capabilities_attributes(
- dcmi_optional_platform_capabilities, cape.data_byte2);
+ printf("\n Optional platform capabilities\n");
+ display_capabilities_attributes(dcmi_optional_platform_capabilities,
+ cape.data_byte2);
/* loop through each of the entries in the third byte from the
* struct
*/
- printf("\n Managebility access capabilties\n");
- display_capabilities_attributes(
- dcmi_management_access_capabilities, cape.data_byte3);
+ printf("\n Managebility access capabilities\n");
+ display_capabilities_attributes(dcmi_management_access_capabilities,
+ cape.data_byte3);
break;
case 0x02:
printf("\n Mandatory platform attributes:\n");
@@ -885,12 +946,12 @@ ipmi_dcmi_prnt_getcapabilities(struct ipmi_intf * intf, uint8_t selector)
printf("\n %d SEL entries\n", sel_entries & 0xFFF);
/* byte 3 data */
printf("\n Identification Attributes: \n");
- display_capabilities_attributes(
- dcmi_id_capabilities_vals, cape.data_byte3);
+ display_capabilities_attributes(dcmi_id_capabilities_vals,
+ cape.data_byte3);
/* byte 4 data */
printf("\n Temperature Monitoring Attributes: \n");
display_capabilities_attributes(dcmi_temp_monitoring_vals,
- cape.data_byte4);
+ cape.data_byte4);
break;
case 0x03:
printf("\n Optional Platform Attributes: \n");
@@ -900,19 +961,19 @@ ipmi_dcmi_prnt_getcapabilities(struct ipmi_intf * intf, uint8_t selector)
printf(" Slave address of device: 20h (BMC)\n" );
} else {
printf(" Slave address of device: %xh (8bits)"
- "(Satellite/External controller)\n",
- cape.data_byte1);
+ "(Satellite/External controller)\n",
+ cape.data_byte1);
}
/* Controller channel number (4-7) bits */
if ((cape.data_byte2>>4) == 0x00) {
printf(" Channel number is 0h (Primary BMC)\n");
} else {
printf(" Channel number is %xh \n",
- (cape.data_byte2>>4));
+ (cape.data_byte2 >> 4));
}
/* Device revision (0-3) */
printf(" Device revision is %d \n",
- cape.data_byte2 &0xf);
+ cape.data_byte2 & 0xf);
break;
case 0x04:
/* LAN */
@@ -921,20 +982,20 @@ ipmi_dcmi_prnt_getcapabilities(struct ipmi_intf * intf, uint8_t selector)
printf(" Primary LAN channel is not available for OOB\n");
} else {
printf(" Primary LAN channel number: %d is available\n",
- cape.data_byte1);
+ cape.data_byte1);
}
if (cape.data_byte2 == 0xFF) {
printf(" Secondary LAN channel is not available for OOB\n");
} else {
printf(" Secondary LAN channel number: %d is available\n",
- cape.data_byte2);
+ cape.data_byte2);
}
/* serial */
if (cape.data_byte3 == 0xFF) {
printf(" No serial channel is available\n");
} else {
printf(" Serial channel number: %d is available\n",
- cape.data_byte3);
+ cape.data_byte3);
}
break;
case 0x05:
@@ -943,7 +1004,7 @@ ipmi_dcmi_prnt_getcapabilities(struct ipmi_intf * intf, uint8_t selector)
printf(" DCMI Specification %d.%d\n", reply[1], reply[2]);
printf(" Rolling average time period options: %d\n", reply[4]);
printf(" Sample time options: ");
- for (j = 1; dcmi_sampling_vals[j-1].str != NULL; j++)
+ for (j = 1; dcmi_sampling_vals[j-1].str; j++)
printf(" %s ", val2str2(reply[4+j],dcmi_sampling_vals));
printf("\n");
break;
@@ -1008,13 +1069,14 @@ ipmi_dcmi_prnt_getassettag(struct ipmi_intf * intf)
taglength = rsp->data[1];
printf("\n Asset tag: ");
while (taglength) {
- getlength = taglength / DCMI_MAX_BYTE_SIZE ?
- DCMI_MAX_BYTE_SIZE : taglength%DCMI_MAX_BYTE_SIZE;
+ /* TODO: Add parentheses for clarity */
+ getlength = taglength / DCMI_MAX_BYTE_SIZE ? DCMI_MAX_BYTE_SIZE
+ : taglength % DCMI_MAX_BYTE_SIZE;
rsp = ipmi_dcmi_getassettag(intf, offset, getlength);
/* macro has no effect here where can generate sig segv
* if rsp occurs with null
*/
- if (rsp != NULL) {
+ if (rsp) {
GOOD_ASSET_TAG_CCODE(rsp->ccode);
}
if (chk_rsp(rsp)) {
@@ -1081,8 +1143,9 @@ ipmi_dcmi_prnt_setassettag(struct ipmi_intf * intf, uint8_t * data)
}
printf("\n Set Asset Tag: ");
while (taglength) {
- getlength = taglength / DCMI_MAX_BYTE_SIZE ?
- DCMI_MAX_BYTE_SIZE : taglength%DCMI_MAX_BYTE_SIZE;
+ /* TODO: Use a macro or an inline for this repeating calculation */
+ getlength = taglength / DCMI_MAX_BYTE_SIZE ? DCMI_MAX_BYTE_SIZE
+ : taglength % DCMI_MAX_BYTE_SIZE;
memcpy(tmpData, data + offset, getlength);
rsp = ipmi_dcmi_setassettag(intf, offset, getlength, tmpData);
if (chk_rsp(rsp)) {
@@ -1146,8 +1209,9 @@ ipmi_dcmi_prnt_getmngctrlids(struct ipmi_intf * intf)
printf("\n Get Management Controller Identifier String: ");
while (taglength) {
- getlength = taglength / DCMI_MAX_BYTE_SIZE ?
- DCMI_MAX_BYTE_SIZE : taglength%DCMI_MAX_BYTE_SIZE;
+ /* TODO: Use a macro or an inline for this repeating calculation */
+ getlength = taglength / DCMI_MAX_BYTE_SIZE ? DCMI_MAX_BYTE_SIZE
+ : taglength % DCMI_MAX_BYTE_SIZE;
rsp = ipmi_dcmi_getmngctrlids(intf, offset, getlength);
if (chk_rsp(rsp)) {
@@ -1223,14 +1287,15 @@ ipmi_dcmi_prnt_setmngctrlids(struct ipmi_intf * intf, uint8_t * data)
printf("\n Set Management Controller Identifier String Command: ");
while (taglength) {
- getlength = taglength / DCMI_MAX_BYTE_SIZE ?
- DCMI_MAX_BYTE_SIZE : taglength%DCMI_MAX_BYTE_SIZE;
+ /* TODO: Use a macro or an inline for this repeating calculation */
+ getlength = taglength / DCMI_MAX_BYTE_SIZE ? DCMI_MAX_BYTE_SIZE
+ : taglength % DCMI_MAX_BYTE_SIZE;
memcpy(tmpData, data + offset, getlength);
rsp = ipmi_dcmi_setmngctrlids(intf, offset, getlength, tmpData);
/* because after call "Set mc id string" RMCP+ will go down
* we have no "rsp"
*/
- if (strncmp(intf->name, "lanplus", 7)) {
+ if (strcmp(intf->name, "lanplus")) {
if (chk_rsp(rsp)) {
return -1;
}
@@ -1250,7 +1315,7 @@ ipmi_dcmi_prnt_setmngctrlids(struct ipmi_intf * intf, uint8_t * data)
*
* @intf: ipmi interface handler
* @isnsr: entity ID
- * @offset: offset (Entity instace start)
+ * @offset: offset (Entity instance start)
*
* returns ipmi_rs structure
*/
@@ -1264,7 +1329,7 @@ ipmi_dcmi_discvry_snsr(struct ipmi_intf * intf, uint8_t isnsr, uint8_t offset)
msg_data[1] = 0x01; /* Senser Type = Temp (01h) */
msg_data[2] = isnsr; /* Sensor Number */
msg_data[3] = 0x00; /* Entity Instance, set to read all instances */
- msg_data[4] = offset; /* Entity instace start */
+ msg_data[4] = offset; /* Entity instance start */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_DCGRP;
@@ -1299,9 +1364,9 @@ ipmi_dcmi_prnt_discvry_snsr(struct ipmi_intf * intf, uint8_t isnsr)
}
instances = rsp->data[1];
printf("\n%s: %d temperature sensor%s found:\n",
- val2str2(isnsr, dcmi_discvry_snsr_vals),
- instances,
- (instances > 1) ? "s" : "");
+ val2str2(isnsr, dcmi_discvry_snsr_vals),
+ instances,
+ (instances > 1) ? "s" : "");
while(instances > 0) {
ipmi_dcmi_discvry_snsr(intf, isnsr, offset);
if (chk_rsp(rsp)) {
@@ -1335,11 +1400,7 @@ ipmi_dcmi_pwr_rd(struct ipmi_intf * intf, uint8_t sample_time)
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct power_reading val;
- struct tm tm_t;
- time_t t;
uint8_t msg_data[4]; /* number of request data bytes */
- memset(&tm_t, 0, sizeof(tm_t));
- memset(&t, 0, sizeof(t));
msg_data[0] = IPMI_DCMI; /* Group Extension Identification */
if (sample_time) {
@@ -1365,19 +1426,17 @@ ipmi_dcmi_pwr_rd(struct ipmi_intf * intf, uint8_t sample_time)
/* rsp->data[0] is equal to response data byte 2 in spec */
/* printf("Group Extension Identification: %02x\n", rsp->data[0]); */
memcpy(&val, rsp->data, sizeof (val));
- t = val.time_stamp;
- gmtime_r(&t, &tm_t);
printf("\n");
printf(" Instantaneous power reading: %8d Watts\n",
- val.curr_pwr);
+ val.curr_pwr);
printf(" Minimum during sampling period: %8d Watts\n",
- val.min_sample);
+ val.min_sample);
printf(" Maximum during sampling period: %8d Watts\n",
- val.max_sample);
+ val.max_sample);
printf(" Average power reading over sample period: %8d Watts\n",
- val.avg_pwr);
+ val.avg_pwr);
printf(" IPMI timestamp: %s",
- asctime(&tm_t));
+ ipmi_timestamp_numeric(ipmi32toh(&val.time_stamp)));
printf(" Sampling period: ");
if (sample_time)
printf("%s \n", val2str2(val.sample,dcmi_sampling_vals));
@@ -1428,16 +1487,16 @@ ipmi_dcmi_getthermalpolicy(struct ipmi_intf * intf, uint8_t entityID,
memcpy(&val, rsp->data, sizeof (val));
printf("\n");
printf(" Persistence flag is: %s\n",
- ((val.exceptionActions & 0x80) ? "set" : "notset"));
+ ((val.exceptionActions & 0x80) ? "set" : "notset"));
printf(" Exception Actions, taken if the Temperature Limit exceeded:\n");
printf(" Hard Power Off system and log event: %s\n",
- ((val.exceptionActions & 0x40) ? "active":"inactive"));
+ ((val.exceptionActions & 0x40) ? "active":"inactive"));
printf(" Log event to SEL only: %s\n",
- ((val.exceptionActions & 0x20) ? "active":"inactive"));
+ ((val.exceptionActions & 0x20) ? "active":"inactive"));
printf(" Temperature Limit %d degrees\n",
- val.tempLimit);
+ val.tempLimit);
printf(" Exception Time %d seconds\n",
- val.exceptionTime);
+ val.exceptionTime);
printf("\n\n");
return 0;
}
@@ -1448,14 +1507,14 @@ ipmi_dcmi_getthermalpolicy(struct ipmi_intf * intf, uint8_t entityID,
*/
int
ipmi_dcmi_setthermalpolicy(struct ipmi_intf * intf,
- uint8_t entityID,
- uint8_t entityInst,
- uint8_t persistanceFlag,
- uint8_t actionHardPowerOff,
- uint8_t actionLogToSEL,
- uint8_t tempLimit,
- uint8_t samplingTimeLSB,
- uint8_t samplingTimeMSB)
+ uint8_t entityID,
+ uint8_t entityInst,
+ uint8_t persistanceFlag,
+ uint8_t actionHardPowerOff,
+ uint8_t actionLogToSEL,
+ uint8_t tempLimit,
+ uint8_t samplingTimeLSB,
+ uint8_t samplingTimeMSB)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1464,10 +1523,10 @@ ipmi_dcmi_setthermalpolicy(struct ipmi_intf * intf,
msg_data[0] = IPMI_DCMI; /* Group Extension Identification */
msg_data[1] = entityID; /* Inlet Temperature DCMI ID*/
msg_data[2] = entityInst; /* Entity Instance */
- /* persistance and actions or disabled if no actions */
+ /* persistence and actions or disabled if no actions */
msg_data[3] = (((persistanceFlag ? 1 : 0) << 7) |
- ((actionHardPowerOff? 1 : 0) << 6) |
- ((actionLogToSEL ? 1 : 0) << 5));
+ ((actionHardPowerOff? 1 : 0) << 6) |
+ ((actionLogToSEL ? 1 : 0) << 5));
msg_data[4] = tempLimit;
msg_data[5] = samplingTimeLSB;
msg_data[6] = samplingTimeMSB;
@@ -1486,7 +1545,7 @@ ipmi_dcmi_setthermalpolicy(struct ipmi_intf * intf,
}
/* rsp->data[0] is equal to response data byte 2 in spec */
printf("\nThermal policy %d for %0Xh entity successfully set.\n\n",
- entityInst, entityID);
+ entityInst, entityID);
return 0;
}
@@ -1498,9 +1557,9 @@ ipmi_dcmi_setthermalpolicy(struct ipmi_intf * intf,
*/
struct ipmi_rs *
ipmi_dcmi_get_temp_readings(struct ipmi_intf * intf,
- uint8_t entityID,
- uint8_t entityInst,
- uint8_t entityInstStart)
+ uint8_t entityID,
+ uint8_t entityInst,
+ uint8_t entityInstStart)
{
struct ipmi_rq req;
uint8_t msg_data[5]; /* number of request data bytes */
@@ -1527,10 +1586,11 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
int i,j, tota_inst, get_inst, offset = 0;
/* Print sensor description */
printf("\n\tEntity ID\t\t\tEntity Instance\t Temp. Readings");
- for (i = 0; dcmi_temp_read_vals[i].str != NULL; i++) {
+ for (i = 0; dcmi_temp_read_vals[i].str; i++) {
/* get all of the information about this sensor */
rsp = ipmi_dcmi_get_temp_readings(intf,
- dcmi_temp_read_vals[i].val, 0, 0);
+ dcmi_temp_read_vals[i].val,
+ 0, 0);
if (chk_rsp(rsp)) {
continue;
}
@@ -1539,10 +1599,11 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
tota_inst = rsp->data[1];
while (tota_inst > 0) {
get_inst = ((tota_inst / DCMI_MAX_BYTE_TEMP_READ_SIZE) ?
- DCMI_MAX_BYTE_TEMP_READ_SIZE :
- (tota_inst % DCMI_MAX_BYTE_TEMP_READ_SIZE));
+ DCMI_MAX_BYTE_TEMP_READ_SIZE :
+ (tota_inst % DCMI_MAX_BYTE_TEMP_READ_SIZE));
rsp = ipmi_dcmi_get_temp_readings(intf,
- dcmi_temp_read_vals[i].val, offset, 0);
+ dcmi_temp_read_vals[i].val,
+ offset, 0);
if (chk_rsp(rsp)) {
continue;
}
@@ -1553,8 +1614,9 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
/* Print Instance temperature info */
printf("\n%s",dcmi_temp_read_vals[i].desc);
printf("\t\t%i\t\t%c%i C", rsp->data[j+4],
- ((rsp->data[j+3]) >> 7) ?
- '-' : '+', (rsp->data[j+3] & 127));
+ ((rsp->data[j+3]) >> 7) ? '-'
+ : '+',
+ (rsp->data[j+3] & 127));
}
offset += get_inst;
tota_inst -= get_inst;
@@ -1599,8 +1661,10 @@ ipmi_dcmi_prnt_getconfparam(struct ipmi_intf * intf)
int param_selector;
uint16_t tmp_value = 0;
/* We are not interested in parameter 1 which always will return 0 */
- for (param_selector = 2 ; param_selector <= dcmi_conf_params;
- param_selector++) {
+ for (param_selector = 2;
+ param_selector <= dcmi_conf_params;
+ param_selector++)
+ {
rsp = ipmi_dcmi_getconfparam(intf, param_selector);
if (chk_rsp(rsp)) {
return -1;
@@ -1611,9 +1675,10 @@ ipmi_dcmi_prnt_getconfparam(struct ipmi_intf * intf)
tmp_value = (rsp->data[4])& 1;
printf("\n\tDHCP Discovery method\t: ");
printf("\n\t\tManagement Controller ID String is %s",
- tmp_value ? "enabled" : "disabled");
- printf("\n\t\tVendor class identifier DCMI IANA and Vendor class-specific Informationa are %s",
- ((rsp->data[4])& 2) ? "enabled" : "disabled" );
+ tmp_value ? "enabled" : "disabled");
+ printf("\n\t\tVendor class identifier DCMI IANA and Vendor "
+ "class-specific Informationa are %s",
+ ((rsp->data[4])& 2) ? "enabled" : "disabled" );
break;
case 3:
printf("\n\tInitial timeout interval\t: %i seconds",
@@ -1621,11 +1686,11 @@ ipmi_dcmi_prnt_getconfparam(struct ipmi_intf * intf)
break;
case 4:
printf("\n\tServer contact timeout interval\t: %i seconds",
- rsp->data[4] + (rsp->data[5]<<8));
+ rsp->data[4] + (rsp->data[5]<<8));
break;
case 5:
printf("\n\tServer contact retry interval\t: %i seconds",
- rsp->data[4] + (rsp->data[5] << 8));
+ rsp->data[4] + (rsp->data[5] << 8));
break;
default:
printf("\n\tConfiguration Parameter not supported.");
@@ -1724,7 +1789,7 @@ ipmi_dcmi_pwr_prnt_glimit(struct ipmi_intf * intf)
/* rsp can be a null so check response before any operation
* on it to avoid sig segv
*/
- if (rsp != NULL) {
+ if (rsp) {
realCc = rsp->ccode;
GOOD_PWR_GLIMIT_CCODE(rsp->ccode);
}
@@ -1735,10 +1800,10 @@ ipmi_dcmi_pwr_prnt_glimit(struct ipmi_intf * intf)
/* printf("Group Extension Identification: %02x\n", rsp->data[0]); */
memcpy(&val, rsp->data, sizeof (val));
printf("\n Current Limit State: %s\n",
- (realCc == 0) ?
- "Power Limit Active" : "No Active Power Limit");
+ (realCc == 0) ?
+ "Power Limit Active" : "No Active Power Limit");
printf(" Exception actions: %s\n",
- val2str2(val.action, dcmi_pwrmgmt_get_action_vals));
+ val2str2(val.action, dcmi_pwrmgmt_get_action_vals));
printf(" Power Limit: %i Watts\n", val.limit);
printf(" Correction time: %i milliseconds\n", val.correction);
printf(" Sampling period: %i seconds\n", val.sample);
@@ -1772,7 +1837,7 @@ ipmi_dcmi_pwr_slimit(struct ipmi_intf * intf, const char * option,
/* rsp can be a null so check response before any operation on it to
* avoid sig segv
*/
- if (rsp != NULL) {
+ if (rsp) {
GOOD_PWR_GLIMIT_CCODE(rsp->ccode);
}
if (chk_rsp(rsp)) {
@@ -1796,8 +1861,8 @@ ipmi_dcmi_pwr_slimit(struct ipmi_intf * intf, const char * option,
* val.sample = *(uint16_t*)(&rsp->data[12]);
*/
lprintf(LOG_INFO,
- "DCMI IN Limit=%d Correction=%d Action=%d Sample=%d\n",
- val.limit, val.correction, val.action, val.sample);
+ "DCMI IN Limit=%d Correction=%d Action=%d Sample=%d\n",
+ val.limit, val.correction, val.action, val.sample);
switch (str2val2(option, dcmi_pwrmgmt_set_usage_vals)) {
case 0x00:
/* action */
@@ -1877,7 +1942,7 @@ ipmi_dcmi_pwr_slimit(struct ipmi_intf * intf, const char * option,
case 0xFF:
/* error - not a string we knew what to do with */
lprintf(LOG_ERR, "Given %s '%s' is invalid.",
- option, value);
+ option, value);
return -1;
}
break;
@@ -1885,7 +1950,7 @@ ipmi_dcmi_pwr_slimit(struct ipmi_intf * intf, const char * option,
/* limit */
if (str2uint(value, &lvalue) != 0) {
lprintf(LOG_ERR, "Given %s '%s' is invalid.",
- option, value);
+ option, value);
return (-1);
}
val.limit = *(uint16_t*)(&lvalue);
@@ -1894,7 +1959,7 @@ ipmi_dcmi_pwr_slimit(struct ipmi_intf * intf, const char * option,
/* correction */
if (str2uint(value, &lvalue) != 0) {
lprintf(LOG_ERR, "Given %s '%s' is invalid.",
- option, value);
+ option, value);
return (-1);
}
val.correction = *(uint32_t*)(&lvalue);
@@ -1903,7 +1968,7 @@ ipmi_dcmi_pwr_slimit(struct ipmi_intf * intf, const char * option,
/* sample */
if (str2uint(value, &lvalue) != 0) {
lprintf(LOG_ERR, "Given %s '%s' is invalid.",
- option, value);
+ option, value);
return (-1);
}
val.sample = *(uint16_t*)(&lvalue);
@@ -2024,7 +2089,8 @@ _ipmi_nm_discover(struct ipmi_intf * intf, struct nm_discover *disc)
* @caps: fills in capability struct
*/
static int
-_ipmi_nm_getcapabilities(struct ipmi_intf * intf, uint8_t domain, uint8_t trigger, struct nm_capability *caps)
+_ipmi_nm_getcapabilities(struct ipmi_intf * intf, uint8_t domain,
+ uint8_t trigger, struct nm_capability *caps)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2049,7 +2115,8 @@ _ipmi_nm_getcapabilities(struct ipmi_intf * intf, uint8_t domain, uint8_t trigge
}
static int
-_ipmi_nm_get_policy(struct ipmi_intf * intf, uint8_t domain, uint8_t policy_id, struct nm_get_policy *policy)
+_ipmi_nm_get_policy(struct ipmi_intf * intf, uint8_t domain,
+ uint8_t policy_id, struct nm_get_policy *policy)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2083,7 +2150,9 @@ _ipmi_nm_set_policy(struct ipmi_intf * intf, struct nm_policy *policy)
req.msg.cmd = IPMI_NM_SET_POLICY;
req.msg.data = (uint8_t *)policy;
req.msg.data_len = sizeof(struct nm_policy);
- policy->intel_id[0] = 0x57; policy->intel_id[1] =1; policy->intel_id[2] =0;
+ policy->intel_id[0] = 0x57;
+ policy->intel_id[1] = 1;
+ policy->intel_id[2] = 0;
rsp = intf->sendrecv(intf, &req);
if (chk_nm_rsp(rsp)) {
return -1;
@@ -2117,7 +2186,8 @@ _ipmi_nm_policy_limiting(struct ipmi_intf * intf, uint8_t domain)
}
static int
-_ipmi_nm_control(struct ipmi_intf * intf, uint8_t scope, uint8_t domain, uint8_t policy_id)
+_ipmi_nm_control(struct ipmi_intf * intf, uint8_t scope,
+ uint8_t domain, uint8_t policy_id)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2151,7 +2221,8 @@ _ipmi_nm_control(struct ipmi_intf * intf, uint8_t scope, uint8_t domain, uint8_t
* @selector: Parameter selector
*/
static int
-_ipmi_nm_statistics(struct ipmi_intf * intf, uint8_t mode, uint8_t domain, uint8_t policy_id, struct nm_statistics *caps)
+_ipmi_nm_statistics(struct ipmi_intf * intf, uint8_t mode, uint8_t domain,
+ uint8_t policy_id, struct nm_statistics *caps)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2177,7 +2248,8 @@ _ipmi_nm_statistics(struct ipmi_intf * intf, uint8_t mode, uint8_t domain, uint8
}
static int
-_ipmi_nm_reset_stats(struct ipmi_intf * intf, uint8_t mode, uint8_t domain, uint8_t policy_id)
+_ipmi_nm_reset_stats(struct ipmi_intf * intf, uint8_t mode,
+ uint8_t domain, uint8_t policy_id)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2202,7 +2274,8 @@ _ipmi_nm_reset_stats(struct ipmi_intf * intf, uint8_t mode, uint8_t domain, uint
}
static int
-_nm_set_range(struct ipmi_intf * intf, uint8_t domain, uint16_t minimum, uint16_t maximum)
+_nm_set_range(struct ipmi_intf * intf, uint8_t domain,
+ uint16_t minimum, uint16_t maximum)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2284,7 +2357,8 @@ _ipmi_nm_set_alert(struct ipmi_intf * intf, struct nm_set_alert *alert)
* This array is filled in for valid thresholds returned.
*/
static int
-_ipmi_nm_get_thresh(struct ipmi_intf * intf, uint8_t domain, uint8_t policy_id, uint16_t *list)
+_ipmi_nm_get_thresh(struct ipmi_intf * intf, uint8_t domain,
+ uint8_t policy_id, uint16_t *list)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2357,7 +2431,8 @@ _ipmi_nm_set_thresh(struct ipmi_intf * intf, struct nm_thresh * thresh)
*
*/
static int
-_ipmi_nm_get_suspend(struct ipmi_intf * intf, uint8_t domain, uint8_t policy_id, int *count, struct nm_period *periods)
+_ipmi_nm_get_suspend(struct ipmi_intf * intf, uint8_t domain,
+ uint8_t policy_id, int *count, struct nm_period *periods)
{
struct ipmi_rq req; /* request data to send to the BMC */
struct ipmi_rs *rsp;
@@ -2400,9 +2475,12 @@ _ipmi_nm_set_suspend(struct ipmi_intf * intf, struct nm_suspend *suspend)
msg_data[1] = 1;
msg_data[2] = 0;
msg_data[3] = suspend->domain;
- msg_data[4] = suspend->policy_id;
+ msg_data[4] = suspend->policy_id;
msg_data[5] = suspend->count;
- for (i = 0, periods = &suspend->period[0]; i < (suspend->count*3); i += 3, periods++) {
+ for (i = 0, periods = &suspend->period[0];
+ i < (suspend->count*3);
+ i += 3, periods++)
+ {
msg_data[6+i] = periods->start;
msg_data[7+i] = periods->stop;
msg_data[8+i] = periods->repeat;
@@ -2412,8 +2490,8 @@ _ipmi_nm_set_suspend(struct ipmi_intf * intf, struct nm_suspend *suspend)
req.msg.netfn = IPMI_NETFN_OEM;
req.msg.cmd = IPMI_NM_SET_SUSPEND;
req.msg.data = msg_data;
- rsp = intf->sendrecv(intf, &req);
- if (chk_nm_rsp(rsp)) {
+ rsp = intf->sendrecv(intf, &req);
+ if (chk_nm_rsp(rsp)) {
return -1;
}
return 0;
@@ -2427,9 +2505,9 @@ ipmi_nm_getcapabilities(struct ipmi_intf * intf, int argc, char **argv)
uint8_t trigger = 0; /* default power policy (no trigger) */
struct nm_capability caps;
- while (--argc > 0) {
+ while (--argc > 0) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if ((option = str2val2(argv[0], nm_capability_opts)) == 0xFF) {
print_strs(nm_capability_opts, "Capability commands", LOG_ERR, 0);
return -1;
@@ -2465,35 +2543,35 @@ ipmi_nm_getcapabilities(struct ipmi_intf * intf, int argc, char **argv)
return -1;
if (csv_output) {
printf("%d,%u,%u,%u,%u,%u,%u,%s\n",
- caps.max_settings, caps.max_value,caps.min_value,
- caps.min_corr/1000, caps.max_corr/1000,
- caps.min_stats, caps.max_stats,
- val2str2(caps.scope&0xF, nm_domain_vals));
+ caps.max_settings, caps.max_value,caps.min_value,
+ caps.min_corr/1000, caps.max_corr/1000,
+ caps.min_stats, caps.max_stats,
+ val2str2(caps.scope&0xF, nm_domain_vals));
return 0;
}
printf(" power policies:\t\t%d\n", caps.max_settings);
switch (trigger&0xF) {
case 0: /* power */
printf(" max_power\t\t%7u Watts\n min_power\t\t%7u Watts\n",
- caps.max_value, caps.min_value);
+ caps.max_value, caps.min_value);
break;
case 1: /* Inlet */
printf(" max_temp\t\t%7u C\n min_temp\t\t%7u C\n",
- caps.max_value, caps.min_value);
+ caps.max_value, caps.min_value);
break;
case 2: /* Missing reading time */
case 3: /* Time after host reset */
printf(" max_time\t\t%7u Secs\n min_time\t\t%7u Secs\n",
- caps.max_value/10, caps.min_value/10);
+ caps.max_value/10, caps.min_value/10);
break;
case 4: /* boot time policy does not use these values */
default:
break;
}
printf(" min_corr\t\t%7u secs\n max_corr\t\t%7u secs\n",
- caps.min_corr/1000, caps.max_corr/1000);
+ caps.min_corr/1000, caps.max_corr/1000);
printf(" min_stats\t\t%7u secs\n max_stats\t\t%7u secs\n",
- caps.min_stats, caps.max_stats);
+ caps.min_stats, caps.max_stats);
printf(" domain scope:\t%s\n", val2str2(caps.scope&0xF, nm_domain_vals));
return 0;
}
@@ -2504,13 +2582,14 @@ ipmi_nm_get_policy(struct ipmi_intf * intf, int argc, char **argv)
uint8_t option;
uint8_t domain = 0; /* default domain of platform */
uint8_t policy_id = -1;
+ uint8_t have_policy_id = FALSE;
struct nm_get_policy policy;
memset(&policy, 0, sizeof(policy));
while (--argc) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if ((option = str2val2(argv[0], nm_policy_options)) == 0xFF) {
print_strs(nm_policy_options, "Get Policy commands", LOG_ERR, 0);
return -1;
@@ -2525,9 +2604,10 @@ ipmi_nm_get_policy(struct ipmi_intf * intf, int argc, char **argv)
break;
case 0x0B: /* policy id */
if (str2uchar(argv[1], &policy_id) < 0) {
- lprintf(LOG_ERR," Policy ID must be a positive integer 0-7.\n");
+ lprintf(LOG_ERR," Policy ID must be a positive integer (0-255)\n");
return -1;
}
+ have_policy_id = TRUE;
break;
default:
printf(" Unknown command 0x%x, skipping.\n", option);
@@ -2536,53 +2616,54 @@ ipmi_nm_get_policy(struct ipmi_intf * intf, int argc, char **argv)
argc--;
argv++;
}
- if (policy_id == 0xFF) {
+ if (!have_policy_id) {
print_strs(nm_stats_opts, "Missing policy_id parameter:", LOG_ERR, 0);
- return -1;
- }
+ return -1;
+ }
if (_ipmi_nm_get_policy(intf, policy.domain, policy_id, &policy))
return -1;
if (csv_output) {
printf("%s,0x%x,%s,%s,%s,%u,%u,%u,%u,%s\n",
- val2str2(policy.domain&0xF, nm_domain_vals),
- policy.domain,
- (policy.policy_type & 0x10) ? "power" : "nopower ",
- val2str2(policy.policy_type & 0xF, nm_policy_type_vals),
- val2str2(policy.policy_exception, nm_exception),
- policy.policy_limits,
- policy.corr_time,
- policy.trigger_limit,
- policy.stats_period,
- policy.policy_type & 0x80 ? "volatile" : "non-volatile");
+ val2str2(policy.domain&0xF, nm_domain_vals),
+ policy.domain,
+ (policy.policy_type & 0x10) ? "power" : "nopower ",
+ val2str2(policy.policy_type & 0xF, nm_policy_type_vals),
+ val2str2(policy.policy_exception, nm_exception),
+ policy.policy_limits,
+ policy.corr_time,
+ policy.trigger_limit,
+ policy.stats_period,
+ policy.policy_type & 0x80 ? "volatile" : "non-volatile");
return 0;
}
printf(" Power domain: %s\n",
- val2str2(policy.domain&0xF, nm_domain_vals));
+ val2str2(policy.domain&0xF, nm_domain_vals));
printf(" Policy is %s %s%s%s\n",
- policy.domain&0x10 ? "enabled" : "not enabled",
- policy.domain&0x20 ? "per Domain " : "",
- policy.domain&0x40 ? "Globally " : "",
- policy.domain&0x80 ? "via DCMI api " : "");
- printf(" Policy is %sa power control type.\n", (policy.policy_type & 0x10) ? "" : "not ");
+ policy.domain&0x10 ? "enabled" : "not enabled",
+ policy.domain&0x20 ? "per Domain " : "",
+ policy.domain&0x40 ? "Globally " : "",
+ policy.domain&0x80 ? "via DCMI api " : "");
+ printf(" Policy is %sa power control type.\n",
+ (policy.policy_type & 0x10) ? "" : "not ");
printf(" Policy Trigger Type: %s\n",
- val2str2(policy.policy_type & 0xF, nm_policy_type_vals));
+ val2str2(policy.policy_type & 0xF, nm_policy_type_vals));
printf(" Correction Aggressiveness: %s\n",
- val2str2((policy.policy_type>> 5) & 0x3, nm_correction_vals));
+ val2str2((policy.policy_type>> 5) & 0x3, nm_correction_vals));
printf(" Policy Exception Actions: %s\n",
- val2str2(policy.policy_exception, nm_exception));
+ val2str2(policy.policy_exception, nm_exception));
printf(" Power Limit: %u Watts\n",
- policy.policy_limits);
+ policy.policy_limits);
printf(" Correction Time Limit: %u milliseconds\n",
- policy.corr_time);
+ policy.corr_time);
printf(" Trigger Limit: %u units\n",
- policy.trigger_limit);
+ policy.trigger_limit);
printf(" Statistics Reporting Period: %u seconds\n",
- policy.stats_period);
+ policy.stats_period);
printf(" Policy retention: %s\n",
- policy.policy_type & 0x80 ? "volatile" : "non-volatile");
+ policy.policy_type & 0x80 ? "volatile" : "non-volatile");
if ( (policy_id == 0) && ((policy.domain & 0xf) == 0x3) )
printf(" HW Prot Power domain: %s\n",
- policy.policy_type & 0x80 ? "Secondary" : "Primary");
+ policy.policy_type & 0x80 ? "Secondary" : "Primary");
return 0;
}
@@ -2594,6 +2675,7 @@ ipmi_nm_policy(struct ipmi_intf * intf, int argc, char **argv)
uint8_t correction;
uint8_t domain = 0; /* default domain of platform */
uint8_t policy_id = -1;
+ uint8_t have_policy_id = FALSE;
uint16_t power, period, inlet;
uint16_t cores;
uint32_t limit;
@@ -2601,8 +2683,9 @@ ipmi_nm_policy(struct ipmi_intf * intf, int argc, char **argv)
argv++;
argc--;
- if ((argv[0] == NULL) ||
- ((action = str2val2(argv[0], nm_policy_action)) == 0xFF)) {
+ if (!argv[0] ||
+ 0xFF == (action = str2val2(argv[0], nm_policy_action)))
+ {
print_strs(nm_policy_action, "Policy commands", LOG_ERR, 0);
return -1;
}
@@ -2610,13 +2693,15 @@ ipmi_nm_policy(struct ipmi_intf * intf, int argc, char **argv)
return (ipmi_nm_get_policy(intf, argc, argv));
memset(&policy, 0, sizeof(policy));
/*
- * nm policy add [domain <param>] enable|disable policy_id <param> correction <opt> power <watts> limit <param> period <param>
+ * nm policy add [domain <param>] enable|disable policy_id <param>
+ * correction <opt> power <watts> limit <param>
+ * period <param>
* nm policy remove [domain <param>] policy_id <param>
* nm policy limiting {domain <param>]
*/
while (--argc > 0) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if ((option = str2val2(argv[0], nm_policy_options)) == 0xFF) {
print_strs(nm_policy_options, "Policy options", LOG_ERR, 0);
return -1;
@@ -2676,10 +2761,11 @@ ipmi_nm_policy(struct ipmi_intf * intf, int argc, char **argv)
break;
case 0x0B: /* policy ID */
if (str2uchar(argv[1], &policy_id) < 0) {
- printf("Policy ID must be a positive integer 0-7.\n");
+ printf("Policy ID must be a positive integer (0-255)\n");
return -1;
}
policy.policy_id = policy_id;
+ have_policy_id = TRUE;
break;
case 0x0C: /* volatile */
policy.policy_type |= 0x80;
@@ -2709,7 +2795,7 @@ ipmi_nm_policy(struct ipmi_intf * intf, int argc, char **argv)
printf("limit %x\n", limit);
return 0;
}
- if (policy_id == 0xFF) {
+ if (!have_policy_id) {
print_strs(nm_stats_opts, "Missing policy_id parameter:", LOG_ERR, 0);
return -1;
}
@@ -2728,12 +2814,14 @@ ipmi_nm_control(struct ipmi_intf * intf, int argc, char **argv)
uint8_t scope = 0; /* default control scope of global */
uint8_t domain = 0; /* default domain of platform */
uint8_t policy_id = -1;
+ uint8_t have_policy_id = FALSE;
argv++;
argc--;
/* nm_ctl_cmds returns 0 for disable, 1 for enable */
- if ((argv[0] == NULL) ||
- ((action = str2val2(argv[0], nm_ctl_cmds)) == 0xFF)) {
+ if (!argv[0] ||
+ 0xFF == (action = str2val2(argv[0], nm_ctl_cmds)))
+ {
print_strs(nm_ctl_cmds, "Control parameters:", LOG_ERR, 0);
print_strs(nm_ctl_domain, "control Scope (required):", LOG_ERR, 0);
return -1;
@@ -2741,30 +2829,31 @@ ipmi_nm_control(struct ipmi_intf * intf, int argc, char **argv)
argv++;
while (--argc) {
/* nm_ctl_domain returns correct bit field except for action */
- if ((argv[0] == NULL) ||
- ((scope = str2val2(argv[0], nm_ctl_domain)) == 0xFF)) {
+ if (!argv[0] ||
+ 0xFF == (scope = str2val2(argv[0], nm_ctl_domain)))
+ {
print_strs(nm_ctl_domain, "Control Scope (required):", LOG_ERR, 0);
return -1;
}
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if (scope == 0x02) { /* domain */
if ((domain = str2val2(argv[0], nm_domain_vals)) == 0xFF) {
print_strs(nm_domain_vals, "Domain Scope:", LOG_ERR, 0);
return -1;
}
} else if (scope == 0x04) { /* per_policy */
-
if (str2uchar(argv[0], &policy_id) < 0) {
- lprintf(LOG_ERR,"Policy ID must be a positive integer.\n");
+ lprintf(LOG_ERR,"Policy ID must be a positive integer (0-255)\n");
return -1;
}
+ have_policy_id = TRUE;
break;
}
argc--;
argv++;
}
- if ((scope == 0x04) && (policy_id == 0xFF)) {
+ if ((scope == 0x04) && !have_policy_id) {
print_strs(nm_stats_opts, "Missing policy_id parameter:", LOG_ERR, 0);
return -1;
}
@@ -2780,25 +2869,23 @@ ipmi_nm_get_statistics(struct ipmi_intf * intf, int argc, char **argv)
uint8_t option;
uint8_t domain = 0; /* default domain of platform */
uint8_t policy_id = -1;
+ uint8_t have_policy_id = FALSE;
int policy_mode = 0;
- int cut;
char *units = "";
- char datebuf[27];
struct nm_statistics stats;
- struct tm tm_t;
- time_t t;
argv++;
- if ((argv[0] == NULL) ||
- ((mode = str2val2(argv[0], nm_stats_mode)) == 0xFF)) {
+ if (!argv[0] ||
+ 0xFF == (mode = str2val2(argv[0], nm_stats_mode)))
+ {
print_strs(nm_stats_mode, "Statistics commands", LOG_ERR, 0);
return -1;
}
while (--argc) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if ((option = str2val2(argv[0], nm_stats_opts)) == 0xFF) {
- print_strs(nm_stats_opts, "Control Scope options", LOG_ERR, 0);
+ print_strs(nm_stats_opts, "Control Scope options", LOG_ERR, 0);
return -1;
}
switch (option) {
@@ -2810,9 +2897,10 @@ ipmi_nm_get_statistics(struct ipmi_intf * intf, int argc, char **argv)
break;
case 0x02: /* policy ID */
if (str2uchar(argv[1], &policy_id) < 0) {
- lprintf(LOG_ERR,"Policy ID must be a positive integer.\n");
+ lprintf(LOG_ERR,"Policy ID must be a positive integer (0-255)\n");
return -1;
}
+ have_policy_id = TRUE;
break;
default:
break;
@@ -2836,7 +2924,7 @@ ipmi_nm_get_statistics(struct ipmi_intf * intf, int argc, char **argv)
case 0x13:
policy_mode = 1;
units = (mode == 0x11) ? "Watts" : (mode == 0x12) ? "Celsius" : " %";
- if (policy_id == 0xFF) {
+ if (!have_policy_id) {
print_strs(nm_stats_opts, "Missing policy_id parameter:", LOG_ERR, 0);
return -1;
}
@@ -2846,47 +2934,53 @@ ipmi_nm_get_statistics(struct ipmi_intf * intf, int argc, char **argv)
}
if (_ipmi_nm_statistics(intf, mode, domain, policy_id, &stats))
return -1;
- t = stats.time_stamp;
- gmtime_r(&t, &tm_t);
- sprintf(datebuf, "%s", asctime(&tm_t));
- cut = strlen(datebuf) -1;
- datebuf[cut] = 0;
if (csv_output) {
printf("%s,%s,%s,%s,%s,%d,%d,%d,%d,%s,%d\n",
- val2str2(stats.id_state & 0xF, nm_domain_vals),
- ((stats.id_state >> 4) & 1) ? (policy_mode ? "Policy Enabled" : "Globally Enabled") : "Disabled" ,
- ((stats.id_state >> 5) & 1) ? "active" : "suspended",
- ((stats.id_state >> 6) & 1) ? "in progress" : "suspended",
- ((stats.id_state >> 7) & 1) ? "triggered" : "not triggered",
- stats.curr_value,
- stats.min_value,
- stats.max_value,
- stats.ave_value,
- datebuf,
- stats.stat_period);
+ val2str2(stats.id_state & 0xF, nm_domain_vals),
+ ((stats.id_state >> 4) & 1) ? (policy_mode ? "Policy Enabled"
+ : "Globally Enabled")
+ : "Disabled" ,
+ ((stats.id_state >> 5) & 1) ? "active"
+ : "suspended",
+ ((stats.id_state >> 6) & 1) ? "in progress"
+ : "suspended",
+ ((stats.id_state >> 7) & 1) ? "triggered"
+ : "not triggered",
+ stats.curr_value,
+ stats.min_value,
+ stats.max_value,
+ stats.ave_value,
+ ipmi_timestamp_numeric(ipmi32toh(&stats.time_stamp)),
+ stats.stat_period);
return 0;
}
printf(" Power domain: %s\n",
- val2str2(stats.id_state & 0xF, nm_domain_vals));
+ val2str2(stats.id_state & 0xF, nm_domain_vals));
printf(" Policy/Global Admin state %s\n",
- ((stats.id_state >> 4) & 1) ? (policy_mode ? "Policy Enabled" : "Globally Enabled") : "Disabled" );
+ ((stats.id_state >> 4) & 1) ? (policy_mode ? "Policy Enabled"
+ : "Globally Enabled")
+ : "Disabled" );
printf(" Policy/Global Operational state %s\n",
- ((stats.id_state >> 5) & 1) ? "active" : "suspended");
+ ((stats.id_state >> 5) & 1) ? "active"
+ : "suspended");
printf(" Policy/Global Measurement state %s\n",
- ((stats.id_state >> 6) & 1) ? "in progress" : "suspended");
+ ((stats.id_state >> 6) & 1) ? "in progress"
+ : "suspended");
printf(" Policy Activation state %s\n",
- ((stats.id_state >> 7) & 1) ? "triggered" : "not triggered");
+ ((stats.id_state >> 7) & 1) ? "triggered"
+ : "not triggered");
printf(" Instantaneous reading: %8d %s\n",
- stats.curr_value, units);
+ stats.curr_value, units);
printf(" Minimum during sampling period: %8d %s\n",
- stats.min_value, units);
+ stats.min_value, units);
printf(" Maximum during sampling period: %8d %s\n",
- stats.max_value, units);
+ stats.max_value, units);
printf(" Average reading over sample period: %8d %s\n",
- stats.ave_value, units);
+ stats.ave_value, units);
printf(" IPMI timestamp: %s\n",
- datebuf);
- printf(" Sampling period: %08d Seconds.\n", stats.stat_period);
+ ipmi_timestamp_numeric(ipmi32toh(&stats.time_stamp)));
+ printf(" Sampling period: %08d Seconds.\n",
+ stats.stat_period);
printf("\n");
return 0;
}
@@ -2898,16 +2992,18 @@ ipmi_nm_reset_statistics(struct ipmi_intf * intf, int argc, char **argv)
uint8_t option;
uint8_t domain = 0; /* default domain of platform */
uint8_t policy_id = -1;
+ uint8_t have_policy_id = FALSE;
argv++;
- if ((argv[0] == NULL) ||
- ((mode = str2val2(argv[0], nm_reset_mode)) == 0xFF)) {
+ if (!argv[0] ||
+ 0xFF == (mode = str2val2(argv[0], nm_reset_mode)))
+ {
print_strs(nm_reset_mode, "Reset Statistics Modes:", LOG_ERR, 0);
return -1;
}
while (--argc) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if ((option = str2val2(argv[0], nm_stats_opts)) == 0xFF) {
print_strs(nm_stats_opts, "Reset Scope options", LOG_ERR, 0);
return -1;
@@ -2921,9 +3017,10 @@ ipmi_nm_reset_statistics(struct ipmi_intf * intf, int argc, char **argv)
break;
case 0x02: /* policy ID */
if (str2uchar(argv[1], &policy_id) < 0) {
- lprintf(LOG_ERR,"Policy ID must be a positive integer.\n");
+ lprintf(LOG_ERR,"Policy ID must be a positive integer (0-255)\n");
return -1;
}
+ have_policy_id = TRUE;
break;
default:
break;
@@ -2931,7 +3028,7 @@ ipmi_nm_reset_statistics(struct ipmi_intf * intf, int argc, char **argv)
argc--;
argv++;
}
- if (mode && (policy_id == 0xFF)) {
+ if (mode && !have_policy_id) {
print_strs(nm_stats_opts, "Missing policy_id parameter:", LOG_ERR, 0);
return -1;
}
@@ -2950,7 +3047,7 @@ ipmi_nm_set_range(struct ipmi_intf * intf, int argc, char **argv)
while (--argc) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if ((param = str2val2(argv[0], nm_power_range)) == 0xFF) {
print_strs(nm_power_range, "power range parameters:", LOG_ERR, 0);
return -1;
@@ -2981,7 +3078,8 @@ ipmi_nm_set_range(struct ipmi_intf * intf, int argc, char **argv)
argv++;
}
if ((minimum == 0xFFFF) || (maximum == 0xFFFF)) {
- lprintf(LOG_ERR,"Missing parameters: nm power range min <minimum> max <maximum>.\n");
+ lprintf(LOG_ERR,"Missing parameters: nm power range min <minimum> "
+ "max <maximum>.\n");
return -1;
}
if (_nm_set_range(intf, domain, minimum, maximum) < 0)
@@ -2999,23 +3097,25 @@ ipmi_nm_get_alert(struct ipmi_intf * intf)
return -1;
if (csv_output) {
printf("%d,%s,0x%x,%s,0x%x\n",
- alert.chan&0xF,
- (alert.chan >> 7) ? "not registered" : "registered",
- alert.dest,
- (alert.string >> 7) ? "yes" : "no",
- alert.string & 0x7F);
+ alert.chan & 0xF,
+ (alert.chan >> 7) ? "not registered"
+ : "registered",
+ alert.dest,
+ (alert.string >> 7) ? "yes"
+ : "no",
+ alert.string & 0x7F);
return 0;
}
printf(" Alert Chan: %d\n",
- alert.chan&0xF);
+ alert.chan & 0xF);
printf(" Alert Receiver: %s\n",
- (alert.chan >> 7) ? "not registered" : "registered");
+ (alert.chan >> 7) ? "not registered" : "registered");
printf(" Alert Lan Destination: 0x%x\n",
- alert.dest);
+ alert.dest);
printf(" Use Alert String: %s\n",
- (alert.string >> 7) ? "yes" : "no");
+ (alert.string >> 7) ? "yes" : "no");
printf(" Alert String Selector: 0x%x\n",
- alert.string & 0x7F);
+ alert.string & 0x7F);
return 0;
}
@@ -3031,8 +3131,9 @@ ipmi_nm_alert(struct ipmi_intf * intf, int argc, char **argv)
argv++;
argc--;
- if ((argv[0] == NULL) ||
- ((action = str2val2(argv[0], nm_alert_opts)) == 0xFF)) {
+ if (!argv[0] ||
+ 0xFF == (action = str2val2(argv[0], nm_alert_opts)))
+ {
print_strs(nm_alert_opts, "Alert commands", LOG_ERR, 0);
return -1;
}
@@ -3042,19 +3143,19 @@ ipmi_nm_alert(struct ipmi_intf * intf, int argc, char **argv)
memset(&alert, 0, sizeof(alert));
while (--argc) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
if ((param = str2val2(argv[0], nm_set_alert_param)) == 0xFF) {
print_strs(nm_set_alert_param, "Set alert Parameters:", LOG_ERR, 0);
return -1;
}
switch (param) {
- case 0x01: /* channnel */
+ case 0x01: /* channel */
if (str2uchar(argv[1], &chan) < 0) {
lprintf(LOG_ERR,"Alert Lan chan must be a positive integer.\n");
return -1;
}
if (action == 0x03) /* Clear */
- chan |= 0x80; /* deactivate alert reciever */
+ chan |= 0x80; /* deactivate alert receiver */
break;
case 0x02: /* dest */
if (str2uchar(argv[1], &dest) < 0) {
@@ -3096,15 +3197,15 @@ ipmi_nm_get_thresh(struct ipmi_intf *intf, uint8_t domain, uint8_t policy_id)
return -1;
printf(" Alert Threshold domain: %s\n",
- val2str2(domain, nm_domain_vals));
+ val2str2(domain, nm_domain_vals));
printf(" Alert Threshold Policy ID: %d\n",
- policy_id);
+ policy_id);
printf(" Alert Threshold 1: %d\n",
- list[0]);
+ list[0]);
printf(" Alert Threshold 2: %d\n",
- list[1]);
+ list[1]);
printf(" Alert Threshold 3: %d\n",
- list[2]);
+ list[2]);
return 0;
}
@@ -3115,21 +3216,23 @@ ipmi_nm_thresh(struct ipmi_intf * intf, int argc, char **argv)
uint8_t action;
uint8_t domain = 0; /* default domain of platform */
uint8_t policy_id = -1;
+ uint8_t have_policy_id = FALSE;
struct nm_thresh thresh;
int i = 0;
argv++;
argc--;
/* set or get */
- if ((argv[0] == NULL) || (argc < 3) ||
- ((action = str2val2(argv[0], nm_thresh_cmds)) == 0xFF)) {
- print_strs(nm_thresh_cmds, "Theshold commands", LOG_ERR, 0);
+ if (!argv[0] || argc < 3
+ || 0xFF == (action = str2val2(argv[0], nm_thresh_cmds)))
+ {
+ print_strs(nm_thresh_cmds, "Threshold commands", LOG_ERR, 0);
return -1;
}
memset(&thresh, 0, sizeof(thresh));
while (--argc) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
option = str2val2(argv[0], nm_thresh_param);
switch (option) {
case 0x01: /* get domain scope */
@@ -3142,9 +3245,10 @@ ipmi_nm_thresh(struct ipmi_intf * intf, int argc, char **argv)
break;
case 0x02: /* policy ID */
if (str2uchar(argv[1], &policy_id) < 0) {
- lprintf(LOG_ERR,"Policy ID must be a positive integer.\n");
+ lprintf(LOG_ERR,"Policy ID must be a positive integer (0-255)\n");
return -1;
}
+ have_policy_id = TRUE;
argc--;
argv++;
break;
@@ -3161,7 +3265,7 @@ ipmi_nm_thresh(struct ipmi_intf * intf, int argc, char **argv)
break;
}
}
- if (policy_id == 0xFF) {
+ if (!have_policy_id) {
print_strs(nm_stats_opts, "Missing policy_id parameter:", LOG_ERR, 0);
return -1;
}
@@ -3213,9 +3317,10 @@ ipmi_nm_get_suspend(struct ipmi_intf *intf, uint8_t domain, uint8_t policy_id)
}
for (i = 0; i < count; i++) {
printf(" Suspend Period %d: %02d:%02d to %02d:%02d",
- i, click2hour(periods[i].start), click2min(periods[i].start),
- click2hour(periods[i].stop), click2min(periods[i].stop));
- if (periods[i].repeat) printf(", ");
+ i, click2hour(periods[i].start), click2min(periods[i].start),
+ click2hour(periods[i].stop), click2min(periods[i].stop));
+ if (periods[i].repeat)
+ printf(", ");
for (j = 0; j < 7; j++)
printf("%s", (periods[i].repeat >> j)&1 ? days[j] : "");
printf("\n");
@@ -3230,6 +3335,7 @@ ipmi_nm_suspend(struct ipmi_intf * intf, int argc, char **argv)
uint8_t action;
uint8_t domain = 0; /* default domain of platform */
uint8_t policy_id = -1;
+ uint8_t have_policy_id = FALSE;
uint8_t count = 0;
struct nm_suspend suspend;
int i;
@@ -3237,15 +3343,16 @@ ipmi_nm_suspend(struct ipmi_intf * intf, int argc, char **argv)
argv++;
argc--;
/* set or get */
- if ((argv[0] == NULL) || (argc < 3) ||
- ((action = str2val2(argv[0], nm_suspend_cmds)) == 0xFF)) {
+ if (!argv[0] || argc < 3 ||
+ 0xFF == (action = str2val2(argv[0], nm_suspend_cmds)))
+ {
print_strs(nm_suspend_cmds, "Suspend commands", LOG_ERR, 0);
return -1;
}
memset(&suspend, 0, sizeof(suspend));
while (--argc > 0) {
argv++;
- if (argv[0] == NULL) break;
+ if (!argv[0]) break;
option = str2val2(argv[0], nm_thresh_param);
switch (option) {
case 0x01: /* get domain scope */
@@ -3258,13 +3365,14 @@ ipmi_nm_suspend(struct ipmi_intf * intf, int argc, char **argv)
break;
case 0x02: /* policy ID */
if (str2uchar(argv[1], &policy_id) < 0) {
- lprintf(LOG_ERR,"Policy ID must be a positive integer.\n");
+ lprintf(LOG_ERR,"Policy ID must be a positive integer (0-255)\n");
return -1;
}
+ have_policy_id = TRUE;
argc--;
argv++;
break;
- case 0xFF: /* process periods */
+ case 0xFF: /* process periods */
for (i = 0; count < IPMI_NM_SUSPEND_PERIOD_MAX; i += 3, count++) {
if (argc < 3) {
lprintf(LOG_ERR,"Error: suspend period requires a start, stop, and repeat values.\n");
@@ -3289,10 +3397,16 @@ ipmi_nm_suspend(struct ipmi_intf * intf, int argc, char **argv)
if (argc <= 0)
break;
break;
- default:
- break;
- }
- }
+ default:
+ break;
+ }
+ }
+
+ if (!have_policy_id) {
+ print_strs(nm_stats_opts, "Missing policy_id parameter:", LOG_ERR, 0);
+ return -1;
+ }
+
if (action == 0x02) /* get */
return (ipmi_nm_get_suspend(intf, domain, policy_id));
@@ -3349,7 +3463,7 @@ ipmi_dcmi_set_limit(struct ipmi_intf * intf, int argc, char **argv)
case 0xFF:
/* error - not a string we knew what to do with */
lprintf(LOG_ERR, "Given Action '%s' is invalid.",
- argv[2]);
+ argv[2]);
return -1;
}
/* limit */
@@ -3364,8 +3478,8 @@ ipmi_dcmi_set_limit(struct ipmi_intf * intf, int argc, char **argv)
/* correction */
if (str2uint(argv[6], &correction) != 0) {
lprintf(LOG_ERR,
- "Given Correction '%s' is invalid.",
- argv[6]);
+ "Given Correction '%s' is invalid.",
+ argv[6]);
return (-1);
}
data[7] = correction >> 0;
@@ -3377,8 +3491,8 @@ ipmi_dcmi_set_limit(struct ipmi_intf * intf, int argc, char **argv)
/* sample */
if (str2ushort(argv[8], &sample) != 0) {
lprintf(LOG_ERR,
- "Given Sample '%s' is invalid.",
- argv[8]);
+ "Given Sample '%s' is invalid.",
+ argv[8]);
return (-1);
}
data[13] = sample >> 0;
@@ -3390,12 +3504,12 @@ ipmi_dcmi_set_limit(struct ipmi_intf * intf, int argc, char **argv)
}
} else {
/* loop through each parameter and value until we have neither */
- while ((argv[1] != NULL) && (argv[2] != NULL)) {
+ while (argv[1] && argv[2]) {
rc = ipmi_dcmi_pwr_slimit(intf, argv[1], argv[2]);
/* catch any error that the set limit function returned */
if (rc > 0) {
print_strs(dcmi_pwrmgmt_set_usage_vals,
- "set_limit <parameter> <value>", LOG_ERR, 0);
+ "set_limit <parameter> <value>", LOG_ERR, 0);
return -1;
}
/* the first argument is the command and the second is the
@@ -3416,11 +3530,11 @@ ipmi_dcmi_parse_power(struct ipmi_intf * intf, int argc, char **argv)
switch (str2val2(argv[0], dcmi_pwrmgmt_vals)) {
case 0x00:
/* get reading */
- if (argv[1] != NULL) {
+ if (argv[1]) {
if (!(sample_time = str2val2(argv[1], dcmi_sampling_vals))) {
print_strs(dcmi_sampling_vals,
- "Invalid sample time. Valid times are: ",
- LOG_ERR, 1);
+ "Invalid sample time. Valid times are: ",
+ LOG_ERR, 1);
printf("\n");
return -1;
}
@@ -3439,8 +3553,8 @@ ipmi_dcmi_parse_power(struct ipmi_intf * intf, int argc, char **argv)
/* set limit */
if (argc < 4) {
print_strs(dcmi_pwrmgmt_set_usage_vals,
- "set_limit <parameter> <value>",
- LOG_ERR, 0);
+ "set_limit <parameter> <value>",
+ LOG_ERR, 0);
return -1;
}
if (ipmi_dcmi_set_limit(intf, argc, argv) < 0)
@@ -3458,7 +3572,7 @@ ipmi_dcmi_parse_power(struct ipmi_intf * intf, int argc, char **argv)
default:
/* no valid options */
print_strs(dcmi_pwrmgmt_vals,
- "power <command>", LOG_ERR, 0);
+ "power <command>", LOG_ERR, 0);
break;
}
return rc;
@@ -3488,14 +3602,14 @@ ipmi_dcmi_thermalpolicy(struct ipmi_intf * intf, int argc, char **argv)
}
if (str2uchar(argv[2], &entityID) != 0) {
lprintf(LOG_ERR,
- "Given Entity ID '%s' is invalid.",
- argv[2]);
+ "Given Entity ID '%s' is invalid.",
+ argv[2]);
return (-1);
}
if (str2uchar(argv[3], &entityInst) != 0) {
lprintf(LOG_ERR,
- "Given Instance ID '%s' is invalid.",
- argv[3]);
+ "Given Instance ID '%s' is invalid.",
+ argv[3]);
return (-1);
}
rc = ipmi_dcmi_getthermalpolicy(intf, entityID, entityInst);
@@ -3505,24 +3619,24 @@ ipmi_dcmi_thermalpolicy(struct ipmi_intf * intf, int argc, char **argv)
lprintf(LOG_NOTICE, "Set <entityID> <instanceID>");
return -1;
} else if (argc < 9) {
- print_strs(dcmi_thermalpolicy_set_parameters_vals,
- "Set thermalpolicy instance parameters: "
- "<volatile/nonvolatile/disabled> "
- "<poweroff/nopoweroff/disabled> "
- "<sel/nosel/disabled> <templimitByte> <exceptionTime>",
- LOG_ERR, 0);
+ print_strs(dcmi_thermalpolicy_set_parameters_vals,
+ "Set thermalpolicy instance parameters: "
+ "<volatile/nonvolatile/disabled> "
+ "<poweroff/nopoweroff/disabled> "
+ "<sel/nosel/disabled> <templimitByte> <exceptionTime>",
+ LOG_ERR, 0);
return -1;
}
if (str2uchar(argv[2], &entityID) != 0) {
lprintf(LOG_ERR,
- "Given Entity ID '%s' is invalid.",
- argv[2]);
+ "Given Entity ID '%s' is invalid.",
+ argv[2]);
return (-1);
}
if (str2uchar(argv[3], &entityInst) != 0) {
lprintf(LOG_ERR,
- "Given Instance ID '%s' is invalid.",
- argv[3]);
+ "Given Instance ID '%s' is invalid.",
+ argv[3]);
return (-1);
}
persistanceFlag = (uint8_t) str2val2(argv[4], dcmi_thermalpolicy_set_parameters_vals);
@@ -3530,14 +3644,14 @@ ipmi_dcmi_thermalpolicy(struct ipmi_intf * intf, int argc, char **argv)
actionLogToSEL = (uint8_t) str2val2(argv[6], dcmi_thermalpolicy_set_parameters_vals);
if (str2uchar(argv[7], &tempLimit) != 0) {
lprintf(LOG_ERR,
- "Given Temp Limit '%s' is invalid.",
- argv[7]);
+ "Given Temp Limit '%s' is invalid.",
+ argv[7]);
return (-1);
}
if (str2ushort(argv[8], &samplingTime) != 0) {
lprintf(LOG_ERR,
- "Given Sampling Time '%s' is invalid.",
- argv[8]);
+ "Given Sampling Time '%s' is invalid.",
+ argv[8]);
return (-1);
}
samplingTimeLSB = (samplingTime & 0xFF);
@@ -3556,8 +3670,8 @@ ipmi_dcmi_thermalpolicy(struct ipmi_intf * intf, int argc, char **argv)
break;
default:
print_strs(dcmi_thermalpolicy_vals,
- "thermalpolicy <command>",
- LOG_ERR, 0);
+ "thermalpolicy <command>",
+ LOG_ERR, 0);
return -1;
}
return rc;
@@ -3576,20 +3690,20 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
int i;
struct ipmi_rs *rsp;
- if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
+ if (!argc || !strcmp(argv[0], "help")) {
print_strs(dcmi_cmd_vals,
- "Data Center Management Interface commands",
- LOG_ERR, 0);
+ "Data Center Management Interface commands",
+ LOG_ERR, 0);
return -1;
}
/* start the cmd requested */
switch (str2val2(argv[0], dcmi_cmd_vals)) {
case 0x00:
/* discover capabilities*/
- for (i = 1; dcmi_capable_vals[i-1].str != NULL; i++) {
+ for (i = 1; dcmi_capable_vals[i-1].str; i++) {
if (ipmi_dcmi_prnt_getcapabilities(intf, i) < 0) {
lprintf(LOG_ERR,"Error discovering %s capabilities!\n",
- val2str2(i, dcmi_capable_vals));
+ val2str2(i, dcmi_capable_vals));
return -1;
}
}
@@ -3597,9 +3711,9 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
case 0x01:
/* power */
argv++;
- if (argv[0] == NULL) {
+ if (!argv[0]) {
print_strs(dcmi_pwrmgmt_vals, "power <command>",
- LOG_ERR, 0);
+ LOG_ERR, 0);
return -1;
}
rc = ipmi_dcmi_parse_power(intf, argc, argv);
@@ -3611,10 +3725,10 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
* and if it exists, print the sdr record id(s) for it.
* Use the val from each one as the sensor number.
*/
- for (i = 0; dcmi_discvry_snsr_vals[i].str != NULL; i++) {
+ for (i = 0; dcmi_discvry_snsr_vals[i].str; i++) {
/* get all of the information about this sensor */
rc = ipmi_dcmi_prnt_discvry_snsr(intf,
- dcmi_discvry_snsr_vals[i].val);
+ dcmi_discvry_snsr_vals[i].val);
}
break;
/* end sensor print */
@@ -3631,8 +3745,8 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
/* set asset tag */
if (argc == 1 ) {
print_strs(dcmi_cmd_vals,
- "Data Center Management Interface commands",
- LOG_ERR, 0);
+ "Data Center Management Interface commands",
+ LOG_ERR, 0);
return -1;
}
if (ipmi_dcmi_prnt_setassettag(intf, (uint8_t *)argv[1]) < 0) {
@@ -3646,7 +3760,7 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
/* get management controller identifier string */
if (ipmi_dcmi_prnt_getmngctrlids(intf) < 0) {
lprintf(LOG_ERR,
- "Error getting management controller identifier string!");
+ "Error getting management controller identifier string!");
return -1;
}
break;
@@ -3656,13 +3770,13 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
/* set management controller identifier string */
if (argc == 1 ) {
print_strs(dcmi_cmd_vals,
- "Data Center Management Interface commands",
- LOG_ERR, 0);
+ "Data Center Management Interface commands",
+ LOG_ERR, 0);
return -1;
}
if (ipmi_dcmi_prnt_setmngctrlids(intf, (uint8_t *)argv[1]) < 0) {
lprintf(LOG_ERR,
- "Error setting management controller identifier string!");
+ "Error setting management controller identifier string!");
return -1;
}
break;
@@ -3675,14 +3789,14 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
case 0x08:
if(ipmi_dcmi_prnt_get_temp_readings(intf) < 0 ) {
lprintf(LOG_ERR,
- "Error get temperature readings!");
+ "Error get temperature readings!");
return -1;
}
break;
case 0x09:
if(ipmi_dcmi_prnt_getconfparam(intf) < 0 ) {
lprintf(LOG_ERR,
- "Error Get DCMI Configuration Parameters!");
+ "Error Get DCMI Configuration Parameters!");
return -1;
};
break;
@@ -3690,46 +3804,44 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
{
switch (argc) {
case 2:
- if (strncmp(argv[1], "activate_dhcp", 13) != 0) {
+ if (strcmp(argv[1], "activate_dhcp")) {
print_strs( dcmi_conf_param_vals,
- "DCMI Configuration Parameters",
- LOG_ERR, 0);
+ "DCMI Configuration Parameters",
+ LOG_ERR, 0);
return -1;
}
break;
default:
- if (argc != 3 || strncmp(argv[1], "help", 4) == 0) {
+ if (argc != 3 || !strcmp(argv[1], "help")) {
print_strs(dcmi_conf_param_vals,
- "DCMI Configuration Parameters",
- LOG_ERR, 0);
+ "DCMI Configuration Parameters",
+ LOG_ERR, 0);
return -1;
}
}
- if (strncmp(argv[1], "activate_dhcp", 13) == 0) {
+ if (!strcmp(argv[1], "activate_dhcp")) {
rsp = ipmi_dcmi_setconfparam(intf, 1, 1);
} else {
uint16_t tmp_val = 0;
if (str2ushort(argv[2], &tmp_val) != 0) {
- lprintf(LOG_ERR,
- "Given %s '%s' is invalid.",
- argv[1], argv[2]);
+ lprintf(LOG_ERR, "Given %s '%s' is invalid.",
+ argv[1], argv[2]);
return (-1);
}
rsp = ipmi_dcmi_setconfparam(intf,
- str2val2(argv[1], dcmi_conf_param_vals),
- tmp_val);
+ str2val2(argv[1], dcmi_conf_param_vals),
+ tmp_val);
}
if (chk_rsp(rsp)) {
- lprintf(LOG_ERR,
- "Error Set DCMI Configuration Parameters!");
+ lprintf(LOG_ERR, "Error Set DCMI Configuration Parameters!");
}
break;
}
case 0x0B:
{
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR,
- "\nOOB discovery is available only via RMCP interface.");
+ "\nOOB discovery is available only via RMCP interface.");
return -1;
}
if(ipmi_dcmi_prnt_oobDiscover(intf) < 0) {
@@ -3741,8 +3853,8 @@ ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char **argv)
default:
/* couldn't detect what the user entered */
print_strs(dcmi_cmd_vals,
- "Data Center Management Interface commands",
- LOG_ERR, 0);
+ "Data Center Management Interface commands",
+ LOG_ERR, 0);
return -1;
break;
}
@@ -3761,10 +3873,10 @@ ipmi_nm_main(struct ipmi_intf * intf, int argc, char **argv)
{
struct nm_discover disc;
- if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
+ if (!argc || !strcmp(argv[0], "help")) {
print_strs(nm_cmd_vals,
- "Node Manager Interface commands",
- LOG_ERR, 0);
+ "Node Manager Interface commands",
+ LOG_ERR, 0);
return -1;
}
@@ -3775,7 +3887,7 @@ ipmi_nm_main(struct ipmi_intf * intf, int argc, char **argv)
return -1;
printf(" Node Manager Version %s\n", val2str2(disc.nm_version, nm_version_vals));
printf(" revision %d.%d%d patch version %d\n", disc.major_rev,
- disc.minor_rev>>4, disc.minor_rev&0xf, disc.patch_version);
+ disc.minor_rev>>4, disc.minor_rev&0xf, disc.patch_version);
break;
/* capability */
case 0x01:
@@ -3846,37 +3958,38 @@ ipmi_print_sensor_info(struct ipmi_intf *intf, uint16_t rec_id)
uint8_t *rec = NULL;
itr = ipmi_sdr_start(intf, 0);
- if (itr == NULL) {
+ if (!itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return (-1);
}
- while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, itr))) {
if (header->id == rec_id) {
break;
}
}
- if (header == NULL) {
+ if (!header) {
lprintf(LOG_DEBUG, "header == NULL");
- ipmi_sdr_end(intf, itr);
+ ipmi_sdr_end(itr);
return (-1);
}
/* yes, we found the SDR for this record ID, now get full record */
rec = ipmi_sdr_get_record(intf, header, itr);
- if (rec == NULL) {
+ if (!rec) {
lprintf(LOG_DEBUG, "rec == NULL");
- ipmi_sdr_end(intf, itr);
+ ipmi_sdr_end(itr);
return (-1);
}
if ((header->type == SDR_RECORD_TYPE_FULL_SENSOR) ||
- (header->type == SDR_RECORD_TYPE_COMPACT_SENSOR)) {
+ (header->type == SDR_RECORD_TYPE_COMPACT_SENSOR))
+ {
rc = ipmi_sdr_print_rawentry(intf, header->type,
- rec, header->length);
+ rec, header->length);
} else {
rc = (-1);
}
free(rec);
rec = NULL;
- ipmi_sdr_end(intf, itr);
+ ipmi_sdr_end(itr);
return rc;
}
diff --git a/lib/ipmi_delloem.c b/lib/ipmi_delloem.c
index 9bb0885..e868913 100644
--- a/lib/ipmi_delloem.c
+++ b/lib/ipmi_delloem.c
@@ -62,6 +62,7 @@
#include <ipmitool/ipmi_entity.h>
#include <ipmitool/ipmi_fru.h>
#include <ipmitool/ipmi_sensor.h>
+#include <ipmitool/ipmi_time.h>
#define DELL_OEM_NETFN (uint8_t)(0x30)
#define GET_IDRAC_VIRTUAL_MAC (uint8_t)(0xC9)
@@ -170,12 +171,10 @@ static int ipmi_lcd_get_status(struct ipmi_intf *intf);
static int ipmi_lcd_set_kvm(struct ipmi_intf *intf, char status);
static int ipmi_lcd_set_lock(struct ipmi_intf *intf, char lock);
static int ipmi_lcd_set_single_line_text(struct ipmi_intf *intf, char *text);
-static int ipmi_lcd_set_text(struct ipmi_intf *intf, char *text,
- int line_number);
+static int ipmi_lcd_set_text(struct ipmi_intf *intf, char *text);
static int ipmi_lcd_configure_wh(struct ipmi_intf *intf, uint32_t mode,
- uint16_t lcdquallifier, uint8_t errordisp, int8_t line_number, char *text);
-static int ipmi_lcd_configure(struct ipmi_intf *intf, int command,
- int8_t line_number, char *text);
+ uint16_t lcdquallifier, uint8_t errordisp, char *text);
+static int ipmi_lcd_configure(struct ipmi_intf *intf, int command, char *text);
static void ipmi_lcd_usage(void);
/* MAC Function prototypes */
static int ipmi_delloem_mac_main(struct ipmi_intf *intf, int argc, char **argv);
@@ -201,7 +200,6 @@ static int ipmi_lan_set_nic_selection_12g(struct ipmi_intf *intf,
/* Power monitor Function prototypes */
static int ipmi_delloem_powermonitor_main(struct ipmi_intf *intf, int argc,
char **argv);
-static void ipmi_time_to_str(time_t rawTime, char *strTime);
static int ipmi_get_sensor_reading(struct ipmi_intf *intf,
unsigned char sensorNumber, SensorReadingType *pSensorReadingData);
static int ipmi_get_power_capstatus_command(struct ipmi_intf *intf);
@@ -271,25 +269,25 @@ ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = 0;
current_arg = 0;
- if (argc == 0 || strncmp(argv[0], "help\0", 5) == 0) {
+ if (!argc || !strcmp(argv[0], "help")) {
usage();
return 0;
}
- if (0 ==strncmp(argv[current_arg], "lcd\0", 4)) {
+ if (0 ==strcmp(argv[current_arg], "lcd")) {
rc = ipmi_delloem_lcd_main(intf,argc,argv);
- } else if (strncmp(argv[current_arg], "mac\0", 4) == 0) {
+ } else if (!strcmp(argv[current_arg], "mac")) {
/* mac address*/
rc = ipmi_delloem_mac_main(intf,argc,argv);
- } else if (strncmp(argv[current_arg], "lan\0", 4) == 0) {
+ } else if (!strcmp(argv[current_arg], "lan")) {
/* lan address*/
rc = ipmi_delloem_lan_main(intf,argc,argv);
- } else if (strncmp(argv[current_arg], "setled\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "setled")) {
/* SetLED support */
rc = ipmi_delloem_setled_main(intf,argc,argv);
- } else if (strncmp(argv[current_arg], "powermonitor\0", 13) == 0) {
+ } else if (!strcmp(argv[current_arg], "powermonitor")) {
/*Powermanagement report processing*/
rc = ipmi_delloem_powermonitor_main(intf,argc,argv);
- } else if (strncmp(argv[current_arg], "vFlash\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "vFlash")) {
/* vFlash Support */
rc = ipmi_delloem_vFlash_main(intf,argc,argv);
} else {
@@ -361,7 +359,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
/* ipmitool delloem lcd info*/
- if (argc == 1 || strcmp(argv[current_arg], "help") == 0) {
+ if (argc == 1 || !strcmp(argv[current_arg], "help")) {
ipmi_lcd_usage();
return 0;
}
@@ -370,15 +368,15 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
if (!IsLCDSupported()) {
lprintf(LOG_ERR, "lcd is not supported on this system.");
return -1;
- } else if (strncmp(argv[current_arg], "info\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "info")) {
if (iDRAC_FLAG_ALL) {
rc = ipmi_lcd_get_info_wh(intf);
} else {
rc = ipmi_lcd_get_info(intf);
}
- } else if (strncmp(argv[current_arg], "status\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "status")) {
rc = ipmi_lcd_get_status(intf);
- } else if (strncmp(argv[current_arg], "set\0", 4) == 0) {
+ } else if (!strcmp(argv[current_arg], "set")) {
/* ipmitool delloem lcd set*/
uint8_t line_number = 0;
current_arg++;
@@ -386,7 +384,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_lcd_usage();
return -1;
}
- if (strncmp(argv[current_arg], "line\0", 5) == 0) {
+ if (!strcmp(argv[current_arg], "line")) {
current_arg++;
if (argc <= current_arg) {
usage();
@@ -404,164 +402,170 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
}
- if ((strncmp(argv[current_arg], "mode\0", 5) == 0)
- && (iDRAC_FLAG_ALL)) {
+ if (!strcmp(argv[current_arg], "mode")
+ && iDRAC_FLAG_ALL)
+ {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
return -1;
}
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_lcd_usage();
return -1;
}
- if (strncmp(argv[current_arg], "none\0", 5) == 0) {
+ if (!strcmp(argv[current_arg], "none")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_NONE, 0xFF,
- 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "modelname\0", 10) == 0) {
+ 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "modelname")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0xFF,
- 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "userdefined\0", 12) == 0) {
+ 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "userdefined")) {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
return -1;
}
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
- 0xFF, 0XFF, line_number, argv[current_arg]);
- } else if (strncmp(argv[current_arg], "ipv4address\0", 12) == 0) {
+ 0xFF, 0XFF, argv[current_arg]);
+ } else if (!strcmp(argv[current_arg], "ipv4address")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV4ADRESS,
- 0xFF, 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "macaddress\0", 11) == 0) {
+ 0xFF, 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "macaddress")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_IDRAC_MAC_ADDRESS,
- 0xFF, 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "systemname\0", 11) == 0) {
+ 0xFF, 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "systemname")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_OS_SYSTEM_NAME, 0xFF,
- 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "servicetag\0", 11) == 0) {
+ 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "servicetag")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SERVICE_TAG, 0xFF,
- 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "ipv6address\0", 12) == 0) {
+ 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "ipv6address")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV6ADRESS,
- 0xFF, 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "ambienttemp\0", 12) == 0) {
+ 0xFF, 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "ambienttemp")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_AMBEINT_TEMP, 0xFF,
- 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "systemwatt\0", 11) == 0) {
+ 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "systemwatt")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SYSTEM_WATTS, 0xFF,
- 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "assettag\0", 9) == 0) {
+ 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "assettag")) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_ASSET_TAG, 0xFF,
- 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
+ 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "help")) {
ipmi_lcd_usage();
} else {
lprintf(LOG_ERR, "Invalid DellOEM command: %s",
argv[current_arg]);
ipmi_lcd_usage();
}
- } else if ((strncmp(argv[current_arg], "lcdqualifier\0", 13) == 0)
- && (iDRAC_FLAG_ALL)) {
+ } else if (!strcmp(argv[current_arg], "lcdqualifier")
+ && iDRAC_FLAG_ALL)
+ {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
return -1;
}
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_lcd_usage();
return -1;
}
- if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
- rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x00, 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "btuphr\0",7) == 0) {
- rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x01, 0XFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "celsius\0", 8) == 0) {
- rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x02, 0xFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "fahrenheit", 11) == 0) {
- rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x03, 0xFF, 0, NULL);
- } else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
+ if (!strcmp(argv[current_arg], "watt")) {
+ rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x00, 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "btuphr")) {
+ rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x01, 0XFF, NULL);
+ } else if (!strcmp(argv[current_arg], "celsius")) {
+ rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x02, 0xFF, NULL);
+ } else if (!strcmp(argv[current_arg], "fahrenheit")) {
+ rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x03, 0xFF, NULL);
+ } else if (!strcmp(argv[current_arg], "help")) {
ipmi_lcd_usage();
} else {
lprintf(LOG_ERR, "Invalid DellOEM command: %s",
argv[current_arg]);
ipmi_lcd_usage();
}
- } else if ((strncmp(argv[current_arg], "errordisplay\0", 13) == 0)
- && (iDRAC_FLAG_ALL)) {
+ } else if (!strcmp(argv[current_arg], "errordisplay")
+ && iDRAC_FLAG_ALL)
+ {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
return -1;
}
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_lcd_usage();
return -1;
}
- if (strncmp(argv[current_arg], "sel\0", 4) == 0) {
+ if (!strcmp(argv[current_arg], "sel")) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
- IPMI_DELL_LCD_ERROR_DISP_SEL, 0, NULL);
- } else if (strncmp(argv[current_arg], "simple\0", 7) == 0) {
+ IPMI_DELL_LCD_ERROR_DISP_SEL, NULL);
+ } else if (!strcmp(argv[current_arg], "simple")) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
- IPMI_DELL_LCD_ERROR_DISP_VERBOSE, 0, NULL);
- } else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
+ IPMI_DELL_LCD_ERROR_DISP_VERBOSE, NULL);
+ } else if (!strcmp(argv[current_arg], "help")) {
ipmi_lcd_usage();
} else {
lprintf(LOG_ERR, "Invalid DellOEM command: %s",
argv[current_arg]);
ipmi_lcd_usage();
}
- } else if ((strncmp(argv[current_arg], "none\0", 5) == 0)
- && (iDRAC_FLAG==0)) {
- rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_NONE, 0, NULL);
- } else if ((strncmp(argv[current_arg], "default\0", 8) == 0)
- && (iDRAC_FLAG==0)) {
- rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0, NULL);
- } else if ((strncmp(argv[current_arg], "custom\0", 7) == 0)
- && (iDRAC_FLAG==0)) {
+ } else if (!strcmp(argv[current_arg], "none")
+ && iDRAC_FLAG==0)
+ {
+ rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_NONE, NULL);
+ } else if (!strcmp(argv[current_arg], "default")
+ && iDRAC_FLAG==0)
+ {
+ rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, NULL);
+ } else if (!strcmp(argv[current_arg], "custom")
+ && iDRAC_FLAG==0)
+ {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
return -1;
}
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
- line_number, argv[current_arg]);
- } else if (strncmp(argv[current_arg], "vkvm\0", 5) == 0) {
+ argv[current_arg]);
+ } else if (!strcmp(argv[current_arg], "vkvm")) {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
return -1;
}
- if (strncmp(argv[current_arg], "active\0", 7) == 0) {
+ if (!strcmp(argv[current_arg], "active")) {
rc = ipmi_lcd_set_kvm(intf, 1);
- } else if (strncmp(argv[current_arg], "inactive\0", 9) == 0) {
+ } else if (!strcmp(argv[current_arg], "inactive")) {
rc = ipmi_lcd_set_kvm(intf, 0);
- } else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "help")) {
ipmi_lcd_usage();
} else {
lprintf(LOG_ERR, "Invalid DellOEM command: %s",
argv[current_arg]);
ipmi_lcd_usage();
}
- } else if (strncmp(argv[current_arg], "frontpanelaccess\0", 17) == 0) {
+ } else if (!strcmp(argv[current_arg], "frontpanelaccess")) {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
return -1;
}
- if (strncmp(argv[current_arg], "viewandmodify\0", 14) == 0) {
+ if (!strcmp(argv[current_arg], "viewandmodify")) {
rc = ipmi_lcd_set_lock(intf, 0);
- } else if (strncmp(argv[current_arg], "viewonly\0", 9)==0) {
+ } else if (strcmp(argv[current_arg], "viewonly")==0) {
rc = ipmi_lcd_set_lock(intf, 1);
- } else if (strncmp(argv[current_arg], "disabled\0", 9)==0) {
+ } else if (strcmp(argv[current_arg], "disabled")==0) {
rc = ipmi_lcd_set_lock(intf, 2);
- } else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "help")) {
ipmi_lcd_usage();
} else {
lprintf(LOG_ERR, "Invalid DellOEM command: %s",
argv[current_arg]);
ipmi_lcd_usage();
}
- } else if( (strncmp(argv[current_arg], "help\0", 5) == 0)
+ } else if( (!strcmp(argv[current_arg], "help"))
&& (iDRAC_FLAG==0)) {
ipmi_lcd_usage();
} else {
@@ -1201,17 +1205,17 @@ ipmi_lcd_set_kvm(struct ipmi_intf * intf, char status)
req.msg.data_len = 5;
req.msg.data = data;
data[0] = IPMI_DELL_LCD_STATUS_SELECTOR;
- data[1] = status; /* active- incative*/
+ data[1] = status; /* active- inactive */
data[2] = lcdstatus.lock_status; /* full-veiw-locked */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error setting LCD status");
rc= -1;
} else if ((rsp->ccode == 0xc1) || (rsp->ccode == 0xcb)) {
lprintf(LOG_ERR, "Error getting LCD status: "
"Command not supported on this system.");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error setting LCD status: %s",
val2str(rsp->ccode, completion_code_vals));
rc= -1;
@@ -1223,7 +1227,7 @@ ipmi_lcd_set_kvm(struct ipmi_intf * intf, char status)
*
* Description: This function sets lcd access mode
* Input: intf - ipmi interface
- * lock - View and modify / View only / Diabled
+ * lock - View and modify / View only / Disabled
* Output:
* Return: -1 on error
* 0 if successful
@@ -1247,17 +1251,17 @@ ipmi_lcd_set_lock(struct ipmi_intf * intf, char lock)
req.msg.data_len = 5;
req.msg.data = data;
data[0] = IPMI_DELL_LCD_STATUS_SELECTOR;
- data[1] = lcdstatus.vKVM_status; /* active- incative */
+ data[1] = lcdstatus.vKVM_status; /* active- inactive */
data[2] = lock; /* full- veiw-locked */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error setting LCD status");
rc = -1;
} else if ((rsp->ccode == 0xc1) || (rsp->ccode == 0xcb)) {
lprintf(LOG_ERR, "Error getting LCD status: "
"Command not supported on this system.");
rc = -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error setting LCD status: %s",
val2str(rsp->ccode, completion_code_vals));
rc= -1;
@@ -1332,13 +1336,12 @@ ipmi_lcd_set_single_line_text(struct ipmi_intf * intf, char * text)
* Description: This function sets lcd line text
* Input: intf - ipmi interface
* text - lcd string
- * line_number- line number
* Output:
* Return: -1 on error
* 0 if successful
*/
static int
-ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
+ipmi_lcd_set_text(struct ipmi_intf * intf, char * text)
{
int rc = 0;
IPMI_DELL_LCD_CAPS lcd_caps;
@@ -1367,7 +1370,6 @@ ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
* Input: intf - ipmi interface
* lcdquallifier- lcd quallifier
* errordisp - error number
- * line_number-line number
* text - lcd string
* Output:
* Return: -1 on error
@@ -1375,12 +1377,12 @@ ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
*/
static int
ipmi_lcd_configure_wh(struct ipmi_intf * intf, uint32_t mode,
- uint16_t lcdquallifier, uint8_t errordisp, int8_t line_number, char * text)
+ uint16_t lcdquallifier, uint8_t errordisp, char * text)
{
int rc = 0;
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == mode) {
/* Any error was reported earlier. */
- rc = ipmi_lcd_set_text(intf, text, line_number);
+ rc = ipmi_lcd_set_text(intf, text);
}
if (rc == 0) {
rc = ipmi_lcd_set_configure_command_wh(intf, mode ,lcdquallifier,errordisp);
@@ -1393,19 +1395,17 @@ ipmi_lcd_configure_wh(struct ipmi_intf * intf, uint32_t mode,
* Description: This function updates the current lcd configuration
* Input: intf - ipmi interface
* command- lcd command
- * line_number-line number
* text - lcd string
* Output:
* Return: -1 on error
* 0 if successful
*/
static int
-ipmi_lcd_configure(struct ipmi_intf * intf, int command,
- int8_t line_number, char * text)
+ipmi_lcd_configure(struct ipmi_intf * intf, int command, char * text)
{
int rc = 0;
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == command) {
- rc = ipmi_lcd_set_text(intf, text, line_number);
+ rc = ipmi_lcd_set_text(intf, text);
}
if (rc == 0) {
rc = ipmi_lcd_set_configure_command(intf, command);
@@ -1515,18 +1515,18 @@ ipmi_delloem_mac_main(struct ipmi_intf * intf, int argc, char ** argv)
int rc = 0;
int currIdInt = -1;
current_arg++;
- if (argc > 1 && strcmp(argv[current_arg], "help") == 0) {
+ if (argc > 1 && !strcmp(argv[current_arg], "help")) {
ipmi_mac_usage();
return 0;
}
ipmi_idracvalidator_command(intf);
if (argc == 1) {
rc = ipmi_macinfo(intf, 0xff);
- } else if (strncmp(argv[current_arg], "list\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "list")) {
rc = ipmi_macinfo(intf, 0xff);
- } else if (strncmp(argv[current_arg], "get\0", 4) == 0) {
+ } else if (!strcmp(argv[current_arg], "get")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_mac_usage();
return -1;
}
@@ -1595,24 +1595,22 @@ ipmi_macinfo_drac_idrac_virtual_mac(struct ipmi_intf* intf,uint8_t NicNum)
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- return -1;
- }
- if (rsp->ccode > 0) {
+ if (!rsp || rsp->ccode) {
return -1;
}
+
if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)
|| (IMC_IDRAC_13G_MODULAR == IMC_Type)
|| (IMC_IDRAC_13G_MONOLITHIC== IMC_Type)) {
- /* Get the Chasiss Assigned MAC Addresss for 12g Only */
+ /* Get the Chasiss Assigned MAC Address for 12g Only */
memcpy(VirtualMacAddress, ((rsp->data) + 1), MACADDRESSLENGH);
for (i = 0; i < MACADDRESSLENGH; i++) {
if (VirtualMacAddress[i] != 0) {
UseVirtualMacAddress = 1;
}
}
- /* Get the Server Assigned MAC Addresss for 12g Only */
+ /* Get the Server Assigned MAC Address for 12g Only */
if (!UseVirtualMacAddress) {
memcpy(VirtualMacAddress, ((rsp->data) + 1 + MACADDRESSLENGH),
MACADDRESSLENGH);
@@ -1652,11 +1650,7 @@ ipmi_macinfo_drac_idrac_virtual_mac(struct ipmi_intf* intf,uint8_t NicNum)
printf("\niDRAC6 MAC Address ");
}
- for (j = 0; j < 5; j++) {
- printf("%02x:", VirtualMacAddress[j]);
- }
- printf("%02x", VirtualMacAddress[j]);
- printf("\n");
+ printf("%s\n", mac2str(VirtualMacAddress));
return 0;
}
/*
@@ -1694,11 +1688,11 @@ ipmi_macinfo_drac_idrac_mac(struct ipmi_intf* intf,uint8_t NicNum)
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting MAC Address");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting MAC Address (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1724,11 +1718,7 @@ ipmi_macinfo_drac_idrac_mac(struct ipmi_intf* intf,uint8_t NicNum)
printf("\niDRAC6 MAC Address ");
}
- for (j = 0; j < 5; j++) {
- printf("%02x:", iDRAC6MacAddressByte[j]);
- }
- printf("%02x", iDRAC6MacAddressByte[j]);
- printf("\n");
+ printf("%s\n", mac2str(iDRAC6MacAddressByte));
return 0;
}
/*
@@ -1764,11 +1754,11 @@ ipmi_macinfo_10g(struct ipmi_intf* intf, uint8_t NicNum)
req.msg.data = msg_data;
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting MAC Address");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting MAC Address (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1786,13 +1776,8 @@ ipmi_macinfo_10g(struct ipmi_intf* intf, uint8_t NicNum)
for (i = 0; i < Total_No_NICs; i++) {
if ((0xff == NicNum) || (i == NicNum)) {
printf("\n%d",i);
- printf("\t\t");
- for (j = 0 ; j < 5; j++) {
- printf("%02x:",
- EmbeddedNICMacAddress_10G.MacAddress[i].MacAddressByte[j]);
- }
- printf("%02x",
- EmbeddedNICMacAddress_10G.MacAddress[i].MacAddressByte[j]);
+ printf("\t\t%s",
+ mac2str(EmbeddedNICMacAddress_10G.MacAddress[i].MacAddressByte));
}
}
printf("\n");
@@ -1843,11 +1828,11 @@ ipmi_macinfo_11g(struct ipmi_intf* intf, uint8_t NicNum)
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting MAC Address");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting MAC Address (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1874,11 +1859,11 @@ ipmi_macinfo_11g(struct ipmi_intf* intf, uint8_t NicNum)
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting MAC Address");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting MAC Address (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1889,13 +1874,7 @@ ipmi_macinfo_11g(struct ipmi_intf* intf, uint8_t NicNum)
if ((0xff==NicNum)
|| (NicNum == EmbeddedNICMacAddress.LOMMacAddress[i].NICNumber)) {
printf("\n%d",EmbeddedNICMacAddress.LOMMacAddress[i].NICNumber);
- printf("\t\t");
- for (j = 0; j < 5; j++) {
- printf("%02x:",
- EmbeddedNICMacAddress.LOMMacAddress[i].MacAddressByte[j]);
- }
- printf("%02x",
- EmbeddedNICMacAddress.LOMMacAddress[i].MacAddressByte[j]);
+ printf("\t\t%s", mac2str(EmbeddedNICMacAddress.LOMMacAddress[i].MacAddressByte));
if (LOM_ETHERNET_ENABLED
== EmbeddedNICMacAddress.LOMMacAddress[i].EthernetStatus) {
@@ -1969,7 +1948,7 @@ ipmi_mac_usage(void)
*
* Description: This function processes the delloem lan command
* Input: intf - ipmi interface
- * argc - no of arguments
+ * argc - no of arguments (unused, left in for calling consistency)
* argv - argument string array
* Output:
*
@@ -1977,13 +1956,13 @@ ipmi_mac_usage(void)
* -1 - failure
*/
static int
-ipmi_delloem_lan_main(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_delloem_lan_main(struct ipmi_intf * intf, int __UNUSED__(argc), char ** argv)
{
int rc = 0;
int nic_selection = 0;
char nic_set[2] = {0};
current_arg++;
- if (argv[current_arg] == NULL || strcmp(argv[current_arg], "help") == 0) {
+ if (!argv[current_arg] || !strcmp(argv[current_arg], "help")) {
ipmi_lan_usage();
return 0;
}
@@ -1991,9 +1970,9 @@ ipmi_delloem_lan_main(struct ipmi_intf * intf, int argc, char ** argv)
if (!IsLANSupported()) {
lprintf(LOG_ERR, "lan is not supported on this system.");
return -1;
- } else if (strncmp(argv[current_arg], "set\0", 4) == 0) {
+ } else if (!strcmp(argv[current_arg], "set")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_lan_usage();
return -1;
}
@@ -2027,12 +2006,12 @@ ipmi_delloem_lan_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = ipmi_lan_set_nic_selection(intf,nic_selection);
}
return 0;
- } else if (strncmp(argv[current_arg], "get\0", 4) == 0) {
+ } else if (!strcmp(argv[current_arg], "get")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
rc = ipmi_lan_get_nic_selection(intf);
return rc;
- } else if (strncmp(argv[current_arg], "active\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "active")) {
rc = ipmi_lan_get_active_nic(intf);
return rc;
} else {
@@ -2072,47 +2051,47 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
req.msg.data = msg_data;
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting nic selection");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting nic selection (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
}
nic_set[0] = rsp->data[0];
nic_set[1] = rsp->data[1];
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "dedicated\0", 10) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "dedicated")) {
nic_set[0] = 1;
nic_set[1] = 0;
return 0;
}
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "shared\0", 7) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "shared")) {
/* placeholder */
} else {
return INVALID;
}
current_arg++;
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "with\0", 5) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "with")) {
/* placeholder */
} else {
return INVALID;
}
current_arg++;
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "failover\0", 9) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "failover")) {
failover = 1;
}
if (failover) {
current_arg++;
}
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "lom1\0", 5) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "lom1")) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
@@ -2130,8 +2109,8 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
}
}
return 0;
- } else if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "lom2\0", 5) == 0) {
+ } else if (argv[current_arg]
+ && !strcmp(argv[current_arg], "lom2")) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
@@ -2149,8 +2128,8 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
}
}
return 0;
- } else if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "lom3\0", 5) == 0) {
+ } else if (argv[current_arg]
+ && !strcmp(argv[current_arg], "lom3")) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
@@ -2168,8 +2147,8 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
}
}
return 0;
- } else if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "lom4\0", 5) == 0) {
+ } else if (argv[current_arg]
+ && !strcmp(argv[current_arg], "lom4")) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
@@ -2187,8 +2166,8 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
}
}
return 0;
- } else if (failover && argv[current_arg] != NULL
- && strncmp(argv[current_arg], "none\0", 5) == 0) {
+ } else if (failover && argv[current_arg]
+ && !strcmp(argv[current_arg], "none")) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type) ) {
return INVAILD_SHARED_MODE;
}
@@ -2199,16 +2178,16 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
nic_set[1] = 0;
}
return 0;
- } else if (failover && argv[current_arg] != NULL
- && strncmp(argv[current_arg], "all\0", 4) == 0) {
+ } else if (failover && argv[current_arg]
+ && !strcmp(argv[current_arg], "all")) {
/* placeholder */
} else {
return INVALID;
}
current_arg++;
- if (failover && argv[current_arg] != NULL
- && strncmp(argv[current_arg], "loms\0", 5) == 0) {
+ if (failover && argv[current_arg]
+ && !strcmp(argv[current_arg], "loms")) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
@@ -2224,47 +2203,47 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
static int
get_nic_selection_mode(int current_arg, char ** argv)
{
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "dedicated\0", 10) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "dedicated")) {
return DEDICATED;
}
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "shared\0", 7) == 0) {
- if (argv[current_arg+1] == NULL) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "shared")) {
+ if (!argv[current_arg+1]) {
return SHARED;
}
}
current_arg++;
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "with\0", 5) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "with")) {
/* place holder */
} else {
return INVALID;
}
current_arg++;
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "failover\0", 9) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "failover")) {
/* place holder */
} else {
return INVALID;
}
current_arg++;
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "lom2\0", 5) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "lom2")) {
return SHARED_WITH_FAILOVER_LOM2;
- } else if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "all\0", 4) == 0) {
+ } else if (argv[current_arg]
+ && !strcmp(argv[current_arg], "all")) {
/* place holder */
} else {
return INVALID;
}
current_arg++;
- if (argv[current_arg] != NULL
- && strncmp(argv[current_arg], "loms\0", 5) == 0) {
+ if (argv[current_arg]
+ && !strcmp(argv[current_arg], "loms")) {
return SHARED_WITH_FAILOVER_ALL_LOMS;
}
return INVALID;
@@ -2287,7 +2266,7 @@ ipmi_lan_set_nic_selection_12g(struct ipmi_intf * intf, uint8_t * nic_selection)
req.msg.data = msg_data;
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in setting nic selection");
return -1;
} else if( (nic_selection[0] == 1)
@@ -2297,7 +2276,7 @@ ipmi_lan_set_nic_selection_12g(struct ipmi_intf * intf, uint8_t * nic_selection)
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error in setting nic selection (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2322,10 +2301,10 @@ ipmi_lan_set_nic_selection(struct ipmi_intf * intf, uint8_t nic_selection)
req.msg.data = msg_data;
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in setting nic selection");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error in setting nic selection (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2355,10 +2334,10 @@ ipmi_lan_get_nic_selection(struct ipmi_intf * intf)
req.msg.data = msg_data;
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting nic selection");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting nic selection (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2411,10 +2390,10 @@ ipmi_lan_get_active_nic(struct ipmi_intf * intf)
req.msg.data = msg_data;
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting Active LOM Status");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting Active LOM Status (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2430,10 +2409,10 @@ ipmi_lan_get_active_nic(struct ipmi_intf * intf)
req.msg.data = msg_data;
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting Active LOM Status");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting Active LOM Status (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2524,68 +2503,68 @@ ipmi_delloem_powermonitor_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = 0;
current_arg++;
- if (argc > 1 && strcmp(argv[current_arg], "help") == 0) {
+ if (argc > 1 && !strcmp(argv[current_arg], "help")) {
ipmi_powermonitor_usage();
return 0;
}
ipmi_idracvalidator_command(intf);
if (argc == 1) {
rc = ipmi_powermgmt(intf);
- } else if (strncmp(argv[current_arg], "status\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "status")) {
rc = ipmi_powermgmt(intf);
- } else if (strncmp(argv[current_arg], "clear\0", 6) == 0) {
+ } else if (!strcmp(argv[current_arg], "clear")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_powermonitor_usage();
return -1;
- } else if (strncmp(argv[current_arg], "peakpower\0", 10) == 0) {
+ } else if (!strcmp(argv[current_arg], "peakpower")) {
rc = ipmi_powermgmt_clear(intf, 1);
- } else if (strncmp(argv[current_arg], "cumulativepower\0", 16) == 0) {
+ } else if (!strcmp(argv[current_arg], "cumulativepower")) {
rc = ipmi_powermgmt_clear(intf, 0);
} else {
ipmi_powermonitor_usage();
return -1;
}
- } else if (strncmp(argv[current_arg], "powerconsumption\0", 17) == 0) {
+ } else if (!strcmp(argv[current_arg], "powerconsumption")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
rc = ipmi_print_get_power_consmpt_data(intf,watt);
- } else if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "watt")) {
rc = ipmi_print_get_power_consmpt_data(intf, watt);
- } else if (strncmp(argv[current_arg], "btuphr\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "btuphr")) {
rc = ipmi_print_get_power_consmpt_data(intf, btuphr);
} else {
ipmi_powermonitor_usage();
return -1;
}
- } else if (strncmp(argv[current_arg], "powerconsumptionhistory\0", 23) == 0) {
+ } else if (!strcmp(argv[current_arg], "powerconsumptionhistory")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
rc = ipmi_print_power_consmpt_history(intf,watt);
- } else if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "watt")) {
rc = ipmi_print_power_consmpt_history(intf, watt);
- } else if (strncmp(argv[current_arg], "btuphr\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "btuphr")) {
rc = ipmi_print_power_consmpt_history(intf, btuphr);
} else {
ipmi_powermonitor_usage();
return -1;
}
- } else if (strncmp(argv[current_arg], "getpowerbudget\0", 15) == 0) {
+ } else if (!strcmp(argv[current_arg], "getpowerbudget")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
rc=ipmi_print_power_cap(intf,watt);
- } else if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "watt")) {
rc = ipmi_print_power_cap(intf, watt);
- } else if (strncmp(argv[current_arg], "btuphr\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "btuphr")) {
rc = ipmi_print_power_cap(intf, btuphr);
} else {
ipmi_powermonitor_usage();
return -1;
}
- } else if (strncmp(argv[current_arg], "setpowerbudget\0", 15) == 0) {
+ } else if (!strcmp(argv[current_arg], "setpowerbudget")) {
int val;
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_powermonitor_usage();
return -1;
}
@@ -2600,21 +2579,21 @@ ipmi_delloem_powermonitor_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_powermonitor_usage();
- } else if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "watt")) {
rc = ipmi_set_power_cap(intf,watt,val);
- } else if (strncmp(argv[current_arg], "btuphr\0", 7) == 0) {
+ } else if (!strcmp(argv[current_arg], "btuphr")) {
rc = ipmi_set_power_cap(intf, btuphr,val);
- } else if (strncmp(argv[current_arg], "percent\0", 8) == 0) {
+ } else if (!strcmp(argv[current_arg], "percent")) {
rc = ipmi_set_power_cap(intf,percent,val);
} else {
ipmi_powermonitor_usage();
return -1;
}
- } else if (strncmp(argv[current_arg], "enablepowercap\0", 15) == 0) {
+ } else if (!strcmp(argv[current_arg], "enablepowercap")) {
ipmi_set_power_capstatus_command(intf,1);
- } else if (strncmp(argv[current_arg], "disablepowercap\0", 16) == 0) {
+ } else if (!strcmp(argv[current_arg], "disablepowercap")) {
ipmi_set_power_capstatus_command(intf,0);
} else {
ipmi_powermonitor_usage();
@@ -2622,24 +2601,7 @@ ipmi_delloem_powermonitor_main(struct ipmi_intf * intf, int argc, char ** argv)
}
return rc;
}
-/*
- * Function Name: ipmi_time_to_str
- *
- * Description: This function converts ipmi time format into gmtime format
- * Input: rawTime - ipmi time format
- * Output: strTime - gmtime format
- *
- * Return:
- */
-static void
-ipmi_time_to_str(time_t rawTime, char * strTime)
-{
- struct tm *tm;
- char *temp;
- tm = gmtime(&rawTime);
- temp = asctime(tm);
- strcpy(strTime,temp);
-}
+
/*
* Function Name: ipmi_get_sensor_reading
*
@@ -2664,19 +2626,19 @@ ipmi_get_sensor_reading(struct ipmi_intf *intf, unsigned char sensorNumber,
req.msg.cmd = GET_SENSOR_READING;
req.msg.data = &sensorNumber;
req.msg.data_len = 1;
- if (pSensorReadingData == NULL) {
+ if (!pSensorReadingData) {
return -1;
}
memset(pSensorReadingData, 0, sizeof(SensorReadingType));
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
return 1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
return 1;
}
memcpy(pSensorReadingData, rsp->data, sizeof(SensorReadingType));
/* if there is an error transmitting ipmi command, return error */
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
rc = 1;
}
/* if sensor messages are disabled, return error*/
@@ -2709,14 +2671,14 @@ ipmi_get_power_capstatus_command(struct ipmi_intf * intf)
data[0] = 01;
data[1] = 0xFF;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error getting powercap status");
return -1;
} else if (( iDRAC_FLAG_12_13 ) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1; /* Return Error as unlicensed */
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error getting powercap statusr: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2760,14 +2722,14 @@ ipmi_set_power_capstatus_command(struct ipmi_intf * intf, uint8_t val)
data[0] = 00;
data[1] = val;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error setting powercap status");
return -1;
} else if ((iDRAC_FLAG_12_13) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1; /* return unlicensed Error code */
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error setting powercap statusr: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2789,24 +2751,15 @@ ipmi_powermgmt(struct ipmi_intf * intf)
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[2];
- uint32_t cumStartTimeConv;
- uint32_t cumReadingConv;
- uint32_t maxPeakStartTimeConv;
- uint32_t ampPeakTimeConv;
- uint16_t ampReadingConv;
- uint32_t wattPeakTimeConv;
- uint32_t wattReadingConv;
- uint32_t bmctimeconv;
- uint32_t * bmctimeconvval;
+ uint32_t cumStartTime;
+ uint32_t cumReading;
+ uint32_t maxPeakStartTime;
+ uint32_t ampPeakTime;
+ uint32_t wattPeakTime;
+ uint32_t bmctime;
IPMI_POWER_MONITOR * pwrMonitorInfo;
- char cumStartTime[26];
- char maxPeakStartTime[26];
- char ampPeakTime[26];
- char wattPeakTime[26];
- char bmctime[26];
-
int ampReading;
int ampReadingRemainder;
int remainder;
@@ -2818,22 +2771,17 @@ ipmi_powermgmt(struct ipmi_intf * intf)
req.msg.cmd = IPMI_CMD_GET_SEL_TIME;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error getting BMC time info.");
return -1;
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR,
"Error getting power management information, return code %x",
rsp->ccode);
return -1;
}
- bmctimeconvval=(uint32_t*)rsp->data;
-# if WORDS_BIGENDIAN
- bmctimeconv=BSWAP_32(*bmctimeconvval);
-# else
- bmctimeconv=*bmctimeconvval;
-# endif
+ bmctime = ipmi32toh(rsp->data);
/* get powermanagement info*/
req.msg.netfn = DELL_OEM_NETFN;
@@ -2847,7 +2795,7 @@ ipmi_powermgmt(struct ipmi_intf * intf)
msg_data[1] = 0x01;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error getting power management information.");
return -1;
}
@@ -2860,7 +2808,7 @@ ipmi_powermgmt(struct ipmi_intf * intf)
lprintf(LOG_ERR, "Error getting power management information: "
"Command not supported on this system.");
return -1;
- }else if (rsp->ccode != 0) {
+ }else if (rsp->ccode) {
lprintf(LOG_ERR,
"Error getting power management information, return code %x",
rsp->ccode);
@@ -2868,54 +2816,35 @@ ipmi_powermgmt(struct ipmi_intf * intf)
}
pwrMonitorInfo = (IPMI_POWER_MONITOR*)rsp->data;
-# if WORDS_BIGENDIAN
- cumStartTimeConv = BSWAP_32(pwrMonitorInfo->cumStartTime);
- cumReadingConv = BSWAP_32(pwrMonitorInfo->cumReading);
- maxPeakStartTimeConv = BSWAP_32(pwrMonitorInfo->maxPeakStartTime);
- ampPeakTimeConv = BSWAP_32(pwrMonitorInfo->ampPeakTime);
- ampReadingConv = BSWAP_16(pwrMonitorInfo->ampReading);
- wattPeakTimeConv = BSWAP_32(pwrMonitorInfo->wattPeakTime);
- wattReadingConv = BSWAP_16(pwrMonitorInfo->wattReading);
-# else
- cumStartTimeConv = pwrMonitorInfo->cumStartTime;
- cumReadingConv = pwrMonitorInfo->cumReading;
- maxPeakStartTimeConv = pwrMonitorInfo->maxPeakStartTime;
- ampPeakTimeConv = pwrMonitorInfo->ampPeakTime;
- ampReadingConv = pwrMonitorInfo->ampReading;
- wattPeakTimeConv = pwrMonitorInfo->wattPeakTime;
- wattReadingConv = pwrMonitorInfo->wattReading;
-# endif
+ cumStartTime = ipmi32toh(&pwrMonitorInfo->cumStartTime);
+ cumReading = ipmi32toh(&pwrMonitorInfo->cumReading);
+ maxPeakStartTime = ipmi32toh(&pwrMonitorInfo->maxPeakStartTime);
+ ampPeakTime = ipmi32toh(&pwrMonitorInfo->ampPeakTime);
+ ampReading = ipmi16toh(&pwrMonitorInfo->ampReading);
+ wattPeakTime = ipmi32toh(&pwrMonitorInfo->wattPeakTime);
+ wattReading = ipmi16toh(&pwrMonitorInfo->wattReading);
- ipmi_time_to_str(cumStartTimeConv, cumStartTime);
- ipmi_time_to_str(maxPeakStartTimeConv, maxPeakStartTime);
- ipmi_time_to_str(ampPeakTimeConv, ampPeakTime);
- ipmi_time_to_str(wattPeakTimeConv, wattPeakTime);
- ipmi_time_to_str(bmctimeconv, bmctime);
-
- remainder = (cumReadingConv % 1000);
- cumReadingConv = cumReadingConv / 1000;
+ remainder = (cumReading % 1000);
+ cumReading = cumReading / 1000;
remainder = (remainder + 50) / 100;
- ampReading = ampReadingConv;
- ampReadingRemainder = ampReading%10;
- ampReading = ampReading/10;
-
- wattReading = wattReadingConv;
+ ampReadingRemainder = ampReading % 10;
+ ampReading = ampReading / 10;
printf("Power Tracking Statistics\n");
printf("Statistic : Cumulative Energy Consumption\n");
- printf("Start Time : %s", cumStartTime);
- printf("Finish Time : %s", bmctime);
- printf("Reading : %d.%d kWh\n\n", cumReadingConv, remainder);
+ printf("Start Time : %s", ipmi_timestamp_numeric(cumStartTime));
+ printf("Finish Time : %s", ipmi_timestamp_numeric(bmctime));
+ printf("Reading : %d.%d kWh\n\n", cumReading, remainder);
printf("Statistic : System Peak Power\n");
- printf("Start Time : %s", maxPeakStartTime);
- printf("Peak Time : %s", wattPeakTime);
+ printf("Start Time : %s", ipmi_timestamp_numeric(maxPeakStartTime));
+ printf("Peak Time : %s", ipmi_timestamp_numeric(wattPeakTime));
printf("Peak Reading : %d W\n\n", wattReading);
printf("Statistic : System Peak Amperage\n");
- printf("Start Time : %s", maxPeakStartTime);
- printf("Peak Time : %s", ampPeakTime);
+ printf("Start Time : %s", ipmi_timestamp_numeric(maxPeakStartTime));
+ printf("Peak Time : %s", ipmi_timestamp_numeric(ampPeakTime));
printf("Peak Reading : %d.%d A\n", ampReading, ampReadingRemainder);
return 0;
}
@@ -2951,7 +2880,7 @@ ipmi_powermgmt_clear(struct ipmi_intf * intf, uint8_t clearValue)
msg_data[2] = clearType;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error clearing power values.");
return -1;
} else if ((iDRAC_FLAG_12_13)
@@ -2963,7 +2892,7 @@ ipmi_powermgmt_clear(struct ipmi_intf * intf, uint8_t clearValue)
lprintf(LOG_ERR,
"Error clearing power values, command not supported on this system.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error clearing power values: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -3029,7 +2958,7 @@ ipmi_get_power_headroom_command(struct ipmi_intf * intf,uint8_t unit)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error getting power headroom status");
return -1;
} else if ((iDRAC_FLAG_12_13)
@@ -3041,7 +2970,7 @@ ipmi_get_power_headroom_command(struct ipmi_intf * intf,uint8_t unit)
lprintf(LOG_ERR, "Error getting power headroom status: "
"Command not supported on this system ");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error getting power headroom status: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -3061,9 +2990,9 @@ ipmi_get_power_headroom_command(struct ipmi_intf * intf,uint8_t unit)
if (unit == btuphr) {
peakpowerheadroombtuphr = watt_to_btuphr_conversion(powerheadroom.peakheadroom);
instantpowerhearoom = watt_to_btuphr_conversion(powerheadroom.instheadroom);
- printf("System Instantaneous Headroom : %lld BTU/hr\n",
+ printf("System Instantaneous Headroom : %" PRId64 " BTU/hr\n",
instantpowerhearoom);
- printf("System Peak Headroom : %lld BTU/hr\n",
+ printf("System Peak Headroom : %" PRId64 " BTU/hr\n",
peakpowerheadroombtuphr);
} else {
printf("System Instantaneous Headroom : %d W\n",
@@ -3096,7 +3025,7 @@ ipmi_get_power_consumption_data(struct ipmi_intf * intf,uint8_t unit)
int status = 0;
int sensor_number = 0;
sdr = ipmi_sdr_find_sdr_byid(intf, "System Level");
- if (sdr == NULL) {
+ if (!sdr) {
lprintf(LOG_ERR,
"Error : Can not access the System Level sensor data");
return -1;
@@ -3108,7 +3037,7 @@ ipmi_get_power_consumption_data(struct ipmi_intf * intf,uint8_t unit)
sdr->record.common->keys.owner_id,
sdr->record.common->keys.lun,
sdr->record.common->keys.channel);
- if (rsp == NULL || rsp->ccode != 0) {
+ if (!rsp || rsp->ccode) {
lprintf(LOG_ERR,
"Error : Can not access the System Level sensor data");
return -1;
@@ -3163,7 +3092,7 @@ ipmi_get_instan_power_consmpt_data(struct ipmi_intf * intf,
msg_data[1] = 0x00;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error getting instantaneous power consumption data .");
return -1;
} else if ((iDRAC_FLAG_12_13)
@@ -3175,7 +3104,7 @@ ipmi_get_instan_power_consmpt_data(struct ipmi_intf * intf,
lprintf(LOG_ERR, "Error getting instantaneous power consumption data: "
"Command not supported on this system.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error getting instantaneous power consumption data: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -3415,12 +3344,7 @@ ipmi_get_minpower_consmpt_history(struct ipmi_intf * intf,
static int
ipmi_print_power_consmpt_history(struct ipmi_intf * intf, int unit)
{
- char timestr[30];
- uint32_t lastminutepeakpower;
- uint32_t lasthourpeakpower;
- uint32_t lastdaypeakpower;
- uint32_t lastweekpeakpower;
- uint64_t tempbtuphrconv;
+ uint64_t tmp;
int rc = 0;
IPMI_AVGPOWER_CONSUMP_HISTORY avgpower;
@@ -3445,101 +3369,91 @@ ipmi_print_power_consmpt_history(struct ipmi_intf * intf, int unit)
return rc;
}
printf("Power Consumption History\n\n");
- /* The fields are alligned manually changing the spaces will alter
+ /* The fields are aligned manually changing the spaces will alter
* the alignment*/
printf("Statistic Last Minute Last Hour "
"Last Day Last Week\n\n");
if (unit == btuphr) {
printf("Average Power Consumption ");
- tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastminutepower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lasthourpower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastdaypower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastweakpower);
- printf("%4lld BTU/hr\n", tempbtuphrconv);
+ tmp = watt_to_btuphr_conversion(avgpower.lastminutepower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(avgpower.lasthourpower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(avgpower.lastdaypower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(avgpower.lastweakpower);
+ printf("%4" PRId64 " BTU/hr\n", tmp);
printf("Max Power Consumption ");
- tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastminutepower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lasthourpower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastdaypower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastweakpower);
- printf("%4lld BTU/hr\n", tempbtuphrconv);
+ tmp = watt_to_btuphr_conversion(stPeakpower.lastminutepower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(stPeakpower.lasthourpower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(stPeakpower.lastdaypower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(stPeakpower.lastweakpower);
+ printf("%4" PRId64 " BTU/hr\n", tmp);
printf("Min Power Consumption ");
- tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastminutepower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lasthourpower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastdaypower);
- printf("%4lld BTU/hr ", tempbtuphrconv);
- tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastweakpower);
- printf("%4lld BTU/hr\n\n", tempbtuphrconv);
+ tmp = watt_to_btuphr_conversion(stMinpower.lastminutepower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(stMinpower.lasthourpower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(stMinpower.lastdaypower);
+ printf("%4" PRId64 " BTU/hr ", tmp);
+ tmp = watt_to_btuphr_conversion(stMinpower.lastweakpower);
+ printf("%4" PRId64 " BTU/hr\n\n", tmp);
} else {
printf("Average Power Consumption ");
- tempbtuphrconv = (avgpower.lastminutepower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (avgpower.lasthourpower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (avgpower.lastdaypower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv=(avgpower.lastweakpower);
- printf("%4lld W \n", tempbtuphrconv);
+ tmp = avgpower.lastminutepower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = avgpower.lasthourpower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = avgpower.lastdaypower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = avgpower.lastweakpower;
+ printf("%4" PRId64 " W \n", tmp);
printf("Max Power Consumption ");
- tempbtuphrconv = (stPeakpower.lastminutepower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (stPeakpower.lasthourpower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (stPeakpower.lastdaypower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (stPeakpower.lastweakpower);
- printf("%4lld W \n", tempbtuphrconv);
+ tmp = stPeakpower.lastminutepower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = stPeakpower.lasthourpower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = stPeakpower.lastdaypower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = stPeakpower.lastweakpower;
+ printf("%4" PRId64 " W \n", tmp);
printf("Min Power Consumption ");
- tempbtuphrconv = (stMinpower.lastminutepower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (stMinpower.lasthourpower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (stMinpower.lastdaypower);
- printf("%4lld W ", tempbtuphrconv);
- tempbtuphrconv = (stMinpower.lastweakpower);
- printf("%4lld W \n\n", tempbtuphrconv);
+ tmp = stMinpower.lastminutepower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = stMinpower.lasthourpower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = stMinpower.lastdaypower;
+ printf("%4" PRId64 " W ", tmp);
+ tmp = stMinpower.lastweakpower;
+ printf("%4" PRId64 " W \n\n", tmp);
}
- lastminutepeakpower = stPeakpower.lastminutepowertime;
- lasthourpeakpower = stPeakpower.lasthourpowertime;
- lastdaypeakpower = stPeakpower.lastdaypowertime;
- lastweekpeakpower = stPeakpower.lastweekpowertime;
-
printf("Max Power Time\n");
- ipmi_time_to_str(lastminutepeakpower, timestr);
- printf("Last Minute : %s",timestr);
- ipmi_time_to_str(lasthourpeakpower, timestr);
- printf("Last Hour : %s",timestr);
- ipmi_time_to_str(lastdaypeakpower, timestr);
- printf("Last Day : %s",timestr);
- ipmi_time_to_str(lastweekpeakpower, timestr);
- printf("Last Week : %s",timestr);
-
- lastminutepeakpower=stMinpower.lastminutepowertime;
- lasthourpeakpower=stMinpower.lasthourpowertime;
- lastdaypeakpower=stMinpower.lastdaypowertime;
- lastweekpeakpower=stMinpower.lastweekpowertime;
+ printf("Last Minute : %s",
+ ipmi_timestamp_numeric(stPeakpower.lastminutepowertime));
+ printf("Last Hour : %s",
+ ipmi_timestamp_numeric(stPeakpower.lasthourpowertime));
+ printf("Last Day : %s",
+ ipmi_timestamp_numeric(stPeakpower.lastdaypowertime));
+ printf("Last Week : %s",
+ ipmi_timestamp_numeric(stPeakpower.lastweekpowertime));
printf("Min Power Time\n");
- ipmi_time_to_str(lastminutepeakpower, timestr);
- printf("Last Minute : %s", timestr);
- ipmi_time_to_str(lasthourpeakpower, timestr);
- printf("Last Hour : %s", timestr);
- ipmi_time_to_str(lastdaypeakpower, timestr);
- printf("Last Day : %s", timestr);
- ipmi_time_to_str(lastweekpeakpower, timestr);
- printf("Last Week : %s", timestr);
+ printf("Last Minute : %s",
+ ipmi_timestamp_numeric(stMinpower.lastminutepowertime));
+ printf("Last Hour : %s",
+ ipmi_timestamp_numeric(stMinpower.lasthourpowertime));
+ printf("Last Day : %s",
+ ipmi_timestamp_numeric(stMinpower.lastdaypowertime));
+ printf("Last Week : %s",
+ ipmi_timestamp_numeric(stMinpower.lastweekpowertime));
return rc;
}
/*
@@ -3612,11 +3526,11 @@ ipmi_print_power_cap(struct ipmi_intf * intf,uint8_t unit)
if (rc == 0) {
if (unit == btuphr) {
tempbtuphrconv = watt_to_btuphr_conversion(ipmipowercap.MaximumPowerConsmp);
- printf("Maximum power: %lld BTU/hr\n", tempbtuphrconv);
+ printf("Maximum power: %" PRId64 " BTU/hr\n", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(ipmipowercap.MinimumPowerConsmp);
- printf("Minimum power: %lld BTU/hr\n", tempbtuphrconv);
+ printf("Minimum power: %" PRId64 " BTU/hr\n", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(ipmipowercap.PowerCap);
- printf("Power cap : %lld BTU/hr\n", tempbtuphrconv);
+ printf("Power cap : %" PRId64 " BTU/hr\n", tempbtuphrconv);
} else {
printf("Maximum power: %d Watt\n", ipmipowercap.MaximumPowerConsmp);
printf("Minimum power: %d Watt\n", ipmipowercap.MinimumPowerConsmp);
@@ -3707,7 +3621,7 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
val = btuphr_to_watt_conversion(val);
} else if (unit == percent) {
if ((val < 0) || (val > 100)) {
- lprintf(LOG_ERR, "Cap value is out of boundary conditon it "
+ lprintf(LOG_ERR, "Cap value is out of boundary condition it "
"should be between 0 - 100");
return -1;
}
@@ -3722,7 +3636,7 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
if (((val < ipmipowercap.MinimumPowerConsmp)
|| (val > ipmipowercap.MaximumPowerConsmp)) && (unit == watt)) {
lprintf(LOG_ERR,
- "Cap value is out of boundary conditon it should be between %d - %d",
+ "Cap value is out of boundary condition it should be between %d - %d",
ipmipowercap.MinimumPowerConsmp, ipmipowercap.MaximumPowerConsmp);
return -1;
} else if (((val < ipmipowercap.MinimumPowerConsmp)
@@ -3730,7 +3644,7 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
minpowerbtuphr = watt_to_btuphr_conversion(ipmipowercap.MinimumPowerConsmp);
maxpowerbtuphr = watt_to_btuphr_conversion(ipmipowercap.MaximumPowerConsmp);
lprintf(LOG_ERR,
- "Cap value is out of boundary conditon it should be between %d",
+ "Cap value is out of boundary condition it should be between %d",
minpowerbtuphr);
lprintf(LOG_ERR, " -%d", maxpowerbtuphr);
return -1;
@@ -3827,7 +3741,7 @@ ipmi_powermonitor_usage(void)
*
* Description: This function processes the delloem vFlash command
* Input: intf - ipmi interface
- * argc - no of arguments
+ * argc - no of arguments (unused)
* argv - argument string array
* Output:
*
@@ -3835,7 +3749,7 @@ ipmi_powermonitor_usage(void)
* -1 - failure
*/
static int
-ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int __UNUSED__(argc), char ** argv)
{
int rc = 0;
current_arg++;
@@ -3856,7 +3770,7 @@ get_vFlash_compcode_str(uint8_t vflashcompcode, const struct vFlashstr *vs)
{
static char un_str[32];
int i;
- for (i = 0; vs[i].str != NULL; i++) {
+ for (i = 0; vs[i].str; i++) {
if (vs[i].val == vflashcompcode)
return vs[i].str;
}
@@ -3890,10 +3804,10 @@ ipmi_get_sd_card_info(struct ipmi_intf * intf) {
req.msg.data_len = input_length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in getting SD Card Extended Information");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error in getting SD Card Extended Information (%s)",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -3954,26 +3868,26 @@ static int
ipmi_delloem_vFlash_process(struct ipmi_intf * intf, int current_arg, char ** argv)
{
int rc;
- if (strncmp(intf->name,"wmi\0",4) && strncmp(intf->name, "open\0",5)) {
+ if (strcmp(intf->name,"wmi") && strcmp(intf->name, "open")) {
lprintf(LOG_ERR,
"vFlash support is enabled only for wmi and open interface.");
lprintf(LOG_ERR, "Its not enabled for lan and lanplus interface.");
return -1;
}
- if (argv[current_arg] == NULL || strcmp(argv[current_arg], "help") == 0) {
+ if (!argv[current_arg] || !strcmp(argv[current_arg], "help")) {
ipmi_vFlash_usage();
return 0;
}
ipmi_idracvalidator_command(intf);
- if (!strncmp(argv[current_arg], "info\0", 5)) {
+ if (!strcmp(argv[current_arg], "info")) {
current_arg++;
- if (argv[current_arg] == NULL) {
+ if (!argv[current_arg]) {
ipmi_vFlash_usage();
return -1;
- } else if (strncmp(argv[current_arg], "Card\0", 5) == 0) {
+ } else if (!strcmp(argv[current_arg], "Card")) {
current_arg++;
- if (argv[current_arg] != NULL) {
+ if (argv[current_arg]) {
ipmi_vFlash_usage();
return -1;
}
@@ -4071,7 +3985,7 @@ CheckSetLEDSupport(struct ipmi_intf * intf)
data[9] = 0x00;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL || rsp->ccode != 0) {
+ if (!rsp || rsp->ccode) {
return;
}
SetLEDSupported = 1;
@@ -4113,10 +4027,10 @@ ipmi_getdrivemap(struct ipmi_intf * intf, int b, int d, int f, int *bay,
data[7] = (d << 3) + f; /* devfn */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error issuing getdrivemap command.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error issuing getdrivemap command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -4168,10 +4082,10 @@ ipmi_setled_state(struct ipmi_intf * intf, int bayId, int slotId, int state)
data[11] = state >> 8; /* state MSB; */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error issuing setled command.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error issuing setled command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -4236,7 +4150,7 @@ ipmi_delloem_setled_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
/* ipmitool delloem setled info*/
- if (argc == 1 || strcmp(argv[current_arg], "help") == 0) {
+ if (argc == 1 || !strcmp(argv[current_arg], "help")) {
ipmi_setled_usage();
return 0;
}
diff --git a/lib/ipmi_ekanalyzer.c b/lib/ipmi_ekanalyzer.c
index d6ce4c7..dbc76b4 100644
--- a/lib/ipmi_ekanalyzer.c
+++ b/lib/ipmi_ekanalyzer.c
@@ -37,10 +37,14 @@
#include <ipmitool/log.h>
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_strings.h>
+#include <ipmitool/ipmi_fru.h>
+#include <ipmitool/ipmi_time.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <fcntl.h>
+#include <sys/stat.h>
#define NO_MORE_INFO_FIELD 0xc1
#define TYPE_CODE 0xc0 /*Language code*/
@@ -193,7 +197,7 @@ struct ipmi_ek_amc_p2p_connectivity_record{
struct fru_picmgext_amc_channel_desc_record * ch_desc;
unsigned char link_desc_count;
struct fru_picmgext_amc_link_desc_record * link_desc;
- int * matching_result; /*For link descriptor comparision*/
+ int * matching_result; /*For link descriptor comparison*/
};
/*****************************************************************************
@@ -216,8 +220,7 @@ static void ipmi_ek_add_record2list( struct ipmi_ek_multi_header ** record,
struct ipmi_ek_multi_header ** list_last );
static void ipmi_ek_display_record( struct ipmi_ek_multi_header * record,
- struct ipmi_ek_multi_header * list_head,
- struct ipmi_ek_multi_header * list_last );
+ struct ipmi_ek_multi_header * list_head);
static void ipmi_ek_remove_record_from_list(
struct ipmi_ek_multi_header * record,
@@ -234,7 +237,7 @@ static int ipmi_ekanalyzer_fru_file2structure( char * filename,
*****************************************************************************/
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
struct ipmi_ek_multi_header ** list_head,
- struct ipmi_ek_multi_header ** list_last, char * opt,
+ char * opt,
struct ipmi_ek_multi_header * pphysical );
static int ipmi_ek_get_resource_descriptor( int port_count, int index,
@@ -450,11 +453,11 @@ ipmi_ek_get_file_type(char *argument)
*
* Global: None
*
-* Return: OK_STATUS as succes or ERROR_STATUS as error
+* Return: OK_STATUS as success or ERROR_STATUS as error
*
***************************************************************************/
int
-ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
+ipmi_ekanalyzer_main(struct ipmi_intf *__UNUSED__(intf), int argc, char **argv)
{
int rc = ERROR_STATUS;
int file_type[MAX_FILE_NUMBER];
@@ -475,11 +478,12 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
return (-1);
}
- if (strcmp(argv[argument_offset], "help") == 0) {
+ if (!strcmp(argv[argument_offset], "help")) {
ipmi_ekanalyzer_usage();
return 0;
- } else if ((strcmp(argv[argument_offset], "frushow") == 0)
- && (argc > (MIN_ARGUMENT-1))) {
+ } else if (!strcmp(argv[argument_offset], "frushow")
+ && (argc > (MIN_ARGUMENT-1)))
+ {
for (type_offset = 0; type_offset < (argc-1); type_offset++ ) {
argument_offset++;
file_type[type_offset] = ipmi_ek_get_file_type(argv[argument_offset]);
@@ -495,7 +499,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
*/
filename[type_offset] = malloc(strlen(argv[argument_offset])
+ 1 - SIZE_OF_FILE_TYPE);
- if (filename[type_offset] == NULL) {
+ if (!filename[type_offset]) {
lprintf(LOG_ERR, "malloc failure");
return (-1);
}
@@ -511,9 +515,9 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
/* Convert from binary data into multi record structure */
rc = ipmi_ekanalyzer_fru_file2structure (filename[type_offset],
&list_head, &list_record, &list_last );
- ipmi_ek_display_record(list_record, list_head, list_last);
+ ipmi_ek_display_record(list_record, list_head);
/* Remove record of list */
- while (list_head != NULL) {
+ while (list_head) {
ipmi_ek_remove_record_from_list(list_head,
&list_head,&list_last );
if (verbose > 1) {
@@ -524,8 +528,9 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
free(filename[type_offset]);
filename[type_offset] = NULL;
}
- } else if ((strcmp(argv[argument_offset], "print") == 0)
- || (strcmp(argv[argument_offset], "summary") == 0)) {
+ } else if (!strcmp(argv[argument_offset], "print")
+ || !strcmp(argv[argument_offset], "summary"))
+ {
/* Display help text for corresponding command
* if not enough parameters were given.
*/
@@ -537,7 +542,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
int filename_size=0;
if (argc < MIN_ARGUMENT) {
lprintf(LOG_ERR, "Not enough parameters given.");
- if (strcmp(argv[argument_offset], "print") == 0) {
+ if (!strcmp(argv[argument_offset], "print")) {
lprintf(LOG_ERR,
" ekanalyzer print [carrier/power/all]"
" <xx=frufile> <xx=frufile> [xx=frufile]");
@@ -549,18 +554,20 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
return ERROR_STATUS;
}
argument_offset++;
- if ((strcmp(argv[argument_offset], "carrier") == 0)
- || (strcmp(argv[argument_offset], "power") == 0)
- || (strcmp(argv[argument_offset], "all") == 0)) {
+ if (!strcmp(argv[argument_offset], "carrier")
+ || !strcmp(argv[argument_offset], "power")
+ || !strcmp(argv[argument_offset], "all"))
+ {
option = argv[argument_offset];
index ++;
argc--;
- } else if ((strcmp(argv[argument_offset], "match") == 0)
- || ( strcmp(argv[argument_offset], "unmatch") == 0)) {
+ } else if (!strcmp(argv[argument_offset], "match")
+ || !strcmp(argv[argument_offset], "unmatch"))
+ {
option = argv[argument_offset];
index ++;
argc--;
- } else if ( strncmp(&argv[argument_offset][2], "=", 1) == 0) {
+ } else if ('=' == argv[argument_offset][2]) {
/* since the command line must receive xx=filename,
* so the position of "=" sign is 2
*/
@@ -573,7 +580,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
option = "invalid";
printf("Invalid option '%s'\n", argv[argument_offset]);
argument_offset--;
- if (strcmp(argv[0], "print") == 0) {
+ if (!strcmp(argv[0], "print")) {
lprintf (LOG_ERR,
" ekanalyzer print [carrier/power/all]"
" <xx=frufile> <xx=frufile> [xx=frufile]");
@@ -584,12 +591,12 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
}
rc = ERROR_STATUS;
}
- if (strcmp(option, "invalid") != 0) {
+ if (strcmp(option, "invalid")) {
int i=0;
for (i = 0; i < (argc-1); i++) {
file_type[i] = ipmi_ek_get_file_type (argv[index]);
if (file_type[i] == ERROR_STATUS) {
- /* display the first 2 charactors (file type) of argument */
+ /* display the first 2 characters (file type) of argument */
lprintf(LOG_ERR, "Invalid file type: %c%c\n",
argv[index][0],
argv[index][1]);
@@ -602,10 +609,13 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
*/
filename_size = strlen(argv[index]) - SIZE_OF_FILE_TYPE + 1;
if (filename_size > 0) {
- /* TODO - check malloc() retval */
filename[i] = malloc( filename_size );
- if (filename[i] != NULL) {
+ if (filename[i]) {
strcpy(filename[i], &argv[index][SIZE_OF_FILE_TYPE]);
+ } else {
+ lprintf(LOG_ERR, "ipmitool: malloc failure");
+ rc = ERROR_STATUS;
+ break;
}
}
rc = OK_STATUS;
@@ -620,7 +630,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
printf("file name: %s\n", filename[i]);
}
}
- if (strcmp(argv[0], "print") == 0) {
+ if (!strcmp(argv[0], "print")) {
rc = ipmi_ekanalyzer_print((argc-1),
option, filename, file_type);
} else {
@@ -628,7 +638,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
option, filename, file_type);
}
for (i = 0; i < (argc-1); i++) {
- if (filename[i] != NULL) {
+ if (filename[i]) {
free(filename[i]);
filename[i] = NULL;
}
@@ -671,7 +681,7 @@ ipmi_ekanalyzer_print(int argc, char *opt, char **filename, int *file_type)
{
int return_value = OK_STATUS;
/* Display carrier topology */
- if ((strcmp(opt, "carrier") == 0) || (strcmp(opt, "default") == 0)) {
+ if (!strcmp(opt, "carrier") || !strcmp(opt, "default")) {
tboolean found_flag = FALSE;
int index = 0;
int index_name[argc];
@@ -711,8 +721,9 @@ ipmi_ekanalyzer_print(int argc, char *opt, char **filename, int *file_type)
*/
tboolean first_data = TRUE;
for (list_record[i] = list_head[i];
- list_record[i] != NULL;
- list_record[i] = list_record[i]->next) {
+ list_record[i];
+ list_record[i] = list_record[i]->next)
+ {
if (list_record[i]->data[PICMG_ID_OFFSET] == FRU_AMC_CARRIER_P2P) {
if (first_data) {
printf("%s\n", STAR_LINE_LIMITER);
@@ -721,7 +732,7 @@ ipmi_ekanalyzer_print(int argc, char *opt, char **filename, int *file_type)
}
return_value = ipmi_ek_display_carrier_connectivity(list_record[i]);
} else if (list_record[i]->data[PICMG_ID_OFFSET] == FRU_AMC_CARRIER_INFO) {
- /*See AMC.0 specification Table3-3 for mor detail*/
+ /*See AMC.0 specification Table3-3 for more detail*/
#define COUNT_OFFSET 6
if (first_data) {
printf("From Carrier file: %s\n", filename[index_name[i]]);
@@ -734,7 +745,7 @@ ipmi_ekanalyzer_print(int argc, char *opt, char **filename, int *file_type)
}
/*Destroy the list of record*/
for (i = 0; i < argc; i++) {
- while (list_head[i] != NULL) {
+ while (list_head[i]) {
ipmi_ek_remove_record_from_list(list_head[i],
&list_head[i], &list_last[i]);
}
@@ -746,10 +757,10 @@ ipmi_ekanalyzer_print(int argc, char *opt, char **filename, int *file_type)
}
}
}
- } else if (strcmp(opt, "power") == 0) {
+ } else if (!strcmp(opt, "power")) {
printf("Print power information\n");
return_value = ipmi_ek_display_power(argc, opt, filename, file_type);
- } else if (strcmp(opt, "all") == 0) {
+ } else if (!strcmp(opt, "all")) {
printf("Print all information\n");
return_value = ipmi_ek_display_power(argc, opt, filename, file_type);
} else {
@@ -784,7 +795,7 @@ ipmi_ek_display_carrier_connectivity(struct ipmi_ek_multi_header *record)
int offset = START_DATA_OFFSET;
struct fru_picmgext_carrier_p2p_record rsc_desc;
struct fru_picmgext_carrier_p2p_descriptor *port_desc;
- if (record == NULL) {
+ if (!record) {
lprintf(LOG_ERR, "P2P connectivity record is invalid\n");
return ERROR_STATUS;
}
@@ -912,14 +923,14 @@ ipmi_ek_display_power( int argc, char * opt, char ** filename, int * file_type )
return_value = ipmi_ekanalyzer_fru_file2structure( filename[num_file],
&list_head[num_file], &list_record[num_file], &list_last[num_file]);
- if ( list_head[num_file] != NULL ){
+ if (list_head[num_file]){
for ( list_record[num_file] = list_head[num_file];
- list_record[num_file] != NULL;
- list_record[num_file] = list_record[num_file]->next
- ){
- if ( ( strcmp(opt, "all") == 0 )
- && ( file_type[num_file] == ON_CARRIER_FRU_FILE )
- ){
+ list_record[num_file];
+ list_record[num_file] = list_record[num_file]->next)
+ {
+ if (!strcmp(opt, "all")
+ && file_type[num_file] == ON_CARRIER_FRU_FILE)
+ {
if ( list_record[num_file]->data[PICMG_ID_OFFSET]
==
FRU_AMC_CARRIER_P2P
@@ -986,7 +997,7 @@ ipmi_ek_display_power( int argc, char * opt, char ** filename, int * file_type )
return_value = OK_STATUS;
/*Destroy the list of record*/
for ( index = 0; index < argc; index++ ){
- while ( list_head[index] != NULL ){
+ while (list_head[index]) {
ipmi_ek_remove_record_from_list ( list_head[index],
&list_head[index],&list_last[index] );
}
@@ -1078,7 +1089,7 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
{
tboolean return_value = FALSE;
- if ( (strcmp(opt, "carrier") == 0 ) || (strcmp(opt, "power") == 0) ){
+ if (!strcmp(opt, "carrier") || !strcmp(opt, "power")) {
lprintf(LOG_ERR, " ekanalyzer summary [match/ unmatch/ all]"\
" <xx=frufile> <xx=frufile> [xx=frufile]");
return_value = ERROR_STATUS;
@@ -1149,13 +1160,13 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
/*Get Carrier p2p connectivity record for physical check*/
for (num_file=0; num_file < argc; num_file++){
if (file_type[num_file] == ON_CARRIER_FRU_FILE ){
- for ( pcarrier_p2p=list_head[num_file];
- pcarrier_p2p != NULL ;
- pcarrier_p2p = pcarrier_p2p->next
- ){
- if ( pcarrier_p2p->data[PICMG_ID_OFFSET]
- == FRU_AMC_CARRIER_P2P
- ){
+ for (pcarrier_p2p = list_head[num_file];
+ pcarrier_p2p;
+ pcarrier_p2p = pcarrier_p2p->next)
+ {
+ if (FRU_AMC_CARRIER_P2P ==
+ pcarrier_p2p->data[PICMG_ID_OFFSET])
+ {
break;
}
}
@@ -1182,14 +1193,14 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
}
return_value = ipmi_ek_matching_process( file_type,
match_pair, num_file, list_head,
- list_last, opt, pcarrier_p2p);
+ opt, pcarrier_p2p);
}
}
}
match_pair ++;
}
for( num_file=0; num_file < argc; num_file++ ){
- if (list_head[num_file] != NULL ){
+ if (list_head[num_file]) {
ipmi_ek_remove_record_from_list( list_head[num_file],
&list_record[num_file], &list_last[num_file]);
}
@@ -1218,8 +1229,6 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
* index2: position of the second record in the list of the record
* ipmi_ek_multi_header ** list_head: pointer to the header of a
* linked list that contain FRU multi record
-* ipmi_ek_multi_header ** list_last: pointer to the tale of a
-* linked list that contain FRU multi record
* opt: string that contain display option such as "match", "unmatch", or
* "all".
* pphysical: a pointer that contain a carrier p2p connectivity record
@@ -1235,7 +1244,7 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
***************************************************************************/
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
struct ipmi_ek_multi_header ** list_head,
- struct ipmi_ek_multi_header ** list_last, char * opt,
+ char * opt,
struct ipmi_ek_multi_header * pphysical )
{
int result = ERROR_STATUS;
@@ -1251,13 +1260,13 @@ static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
index2 = index_temp; /*index2 indcate an AMC*/
}
/*Calculate record size for Carrier file*/
- for ( record=list_head[index1]; record != NULL;record = record->next ){
+ for (record = list_head[index1]; record; record = record->next ){
if ( record->data[PICMG_ID_OFFSET] == FRU_AMC_P2P ){
num_amc_record2++;
}
}
/*Calculate record size for amc file*/
- for ( record=list_head[index2]; record != NULL;record = record->next){
+ for (record = list_head[index2]; record; record = record->next){
if ( record->data[PICMG_ID_OFFSET] == FRU_AMC_P2P ){
num_amc_record1++;
}
@@ -1275,17 +1284,17 @@ static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
amc_record2 = malloc ( num_amc_record2 * \
sizeof(struct ipmi_ek_amc_p2p_connectivity_record));
- for (record=list_head[index2]; record != NULL;record = record->next){
+ for (record = list_head[index2]; record; record = record->next) {
if ( record->data[PICMG_ID_OFFSET] == FRU_AMC_P2P ){
result = ipmi_ek_create_amc_p2p_record( record,
&amc_record1[index_record1] );
if (result != ERROR_STATUS){
struct ipmi_ek_multi_header * current_record = NULL;
- for ( current_record=list_head[index1];
- current_record != NULL ;
- current_record = current_record->next
- ){
+ for (current_record=list_head[index1];
+ current_record;
+ current_record = current_record->next)
+ {
if ( current_record->data[PICMG_ID_OFFSET] == FRU_AMC_P2P ){
result = ipmi_ek_create_amc_p2p_record( current_record,
&amc_record2[index_record2] );
@@ -1355,7 +1364,7 @@ ipmi_ek_check_physical_connectivity(
{
int return_status = OK_STATUS;
- if ( record == NULL ){
+ if (!record){
printf("NO Carrier p2p connectivity !\n");
return_status = ERROR_STATUS;
}
@@ -1420,7 +1429,7 @@ ipmi_ek_check_physical_connectivity(
rsc_desc.p2p_count );
}
- if ( (port_desc != NULL) && (return_status != ERROR_STATUS) ){
+ if (port_desc && return_status != ERROR_STATUS) {
int j=0;
for ( j = 0; j < rsc_desc.p2p_count; j++ ){
@@ -1447,7 +1456,7 @@ ipmi_ek_check_physical_connectivity(
(filetype1 ==(port_desc[j].remote_resource_id &0x0f))
)
){
- if ( ! (strcmp(option, "unmatch") == 0) ){
+ if (strcmp(option, "unmatch")){
printf("%s port %d ==> %s port %d\n",
val2str(filetype2, ipmi_ekanalyzer_module_type),
record1.ch_desc[index1].lane0port,
@@ -1470,7 +1479,7 @@ ipmi_ek_check_physical_connectivity(
&&
(filetype2 == (port_desc[j].remote_resource_id & 0x0f))
){
- if ( ! (strcmp(option, "unmatch") == 0) ){
+ if (strcmp(option, "unmatch")){
printf("%s port %d ==> %s port %d\n",
val2str(filetype2, ipmi_ekanalyzer_module_type),
record1.ch_desc[index1].lane0port,
@@ -1484,7 +1493,7 @@ ipmi_ek_check_physical_connectivity(
&&
(record2.rsc_id == (port_desc[j].remote_resource_id))
){
- if ( ! (strcmp(option, "unmatch") == 0) ){
+ if (strcmp(option, "unmatch")){
printf("%s port %d ==> %s %x port %d\n",
val2str(filetype2, ipmi_ekanalyzer_module_type),
record1.ch_desc[index1].lane0port,
@@ -1520,7 +1529,7 @@ ipmi_ek_check_physical_connectivity(
}
return_status = ERROR_STATUS;
}
- if (port_desc != NULL){
+ if (port_desc) {
free(port_desc);
port_desc = NULL;
}
@@ -1600,10 +1609,10 @@ ipmi_ek_compare_link( struct ipmi_ek_multi_header * physic_record,
physic_record, file_type1, file_type2, opt );
if ( result == OK_STATUS ){
/*Display the result if option = match or all*/
- if ( (strcmp( opt, "match" ) == 0)
- || (strcmp( opt, "all" ) == 0)
- || (strcmp( opt, "default" ) == 0)
- ){
+ if (!strcmp(opt, "match")
+ || !strcmp(opt, "all")
+ || !strcmp(opt, "default"))
+ {
tboolean isOEMtype = FALSE;
printf(" Matching Result\n");
isOEMtype = ipmi_ek_display_link_descriptor( file_type1,
@@ -1660,10 +1669,10 @@ ipmi_ek_compare_link( struct ipmi_ek_multi_header * physic_record,
record1, index_ch_desc1, record2, index_ch_desc2,
physic_record, file_type1, file_type2, opt );
if ( result == OK_STATUS ){
- if ( (strcmp( opt, "match" ) == 0)
- || (strcmp( opt, "all" ) == 0)
- || (strcmp( opt, "default" ) == 0)
- ){
+ if (!strcmp( opt, "match" )
+ || !strcmp(opt, "all")
+ || !strcmp(opt, "default"))
+ {
tboolean isOEMtype = FALSE;
printf(" Matching Result\n");
isOEMtype = ipmi_ek_display_link_descriptor( file_type1,
@@ -1691,7 +1700,7 @@ ipmi_ek_compare_link( struct ipmi_ek_multi_header * physic_record,
}
}
- if ( (strcmp(opt, "unmatch") == 0) || (strcmp(opt, "all") == 0) ){
+ if (!strcmp(opt, "unmatch") || !strcmp(opt, "all")) {
int isOEMtype = FALSE;
printf(" Unmatching result\n");
for (index1 = 0; index1 < record1.link_desc_count; index1++){
@@ -1936,12 +1945,12 @@ ipmi_ek_compare_link_descriptor(
*
* Function name: ipmi_ek_compare_asym
*
-* Description: This function compares 2 asymetric match of 2
+* Description: This function compares 2 asymmetric match of 2
* amc link descriptors
*
* Restriction: None
*
-* Input: asym[COMPARE_CANDIDATE]: Contain 2 asymetric match for comparison
+* Input: asym[COMPARE_CANDIDATE]: Contain 2 asymmetric match for comparison
*
* Output: None
*
@@ -2052,7 +2061,7 @@ ipmi_ek_compare_number_of_enable_port(
* destination (its value = "To"). ( it is set to "" if it is not
* a source nor destination
* link_desc: AMC link descriptor
-* asym: asymetric match
+* asym: asymmetric match
*
* Output: None
*
@@ -2205,6 +2214,9 @@ ipmi_ek_create_amc_p2p_record(struct ipmi_ek_multi_header *record,
int index_oem = 0;
amc_record->oem_guid = malloc(amc_record->guid_count * \
sizeof(struct fru_picmgext_guid));
+ if (!amc_record->oem_guid) {
+ return ERROR_STATUS;
+ }
for (index_oem = 0; index_oem < amc_record->guid_count;
index_oem++) {
memcpy(&amc_record->oem_guid[index_oem].guid,
@@ -2232,6 +2244,9 @@ ipmi_ek_create_amc_p2p_record(struct ipmi_ek_multi_header *record,
int ch_index = 0;
amc_record->ch_desc = malloc((amc_record->ch_count) * \
sizeof(struct fru_picmgext_amc_channel_desc_record));
+ if (!amc_record->ch_desc) {
+ return ERROR_STATUS;
+ }
for (ch_index = 0; ch_index < amc_record->ch_count;
ch_index++) {
unsigned int data;
@@ -2255,6 +2270,9 @@ ipmi_ek_create_amc_p2p_record(struct ipmi_ek_multi_header *record,
int i=0;
amc_record->link_desc = malloc(amc_record->link_desc_count * \
sizeof(struct fru_picmgext_amc_link_desc_record));
+ if (!amc_record->link_desc) {
+ return ERROR_STATUS;
+ }
for (i = 0; i< amc_record->link_desc_count; i++) {
unsigned int data[2];
struct fru_picmgext_amc_link_desc_record *src, *dst;
@@ -2335,7 +2353,7 @@ ipmi_ek_get_resource_descriptor(int port_count, int index,
*
* Global: None
*
-* Return: Return OK_STATUS on sucess, ERROR_STATUS on error
+* Return: Return OK_STATUS on success, ERROR_STATUS on error
*
***************************************************************************/
static int
@@ -2346,7 +2364,7 @@ ipmi_ek_display_fru_header(char *filename)
int ret = 0;
input_file = fopen(filename, "r");
- if (input_file == NULL) {
+ if (!input_file) {
lprintf(LOG_ERR, "File '%s' not found.", filename);
return (ERROR_STATUS);
}
@@ -2401,7 +2419,7 @@ ipmi_ek_display_fru_header_detail(char *filename)
FILE *input_file;
size_t file_offset = 0;
struct fru_header header;
- time_t tval;
+ time_t ts;
int ret = 0;
unsigned char data = 0;
unsigned char lan_code = 0;
@@ -2409,7 +2427,7 @@ ipmi_ek_display_fru_header_detail(char *filename)
unsigned int board_length = 0;
input_file = fopen(filename, "r");
- if (input_file == NULL) {
+ if (!input_file) {
lprintf(LOG_ERR, "File '%s' not found.", filename);
return (-1);
}
@@ -2427,6 +2445,8 @@ ipmi_ek_display_fru_header_detail(char *filename)
if (header.offset.internal != 0) {
unsigned char format_version;
unsigned long len = 0;
+ uint8_t *area_offset;
+ uint8_t next_offset = UINT8_MAX;
printf("%s\n", EQUAL_LINE_LIMITER);
printf("FRU Internal Use Info\n");
@@ -2440,12 +2460,46 @@ ipmi_ek_display_fru_header_detail(char *filename)
}
printf("Format Version: %d\n", (format_version & 0x0f));
- if (header.offset.chassis > 0) {
- len = (header.offset.chassis * FACTOR_OFFSET)
- - (header.offset.internal * FACTOR_OFFSET);
- } else {
- len = (header.offset.board * FACTOR_OFFSET)
- - (header.offset.internal * FACTOR_OFFSET);
+ /* Internal use area doesn't contain the size byte.
+ * We need to calculate its size by finding the area
+ * that is next. Areas may not follow the same order
+ * as their offsets listed in the header, so we need
+ * to find the area that is physically next to the
+ * internal use area.
+ */
+ for (area_offset = &header.offset.internal + 1;
+ area_offset <= &header.offset.multi;
+ ++area_offset)
+ {
+ /* If the area is closer to us than the previously
+ * checked one, make it our best candidate
+ */
+ if (*area_offset < next_offset
+ && *area_offset > header.offset.internal)
+ {
+ next_offset = *area_offset;
+ }
+ }
+
+ /* If there was at least one area after internal use one,
+ * then we must have found it and can use it to calculate
+ * length. Otherwise, everything till the end of file is
+ * internal use area expect for the last (checksum) byte.
+ */
+ if (next_offset < UINT8_MAX) {
+ len = (next_offset - header.offset.internal) * FACTOR_OFFSET;
+ --len; /* First byte of internal use area is version and we've
+ already read it */
+ }
+ else {
+ struct stat fs;
+ long curpos = ftell(input_file);
+ if (curpos < 0 || 0 > fstat(fileno(input_file), &fs)) {
+ lprintf(LOG_ERR, "Failed to determine FRU file size");
+ fclose(input_file);
+ return -1;
+ }
+ len = fs.st_size - curpos - 1; /* Last byte is checksum */
}
printf("Length: %ld\n", len);
printf("Data dump:\n");
@@ -2529,33 +2583,40 @@ ipmi_ek_display_fru_header_detail(char *filename)
fclose(input_file);
return (-1);
}
- tval = ((mfg_date[2] << 16) + (mfg_date[1] << 8)
- + (mfg_date[0]));
- tval = tval * 60;
- tval = tval + secs_from_1970_1996;
- printf("Board Mfg Date: %ld, %s", tval,
- asctime(localtime(&tval)));
+
+ ts = ipmi_fru2time_t(mfg_date);
+ printf("Board Mfg Date: %ld, %s\n",
+ (IPMI_TIME_UNSPECIFIED == ts)
+ ? FRU_BOARD_DATE_UNSPEC
+ : ts,
+ ipmi_timestamp_numeric(ts));
board_length -= SIZE_MFG_DATE;
+
/* Board Mfg */
file_offset = ipmi_ek_display_board_info_area(
input_file, "Board Manufacture Data", &board_length);
ret = fseek(input_file, file_offset, SEEK_SET);
+
/* Board Product */
file_offset = ipmi_ek_display_board_info_area(
input_file, "Board Product Name", &board_length);
ret = fseek(input_file, file_offset, SEEK_SET);
+
/* Board Serial */
file_offset = ipmi_ek_display_board_info_area(
input_file, "Board Serial Number", &board_length);
ret = fseek(input_file, file_offset, SEEK_SET);
+
/* Board Part */
file_offset = ipmi_ek_display_board_info_area(
input_file, "Board Part Number", &board_length);
ret = fseek(input_file, file_offset, SEEK_SET);
+
/* FRU file ID */
file_offset = ipmi_ek_display_board_info_area(
input_file, "FRU File ID", &board_length);
ret = fseek(input_file, file_offset, SEEK_SET);
+
/* Additional Custom Mfg. */
file_offset = ipmi_ek_display_board_info_area(
input_file, "Custom", &board_length);
@@ -2602,7 +2663,7 @@ ipmi_ek_display_chassis_info_area(FILE *input_file, long offset)
unsigned char ch_type = 0;
unsigned int len;
- if (input_file == NULL) {
+ if (!input_file) {
lprintf(LOG_ERR, "No file stream to read.");
return (-1);
}
@@ -2684,12 +2745,18 @@ ipmi_ek_display_board_info_area(FILE *input_file, char *board_type,
int ret = 0;
unsigned char len = 0;
unsigned int size_board = 0;
- if (input_file == NULL || board_type == NULL
- || board_length == NULL) {
+ int custom_fields = 0;
+ if (!input_file || !board_type || !board_length) {
return (size_t)(-1);
}
file_offset = ftell(input_file);
+ /*
+ * TODO: This whole file's code is extremely dirty and wicked.
+ * Must eventually switch to using ipmi_fru.c code or some
+ * specialized FRU library.
+ */
+
/* Board length*/
ret = fread(&len, 1, 1, input_file);
if ((ret != 1) || ferror(input_file)) {
@@ -2698,21 +2765,22 @@ ipmi_ek_display_board_info_area(FILE *input_file, char *board_type,
}
(*board_length)--;
- /* Bit 5:0 of Board Mfg type represent legnth */
+ /* Bit 5:0 of Board Mfg type represent length */
size_board = (len & 0x3f);
if (size_board == 0) {
printf("%s: None\n", board_type);
goto out;
}
- if (strncmp(board_type, "Custom", 6 ) != 0) {
- unsigned char *data;
+ if (strcmp(board_type, "Custom")) {
+ unsigned char *data, *str;
unsigned int i = 0;
- data = malloc(size_board);
- if (data == NULL) {
+ data = malloc(size_board + 1); /* Make room for type/length field */
+ if (!data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (size_t)(-1);
}
- ret = fread(data, size_board, 1, input_file);
+ data[0] = len; /* Save the type/length byte in 'data' */
+ ret = fread(data + 1, size_board, 1, input_file);
if ((ret != 1) || ferror(input_file)) {
lprintf(LOG_ERR, "Invalid board type size!");
free(data);
@@ -2721,17 +2789,11 @@ ipmi_ek_display_board_info_area(FILE *input_file, char *board_type,
}
printf("%s type: 0x%02x\n", board_type, len);
printf("%s: ", board_type);
- for (i = 0; i < size_board; i++) {
- if ((len & TYPE_CODE) == TYPE_CODE) {
- printf("%c", data[i]);
- } else {
- /* other than language code (binary, BCD,
- * ASCII 6 bit...) is not supported
- */
- printf("%02x", data[i]);
- }
- }
- printf("\n");
+ i = 0;
+ str = (unsigned char *)get_fru_area_str(data, &i);
+ printf("%s\n", str);
+ free(str);
+ str = NULL;
free(data);
data = NULL;
(*board_length) -= size_board;
@@ -2744,7 +2806,12 @@ ipmi_ek_display_board_info_area(FILE *input_file, char *board_type,
/* take the rest of data in the area minus 1 byte of
* checksum
*/
- printf("Additional Custom Mfg. length: 0x%02x\n", len);
+ if (custom_fields) {
+ printf("End of Custom Mfg. fields (0x%02x)\n", len);
+ } else {
+ printf("No Additional Custom Mfg. fields (0x%02x)\n", len);
+ }
+
padding = (*board_length) - 1;
if ((padding > 0) && (!feof(input_file))) {
printf("Unused space: %d (bytes)\n", padding);
@@ -2758,37 +2825,47 @@ ipmi_ek_display_board_info_area(FILE *input_file, char *board_type,
printf("Checksum: 0x%02x\n", checksum);
goto out;
}
+ custom_fields++;
printf("Additional Custom Mfg. length: 0x%02x\n", len);
if ((size_board > 0) && (size_board < (*board_length))) {
- unsigned char * additional_data = NULL;
+ unsigned char *additional_data, *str;
unsigned int i = 0;
- additional_data = malloc(size_board);
- if (additional_data == NULL) {
+ additional_data = malloc(size_board + 1); /* Make room for type/length field */
+ if (!additional_data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (size_t)(-1);
}
-
- ret = fread(additional_data, size_board, 1, input_file);
+ additional_data[0] = len;
+ ret = fread(additional_data + 1, size_board, 1, input_file);
if ((ret != 1) || ferror(input_file)) {
lprintf(LOG_ERR, "Invalid Additional Data!");
- if (additional_data != NULL) {
+ if (additional_data) {
free(additional_data);
additional_data = NULL;
}
goto out;
}
- printf("Additional Custom Mfg. Data: %02x",
- additional_data[0]);
- for (i = 1; i < size_board; i++) {
- printf("-%02x", additional_data[i]);
- }
- printf("\n");
+ printf("Additional Custom Mfg. Data: ");
+ i = 0;
+ str = (unsigned char *)get_fru_area_str(additional_data, &i);
+ printf("%s\n", str);
+ free(str);
+ str = NULL;
free(additional_data);
additional_data = NULL;
+
(*board_length) -= size_board;
+ ret = fread(&len, 1, 1, input_file);
+ if ((ret != 1) || ferror(input_file)) {
+ lprintf(LOG_ERR, "Invalid Length!");
+ goto out;
+ }
+ (*board_length)--;
+ size_board = (len & 0x3f);
}
else {
- printf("No Additional Custom Mfg. %d\n", *board_length);
+ printf("ERROR: File has insufficient data (%d bytes) for the "
+ "Additional Custom Mfg. field\n", *board_length);
goto out;
}
}
@@ -2827,7 +2904,7 @@ ipmi_ek_display_product_info_area(FILE *input_file, long offset)
unsigned char data = 0;
unsigned int len = 0;
- if (input_file == NULL) {
+ if (!input_file) {
lprintf(LOG_ERR, "No file stream to read.");
return (-1);
}
@@ -2913,7 +2990,6 @@ ipmi_ek_display_product_info_area(FILE *input_file, long offset)
*
* Input: record: a pointer to current record
* list_head: a pointer to header of the list
-* list_last: a pointer to tale of the list
*
* Output: None
*
@@ -2924,17 +3000,16 @@ ipmi_ek_display_product_info_area(FILE *input_file, long offset)
***************************************************************************/
static void
ipmi_ek_display_record(struct ipmi_ek_multi_header *record,
- struct ipmi_ek_multi_header *list_head,
- struct ipmi_ek_multi_header *list_last)
+ struct ipmi_ek_multi_header *list_head)
{
- if (list_head == NULL) {
+ if (!list_head) {
printf("***empty list***\n");
return;
}
printf("%s\n", EQUAL_LINE_LIMITER);
printf("FRU Multi Info area\n");
printf("%s\n", EQUAL_LINE_LIMITER);
- for (record = list_head; record != NULL; record = record->next) {
+ for (record = list_head; record; record = record->next) {
printf("Record Type ID: 0x%02x\n", record->header.type);
printf("Record Format version: 0x%02x\n",
record->header.format);
@@ -3363,7 +3438,7 @@ ipmi_ek_display_board_p2p_record(struct ipmi_ek_multi_header *record)
printf("\n");
offset += sizeof(struct fru_picmgext_guid);
}
- for (offset;
+ for (offset = offset;
offset < record->header.len;
offset += sizeof(struct fru_picmgext_link_desc)) {
/* to solve little endian/big endian problem */
@@ -3387,7 +3462,7 @@ ipmi_ek_display_board_p2p_record(struct ipmi_ek_multi_header *record)
printf("ShMC Cross-connect (two-pair)\n");
break;
default:
- printf("Unknwon\n");
+ printf("Unknown\n");
break;
}
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET) {
@@ -3402,17 +3477,17 @@ ipmi_ek_display_board_p2p_record(struct ipmi_ek_multi_header *record)
printf("FC-PI\n");
break;
default:
- printf("Unknwon\n");
+ printf("Unknown\n");
break;
}
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_PCIE) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else {
- printf("Unknwon\n");
+ printf("Unknown\n");
}
printf("\tLink Type:\t\t0x%02x - ", d->type);
if (d->type == 0 || d->type == 0xff) {
@@ -3522,7 +3597,7 @@ ipmi_ek_display_radial_ipmb0_record(struct ipmi_ek_multi_header *record)
if (record->data[offset] < 1) {
return;
}
- for (offset; offset < record->header.len;) {
+ for (offset = offset; offset < record->header.len;) {
unsigned char entry_count = 0;
printf(" IPMB-0 Hub Descriptor\n");
printf("\tHardware Address: 0x%02x\n",
@@ -3996,7 +4071,7 @@ ipmi_ek_display_clock_config_record(struct ipmi_ek_multi_header *record)
*
* Restriction: None
*
-* Input/Ouput: filename1: name of the file that contain FRU binary data
+* Input/Output: filename1: name of the file that contain FRU binary data
* record: a pointer to current record
* list_head: a pointer to header of the list
* list_last: a pointer to tale of the list
@@ -4020,7 +4095,7 @@ ipmi_ekanalyzer_fru_file2structure(char *filename,
int ret = 0;
input_file = fopen(filename, "r");
- if (input_file == NULL) {
+ if (!input_file) {
lprintf(LOG_ERR, "File: '%s' is not found", filename);
return ERROR_STATUS;
}
@@ -4046,14 +4121,18 @@ ipmi_ekanalyzer_fru_file2structure(char *filename,
fseek(input_file, multi_offset, SEEK_SET);
while (!feof(input_file)) {
- /* TODO - check malloc() */
*list_record = malloc(sizeof(struct ipmi_ek_multi_header));
+ if (!(*list_record)) {
+ lprintf(LOG_ERR, "ipmitool: malloc failure");
+ return ERROR_STATUS;
+ }
ret = fread(&(*list_record)->header, START_DATA_OFFSET, 1,
input_file);
if ((ret != 1) || ferror(input_file)) {
- /* TODO - no free?! */
- lprintf(LOG_ERR, "Invalid Header!");
+ free(*list_record);
+ *list_record = NULL;
fclose(input_file);
+ lprintf(LOG_ERR, "Invalid Header!");
return ERROR_STATUS;
}
if ((*list_record)->header.len == 0) {
@@ -4061,7 +4140,7 @@ ipmi_ekanalyzer_fru_file2structure(char *filename,
continue;
}
(*list_record)->data = malloc((*list_record)->header.len);
- if ((*list_record)->data == NULL) {
+ if (!(*list_record)->data) {
lprintf(LOG_ERR, "Failed to allocation memory size %d\n",
(*list_record)->header.len);
record_count++;
@@ -4106,7 +4185,7 @@ ipmi_ekanalyzer_fru_file2structure(char *filename,
*
* Function name: ipmi_ek_add_record2list
*
-* Description: this function adds a sigle FRU multi record to a linked list of
+* Description: this function adds a single FRU multi record to a linked list of
* FRU multi record.
*
* Restriction: None
@@ -4125,18 +4204,18 @@ ipmi_ek_add_record2list(struct ipmi_ek_multi_header **record,
struct ipmi_ek_multi_header **list_head,
struct ipmi_ek_multi_header **list_last)
{
- if (*list_head == NULL) {
- *list_head = *record;
- (*record)->prev = NULL;
- if (verbose > 2) {
- printf("Adding first record to list\n");
- }
- } else {
+ if (*list_head) {
(*list_last)->next = *record;
(*record)->prev = *list_last;
if (verbose > 2) {
printf("Add 1 record to list\n");
}
+ } else {
+ *list_head = *record;
+ (*record)->prev = NULL;
+ if (verbose > 2) {
+ printf("Adding first record to list\n");
+ }
}
*list_last = *record;
(*record)->next = NULL;
@@ -4146,7 +4225,7 @@ ipmi_ek_add_record2list(struct ipmi_ek_multi_header **record,
*
* Function name: ipmi_ek_remove_record_from_list
*
-* Description: this function removes a sigle FRU multi record from a linked
+* Description: this function removes a single FRU multi record from a linked
* list of FRU multi record.
*
* Restriction: None
@@ -4165,12 +4244,12 @@ ipmi_ek_remove_record_from_list(struct ipmi_ek_multi_header *record,
struct ipmi_ek_multi_header **list_head,
struct ipmi_ek_multi_header **list_last)
{
- if (record->prev == NULL) {
+ if (!record->prev) {
*list_head = record->next;
} else {
record->prev->next = record->next;
}
- if (record->next == NULL) {
+ if (!record->next) {
(*list_last) = record->prev;
} else {
record->next->prev = record->prev;
diff --git a/lib/ipmi_event.c b/lib/ipmi_event.c
index 16fc80d..df6aa51 100644
--- a/lib/ipmi_event.c
+++ b/lib/ipmi_event.c
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _BSD_SOURCE
#include <stdlib.h>
#include <stdio.h>
@@ -53,6 +52,14 @@
#include <ipmitool/ipmi_event.h>
#include <ipmitool/ipmi_sdr.h>
+static
+inline
+bool
+is_system(const struct channel_info_t *chinfo)
+{
+ return (IPMI_CHANNEL_MEDIUM_SYSTEM == chinfo->medium
+ || CH_SYSTEM == chinfo->channel);
+}
static void
ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
@@ -62,7 +69,8 @@ ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
memset(&sel_event, 0, sizeof(struct sel_event_record));
sel_event.record_id = 0;
- sel_event.sel_type.standard_type.gen_id = 2;
+ htoipmi16(EVENT_GENERATOR(SMS, 0),
+ (void *)&sel_event.sel_type.standard_type.gen_id);
sel_event.sel_type.standard_type.evm_rev = pmsg->evm_rev;
sel_event.sel_type.standard_type.sensor_type = pmsg->sensor_type;
@@ -84,36 +92,42 @@ ipmi_send_platform_event(struct ipmi_intf * intf, struct platform_event_msg * em
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
- uint8_t rqdata[8];
- uint8_t chmed;
+ uint8_t rqdata[PLATFORM_EVENT_DATA_LEN_MAX];
+ uint8_t *rqdata_start = rqdata;
+ struct channel_info_t chinfo;
memset(&req, 0, sizeof(req));
- memset(rqdata, 0, 8);
+ memset(rqdata, 0, sizeof(rqdata));
req.msg.netfn = IPMI_NETFN_SE;
- req.msg.cmd = 0x02;
+ req.msg.cmd = IPMI_CMD_PLATFORM_EVENT;
req.msg.data = rqdata;
+ req.msg.data_len = PLATFORM_EVENT_DATA_LEN_NON_SI;
- chmed = ipmi_current_channel_medium(intf);
- if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
- /* system interface, need extra generator ID */
- req.msg.data_len = 8;
- rqdata[0] = 0x41; // As per Fig. 29-2 and Table 5-4
- memcpy(rqdata+1, emsg, sizeof(struct platform_event_msg));
+ ipmi_current_channel_info(intf, &chinfo);
+ if (chinfo.channel == CH_UNKNOWN) {
+ lprintf(LOG_ERR, "Failed to send the platform event "
+ "via an unknown channel");
+ return -3;
}
- else {
- req.msg.data_len = 7;
- memcpy(rqdata, emsg, sizeof(struct platform_event_msg));
+
+ if (is_system(&chinfo)) {
+ /* system interface, need extra generator ID, see Fig. 29-2 */
+ req.msg.data_len = PLATFORM_EVENT_DATA_LEN_SI;
+ rqdata[0] = EVENT_GENERATOR(SMS, 0);
+ rqdata_start++;
}
+ memcpy(rqdata_start, emsg, sizeof(struct platform_event_msg));
+
ipmi_event_msg_print(intf, emsg);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Platform Event Message command failed");
return -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Platform Event Message command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -207,18 +221,20 @@ ipmi_send_platform_event_num(struct ipmi_intf * intf, int num)
}
static int
-ipmi_event_find_offset(uint8_t code,
- struct ipmi_event_sensor_types * evt,
- char * desc)
+ipmi_event_find_offset(struct ipmi_intf *intf, uint8_t sensor_type, uint8_t event_type, char *desc)
{
- if (desc == NULL || code == 0)
+ const struct ipmi_event_sensor_types *evt;
+
+ if (!desc || sensor_type == 0 || event_type == 0) {
return 0x00;
+ }
- while (evt->type) {
- if (evt->code == code && evt->desc != NULL &&
- strncasecmp(desc, evt->desc, __maxlen(desc, evt->desc)) == 0)
+ for (evt = ipmi_get_first_event_sensor_type(intf, sensor_type, event_type);
+ evt; evt = ipmi_get_next_event_sensor_type(evt)) {
+ if (evt->desc &&
+ strcasecmp(desc, evt->desc) == 0) {
return evt->offset;
- evt++;
+ }
}
lprintf(LOG_WARN, "Unable to find matching event offset for '%s'", desc);
@@ -226,11 +242,11 @@ ipmi_event_find_offset(uint8_t code,
}
static void
-print_sensor_states(uint8_t sensor_type, uint8_t event_type)
+print_sensor_states(struct ipmi_intf *intf, uint8_t sensor_type, uint8_t event_type)
{
- ipmi_sdr_print_discrete_state_mini(
+ ipmi_sdr_print_discrete_state_mini(intf,
"Sensor States: \n ", "\n ", sensor_type,
- event_type, 0xff, 0xff);
+ event_type, 0xff, 0xff);
printf("\n");
}
@@ -244,7 +260,7 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
int off;
uint8_t target, lun, channel;
- if (id == NULL) {
+ if (!id) {
lprintf(LOG_ERR, "No sensor ID supplied");
return -1;
}
@@ -252,11 +268,11 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
memset(&emsg, 0, sizeof(struct platform_event_msg));
emsg.evm_rev = 0x04;
- if (evdir == NULL)
+ if (!evdir)
emsg.event_dir = EVENT_DIR_ASSERT;
- else if (strncasecmp(evdir, "assert", 6) == 0)
+ else if (!strcmp(evdir, "assert"))
emsg.event_dir = EVENT_DIR_ASSERT;
- else if (strncasecmp(evdir, "deassert", 8) == 0)
+ else if (!strcmp(evdir, "deassert"))
emsg.event_dir = EVENT_DIR_DEASSERT;
else {
lprintf(LOG_ERR, "Invalid event direction %s. Must be 'assert' or 'deassert'", evdir);
@@ -265,7 +281,7 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
printf("Finding sensor %s... ", id);
sdr = ipmi_sdr_find_sdr_byid(intf, id);
- if (sdr == NULL) {
+ if (!sdr) {
printf("not found!\n");
return -1;
}
@@ -302,7 +318,7 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
int hilo = 0;
off = 1;
- if (state == NULL || strncasecmp(state, "list", 4) == 0) {
+ if (!state || !strcmp(state, "list")) {
printf("Sensor States:\n");
printf(" lnr : Lower Non-Recoverable \n");
printf(" lcr : Lower Critical\n");
@@ -313,12 +329,12 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
return -1;
}
- if (0 != strncasecmp(state, "lnr", 3) &&
- 0 != strncasecmp(state, "lcr", 3) &&
- 0 != strncasecmp(state, "lnc", 3) &&
- 0 != strncasecmp(state, "unc", 3) &&
- 0 != strncasecmp(state, "ucr", 3) &&
- 0 != strncasecmp(state, "unr", 3))
+ if (0 != strcmp(state, "lnr") &&
+ 0 != strcmp(state, "lcr") &&
+ 0 != strcmp(state, "lnc") &&
+ 0 != strcmp(state, "unc") &&
+ 0 != strcmp(state, "ucr") &&
+ 0 != strcmp(state, "unr"))
{
lprintf(LOG_ERR, "Invalid threshold identifier %s", state);
return -1;
@@ -347,11 +363,11 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
rsp = ipmi_sdr_get_sensor_thresholds(intf, emsg.sensor_num,
target, lun, channel);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Command Get Sensor Thresholds failed: invalid response.");
return (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Command Get Sensor Thresholds failed: %s",
val2str(rsp->ccode, completion_code_vals));
return (-1);
@@ -362,7 +378,7 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
rsp = ipmi_sdr_get_sensor_hysteresis(intf, emsg.sensor_num,
target, lun, channel);
- if (rsp != NULL && rsp->ccode == 0)
+ if (rsp && !rsp->ccode)
off = dir ? rsp->data[0] : rsp->data[1];
if (off <= 0)
off = 1;
@@ -399,8 +415,8 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
/*
* print list of available states for this sensor
*/
- if (state == NULL || strncasecmp(state, "list", 4) == 0) {
- print_sensor_states(emsg.sensor_type, emsg.event_type);
+ if (!state || strcasecmp(state, "list") == 0) {
+ print_sensor_states(intf, emsg.sensor_type, emsg.event_type);
printf("Sensor State Shortcuts:\n");
for (x = 0; x < sizeof(digi_on)/sizeof(*digi_on); x++) {
printf(" %-9s %-9s\n", digi_on[x], digi_off[x]);
@@ -410,20 +426,20 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
off = 0;
for (x = 0; x < sizeof(digi_on)/sizeof(*digi_on); x++) {
- if (strncasecmp(state, digi_on[x], strlen(digi_on[x])) == 0) {
+ if (strcasecmp(state, digi_on[x]) == 0) {
emsg.event_data[0] = 1;
off = 1;
break;
}
- else if (strncasecmp(state, digi_off[x], strlen(digi_off[x])) == 0) {
+ else if (strcasecmp(state, digi_off[x]) == 0) {
emsg.event_data[0] = 0;
off = 1;
break;
}
}
if (off == 0) {
- off = ipmi_event_find_offset(
- emsg.event_type, generic_event_types, state);
+ off = ipmi_event_find_offset(intf,
+ emsg.sensor_type, emsg.event_type, state);
if (off < 0)
return -1;
emsg.event_data[0] = off;
@@ -439,12 +455,12 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
/*
* print list of available states for this sensor
*/
- if (state == NULL || strncasecmp(state, "list", 4) == 0) {
- print_sensor_states(emsg.sensor_type, emsg.event_type);
+ if (!state || strcasecmp(state, "list") == 0) {
+ print_sensor_states(intf, emsg.sensor_type, emsg.event_type);
return 0;
}
- off = ipmi_event_find_offset(
- emsg.event_type, generic_event_types, state);
+ off = ipmi_event_find_offset(intf,
+ emsg.sensor_type, emsg.event_type, state);
if (off < 0)
return -1;
emsg.event_data[0] = off;
@@ -459,12 +475,12 @@ ipmi_event_fromsensor(struct ipmi_intf * intf, char * id, char * state, char * e
/*
* print list of available states for this sensor
*/
- if (state == NULL || strncasecmp(state, "list", 4) == 0) {
- print_sensor_states(emsg.sensor_type, emsg.event_type);
+ if (!state || strcasecmp(state, "list") == 0) {
+ print_sensor_states(intf, emsg.sensor_type, emsg.event_type);
return 0;
}
- off = ipmi_event_find_offset(
- emsg.sensor_type, sensor_specific_types, state);
+ off = ipmi_event_find_offset(intf,
+ emsg.sensor_type, emsg.event_type, state);
if (off < 0)
return -1;
emsg.event_data[0] = off;
@@ -483,43 +499,30 @@ static int
ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
{
FILE * fp;
- struct ipmi_rs * rsp;
- struct ipmi_rq req;
- struct sel_event_record sel_event;
- uint8_t rqdata[8];
+ /* For ease of filling in from file data */
+ union {
+ struct platform_event_msg emsg;
+ uint8_t bytes[sizeof(struct platform_event_msg)];
+ } __attribute__ ((packed)) rqdata;
char buf[1024];
char * ptr, * tok;
- int i, j;
- uint8_t chmed;
int rc = 0;
- if (file == NULL)
+ if (!file)
return -1;
- memset(rqdata, 0, 8);
-
- /* setup Platform Event Message command */
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_SE;
- req.msg.cmd = 0x02;
- req.msg.data = rqdata;
- req.msg.data_len = 7;
-
- chmed = ipmi_current_channel_medium(intf);
- if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
- /* system interface, need extra generator ID */
- rqdata[0] = 0x41; // As per Fig. 29-2 and Table 5-4
- req.msg.data_len = 8;
- }
-
fp = ipmi_open_file_read(file);
- if (fp == NULL)
+ if (!fp)
return -1;
while (feof(fp) == 0) {
- if (fgets(buf, 1024, fp) == NULL)
+ size_t count = 0;
+ if (!fgets(buf, 1024, fp))
continue;
+ /* Each line is a new event */
+ memset(&rqdata, 0, sizeof(rqdata));
+
/* clip off optional comment tail indicated by # */
ptr = strchr(buf, '#');
if (ptr)
@@ -539,49 +542,28 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
/* parse the event, 7 bytes with optional comment */
/* 0x00 0x00 0x00 0x00 0x00 0x00 0x00 # event */
- i = 0;
tok = strtok(ptr, " ");
while (tok) {
- if (i == 7)
+ if (count == sizeof(struct platform_event_msg))
+ break;
+ if (0 > str2uchar(tok, &rqdata.bytes[count])) {
+ lprintf(LOG_ERR, "Invalid token in file: [%s]", tok);
+ rc = -1;
break;
- j = i++;
- if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM)
- j++;
- rqdata[j] = (uint8_t)strtol(tok, NULL, 0);
+ }
tok = strtok(NULL, " ");
+ ++count;
}
- if (i < 7) {
+ if (count < sizeof(struct platform_event_msg)) {
lprintf(LOG_ERR, "Invalid Event: %s",
- buf2str(rqdata, sizeof(rqdata)));
+ buf2str(rqdata.bytes, sizeof(rqdata.bytes)));
continue;
}
- memset(&sel_event, 0, sizeof(struct sel_event_record));
- sel_event.record_id = 0;
- sel_event.sel_type.standard_type.gen_id = 2;
-
- j = (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) ? 1 : 0;
- sel_event.sel_type.standard_type.evm_rev = rqdata[j++];
- sel_event.sel_type.standard_type.sensor_type = rqdata[j++];
- sel_event.sel_type.standard_type.sensor_num = rqdata[j++];
- sel_event.sel_type.standard_type.event_type = rqdata[j] & 0x7f;
- sel_event.sel_type.standard_type.event_dir = (rqdata[j++] & 0x80) >> 7;
- sel_event.sel_type.standard_type.event_data[0] = rqdata[j++];
- sel_event.sel_type.standard_type.event_data[1] = rqdata[j++];
- sel_event.sel_type.standard_type.event_data[2] = rqdata[j++];
-
- ipmi_sel_print_std_entry(intf, &sel_event);
-
- rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_ERR, "Platform Event Message command failed");
- rc = -1;
- }
- else if (rsp->ccode > 0) {
- lprintf(LOG_ERR, "Platform Event Message command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
- rc = -1;
- }
+ /* Now actually send it, failures will be logged by the sender */
+ rc = ipmi_send_platform_event(intf, &rqdata.emsg);
+ if (IPMI_CC_OK != rc)
+ break;
}
fclose(fp);
@@ -614,11 +596,11 @@ ipmi_event_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = 0;
- if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc == 0 || !strcmp(argv[0], "help")) {
ipmi_event_usage();
return 0;
}
- if (strncmp(argv[0], "file", 4) == 0) {
+ if (!strcmp(argv[0], "file")) {
if (argc < 2) {
ipmi_event_usage();
return 0;
diff --git a/lib/ipmi_firewall.c b/lib/ipmi_firewall.c
index c3f51ad..640a4ad 100644
--- a/lib/ipmi_firewall.c
+++ b/lib/ipmi_firewall.c
@@ -128,7 +128,7 @@ ipmi_firewall_parse_args(int argc, char ** argv, struct ipmi_function_params * p
return -1;
}
for (i=0; i<argc; i++) {
- if (strncmp(argv[i], "channel", 7) == 0 && (++i < argc)) {
+ if (!strcmp(argv[i], "channel") && (++i < argc)) {
uint8_t channel_tmp = 0;
if (is_ipmi_channel_num(argv[i], &channel_tmp) != 0) {
conv_err = 1;
@@ -137,31 +137,31 @@ ipmi_firewall_parse_args(int argc, char ** argv, struct ipmi_function_params * p
p->channel = channel_tmp;
}
}
- else if (strncmp(argv[i], "lun", 3) == 0 && (++i < argc)) {
+ else if (!strcmp(argv[i], "lun") && (++i < argc)) {
if (str2int(argv[i], &(p->lun)) != 0) {
lprintf(LOG_ERR, "Given lun '%s' is invalid.", argv[i]);
conv_err = 1;
break;
}
}
- else if (strncmp(argv[i], "force", 5) == 0) {
+ else if (!strcmp(argv[i], "force")) {
p->force = 1;
}
- else if (strncmp(argv[i], "netfn", 5) == 0 && (++i < argc)) {
+ else if (!strcmp(argv[i], "netfn") && (++i < argc)) {
if (str2int(argv[i], &(p->netfn)) != 0) {
lprintf(LOG_ERR, "Given netfn '%s' is invalid.", argv[i]);
conv_err = 1;
break;
}
}
- else if (strncmp(argv[i], "command", 7) == 0 && (++i < argc)) {
+ else if (!strcmp(argv[i], "command") && (++i < argc)) {
if (str2int(argv[i], &(p->command)) != 0) {
lprintf(LOG_ERR, "Given command '%s' is invalid.", argv[i]);
conv_err = 1;
break;
}
}
- else if (strncmp(argv[i], "subfn", 5) == 0 && (++i < argc)) {
+ else if (!strcmp(argv[i], "subfn") && (++i < argc)) {
if (str2int(argv[i], &(p->subfn)) != 0) {
lprintf(LOG_ERR, "Given subfn '%s' is invalid.", argv[i]);
conv_err = 1;
@@ -235,11 +235,11 @@ _get_netfn_support(struct ipmi_intf * intf, int channel, unsigned char * lun, un
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get NetFn Support command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get NetFn Support command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -289,11 +289,11 @@ _get_command_support(struct ipmi_intf * intf,
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Command Support (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Command Support (LUN=%d, NetFn=%d, op=0) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -316,11 +316,11 @@ _get_command_support(struct ipmi_intf * intf,
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Command Support (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Command Support (LUN=%d, NetFn=%d, op=1) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -368,11 +368,11 @@ _get_command_configurable(struct ipmi_intf * intf,
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Configurable Command (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Configurable Command (LUN=%d, NetFn=%d, op=0) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -395,11 +395,11 @@ _get_command_configurable(struct ipmi_intf * intf,
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Configurable Command (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Configurable Command (LUN=%d, NetFn=%d, op=1) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -447,11 +447,11 @@ _get_command_enables(struct ipmi_intf * intf,
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Command Enables (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Command Enables (LUN=%d, NetFn=%d, op=0) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -474,11 +474,11 @@ _get_command_enables(struct ipmi_intf * intf,
req.msg.data_len = 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Command Enables (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Command Enables (LUN=%d, NetFn=%d, op=1) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -558,11 +558,11 @@ _set_command_enables(struct ipmi_intf * intf,
req.msg.data_len = 19;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Command Enables (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Command Enables (LUN=%d, NetFn=%d, op=0) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -579,11 +579,11 @@ _set_command_enables(struct ipmi_intf * intf,
req.msg.data_len = 19;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Command Enables (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->netfn);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Command Enables (LUN=%d, NetFn=%d, op=1) command failed: %s",
p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -625,11 +625,11 @@ _get_subfn_support(struct ipmi_intf * intf,
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Command Sub-function Support (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Command Sub-function Support (LUN=%d, NetFn=%d, command=%d) command failed: %s",
p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -672,11 +672,11 @@ _get_subfn_configurable(struct ipmi_intf * intf,
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Configurable Command Sub-function (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Configurable Command Sub-function (LUN=%d, NetFn=%d, command=%d) command failed: %s",
p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -719,11 +719,11 @@ _get_subfn_enables(struct ipmi_intf * intf,
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Command Sub-function Enables (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Command Sub-function Enables (LUN=%d, NetFn=%d, command=%d) command failed: %s",
p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -787,11 +787,11 @@ _set_subfn_enables(struct ipmi_intf * intf,
req.msg.data_len = 8;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Command Sub-function Enables (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Command Sub-function Enables (LUN=%d, NetFn=%d, command=%d) command failed: %s",
p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -888,7 +888,7 @@ static int _gather_info(struct ipmi_intf * intf, struct ipmi_function_params * p
/* ipmi_firewall_info - print out info for firewall functions
*
- * @intf: ipmi inteface
+ * @intf: ipmi interface
* @argc: argument count
* @argv: argument list
*
@@ -899,11 +899,11 @@ static int
ipmi_firewall_info(struct ipmi_intf * intf, int argc, char ** argv)
{
int ret = 0;
- struct ipmi_function_params p = {0xe, -1, -1, -1, -1};
+ struct ipmi_function_params p = {0xe, -1, -1, -1, -1, 0};
struct bmc_fn_support * bmc_fn_support;
unsigned int l, n, c;
- if ((argc > 0 && strncmp(argv[0], "help", 4) == 0) || ipmi_firewall_parse_args(argc, argv, &p) < 0)
+ if ((argc > 0 && !strcmp(argv[0], "help")) || ipmi_firewall_parse_args(argc, argv, &p) < 0)
{
printf_firewall_info_usage();
return 0;
@@ -1001,7 +1001,7 @@ ipmi_firewall_info(struct ipmi_intf * intf, int argc, char ** argv)
/* ipmi_firewall_enable_disable - enable/disable BMC functions
*
- * @intf: ipmi inteface
+ * @intf: ipmi interface
* @enable: whether to enable or disable
* @argc: argument count
* @argv: argument list
@@ -1012,13 +1012,13 @@ ipmi_firewall_info(struct ipmi_intf * intf, int argc, char ** argv)
static int
ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char ** argv)
{
- struct ipmi_function_params p = {0xe, -1, -1, -1, -1};
+ struct ipmi_function_params p = {0xe, -1, -1, -1, -1, 0};
struct bmc_fn_support * bmc_fn_support;
int ret;
unsigned int l, n, c;
unsigned char enables[MAX_COMMAND_BYTES];
- if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc < 1 || !strcmp(argv[0], "help")) {
char * s1 = enable?"en":"dis";
char * s2 = enable?"":" [force]";
printf("%sable [channel H] lun L netfn N%s\n", s1, s2);
@@ -1055,7 +1055,7 @@ ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char
c = p.command;
if (p.subfn >= 0) {
// firewall (en|dis)able [channel c] lun l netfn n command m subfn s
- // (en|dis)able this sub-function for this commnad on this lun/netfn pair
+ // (en|dis)able this sub-function for this command on this lun/netfn pair
memcpy(enables,
bmc_fn_support->lun[l].netfn[n].command[c].subfn_enable,
MAX_SUBFN_BYTES);
@@ -1065,7 +1065,7 @@ ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char
} else if (p.command >= 0) {
// firewall (en|dis)able [channel c] lun l netfn n command m
- // (en|dis)able all subfn and command for this commnad on this lun/netfn pair
+ // (en|dis)able all subfn and command for this command on this lun/netfn pair
memset(enables, enable?0xff:0, MAX_SUBFN_BYTES);
ret = _set_subfn_enables(intf, &p,
&bmc_fn_support->lun[l].netfn[n].command[c], enables);
@@ -1076,14 +1076,14 @@ ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char
&bmc_fn_support->lun[l].netfn[n], enables, p.force);
} else if (p.netfn >= 0) {
// firewall (en|dis)able [channel c] lun l netfn n
- // (en|dis)able all commnads on this lun/netfn pair
+ // (en|dis)able all command on this lun/netfn pair
memset(enables, enable?0xff:0, sizeof(enables));
ret = _set_command_enables(intf, &p,
&bmc_fn_support->lun[l].netfn[n], enables, p.force);
/*
} else if (p.lun >= 0) {
// firewall (en|dis)able [channel c] lun l
- // (en|dis)able all commnads on all netfn pairs for this lun
+ // (en|dis)able all command on all netfn pairs for this lun
*/
}
free(bmc_fn_support);
@@ -1093,7 +1093,7 @@ ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char
/* ipmi_firewall_reset - reset firmware firewall to enable everything
*
- * @intf: ipmi inteface
+ * @intf: ipmi interface
* @argc: argument count
* @argv: argument list
*
@@ -1103,7 +1103,7 @@ ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char
static int
ipmi_firewall_reset(struct ipmi_intf * intf, int argc, char ** argv)
{
- struct ipmi_function_params p = {0xe, -1, -1, -1, -1};
+ struct ipmi_function_params p = {0xe, -1, -1, -1, -1, 0};
struct bmc_fn_support * bmc_fn_support;
int ret;
unsigned int l, n, c;
@@ -1113,7 +1113,7 @@ ipmi_firewall_reset(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_ERR, "Not enough parameters given.");
printf_firewall_usage();
return (-1);
- } else if (argc > 0 && strncmp(argv[0], "help", 4) == 0) {
+ } else if (argc > 0 && !strcmp(argv[0], "help")) {
printf_firewall_usage();
return 0;
}
@@ -1135,8 +1135,8 @@ ipmi_firewall_reset(struct ipmi_intf * intf, int argc, char ** argv)
for (l=0; l<MAX_LUN; l++) {
p.lun = l;
- for (n=0; n<MAX_NETFN; n+=2) {
- p.netfn = n;
+ for (n=0; n<MAX_NETFN_PAIR; n++) {
+ p.netfn = n*2;
for (c=0; c<MAX_COMMAND; c++) {
p.command = c;
printf("reset lun %d, netfn %d, command %d, subfn\n", l, n, c);
@@ -1171,19 +1171,19 @@ ipmi_firewall_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = 0;
- if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc < 1 || !strcmp(argv[0], "help")) {
printf_firewall_usage();
}
- else if (strncmp(argv[0], "info", 4) == 0) {
+ else if (!strcmp(argv[0], "info")) {
rc = ipmi_firewall_info(intf, argc-1, &(argv[1]));
}
- else if (strncmp(argv[0], "enable", 6) == 0) {
+ else if (!strcmp(argv[0], "enable")) {
rc = ipmi_firewall_enable_disable(intf, 1, argc-1, &(argv[1]));
}
- else if (strncmp(argv[0], "disable", 7) == 0) {
+ else if (!strcmp(argv[0], "disable")) {
rc = ipmi_firewall_enable_disable(intf, 0, argc-1, &(argv[1]));
}
- else if (strncmp(argv[0], "reset", 5) == 0) {
+ else if (!strcmp(argv[0], "reset")) {
rc = ipmi_firewall_reset(intf, argc-1, &(argv[1]));
}
else {
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 5c94b08..3d1d8a1 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -33,12 +33,15 @@
#include <ipmitool/ipmi.h>
#include <ipmitool/log.h>
#include <ipmitool/helper.h>
+#include <ipmitool/ipmi_cc.h>
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_fru.h>
#include <ipmitool/ipmi_mc.h>
#include <ipmitool/ipmi_sdr.h>
#include <ipmitool/ipmi_strings.h> /* IANA id strings */
+#include <ipmitool/ipmi_time.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -49,17 +52,65 @@
#endif
#define FRU_MULTIREC_CHUNK_SIZE (255 + sizeof(struct fru_multirec_header))
+#define FRU_FIELD_VALID(a) (a && a[0])
+
+static const char *section_id[4] = {
+ "Internal Use Section",
+ "Chassis Section",
+ "Board Section",
+ "Product Section"
+};
+
+static const char * combined_voltage_desc[] = {
+ "12 V",
+ "-12 V",
+ "5 V",
+ "3.3 V"
+};
+
+static const char * chassis_type_desc[] = {
+ "Unspecified",
+ "Other",
+ "Unknown",
+ "Desktop",
+ "Low Profile Desktop",
+ "Pizza Box",
+ "Mini Tower",
+ "Tower",
+ "Portable",
+ "LapTop",
+ "Notebook",
+ "Hand Held",
+ "Docking Station",
+ "All in One",
+ "Sub Notebook",
+ "Space-saving",
+ "Lunch Box",
+ "Main Server Chassis",
+ "Expansion Chassis",
+ "SubChassis",
+ "Bus Expansion Chassis",
+ "Peripheral Chassis",
+ "RAID Chassis",
+ "Rack Mount Chassis",
+ "Sealed-case PC",
+ "Multi-system Chassis",
+ "CompactPCI",
+ "AdvancedTCA",
+ "Blade",
+ "Blade Enclosure"
+};
+
+static inline bool fru_cc_rq2big(int code) {
+ return (code == IPMI_CC_REQ_DATA_INV_LENGTH
+ || code == IPMI_CC_REQ_DATA_FIELD_EXCEED
+ || code == IPMI_CC_CANT_RET_NUM_REQ_BYTES);
+}
/* From lib/dimm_spd.c: */
int
ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id);
-/* From src/plugins/ipmi_intf.c: */
-void
-ipmi_intf_set_max_request_data_size(struct ipmi_intf * intf, uint16_t size);
-void
-ipmi_intf_set_max_response_data_size(struct ipmi_intf * intf, uint16_t size);
-
extern int verbose;
static void ipmi_fru_read_to_bin(struct ipmi_intf * intf, char * pFileName, uint8_t fruId);
@@ -100,7 +151,7 @@ char * get_fru_area_str(uint8_t * data, uint32_t * offset)
{
static const char bcd_plus[] = "0123456789 -.:,_";
char * str;
- int len, off, size, i, j, k, typecode;
+ int len, off, size, i, j, k, typecode, char_idx;
union {
uint32_t bits;
char chars[4];
@@ -119,15 +170,15 @@ char * get_fru_area_str(uint8_t * data, uint32_t * offset)
switch (typecode) {
case 0: /* 00b: binary/unspecified */
- /* hex dump -> 2x length */
- size = (len*2);
+ case 1: /* 01b: BCD plus */
+ /* hex dump or BCD -> 2x length */
+ size = (len * 2);
break;
case 2: /* 10b: 6-bit ASCII */
- /* 4 chars per group of 1-3 bytes */
- size = ((((len+2)*4)/3) & ~3);
+ /* 4 chars per group of 1-3 bytes, round up to 4 bytes boundary */
+ size = (len / 3 + 1) * 4;
break;
case 3: /* 11b: 8-bit ASCII */
- case 1: /* 01b: BCD plus */
/* no length adjustment */
size = len;
break;
@@ -138,11 +189,11 @@ char * get_fru_area_str(uint8_t * data, uint32_t * offset)
return NULL;
}
str = malloc(size+1);
- if (str == NULL)
+ if (!str)
return NULL;
memset(str, 0, size+1);
- if (len == 0) {
+ if (size == 0) {
str[0] = '\0';
*offset = off;
return str;
@@ -150,30 +201,30 @@ char * get_fru_area_str(uint8_t * data, uint32_t * offset)
switch (typecode) {
case 0: /* Binary */
- strncpy(str, buf2str(&data[off], len), len*2);
+ strncpy(str, buf2str(&data[off], len), size);
break;
case 1: /* BCD plus */
- for (k=0; k<len; k++)
- str[k] = bcd_plus[(data[off+k] & 0x0f)];
+ for (k = 0; k < size; k++)
+ str[k] = bcd_plus[((data[off + k / 2] >> ((k % 2) ? 0 : 4)) & 0x0f)];
str[k] = '\0';
break;
case 2: /* 6-bit ASCII */
- for (i=j=0; i<len; i+=3) {
+ for (i = j = 0; i < len; i += 3) {
u.bits = 0;
- k = ((len-i) < 3 ? (len-i) : 3);
+ k = ((len - i) < 3 ? (len - i) : 3);
#if WORDS_BIGENDIAN
u.chars[3] = data[off+i];
u.chars[2] = (k > 1 ? data[off+i+1] : 0);
u.chars[1] = (k > 2 ? data[off+i+2] : 0);
-#define CHAR_IDX 3
+ char_idx = 3;
#else
memcpy((void *)&u.bits, &data[off+i], k);
-#define CHAR_IDX 0
+ char_idx = 0;
#endif
for (k=0; k<4; k++) {
- str[j++] = ((u.chars[CHAR_IDX] & 0x3f) + 0x20);
+ str[j++] = ((u.chars[char_idx] & 0x3f) + 0x20);
u.bits >>= 6;
}
}
@@ -181,8 +232,8 @@ char * get_fru_area_str(uint8_t * data, uint32_t * offset)
break;
case 3:
- memcpy(str, &data[off], len);
- str[len] = '\0';
+ memcpy(str, &data[off], size);
+ str[size] = '\0';
break;
}
@@ -197,26 +248,26 @@ char * get_fru_area_str(uint8_t * data, uint32_t * offset)
* input_filename - user input string
*
* returns 0 if path is ok
- * returns (-1) if path is NULL
- * returns (-2) if path is too short
- * returns (-3) if path is too long
+ * returns -1 if path is NULL
+ * returns -2 if path is too short
+ * returns -3 if path is too long
*/
int
is_valid_filename(const char *input_filename)
{
- if (input_filename == NULL) {
+ if (!input_filename) {
lprintf(LOG_ERR, "ERROR: NULL pointer passed.");
- return (-1);
+ return -1;
}
if (strlen(input_filename) < 1) {
lprintf(LOG_ERR, "File/path is invalid.");
- return (-2);
+ return -2;
}
if (strlen(input_filename) >= 512) {
lprintf(LOG_ERR, "File/path must be shorter than 512 bytes.");
- return (-3);
+ return -3;
}
return 0;
@@ -264,12 +315,12 @@ build_fru_bloc(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, " Device not present (No Response)");
return NULL;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR," Device not present (%s)",
val2str(rsp->ccode, completion_code_vals));
return NULL;
@@ -421,11 +472,15 @@ free_fru_bloc(t_ipmi_fru_bloc *bloc)
while (bloc) {
del = bloc;
bloc = bloc->next;
- free(del);
- del = NULL;
+ free_n(&del);
}
}
+/* By how many bytes to reduce a write command on a size failure. */
+#define FRU_BLOCK_SZ 8
+/* Baseline for a large enough piece to reduce via steps instead of bytes. */
+#define FRU_AREA_MAXIMUM_BLOCK_SZ 32
+
/*
* write FRU[doffset:length] from the pFrubuf[soffset:length]
* rc=1 on success
@@ -451,7 +506,7 @@ write_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
if (fru->access && ((doffset & 1) || (length & 1))) {
lprintf(LOG_ERROR, "Odd offset or length specified");
- return (-1);
+ return -1;
}
t_ipmi_fru_bloc * fru_bloc = build_fru_bloc(intf, fru, id);
@@ -547,20 +602,20 @@ write_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
break;
}
- if (rsp->ccode == 0xc7 || rsp->ccode == 0xc8 || rsp->ccode == 0xca) {
- if (fru->max_write_size > 8) {
- fru->max_write_size -= 8;
+ if (fru_cc_rq2big(rsp->ccode)) {
+ if (fru->max_write_size > FRU_AREA_MAXIMUM_BLOCK_SZ) {
+ fru->max_write_size -= FRU_BLOCK_SZ;
lprintf(LOG_INFO, "Retrying FRU write with request size %d",
fru->max_write_size);
continue;
}
- } else if(rsp->ccode == 0x80) {
- rsp->ccode = 0;
+ } else if (rsp->ccode == IPMI_CC_FRU_WRITE_PROTECTED_OFFSET) {
+ rsp->ccode = IPMI_CC_OK;
// Write protected section
protected_bloc = 1;
}
- if (rsp->ccode > 0)
+ if (rsp->ccode)
break;
if (protected_bloc == 0) {
@@ -608,7 +663,10 @@ int
read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
uint32_t offset, uint32_t length, uint8_t *frubuf)
{
- uint32_t off = offset, tmp, finish;
+ uint32_t off = offset;
+ uint32_t tmp;
+ uint32_t finish;
+ uint32_t size_left_in_buffer;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
@@ -621,10 +679,12 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
finish = offset + length;
if (finish > fru->size) {
+ memset(frubuf + fru->size, 0, length - fru->size);
finish = fru->size;
lprintf(LOG_NOTICE, "Read FRU Area length %d too large, "
"Adjusting to %d",
offset + length, finish - offset);
+ length = finish - offset;
}
memset(&req, 0, sizeof(req));
@@ -660,6 +720,7 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
}
+ size_left_in_buffer = length;
do {
tmp = fru->access ? off >> 1 : off;
msg_data[0] = id;
@@ -672,18 +733,19 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
msg_data[3] = (uint8_t)tmp;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_NOTICE, "FRU Read failed");
break;
}
- if (rsp->ccode > 0) {
- /* if we get C8h or CAh completion code then we requested too
+ if (rsp->ccode) {
+ /* if we get C7h or C8h or CAh return code then we requested too
* many bytes at once so try again with smaller size */
- if ((rsp->ccode == 0xc8 || rsp->ccode == 0xca)
- && fru->max_read_size > 8) {
- if (fru->max_read_size > 32) {
+ if (fru_cc_rq2big(rsp->ccode)
+ && fru->max_read_size > FRU_BLOCK_SZ)
+ {
+ if (fru->max_read_size > FRU_AREA_MAXIMUM_BLOCK_SZ) {
/* subtract read length more aggressively */
- fru->max_read_size -= 8;
+ fru->max_read_size -= FRU_BLOCK_SZ;
} else {
/* subtract length less aggressively */
fru->max_read_size--;
@@ -700,9 +762,18 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0];
+ if(rsp->data_len < 1
+ || tmp > rsp->data_len - 1
+ || tmp > size_left_in_buffer)
+ {
+ printf(" Not enough buffer size");
+ return -1;
+ }
+
memcpy(frubuf, rsp->data + 1, tmp);
off += tmp;
frubuf += tmp;
+ size_left_in_buffer -= tmp;
/* sometimes the size returned in the Info command
* is too large. return 0 so higher level function
* still attempts to parse what was returned */
@@ -735,7 +806,9 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
uint32_t offset, uint32_t length, uint8_t *frubuf)
{
static uint32_t fru_data_rqst_size = 20;
- uint32_t off = offset, tmp, finish;
+ uint32_t off = offset;
+ uint32_t tmp, finish;
+ uint32_t size_left_in_buffer;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
@@ -748,10 +821,12 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
finish = offset + length;
if (finish > fru->size) {
+ memset(frubuf + fru->size, 0, length - fru->size);
finish = fru->size;
lprintf(LOG_NOTICE, "Read FRU Area length %d too large, "
"Adjusting to %d",
offset + length, finish - offset);
+ length = finish - offset;
}
memset(&req, 0, sizeof(req));
@@ -766,6 +841,8 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
if (fru->access && fru_data_rqst_size > 16)
#endif
fru_data_rqst_size = 16;
+
+ size_left_in_buffer = length;
do {
tmp = fru->access ? off >> 1 : off;
msg_data[0] = id;
@@ -778,16 +855,16 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
msg_data[3] = (uint8_t)tmp;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_NOTICE, "FRU Read failed");
break;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
/* if we get C7 or C8 or CA return code then we requested too
* many bytes at once so try again with smaller size */
- if ((rsp->ccode == 0xc7 || rsp->ccode == 0xc8 || rsp->ccode == 0xca) &&
- (--fru_data_rqst_size > 8)) {
- lprintf(LOG_INFO, "Retrying FRU read with request size %d",
+ if (fru_cc_rq2big(rsp->ccode) && (--fru_data_rqst_size > FRU_BLOCK_SZ)) {
+ lprintf(LOG_INFO,
+ "Retrying FRU read with request size %d",
fru_data_rqst_size);
continue;
}
@@ -797,8 +874,16 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0];
+ if(rsp->data_len < 1
+ || tmp > rsp->data_len - 1
+ || tmp > size_left_in_buffer)
+ {
+ printf(" Not enough buffer size");
+ return -1;
+ }
memcpy((frubuf + off)-offset, rsp->data + 1, tmp);
off += tmp;
+ size_left_in_buffer -= tmp;
/* sometimes the size returned in the Info command
* is too large. return 0 so higher level function
@@ -827,7 +912,7 @@ fru_area_print_multirec_bloc(struct ipmi_intf * intf, struct fru_info * fru,
i = last_off = offset;
fru_data = malloc(fru->size + 1);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, " Out of memory!");
return;
}
@@ -871,8 +956,7 @@ fru_area_print_multirec_bloc(struct ipmi_intf * intf, struct fru_info * fru,
lprintf(LOG_DEBUG ,"Multi-Record area ends at: %i (%xh)",i,i);
- free(fru_data);
- fru_data = NULL;
+ free_n(&fru_data);
}
@@ -891,6 +975,7 @@ fru_area_print_chassis(struct ipmi_intf * intf, struct fru_info * fru,
uint8_t * fru_data;
uint32_t fru_len, i;
uint8_t tmp[2];
+ size_t chassis_type;
fru_len = 0;
@@ -904,7 +989,7 @@ fru_area_print_chassis(struct ipmi_intf * intf, struct fru_info * fru,
}
fru_data = malloc(fru_len);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return;
}
@@ -913,8 +998,7 @@ fru_area_print_chassis(struct ipmi_intf * intf, struct fru_info * fru,
/* read in the full fru */
if (read_fru_area(intf, fru, id, offset, fru_len, fru_data) < 0) {
- free(fru_data);
- fru_data = NULL;
+ free_n(&fru_data);
return;
}
@@ -924,42 +1008,38 @@ fru_area_print_chassis(struct ipmi_intf * intf, struct fru_info * fru,
*/
i = 2;
- printf(" Chassis Type : %s\n",
- chassis_type_desc[fru_data[i] >
- (sizeof(chassis_type_desc)/sizeof(chassis_type_desc[0])) - 1 ?
- 2 : fru_data[i]]);
+ chassis_type = (fru_data[i] > ARRAY_SIZE(chassis_type_desc) - 1)
+ ? 2
+ : fru_data[i];
+ printf(" Chassis Type : %s\n", chassis_type_desc[chassis_type]);
i++;
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Chassis Part Number : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Chassis Serial : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
/* read any extra fields */
- while ((fru_data[i] != 0xc1) && (i < fru_len))
- {
+ while ((i < fru_len) && (fru_data[i] != FRU_END_OF_FIELDS)) {
int j = i;
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Chassis Extra : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
if (i == j) {
@@ -967,10 +1047,7 @@ fru_area_print_chassis(struct ipmi_intf * intf, struct fru_info * fru,
}
}
- if (fru_data != NULL) {
- free(fru_data);
- fru_data = NULL;
- }
+ free_n(&fru_data);
}
/* fru_area_print_board - Print FRU Board Area
@@ -988,7 +1065,7 @@ fru_area_print_board(struct ipmi_intf * intf, struct fru_info * fru,
uint8_t * fru_data;
uint32_t fru_len;
uint32_t i;
- time_t tval;
+ time_t ts;
uint8_t tmp[2];
fru_len = 0;
@@ -1003,7 +1080,7 @@ fru_area_print_board(struct ipmi_intf * intf, struct fru_info * fru,
}
fru_data = malloc(fru_len);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return;
}
@@ -1012,8 +1089,7 @@ fru_area_print_board(struct ipmi_intf * intf, struct fru_info * fru,
/* read in the full fru */
if (read_fru_area(intf, fru, id, offset, fru_len, fru_data) < 0) {
- free(fru_data);
- fru_data = NULL;
+ free_n(&fru_data);
return;
}
@@ -1024,77 +1100,65 @@ fru_area_print_board(struct ipmi_intf * intf, struct fru_info * fru,
*/
i = 3;
- tval=((fru_data[i+2] << 16) + (fru_data[i+1] << 8) + (fru_data[i]));
- tval=tval * 60;
- tval=tval + secs_from_1970_1996;
- printf(" Board Mfg Date : %s", asctime(localtime(&tval)));
+ ts = ipmi_fru2time_t(&fru_data[i]);
+ printf(" Board Mfg Date : %s\n", ipmi_timestamp_string(ts));
i += 3; /* skip mfg. date time */
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Board Mfg : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Board Product : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Board Serial : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Board Part Number : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0 && verbose > 0) {
printf(" Board FRU ID : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
/* read any extra fields */
- while ((fru_data[i] != 0xc1) && (i < fru_len))
- {
+ while ((i < fru_len) && (fru_data[i] != FRU_END_OF_FIELDS)) {
int j = i;
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Board Extra : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
if (i == j)
break;
}
- if (fru_data != NULL) {
- free(fru_data);
- fru_data = NULL;
- }
+ free_n(&fru_data);
}
/* fru_area_print_product - Print FRU Product Area
@@ -1125,7 +1189,7 @@ fru_area_print_product(struct ipmi_intf * intf, struct fru_info * fru,
}
fru_data = malloc(fru_len);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return;
}
@@ -1135,8 +1199,7 @@ fru_area_print_product(struct ipmi_intf * intf, struct fru_info * fru,
/* read in the full fru */
if (read_fru_area(intf, fru, id, offset, fru_len, fru_data) < 0) {
- free(fru_data);
- fru_data = NULL;
+ free_n(&fru_data);
return;
}
@@ -1148,88 +1211,76 @@ fru_area_print_product(struct ipmi_intf * intf, struct fru_info * fru,
i = 3;
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Product Manufacturer : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Product Name : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Product Part Number : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Product Version : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Product Serial : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Product Asset Tag : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0 && verbose > 0) {
printf(" Product FRU ID : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
/* read any extra fields */
- while ((fru_data[i] != 0xc1) && (i < fru_len))
- {
+ while ((i < fru_len) && (fru_data[i] != FRU_END_OF_FIELDS)) {
int j = i;
fru_area = get_fru_area_str(fru_data, &i);
- if (fru_area != NULL) {
+ if (fru_area) {
if (strlen(fru_area) > 0) {
printf(" Product Extra : %s\n", fru_area);
}
- free(fru_area);
- fru_area = NULL;
+ free_n(&fru_area);
}
if (i == j)
break;
}
- if (fru_data != NULL) {
- free(fru_data);
- fru_data = NULL;
- }
+ free_n(&fru_data);
}
/* fru_area_print_multirec - Print FRU Multi Record Area
@@ -1255,7 +1306,7 @@ fru_area_print_multirec(struct ipmi_intf * intf, struct fru_info * fru,
last_off = offset;
fru_data = malloc(FRU_MULTIREC_CHUNK_SIZE);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return;
}
@@ -1421,7 +1472,7 @@ fru_area_print_multirec(struct ipmi_intf * intf, struct fru_info * fru,
lprintf(LOG_DEBUG ,"Multi-Record area ends at: %i (%xh)", last_off, last_off);
- free(fru_data);
+ free_n(&fru_data);
}
/* ipmi_fru_query_new_value - Query new values to replace original FRU content
@@ -1433,16 +1484,18 @@ fru_area_print_multirec(struct ipmi_intf * intf, struct fru_info * fru,
* returns : TRUE if data changed
* returns : FALSE if data not changed
*/
-int ipmi_fru_query_new_value(uint8_t *data,int offset, size_t len)
+static
+bool
+ipmi_fru_query_new_value(uint8_t *data,int offset, size_t len)
{
- int status=FALSE;
+ bool status = false;
int ret;
char answer;
printf("Would you like to change this value <y/n> ? ");
ret = scanf("%c", &answer);
if (ret != 1) {
- return FALSE;
+ return false;
}
if( answer == 'y' || answer == 'Y' ){
@@ -1458,17 +1511,16 @@ int ipmi_fru_query_new_value(uint8_t *data,int offset, size_t len)
for( i=0;i<len;i++ ){
ret = scanf("%x", holder+i);
if (ret != 1) {
- free(holder);
- return FALSE;
+ free_n(&holder);
+ return false;
}
}
for( i=0;i<len;i++ ){
data[offset++] = (unsigned char) *(holder+i);
}
/* &data[offset++] */
- free(holder);
- holder = NULL;
- status = TRUE;
+ free_n(&holder);
+ status = true;
}
else{
printf("Entered %c\n",answer);
@@ -1565,12 +1617,13 @@ typedef struct OemKontronInformationRecordV1{
*/
-static void ipmi_fru_oemkontron_get( int argc, char ** argv,uint8_t * fru_data,
- int off,int len,
- struct fru_multirec_header *h,
- struct fru_multirec_oem_header *oh)
+static void ipmi_fru_oemkontron_get(int argc,
+ char ** argv,
+ uint8_t * fru_data,
+ int off,
+ struct fru_multirec_oem_header *oh)
{
- static int badParams=FALSE;
+ static bool badParams = false;
int start = off;
int offset = start;
offset += sizeof(struct fru_multirec_oem_header);
@@ -1578,117 +1631,114 @@ static void ipmi_fru_oemkontron_get( int argc, char ** argv,uint8_t * fru_data,
if(!badParams){
/* the 'OEM' field is already checked in caller */
if( argc > OEM_KONTRON_SUBCOMMAND_ARG_POS ){
- if(strncmp("oem", argv[OEM_KONTRON_SUBCOMMAND_ARG_POS],3)){
+ if(strcmp("oem", argv[OEM_KONTRON_SUBCOMMAND_ARG_POS])){
printf("usage: fru get <id> <oem>\n");
- badParams = TRUE;
+ badParams = true;
return;
}
}
if( argc<GET_OEM_KONTRON_COMPLETE_ARG_COUNT ){
printf("usage: oem <iana> <recordid>\n");
printf("usage: oem 15000 3\n");
- badParams = TRUE;
+ badParams = true;
return;
}
}
- if(!badParams){
-
- if(oh->record_id == OEM_KONTRON_INFORMATION_RECORD ) {
-
- uint8_t version;
-
- printf("Kontron OEM Information Record\n");
- version = oh->record_version;
-
- uint8_t blockCount;
- uint8_t blockIndex=0;
+ if (badParams) {
+ return;
+ }
- unsigned int matchInstance = 0;
- uint8_t instance = 0;
-
- if (str2uchar(argv[OEM_KONTRON_INSTANCE_ARG_POS], &instance) != 0) {
- lprintf(LOG_ERR,
- "Instance argument '%s' is either invalid or out of range.",
- argv[OEM_KONTRON_INSTANCE_ARG_POS]);
- badParams = TRUE;
- return;
- }
+ if (oh->record_id != OEM_KONTRON_INFORMATION_RECORD) {
+ return;
+ }
- blockCount = fru_data[offset++];
+ uint8_t version;
- for(blockIndex=0;blockIndex<blockCount;blockIndex++){
- void * pRecordData;
- uint8_t nameLen;
+ printf("Kontron OEM Information Record\n");
+ version = oh->record_version;
- nameLen = ( fru_data[offset++] &= 0x3F );
- printf(" Name: %*.*s\n",nameLen, nameLen, (const char *)(fru_data+offset));
+ uint8_t blockCount;
+ uint8_t blockIndex = 0;
- offset+=nameLen;
+ uint8_t instance = 0;
- pRecordData = &fru_data[offset];
+ if (str2uchar(argv[OEM_KONTRON_INSTANCE_ARG_POS], &instance) != 0) {
+ lprintf(LOG_ERR,
+ "Instance argument '%s' is either invalid or out of range.",
+ argv[OEM_KONTRON_INSTANCE_ARG_POS]);
+ badParams = true;
+ return;
+ }
- printf(" Record Version: %d\n", version);
- if( version == 0 )
- {
- printf(" Version: %*.*s\n",
- OEM_KONTRON_FIELD_SIZE,
- OEM_KONTRON_FIELD_SIZE,
- ((tOemKontronInformationRecordV0 *) pRecordData)->field1);
- printf(" Build Date: %*.*s\n",
- OEM_KONTRON_FIELD_SIZE,
- OEM_KONTRON_FIELD_SIZE,
- ((tOemKontronInformationRecordV0 *) pRecordData)->field2);
- printf(" Update Date: %*.*s\n",
- OEM_KONTRON_FIELD_SIZE,
- OEM_KONTRON_FIELD_SIZE,
- ((tOemKontronInformationRecordV0 *) pRecordData)->field3);
- printf(" Checksum: %*.*s\n\n",
- OEM_KONTRON_FIELD_SIZE,
- OEM_KONTRON_FIELD_SIZE,
- ((tOemKontronInformationRecordV0 *) pRecordData)->crc32);
- matchInstance++;
- offset+= sizeof(tOemKontronInformationRecordV0);
- offset++;
- }
- else if ( version == 1 )
- {
- printf(" Version: %*.*s\n",
- OEM_KONTRON_VERSION_FIELD_SIZE,
- OEM_KONTRON_VERSION_FIELD_SIZE,
- ((tOemKontronInformationRecordV1 *) pRecordData)->field1);
- printf(" Build Date: %*.*s\n",
- OEM_KONTRON_FIELD_SIZE,
- OEM_KONTRON_FIELD_SIZE,
- ((tOemKontronInformationRecordV1 *) pRecordData)->field2);
- printf(" Update Date: %*.*s\n",
- OEM_KONTRON_FIELD_SIZE,
- OEM_KONTRON_FIELD_SIZE,
- ((tOemKontronInformationRecordV1 *) pRecordData)->field3);
- printf(" Checksum: %*.*s\n\n",
- OEM_KONTRON_FIELD_SIZE,
- OEM_KONTRON_FIELD_SIZE,
- ((tOemKontronInformationRecordV1 *) pRecordData)->crc32);
- matchInstance++;
- offset+= sizeof(tOemKontronInformationRecordV1);
- offset++;
- }
- else
- {
- printf (" Unsupported version %d\n",version);
- }
- }
+ blockCount = fru_data[offset++];
+
+ for (blockIndex = 0; blockIndex < blockCount; blockIndex++) {
+ void *pRecordData;
+ uint8_t nameLen;
+
+ nameLen = (fru_data[offset++] &= 0x3F);
+ printf(" Name: %*.*s\n", nameLen, nameLen,
+ (const char *)(fru_data + offset));
+
+ offset += nameLen;
+
+ pRecordData = &fru_data[offset];
+
+ printf(" Record Version: %d\n", version);
+ if (version == 0) {
+ printf(" Version: %*.*s\n",
+ OEM_KONTRON_FIELD_SIZE,
+ OEM_KONTRON_FIELD_SIZE,
+ ((tOemKontronInformationRecordV0 *)pRecordData)->field1);
+ printf(" Build Date: %*.*s\n",
+ OEM_KONTRON_FIELD_SIZE,
+ OEM_KONTRON_FIELD_SIZE,
+ ((tOemKontronInformationRecordV0 *)pRecordData)->field2);
+ printf(" Update Date: %*.*s\n",
+ OEM_KONTRON_FIELD_SIZE,
+ OEM_KONTRON_FIELD_SIZE,
+ ((tOemKontronInformationRecordV0 *)pRecordData)->field3);
+ printf(" Checksum: %*.*s\n\n",
+ OEM_KONTRON_FIELD_SIZE,
+ OEM_KONTRON_FIELD_SIZE,
+ ((tOemKontronInformationRecordV0 *)pRecordData)->crc32);
+ offset += sizeof(tOemKontronInformationRecordV0);
+ offset++;
+ } else if (version == 1) {
+ printf(" Version: %*.*s\n",
+ OEM_KONTRON_VERSION_FIELD_SIZE,
+ OEM_KONTRON_VERSION_FIELD_SIZE,
+ ((tOemKontronInformationRecordV1 *)pRecordData)->field1);
+ printf(" Build Date: %*.*s\n",
+ OEM_KONTRON_FIELD_SIZE,
+ OEM_KONTRON_FIELD_SIZE,
+ ((tOemKontronInformationRecordV1 *)pRecordData)->field2);
+ printf(" Update Date: %*.*s\n",
+ OEM_KONTRON_FIELD_SIZE,
+ OEM_KONTRON_FIELD_SIZE,
+ ((tOemKontronInformationRecordV1 *)pRecordData)->field3);
+ printf(" Checksum: %*.*s\n\n",
+ OEM_KONTRON_FIELD_SIZE,
+ OEM_KONTRON_FIELD_SIZE,
+ ((tOemKontronInformationRecordV1 *)pRecordData)->crc32);
+ offset += sizeof(tOemKontronInformationRecordV1);
+ offset++;
+ } else {
+ printf(" Unsupported version %d\n", version);
}
}
}
-static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
+static
+bool
+ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
int off,int len,
struct fru_multirec_header *h,
struct fru_multirec_oem_header *oh)
{
- static int badParams=FALSE;
- int hasChanged = FALSE;
+ static bool badParams=false;
+ bool hasChanged = false;
int start = off;
int offset = start;
int length = len;
@@ -1699,9 +1749,9 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
if(!badParams){
/* the 'OEM' field is already checked in caller */
if( argc > OEM_KONTRON_SUBCOMMAND_ARG_POS ){
- if(strncmp("oem", argv[OEM_KONTRON_SUBCOMMAND_ARG_POS],3)){
+ if(strcmp("oem", argv[OEM_KONTRON_SUBCOMMAND_ARG_POS])){
printf("usage: fru edit <id> <oem> <args...>\n");
- badParams = TRUE;
+ badParams = true;
return hasChanged;
}
}
@@ -1709,14 +1759,14 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
printf("usage: oem <iana> <recordid> <format> <args...>\n");
printf("usage: oem 15000 3 0 <name> <instance> <field1>"\
" <field2> <field3> <crc32>\n");
- badParams = TRUE;
+ badParams = true;
return hasChanged;
}
if (str2uchar(argv[OEM_KONTRON_RECORDID_ARG_POS], &record_id) != 0) {
lprintf(LOG_ERR,
"Record ID argument '%s' is either invalid or out of range.",
argv[OEM_KONTRON_RECORDID_ARG_POS]);
- badParams = TRUE;
+ badParams = true;
return hasChanged;
}
if (record_id == OEM_KONTRON_INFORMATION_RECORD) {
@@ -1725,7 +1775,7 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
(strlen(argv[i]) != OEM_KONTRON_VERSION_FIELD_SIZE)) {
printf("error: version fields must have %d characters\n",
OEM_KONTRON_FIELD_SIZE);
- badParams = TRUE;
+ badParams = true;
return hasChanged;
}
}
@@ -1742,7 +1792,7 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
lprintf(LOG_ERR,
"Format argument '%s' is either invalid or out of range.",
argv[OEM_KONTRON_FORMAT_ARG_POS]);
- badParams = TRUE;
+ badParams = true;
return hasChanged;
}
@@ -1760,7 +1810,7 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
lprintf(LOG_ERR,
"Instance argument '%s' is either invalid or out of range.",
argv[OEM_KONTRON_INSTANCE_ARG_POS]);
- badParams = TRUE;
+ badParams = true;
return hasChanged;
}
@@ -1823,7 +1873,7 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
}
matchInstance++;
- hasChanged = TRUE;
+ hasChanged = true;
}
else if(!strncmp((char *)argv[OEM_KONTRON_NAME_ARG_POS],
(const char *)(fru_data+offset), nameLen)){
@@ -1899,12 +1949,14 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
* returns: TRUE if data changed
* returns: FALSE if data not changed
*/
-static int ipmi_fru_picmg_ext_edit(uint8_t * fru_data,
+static
+bool
+ipmi_fru_picmg_ext_edit(uint8_t * fru_data,
int off,int len,
struct fru_multirec_header *h,
struct fru_multirec_oem_header *oh)
{
- int hasChanged = FALSE;
+ bool hasChanged = false;
int start = off;
int offset = start;
int length = len;
@@ -1929,7 +1981,7 @@ static int ipmi_fru_picmg_ext_edit(uint8_t * fru_data,
max_current |= fru_data[++index]<<8;
printf(" New Maximum Internal Current(@12V): %.2f A (0x%02x)\n",
(float)max_current / 10.0f, max_current);
- hasChanged = TRUE;
+ hasChanged = true;
}
@@ -1967,7 +2019,7 @@ static int ipmi_fru_picmg_ext_edit(uint8_t * fru_data,
printf(" New Current draw(@12V): %.2f A (0x%02x)\n",
(float)current / 10.0f, current);
- hasChanged = TRUE;
+ hasChanged = true;
}
}
break;
@@ -2281,8 +2333,7 @@ static void ipmi_fru_picmg_ext_print(uint8_t * fru_data, int off, int length)
printf(" Link Type Extension: 0x%02x - ",
d->ext);
if (d->type == FRU_PICMGEXT_LINK_TYPE_BASE) {
- switch (d->ext)
- {
+ switch (d->ext) {
case 0:
printf("10/100/1000BASE-T Link (four-pair)\n");
break;
@@ -2290,76 +2341,93 @@ static void ipmi_fru_picmg_ext_print(uint8_t * fru_data, int off, int length)
printf("ShMC Cross-connect (two-pair)\n");
break;
default:
- printf("Unknwon\n");
+ printf("Unknown\n");
break;
}
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET) {
- switch (d->ext)
- {
+ switch (d->ext) {
case 0:
- printf("Fixed 1000Base-BX\n");
+ printf("1000Base-BX\n");
break;
case 1:
- printf("Fixed 10GBASE-BX4 [XAUI]\n");
+ printf("10GBase-BX4 [XAUI]\n");
break;
case 2:
printf("FC-PI\n");
break;
+ case 3:
+ printf("1000Base-KX\n");
+ break;
+ case 4:
+ printf("10GBase-KX4\n");
+ break;
default:
- printf("Unknwon\n");
+ printf("Unknown\n");
+ break;
+ }
+ } else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD) {
+ switch (d->ext) {
+ case 0:
+ printf("10GBase-KR\n");
+ break;
+ case 1:
+ printf("40GBase-KR4\n");
+ break;
+ default:
+ printf("Unknown\n");
break;
}
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else if (d->type == FRU_PICMGEXT_LINK_TYPE_PCIE) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else {
- printf("Unknwon\n");
+ printf("Unknown\n");
}
printf(" Link Type: 0x%02x - ",
d->type);
- if (d->type == 0 || d->type == 0xff) {
- printf("Reserved\n");
- }
- else if (d->type >= 0x06 && d->type <= 0xef) {
- printf("Reserved\n");
- }
- else if (d->type >= 0xf0 && d->type <= 0xfe) {
- printf("OEM GUID Definition\n");
- }
- else {
- switch (d->type)
- {
- case FRU_PICMGEXT_LINK_TYPE_BASE:
- printf("PICMG 3.0 Base Interface 10/100/1000\n");
- break;
- case FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET:
- printf("PICMG 3.1 Ethernet Fabric Interface\n");
- break;
- case FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND:
- printf("PICMG 3.2 Infiniband Fabric Interface\n");
- break;
- case FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR:
- printf("PICMG 3.3 Star Fabric Interface\n");
- break;
- case FRU_PICMGEXT_LINK_TYPE_PCIE:
- printf("PICMG 3.4 PCI Express Fabric Interface\n");
- break;
- default:
+ switch (d->type) {
+ case FRU_PICMGEXT_LINK_TYPE_BASE:
+ printf("PICMG 3.0 Base Interface 10/100/1000\n");
+ break;
+ case FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET:
+ printf("PICMG 3.1 Ethernet Fabric Interface\n");
+ printf(" Base signaling Link Class\n");
+ break;
+ case FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND:
+ printf("PICMG 3.2 Infiniband Fabric Interface\n");
+ break;
+ case FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR:
+ printf("PICMG 3.3 Star Fabric Interface\n");
+ break;
+ case FRU_PICMGEXT_LINK_TYPE_PCIE:
+ printf("PICMG 3.4 PCI Express Fabric Interface\n");
+ break;
+ case FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD:
+ printf("PICMG 3.1 Ethernet Fabric Interface\n");
+ printf(" 10.3125Gbd signaling Link Class\n");
+ break;
+ default:
+ if (d->type == 0 || d->type == 0xff) {
+ printf("Reserved\n");
+ } else if (d->type >= 0x06 && d->type <= 0xef) {
+ printf("Reserved\n");
+ } else if (d->type >= 0xf0 && d->type <= 0xfe) {
+ printf("OEM GUID Definition\n");
+ } else {
printf("Invalid\n");
- break;
- }
+ }
+ break;
}
printf(" Link Designator: \n");
printf(" Port Flag: 0x%02x\n",
d->desig_port);
printf(" Interface: 0x%02x - ",
d->desig_if);
- switch (d->desig_if)
- {
+ switch (d->desig_if) {
case FRU_PICMGEXT_DESIGN_IF_BASE:
printf("Base Interface\n");
break;
@@ -2862,11 +2930,11 @@ __ipmi_fru_print(struct ipmi_intf * intf, uint8_t id)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2899,11 +2967,11 @@ __ipmi_fru_print(struct ipmi_intf * intf, uint8_t id)
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return 1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return 1;
@@ -2980,7 +3048,7 @@ ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru)
uint32_t save_channel;
int rc = 0;
- if (fru == NULL)
+ if (!fru)
return __ipmi_fru_print(intf, 0);
/* Logical FRU Device
@@ -3010,7 +3078,7 @@ ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru)
return 0;
memset(desc, 0, sizeof(desc));
- memcpy(desc, fru->id_string, fru->id_code & 0x01f);
+ memcpy(desc, fru->id_string, __min(fru->id_code & 0x01f, sizeof(desc)));
desc[fru->id_code & 0x01f] = 0;
printf("FRU Device Description : %s (ID %d)\n", desc, fru->device_id);
@@ -3078,11 +3146,11 @@ ipmi_fru_print_all(struct ipmi_intf * intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Device ID command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Device ID command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -3098,14 +3166,15 @@ ipmi_fru_print_all(struct ipmi_intf * intf)
printf("\n");
}
- if ((itr = ipmi_sdr_start(intf, 0)) == NULL)
+ itr = ipmi_sdr_start(intf, 0);
+ if (!itr)
return -1;
/* Walk the SDRs looking for FRU Devices and Management Controller Devices. */
/* For FRU devices, print the FRU from the SDR locator record. */
/* For MC devices, issue FRU commands to the satellite controller to print */
/* FRU data. */
- while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL)
+ while ((header = ipmi_sdr_get_next_header(intf, itr)))
{
if (header->type == SDR_RECORD_TYPE_MC_DEVICE_LOCATOR ) {
/* Check the capabilities of the Management Controller Device */
@@ -3135,11 +3204,7 @@ ipmi_fru_print_all(struct ipmi_intf * intf)
intf->target_addr = save_addr;
}
- if (mc) {
- free(mc);
- mc = NULL;
- }
-
+ free_n(&mc);
continue;
}
@@ -3149,19 +3214,15 @@ ipmi_fru_print_all(struct ipmi_intf * intf)
/* Print the FRU from the SDR locator record. */
fru = (struct sdr_record_fru_locator *)
ipmi_sdr_get_record(intf, header, itr);
- if (fru == NULL || !fru->logical) {
- if (fru) {
- free(fru);
- fru = NULL;
- }
+ if (!fru || !fru->logical) {
+ free_n(&fru);
continue;
}
rc = ipmi_fru_print(intf, fru);
- free(fru);
- fru = NULL;
+ free_n(&fru);
}
- ipmi_sdr_end(intf, itr);
+ ipmi_sdr_end(itr);
return rc;
}
@@ -3201,8 +3262,8 @@ ipmi_fru_read_to_bin(struct ipmi_intf * intf,
if (!rsp)
return;
- if (rsp->ccode > 0) {
- if (rsp->ccode == 0xc3)
+ if (rsp->ccode) {
+ if (rsp->ccode == IPMI_CC_TIMEOUT)
printf (" Timeout accessing FRU info. (Device not present?)\n");
return;
}
@@ -3217,7 +3278,7 @@ ipmi_fru_read_to_bin(struct ipmi_intf * intf,
}
pFruBuf = malloc(fru.size);
- if (pFruBuf != NULL) {
+ if (pFruBuf) {
printf("Fru Size : %d bytes\n",fru.size);
read_fru_area(intf, &fru, fruId, 0, fru.size, pFruBuf);
} else {
@@ -3225,7 +3286,7 @@ ipmi_fru_read_to_bin(struct ipmi_intf * intf,
return;
}
- if(pFruBuf != NULL)
+ if(pFruBuf)
{
FILE * pFile;
pFile = fopen(pFileName,"wb");
@@ -3234,14 +3295,12 @@ ipmi_fru_read_to_bin(struct ipmi_intf * intf,
printf("Done\n");
} else {
lprintf(LOG_ERR, "Error opening file %s\n", pFileName);
- free(pFruBuf);
- pFruBuf = NULL;
+ free_n(&pFruBuf);
return;
}
fclose(pFile);
}
- free(pFruBuf);
- pFruBuf = NULL;
+ free_n(&pFruBuf);
}
static void
@@ -3270,7 +3329,7 @@ ipmi_fru_write_from_bin(struct ipmi_intf * intf,
return;
if (rsp->ccode) {
- if (rsp->ccode == 0xc3)
+ if (rsp->ccode == IPMI_CC_TIMEOUT)
printf(" Timeout accessing FRU info. (Device not present?)\n");
return;
}
@@ -3285,13 +3344,13 @@ ipmi_fru_write_from_bin(struct ipmi_intf * intf,
}
pFruBuf = malloc(fru.size);
- if (pFruBuf == NULL) {
+ if (!pFruBuf) {
lprintf(LOG_ERR, "Cannot allocate %d bytes\n", fru.size);
return;
}
pFile = fopen(pFileName, "rb");
- if (pFile != NULL) {
+ if (pFile) {
len = fread(pFruBuf, 1, fru.size, pFile);
printf("Fru Size : %d bytes\n", fru.size);
printf("Size to Write : %d bytes\n", len);
@@ -3305,13 +3364,12 @@ ipmi_fru_write_from_bin(struct ipmi_intf * intf,
lprintf(LOG_INFO,"Done");
}
- free(pFruBuf);
- pFruBuf = NULL;
+ free_n(&pFruBuf);
}
/* ipmi_fru_write_help() - print help text for 'write'
*
- * retruns void
+ * returns void
*/
void
ipmi_fru_write_help()
@@ -3388,11 +3446,11 @@ ipmi_fru_edit_multirec(struct ipmi_intf * intf, uint8_t id ,
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -3423,7 +3481,7 @@ ipmi_fru_edit_multirec(struct ipmi_intf * intf, uint8_t id ,
memset(&fru, 0, sizeof(fru));
fru_data = malloc(fru.size + 1);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, " Out of memory!");
return -1;
}
@@ -3457,7 +3515,7 @@ ipmi_fru_edit_multirec(struct ipmi_intf * intf, uint8_t id ,
if( argc <=2 ) {
suppliedIana = IPMI_OEM_PICMG;
} else {
- if( !strncmp( argv[2] , "oem" , 3 )) {
+ if( !strcmp( argv[2] , "oem")) {
/* Expect IANA number next */
if( argc <= 3 ) {
lprintf(LOG_ERR, "oem iana <record> <format> [<args>]");
@@ -3509,8 +3567,7 @@ ipmi_fru_edit_multirec(struct ipmi_intf * intf, uint8_t id ,
i += h->len + sizeof (struct fru_multirec_header);
} while (!(h->format & 0x80) && (error != 1));
- free(fru_data);
- fru_data = NULL;
+ free_n(&fru_data);
}
return 0;
}
@@ -3593,11 +3650,11 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -3627,7 +3684,7 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
i = last_off = offset;
fru_data = malloc(fru.size + 1);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, " Out of memory!");
return -1;
}
@@ -3656,7 +3713,7 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
uint32_t suppliedIana = 0 ;
/* Now makes sure this is really PICMG record */
- if( !strncmp( argv[2] , "oem" , 3 )) {
+ if( !strcmp( argv[2] , "oem")) {
/* Expect IANA number next */
if( argc <= 3 ) {
lprintf(LOG_ERR, "oem iana <record> <format>");
@@ -3678,15 +3735,15 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
if( suppliedIana == iana ) {
lprintf(LOG_DEBUG, "Matching record found" );
- if( iana == IPMI_OEM_KONTRON ) {
- ipmi_fru_oemkontron_get( argc,argv,fru_data,
- i + sizeof(struct fru_multirec_header),
- h->len, h, oh );
+ if( iana == IPMI_OEM_KONTRON ) {
+ ipmi_fru_oemkontron_get(argc, argv, fru_data,
+ i + sizeof(struct fru_multirec_header),
+ oh);
}
/* FIXME: Add OEM record support here */
else{
printf(" OEM IANA (%s) Record not supported in this mode\n",
- val2str( iana, ipmi_oem_info));
+ val2str( iana, ipmi_oem_info));
error = 1;
}
}
@@ -3694,16 +3751,16 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
i += h->len + sizeof (struct fru_multirec_header);
} while (!(h->format & 0x80) && (error != 1));
- free(fru_data);
- fru_data = NULL;
+ free_n(&fru_data);
}
return 0;
}
-static int
-ipmi_fru_upg_ekeying(struct ipmi_intf * intf,
- char * pFileName,
- uint8_t fruId)
+#define ERR_EXIT do { rc = -1; goto exit; } while(0)
+
+static
+int
+ipmi_fru_upg_ekeying(struct ipmi_intf *intf, char *pFileName, uint8_t fruId)
{
struct fru_info fruInfo = {0};
uint8_t *buf = NULL;
@@ -3711,59 +3768,50 @@ ipmi_fru_upg_ekeying(struct ipmi_intf * intf,
uint32_t fruMultiRecSize = 0;
uint32_t offFileMultiRec = 0;
uint32_t fileMultiRecSize = 0;
- if (pFileName == NULL) {
+ int rc = 0;
+
+ if (!pFileName) {
lprintf(LOG_ERR, "File expected, but none given.");
- return (-1);
+ ERR_EXIT;
}
if (ipmi_fru_get_multirec_location_from_fru(intf, fruId, &fruInfo,
&offFruMultiRec, &fruMultiRecSize) != 0) {
lprintf(LOG_ERR, "Failed to get multirec location from FRU.");
- return (-1);
+ ERR_EXIT;
}
lprintf(LOG_DEBUG, "FRU Size : %lu\n", fruMultiRecSize);
lprintf(LOG_DEBUG, "Multi Rec offset: %lu\n", offFruMultiRec);
if (ipmi_fru_get_multirec_size_from_file(pFileName, &fileMultiRecSize,
&offFileMultiRec) != 0) {
lprintf(LOG_ERR, "Failed to get multirec size from file '%s'.", pFileName);
- return (-1);
+ ERR_EXIT;
}
buf = malloc(fileMultiRecSize);
- if (buf == NULL) {
+ if (!buf) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
- return (-1);
+ ERR_EXIT;
}
if (ipmi_fru_get_multirec_from_file(pFileName, buf, fileMultiRecSize,
offFileMultiRec) != 0) {
lprintf(LOG_ERR, "Failed to get multirec from file '%s'.", pFileName);
- if (buf != NULL) {
- free(buf);
- buf = NULL;
- }
- return (-1);
+ ERR_EXIT;
}
if (ipmi_fru_get_adjust_size_from_buffer(buf, &fileMultiRecSize) != 0) {
lprintf(LOG_ERR, "Failed to adjust size from buffer.");
- if (buf != NULL) {
- free(buf);
- buf = NULL;
- }
- return (-1);
+ ERR_EXIT;
}
if (write_fru_area(intf, &fruInfo, fruId, 0, offFruMultiRec,
fileMultiRecSize, buf) != 0) {
lprintf(LOG_ERR, "Failed to write FRU area.");
- if (buf != NULL) {
- free(buf);
- buf = NULL;
- }
- return (-1);
- }
- if (buf != NULL) {
- free(buf);
- buf = NULL;
+ ERR_EXIT;
}
+
lprintf(LOG_INFO, "Done upgrading Ekey.");
- return 0;
+
+exit:
+ free_n(&buf);
+
+ return rc;
}
/* ipmi_fru_upgekey_help - print help text for 'upgEkey'
@@ -3811,7 +3859,7 @@ ipmi_fru_get_multirec_size_from_file(char * pFileName,
return -1;
}
- /* Retreive length */
+ /* Retrieve length */
if (((header.offset.internal * 8) > (header.offset.internal * 8)) &&
((header.offset.internal * 8) < end))
end = (header.offset.internal * 8);
@@ -3859,7 +3907,7 @@ ipmi_fru_get_adjust_size_from_buffer(uint8_t * fru_data, uint32_t *pSize)
}
if (checksum != 0) {
lprintf(LOG_ERR, "Bad checksum in Multi Records");
- status = (-1);
+ status = -1;
if (verbose) {
printf("--> FAIL");
}
@@ -3889,9 +3937,9 @@ ipmi_fru_get_multirec_from_file(char * pFileName, uint8_t * pBufArea,
{
FILE * pFile;
uint32_t len = 0;
- if (pFileName == NULL) {
+ if (!pFileName) {
lprintf(LOG_ERR, "Invalid file name given.");
- return (-1);
+ return -1;
}
errno = 0;
@@ -3899,21 +3947,21 @@ ipmi_fru_get_multirec_from_file(char * pFileName, uint8_t * pBufArea,
if (!pFile) {
lprintf(LOG_ERR, "Error opening file '%s': %i -> %s.", pFileName, errno,
strerror(errno));
- return (-1);
+ return -1;
}
errno = 0;
if (fseek(pFile, offset, SEEK_SET) != 0) {
lprintf(LOG_ERR, "Failed to seek in file '%s': %i -> %s.", pFileName, errno,
strerror(errno));
fclose(pFile);
- return (-1);
+ return -1;
}
len = fread(pBufArea, size, 1, pFile);
fclose(pFile);
if (len != 1) {
lprintf(LOG_ERR, "Error in file '%s'.", pFileName);
- return (-1);
+ return -1;
}
return 0;
}
@@ -3948,8 +3996,8 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
return -1;
}
- if (rsp->ccode > 0) {
- if (rsp->ccode == 0xc3)
+ if (rsp->ccode) {
+ if (rsp->ccode == IPMI_CC_TIMEOUT)
printf (" Timeout accessing FRU info. (Device not present?)\n");
else
printf (" CCODE = 0x%02x\n", rsp->ccode);
@@ -3980,8 +4028,8 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
if (!rsp)
return -1;
- if (rsp->ccode > 0) {
- if (rsp->ccode == 0xc3)
+ if (rsp->ccode) {
+ if (rsp->ccode == IPMI_CC_TIMEOUT)
printf (" Timeout while reading FRU data. (Device not present?)\n");
return -1;
}
@@ -3998,7 +4046,7 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
end = pFruInfo->size;
- /* Retreive length */
+ /* Retrieve length */
if (((header.offset.internal * 8) > (header.offset.internal * 8)) &&
((header.offset.internal * 8) < end))
end = (header.offset.internal * 8);
@@ -4021,7 +4069,7 @@ ipmi_fru_get_multirec_location_from_fru(struct ipmi_intf * intf,
return 0;
}
-/* ipmi_fru_get_internal_use_offset - Retreive internal use offset
+/* ipmi_fru_get_internal_use_offset - Retrieve internal use offset
*
* @intf: ipmi interface
* @id: fru id
@@ -4062,17 +4110,16 @@ ipmi_fru_get_internal_use_info( struct ipmi_intf * intf,
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return -1;
}
- memset(&fru, 0, sizeof(fru));
fru->size = (rsp->data[1] << 8) | rsp->data[0];
fru->access = rsp->data[2] & 0x1;
@@ -4099,11 +4146,11 @@ ipmi_fru_get_internal_use_info( struct ipmi_intf * intf,
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return 1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return 1;
@@ -4242,7 +4289,7 @@ ipmi_fru_read_internal_use(struct ipmi_intf * intf, uint8_t id, char * pFileName
if(rc == 0)
{
- if(pFileName == NULL)
+ if(!pFileName)
{
uint16_t counter;
for(counter = 0; counter < size; counter ++)
@@ -4264,8 +4311,7 @@ ipmi_fru_read_internal_use(struct ipmi_intf * intf, uint8_t id, char * pFileName
else
{
lprintf(LOG_ERR, "Error opening file %s\n", pFileName);
- free(frubuf);
- frubuf = NULL;
+ free_n(&frubuf);
return -1;
}
fclose(pFile);
@@ -4273,8 +4319,7 @@ ipmi_fru_read_internal_use(struct ipmi_intf * intf, uint8_t id, char * pFileName
}
printf("\n");
- free(frubuf);
- frubuf = NULL;
+ free_n(&frubuf);
}
}
@@ -4317,7 +4362,7 @@ ipmi_fru_write_internal_use(struct ipmi_intf * intf, uint8_t id, char * pFileNam
if(fp)
{
- /* Retreive file length, check if it's fits the Eeprom Size */
+ /* Retrieve file length, check if it's fits the Eeprom Size */
fseek(fp, 0 ,SEEK_END);
fileLength = ftell(fp);
@@ -4357,8 +4402,7 @@ ipmi_fru_write_internal_use(struct ipmi_intf * intf, uint8_t id, char * pFileNam
lprintf(LOG_ERR, "Unable to read file: %i\n", fru_read_size);
}
- free(frubuf);
- frubuf = NULL;
+ free_n(&frubuf);
}
fclose(fp);
fp = NULL;
@@ -4380,42 +4424,43 @@ ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
if (argc < 1) {
rc = ipmi_fru_print_all(intf);
}
- else if (strncmp(argv[0], "help", 4) == 0) {
+ else if (!strcmp(argv[0], "help")) {
ipmi_fru_help();
return 0;
}
- else if (strncmp(argv[0], "print", 5) == 0 ||
- strncmp(argv[0], "list", 4) == 0) {
+ else if (!strcmp(argv[0], "print")
+ || !strcmp(argv[0], "list"))
+ {
if (argc > 1) {
- if (strcmp(argv[1], "help") == 0) {
+ if (!strcmp(argv[1], "help")) {
lprintf(LOG_NOTICE, "fru print [fru id] - print information about FRU(s)");
return 0;
}
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
rc = __ipmi_fru_print(intf, fru_id);
} else {
rc = ipmi_fru_print_all(intf);
}
}
- else if (!strncmp(argv[0], "read", 5)) {
- if (argc > 1 && strcmp(argv[1], "help") == 0) {
+ else if (!strcmp(argv[0], "read")) {
+ if (argc > 1 && !strcmp(argv[1], "help")) {
ipmi_fru_read_help();
return 0;
} else if (argc < 3) {
lprintf(LOG_ERR, "Not enough parameters given.");
ipmi_fru_read_help();
- return (-1);
+ return -1;
}
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
/* There is a file name in the parameters */
if (is_valid_filename(argv[2]) != 0)
- return (-1);
+ return -1;
if (verbose) {
printf("FRU ID : %d\n", fru_id);
@@ -4424,22 +4469,22 @@ ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
/* TODO - rc is missing */
ipmi_fru_read_to_bin(intf, argv[2], fru_id);
}
- else if (!strncmp(argv[0], "write", 5)) {
- if (argc > 1 && strcmp(argv[1], "help") == 0) {
+ else if (!strcmp(argv[0], "write")) {
+ if (argc > 1 && !strcmp(argv[1], "help")) {
ipmi_fru_write_help();
return 0;
} else if (argc < 3) {
lprintf(LOG_ERR, "Not enough parameters given.");
ipmi_fru_write_help();
- return (-1);
+ return -1;
}
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
/* There is a file name in the parameters */
if (is_valid_filename(argv[2]) != 0)
- return (-1);
+ return -1;
if (verbose) {
printf("FRU ID : %d\n", fru_id);
@@ -4448,67 +4493,67 @@ ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
/* TODO - rc is missing */
ipmi_fru_write_from_bin(intf, argv[2], fru_id);
}
- else if (!strncmp(argv[0], "upgEkey", 7)) {
- if (argc > 1 && strcmp(argv[1], "help") == 0) {
+ else if (!strcmp(argv[0], "upgEkey")) {
+ if (argc > 1 && !strcmp(argv[1], "help")) {
ipmi_fru_upgekey_help();
return 0;
} else if (argc < 3) {
lprintf(LOG_ERR, "Not enough parameters given.");
ipmi_fru_upgekey_help();
- return (-1);
+ return -1;
}
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
/* There is a file name in the parameters */
if (is_valid_filename(argv[2]) != 0)
- return (-1);
+ return -1;
rc = ipmi_fru_upg_ekeying(intf, argv[2], fru_id);
}
- else if (!strncmp(argv[0], "internaluse", 11)) {
- if (argc > 1 && strcmp(argv[1], "help") == 0) {
+ else if (!strcmp(argv[0], "internaluse")) {
+ if (argc > 1 && !strcmp(argv[1], "help")) {
ipmi_fru_internaluse_help();
return 0;
}
- if ( (argc >= 3) && (!strncmp(argv[2], "info", 4)) ) {
+ if ( (argc >= 3) && (!strcmp(argv[2], "info")) ) {
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
rc = ipmi_fru_info_internal_use(intf, fru_id);
}
- else if ( (argc >= 3) && (!strncmp(argv[2], "print", 5)) ) {
+ else if ( (argc >= 3) && (!strcmp(argv[2], "print")) ) {
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
rc = ipmi_fru_read_internal_use(intf, fru_id, NULL);
}
- else if ( (argc >= 4) && (!strncmp(argv[2], "read", 4)) ) {
+ else if ( (argc >= 4) && (!strcmp(argv[2], "read")) ) {
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
/* There is a file name in the parameters */
if (is_valid_filename(argv[3]) != 0)
- return (-1);
+ return -1;
lprintf(LOG_DEBUG, "FRU ID : %d", fru_id);
lprintf(LOG_DEBUG, "FRU File : %s", argv[3]);
rc = ipmi_fru_read_internal_use(intf, fru_id, argv[3]);
}
- else if ( (argc >= 4) && (!strncmp(argv[2], "write", 5)) ) {
+ else if ( (argc >= 4) && (!strcmp(argv[2], "write")) ) {
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
/* There is a file name in the parameters */
if (is_valid_filename(argv[3]) != 0)
- return (-1);
+ return -1;
lprintf(LOG_DEBUG, "FRU ID : %d", fru_id);
lprintf(LOG_DEBUG, "FRU File : %s", argv[3]);
@@ -4518,22 +4563,22 @@ ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_ERR,
"Either unknown command or not enough parameters given.");
ipmi_fru_internaluse_help();
- return (-1);
+ return -1;
}
}
- else if (!strncmp(argv[0], "edit", 4)) {
- if (argc > 1 && strcmp(argv[1], "help") == 0) {
+ else if (!strcmp(argv[0], "edit")) {
+ if (argc > 1 && !strcmp(argv[1], "help")) {
ipmi_fru_edit_help();
return 0;
} else if (argc < 2) {
lprintf(LOG_ERR, "Not enough parameters given.");
ipmi_fru_edit_help();
- return (-1);
+ return -1;
}
if (argc >= 2) {
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
if (verbose) {
printf("FRU ID : %d\n", fru_id);
@@ -4543,38 +4588,38 @@ ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
}
if (argc >= 3) {
- if (!strncmp(argv[2], "field", 5)) {
+ if (!strcmp(argv[2], "field")) {
if (argc != 6) {
lprintf(LOG_ERR, "Not enough parameters given.");
ipmi_fru_edit_help();
- return (-1);
+ return -1;
}
rc = ipmi_fru_set_field_string(intf, fru_id, *argv[3], *argv[4],
(char *) argv[5]);
- } else if (!strncmp(argv[2], "oem", 3)) {
+ } else if (!strcmp(argv[2], "oem")) {
rc = ipmi_fru_edit_multirec(intf, fru_id, argc, argv);
} else {
lprintf(LOG_ERR, "Invalid command: %s", argv[2]);
ipmi_fru_edit_help();
- return (-1);
+ return -1;
}
} else {
rc = ipmi_fru_edit_multirec(intf, fru_id, argc, argv);
}
}
- else if (!strncmp(argv[0], "get", 4)) {
- if (argc > 1 && (strncmp(argv[1], "help", 4) == 0)) {
+ else if (!strcmp(argv[0], "get")) {
+ if (argc > 1 && (!strcmp(argv[1], "help"))) {
ipmi_fru_get_help();
return 0;
} else if (argc < 2) {
lprintf(LOG_ERR, "Not enough parameters given.");
ipmi_fru_get_help();
- return (-1);
+ return -1;
}
if (argc >= 2) {
if (is_fru_id(argv[1], &fru_id) != 0)
- return (-1);
+ return -1;
if (verbose) {
printf("FRU ID : %d\n", fru_id);
@@ -4584,12 +4629,12 @@ ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
}
if (argc >= 3) {
- if (!strncmp(argv[2], "oem", 3)) {
+ if (!strcmp(argv[2], "oem")) {
rc = ipmi_fru_get_multirec(intf, fru_id, argc, argv);
} else {
lprintf(LOG_ERR, "Invalid command: %s", argv[2]);
ipmi_fru_get_help();
- return (-1);
+ return -1;
}
} else {
rc = ipmi_fru_get_multirec(intf, fru_id, argc, argv);
@@ -4598,7 +4643,7 @@ ipmi_fru_main(struct ipmi_intf * intf, int argc, char ** argv)
else {
lprintf(LOG_ERR, "Invalid FRU command: %s", argv[0]);
ipmi_fru_help();
- return (-1);
+ return -1;
}
return rc;
@@ -4645,15 +4690,15 @@ f_type, uint8_t f_index, char *f_string)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
@@ -4663,7 +4708,7 @@ f_type, uint8_t f_index, char *f_string)
if (fru.size < 1) {
printf(" Invalid FRU size %d", fru.size);
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
/*
@@ -4681,17 +4726,17 @@ f_type, uint8_t f_index, char *f_string)
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL)
+ if (!rsp)
{
printf(" Device not present (No Response)\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
- if (rsp->ccode > 0)
+ if (rsp->ccode)
{
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
@@ -4700,20 +4745,17 @@ f_type, uint8_t f_index, char *f_string)
memcpy(&header, rsp->data + 1, 8);
- if (header.version != 1)
- {
+ if (header.version != 1) {
printf(" Unknown FRU header version 0x%02x",
header.version);
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
fru_data = malloc( fru.size );
-
- if( fru_data == NULL )
- {
+ if (!fru_data) {
printf("Out of memory!\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
@@ -4743,14 +4785,14 @@ f_type, uint8_t f_index, char *f_string)
else
{
printf("Wrong field type.");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
memset(fru_data, 0, fru.size);
if( read_fru_area(intf ,&fru, fruId, header_offset ,
fru_section_len , fru_data) < 0 )
{
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
/* Convert index from character to decimal */
@@ -4759,16 +4801,15 @@ f_type, uint8_t f_index, char *f_string)
/*Seek to field index */
for (i=0; i <= f_index; i++) {
fru_field_offset_tmp = fru_field_offset;
- if (fru_area != NULL) {
- free(fru_area);
- fru_area = NULL;
+ if (fru_area) {
+ free_n(&fru_area);
}
fru_area = (uint8_t *) get_fru_area_str(fru_data, &fru_field_offset);
}
- if( (fru_area == NULL ) || strlen((const char *)fru_area) == 0 ) {
+ if (!FRU_FIELD_VALID(fru_area)) {
printf("Field not found !\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
@@ -4792,7 +4833,7 @@ f_type, uint8_t f_index, char *f_string)
header_offset, fru_section_len, fru_data) < 0 )
{
printf("Write to FRU data failed.\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
}
@@ -4802,20 +4843,14 @@ f_type, uint8_t f_index, char *f_string)
ipmi_fru_set_field_string_rebuild(intf,fruId,fru,header,f_type,f_index,f_string)
)
{
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_out;
}
}
- ipmi_fru_set_field_string_out:
- if (fru_data != NULL) {
- free(fru_data);
- fru_data = NULL;
- }
- if (fru_area != NULL) {
- free(fru_area);
- fru_area = NULL;
- }
+ipmi_fru_set_field_string_out:
+ free_n(&fru_data);
+ free_n(&fru_area);
return rc;
}
@@ -4871,10 +4906,9 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
fru_data_new = malloc( fru.size );
- if( fru_data_old == NULL || fru_data_new == NULL )
- {
+ if (!fru_data_old || !fru_data_new) {
printf("Out of memory!\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_rebuild_out;
}
@@ -4929,7 +4963,7 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
else
{
printf("Wrong field type.");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_rebuild_out;
}
@@ -4937,16 +4971,13 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
3) Seek to field index */
for (i = 0;i <= f_index; i++) {
fru_field_offset_tmp = fru_field_offset;
- if (fru_area != NULL) {
- free(fru_area);
- fru_area = NULL;
- }
+ free_n(&fru_area);
fru_area = (uint8_t *) get_fru_area_str(fru_data_old, &fru_field_offset);
}
- if( (fru_area == NULL ) || strlen((const char *)fru_area) == 0 ) {
+ if (!FRU_FIELD_VALID(fru_area)) {
printf("Field not found (1)!\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_rebuild_out;
}
@@ -5119,7 +5150,7 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
*(fru_data_new + fru_field_offset_tmp) = (0xc0 + strlen(f_string));
memcpy(fru_data_new + fru_field_offset_tmp + 1, f_string, strlen(f_string));
- /* Copy remaing bytes in section */
+ /* Copy remaining bytes in section */
#ifdef DBG_RESIZE_FRU
printf("Copying remaining of sections: %d \n",
(int)((fru_data_old + header_offset + fru_section_len - 1) -
@@ -5155,7 +5186,7 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
else
{
printf( "Internal error, padding length %i (must be from 0 to 7) ", padding_len );
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_rebuild_out;
}
@@ -5165,25 +5196,16 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
if( write_fru_area( intf, &fru, fruId, 0, 0, fru.size, fru_data_new ) < 0 )
{
printf("Write to FRU data failed.\n");
- rc = (-1);
+ rc = -1;
goto ipmi_fru_set_field_string_rebuild_out;
}
printf("Done.\n");
- ipmi_fru_set_field_string_rebuild_out:
- if (fru_area != NULL) {
- free(fru_area);
- fru_area = NULL;
- }
- if (fru_data_new != NULL) {
- free(fru_data_new);
- fru_data_new = NULL;
- }
- if (fru_data_old != NULL) {
- free(fru_data_old);
- fru_data_old = NULL;
- }
+ipmi_fru_set_field_string_rebuild_out:
+ free_n(&fru_area);
+ free_n(&fru_data_new);
+ free_n(&fru_data_old);
return rc;
}
diff --git a/lib/ipmi_fwum.c b/lib/ipmi_fwum.c
index d1e3f4f..b01c545 100644
--- a/lib/ipmi_fwum.c
+++ b/lib/ipmi_fwum.c
@@ -151,16 +151,16 @@ ipmi_fwum_main(struct ipmi_intf *intf, int argc, char **argv)
printf_kfwum_help();
return (-1);
}
- if (strncmp(argv[0], "help", 4) == 0) {
+ if (!strcmp(argv[0], "help")) {
printf_kfwum_help();
rc = 0;
- } else if (strncmp(argv[0], "info", 4) == 0) {
+ } else if (!strcmp(argv[0], "info")) {
rc = ipmi_fwum_info(intf);
- } else if (strncmp(argv[0], "status", 6) == 0) {
+ } else if (!strcmp(argv[0], "status")) {
rc = ipmi_fwum_status(intf);
- } else if (strncmp(argv[0], "rollback", 8) == 0) {
+ } else if (!strcmp(argv[0], "rollback")) {
rc = KfwumManualRollback(intf);
- } else if (strncmp(argv[0], "download", 8) == 0) {
+ } else if (!strcmp(argv[0], "download")) {
if ((argc < 2) || (strlen(argv[1]) < 1)) {
lprintf(LOG_ERR,
"Path and file name must be specified.");
@@ -168,14 +168,14 @@ ipmi_fwum_main(struct ipmi_intf *intf, int argc, char **argv)
}
printf("Firmware File Name : %s\n", argv[1]);
rc = ipmi_fwum_fwupgrade(intf, argv[1], 0);
- } else if (strncmp(argv[0], "upgrade", 7) == 0) {
+ } else if (!strcmp(argv[0], "upgrade")) {
if ((argc >= 2) && (strlen(argv[1]) > 0)) {
printf("Upgrading using file name %s\n", argv[1]);
rc = ipmi_fwum_fwupgrade(intf, argv[1], 1);
} else {
rc = KfwumStartFirmwareUpgrade(intf);
}
- } else if (strncmp(argv[0], "tracelog", 8) == 0) {
+ } else if (!strcmp(argv[0], "tracelog")) {
rc = KfwumGetTraceLog(intf);
} else {
lprintf(LOG_ERR, "Invalid KFWUM command: %s", argv[0]);
@@ -258,7 +258,7 @@ ipmi_fwum_fwupgrade(struct ipmi_intf *intf, char *file, int action)
unsigned short padding;
unsigned long fsize = 0;
unsigned char not_used;
- if (file == NULL) {
+ if (!file) {
lprintf(LOG_ERR, "No file given.");
return (-1);
}
@@ -312,7 +312,7 @@ KfwumGetFileSize(const char *pFileName, unsigned long *pFileSize)
{
FILE *pFileHandle = NULL;
pFileHandle = fopen(pFileName, "rb");
- if (pFileHandle == NULL) {
+ if (!pFileHandle) {
return (-1);
}
if (fseek(pFileHandle, 0L , SEEK_END) == 0) {
@@ -342,7 +342,7 @@ KfwumSetupBuffersFromFile(const char *pFileName, unsigned long fileSize)
int qty = 0;
pFileHandle = fopen(pFileName, "rb");
- if (pFileHandle == NULL) {
+ if (!pFileHandle) {
lprintf(LOG_ERR, "Failed to open '%s' for reading.",
pFileName);
return (-1);
@@ -454,7 +454,7 @@ KfwumGetInfo(struct ipmi_intf *intf, unsigned char output,
if (!rsp) {
lprintf(LOG_ERR, "Error in FWUM Firmware Get Info Command.");
return (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "FWUM Firmware Get Info returned %x",
rsp->ccode);
return (-1);
@@ -479,7 +479,7 @@ KfwumGetInfo(struct ipmi_intf *intf, unsigned char output,
printf("Number Of Memory Bank : %u\n", pGetInfo->numBank);
}
*pNumBank = pGetInfo->numBank;
- /* Determine wich type of download to use: */
+ /* Determine which type of download to use: */
/* Old FWUM or Old IPMC fw (data_len < 7)
* --> Address with small buffer size
*/
@@ -501,14 +501,14 @@ KfwumGetInfo(struct ipmi_intf *intf, unsigned char output,
printf("Protocol Revision :");
printf(" > 5 optimizing buffers\n");
}
- if (strstr(intf->name,"lan") != NULL) {
+ if (strstr(intf->name,"lan")) {
/* also covers lanplus */
save_fw_nfo.bufferSize = KFWUM_SMALL_BUFFER;
if (verbose) {
printf("IOL payload size : %d\n",
save_fw_nfo.bufferSize);
}
- } else if ((strstr(intf->name,"open")!= NULL)
+ } else if (strstr(intf->name,"open")
&& intf->target_addr != IPMI_BMC_SLAVE_ADDR
&& (intf->target_addr != intf->my_addr)) {
save_fw_nfo.bufferSize = KFWUM_SMALL_BUFFER;
@@ -549,10 +549,10 @@ KfwumGetDeviceInfo(struct ipmi_intf *intf, unsigned char output,
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in Get Device Id Command");
return (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Get Device Id returned %x",
rsp->ccode);
return (-1);
@@ -598,19 +598,19 @@ KfwumGetStatus(struct ipmi_intf * intf)
if (verbose) {
printf(" Getting Status!\n");
}
- /* Retreive the number of bank */
+ /* Retrieve the number of bank */
rc = KfwumGetInfo(intf, 0, &numBank);
for(counter = 0;
(counter < numBank) && (rc == 0);
counter ++) {
- /* Retreive the status of each bank */
+ /* Retrieve the status of each bank */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_FIRMWARE;
req.msg.cmd = KFWUM_CMD_ID_GET_FIRMWARE_STATUS;
req.msg.data = &counter;
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Error in FWUM Firmware Get Status Command.");
rc = (-1);
@@ -668,10 +668,10 @@ KfwumManualRollback(struct ipmi_intf *intf)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in FWUM Manual Rollback Command.");
return (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR,
"Error in FWUM Manual Rollback Command returned %x",
rsp->ccode);
@@ -707,7 +707,7 @@ KfwumStartFirmwareImage(struct ipmi_intf *intf, unsigned long length,
req.msg.data_len = 6;
}
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Error in FWUM Firmware Start Firmware Image Download Command.");
return (-1);
@@ -755,13 +755,13 @@ KfwumSaveFirmwareImage(struct ipmi_intf *intf, unsigned char sequenceNumber,
/* + 1 => sequenceNumber*/
}
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Error in FWUM Firmware Save Firmware Image Download Command.");
/* We don't receive "C7" on errors with IOL,
* instead we receive nothing
*/
- if (strstr(intf->name, "lan") != NULL) {
+ if (strstr(intf->name, "lan")) {
no_rsp++;
if (no_rsp < FWUM_SAVE_FIRMWARE_NO_RESPONSE_LIMIT) {
*pInBufLength -= 1;
@@ -772,7 +772,7 @@ KfwumSaveFirmwareImage(struct ipmi_intf *intf, unsigned char sequenceNumber,
*pInBufLength = 0;
break;
} /* For other interface keep trying */
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
if (rsp->ccode == 0xc0) {
sleep(1);
} else if ((rsp->ccode == 0xc7)
@@ -836,9 +836,9 @@ KfwumFinishFirmwareImage(struct ipmi_intf *intf, tKFWUM_InFirmwareInfo firmInfo)
/* Infinite loop if BMC doesn't reply or replies 0xc0 every time. */
do {
rsp = intf->sendrecv(intf, &req);
- } while (rsp == NULL || rsp->ccode == 0xc0);
+ } while (!rsp || rsp->ccode == 0xc0);
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR,
"FWUM Firmware Finish Firmware Image Download returned %x",
rsp->ccode);
@@ -917,7 +917,7 @@ KfwumStartFirmwareUpgrade(struct ipmi_intf *intf)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Error in FWUM Firmware Start Firmware Upgrade Command");
rc = (-1);
@@ -950,7 +950,7 @@ KfwumGetTraceLog(struct ipmi_intf *intf)
(chunkIdx < TRACE_LOG_CHUNK_COUNT)
&& (rc == 0);
chunkIdx++) {
- /* Retreive each log chunk and print it */
+ /* Retrieve each log chunk and print it */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_FIRMWARE;
req.msg.cmd = KFWUM_CMD_ID_GET_TRACE_LOG;
@@ -958,7 +958,7 @@ KfwumGetTraceLog(struct ipmi_intf *intf)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Error in FWUM Firmware Get Trace Log Command");
rc = (-1);
@@ -971,7 +971,7 @@ KfwumGetTraceLog(struct ipmi_intf *intf)
break;
}
for (cmdIdx=0; cmdIdx < TRACE_LOG_CHUNK_SIZE; cmdIdx++) {
- /* Don't diplay commands with an invalid state */
+ /* Don't display commands with an invalid state */
if ((rsp->data[TRACE_LOG_ATT_COUNT * cmdIdx + 1] != 0)
&& (rsp->data[TRACE_LOG_ATT_COUNT * cmdIdx] < KFWUM_CMD_ID_STD_MAX_CMD)) {
printf(" Cmd ID: %17s -- CmdState: %10s -- CompCode: %2x\n",
@@ -1001,7 +1001,7 @@ KfwumGetInfoFromFirmware(unsigned char *pBuf, unsigned long bufSize,
}
offset = IN_FIRMWARE_INFO_OFFSET_LOCATION;
- /* Now, fill the structure with read informations */
+ /* Now, fill the structure with read information */
pInfo->checksum = (unsigned short)KWUM_GET_BYTE_AT_OFFSET(pBuf,
offset + 0 + IN_FIRMWARE_INFO_OFFSET_CHECKSUM ) << 8;
diff --git a/lib/ipmi_gendev.c b/lib/ipmi_gendev.c
index 7a4cf08..215a717 100644
--- a/lib/ipmi_gendev.c
+++ b/lib/ipmi_gendev.c
@@ -71,7 +71,6 @@ typedef struct gendev_eeprom_info
static int
ipmi_gendev_get_eeprom_size(
- struct ipmi_intf *intf,
struct sdr_record_generic_locator *dev,
t_gendev_eeprom_info *info
)
@@ -88,8 +87,7 @@ ipmi_gendev_get_eeprom_size(
lprintf(LOG_ERR, "DevType : %x", dev->dev_type);
lprintf(LOG_ERR, "DevType Mod: %x", dev->dev_type_modifier);
*/
- if( info != NULL)
- {
+ if (info) {
switch(dev->dev_type)
{
case 0x08: // 24C01
@@ -192,7 +190,7 @@ ipmi_gendev_read_file(
int eeprom_size;
t_gendev_eeprom_info eeprom_info;
- eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
+ eeprom_size = ipmi_gendev_get_eeprom_size(dev, &eeprom_info);
if(eeprom_size > 0)
{
@@ -280,8 +278,7 @@ ipmi_gendev_read_file(
msize
);
- if (rsp != NULL)
- {
+ if (rsp) {
retryCounter = GENDEV_RETRY_COUNT;
rc = 0;
}
@@ -364,7 +361,7 @@ ipmi_gendev_write_file(
int eeprom_size;
t_gendev_eeprom_info eeprom_info;
- eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
+ eeprom_size = ipmi_gendev_get_eeprom_size(dev, &eeprom_info);
if(eeprom_size > 0)
{
@@ -376,7 +373,7 @@ ipmi_gendev_write_file(
if(fp)
{
- /* Retreive file length, check if it's fits the Eeprom Size */
+ /* Retrieve file length, check if it's fits the Eeprom Size */
fseek(fp, 0 ,SEEK_END);
fileLength = ftell(fp);
@@ -457,8 +454,6 @@ ipmi_gendev_write_file(
break;
}
-
-
for(
retryCounter = 0;
retryCounter<GENDEV_RETRY_COUNT;
@@ -476,8 +471,7 @@ ipmi_gendev_write_file(
i2caddr+= (((eeprom_info.size) % address_span_size) * 2);
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr, (uint8_t *) wrByte, eeprom_info.address_length+msize, 0);
- if (rsp != NULL)
- {
+ if (rsp) {
retryCounter = GENDEV_RETRY_COUNT;
rc = 0;
}
@@ -495,8 +489,7 @@ ipmi_gendev_write_file(
}
}
- if( rc == 0 )
- {
+ if (!rc) {
static uint8_t previousCompleted = 101;
percentCompleted = ((counter * 100) / eeprom_info.size );
@@ -548,11 +541,7 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv)
lprintf(LOG_ERR, "Rx gendev command: %s", argv[0]);
- if (
- (argc == 0)
- ||
- (strncmp(argv[0], "help", 4) == 0)
- )
+ if (!argc || !strcmp(argv[0], "help"))
{
lprintf(LOG_ERR,
"SDR Commands: list read write");
@@ -562,18 +551,12 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv)
" read <sdr name> <file> Read to file eeprom specify by Generic Device Locators");
lprintf(LOG_ERR,
" write <sdr name> <file> Write from file eeprom specify by Generic Device Locators");
- }
- else if ( strncmp(argv[0], "list", 4) == 0)
- {
- rc = ipmi_sdr_print_sdr(intf,
- SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
- }
- else if (strncmp(argv[0], "read", 4) == 0)
- {
+ } else if (!strcmp(argv[0], "list")) {
+ rc = ipmi_sdr_print_sdr(intf, SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
+ } else if (!strcmp(argv[0], "read")) {
if (argc < 3)
lprintf(LOG_ERR, "usage: gendev read <gendev> <filename>");
- else
- {
+ else {
struct sdr_record_list *sdr;
lprintf(LOG_ERR, "Gendev read sdr name : %s", argv[1]);
@@ -582,14 +565,12 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv)
/* lookup by sensor name */
sdr = ipmi_sdr_find_sdr_byid(intf, argv[1]);
- if (sdr == NULL)
- {
+ if (!sdr) {
lprintf(LOG_ERR, "Sensor data record not found!");
return -1;
}
- if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
- {
+ if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) {
lprintf(LOG_ERR, "Target SDR is not a generic device locator");
return -1;
}
@@ -598,13 +579,10 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv)
ipmi_gendev_read_file(intf, sdr->record.genloc, argv[2]);
}
- }
- else if (strncmp(argv[0], "write", 5) == 0)
- {
+ } else if (!strcmp(argv[0], "write")) {
if (argc < 3)
lprintf(LOG_ERR, "usage: gendev write <gendev> <filename>");
- else
- {
+ else {
struct sdr_record_list *sdr;
lprintf(LOG_ERR, "Gendev write sdr name : %s", argv[1]);
@@ -613,25 +591,20 @@ ipmi_gendev_main(struct ipmi_intf *intf, int argc, char **argv)
/* lookup by sensor name */
sdr = ipmi_sdr_find_sdr_byid(intf, argv[1]);
- if (sdr == NULL)
- {
+ if (!sdr) {
lprintf(LOG_ERR, "Sensor data record not found!");
return -1;
}
- if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
- {
+ if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) {
lprintf(LOG_ERR, "Target SDR is not a generic device locator");
return -1;
}
lprintf(LOG_ERR, "Gendev write file name: %s", argv[2]);
ipmi_gendev_write_file(intf, sdr->record.genloc, argv[2]);
-
}
- }
- else
- {
+ } else {
lprintf(LOG_ERR, "Invalid gendev command: %s", argv[0]);
rc = -1;
}
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c
index 9cbd4ff..ea9072e 100644
--- a/lib/ipmi_hpmfwupg.c
+++ b/lib/ipmi_hpmfwupg.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2006 Kontron Canada, Inc. All Rights Reserved.
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2020 Joyent, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,10 +31,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _BSD_SOURCE || \
- (_XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
- !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_mc.h>
@@ -52,12 +49,27 @@
# include <config.h>
#endif
-/* From src/plugins/ipmi_intf.c: */
-uint16_t
-ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf);
+/*
+ * This error code is used as a temporary PATCH to
+ * the latest Open ipmi driver. This PATCH
+ * will be removed once a new Open IPMI driver is released.
+ * (Buggy version = 39)
+ */
+#define ENABLE_OPENIPMI_V39_PATCH
+
+#ifdef ENABLE_OPENIPMI_V39_PATCH
+# define RETRY_COUNT_MAX 3
+static int errorCount;
+# define HPMFWUPG_IS_RETRYABLE(error) \
+ ((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++<RETRY_COUNT_MAX))?TRUE:FALSE)
+#else
+# define HPMFWUPG_IS_RETRYABLE(error) FALSE
+#endif
extern int verbose;
+VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX];
+
int HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename,
int activate, int, int);
int HpmfwupgValidateImageIntegrity(struct HpmfwupgUpgradeCtx *pFwupgCtx);
@@ -117,7 +129,7 @@ int HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
int option,
int *pFlagColdReset);
int
-HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf,
+HpmfwupgPreUpgradeCheck(
struct HpmfwupgUpgradeCtx *pFwupgCtx,
int componentMask, int option);
@@ -507,10 +519,9 @@ HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename, int activate,
lprintf(LOG_NOTICE, "\nPerforming upgrade stage:");
}
if (option & VIEW_MODE) {
- rc = HpmfwupgPreUpgradeCheck(intf,
- &fwupgCtx,componentMask, VIEW_MODE);
+ rc = HpmfwupgPreUpgradeCheck(&fwupgCtx,componentMask, VIEW_MODE);
} else {
- rc = HpmfwupgPreUpgradeCheck(intf, &fwupgCtx,
+ rc = HpmfwupgPreUpgradeCheck(&fwupgCtx,
componentMask, option);
if (rc == HPMFWUPG_SUCCESS) {
if (verbose) {
@@ -534,7 +545,7 @@ HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename, int activate,
}
if (rc == HPMFWUPG_SUCCESS) {
if (option & VIEW_MODE) {
- /* Dont display anything here in case we are just viewing it */
+ /* Don't display anything here in case we are just viewing it */
lprintf(LOG_NOTICE," ");
} else if (option & COMPARE_MODE) {
lprintf(LOG_NOTICE,
@@ -544,7 +555,7 @@ HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename, int activate,
"\nFirmware upgrade procedure successful\n");
}
} else if (option & VIEW_MODE) {
- /* Dont display anything here in case we are just viewing it */
+ /* Don't display anything here in case we are just viewing it */
lprintf(LOG_NOTICE," ");
} else if (option & COMPARE_MODE) {
lprintf(LOG_NOTICE,
@@ -653,7 +664,7 @@ HpmfwupgPreparationStage(struct ipmi_intf *intf,
if (rc != HPMFWUPG_SUCCESS) {
/* Giving one more chance to user to check whether its OK to continue even if the
* product ID does not match. This is helpful as sometimes we just want to update
- * and dont care whether we have a different product Id. If the user says NO then
+ * and don't care whether we have a different product Id. If the user says NO then
* we need to just bail out from here
*/
if (!((option & FORCE_MODE) || (option & VIEW_MODE))) {
@@ -725,7 +736,7 @@ HpmfwupgPreparationStage(struct ipmi_intf *intf,
"\n Some components present in the image file are not supported by the IPMC");
return HPMFWUPG_ERROR;
}
- /* Make sure the upgrade is desirable rigth now */
+ /* Make sure the upgrade is desirable right now */
if (pFwupgCtx->targetCap.GlobalCapabilities.bitField.fwUpgUndesirable == 1) {
lprintf(LOG_NOTICE, "\n Upgrade undesirable at this moment");
return HPMFWUPG_ERROR;
@@ -834,7 +845,7 @@ HpmfwupgValidateActionRecordChecksum(struct HpmfwupgActionRecord *pActionRecord)
* is same as target version.
*/
int
-HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf,
+HpmfwupgPreUpgradeCheck(
struct HpmfwupgUpgradeCtx *pFwupgCtx,
int componentMask, int option)
{
@@ -1213,7 +1224,7 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
if (rc == HPMFWUPG_UPLOAD_BLOCK_LENGTH && !bufLengthIsSet) {
rc = HPMFWUPG_SUCCESS;
/* Retry with a smaller buffer length */
- if (strstr(intf->name,"lan") != NULL && bufLength > 8) {
+ if (strstr(intf->name,"lan") && bufLength > 8) {
bufLength-= 8;
lprintf(LOG_INFO,
"Trying reduced buffer length: %d",
@@ -1304,7 +1315,7 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
HpmDisplayUpgrade(1,0,0,0);
if ((option & COMPARE_MODE)
&& !pFwupgCtx->genCompProp[pFwupgCtx->componentId].GeneralCompProperties.bitfield.comparisonSupport) {
- printf("| |Comparison isn't supported for given compenent. |\n");
+ printf("| |Comparison isn't supported for given component. |\n");
}
*pImagePtr = pDataInitial + firmwareLength;
}
@@ -1390,22 +1401,26 @@ int
HpmfwupgGetBufferFromFile(char *imageFilename,
struct HpmfwupgUpgradeCtx *pFwupgCtx)
{
- int rc = HPMFWUPG_SUCCESS;
+ int rc = HPMFWUPG_ERROR;
int ret = 0;
FILE *pImageFile = fopen(imageFilename, "rb");
- if (pImageFile == NULL) {
+ if (!pImageFile) {
lprintf(LOG_ERR, "Cannot open image file '%s'",
imageFilename);
- return HPMFWUPG_ERROR;
+ goto ret_no_close;
}
/* Get the raw data in file */
- fseek(pImageFile, 0, SEEK_END);
+ ret = fseek(pImageFile, 0, SEEK_END);
+ if (ret != 0) {
+ lprintf(LOG_ERR, "Failed to seek in the image file '%s'",
+ imageFilename);
+ goto ret_close;
+ }
pFwupgCtx->imageSize = ftell(pImageFile);
pFwupgCtx->pImageData = malloc(sizeof(unsigned char)*pFwupgCtx->imageSize);
- if (pFwupgCtx->pImageData == NULL) {
+ if (!pFwupgCtx->pImageData) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
- fclose(pImageFile);
- return HPMFWUPG_ERROR;
+ goto ret_close;
}
rewind(pImageFile);
ret = fread(pFwupgCtx->pImageData,
@@ -1417,9 +1432,14 @@ HpmfwupgGetBufferFromFile(char *imageFilename,
"Failed to read file %s size %d",
imageFilename,
pFwupgCtx->imageSize);
- rc = HPMFWUPG_ERROR;
+ goto ret_close;
}
+
+ rc = HPMFWUPG_SUCCESS;
+
+ret_close:
fclose(pImageFile);
+ret_no_close:
return rc;
}
@@ -1433,11 +1453,11 @@ HpmfwupgGetDeviceId(struct ipmi_intf *intf, struct ipm_devid_rsp *pGetDevId)
req.msg.cmd = BMC_GET_DEVICE_ID;
req.msg.data_len = 0;
rsp = HpmfwupgSendCmd(intf, req, NULL);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error getting device ID.");
return HPMFWUPG_ERROR;
}
- if (rsp->ccode != 0x00) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error getting device ID.");
lprintf(LOG_ERR, "compcode=0x%x: %s",
rsp->ccode,
@@ -1461,12 +1481,12 @@ HpmfwupgGetTargetUpgCapabilities(struct ipmi_intf *intf,
req.msg.data = (unsigned char*)&pCtx->req;
req.msg.data_len = sizeof(struct HpmfwupgGetTargetUpgCapabilitiesReq);
rsp = HpmfwupgSendCmd(intf, req, NULL);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Error getting target upgrade capabilities.");
return HPMFWUPG_ERROR;
}
- if (rsp->ccode != 0x00) {
+ if (rsp->ccode) {
lprintf(LOG_ERR,
"Error getting target upgrade capabilities, ccode: 0x%x: %s",
rsp->ccode,
@@ -1502,7 +1522,7 @@ HpmfwupgGetTargetUpgCapabilities(struct ipmi_intf *intf,
pCtx->resp.GlobalCapabilities.bitField.autRollbackOverride ? 'y' : 'n');
lprintf(LOG_NOTICE, "IPMC degraded...........[%c] ",
pCtx->resp.GlobalCapabilities.bitField.ipmcDegradedDurinUpg ? 'y' : 'n');
- lprintf(LOG_NOTICE, "Defered activation......[%c] ",
+ lprintf(LOG_NOTICE, "Deferred activation.....[%c] ",
pCtx->resp.GlobalCapabilities.bitField.deferActivation ? 'y' : 'n');
lprintf(LOG_NOTICE, "Service affected........[%c] ",
pCtx->resp.GlobalCapabilities.bitField.servAffectDuringUpg ? 'y' : 'n');
@@ -1538,12 +1558,12 @@ HpmfwupgGetComponentProperties(struct ipmi_intf *intf,
req.msg.data = (unsigned char*)&pCtx->req;
req.msg.data_len = sizeof(struct HpmfwupgGetComponentPropertiesReq);
rsp = HpmfwupgSendCmd(intf, req, NULL);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_NOTICE,
"Error getting component properties\n");
return HPMFWUPG_ERROR;
}
- if (rsp->ccode != 0x00) {
+ if (rsp->ccode) {
lprintf(LOG_NOTICE,
"Error getting component properties");
lprintf(LOG_NOTICE,
@@ -1664,11 +1684,11 @@ HpmfwupgAbortUpgrade(struct ipmi_intf *intf,
req.msg.data = (unsigned char*)&pCtx->req;
req.msg.data_len = sizeof(struct HpmfwupgAbortUpgradeReq);
rsp = HpmfwupgSendCmd(intf, req, NULL);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error - aborting upgrade.");
return HPMFWUPG_ERROR;
}
- if (rsp->ccode != 0x00) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error aborting upgrade");
lprintf(LOG_ERR, "compcode=0x%x: %s",
rsp->ccode,
@@ -1693,14 +1713,14 @@ HpmfwupgInitiateUpgradeAction(struct ipmi_intf *intf,
req.msg.data = (unsigned char*)&pCtx->req;
req.msg.data_len = sizeof(struct HpmfwupgInitiateUpgradeActionReq);
rsp = HpmfwupgSendCmd(intf, req, pFwupgCtx);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error initiating upgrade action.");
return HPMFWUPG_ERROR;
}
/* Long duration command handling */
if (rsp->ccode == HPMFWUPG_COMMAND_IN_PROGRESS) {
rc = HpmfwupgWaitLongDurationCmd(intf, pFwupgCtx);
- } else if (rsp->ccode != 0x00) {
+ } else if (rsp->ccode) {
lprintf(LOG_NOTICE,"Error initiating upgrade action");
lprintf(LOG_NOTICE, "compcode=0x%x: %s",
rsp->ccode,
@@ -1727,7 +1747,7 @@ HpmfwupgUploadFirmwareBlock(struct ipmi_intf *intf,
/* 2 is the size of the upload struct - data */
req.msg.data_len = 2 + count;
rsp = HpmfwupgSendCmd(intf, req, pFwupgCtx);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_NOTICE, "Error uploading firmware block.");
return HPMFWUPG_ERROR;
}
@@ -1763,7 +1783,7 @@ HpmfwupgUploadFirmwareBlock(struct ipmi_intf *intf,
/* Long duration command handling */
if (rsp->ccode == HPMFWUPG_COMMAND_IN_PROGRESS) {
rc = HpmfwupgWaitLongDurationCmd(intf, pFwupgCtx);
- } else if (rsp->ccode != 0x00) {
+ } else if (rsp->ccode) {
/* PATCH --> This validation is to handle retryables errors codes on IPMB bus.
* This will be fixed in the next release of open ipmi and this
* check will have to be removed. (Buggy version = 39)
@@ -1804,7 +1824,7 @@ HpmfwupgFinishFirmwareUpload(struct ipmi_intf *intf,
req.msg.data = (unsigned char*)&pCtx->req;
req.msg.data_len = sizeof(struct HpmfwupgFinishFirmwareUploadReq);
rsp = HpmfwupgSendCmd(intf, req, pFwupgCtx);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error fininshing firmware upload.");
return HPMFWUPG_ERROR;
}
@@ -1841,7 +1861,7 @@ HpmfwupgActivateFirmware(struct ipmi_intf *intf,
req.msg.data_len = sizeof(struct HpmfwupgActivateFirmwareReq)
- (!pCtx->req.rollback_override ? 1 : 0);
rsp = HpmfwupgSendCmd(intf, req, pFwupgCtx);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error activating firmware.");
return HPMFWUPG_ERROR;
}
@@ -1942,7 +1962,7 @@ HpmfwupgManualFirmwareRollback(struct ipmi_intf *intf,
req.msg.data = (unsigned char*)&pCtx->req;
req.msg.data_len = sizeof(struct HpmfwupgManualFirmwareRollbackReq);
rsp = HpmfwupgSendCmd(intf, req, &fwupgCtx);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error sending manual rollback.");
return HPMFWUPG_ERROR;
}
@@ -1953,7 +1973,7 @@ HpmfwupgManualFirmwareRollback(struct ipmi_intf *intf,
printf("Waiting firmware rollback...");
fflush(stdout);
rc = HpmfwupgQueryRollbackStatus(intf, &resCmd, &fwupgCtx);
- } else if ( rsp->ccode != 0x00 ) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error sending manual rollback");
lprintf(LOG_ERR, "compcode=0x%x: %s",
rsp->ccode,
@@ -1980,7 +2000,7 @@ HpmfwupgQueryRollbackStatus(struct ipmi_intf *intf,
req.msg.data = (unsigned char*)&pCtx->req;
req.msg.data_len = sizeof(struct HpmfwupgQueryRollbackStatusReq);
/* If we are not in upgrade context, we use default timeout values */
- if (pFwupgCtx != NULL) {
+ if (pFwupgCtx) {
struct HpmfwupgImageHeader *pImageHeader;
if (pFwupgCtx->pImageData) {
pImageHeader = (struct HpmfwupgImageHeader*)pFwupgCtx->pImageData;
@@ -1989,7 +2009,7 @@ HpmfwupgQueryRollbackStatus(struct ipmi_intf *intf,
rollbackTimeout = 0;
}
/* Use the greater of the two timeouts (header and target caps) */
- rollbackTimeout = MAX(rollbackTimeout,
+ rollbackTimeout = __max(rollbackTimeout,
pFwupgCtx->targetCap.rollbackTimeout) * 5;
} else {
rollbackTimeout = HPMFWUPG_DEFAULT_UPGRADE_TIMEOUT;
@@ -2016,7 +2036,7 @@ HpmfwupgQueryRollbackStatus(struct ipmi_intf *intf,
&& ((rsp->ccode == HPMFWUPG_COMMAND_IN_PROGRESS)
|| (rsp->ccode == IPMI_CC_TIMEOUT))
&& (timeoutSec2 - timeoutSec1 < rollbackTimeout));
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error getting upgrade status.");
return HPMFWUPG_ERROR;
}
@@ -2060,11 +2080,11 @@ HpmfwupgQuerySelftestResult(struct ipmi_intf *intf, struct HpmfwupgQuerySelftest
unsigned int timeoutSec1, timeoutSec2;
pCtx->req.picmgId = HPMFWUPG_PICMG_IDENTIFIER;
/* If we are not in upgrade context, we use default timeout values */
- if (pFwupgCtx != NULL) {
+ if (pFwupgCtx) {
/* Getting selftest timeout from new image */
struct HpmfwupgImageHeader *pImageHeader = (struct HpmfwupgImageHeader*)
pFwupgCtx->pImageData;
- selfTestTimeout = MAX(pImageHeader->selfTestTimeout,
+ selfTestTimeout = __max(pImageHeader->selfTestTimeout,
pFwupgCtx->targetCap.selftestTimeout) * 5;
} else {
selfTestTimeout = HPMFWUPG_DEFAULT_UPGRADE_TIMEOUT;
@@ -2096,7 +2116,7 @@ HpmfwupgQuerySelftestResult(struct ipmi_intf *intf, struct HpmfwupgQuerySelftest
} while (rsp
&& (rsp->ccode == HPMFWUPG_COMMAND_IN_PROGRESS)
&& (timeoutSec2 - timeoutSec1 < selfTestTimeout));
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_NOTICE, "Error getting upgrade status\n");
return HPMFWUPG_ERROR;
}
@@ -2130,14 +2150,14 @@ HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req,
unsigned int timeoutSec1, timeoutSec2;
unsigned char retry = 0;
/* If we are not in upgrade context, we use default timeout values */
- if (pFwupgCtx != NULL) {
+ if (pFwupgCtx) {
inaccessTimeout = pFwupgCtx->targetCap.inaccessTimeout*5;
upgradeTimeout = pFwupgCtx->targetCap.upgradeTimeout*5;
} else {
/* keeping the inaccessTimeout to 60 seconds results in almost 2900 retries
* So if the target is not available it will be retrying the command for 2900
- * times which is not effecient -So reducing the Timout to 5 seconds which is
- * almost 200 retries if it continuously recieves 0xC3 as completion code.
+ * times which is not efficient -So reducing the Timeout to 5 seconds which is
+ * almost 200 retries if it continuously receives 0xC3 as completion code.
*/
inaccessTimeout = HPMFWUPG_DEFAULT_UPGRADE_TIMEOUT;
upgradeTimeout = HPMFWUPG_DEFAULT_UPGRADE_TIMEOUT;
@@ -2146,10 +2166,10 @@ HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req,
do {
static unsigned char isValidSize = FALSE;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
#define HPM_LAN_PACKET_RESIZE_LIMIT 6
/* also covers lanplus */
- if (strstr(intf->name, "lan") != NULL) {
+ if (strstr(intf->name, "lan")) {
static int errorCount=0;
static struct ipmi_rs fakeRsp;
lprintf(LOG_DEBUG,
@@ -2214,7 +2234,7 @@ HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req,
}
}
/* Handle inaccessibility timeout (rsp = NULL if IOL) */
- if (rsp == NULL || rsp->ccode == 0xff || rsp->ccode == 0xc3 || rsp->ccode == 0xd3) {
+ if (!rsp || rsp->ccode == 0xff || rsp->ccode == 0xc3 || rsp->ccode == 0xd3) {
if (inaccessTimeoutCounter < inaccessTimeout) {
timeoutSec2 = time(NULL);
if (timeoutSec2 > timeoutSec1) {
@@ -2267,14 +2287,14 @@ HpmfwupgWaitLongDurationCmd(struct ipmi_intf *intf,
unsigned int timeoutSec1, timeoutSec2;
struct HpmfwupgGetUpgradeStatusCtx upgStatusCmd;
/* If we are not in upgrade context, we use default timeout values */
- if (pFwupgCtx != NULL) {
+ if (pFwupgCtx) {
upgradeTimeout = (unsigned int)(pFwupgCtx->targetCap.upgradeTimeout*5);
if (verbose) {
printf("Use File Upgrade Capabilities: %i seconds\n",
upgradeTimeout);
}
} else {
- /* Try to retreive from Caps */
+ /* Try to retrieve from Caps */
struct HpmfwupgGetTargetUpgCapabilitiesCtx targetCapCmd;
if(HpmfwupgGetTargetUpgCapabilities(intf, &targetCapCmd) != HPMFWUPG_SUCCESS) {
upgradeTimeout = HPMFWUPG_DEFAULT_UPGRADE_TIMEOUT;
@@ -2290,13 +2310,9 @@ HpmfwupgWaitLongDurationCmd(struct ipmi_intf *intf,
}
}
}
- if (rc == HPMFWUPG_SUCCESS) {
- /* Poll upgrade status until completion or timeout*/
- timeoutSec1 = time(NULL);
- timeoutSec2 = time(NULL);
- rc = HpmfwupgGetUpgradeStatus(intf, &upgStatusCmd,
- pFwupgCtx, 1);
- }
+ /* Poll upgrade status until completion or timeout*/
+ timeoutSec2 = timeoutSec1 = time(NULL);
+ rc = HpmfwupgGetUpgradeStatus(intf, &upgStatusCmd, pFwupgCtx, 1);
while (
/* With KCS: Cover the case where we sometime
* receive d5 (on the first get status) from
@@ -2459,12 +2475,12 @@ ipmi_hpmfwupg_main(struct ipmi_intf *intf, int argc, char **argv)
HpmfwupgPrintUsage();
return HPMFWUPG_ERROR;
}
- if (strcmp(argv[0], "help") == 0) {
+ if (!strcmp(argv[0], "help")) {
HpmfwupgPrintUsage();
return HPMFWUPG_SUCCESS;
- } else if ((strcmp(argv[0], "check") == 0)) {
+ } else if (!strcmp(argv[0], "check")) {
/* hpm check */
- if (argv[1] == NULL) {
+ if (!argv[1]) {
rc = HpmfwupgTargetCheck(intf,VIEW_MODE);
} else {
/* hpm check <filename> */
@@ -2474,18 +2490,18 @@ ipmi_hpmfwupg_main(struct ipmi_intf *intf, int argc, char **argv)
0, VIEW_MODE);
}
}
- } else if (strcmp(argv[0], "upgrade") == 0) {
+ } else if (!strcmp(argv[0], "upgrade")) {
int i =0;
for (i=1; i< argc ; i++) {
- if (strcmp(argv[i],"activate") == 0) {
+ if (!strcmp(argv[i],"activate")) {
activateFlag = 1;
}
/* hpm upgrade <filename> force */
- if (strcmp(argv[i],"force") == 0) {
+ if (!strcmp(argv[i],"force")) {
option |= FORCE_MODE;
}
/* hpm upgrade <filename> component <comp Id> */
- if (strcmp(argv[i],"component") == 0) {
+ if (!strcmp(argv[i],"component")) {
if (i+1 < argc) {
/* Error Checking */
if (str2int(argv[i+1], &componentId) != 0
@@ -2514,7 +2530,7 @@ ipmi_hpmfwupg_main(struct ipmi_intf *intf, int argc, char **argv)
return HPMFWUPG_ERROR;
}
}
- if (strcmp(argv[i],"debug") == 0) {
+ if (!strcmp(argv[i],"debug")) {
option |= DEBUG_MODE;
}
}
@@ -2524,11 +2540,11 @@ ipmi_hpmfwupg_main(struct ipmi_intf *intf, int argc, char **argv)
rc = HpmfwupgUpgrade(intf, argv[1], activateFlag,
componentMask, option);
}
- } else if (strcmp(argv[0], "compare") == 0) {
+ } else if (!strcmp(argv[0], "compare")) {
int i = 0;
for (i=1; i< argc; i++) {
/* hpm compare <file> [component x...] */
- if (strcmp(argv[i],"component") == 0) {
+ if (!strcmp(argv[i],"component")) {
if (i+1 < argc) {
/* Error Checking */
if (str2int(argv[i+1], &componentId) != 0
@@ -2557,7 +2573,7 @@ ipmi_hpmfwupg_main(struct ipmi_intf *intf, int argc, char **argv)
"No component Id provided\n");
return HPMFWUPG_ERROR;
}
- } else if (strcmp(argv[i],"debug") == 0) {
+ } else if (!strcmp(argv[i],"debug")) {
option|= DEBUG_MODE;
}
}
@@ -2567,19 +2583,19 @@ ipmi_hpmfwupg_main(struct ipmi_intf *intf, int argc, char **argv)
rc = HpmfwupgUpgrade(intf, argv[1], 0,
componentMask, option);
}
- } else if ((argc >= 1) && (strcmp(argv[0], "activate") == 0)) {
+ } else if (argc >= 1 && !strcmp(argv[0], "activate")) {
struct HpmfwupgActivateFirmwareCtx cmdCtx;
- if ((argc == 2) && (strcmp(argv[1], "norollback") == 0)) {
+ if (argc == 2 && !strcmp(argv[1], "norollback")) {
cmdCtx.req.rollback_override = 1;
} else {
cmdCtx.req.rollback_override = 0;
}
rc = HpmfwupgActivateFirmware(intf, &cmdCtx, NULL);
- } else if ((argc == 1) && (strcmp(argv[0], "targetcap") == 0)) {
+ } else if (argc == 1 && !strcmp(argv[0], "targetcap")) {
struct HpmfwupgGetTargetUpgCapabilitiesCtx cmdCtx;
verbose++;
rc = HpmfwupgGetTargetUpgCapabilities(intf, &cmdCtx);
- } else if ((argc == 3) && (strcmp(argv[0], "compprop") == 0)) {
+ } else if (argc == 3 && !strcmp(argv[0], "compprop")) {
struct HpmfwupgGetComponentPropertiesCtx cmdCtx;
if (str2uchar(argv[1], &(cmdCtx.req.componentId)) != 0
|| cmdCtx.req.componentId > 7) {
@@ -2601,23 +2617,23 @@ ipmi_hpmfwupg_main(struct ipmi_intf *intf, int argc, char **argv)
}
verbose++;
rc = HpmfwupgGetComponentProperties(intf, &cmdCtx);
- } else if ((argc == 1) && (strcmp(argv[0], "abort") == 0)) {
+ } else if (argc == 1 && !strcmp(argv[0], "abort")) {
struct HpmfwupgAbortUpgradeCtx cmdCtx;
verbose++;
rc = HpmfwupgAbortUpgrade(intf, &cmdCtx);
- } else if ((argc == 1) && (strcmp(argv[0], "upgstatus") == 0)) {
+ } else if (argc == 1 && !strcmp(argv[0], "upgstatus")) {
struct HpmfwupgGetUpgradeStatusCtx cmdCtx;
verbose++;
rc = HpmfwupgGetUpgradeStatus(intf, &cmdCtx, NULL, 0);
- } else if ((argc == 1) && (strcmp(argv[0], "rollback") == 0)) {
+ } else if (argc == 1 && !strcmp(argv[0], "rollback")) {
struct HpmfwupgManualFirmwareRollbackCtx cmdCtx;
verbose++;
rc = HpmfwupgManualFirmwareRollback(intf, &cmdCtx);
- } else if ((argc == 1) && (strcmp(argv[0], "rollbackstatus") == 0)) {
+ } else if (argc == 1 && !strcmp(argv[0], "rollbackstatus")) {
struct HpmfwupgQueryRollbackStatusCtx cmdCtx;
verbose++;
rc = HpmfwupgQueryRollbackStatus(intf, &cmdCtx, NULL);
- } else if ((argc == 1) && (strcmp(argv[0], "selftestresult") == 0)) {
+ } else if (argc == 1 && !strcmp(argv[0], "selftestresult")) {
struct HpmfwupgQuerySelftestResultCtx cmdCtx;
verbose++;
rc = HpmfwupgQuerySelftestResult(intf, &cmdCtx, NULL);
diff --git a/lib/ipmi_ime.c b/lib/ipmi_ime.c
index 6bdca3b..5499eba 100755..100644
--- a/lib/ipmi_ime.c
+++ b/lib/ipmi_ime.c
@@ -202,11 +202,11 @@ static int ImeGetInfo(struct ipmi_intf *intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Device ID command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Device ID command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -240,8 +240,7 @@ static int ImeGetInfo(struct ipmi_intf *intf)
{
rc = IME_SUCCESS;
printf("Manufacturer Name : %s\n",
- val2str( (long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
- ipmi_oem_info) );
+ OEM_MFG_STRING(devid->manufacturer_id));
printf("Product ID : %u (0x%02x%02x)\n",
buf2short((uint8_t *)(devid->product_id)),
@@ -251,7 +250,7 @@ static int ImeGetInfo(struct ipmi_intf *intf)
(devid->product_id[1]<<8)+devid->product_id[0],
ipmi_oem_product_info);
- if (product!=NULL)
+ if (product)
{
printf("Product Name : %s\n", product);
}
@@ -357,12 +356,7 @@ static int ImeUpgrade(struct ipmi_intf *intf, char* imageFilename)
rc = ImeImageCtxFromFile(imageFilename, &imgCtx);
- if(
- (rc == IME_ERROR) ||
- (imgCtx.pData == NULL) ||
- (imgCtx.size == 0)
- )
- {
+ if (rc == IME_ERROR || !imgCtx.pData || !imgCtx.size) {
return IME_ERROR;
}
@@ -510,11 +504,11 @@ static int ImeUpdatePrepare(struct ipmi_intf *intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "UpdatePrepare command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "UpdatePrepare command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -545,11 +539,11 @@ static int ImeUpdateOpenArea(struct ipmi_intf *intf)
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "UpdateOpenArea command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "UpdateOpenArea command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -585,11 +579,11 @@ static int ImeUpdateWriteArea(
req.msg.data_len = length + 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "UpdateWriteArea command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "UpdateWriteArea command failed: %s",
val2str(rsp->ccode, completion_code_vals));
if( rsp->ccode == 0x80) // restart operation
@@ -632,11 +626,11 @@ static int ImeUpdateCloseArea(
req.msg.data_len = length;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "UpdateCloseArea command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "UpdateCloseArea command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -666,11 +660,11 @@ static int ImeUpdateGetStatus(struct ipmi_intf *intf, tImeStatus *pStatus )
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "UpdatePrepare command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "UpdatePrepare command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -739,11 +733,11 @@ static int ImeUpdateGetCapabilities(struct ipmi_intf *intf, tImeCaps *pCaps )
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "UpdatePrepare command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "UpdatePrepare command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -779,11 +773,11 @@ static int ImeUpdateRegisterUpdate(struct ipmi_intf *intf, tImeUpdateType type)
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "ImeUpdateRegisterUpdate command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "ImeUpdateRegisterUpdate command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -810,11 +804,11 @@ static int ImeUpdateShowStatus(struct ipmi_intf *intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "UpdatePrepare command failed");
return IME_ERROR;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "UpdatePrepare command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return IME_ERROR;
@@ -879,15 +873,13 @@ static int ImeImageCtxFromFile(
{
int rc = IME_SUCCESS;
FILE* pImageFile = fopen(imageFilename, "rb");
-
- if ( pImageFile == NULL )
- {
+
+ if (!pImageFile) {
lprintf(LOG_NOTICE,"Cannot open image file %s", imageFilename);
rc = IME_ERROR;
}
-
- if ( rc == IME_SUCCESS )
- {
+
+ if (rc == IME_SUCCESS) {
/* Get the raw data in file */
fseek(pImageFile, 0, SEEK_END);
pImageCtx->size = ftell(pImageFile);
@@ -901,32 +893,26 @@ static int ImeImageCtxFromFile(
pImageCtx->pData = malloc(sizeof(unsigned char)*pImageCtx->size);
rewind(pImageFile);
- if ( pImageCtx->pData != NULL )
- {
- if (pImageCtx->size < fread(pImageCtx->pData, sizeof(unsigned char),
- pImageCtx->size, pImageFile))
- rc = IME_ERROR;
- }
- else
+ if (!pImageCtx->pData
+ || pImageCtx->size < fread(pImageCtx->pData, sizeof(unsigned char),
+ pImageCtx->size, pImageFile))
{
rc = IME_ERROR;
}
}
-
+
// Calculate checksum CRC8
if ( rc == IME_SUCCESS )
{
pImageCtx->crc8 = ImeCrc8(pImageCtx->size, pImageCtx->pData);
}
-
- if( pImageFile != NULL)
- {
+ if (pImageFile) {
fclose(pImageFile);
}
-
+
return rc;
-}
+}
static uint8_t ImeCrc8( uint32_t length, uint8_t * pBuf )
{
@@ -1002,16 +988,13 @@ int ipmi_ime_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_DEBUG,"ipmi_ime_main()");
- if ( (argc == 0) || (strcmp(argv[0], "help") == 0) )
- {
+ if (!argc || !strcmp(argv[0], "help")) {
ImePrintUsage();
}
- else if ( (argc == 0) || (strcmp(argv[0], "info") == 0) )
- {
+ else if (!strcmp(argv[0], "info")) {
rc = ImeGetInfo(intf);
}
- else if ( strcmp(argv[0], "update") == 0)
- {
+ else if (!strcmp(argv[0], "update")) {
if(argc == 2)
{
lprintf(LOG_NOTICE,"Update using file: %s", argv[1]);
@@ -1023,8 +1006,7 @@ int ipmi_ime_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = IME_ERROR;
}
}
- else if ( (argc == 0) || (strcmp(argv[0], "rollback") == 0) )
- {
+ else if (!strcmp(argv[0], "rollback")) {
rc = ImeManualRollback(intf);
}
else
diff --git a/lib/ipmi_isol.c b/lib/ipmi_isol.c
index bc0b08b..1c2708f 100644
--- a/lib/ipmi_isol.c
+++ b/lib/ipmi_isol.c
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE
#include <stdlib.h>
#include <string.h>
@@ -84,7 +83,7 @@ static int ipmi_get_isol_info(struct ipmi_intf * intf,
data[3] = 0x00; /* selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in Get ISOL Config Command");
return -1;
}
@@ -92,7 +91,7 @@ static int ipmi_get_isol_info(struct ipmi_intf * intf,
lprintf(LOG_ERR, "IPMI v1.5 Serial Over Lan (ISOL) not supported!");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error in Get ISOL Config Command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -108,11 +107,11 @@ static int ipmi_get_isol_info(struct ipmi_intf * intf,
data[3] = 0x00; /* selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in Get ISOL Config Command");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error in Get ISOL Config Command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -128,11 +127,11 @@ static int ipmi_get_isol_info(struct ipmi_intf * intf,
data[3] = 0x00; /* selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error in Get ISOL Config Command");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error in Get ISOL Config Command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -193,12 +192,12 @@ static int ipmi_isol_set_param(struct ipmi_intf * intf,
/*
* enabled
*/
- if (strcmp(param, "enabled") == 0)
+ if (!strcmp(param, "enabled"))
{
data[1] = ISOL_ENABLE_PARAM;
- if (strcmp(value, "true") == 0)
+ if (!strcmp(value, "true"))
data[2] = 0x01;
- else if (strcmp(value, "false") == 0)
+ else if (!strcmp(value, "false"))
data[2] = 0x00;
else {
lprintf(LOG_ERR, "Invalid value %s for parameter %s",
@@ -211,7 +210,7 @@ static int ipmi_isol_set_param(struct ipmi_intf * intf,
/*
* privilege-level
*/
- else if (strcmp(param, "privilege-level") == 0)
+ else if (!strcmp(param, "privilege-level"))
{
data[1] = ISOL_AUTHENTICATION_PARAM;
if (! strcmp(value, "user"))
@@ -236,22 +235,22 @@ static int ipmi_isol_set_param(struct ipmi_intf * intf,
/*
* bit-rate
*/
- else if (strcmp(param, "bit-rate") == 0)
+ else if (!strcmp(param, "bit-rate"))
{
data[1] = ISOL_BAUD_RATE_PARAM;
- if (strncmp(value, "9.6", 3) == 0) {
+ if (!strcmp(value, "9.6")) {
data[2] = 0x06;
}
- else if (strncmp(value, "19.2", 4) == 0) {
+ else if (!strcmp(value, "19.2")) {
data[2] = 0x07;
}
- else if (strncmp(value, "38.4", 4) == 0) {
+ else if (!strcmp(value, "38.4")) {
data[2] = 0x08;
}
- else if (strncmp(value, "57.6", 4) == 0) {
+ else if (!strcmp(value, "57.6")) {
data[2] = 0x09;
}
- else if (strncmp(value, "115.2", 5) == 0) {
+ else if (!strcmp(value, "115.2")) {
data[2] = 0x0A;
}
else {
@@ -272,11 +271,11 @@ static int ipmi_isol_set_param(struct ipmi_intf * intf,
*/
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error setting ISOL parameter '%s'", param);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error setting ISOL parameter '%s': %s",
param, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -429,11 +428,11 @@ ipmi_isol_deactivate(struct ipmi_intf * intf)
data[5] = 0x00;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error deactivating ISOL");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error deactivating ISOL: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -573,7 +572,7 @@ ipmi_isol_red_pill(struct ipmi_intf * intf)
int timedout = 0;
buffer = (char*)malloc(buffer_size);
- if (buffer == NULL) {
+ if (!buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -791,20 +790,20 @@ int ipmi_isol_main(struct ipmi_intf * intf, int argc, char ** argv)
/*
* Help
*/
- if (!argc || !strncmp(argv[0], "help", 4))
+ if (!argc || !strcmp(argv[0], "help"))
print_isol_usage();
/*
* Info
*/
- else if (!strncmp(argv[0], "info", 4)) {
+ else if (!strcmp(argv[0], "info")) {
ret = ipmi_print_isol_info(intf);
}
/*
* Set a parameter value
*/
- else if (!strncmp(argv[0], "set", 3)) {
+ else if (!strcmp(argv[0], "set")) {
if (argc < 3) {
print_isol_set_usage();
return -1;
@@ -815,7 +814,7 @@ int ipmi_isol_main(struct ipmi_intf * intf, int argc, char ** argv)
/*
* Activate
*/
- else if (!strncmp(argv[0], "activate", 8)) {
+ else if (!strcmp(argv[0], "activate")) {
ret = ipmi_isol_activate(intf);
}
diff --git a/lib/ipmi_kontronoem.c b/lib/ipmi_kontronoem.c
index 64860be..16e6014 100644
--- a/lib/ipmi_kontronoem.c
+++ b/lib/ipmi_kontronoem.c
@@ -60,8 +60,7 @@ static void ipmi_kontron_help(void);
static int ipmi_kontron_set_serial_number(struct ipmi_intf *intf);
static int ipmi_kontron_set_mfg_date (struct ipmi_intf *intf);
static void ipmi_kontron_nextboot_help(void);
-static int ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc,
- char **argv);
+static int ipmi_kontron_nextboot_set(struct ipmi_intf *intf, char **argv);
static int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf *intf,
unsigned char channel, unsigned char size);
@@ -76,38 +75,38 @@ ipmi_kontronoem_main(struct ipmi_intf *intf, int argc, char **argv)
ipmi_kontron_help();
return (-1);
}
- if (strncmp(argv[0], "help", 4) == 0) {
+ if (!strcmp(argv[0], "help")) {
ipmi_kontron_help();
rc = 0;
- } else if (!strncmp(argv[0], "setsn", 5)) {
+ } else if (!strcmp(argv[0], "setsn")) {
if (argc < 1) {
printf("fru setsn\n");
return (-1);
}
if (ipmi_kontron_set_serial_number(intf) > 0) {
- printf("FRU serial number setted successfully\n");
+ printf("FRU serial number set successfully\n");
} else {
printf("FRU serial number set failed\n");
rc = (-1);
}
- } else if (!strncmp(argv[0], "setmfgdate", 10)) {
+ } else if (!strcmp(argv[0], "setmfgdate")) {
if (argc < 1) {
printf("fru setmfgdate\n");
return (-1);
}
if (ipmi_kontron_set_mfg_date(intf) > 0) {
- printf("FRU manufacturing date setted successfully\n");
+ printf("FRU manufacturing date set successfully\n");
} else {
printf("FRU manufacturing date set failed\n");
rc = (-1);
}
- } else if (!strncmp(argv[0], "nextboot", 8)) {
+ } else if (!strcmp(argv[0], "nextboot")) {
if (argc < 2) {
lprintf(LOG_ERR, "Not enough parameters given.");
ipmi_kontron_nextboot_help();
return (-1);
}
- rc = ipmi_kontron_nextboot_set(intf, (argc - 1), (argv + 1));
+ rc = ipmi_kontron_nextboot_set(intf, (argv + 1));
if (rc == 0) {
printf("Nextboot set successfully\n");
} else {
@@ -188,10 +187,10 @@ ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf *intf,
req.msg.data_len = 2;
req.msg.lun = 0x00;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf("Cannot send large buffer command\n");
return(-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf("Invalid length for the selected interface (%s) %d\n",
val2str(rsp->ccode, completion_code_vals), rsp->ccode);
return(-1);
@@ -243,16 +242,16 @@ ipmi_kontron_set_serial_number(struct ipmi_intf *intf)
/* Set Lun, necessary for this oem command */
req.msg.lun = 0x03;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return (-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf(" This option is not implemented for this board\n");
return (-1);
}
sn_size = rsp->data_len;
sn = malloc(sn_size + 1);
- if (sn == NULL) {
+ if (!sn) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (-1);
}
@@ -269,12 +268,12 @@ ipmi_kontron_set_serial_number(struct ipmi_intf *intf)
req.msg.data = msg_data;
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
free(sn);
sn = NULL;
return (-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
free(sn);
@@ -302,12 +301,12 @@ ipmi_kontron_set_serial_number(struct ipmi_intf *intf)
req.msg.data = msg_data;
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
free(sn);
sn = NULL;
return (-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
free(sn);
@@ -328,7 +327,7 @@ ipmi_kontron_set_serial_number(struct ipmi_intf *intf)
/* Set the Board Section */
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
fru_data = malloc(fru.size);
- if (fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
free(sn);
sn = NULL;
@@ -346,20 +345,20 @@ ipmi_kontron_set_serial_number(struct ipmi_intf *intf)
/* Position at Board Manufacturer */
fru_data_offset = (header.offset.board * 8) + 6;
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
- if (fru_area != NULL) {
+ if (fru_area) {
free(fru_area);
fru_area = NULL;
}
/* Position at Board Product Name */
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
- if (fru_area != NULL) {
+ if (fru_area) {
free(fru_area);
fru_area = NULL;
}
fru_data_offset_tmp = fru_data_offset;
/* Position at Serial Number */
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
- if (fru_area == NULL) {
+ if (!fru_area) {
lprintf(LOG_ERR, "Failed to read FRU Area string.");
free(fru_data);
fru_data = NULL;
@@ -420,32 +419,32 @@ ipmi_kontron_set_serial_number(struct ipmi_intf *intf)
/* Position at Product Manufacturer */
fru_data_offset = (header.offset.product * 8) + 3;
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
- if (fru_area != NULL) {
+ if (fru_area) {
free(fru_area);
fru_area = NULL;
}
/* Position at Product Name */
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
- if (fru_area != NULL) {
+ if (fru_area) {
free(fru_area);
fru_area = NULL;
}
/* Position at Product Part */
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
- if (fru_area != NULL) {
+ if (fru_area) {
free(fru_area);
fru_area = NULL;
}
/* Position at Product Version */
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
- if (fru_area != NULL) {
+ if (fru_area) {
free(fru_area);
fru_area = NULL;
}
fru_data_offset_tmp = fru_data_offset;
/* Position at Serial Number */
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
- if (fru_area == NULL) {
+ if (!fru_area) {
lprintf(LOG_ERR, "Failed to read FRU Area string.");
free(sn);
sn = NULL;
@@ -532,10 +531,10 @@ ipmi_kontron_set_mfg_date (struct ipmi_intf *intf)
/* Set Lun temporary, necessary for this oem command */
req.msg.lun = 0x03;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf("Device not present (No Response)\n");
return(-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf("This option is not implemented for this board\n");
return(-1);
}
@@ -554,10 +553,10 @@ ipmi_kontron_set_mfg_date (struct ipmi_intf *intf)
req.msg.data = msg_data;
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return(-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return(-1);
@@ -582,10 +581,10 @@ ipmi_kontron_set_mfg_date (struct ipmi_intf *intf)
req.msg.data = msg_data;
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf(" Device not present (No Response)\n");
return (-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return (-1);
@@ -601,7 +600,7 @@ ipmi_kontron_set_mfg_date (struct ipmi_intf *intf)
}
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
fru_data = malloc(fru.size);
- if(fru_data == NULL) {
+ if (!fru_data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return(-1);
}
@@ -656,7 +655,7 @@ ipmi_kontron_nextboot_help(void)
* returns 1 if successful
*/
static int
-ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc, char **argv)
+ipmi_kontron_nextboot_set(struct ipmi_intf *intf, char **argv)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
@@ -672,7 +671,7 @@ ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc, char **argv)
msg_data[5] = 0xFF;
msg_data[6] = 0xFF; /* any */
for (i = 0; bootdev[i] != 0; i++) {
- if (strcmp(argv[0], bootdev[i]) == 0) {
+ if (!strcmp(argv[0], bootdev[i])) {
msg_data[5] = i;
break;
}
@@ -690,10 +689,10 @@ ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc, char **argv)
/* Set Lun temporary, necessary for this oem command */
req.msg.lun = 0x03;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf("Device not present (No Response)\n");
return(-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
printf("Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return (-1);
diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c
index ecd313a..16c0d9a 100644
--- a/lib/ipmi_lanp.c
+++ b/lib/ipmi_lanp.c
@@ -57,6 +57,62 @@
extern int verbose;
+static struct lan_param {
+ int cmd;
+ int size;
+ char desc[24];
+ uint8_t *data;
+ int data_len;
+} ipmi_lan_params[] = {
+ { IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress", NULL, 0 },
+ { IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support", NULL, 0 },
+ { IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable", NULL, 0 },
+ { IPMI_LANP_IP_ADDR, 4, "IP Address", NULL, 0 },
+ { IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source", NULL, 0 },
+ { IPMI_LANP_MAC_ADDR, 6, "MAC Address", NULL, 0 }, /* 5 */
+ { IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask", NULL, 0 },
+ { IPMI_LANP_IP_HEADER, 3, "IP Header", NULL, 0 },
+ { IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port", NULL, 0 },
+ { IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port", NULL, 0 },
+ { IPMI_LANP_BMC_ARP, 1, "BMC ARP Control", NULL, 0}, /* 10 */
+ { IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl", NULL, 0 },
+ { IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP", NULL, 0 },
+ { IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC", NULL, 0 },
+ { IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP", NULL, 0 },
+ { IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC", NULL, 0 }, /* 15 */
+ { IPMI_LANP_SNMP_STRING, 18, "SNMP Community String", NULL, 0 },
+ { IPMI_LANP_NUM_DEST, 1, "Number of Destinations", NULL, 0 },
+ { IPMI_LANP_DEST_TYPE, 4, "Destination Type", NULL, 0 },
+ { IPMI_LANP_DEST_ADDR, 13, "Destination Addresses", NULL, 0 },
+ { IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID", NULL, 0 }, /* 20 */
+ { IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority", NULL, 0 },
+ { IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count", NULL, 0 },
+ { IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites", NULL, 0 },
+ { IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max", NULL, 0 },
+ { IPMI_LANP_BAD_PASS_THRESH, 6, "Bad Password Threshold", NULL, 0 },
+ { IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String", NULL, 0 }, /* 25 */
+ { IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm", NULL, 0 },
+ { IPMI_LANP_UTC_OFFSET, 3, "UTC Offset", NULL, 0 },
+ { IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP", NULL, 0 },
+ { IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC", NULL, 0},
+ { IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable", NULL, 0 }, /* 30 */
+ { IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode", NULL, 0 },
+ { -1, -1, "", NULL, -1 }
+};
+
+static const struct valstr set_lan_cc_vals[] = {
+ { 0x80, "Unsupported parameter" },
+ { 0x81, "Attempt to set 'in progress' while not in 'complete' state" },
+ { 0x82, "Parameter is read-only" },
+ { 0x83, "Parameter is wrote-only" },
+ { 0x00, NULL }
+};
+
+static const struct valstr get_lan_cc_vals[] = {
+ { 0x80, "Unsupported parameter" },
+ { 0x00, NULL }
+};
+
static void print_lan_alert_print_usage(void);
static void print_lan_alert_set_usage(void);
static void print_lan_set_usage(void);
@@ -80,7 +136,7 @@ static void print_lan_usage(void);
* @chan: channel number to check
*/
static int
-is_lan_channel(struct ipmi_intf * intf, uint8_t chan)
+is_lan_channel(struct ipmi_intf *intf, uint8_t chan)
{
uint8_t medium;
@@ -104,8 +160,8 @@ is_lan_channel(struct ipmi_intf * intf, uint8_t chan)
* @intf: ipmi interface handle
* @start: channel number to start searching from
*/
-static uint8_t
-find_lan_channel(struct ipmi_intf * intf, uint8_t start)
+uint8_t
+find_lan_channel(struct ipmi_intf *intf, uint8_t start)
{
uint8_t chan = 0;
@@ -131,10 +187,11 @@ find_lan_channel(struct ipmi_intf * intf, uint8_t start)
* @select: lan parameter set selector
*/
static struct lan_param *
-get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int select)
+get_lan_param_select(struct ipmi_intf *intf, uint8_t chan, int param, int select)
{
- struct lan_param * p = NULL;
- struct ipmi_rs * rsp;
+ struct lan_param *p = NULL;
+ struct lan_param *rc = NULL;
+ struct ipmi_rs *rsp;
struct ipmi_rq req;
int i = 0;
uint8_t msg_data[4];
@@ -146,9 +203,9 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
}
}
- if (p == NULL) {
+ if (!p) {
lprintf(LOG_INFO, "Get LAN Parameter failed: Unknown parameter.");
- return NULL;
+ return rc;
}
msg_data[0] = chan;
@@ -163,9 +220,9 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed", p->desc);
- return NULL;
+ return rc;
}
switch (rsp->ccode)
@@ -176,19 +233,18 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
case 0x80: /* parameter not supported */
case 0xc9: /* parameter out of range */
case 0xcc: /* invalid data field in request */
-
- /* these completion codes usually mean parameter not supported */
- lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed: %s",
- p->desc, val2str(rsp->ccode, completion_code_vals));
+ /* We treat them as valid but empty response */
p->data = NULL;
p->data_len = 0;
- return p;
-
+ rc = p;
+ /* fall through */
default:
-
/* other completion codes are treated as error */
lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed: %s",
- p->desc, val2str(rsp->ccode, completion_code_vals));
+ p->desc,
+ specific_val2str(rsp->ccode,
+ get_lan_cc_vals,
+ completion_code_vals));
return NULL;
}
@@ -211,7 +267,7 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
* @param: lan parameter id
*/
static struct lan_param *
-get_lan_param(struct ipmi_intf * intf, uint8_t chan, int param)
+get_lan_param(struct ipmi_intf *intf, uint8_t chan, int param)
{
return get_lan_param_select(intf, chan, param, 0);
}
@@ -232,10 +288,10 @@ get_lan_param(struct ipmi_intf * intf, uint8_t chan, int param)
* @len: length of lan parameter data
*/
static int
-set_lan_param_wait(struct ipmi_intf * intf, uint8_t chan,
- int param, uint8_t * data, int len)
+set_lan_param_wait(struct ipmi_intf *intf, uint8_t chan,
+ int param, uint8_t *data, int len)
{
- struct lan_param * p;
+ struct lan_param *p;
int retry = 10; /* 10 retries */
lprintf(LOG_DEBUG, "Waiting for Set LAN Parameter to complete...");
@@ -244,7 +300,7 @@ set_lan_param_wait(struct ipmi_intf * intf, uint8_t chan,
for (;;) {
p = get_lan_param(intf, chan, param);
- if (p == NULL) {
+ if (!p) {
sleep(IPMI_LANP_TIMEOUT);
if (retry-- == 0)
return -1;
@@ -291,10 +347,10 @@ set_lan_param_wait(struct ipmi_intf * intf, uint8_t chan,
* @wait: whether to wait for write completion
*/
static int
-__set_lan_param(struct ipmi_intf * intf, uint8_t chan,
- int param, uint8_t * data, int len, int wait)
+__set_lan_param(struct ipmi_intf *intf, uint8_t chan,
+ int param, uint8_t *data, int len, int wait)
{
- struct ipmi_rs * rsp;
+ struct ipmi_rs *rsp;
struct ipmi_rq req;
uint8_t msg_data[32];
@@ -312,13 +368,15 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
req.msg.data_len = len+2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set LAN Parameter failed");
return -1;
}
- if ((rsp->ccode > 0) && (wait != 0)) {
+ if (rsp->ccode && wait) {
lprintf(LOG_DEBUG, "Warning: Set LAN Parameter failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ specific_val2str(rsp->ccode,
+ set_lan_cc_vals,
+ completion_code_vals));
if (rsp->ccode == 0xcc) {
/* retry hack for invalid data field ccode */
int retry = 10; /* 10 retries */
@@ -328,9 +386,7 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
break;
sleep(IPMI_LANP_TIMEOUT);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL)
- continue;
- if (rsp->ccode > 0)
+ if (!rsp || rsp->ccode)
continue;
return set_lan_param_wait(intf, chan, param, data, len);
}
@@ -341,7 +397,7 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
}
}
- if (wait == 0)
+ if (!wait)
return 0;
return set_lan_param_wait(intf, chan, param, data, len);
}
@@ -358,13 +414,13 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
* @chan: ipmi channel
*/
static int
-ipmi_lanp_lock_state(struct ipmi_intf * intf, uint8_t chan)
+ipmi_lanp_lock_state(struct ipmi_intf *intf, uint8_t chan)
{
- struct lan_param * p;
+ struct lan_param *p;
p = get_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data == NULL)
+ if (!p->data)
return -1;
return (p->data[0] & 3);
}
@@ -381,7 +437,7 @@ ipmi_lanp_lock_state(struct ipmi_intf * intf, uint8_t chan)
* @chan: ipmi channel
*/
static void
-ipmi_lanp_lock(struct ipmi_intf * intf, uint8_t chan)
+ipmi_lanp_lock(struct ipmi_intf *intf, uint8_t chan)
{
uint8_t val = IPMI_LANP_WRITE_LOCK;
int retry = 3;
@@ -411,7 +467,7 @@ ipmi_lanp_lock(struct ipmi_intf * intf, uint8_t chan)
* @chan: ipmi channel
*/
static void
-ipmi_lanp_unlock(struct ipmi_intf * intf, uint8_t chan)
+ipmi_lanp_unlock(struct ipmi_intf *intf, uint8_t chan)
{
uint8_t val = IPMI_LANP_WRITE_COMMIT;
int rc;
@@ -436,8 +492,8 @@ ipmi_lanp_unlock(struct ipmi_intf * intf, uint8_t chan)
* @len: length of lan parameter data
*/
static int
-set_lan_param(struct ipmi_intf * intf, uint8_t chan,
- int param, uint8_t * data, int len)
+set_lan_param(struct ipmi_intf *intf, uint8_t chan,
+ int param, uint8_t *data, int len)
{
int rc;
ipmi_lanp_lock(intf, chan);
@@ -457,8 +513,8 @@ set_lan_param(struct ipmi_intf * intf, uint8_t chan,
* @len: length of lan parameter data
*/
static int
-set_lan_param_nowait(struct ipmi_intf * intf, uint8_t chan,
- int param, uint8_t * data, int len)
+set_lan_param_nowait(struct ipmi_intf *intf, uint8_t chan,
+ int param, uint8_t *data, int len)
{
int rc;
ipmi_lanp_lock(intf, chan);
@@ -468,16 +524,16 @@ set_lan_param_nowait(struct ipmi_intf * intf, uint8_t chan,
}
static int
-lan_set_arp_interval(struct ipmi_intf * intf, uint8_t chan, uint8_t ival)
+lan_set_arp_interval(struct ipmi_intf *intf, uint8_t chan, uint8_t ival)
{
struct lan_param *lp;
uint8_t interval = 0;
int rc = 0;
lp = get_lan_param(intf, chan, IPMI_LANP_GRAT_ARP);
- if (lp == NULL)
+ if (!lp)
return -1;
- if (lp->data == NULL)
+ if (!lp->data)
return -1;
if (ival != 0) {
@@ -498,16 +554,16 @@ lan_set_arp_interval(struct ipmi_intf * intf, uint8_t chan, uint8_t ival)
}
static int
-lan_set_arp_generate(struct ipmi_intf * intf,
+lan_set_arp_generate(struct ipmi_intf *intf,
uint8_t chan, uint8_t ctl)
{
struct lan_param *lp;
uint8_t data;
lp = get_lan_param(intf, chan, IPMI_LANP_BMC_ARP);
- if (lp == NULL)
+ if (!lp)
return -1;
- if (lp->data == NULL)
+ if (!lp->data)
return -1;
data = lp->data[0];
@@ -522,16 +578,16 @@ lan_set_arp_generate(struct ipmi_intf * intf,
}
static int
-lan_set_arp_respond(struct ipmi_intf * intf,
+lan_set_arp_respond(struct ipmi_intf *intf,
uint8_t chan, uint8_t ctl)
{
struct lan_param *lp;
uint8_t data;
lp = get_lan_param(intf, chan, IPMI_LANP_BMC_ARP);
- if (lp == NULL)
+ if (!lp)
return -1;
- if (lp->data == NULL)
+ if (!lp->data)
return -1;
data = lp->data[0];
@@ -574,9 +630,9 @@ static char priv_level_to_char(unsigned char priv_level)
static int
-ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
+ipmi_lan_print(struct ipmi_intf *intf, uint8_t chan)
{
- struct lan_param * p;
+ struct lan_param *p;
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX) {
lprintf(LOG_ERR, "Invalid Channel %d", chan);
@@ -590,9 +646,9 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
}
p = get_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL) {
+ if (p->data) {
printf("%-24s: ", p->desc);
p->data[0] &= 3;
switch (p->data[0]) {
@@ -614,9 +670,9 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
}
p = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL) {
+ if (p->data) {
printf("%-24s: %s%s%s%s%s\n", p->desc,
(p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "",
(p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "",
@@ -626,9 +682,9 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
}
p = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE_ENABLE);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL) {
+ if (p->data) {
printf("%-24s: Callback : %s%s%s%s%s\n", p->desc,
(p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_NONE) ? "NONE " : "",
(p->data[0] & 1<<IPMI_SESSION_AUTHTYPE_MD2) ? "MD2 " : "",
@@ -662,9 +718,9 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
}
p = get_lan_param(intf, chan, IPMI_LANP_IP_ADDR_SRC);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL) {
+ if (p->data) {
printf("%-24s: ", p->desc);
p->data[0] &= 0xf;
switch (p->data[0]) {
@@ -687,82 +743,79 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
}
p = get_lan_param(intf, chan, IPMI_LANP_IP_ADDR);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: %d.%d.%d.%d\n", p->desc,
p->data[0], p->data[1], p->data[2], p->data[3]);
p = get_lan_param(intf, chan, IPMI_LANP_SUBNET_MASK);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: %d.%d.%d.%d\n", p->desc,
p->data[0], p->data[1], p->data[2], p->data[3]);
p = get_lan_param(intf, chan, IPMI_LANP_MAC_ADDR);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
- printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
- p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
+ if (p->data)
+ printf("%-24s: %s\n", p->desc, mac2str(p->data));
p = get_lan_param(intf, chan, IPMI_LANP_SNMP_STRING);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: %s\n", p->desc, p->data);
p = get_lan_param(intf, chan, IPMI_LANP_IP_HEADER);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: TTL=0x%02x Flags=0x%02x Precedence=0x%02x TOS=0x%02x\n",
p->desc, p->data[0], p->data[1] & 0xe0, p->data[2] & 0xe0, p->data[2] & 0x1e);
p = get_lan_param(intf, chan, IPMI_LANP_BMC_ARP);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: ARP Responses %sabled, Gratuitous ARP %sabled\n", p->desc,
(p->data[0] & 2) ? "En" : "Dis", (p->data[0] & 1) ? "En" : "Dis");
p = get_lan_param(intf, chan, IPMI_LANP_GRAT_ARP);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: %.1f seconds\n", p->desc, (float)((p->data[0] + 1) / 2));
p = get_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_IP);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: %d.%d.%d.%d\n", p->desc,
p->data[0], p->data[1], p->data[2], p->data[3]);
p = get_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_MAC);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
- printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
- p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
+ if (p->data)
+ printf("%-24s: %s\n", p->desc, mac2str(p->data));
p = get_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_IP);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
+ if (p->data)
printf("%-24s: %d.%d.%d.%d\n", p->desc,
p->data[0], p->data[1], p->data[2], p->data[3]);
p = get_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_MAC);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data != NULL)
- printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
- p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
+ if (p->data)
+ printf("%-24s: %s\n", p->desc, mac2str(p->data));
p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
- if (p != NULL && p->data != NULL) {
+ if (p && p->data) {
int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
if (p->data[1] & 0x80)
printf("%-24s: %d\n", p->desc, id);
@@ -771,25 +824,25 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
}
p = get_lan_param(intf, chan, IPMI_LANP_VLAN_PRIORITY);
- if (p != NULL && p->data != NULL)
+ if (p && p->data)
printf("%-24s: %d\n", p->desc, p->data[0] & 0x07);
/* Determine supported Cipher Suites -- Requires two calls */
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHER_SUPPORT);
- if (p == NULL)
+ if (!p)
return -1;
- else if (p->data != NULL)
+ else if (p->data)
{
unsigned char cipher_suite_count = p->data[0];
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHERS);
- if (p == NULL)
+ if (!p)
return -1;
printf("%-24s: ", p->desc);
/* Now we're dangerous. There are only 15 fixed cipher
suite IDs, but the spec allows for 16 in the return data.*/
- if ((p->data != NULL) && (p->data_len <= 17))
+ if (p->data && p->data_len <= 17)
{
unsigned int i;
for (i = 0; (i < 16) && (i < cipher_suite_count); ++i)
@@ -809,9 +862,9 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
/* RMCP+ Messaging Cipher Suite Privilege Levels */
/* These are the privilege levels for the 15 fixed cipher suites */
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_PRIV_LEVELS);
- if (p == NULL)
+ if (!p)
return -1;
- if ((p->data != NULL) && (p->data_len == 9))
+ if (p->data && 9 == p->data_len)
{
printf("%-24s: %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n", p->desc,
priv_level_to_char(p->data[1] & 0x0F),
@@ -843,9 +896,9 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
/* Bad Password Threshold */
p = get_lan_param(intf, chan, IPMI_LANP_BAD_PASS_THRESH);
- if (p == NULL)
+ if (!p)
return -1;
- if ((p->data != NULL) && (p->data_len == 6)) {
+ if (p->data && 6 == p->data_len) {
int tmp;
printf("%-24s: %d\n", p->desc, p->data[1]);
@@ -865,20 +918,20 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
/* Configure Authentication Types */
/* TODO - probably some code duplication going on ??? */
static int
-ipmi_lan_set_auth(struct ipmi_intf * intf, uint8_t chan, char * level, char * types)
+ipmi_lan_set_auth(struct ipmi_intf *intf, uint8_t chan, char *level, char *types)
{
uint8_t data[5];
uint8_t authtype = 0;
- char * p;
- struct lan_param * lp;
+ char *p;
+ struct lan_param *lp;
- if (level == NULL || types == NULL)
+ if (!level || !types)
return -1;
lp = get_lan_param(intf, chan, IPMI_LANP_AUTH_TYPE_ENABLE);
- if (lp == NULL)
+ if (!lp)
return -1;
- if (lp->data == NULL)
+ if (!lp->data)
return -1;
lprintf(LOG_DEBUG, "%-24s: callback=0x%02x user=0x%02x operator=0x%02x admin=0x%02x oem=0x%02x",
@@ -889,16 +942,16 @@ ipmi_lan_set_auth(struct ipmi_intf * intf, uint8_t chan, char * level, char * ty
p = types;
while (p) {
- if (strncasecmp(p, "none", 4) == 0)
+ if (strcasecmp(p, "none") == 0)
authtype |= 1 << IPMI_SESSION_AUTHTYPE_NONE;
- else if (strncasecmp(p, "md2", 3) == 0)
+ else if (strcasecmp(p, "md2") == 0)
authtype |= 1 << IPMI_SESSION_AUTHTYPE_MD2;
- else if (strncasecmp(p, "md5", 3) == 0)
+ else if (strcasecmp(p, "md5") == 0)
authtype |= 1 << IPMI_SESSION_AUTHTYPE_MD5;
- else if ((strncasecmp(p, "password", 8) == 0) ||
- (strncasecmp(p, "key", 3) == 0))
+ else if ((strcasecmp(p, "password") == 0) ||
+ (strcasecmp(p, "key") == 0))
authtype |= 1 << IPMI_SESSION_AUTHTYPE_KEY;
- else if (strncasecmp(p, "oem", 3) == 0)
+ else if (strcasecmp(p, "oem") == 0)
authtype |= 1 << IPMI_SESSION_AUTHTYPE_OEM;
else
lprintf(LOG_WARNING, "Invalid authentication type: %s", p);
@@ -909,13 +962,13 @@ ipmi_lan_set_auth(struct ipmi_intf * intf, uint8_t chan, char * level, char * ty
p = level;
while (p) {
- if (strncasecmp(p, "callback", 8) == 0)
+ if (strcasecmp(p, "callback") == 0)
data[0] = authtype;
- else if (strncasecmp(p, "user", 4) == 0)
+ else if (strcasecmp(p, "user") == 0)
data[1] = authtype;
- else if (strncasecmp(p, "operator", 8) == 0)
+ else if (strcasecmp(p, "operator") == 0)
data[2] = authtype;
- else if (strncasecmp(p, "admin", 5) == 0)
+ else if (strcasecmp(p, "admin") == 0)
data[3] = authtype;
else
lprintf(LOG_WARNING, "Invalid authentication level: %s", p);
@@ -947,7 +1000,7 @@ ipmi_lan_set_password(struct ipmi_intf *intf,
*/
ipmi_intf_session_set_password(intf, (char *)password);
printf("Password %s for user %d\n",
- (password == NULL) ? "cleared" : "set", user_id);
+ password ? "set" : "cleared", user_id);
return 0;
}
@@ -1103,46 +1156,10 @@ ipmi_set_user_access(struct ipmi_intf *intf, uint8_t channel, uint8_t user_id)
}
}
-/* get_cmdline_macaddr - parse-out MAC address from given string and store it
- * into buffer.
- *
- * @arg: string to be parsed.
- * @buf: buffer of 6 to hold parsed MAC address.
- *
- * returns zero on success, (-1) on error and error message is printed-out.
- */
-static int
-get_cmdline_macaddr(char *arg, uint8_t *buf)
-{
- uint32_t m1 = 0;
- uint32_t m2 = 0;
- uint32_t m3 = 0;
- uint32_t m4 = 0;
- uint32_t m5 = 0;
- uint32_t m6 = 0;
- if (sscanf(arg, "%02x:%02x:%02x:%02x:%02x:%02x",
- &m1, &m2, &m3, &m4, &m5, &m6) != 6) {
- lprintf(LOG_ERR, "Invalid MAC address: %s", arg);
- return -1;
- }
- if (m1 > UINT8_MAX || m2 > UINT8_MAX
- || m3 > UINT8_MAX || m4 > UINT8_MAX
- || m5 > UINT8_MAX || m6 > UINT8_MAX) {
- lprintf(LOG_ERR, "Invalid MAC address: %s", arg);
- return -1;
- }
- buf[0] = (uint8_t)m1;
- buf[1] = (uint8_t)m2;
- buf[2] = (uint8_t)m3;
- buf[3] = (uint8_t)m4;
- buf[4] = (uint8_t)m5;
- buf[5] = (uint8_t)m6;
- return 0;
-}
static int
-get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
+get_cmdline_cipher_suite_priv_data(char *arg, uint8_t *buf)
{
int i, ret = 0;
@@ -1219,7 +1236,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
static int
-get_cmdline_ipaddr(char * arg, uint8_t * buf)
+get_cmdline_ipaddr(char *arg, uint8_t *buf)
{
uint32_t ip1, ip2, ip3, ip4;
if (sscanf(arg,
@@ -1243,23 +1260,52 @@ get_cmdline_ipaddr(char * arg, uint8_t * buf)
static int
ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
{
+ struct lan_param *p;
uint8_t data[2];
- int rc;
-
- if (string == NULL) {
- data[0] = 0;
- data[1] = 0;
+ int rc = -1;
+
+ if (!string) { /* request to disable VLAN */
+ lprintf(LOG_DEBUG, "Get current VLAN ID from BMC.");
+ p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
+ if (p && p->data && p->data_len > 1) {
+ int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
+ if (IPMI_LANP_VLAN_DISABLE == id) {
+ printf("VLAN is already disabled for channel %"
+ PRIu8 "\n", chan);
+ rc = 0;
+ goto out;
+ }
+ if (!IPMI_LANP_IS_VLAN_VALID(id)) {
+ lprintf(LOG_ERR,
+ "Retrieved VLAN ID %i is out of "
+ "range <%d..%d>.",
+ id,
+ IPMI_LANP_VLAN_ID_MIN,
+ IPMI_LANP_VLAN_ID_MAX);
+ goto out;
+ }
+ data[0] = p->data[0];
+ data[1] = p->data[1] & 0x0F;
+ } else {
+ data[0] = 0;
+ data[1] = 0;
+ }
}
else {
int id = 0;
if (str2int(string, &id) != 0) {
- lprintf(LOG_ERR, "Given VLAN ID '%s' is invalid.", string);
- return (-1);
+ lprintf(LOG_ERR,
+ "Given VLAN ID '%s' is invalid.",
+ string);
+ goto out;
}
- if (id < 1 || id > 4094) {
- lprintf(LOG_NOTICE, "VLAN ID must be between 1 and 4094.");
- return (-1);
+ if (!IPMI_LANP_IS_VLAN_VALID(id)) {
+ lprintf(LOG_NOTICE,
+ "VLAN ID must be between %d and %d.",
+ IPMI_LANP_VLAN_ID_MIN,
+ IPMI_LANP_VLAN_ID_MAX);
+ goto out;
}
else {
data[0] = (uint8_t)id;
@@ -1267,6 +1313,8 @@ ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
}
}
rc = set_lan_param(intf, chan, IPMI_LANP_VLAN_ID, data, 2);
+
+out:
return rc;
}
@@ -1294,8 +1342,8 @@ static void
print_lan_set_bad_pass_thresh_usage(void)
{
lprintf(LOG_NOTICE,
-"lan set <chanel> bad_pass_thresh <thresh_num> <1|0> <reset_interval> <lockout_interval>\n"
-" <thresh_num> Bad Pasword Threshold number.\n"
+"lan set <channel> bad_pass_thresh <thresh_num> <1|0> <reset_interval> <lockout_interval>\n"
+" <thresh_num> Bad Password Threshold number.\n"
" <1|0> 1 = generate a Session Audit sensor event.\n"
" 0 = do not generate an event.\n"
" <reset_interval> Attempt Count Reset Interval. In tens of seconds.\n"
@@ -1340,7 +1388,7 @@ get_cmdline_bad_pass_thresh(char *argv[], uint8_t *buf)
}
static int
-ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_lan_set(struct ipmi_intf *intf, int argc, char **argv)
{
uint8_t data[32];
uint8_t chan;
@@ -1351,8 +1399,9 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
- if (strncmp(argv[0], "help", 4) == 0 ||
- strncmp(argv[1], "help", 4) == 0) {
+ if (!strcmp(argv[0], "help")
+ || !strcmp(argv[1], "help"))
+ {
print_lan_set_usage();
return 0;
}
@@ -1372,23 +1421,23 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
memset(&data, 0, sizeof(data));
/* set user access */
- if (strncmp(argv[1], "user", 4) == 0) {
+ if (!strcmp(argv[1], "user")) {
rc = ipmi_set_user_access(intf, chan, 1);
}
/* set channel access mode */
- else if (strncmp(argv[1], "access", 6) == 0) {
+ else if (!strcmp(argv[1], "access")) {
if (argc < 3) {
print_lan_set_access_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_access_usage();
return 0;
}
- else if (strncmp(argv[2], "on", 2) == 0) {
+ else if (!strcmp(argv[2], "on")) {
rc = ipmi_set_channel_access(intf, chan, 1);
}
- else if (strncmp(argv[2], "off", 3) == 0) {
+ else if (!strcmp(argv[2], "off")) {
rc = ipmi_set_channel_access(intf, chan, 0);
}
else {
@@ -1397,15 +1446,15 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* set ARP control */
- else if (strncmp(argv[1], "arp", 3) == 0) {
+ else if (!strcmp(argv[1], "arp")) {
if (argc < 3) {
print_lan_set_arp_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_arp_usage();
}
- else if (strncmp(argv[2], "interval", 8) == 0) {
+ else if (!strcmp(argv[2], "interval")) {
uint8_t interval = 0;
if (str2uchar(argv[3], &interval) != 0) {
lprintf(LOG_ERR, "Given ARP interval '%s' is invalid.", argv[3]);
@@ -1413,28 +1462,28 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
rc = lan_set_arp_interval(intf, chan, interval);
}
- else if (strncmp(argv[2], "generate", 8) == 0) {
+ else if (!strcmp(argv[2], "generate")) {
if (argc < 4) {
print_lan_set_arp_usage();
return (-1);
}
- else if (strncmp(argv[3], "on", 2) == 0)
+ else if (!strcmp(argv[3], "on"))
rc = lan_set_arp_generate(intf, chan, 1);
- else if (strncmp(argv[3], "off", 3) == 0)
+ else if (!strcmp(argv[3], "off"))
rc = lan_set_arp_generate(intf, chan, 0);
else {
print_lan_set_arp_usage();
return (-1);
}
}
- else if (strncmp(argv[2], "respond", 7) == 0) {
+ else if (!strcmp(argv[2], "respond")) {
if (argc < 4) {
print_lan_set_arp_usage();
return (-1);
}
- else if (strncmp(argv[3], "on", 2) == 0)
+ else if (!strcmp(argv[3], "on"))
rc = lan_set_arp_respond(intf, chan, 1);
- else if (strncmp(argv[3], "off", 3) == 0)
+ else if (!strcmp(argv[3], "off"))
rc = lan_set_arp_respond(intf, chan, 0);
else {
print_lan_set_arp_usage();
@@ -1446,12 +1495,12 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* set authentication types */
- else if (strncmp(argv[1], "auth", 4) == 0) {
+ else if (!strcmp(argv[1], "auth")) {
if (argc < 3) {
print_lan_set_auth_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_auth_usage();
return 0;
} else {
@@ -1459,22 +1508,22 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* ip address source */
- else if (strncmp(argv[1], "ipsrc", 5) == 0) {
+ else if (!strcmp(argv[1], "ipsrc")) {
if (argc < 3) {
print_lan_set_ipsrc_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_ipsrc_usage();
return 0;
}
- else if (strncmp(argv[2], "none", 4) == 0)
+ else if (!strcmp(argv[2], "none"))
data[0] = 0;
- else if (strncmp(argv[2], "static", 5) == 0)
+ else if (!strcmp(argv[2], "static"))
data[0] = 1;
- else if (strncmp(argv[2], "dhcp", 4) == 0)
+ else if (!strcmp(argv[2], "dhcp"))
data[0] = 2;
- else if (strncmp(argv[2], "bios", 4) == 0)
+ else if (!strcmp(argv[2], "bios"))
data[0] = 3;
else {
print_lan_set_ipsrc_usage();
@@ -1484,16 +1533,16 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
/* session password
* not strictly a lan setting, but its used for lan connections */
- else if (strncmp(argv[1], "password", 8) == 0) {
+ else if (!strcmp(argv[1], "password")) {
rc = ipmi_lan_set_password(intf, 1, argv[2]);
}
/* snmp community string */
- else if (strncmp(argv[1], "snmp", 4) == 0) {
+ else if (!strcmp(argv[1], "snmp")) {
if (argc < 3) {
print_lan_set_snmp_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_snmp_usage();
return 0;
} else {
@@ -1504,7 +1553,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* ip address */
- else if (strncmp(argv[1], "ipaddr", 6) == 0) {
+ else if (!strcmp(argv[1], "ipaddr")) {
if(argc != 3)
{
print_lan_set_usage();
@@ -1519,7 +1568,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* network mask */
- else if (strncmp(argv[1], "netmask", 7) == 0) {
+ else if (!strcmp(argv[1], "netmask")) {
if(argc != 3)
{
print_lan_set_usage();
@@ -1534,42 +1583,44 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* mac address */
- else if (strncmp(argv[1], "macaddr", 7) == 0) {
+ else if (!strcmp(argv[1], "macaddr")) {
if(argc != 3)
{
print_lan_set_usage();
return -1;
}
- rc = get_cmdline_macaddr(argv[2], data);
+ rc = str2mac(argv[2], data);
if (rc == 0) {
- printf("Setting LAN %s to %02x:%02x:%02x:%02x:%02x:%02x\n",
- ipmi_lan_params[IPMI_LANP_MAC_ADDR].desc,
- data[0], data[1], data[2], data[3], data[4], data[5]);
+ printf("Setting LAN %s to %s\n",
+ ipmi_lan_params[IPMI_LANP_MAC_ADDR].desc,
+ mac2str(data));
rc = set_lan_param(intf, chan, IPMI_LANP_MAC_ADDR, data, 6);
}
}
/* default gateway settings */
- else if (strncmp(argv[1], "defgw", 5) == 0) {
+ else if (!strcmp(argv[1], "defgw")) {
if (argc < 4) {
print_lan_set_defgw_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_defgw_usage();
return 0;
}
- else if ((strncmp(argv[2], "ipaddr", 5) == 0) &&
- (get_cmdline_ipaddr(argv[3], data) == 0)) {
+ else if (!strcmp(argv[2], "ipaddr")
+ && !get_cmdline_ipaddr(argv[3], data))
+ {
printf("Setting LAN %s to %d.%d.%d.%d\n",
ipmi_lan_params[IPMI_LANP_DEF_GATEWAY_IP].desc,
data[0], data[1], data[2], data[3]);
rc = set_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_IP, data, 4);
}
- else if ((strncmp(argv[2], "macaddr", 7) == 0) &&
- (get_cmdline_macaddr(argv[3], data) == 0)) {
- printf("Setting LAN %s to %02x:%02x:%02x:%02x:%02x:%02x\n",
- ipmi_lan_params[IPMI_LANP_DEF_GATEWAY_MAC].desc,
- data[0], data[1], data[2], data[3], data[4], data[5]);
+ else if (!strcmp(argv[2], "macaddr")
+ && !str2mac(argv[3], data))
+ {
+ printf("Setting LAN %s to %s\n",
+ ipmi_lan_params[IPMI_LANP_DEF_GATEWAY_MAC].desc,
+ mac2str(data));
rc = set_lan_param(intf, chan, IPMI_LANP_DEF_GATEWAY_MAC, data, 6);
}
else {
@@ -1578,27 +1629,28 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* backup gateway settings */
- else if (strncmp(argv[1], "bakgw", 5) == 0) {
+ else if (!strcmp(argv[1], "bakgw")) {
if (argc < 4) {
print_lan_set_bakgw_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_bakgw_usage();
return 0;
}
- else if ((strncmp(argv[2], "ipaddr", 5) == 0) &&
- (get_cmdline_ipaddr(argv[3], data) == 0)) {
+ else if (!strcmp(argv[2], "ipaddr")
+ && !get_cmdline_ipaddr(argv[3], data))
+ {
printf("Setting LAN %s to %d.%d.%d.%d\n",
ipmi_lan_params[IPMI_LANP_BAK_GATEWAY_IP].desc,
data[0], data[1], data[2], data[3]);
rc = set_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_IP, data, 4);
}
- else if ((strncmp(argv[2], "macaddr", 7) == 0) &&
- (get_cmdline_macaddr(argv[3], data) == 0)) {
- printf("Setting LAN %s to %02x:%02x:%02x:%02x:%02x:%02x\n",
- ipmi_lan_params[IPMI_LANP_BAK_GATEWAY_MAC].desc,
- data[0], data[1], data[2], data[3], data[4], data[5]);
+ else if (!strcmp(argv[2], "macaddr")
+ && !str2mac(argv[3], data)) {
+ printf("Setting LAN %s to %s\n",
+ ipmi_lan_params[IPMI_LANP_BAK_GATEWAY_MAC].desc,
+ mac2str(data));
rc = set_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_MAC, data, 6);
}
else {
@@ -1606,24 +1658,24 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
}
- else if (strncasecmp(argv[1], "vlan", 4) == 0) {
+ else if (!strcmp(argv[1], "vlan")) {
if (argc < 4) {
print_lan_set_vlan_usage();
return (-1);
}
- else if (strncmp(argv[2], "help", 4) == 0) {
+ else if (!strcmp(argv[2], "help")) {
print_lan_set_vlan_usage();
return 0;
}
- else if (strncasecmp(argv[2], "id", 2) == 0) {
- if (strncasecmp(argv[3], "off", 3) == 0) {
+ else if (!strcmp(argv[2], "id")) {
+ if (!strcmp(argv[3], "off")) {
ipmi_lan_set_vlan_id(intf, chan, NULL);
}
else {
ipmi_lan_set_vlan_id(intf, chan, argv[3]);
}
}
- else if (strncasecmp(argv[2], "priority", 8) == 0) {
+ else if (!strcmp(argv[2], "priority")) {
ipmi_lan_set_vlan_priority(intf, chan, argv[3]);
}
else {
@@ -1632,18 +1684,18 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* set PEF alerting on or off */
- else if (strncasecmp(argv[1], "alert", 5) == 0) {
+ else if (!strcmp(argv[1], "alert")) {
if (argc < 3) {
lprintf(LOG_NOTICE, "LAN set alert must be 'on' or 'off'");
return (-1);
}
- else if (strncasecmp(argv[2], "on", 2) == 0 ||
- strncasecmp(argv[2], "enable", 6) == 0) {
+ else if (!strcmp(argv[2], "on") ||
+ !strcmp(argv[2], "enable")) {
printf("Enabling PEF alerts for LAN channel %d\n", chan);
rc = ipmi_set_alert_enable(intf, chan, 1);
}
- else if (strncasecmp(argv[2], "off", 3) == 0 ||
- strncasecmp(argv[2], "disable", 7) == 0) {
+ else if (!strcmp(argv[2], "off") ||
+ !strcmp(argv[2], "disable")) {
printf("Disabling PEF alerts for LAN channel %d\n", chan);
rc = ipmi_set_alert_enable(intf, chan, 0);
}
@@ -1653,14 +1705,14 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* RMCP+ cipher suite privilege levels */
- else if (strncmp(argv[1], "cipher_privs", 12) == 0)
+ else if (!strcmp(argv[1], "cipher_privs"))
{
if (argc != 3) {
print_lan_set_cipher_privs_usage();
return (-1);
}
- else if ((strncmp(argv[2], "help", 4) == 0) ||
- get_cmdline_cipher_suite_priv_data(argv[2], data))
+ else if (!strcmp(argv[2], "help")
+ || get_cmdline_cipher_suite_priv_data(argv[2], data))
{
print_lan_set_cipher_privs_usage();
return 0;
@@ -1670,9 +1722,9 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
rc = set_lan_param(intf, chan, IPMI_LANP_RMCP_PRIV_LEVELS, data, 9);
}
}
- else if (strncmp(argv[1], "bad_pass_thresh", 15) == 0)
+ else if (!strcmp(argv[1], "bad_pass_thresh"))
{
- if (argc == 3 && strncmp(argv[2], "help", 4) == 0) {
+ if (argc == 3 && !strcmp(argv[2], "help")) {
print_lan_set_bad_pass_thresh_usage();
return 0;
}
@@ -1692,14 +1744,14 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
static int
-is_alert_destination(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
+is_alert_destination(struct ipmi_intf *intf, uint8_t channel, uint8_t alert)
{
- struct lan_param * p;
+ struct lan_param *p;
p = get_lan_param(intf, channel, IPMI_LANP_NUM_DEST);
- if (p == NULL)
+ if (!p)
return 0;
- if (p->data == NULL)
+ if (!p->data)
return 0;
if (alert <= (p->data[0] & 0xf))
@@ -1709,7 +1761,7 @@ is_alert_destination(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
}
static int
-ipmi_lan_alert_print(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
+ipmi_lan_alert_print(struct ipmi_intf *intf, uint8_t channel, uint8_t alert)
{
# define PTYPE_LEN 4
# define PADDR_LEN 13
@@ -1719,15 +1771,14 @@ ipmi_lan_alert_print(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
uint8_t paddr[PADDR_LEN];
lp_ptr = get_lan_param_select(intf, channel, IPMI_LANP_DEST_TYPE, alert);
- if (lp_ptr == NULL || lp_ptr->data == NULL
+ if (!lp_ptr || !lp_ptr->data
|| lp_ptr->data_len < PTYPE_LEN) {
return (-1);
}
memcpy(ptype, lp_ptr->data, PTYPE_LEN);
lp_ptr = get_lan_param_select(intf, channel, IPMI_LANP_DEST_ADDR, alert);
- if (lp_ptr == NULL || lp_ptr->data == NULL
- || lp_ptr->data_len < PADDR_LEN) {
+ if (!lp_ptr || !lp_ptr->data || lp_ptr->data_len < PADDR_LEN) {
return (-1);
}
memcpy(paddr, lp_ptr->data, PADDR_LEN);
@@ -1776,24 +1827,23 @@ ipmi_lan_alert_print(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
printf("%-24s: %d.%d.%d.%d\n", "Alert IP Address",
paddr[3], paddr[4], paddr[5], paddr[6]);
- printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", "Alert MAC Address",
- paddr[7], paddr[8], paddr[9],
- paddr[10], paddr[11], paddr[12]);
+ printf("%-24s: %s\n", "Alert MAC Address",
+ mac2str(&paddr[7]));
printf("\n");
return 0;
}
static int
-ipmi_lan_alert_print_all(struct ipmi_intf * intf, uint8_t channel)
+ipmi_lan_alert_print_all(struct ipmi_intf *intf, uint8_t channel)
{
int j, ndest;
- struct lan_param * p;
+ struct lan_param *p;
p = get_lan_param(intf, channel, IPMI_LANP_NUM_DEST);
- if (p == NULL)
+ if (!p)
return -1;
- if (p->data == NULL)
+ if (!p->data)
return -1;
ndest = p->data[0] & 0xf;
@@ -1805,10 +1855,10 @@ ipmi_lan_alert_print_all(struct ipmi_intf * intf, uint8_t channel)
}
static int
-ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
- int argc, char ** argv)
+ipmi_lan_alert_set(struct ipmi_intf *intf, uint8_t chan, uint8_t alert,
+ int argc, char **argv)
{
- struct lan_param * p;
+ struct lan_param *p;
uint8_t data[32], temp[32];
int rc = 0;
@@ -1817,8 +1867,9 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
return (-1);
}
- if (strncmp(argv[0], "help", 4) == 0 ||
- strncmp(argv[1], "help", 4) == 0) {
+ if (!strcmp(argv[0], "help")
+ || !strcmp(argv[1], "help"))
+ {
print_lan_alert_set_usage();
return 0;
}
@@ -1827,14 +1878,14 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
memset(temp, 0, sizeof(temp));
/* alert destination ip address */
- if (strncasecmp(argv[0], "ipaddr", 6) == 0 &&
+ if (strcasecmp(argv[0], "ipaddr") == 0 &&
(get_cmdline_ipaddr(argv[1], temp) == 0)) {
/* get current parameter */
p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_ADDR, alert);
- if (p == NULL) {
+ if (!p) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
/* set new ipaddr */
memcpy(data+3, temp, 4);
printf("Setting LAN Alert %d IP Address to %d.%d.%d.%d\n", alert,
@@ -1842,37 +1893,36 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_ADDR, data, p->data_len);
}
/* alert destination mac address */
- else if (strncasecmp(argv[0], "macaddr", 7) == 0 &&
- (get_cmdline_macaddr(argv[1], temp) == 0)) {
+ else if (strcasecmp(argv[0], "macaddr") == 0 &&
+ (str2mac(argv[1], temp) == 0)) {
/* get current parameter */
p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_ADDR, alert);
- if (p == NULL) {
+ if (!p) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
/* set new macaddr */
memcpy(data+7, temp, 6);
printf("Setting LAN Alert %d MAC Address to "
- "%02x:%02x:%02x:%02x:%02x:%02x\n", alert,
- data[7], data[8], data[9], data[10], data[11], data[12]);
+ "%s\n", alert, mac2str(&data[7]));
rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_ADDR, data, p->data_len);
}
/* alert destination gateway selector */
- else if (strncasecmp(argv[0], "gateway", 7) == 0) {
+ else if (strcasecmp(argv[0], "gateway") == 0) {
/* get current parameter */
p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_ADDR, alert);
- if (p == NULL) {
+ if (!p) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
- if (strncasecmp(argv[1], "def", 3) == 0 ||
- strncasecmp(argv[1], "default", 7) == 0) {
+ if (strcasecmp(argv[1], "def") == 0 ||
+ strcasecmp(argv[1], "default") == 0) {
printf("Setting LAN Alert %d to use Default Gateway\n", alert);
data[2] = 0;
}
- else if (strncasecmp(argv[1], "bak", 3) == 0 ||
- strncasecmp(argv[1], "backup", 6) == 0) {
+ else if (strcasecmp(argv[1], "bak") == 0 ||
+ strcasecmp(argv[1], "backup") == 0) {
printf("Setting LAN Alert %d to use Backup Gateway\n", alert);
data[2] = 1;
}
@@ -1884,21 +1934,21 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_ADDR, data, p->data_len);
}
/* alert acknowledgement */
- else if (strncasecmp(argv[0], "ack", 3) == 0) {
+ else if (strcasecmp(argv[0], "ack") == 0) {
/* get current parameter */
p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert);
- if (p == NULL) {
+ if (!p) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
- if (strncasecmp(argv[1], "on", 2) == 0 ||
- strncasecmp(argv[1], "yes", 3) == 0) {
+ if (strcasecmp(argv[1], "on") == 0 ||
+ strcasecmp(argv[1], "yes") == 0) {
printf("Setting LAN Alert %d to Acknowledged\n", alert);
data[1] |= 0x80;
}
- else if (strncasecmp(argv[1], "off", 3) == 0 ||
- strncasecmp(argv[1], "no", 2) == 0) {
+ else if (strcasecmp(argv[1], "off") == 0 ||
+ strcasecmp(argv[1], "no") == 0) {
printf("Setting LAN Alert %d to Unacknowledged\n", alert);
data[1] &= ~0x80;
}
@@ -1909,24 +1959,24 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_TYPE, data, p->data_len);
}
/* alert destination type */
- else if (strncasecmp(argv[0], "type", 4) == 0) {
+ else if (strcasecmp(argv[0], "type") == 0) {
/* get current parameter */
p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert);
- if (p == NULL) {
+ if (!p) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
- if (strncasecmp(argv[1], "pet", 3) == 0) {
+ if (strcasecmp(argv[1], "pet") == 0) {
printf("Setting LAN Alert %d destination to PET Trap\n", alert);
data[1] &= ~0x07;
}
- else if (strncasecmp(argv[1], "oem1", 4) == 0) {
+ else if (strcasecmp(argv[1], "oem1") == 0) {
printf("Setting LAN Alert %d destination to OEM 1\n", alert);
data[1] &= ~0x07;
data[1] |= 0x06;
}
- else if (strncasecmp(argv[1], "oem2", 4) == 0) {
+ else if (strcasecmp(argv[1], "oem2") == 0) {
printf("Setting LAN Alert %d destination to OEM 2\n", alert);
data[1] |= 0x07;
}
@@ -1937,13 +1987,13 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_TYPE, data, p->data_len);
}
/* alert acknowledge timeout or retry interval */
- else if (strncasecmp(argv[0], "time", 4) == 0) {
+ else if (strcasecmp(argv[0], "time") == 0) {
/* get current parameter */
p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert);
- if (p == NULL) {
+ if (!p) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
if (str2uchar(argv[1], &data[2]) != 0) {
lprintf(LOG_ERR, "Invalid time: %s", argv[1]);
@@ -1953,13 +2003,13 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
rc = set_lan_param_nowait(intf, chan, IPMI_LANP_DEST_TYPE, data, p->data_len);
}
/* number of retries */
- else if (strncasecmp(argv[0], "retry", 5) == 0) {
+ else if (strcasecmp(argv[0], "retry") == 0) {
/* get current parameter */
p = get_lan_param_select(intf, chan, IPMI_LANP_DEST_TYPE, alert);
- if (p == NULL) {
+ if (!p) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
if (str2uchar(argv[1], &data[3]) != 0) {
lprintf(LOG_ERR, "Invalid retry: %s", argv[1]);
@@ -1978,7 +2028,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
}
static int
-ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_lan_alert(struct ipmi_intf *intf, int argc, char **argv)
{
uint8_t alert;
uint8_t channel = 1;
@@ -1988,14 +2038,14 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
print_lan_alert_set_usage();
return (-1);
}
- else if (strncasecmp(argv[0], "help", 4) == 0) {
+ else if (strcasecmp(argv[0], "help") == 0) {
print_lan_alert_print_usage();
print_lan_alert_set_usage();
return 0;
}
/* alert print [channel] [alert] */
- if (strncasecmp(argv[0], "print", 5) == 0) {
+ if (strcasecmp(argv[0], "print") == 0) {
if (argc < 2) {
channel = find_lan_channel(intf, 1);
if (!is_lan_channel(intf, channel)) {
@@ -2005,7 +2055,7 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
return ipmi_lan_alert_print_all(intf, channel);
}
- if (strncasecmp(argv[1], "help", 4) == 0) {
+ if (strcasecmp(argv[1], "help") == 0) {
print_lan_alert_print_usage();
return 0;
}
@@ -2034,12 +2084,12 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
}
/* alert set <channel> <alert> [option] */
- if (strncasecmp(argv[0], "set", 3) == 0) {
+ if (strcasecmp(argv[0], "set") == 0) {
if (argc < 5) {
print_lan_alert_set_usage();
return (-1);
}
- else if (strncasecmp(argv[1], "help", 4) == 0) {
+ else if (strcasecmp(argv[1], "help") == 0) {
print_lan_alert_set_usage();
return 0;
}
@@ -2070,10 +2120,10 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
static int
-ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
+ipmi_lan_stats_get(struct ipmi_intf *intf, uint8_t chan)
{
int rc = 0;
- struct ipmi_rs * rsp;
+ struct ipmi_rs *rsp;
struct ipmi_rq req;
uint8_t msg_data[2];
uint16_t statsTemp;
@@ -2095,14 +2145,16 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get LAN Stats command failed");
return (-1);
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get LAN Stats command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ specific_val2str(rsp->ccode,
+ get_lan_cc_vals,
+ completion_code_vals));
return (-1);
}
@@ -2148,10 +2200,10 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
static int
-ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
+ipmi_lan_stats_clear(struct ipmi_intf *intf, uint8_t chan)
{
int rc = 0;
- struct ipmi_rs * rsp;
+ struct ipmi_rs *rsp;
struct ipmi_rq req;
uint8_t msg_data[2];
@@ -2171,14 +2223,16 @@ ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_INFO, "Get LAN Stats command failed");
return (-1);
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ specific_val2str(rsp->ccode,
+ get_lan_cc_vals,
+ completion_code_vals));
return (-1);
}
@@ -2438,7 +2492,7 @@ print_lan_usage(void)
int
-ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_lanp_main(struct ipmi_intf *intf, int argc, char **argv)
{
int rc = 0;
uint8_t chan = 0;
@@ -2446,13 +2500,13 @@ ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
if (argc == 0) {
print_lan_usage();
return (-1);
- } else if (strncmp(argv[0], "help", 4) == 0) {
+ } else if (!strcmp(argv[0], "help")) {
print_lan_usage();
return 0;
}
- if (strncmp(argv[0], "printconf", 9) == 0 ||
- strncmp(argv[0], "print", 5) == 0)
+ if (!strcmp(argv[0], "printconf")
+ || !strcmp(argv[0], "print"))
{
if (argc > 2) {
print_lan_usage();
@@ -2470,11 +2524,11 @@ ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
rc = ipmi_lan_print(intf, chan);
- } else if (strncmp(argv[0], "set", 3) == 0) {
+ } else if (!strcmp(argv[0], "set")) {
rc = ipmi_lan_set(intf, argc-1, &(argv[1]));
- } else if (strncmp(argv[0], "alert", 5) == 0) {
+ } else if (!strcmp(argv[0], "alert")) {
rc = ipmi_lan_alert(intf, argc-1, &(argv[1]));
- } else if (strncmp(argv[0], "stats", 5) == 0) {
+ } else if (!strcmp(argv[0], "stats")) {
if (argc < 2) {
print_lan_usage();
return (-1);
@@ -2490,9 +2544,9 @@ ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_ERR, "Invalid channel: %d", chan);
return (-1);
}
- if (strncmp(argv[1], "get", 3) == 0) {
+ if (!strcmp(argv[1], "get")) {
rc = ipmi_lan_stats_get(intf, chan);
- } else if (strncmp(argv[1], "clear", 5) == 0) {
+ } else if (!strcmp(argv[1], "clear")) {
rc = ipmi_lan_stats_clear(intf, chan);
} else {
print_lan_usage();
diff --git a/lib/ipmi_lanp6.c b/lib/ipmi_lanp6.c
new file mode 100644
index 0000000..4af6d8b
--- /dev/null
+++ b/lib/ipmi_lanp6.c
@@ -0,0 +1,1238 @@
+/*
+ * Copyright (c) 2016 Pentair Technical Products. All right reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Pentair Technical Products or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * PENTAIR TECHNICAL SOLUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <ipmitool/helper.h>
+#include <ipmitool/ipmi_cc.h>
+#include <ipmitool/ipmi_cfgp.h>
+#include <ipmitool/ipmi_lanp.h>
+#include <ipmitool/ipmi_lanp6.h>
+#include <ipmitool/log.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+/*
+ * LAN6 command values.
+ */
+enum {
+ LANP_CMD_SAVE,
+ LANP_CMD_SET,
+ LANP_CMD_PRINT,
+ LANP_CMD_LOCK,
+ LANP_CMD_COMMIT,
+ LANP_CMD_DISCARD,
+ LANP_CMD_HELP,
+ LANP_CMD_ANY = 0xFF
+};
+
+/*
+ * Generic LAN configuration parameters.
+ */
+const struct ipmi_lanp generic_lanp6[] = {
+ { 0, "Set In Progress", 1 },
+ { 50, "IPv6/IPv4 Support", 1 },
+ { 51, "IPv6/IPv4 Addressing Enables", 1 },
+ { 52, "IPv6 Header Traffic Class", 1 },
+ { 53, "IPv6 Header Static Hop Limit", 1 },
+ { 54, "IPv6 Header Flow Label", 3 },
+ { 55, "IPv6 Status", 3 },
+ { 56, "IPv6 Static Address", 20 },
+ { 57, "IPv6 DHCPv6 Static DUID Storage Length", 1 },
+ { 58, "IPv6 DHCPv6 Static DUID", 18 },
+ { 59, "IPv6 Dynamic Address", 20 },
+ { 60, "IPv6 DHCPv6 Dynamic DUID Storage Length", 1 },
+ { 61, "IPv6 DHCPv6 Dynamic DUID", 18 },
+ { 62, "IPv6 DHCPv6 Timing Configuration Support", 1 },
+ { 63, "IPv6 DHCPv6 Timing Configuration", 18 },
+ { 64, "IPv6 Router Address Configuration Control", 1 },
+ { 65, "IPv6 Static Router 1 IP Address", 16 },
+ { 66, "IPv6 Static Router 1 MAC Address", 6 },
+ { 67, "IPv6 Static Router 1 Prefix Length", 1 },
+ { 68, "IPv6 Static Router 1 Prefix Value", 16 },
+ { 69, "IPv6 Static Router 2 IP Address", 16 },
+ { 70, "IPv6 Static Router 2 MAC Address", 6 },
+ { 71, "IPv6 Static Router 2 Prefix Length", 1 },
+ { 72, "IPv6 Static Router 2 Prefix Value", 16 },
+ { 73, "IPv6 Number of Dynamic Router Info Sets", 1 },
+ { 74, "IPv6 Dynamic Router Info IP Address", 17 },
+ { 75, "IPv6 Dynamic Router Info MAC Address", 7 },
+ { 76, "IPv6 Dynamic Router Info Prefix Length", 2 },
+ { 77, "IPv6 Dynamic Router Info Prefix Value", 17 },
+ { 78, "IPv6 Dynamic Router Received Hop Limit", 1 },
+ { 79, "IPv6 ND/SLAAC Timing Configuration Support", 1 },
+ { 80, "IPv6 ND/SLAAC Timing Configuration", 18 },
+ { 0, NULL, 0 }
+};
+
+/*
+ * Set/Get LAN Configuration Parameters
+ * command-specific completion codes.
+ */
+const struct valstr lanp_cc_vals[] = {
+ { 0x80, "Parameter not supported" },
+ { 0x81, "Set already in progress" },
+ { 0x82, "Parameter is read-only" },
+ { 0x83, "Write-only parameter" },
+ { 0x00, NULL }
+};
+
+/*
+ * IPv6/IPv4 Addressing Enables.
+ */
+const struct valstr ip6_enable_vals[] = {
+ { 0, "ipv4" },
+ { 1, "ipv6" },
+ { 2, "both" },
+ { 0xFF, NULL }
+};
+
+/*
+ * Enable/Disable a static address.
+ */
+const struct valstr ip6_addr_enable_vals[] = {
+ { 0x00, "disable" },
+ { 0x80, "enable" },
+ { 0xFF, NULL }
+};
+
+/*
+ * IPv6 address source values.
+ */
+const struct valstr ip6_addr_sources[] = {
+ { 0, "static" },
+ { 1, "SLAAC" },
+ { 2, "DHCPv6" },
+ { 0, NULL }
+};
+
+/*
+ * IPv6 address status values.
+ */
+const struct valstr ip6_addr_statuses[] = {
+ { 0, "active" },
+ { 1, "disabled" },
+ { 2, "pending" },
+ { 3, "failed" },
+ { 4, "deprecated" },
+ { 5, "invalid" },
+ { 0xFF, NULL }
+};
+
+/*
+ * DHCPv6 DUID type values.
+ */
+const struct valstr ip6_duid_types[] = {
+ { 0, "unknown" },
+ { 1, "DUID-LLT" },
+ { 2, "DUID-EN" },
+ { 3, "DUID-LL" },
+ { 0xFF, NULL }
+};
+
+/*
+ * Timing Configuration support values.
+ */
+const struct valstr ip6_cfg_sup_vals[] = {
+ { 0, "not supported" },
+ { 1, "global" },
+ { 2, "per interface" },
+ { 0xFF, NULL }
+};
+
+/*
+ * Router Address Configuration Control values.
+ */
+const struct valstr ip6_rtr_configs[] = {
+ { 1, "static" },
+ { 2, "dynamic" },
+ { 3, "both" },
+ { 0xFF, NULL }
+};
+
+
+const struct valstr ip6_command_vals[] = {
+ { LANP_CMD_SET, "set" },
+ { LANP_CMD_SAVE, "save" },
+ { LANP_CMD_PRINT, "print" },
+ { LANP_CMD_LOCK, "lock" },
+ { LANP_CMD_COMMIT, "commit" },
+ { LANP_CMD_DISCARD, "discard" },
+ { LANP_CMD_HELP, "help" },
+ { LANP_CMD_ANY, NULL }
+};
+
+static const struct ipmi_cfgp lan_cfgp[] = {
+ { .name = "support", .format = NULL, .size = 1,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_SUPPORT
+ },
+ { .name = "enables", .format = "{ipv4|ipv6|both}", .size = 1,
+ .access = CFGP_RDWR,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_ENABLES
+ },
+ { .name = "traffic_class", .format = "<value>", .size = 1,
+ .access = CFGP_RDWR,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_TRAFFIC_CLASS
+ },
+ { .name = "static_hops", .format = "<value>", .size = 1,
+ .access = CFGP_RDWR,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_STATIC_HOPS
+ },
+ { .name = "flow_label", .format = "<value>", .size = 3,
+ .access = CFGP_RDWR,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_FLOW_LABEL
+ },
+ { .name = "status", .format = NULL, .size = 3,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_STATUS
+ },
+ { .name = "static_addr",
+ .format = "{enable|disable} <addr> <pfx_len>", .size = 20,
+ .access = CFGP_RDWR,
+ .is_set = 1, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_STATIC_ADDR
+ },
+ { .name = "static_duid_stg", .format = NULL, .size = 1,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_STATIC_DUID_STG
+ },
+ { .name = "static_duid", .format = "<data>", .size = 18,
+ .access = CFGP_RDWR,
+ .is_set = 1, .first_set = 0, .has_blocks = 1, .first_block = 0,
+ .specific = IPMI_LANP_IP6_STATIC_DUID
+ },
+ { .name = "dynamic_addr", .format = NULL, .size = 20,
+ .access = CFGP_RDONLY,
+ .is_set = 1, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_DYNAMIC_ADDR
+ },
+ { .name = "dynamic_duid_stg", .format = NULL, .size = 1,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_DYNAMIC_DUID_STG
+ },
+ { .name = "dynamic_duid", .format = "<data>", .size = 18,
+ .access = CFGP_RDWR,
+ .is_set = 1, .first_set = 0, .has_blocks = 1, .first_block = 0,
+ .specific = IPMI_LANP_IP6_DYNAMIC_DUID
+ },
+ { .name = "dhcp6_cfg_sup", .format = NULL, .size = 1,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_DHCP6_CFG_SUP
+ },
+ { .name = "dhcp6_cfg", .format = "<data> <data>", .size = 36,
+ .access = CFGP_RDWR,
+ .is_set = 1, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_DHCP6_CFG
+ },
+ { .name = "rtr_cfg", .format = "{static|dynamic|both}", .size = 1,
+ .access = CFGP_RDWR,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_ROUTER_CFG
+ },
+ { .name = "static_rtr",
+ .format = "<addr> <macaddr> <prefix> <prefix_len>", .size = 43,
+ .access = CFGP_RDWR,
+ .is_set = 1, .first_set = 1, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_STATIC_RTR1_ADDR
+ },
+ { .name = "num_dynamic_rtrs", .format = NULL, .size = 1,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_NUM_DYNAMIC_RTRS
+ },
+ { .name = "dynamic_rtr", .format = NULL, .size = 43,
+ .access = CFGP_RDONLY,
+ .is_set = 1, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_DYNAMIC_RTR_ADDR
+ },
+ { .name = "dynamic_hops", .format = NULL, .size = 1,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_DYNAMIC_HOPS
+ },
+ { .name = "ndslaac_cfg_sup", .format = NULL, .size = 1,
+ .access = CFGP_RDONLY,
+ .is_set = 0, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_NDSLAAC_CFG_SUP
+ },
+ { .name = "ndslaac_cfg", .format = "<data>", .size = 18,
+ .access = CFGP_RDWR,
+ .is_set = 1, .first_set = 0, .has_blocks = 0, .first_block = 0,
+ .specific = IPMI_LANP_IP6_NDSLAAC_CFG
+ }
+};
+
+/*
+ * Lookup LAN parameter descriptor by parameter selector.
+ */
+const struct ipmi_lanp *
+lookup_lanp(int param)
+{
+ const struct ipmi_lanp *p = generic_lanp6;
+
+ while (p->name) {
+ if (p->selector == param) {
+ return p;
+ }
+
+ p++;
+ }
+
+ return NULL;
+}
+
+/*
+ * Print request error.
+ */
+static int
+ipmi_lanp_err(const struct ipmi_rs *rsp, const struct ipmi_lanp *p,
+ const char *action, int quiet)
+{
+ const char *reason;
+ char cc_msg[10];
+ int log_level = LOG_ERR;
+ int err;
+
+ if (!rsp) {
+ reason = "No response";
+ err = -1;
+ } else {
+ err = rsp->ccode;
+ if (quiet == 1
+ && (rsp->ccode == 0x80
+ || rsp->ccode == IPMI_CC_PARAM_OUT_OF_RANGE
+ || rsp->ccode == IPMI_CC_INV_DATA_FIELD_IN_REQ)) {
+ /* be quiet */
+ return err;
+ }
+
+ if (rsp->ccode >= 0xC0) {
+ /* browse for generic completion codes */
+ reason = val2str(rsp->ccode, completion_code_vals);
+ } else {
+ /* browse for command-specific completion codes first */
+ reason = val2str(rsp->ccode, lanp_cc_vals);
+ }
+
+ if (!reason) {
+ /* print completion code value */
+ snprintf(cc_msg, sizeof(cc_msg), "CC=%02x", rsp->ccode);
+ reason = cc_msg;
+ }
+
+ if (rsp->ccode == IPMI_CC_OK) {
+ log_level = LOG_DEBUG;
+ }
+ }
+
+ lprintf(log_level, "Failed to %s %s: %s", action, p->name, reason);
+ return err;
+}
+
+/*
+ * Get dynamic OEM LAN configuration parameter from BMC.
+ * Dynamic in this context is when the base for OEM LAN parameters
+ * is not known apriori.
+ */
+int
+ipmi_get_dynamic_oem_lanp(void *priv, const struct ipmi_lanp *param,
+ int oem_base, int set_selector, int block_selector,
+ void *data, int quiet)
+{
+ struct ipmi_lanp_priv *lp = priv;
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ uint8_t req_data[4];
+ int length;
+
+ if (!priv || !param || !data) {
+ return -1;
+ }
+ req_data[0] = lp->channel;
+ req_data[1] = param->selector + oem_base;
+ req_data[2] = set_selector;
+ req_data[3] = block_selector;
+
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_TRANSPORT;
+ req.msg.cmd = 2;
+ req.msg.data = req_data;
+ req.msg.data_len = 4;
+
+ lprintf(LOG_INFO, "Getting parameter '%s' set %d block %d",
+ param->name, set_selector, block_selector);
+
+ rsp = lp->intf->sendrecv(lp->intf, &req);
+ if (!rsp || rsp->ccode) {
+ return ipmi_lanp_err(rsp, param, "get", quiet);
+ }
+
+ memset(data, 0, param->size);
+
+ if (rsp->data_len - 1 < param->size) {
+ length = rsp->data_len - 1;
+ } else {
+ length = param->size;
+ }
+
+ if (length) {
+ memcpy(data, rsp->data + 1, length);
+ }
+
+ return 0;
+}
+
+/*
+ * Get generic LAN configuration parameter.
+ */
+int
+ipmi_get_lanp(void *priv, int param_selector, int set_selector,
+ int block_selector, void *data, int quiet)
+{
+ return ipmi_get_dynamic_oem_lanp(priv, lookup_lanp(param_selector), 0,
+ set_selector, block_selector, data, quiet);
+}
+
+/*
+ * Set dynamic OEM LAN configuration parameter to BMC.
+ * Dynamic in this context is when the base for OEM LAN parameters
+ * is not known apriori.
+ */
+int
+ipmi_set_dynamic_oem_lanp(void *priv, const struct ipmi_lanp *param,
+ int base, const void *data)
+{
+ struct ipmi_lanp_priv *lp = priv;
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ uint8_t req_data[32];
+
+ if (!priv || !param || !data) {
+ return -1;
+ }
+ /* fill the first two bytes */
+ req_data[0] = lp->channel;
+ req_data[1] = param->selector + base;
+
+ /* fill the rest data */
+ memcpy(&req_data[2], data, param->size);
+
+ /* fill request */
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_TRANSPORT;
+ req.msg.cmd = 1;
+ req.msg.data = req_data;
+ req.msg.data_len = param->size + 2;
+
+ lprintf(LOG_INFO, "Setting parameter '%s'", param->name);
+
+ rsp = lp->intf->sendrecv(lp->intf, &req);
+ if (!rsp || rsp->ccode) {
+ return ipmi_lanp_err(rsp, param, "set", 0);
+ }
+
+ return 0;
+}
+
+/*
+ * Set generic LAN configuration parameter.
+ */
+int
+ipmi_set_lanp(void *priv, int param_selector, const void *data)
+{
+ return ipmi_set_dynamic_oem_lanp(priv, lookup_lanp(param_selector),
+ 0, data);
+}
+
+static int
+lanp_parse_cfgp(const struct ipmi_cfgp *p, int set, int block,
+ int argc, const char *argv[], unsigned char *data)
+{
+ unsigned int v;
+
+ if (argc == 0) {
+ return -1;
+ }
+
+ switch(p->specific) {
+ case IPMI_LANP_IP6_ENABLES:
+ data[0] = str2val(argv[0], ip6_enable_vals);
+ if (data[0] == 0xFF) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+ break;
+
+ case IPMI_LANP_IP6_FLOW_LABEL:
+ if (str2uint(argv[0], &v)) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+
+ data[0] = (v >> 16) & 0x0F;
+ data[1] = (v >> 8) & 0xFF;
+ data[2] = v & 0xFF;
+ break;
+
+ case IPMI_LANP_IP6_STATUS:
+ if (argc < 3) {
+ return -1;
+ }
+
+ if (str2uchar(argv[0], &data[0])
+ || str2uchar(argv[1], &data[1])
+ || str2uchar(argv[2], &data[2])) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+ break;
+
+ case IPMI_LANP_IP6_STATIC_ADDR:
+ case IPMI_LANP_IP6_DYNAMIC_ADDR:
+ if (argc < 3) {
+ return -1;
+ }
+
+ data[0] = set;
+ if (p->specific == IPMI_LANP_IP6_STATIC_ADDR) {
+ data[1] = str2val(argv[0], ip6_addr_enable_vals);
+ } else {
+ data[1] = str2val(argv[0], ip6_addr_sources);
+ }
+ if (data[1] == 0xFF) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+
+ if (inet_pton(AF_INET6, argv[1], &data[2]) != 1) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+
+ if (str2uchar(argv[2], &data[18])) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+
+ if (argc >= 4) {
+ data[19] = str2val(argv[3], ip6_addr_statuses);
+ }
+ break;
+
+ case IPMI_LANP_IP6_STATIC_DUID:
+ case IPMI_LANP_IP6_DYNAMIC_DUID:
+ case IPMI_LANP_IP6_NDSLAAC_CFG:
+ data[0] = set;
+ data[1] = block;
+ if (ipmi_parse_hex(argv[0], &data[2], 16) < 0) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+ break;
+
+ case IPMI_LANP_IP6_DHCP6_CFG:
+ data[0] = set;
+ data[1] = 0;
+ data[18] = set;
+ data[19] = 1;
+
+ if (ipmi_parse_hex(argv[0], &data[2], 16) < 0
+ || (argc > 1 &&
+ ipmi_parse_hex(argv[1], &data[20], 6) < 0)) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+ break;
+
+ case IPMI_LANP_IP6_ROUTER_CFG:
+ data[0] = str2val(argv[0], ip6_rtr_configs);
+ if (data[0] == 0xFF) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+ break;
+
+ case IPMI_LANP_IP6_STATIC_RTR1_ADDR:
+ if (set > 2) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+
+ case IPMI_LANP_IP6_DYNAMIC_RTR_ADDR:
+ if (argc < 4) {
+ return -1;
+ }
+
+ /*
+ * Data is stored in the following way:
+ * 0: <set> <addr1>...<addr16>
+ * 17: <set> <mac1>...<mac6>
+ * 24: <set> <pfxlen>
+ * 26: <set> <pfx1>...<pfx16>
+ */
+ data[0] = data[17] = data[24] = data[26] = set;
+
+ if (inet_pton(AF_INET6, argv[0], &data[1]) != 1
+ || str2mac(argv[1], &data[18])
+ || inet_pton(AF_INET6, argv[2], &data[27]) != 1
+ || str2uchar(argv[3], &data[25])) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+ break;
+
+ default:
+ if (str2uchar(argv[0], &data[0])) {
+ lprintf(LOG_ERR, "invalid value");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int
+lanp_set_cfgp(void *priv, const struct ipmi_cfgp *p, const unsigned char *data)
+{
+ int ret;
+ int param = p->specific;
+ int off = 0;
+
+ switch(param) {
+ case IPMI_LANP_IP6_DHCP6_CFG:
+ ret = ipmi_set_lanp(priv, param, &data[0]);
+ if (ret == 0) {
+ ret = ipmi_set_lanp(priv, param, &data[18]);
+ }
+ break;
+
+ case IPMI_LANP_IP6_STATIC_RTR1_ADDR:
+ if (data[0] == 2) {
+ param = IPMI_LANP_IP6_STATIC_RTR2_ADDR;
+ }
+ off = 1;
+
+ case IPMI_LANP_IP6_DYNAMIC_RTR_ADDR:
+ ret = ipmi_set_lanp(priv, param, &data[0 + off]);
+ if (ret == 0) {
+ ret = ipmi_set_lanp(priv, param + 1, &data[17 + off]);
+ }
+ if (ret == 0) {
+ ret = ipmi_set_lanp(priv, param + 2, &data[24 + off]);
+ }
+ if (ret == 0) {
+ ret = ipmi_set_lanp(priv, param + 3, &data[26 + off]);
+ }
+ break;
+
+
+ default:
+ ret = ipmi_set_lanp(priv, param, data);
+ }
+
+ return ret;
+}
+
+static int
+lanp_get_cfgp(void *priv, const struct ipmi_cfgp *p,
+ int set, int block, unsigned char *data, int quiet)
+{
+ int ret;
+ int param = p->specific;
+ int off = 0;
+
+ switch(param) {
+ case IPMI_LANP_IP6_DHCP6_CFG:
+ ret = ipmi_get_lanp(priv, param, set, 0, &data[0], quiet);
+ if (ret == 0) {
+ ret = ipmi_get_lanp(priv, param, set,
+ 1, &data[18], quiet);
+ }
+ break;
+
+ case IPMI_LANP_IP6_STATIC_RTR1_ADDR:
+ if (set > 2) {
+ return -1;
+ }
+
+ if (set == 2) {
+ param = IPMI_LANP_IP6_STATIC_RTR2_ADDR;
+ }
+ set = 0;
+ off = 1;
+ data[0] = data[17] = data[24] = data[26] = set;
+
+ case IPMI_LANP_IP6_DYNAMIC_RTR_ADDR:
+ ret = ipmi_get_lanp(priv, param, set, block,
+ &data[0 + off], quiet);
+ if (ret == 0) {
+ ret = ipmi_get_lanp(priv, param + 1, set, block,
+ &data[17 + off], 0);
+ }
+ if (ret == 0) {
+ ret = ipmi_get_lanp(priv, param + 2, set, block,
+ &data[24 + off], 0);
+ }
+ if (ret == 0) {
+ ret = ipmi_get_lanp(priv, param + 3, set, block,
+ &data[26 + off], 0);
+ }
+ break;
+
+ default:
+ ret = ipmi_get_lanp(priv, param, set, block, data, quiet);
+ }
+
+ return ret;
+}
+
+static int
+lanp_save_cfgp(const struct ipmi_cfgp *p, const unsigned char *data, FILE *file)
+{
+ char addr[INET6_ADDRSTRLEN];
+ char pfx[INET6_ADDRSTRLEN];
+ const char *src;
+
+ switch(p->specific) {
+ case IPMI_LANP_IP6_ENABLES:
+ fputs(val2str(data[0], ip6_enable_vals), file);
+ break;
+
+ case IPMI_LANP_IP6_FLOW_LABEL:
+ fprintf(file, "0x%xd", (data[0] << 16 ) | (data[1] << 8) | data[2]);
+ break;
+
+ case IPMI_LANP_IP6_STATUS:
+ fprintf(file, "%d %d %d", data[0], data[1], data[2]);
+ break;
+
+ case IPMI_LANP_IP6_STATIC_ADDR:
+ case IPMI_LANP_IP6_DYNAMIC_ADDR:
+ if (p->specific == IPMI_LANP_IP6_STATIC_ADDR) {
+ src = val2str(data[1], ip6_addr_enable_vals);
+ } else {
+ src = val2str(data[1], ip6_addr_sources);
+ }
+
+ fprintf(file, "%s %s %d %s", src,
+ inet_ntop(AF_INET6, &data[2], addr, sizeof(addr)),
+ data[18], val2str(data[19], ip6_addr_statuses));
+ break;
+
+ case IPMI_LANP_IP6_STATIC_DUID:
+ case IPMI_LANP_IP6_DYNAMIC_DUID:
+ case IPMI_LANP_IP6_NDSLAAC_CFG:
+ fprintf(file, "%s", buf2str(&data[2], 16));
+ break;
+
+ case IPMI_LANP_IP6_DHCP6_CFG:
+ fprintf(file, "%s", buf2str(&data[2], 16));
+ fprintf(file, " %s", buf2str(&data[20], 6));
+ break;
+
+ case IPMI_LANP_IP6_ROUTER_CFG:
+ fputs(val2str(data[0], ip6_rtr_configs), file);
+ break;
+
+ case IPMI_LANP_IP6_STATIC_RTR1_ADDR:
+ case IPMI_LANP_IP6_DYNAMIC_RTR_ADDR:
+ fprintf(file, "%s %s %s %d",
+ inet_ntop(AF_INET6, &data[1], addr, sizeof(addr)),
+ mac2str(&data[18]),
+ inet_ntop(AF_INET6, &data[27], pfx, sizeof(pfx)), data[25]);
+ break;
+
+ default:
+ fprintf(file, "%d", data[0]);
+ }
+
+ return 0;
+}
+
+
+static int
+lanp_print_cfgp(const struct ipmi_cfgp *p,
+ int set, int block, const unsigned char *data, FILE *file)
+{
+ char addr[INET6_ADDRSTRLEN];
+ char pfx[INET6_ADDRSTRLEN];
+ const char *pname;
+ const struct ipmi_lanp *lanp = lookup_lanp(p->specific);
+
+ if (!lanp || !p || !file || !data || !lanp->name) {
+ return -1;
+ }
+ pname = lanp->name;
+
+ switch(p->specific) {
+ case IPMI_LANP_IP6_SUPPORT:
+ fprintf(file, "%s:\n"
+ " IPv6 only: %s\n"
+ " IPv4 and IPv6: %s\n"
+ " IPv6 Destination Addresses for LAN alerting: %s\n",
+ pname,
+ data[0] & 1 ? "yes" : "no",
+ data[0] & 2 ? "yes" : "no",
+ data[0] & 4 ? "yes" : "no");
+ break;
+
+ case IPMI_LANP_IP6_ENABLES:
+ fprintf(file, "%s: %s\n",
+ pname, val2str(data[0], ip6_enable_vals));
+ break;
+
+ case IPMI_LANP_IP6_FLOW_LABEL:
+ fprintf(file, "%s: %d\n",
+ pname, (data[0] << 16 ) | (data[1] << 8) | data[2]);
+ break;
+
+ case IPMI_LANP_IP6_STATUS:
+ fprintf(file, "%s:\n"
+ " Static address max: %d\n"
+ " Dynamic address max: %d\n"
+ " DHCPv6 support: %s\n"
+ " SLAAC support: %s\n",
+ pname,
+ data[0], data[1],
+ (data[2] & 1) ? "yes" : "no",
+ (data[2] & 2) ? "yes" : "no");
+ break;
+
+ case IPMI_LANP_IP6_STATIC_ADDR:
+ fprintf(file, "%s %d:\n"
+ " Enabled: %s\n"
+ " Address: %s/%d\n"
+ " Status: %s\n",
+ pname, set,
+ (data[1] & 0x80) ? "yes" : "no",
+ inet_ntop(AF_INET6, &data[2], addr, sizeof(addr)),
+ data[18], val2str(data[19] & 0xF, ip6_addr_statuses));
+ break;
+
+ case IPMI_LANP_IP6_DYNAMIC_ADDR:
+ fprintf(file, "%s %d:\n"
+ " Source/Type: %s\n"
+ " Address: %s/%d\n"
+ " Status: %s\n",
+ pname, set,
+ val2str(data[1] & 0xF, ip6_addr_sources),
+ inet_ntop(AF_INET6, &data[2], addr, sizeof(addr)),
+ data[18], val2str(data[19] & 0xF, ip6_addr_statuses));
+ break;
+
+ case IPMI_LANP_IP6_STATIC_DUID:
+ case IPMI_LANP_IP6_DYNAMIC_DUID:
+ if (block == 0) {
+ fprintf(file, "%s %d:\n"
+ " Length: %d\n"
+ " Type: %s\n",
+ pname, set, data[2],
+ val2str((data[3] << 8) + data[4], ip6_duid_types));
+ }
+ fprintf(file, " %s\n", buf2str(&data[2], 16));
+ break;
+
+ case IPMI_LANP_IP6_DHCP6_CFG_SUP:
+ case IPMI_LANP_IP6_NDSLAAC_CFG_SUP:
+ fprintf(file, "%s: %s\n",
+ pname, val2str(data[0], ip6_cfg_sup_vals));
+ break;
+
+ case IPMI_LANP_IP6_DHCP6_CFG:
+ fprintf(file, "%s %d:\n", pname, set);
+
+ fprintf(file,
+ " SOL_MAX_DELAY: %d\n"
+ " SOL_TIMEOUT: %d\n"
+ " SOL_MAX_RT: %d\n"
+ " REQ_TIMEOUT: %d\n"
+ " REQ_MAX_RT: %d\n"
+ " REQ_MAX_RC: %d\n"
+ " CNF_MAX_DELAY: %d\n"
+ " CNF_TIMEOUT: %d\n"
+ " CNF_MAX_RT: %d\n"
+ " CNF_MAX_RD: %d\n"
+ " REN_TIMEOUT: %d\n"
+ " REN_MAX_RT: %d\n"
+ " REB_TIMEOUT: %d\n"
+ " REB_MAX_RT: %d\n"
+ " INF_MAX_DELAY: %d\n"
+ " INF_TIMEOUT: %d\n"
+ " INF_MAX_RT: %d\n"
+ " REL_TIMEOUT: %d\n"
+ " REL_MAX_RC: %d\n"
+ " DEC_TIMEOUT: %d\n"
+ " DEC_MAX_RC: %d\n"
+ " HOP_COUNT_LIMIT: %d\n",
+ data[2], data[3], data[4], data[5],
+ data[6], data[7], data[8], data[9],
+ data[10], data[11], data[12], data[13],
+ data[14], data[15], data[16], data[17],
+ data[20], data[21], data[22], data[23],
+ data[24], data[25]);
+ break;
+
+ case IPMI_LANP_IP6_ROUTER_CFG:
+ fprintf(file, "%s:\n"
+ " Enable static router address: %s\n"
+ " Enable dynamic router address: %s\n",
+ pname,
+ (data[0] & 1) ? "yes" : "no",
+ (data[0] & 2) ? "yes" : "no");
+ break;
+
+ case IPMI_LANP_IP6_STATIC_RTR1_ADDR:
+ case IPMI_LANP_IP6_DYNAMIC_RTR_ADDR:
+ if (p->specific == IPMI_LANP_IP6_STATIC_RTR1_ADDR) {
+ pname = "IPv6 Static Router";
+ } else {
+ pname = "IPv6 Dynamic Router";
+ }
+
+ fprintf(file, "%s %d:\n"
+ " Address: %s\n"
+ " MAC: %s\n"
+ " Prefix: %s/%d\n",
+ pname, set,
+ inet_ntop(AF_INET6, &data[1], addr, sizeof(addr)),
+ mac2str(&data[18]),
+ inet_ntop(AF_INET6, &data[27], pfx, sizeof(pfx)), data[25]);
+ break;
+
+ case IPMI_LANP_IP6_NDSLAAC_CFG:
+ fprintf(file, "%s %d:\n"
+ " MAX_RTR_SOLICITATION_DELAY: %d\n"
+ " RTR_SOLICITATION_INTERVAL: %d\n"
+ " MAX_RTR_SOLICITATIONS: %d\n"
+ " DupAddrDetectTransmits: %d\n"
+ " MAX_MULTICAST_SOLICIT: %d\n"
+ " MAX_UNICAST_SOLICIT: %d\n"
+ " MAX_ANYCAST_DELAY_TIME: %d\n"
+ " MAX_NEIGHBOR_ADVERTISEMENT: %d\n"
+ " REACHABLE_TIME: %d\n"
+ " RETRANS_TIMER: %d\n"
+ " DELAY_FIRST_PROBE_TIME: %d\n"
+ " MAX_RANDOM_FACTOR: %d\n"
+ " MIN_RANDOM_FACTOR: %d\n",
+ pname, set,
+ data[2], data[3], data[4], data[5],
+ data[6], data[7], data[8], data[9],
+ data[10], data[11], data[12], data[13],
+ data[14]);
+ break;
+
+ default:
+ fprintf(file, "%s: %d\n", pname, data[0]);
+ }
+
+ return 0;
+}
+
+static int
+lanp_ip6_cfgp(void *priv, const struct ipmi_cfgp *p,
+ const struct ipmi_cfgp_action *action, unsigned char *data)
+{
+ switch (action->type) {
+ case CFGP_PARSE:
+ return lanp_parse_cfgp(p, action->set, action->block,
+ action->argc, action->argv, data);
+
+ case CFGP_GET:
+ return lanp_get_cfgp(priv, p, action->set, action->block,
+ data, action->quiet);
+
+ case CFGP_SET:
+ return lanp_set_cfgp(priv, p, data);
+
+ case CFGP_SAVE:
+ return lanp_save_cfgp(p, data, action->file);
+
+ case CFGP_PRINT:
+ return lanp_print_cfgp(p, action->set, action->block,
+ data, action->file);
+
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+static void lanp_print_usage(int cmd)
+{
+ if (cmd == LANP_CMD_ANY || cmd == LANP_CMD_HELP) {
+ printf(" help [command]\n");
+ }
+ if (cmd == LANP_CMD_ANY || cmd == LANP_CMD_SAVE) {
+ printf(" save <channel> [<parameter> [<set_sel> [<block_sel>]]]\n");
+ }
+ if (cmd == LANP_CMD_ANY || cmd == LANP_CMD_SET) {
+ printf(" set <channel> [nolock] <parameter> [<set_sel> [<block_sel>]] <values...>\n");
+ }
+ if (cmd == LANP_CMD_ANY || cmd == LANP_CMD_PRINT) {
+ printf(" print <channel> [<parameter> [<set_sel> [<block_sel>]]]\n");
+ }
+ if (cmd == LANP_CMD_ANY || cmd == LANP_CMD_LOCK) {
+ printf(" lock <channel>\n");
+ }
+ if (cmd == LANP_CMD_ANY || cmd == LANP_CMD_COMMIT) {
+ printf(" commit <channel>\n");
+ }
+ if (cmd == LANP_CMD_ANY || cmd == LANP_CMD_DISCARD) {
+ printf(" discard <channel>\n");
+ }
+ if (cmd == LANP_CMD_SAVE
+ || cmd == LANP_CMD_PRINT
+ || cmd == LANP_CMD_SET) {
+ printf("\n available parameters:\n");
+ /* 'save' shall use 'write' filter, since it outputs a block
+ * of 'set's */
+ ipmi_cfgp_usage(lan_cfgp, ARRAY_SIZE(lan_cfgp), cmd != LANP_CMD_PRINT);
+ }
+}
+
+static int
+lanp_lock(struct ipmi_lanp_priv *lp)
+{
+ unsigned char byte = 1;
+
+ return ipmi_set_lanp(lp, 0, &byte);
+}
+
+static int
+lanp_discard(struct ipmi_lanp_priv *lp)
+{
+ unsigned char byte = 0;
+
+ return ipmi_set_lanp(lp, 0, &byte);
+}
+
+static int
+lanp_commit(struct ipmi_lanp_priv *lp)
+{
+ unsigned char byte = 2;
+ int ret;
+
+ ret = ipmi_set_lanp(lp, 0, &byte);
+ if (ret == 0) {
+ ret = lanp_discard(lp);
+ }
+
+ return ret;
+}
+
+int
+ipmi_lan6_main(struct ipmi_intf *intf, int argc, char **argv)
+{
+ struct ipmi_cfgp_ctx ctx;
+ struct ipmi_cfgp_sel sel;
+ struct ipmi_lanp_priv lp;
+ int cmd;
+ int chan;
+ int nolock = 0;
+ int ret;
+
+ if (argc == 0) {
+ lanp_print_usage(LANP_CMD_ANY);
+ return 0;
+ }
+
+ cmd = str2val(argv[0], ip6_command_vals);
+ if (cmd == LANP_CMD_ANY) {
+ lanp_print_usage(cmd);
+ return -1;
+ }
+
+ if (cmd == LANP_CMD_HELP) {
+ if (argc == 1) {
+ cmd = LANP_CMD_ANY;
+ } else {
+ cmd = str2val(argv[1], ip6_command_vals);
+ }
+
+ lanp_print_usage(cmd);
+ return 0;
+ }
+
+ /*
+ * the rest commands expect channel number
+ * with the exception of 'get' and 'print'
+ */
+ if (argc == 1) {
+ if (cmd == LANP_CMD_SAVE || cmd == LANP_CMD_PRINT) {
+ chan = find_lan_channel(intf, 1);
+ if (chan == 0) {
+ lprintf(LOG_ERR, "No LAN channel found");
+ return -1;
+ }
+ } else {
+ lanp_print_usage(cmd);
+ return -1;
+ }
+
+ argc -= 1;
+ argv += 1;
+ } else {
+ if (str2int(argv[1], &chan) != 0) {
+ lprintf(LOG_ERR, "Invalid channel: %s", argv[1]);
+ return -1;
+ }
+
+ argc -= 2;
+ argv += 2;
+
+ if (cmd == LANP_CMD_SET) {
+ if (argc && !strcasecmp(argv[0], "nolock")) {
+ nolock = 1;
+
+ argc -= 1;
+ argv += 1;
+ }
+ }
+
+ }
+
+ lp.intf = intf;
+ lp.channel = chan;
+
+ /*
+ * lock/commit/discard commands do not require parsing
+ * of parameter selection
+ */
+
+ switch (cmd) {
+ case LANP_CMD_LOCK:
+ lprintf(LOG_NOTICE, "Lock parameter(s)...");
+ return lanp_lock(&lp);
+
+ case LANP_CMD_COMMIT:
+ lprintf(LOG_NOTICE, "Commit parameter(s)...");
+ return lanp_commit(&lp);
+
+ case LANP_CMD_DISCARD:
+ lprintf(LOG_NOTICE, "Discard parameter(s)...");
+ return lanp_discard(&lp);
+ }
+
+ /*
+ * initialize configuration context and parse parameter selection
+ */
+
+ ipmi_cfgp_init(&ctx, lan_cfgp,
+ ARRAY_SIZE(lan_cfgp), "lan6 set nolock",
+ lanp_ip6_cfgp, &lp);
+
+ ret = ipmi_cfgp_parse_sel(&ctx, argc, (const char **)argv, &sel);
+ if (ret == -1) {
+ lanp_print_usage(cmd);
+ ipmi_cfgp_uninit(&ctx);
+ return -1;
+ }
+
+ argc -= ret;
+ argv += ret;
+
+ /*
+ * handle the rest commands
+ */
+
+ switch (cmd) {
+ case LANP_CMD_SAVE:
+ case LANP_CMD_PRINT:
+ lprintf(LOG_NOTICE, "Getting parameter(s)...");
+
+ ret = ipmi_cfgp_get(&ctx, &sel);
+ if (ret != 0) {
+ break;
+ }
+
+ if (cmd == LANP_CMD_SAVE) {
+ static char cmd[20];
+ FILE *out = stdout;
+ snprintf(cmd, sizeof(cmd) - 1, "lan6 set %d nolock",
+ lp.channel);
+ cmd[sizeof(cmd) - 1] = '\0';
+ ctx.cmdname = cmd;
+ fprintf(out, "lan6 lock %d\n", lp.channel);
+ ret = ipmi_cfgp_save(&ctx, &sel, out);
+ fprintf(out, "lan6 commit %d\nlan6 discard %d\nexit\n",
+ lp.channel, lp.channel);
+ } else {
+ ret = ipmi_cfgp_print(&ctx, &sel, stdout);
+ }
+ break;
+
+ case LANP_CMD_SET:
+ ret = ipmi_cfgp_parse_data(&ctx, &sel, argc,
+ (const char **)argv);
+ if (ret != 0) {
+ break;
+ }
+
+ lprintf(LOG_NOTICE, "Setting parameter(s)...");
+
+ if (!nolock) {
+ ret = lanp_lock(&lp);
+ if (ret != 0) {
+ break;
+ }
+ }
+
+ ret = ipmi_cfgp_set(&ctx, &sel);
+ if (!nolock) {
+ if (ret == 0) {
+ ret = lanp_commit(&lp);
+ } else {
+ lanp_discard(&lp);
+ }
+ }
+ break;
+ }
+
+ /*
+ * free allocated memory
+ */
+ ipmi_cfgp_uninit(&ctx);
+
+ return ret;
+}
diff --git a/lib/ipmi_main.c b/lib/ipmi_main.c
index e6f96f6..a673a30 100644
--- a/lib/ipmi_main.c
+++ b/lib/ipmi_main.c
@@ -29,11 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE 700
-#define _BSD_SOURCE || \
- (_XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
- !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
#include <stdlib.h>
#include <stdio.h>
@@ -47,6 +42,7 @@
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
+#include <locale.h>
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
@@ -70,18 +66,20 @@
#include <ipmitool/ipmi_user.h>
#include <ipmitool/ipmi_raw.h>
#include <ipmitool/ipmi_pef.h>
+#include <ipmitool/ipmi_time.h>
#include <ipmitool/ipmi_oem.h>
#include <ipmitool/ipmi_ekanalyzer.h>
#include <ipmitool/ipmi_picmg.h>
#include <ipmitool/ipmi_kontronoem.h>
#include <ipmitool/ipmi_vita.h>
+#include <ipmitool/ipmi_quantaoem.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef ENABLE_ALL_OPTIONS
-# define OPTION_STRING "I:46hVvcgsEKYao:H:d:P:f:U:p:C:L:A:t:T:m:z:S:l:b:B:e:k:y:O:R:N:D:"
+# define OPTION_STRING "I:46hVvcgsEKYao:H:d:P:f:U:p:C:L:A:t:T:m:z:S:l:b:B:e:k:y:O:R:N:D:Z"
#else
# define OPTION_STRING "I:46hVvcH:f:U:p:d:S:D:"
#endif
@@ -90,8 +88,6 @@
void
ipmi_intf_set_max_request_data_size(struct ipmi_intf * intf, uint16_t size);
-extern int verbose;
-extern int csv_output;
extern const struct valstr ipmi_privlvl_vals[];
extern const struct valstr ipmi_authtype_session_vals[];
@@ -113,14 +109,14 @@ ipmi_password_file_read(char * filename)
int l;
pass = malloc(21);
- if (pass == NULL) {
+ if (!pass) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
memset(pass, 0, 21);
fp = ipmi_open_file_read((const char *)filename);
- if (fp == NULL) {
+ if (!fp) {
lprintf(LOG_ERR, "Unable to open password file %s",
filename);
free(pass);
@@ -128,7 +124,7 @@ ipmi_password_file_read(char * filename)
}
/* read in id */
- if (fgets(pass, 21, fp) == NULL) {
+ if (!fgets(pass, 21, fp)) {
lprintf(LOG_ERR, "Unable to read password from file %s",
filename);
free(pass);
@@ -157,10 +153,10 @@ ipmi_cmd_print(struct ipmi_cmd * cmdlist)
struct ipmi_cmd * cmd;
int hdr = 0;
- if (cmdlist == NULL)
+ if (!cmdlist)
return;
- for (cmd=cmdlist; cmd->func != NULL; cmd++) {
- if (cmd->desc == NULL)
+ for (cmd=cmdlist; cmd->func; cmd++) {
+ if (!cmd->desc)
continue;
if (hdr == 0) {
lprintf(LOG_NOTICE, "Commands:");
@@ -182,7 +178,7 @@ ipmi_cmd_print(struct ipmi_cmd * cmdlist)
* @argc: command argument count
* @argv: command argument list
*
- * returns value from func() of that commnad if found
+ * returns value from func() of that command if found
* returns -1 if command is not found
*/
int
@@ -191,25 +187,25 @@ ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv)
struct ipmi_cmd * cmd = intf->cmdlist;
/* hook to run a default command if nothing specified */
- if (name == NULL) {
- if (cmd->func == NULL || cmd->name == NULL)
+ if (!name) {
+ if (!cmd->func || !cmd->name)
return -1;
- else if (strncmp(cmd->name, "default", 7) == 0)
+
+ if (!strcmp(cmd->name, "default"))
return cmd->func(intf, 0, NULL);
- else {
- lprintf(LOG_ERR, "No command provided!");
- ipmi_cmd_print(intf->cmdlist);
- return -1;
- }
+
+ lprintf(LOG_ERR, "No command provided!");
+ ipmi_cmd_print(intf->cmdlist);
+ return -1;
}
- for (cmd=intf->cmdlist; cmd->func != NULL; cmd++) {
- if (strncmp(name, cmd->name, __maxlen(cmd->name, name)) == 0)
+ for (cmd=intf->cmdlist; cmd->func; cmd++) {
+ if (!strcmp(name, cmd->name))
break;
}
- if (cmd->func == NULL) {
+ if (!cmd->func) {
cmd = intf->cmdlist;
- if (strncmp(cmd->name, "default", 7) == 0)
+ if (!strcmp(cmd->name, "default"))
return cmd->func(intf, argc+1, argv-1);
lprintf(LOG_ERR, "Invalid command: %s", name);
@@ -263,12 +259,13 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
lprintf(LOG_NOTICE, " -O seloem Use file for OEM SEL event descriptions");
lprintf(LOG_NOTICE, " -N seconds Specify timeout for lan [default=2] / lanplus [default=1] interface");
lprintf(LOG_NOTICE, " -R retry Set the number of retries for lan/lanplus interface [default=4]");
+ lprintf(LOG_NOTICE, " -Z Display all dates in UTC");
#endif
lprintf(LOG_NOTICE, "");
ipmi_intf_print(intflist);
- if (cmdlist != NULL)
+ if (cmdlist)
ipmi_cmd_print(cmdlist);
}
/* ipmi_catch_sigint - Handle the interrupt signal (Ctrl-C), close the
@@ -281,7 +278,7 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
*/
void ipmi_catch_sigint()
{
- if (ipmi_main_intf != NULL) {
+ if (ipmi_main_intf) {
printf("\nSIGN INT: Close Interface %s\n",ipmi_main_intf->desc);
/* reduce retry count to a single retry */
ipmi_main_intf->ssn_params.retry = 1;
@@ -291,69 +288,6 @@ void ipmi_catch_sigint()
exit(-1);
}
-/* ipmi_parse_hex - convert hexadecimal numbers to ascii string
- * Input string must be composed of two-characer hexadecimal numbers.
- * There is no separator between the numbers. Each number results in one character
- * of the converted string.
- *
- * Example: ipmi_parse_hex("50415353574F5244") returns 'PASSWORD'
- *
- * @param str: input string. It must contain only even number of '0'-'9','a'-'f' and 'A-F' characters.
- * @returns converted ascii string
- * @returns NULL on error
- */
-static unsigned char *
-ipmi_parse_hex(const char *str)
-{
- const char * p;
- unsigned char * out, *q;
- unsigned char b = 0;
- int shift = 4;
-
- if (strlen(str) == 0)
- return NULL;
-
- if (strlen(str) % 2 != 0) {
- lprintf(LOG_ERR, "Number of hex_kg characters is not even");
- return NULL;
- }
-
- if (strlen(str) > (IPMI_KG_BUFFER_SIZE-1)*2) {
- lprintf(LOG_ERR, "Kg key is too long");
- return NULL;
- }
-
- out = calloc(IPMI_KG_BUFFER_SIZE, sizeof(unsigned char));
- if (out == NULL) {
- lprintf(LOG_ERR, "malloc failure");
- return NULL;
- }
-
- for (p = str, q = out; *p; p++) {
- if (!isxdigit(*p)) {
- lprintf(LOG_ERR, "Kg_hex is not hexadecimal number");
- free(out);
- out = NULL;
- return NULL;
- }
-
- if (*p < 'A') /* it must be 0-9 */
- b = *p - '0';
- else /* it's A-F or a-f */
- b = (*p | 0x20) - 'a' + 10; /* convert to lowercase and to 10-15 */
-
- *q = *q + (b << shift);
- if (shift)
- shift = 0;
- else {
- shift = 4;
- q++;
- }
- }
-
- return out;
-}
-
static uint8_t
ipmi_acquire_ipmb_address(struct ipmi_intf * intf)
{
@@ -386,6 +320,7 @@ ipmi_main(int argc, char ** argv,
uint8_t target_addr = 0;
uint8_t target_channel = 0;
+ uint8_t u8tmp = 0;
uint8_t transit_addr = 0;
uint8_t transit_channel = 0;
uint8_t target_lun = 0;
@@ -406,21 +341,32 @@ ipmi_main(int argc, char ** argv,
char * progname = NULL;
char * oemtype = NULL;
char * sdrcache = NULL;
- unsigned char * kgkey = NULL;
+ uint8_t kgkey[IPMI_KG_BUFFER_SIZE];
char * seloem = NULL;
int port = 0;
int devnum = 0;
- int cipher_suite_id = 3; /* See table 22-19 of the IPMIv2 spec */
+#ifdef IPMI_INTF_LANPLUS
+ /* lookup best cipher suite available */
+ enum cipher_suite_ids cipher_suite_id = IPMI_LANPLUS_CIPHER_SUITE_RESERVED;
+#endif /* IPMI_INTF_LANPLUS */
int argflag, i, found;
int rc = -1;
int ai_family = AF_UNSPEC;
char sol_escape_char = SOL_ESCAPE_CHARACTER_DEFAULT;
char * devfile = NULL;
+ /* Set program locale according to system settings */
+ setlocale(LC_ALL, "");
+
+
/* save program name */
progname = strrchr(argv[0], '/');
- progname = ((progname == NULL) ? argv[0] : progname+1);
+ progname = ((!progname) ? argv[0] : progname+1);
signal(SIGINT, ipmi_catch_sigint);
+ memset(kgkey, 0, sizeof(kgkey));
+
+ /* setup log */
+ log_init(progname, 0, 0);
while ((argflag = getopt(argc, (char **)argv, OPTION_STRING)) != -1)
{
@@ -431,17 +377,18 @@ ipmi_main(int argc, char ** argv,
intfname = NULL;
}
intfname = strdup(optarg);
- if (intfname == NULL) {
+ if (!intfname) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
- if (intflist != NULL) {
+ if (intflist) {
found = 0;
- for (sup=intflist; sup->name != NULL; sup++) {
- if (strncmp(sup->name, intfname, strlen(intfname)) == 0 &&
- strncmp(sup->name, intfname, strlen(sup->name)) == 0 &&
- sup->supported == 1)
+ for (sup=intflist; sup->name; sup++) {
+ if (!strcmp(sup->name, intfname)
+ && sup->supported)
+ {
found = 1;
+ }
}
if (!found) {
lprintf(LOG_ERR, "Interface %s not supported", intfname);
@@ -487,21 +434,24 @@ ipmi_main(int argc, char ** argv,
goto out_free;
}
break;
+#ifdef IPMI_INTF_LANPLUS
case 'C':
- if (str2int(optarg, &cipher_suite_id) != 0) {
- lprintf(LOG_ERR, "Invalid parameter given or out of range for '-C'.");
- rc = -1;
- goto out_free;
- }
- /* add check Cipher is -gt 0 */
- if (cipher_suite_id < 0) {
- lprintf(LOG_ERR, "Cipher suite ID %i is invalid.", cipher_suite_id);
+ /* Cipher Suite ID is a byte as per IPMI specification */
+ if (str2uchar(optarg, &u8tmp) != 0) {
+ lprintf(LOG_ERR, "Invalid parameter given or out of "
+ "range [0-255] for '-C'.");
rc = -1;
goto out_free;
}
+ cipher_suite_id = u8tmp;
break;
+#endif /* IPMI_INTF_LANPLUS */
case 'v':
- verbose++;
+ log_level_set(++verbose);
+ if (verbose == 2) {
+ /* add version info to debug output */
+ lprintf(LOG_DEBUG, "%s version %s\n", progname, VERSION);
+ }
break;
case 'c':
csv_output = 1;
@@ -512,7 +462,7 @@ ipmi_main(int argc, char ** argv,
hostname = NULL;
}
hostname = strdup(optarg);
- if (hostname == NULL) {
+ if (!hostname) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -523,7 +473,7 @@ ipmi_main(int argc, char ** argv,
password = NULL;
}
password = ipmi_password_file_read(optarg);
- if (password == NULL)
+ if (!password)
lprintf(LOG_ERR, "Unable to read password "
"from file %s", optarg);
break;
@@ -533,52 +483,44 @@ ipmi_main(int argc, char ** argv,
#else
tmp_pass = getpass("Password: ");
#endif
- if (tmp_pass != NULL) {
+ if (tmp_pass) {
if (password) {
free(password);
password = NULL;
}
password = strdup(tmp_pass);
tmp_pass = NULL;
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
}
break;
case 'k':
- if (kgkey) {
- free(kgkey);
- kgkey = NULL;
- }
- kgkey = strdup(optarg);
- if (kgkey == NULL) {
- lprintf(LOG_ERR, "%s: malloc failure", progname);
- goto out_free;
- }
+ memset(kgkey, 0, sizeof(kgkey));
+ strncpy((char *)kgkey, optarg, sizeof(kgkey) - 1);
break;
case 'K':
if ((tmp_env = getenv("IPMI_KGKEY"))) {
- if (kgkey) {
- free(kgkey);
- kgkey = NULL;
- }
- kgkey = strdup(tmp_env);
- if (kgkey == NULL) {
- lprintf(LOG_ERR, "%s: malloc failure", progname);
- goto out_free;
- }
+ memset(kgkey, 0, sizeof(kgkey));
+ strncpy((char *)kgkey, tmp_env,
+ sizeof(kgkey) - 1);
} else {
lprintf(LOG_WARN, "Unable to read kgkey from environment");
}
break;
case 'y':
- if (kgkey) {
- free(kgkey);
- kgkey = NULL;
- }
- kgkey = ipmi_parse_hex(optarg);
- if (kgkey == NULL) {
+ memset(kgkey, 0, sizeof(kgkey));
+
+ rc = ipmi_parse_hex(optarg, kgkey, sizeof(kgkey) - 1);
+ if (rc == -1) {
+ lprintf(LOG_ERR, "Number of Kg key characters is not even");
+ goto out_free;
+ } else if (rc == -3) {
+ lprintf(LOG_ERR, "Kg key is not hexadecimal number");
+ goto out_free;
+ } else if (rc > (IPMI_KG_BUFFER_SIZE-1)) {
+ lprintf(LOG_ERR, "Kg key is too long");
goto out_free;
}
break;
@@ -588,17 +530,11 @@ ipmi_main(int argc, char ** argv,
#else
tmp_pass = getpass("Key: ");
#endif
- if (tmp_pass != NULL) {
- if (kgkey) {
- free(kgkey);
- kgkey = NULL;
- }
- kgkey = strdup(tmp_pass);
+ if (tmp_pass) {
+ memset(kgkey, 0, sizeof(kgkey));
+ strncpy((char *)kgkey, tmp_pass,
+ sizeof(kgkey) - 1);
tmp_pass = NULL;
- if (kgkey == NULL) {
- lprintf(LOG_ERR, "%s: malloc failure", progname);
- goto out_free;
- }
}
break;
case 'U':
@@ -611,7 +547,7 @@ ipmi_main(int argc, char ** argv,
goto out_free;
}
username = strdup(optarg);
- if (username == NULL) {
+ if (!username) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -622,7 +558,7 @@ ipmi_main(int argc, char ** argv,
sdrcache = NULL;
}
sdrcache = strdup(optarg);
- if (sdrcache == NULL) {
+ if (!sdrcache) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -634,7 +570,7 @@ ipmi_main(int argc, char ** argv,
free(devfile);
}
devfile = strdup(optarg);
- if (devfile == NULL) {
+ if (!devfile) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -678,12 +614,13 @@ ipmi_main(int argc, char ** argv,
oemtype = NULL;
}
oemtype = strdup(optarg);
- if (oemtype == NULL) {
+ if (!oemtype) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
- if (strncmp(oemtype, "list", 4) == 0 ||
- strncmp(oemtype, "help", 4) == 0) {
+ if (!strcmp(oemtype, "list")
+ || !strcmp(oemtype, "help"))
+ {
ipmi_oem_print();
rc = 0;
goto out_free;
@@ -711,7 +648,7 @@ ipmi_main(int argc, char ** argv,
password = NULL;
}
password = strdup(optarg);
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -727,7 +664,7 @@ ipmi_main(int argc, char ** argv,
password = NULL;
}
password = strdup(tmp_env);
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -738,7 +675,7 @@ ipmi_main(int argc, char ** argv,
password = NULL;
}
password = strdup(tmp_env);
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -812,7 +749,7 @@ ipmi_main(int argc, char ** argv,
seloem = NULL;
}
seloem = strdup(optarg);
- if (seloem == NULL) {
+ if (!seloem) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -839,6 +776,9 @@ ipmi_main(int argc, char ** argv,
goto out_free;
}
break;
+ case 'Z':
+ time_in_utc = 1;
+ break;
#endif
default:
ipmi_option_usage(progname, cmdlist, intflist);
@@ -847,8 +787,9 @@ ipmi_main(int argc, char ** argv,
}
/* check for command before doing anything */
- if (argc-optind > 0 &&
- strncmp(argv[optind], "help", 4) == 0) {
+ if (argc-optind > 0
+ && !strcmp(argv[optind], "help"))
+ {
ipmi_cmd_print(cmdlist);
rc = 0;
goto out_free;
@@ -862,17 +803,17 @@ ipmi_main(int argc, char ** argv,
* and the authtype was not explicitly set to NONE
* then prompt the user.
*/
- if (hostname != NULL && password == NULL &&
+ if (hostname && !password &&
(authtype != IPMI_SESSION_AUTHTYPE_NONE || authtype < 0)) {
#ifdef HAVE_GETPASSPHRASE
tmp_pass = getpassphrase("Password: ");
#else
tmp_pass = getpass("Password: ");
#endif
- if (tmp_pass != NULL) {
+ if (tmp_pass) {
password = strdup(tmp_pass);
tmp_pass = NULL;
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
@@ -884,52 +825,54 @@ ipmi_main(int argc, char ** argv,
* otherwise the default is hardcoded
* to use the first entry in the list
*/
- if (intfname == NULL && hostname != NULL) {
+ if (!intfname && hostname) {
intfname = strdup("lan");
- if (intfname == NULL) {
+ if (!intfname) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
}
- if (password != NULL && intfname != NULL) {
- if (strcmp(intfname, "lan") == 0 && strlen(password) > 16) {
+ if (password && intfname) {
+ if (!strcmp(intfname, "lan") && strlen(password) > 16) {
lprintf(LOG_ERR, "%s: password is longer than 16 bytes.", intfname);
rc = -1;
goto out_free;
- } else if (strcmp(intfname, "lanplus") == 0 && strlen(password) > 20) {
+ } else if (!strcmp(intfname, "lanplus") && strlen(password) > 20) {
lprintf(LOG_ERR, "%s: password is longer than 20 bytes.", intfname);
rc = -1;
goto out_free;
}
- } /* if (password != NULL && intfname != NULL) */
+ }
/* load interface */
ipmi_main_intf = ipmi_intf_load(intfname);
- if (ipmi_main_intf == NULL) {
+ if (!ipmi_main_intf) {
lprintf(LOG_ERR, "Error loading interface %s", intfname);
goto out_free;
}
- /* setup log */
- log_init(progname, 0, verbose);
+ /* load the IANA PEN registry */
+ if (ipmi_oem_info_init()) {
+ lprintf(LOG_ERR, "Failed to initialize the OEM info dictionary");
+ goto out_free;
+ }
/* run OEM setup if found */
- if (oemtype != NULL &&
+ if (oemtype &&
ipmi_oem_setup(ipmi_main_intf, oemtype) < 0) {
lprintf(LOG_ERR, "OEM setup for \"%s\" failed", oemtype);
goto out_free;
}
/* set session variables */
- if (hostname != NULL)
+ if (hostname)
ipmi_intf_session_set_hostname(ipmi_main_intf, hostname);
- if (username != NULL)
+ if (username)
ipmi_intf_session_set_username(ipmi_main_intf, username);
- if (password != NULL)
+ if (password)
ipmi_intf_session_set_password(ipmi_main_intf, password);
- if (kgkey != NULL)
- ipmi_intf_session_set_kgkey(ipmi_main_intf, kgkey);
+ ipmi_intf_session_set_kgkey(ipmi_main_intf, kgkey);
if (port > 0)
ipmi_intf_session_set_port(ipmi_main_intf, port);
if (authtype >= 0)
@@ -947,7 +890,9 @@ ipmi_main(int argc, char ** argv,
ipmi_intf_session_set_lookupbit(ipmi_main_intf, lookupbit);
ipmi_intf_session_set_sol_escape_char(ipmi_main_intf, sol_escape_char);
+#ifdef IPMI_INTF_LANPLUS
ipmi_intf_session_set_cipher_suite_id(ipmi_main_intf, cipher_suite_id);
+#endif /* IPMI_INTF_LANPLUS */
ipmi_main_intf->devnum = devnum;
@@ -957,7 +902,7 @@ ipmi_main(int argc, char ** argv,
ipmi_main_intf->ai_family = ai_family;
/* Open the interface with the specified or default IPMB address */
ipmi_main_intf->my_addr = arg_addr ? arg_addr : IPMI_BMC_SLAVE_ADDR;
- if (ipmi_main_intf->open != NULL) {
+ if (ipmi_main_intf->open) {
if (ipmi_main_intf->open(ipmi_main_intf) < 0) {
goto out_free;
}
@@ -1052,11 +997,11 @@ ipmi_main(int argc, char ** argv,
ipmi_main_intf->target_ipmb_addr);
/* parse local SDR cache if given */
- if (sdrcache != NULL) {
- ipmi_sdr_list_cache_fromfile(ipmi_main_intf, sdrcache);
+ if (sdrcache) {
+ ipmi_sdr_list_cache_fromfile(sdrcache);
}
/* Parse SEL OEM file if given */
- if (seloem != NULL) {
+ if (seloem) {
ipmi_sel_oem_init(seloem);
}
@@ -1093,41 +1038,37 @@ ipmi_main(int argc, char ** argv,
ipmi_cleanup(ipmi_main_intf);
/* call interface close function if available */
- if (ipmi_main_intf->opened > 0 && ipmi_main_intf->close != NULL)
+ if (ipmi_main_intf->opened && ipmi_main_intf->close)
ipmi_main_intf->close(ipmi_main_intf);
out_free:
log_halt();
- if (intfname != NULL) {
+ if (intfname) {
free(intfname);
intfname = NULL;
}
- if (hostname != NULL) {
+ if (hostname) {
free(hostname);
hostname = NULL;
}
- if (username != NULL) {
+ if (username) {
free(username);
username = NULL;
}
- if (password != NULL) {
+ if (password) {
free(password);
password = NULL;
}
- if (oemtype != NULL) {
+ if (oemtype) {
free(oemtype);
oemtype = NULL;
}
- if (seloem != NULL) {
+ if (seloem) {
free(seloem);
seloem = NULL;
}
- if (kgkey != NULL) {
- free(kgkey);
- kgkey = NULL;
- }
- if (sdrcache != NULL) {
+ if (sdrcache) {
free(sdrcache);
sdrcache = NULL;
}
@@ -1136,6 +1077,8 @@ ipmi_main(int argc, char ** argv,
devfile = NULL;
}
+ ipmi_oem_info_free();
+
return rc;
}
diff --git a/lib/ipmi_mc.c b/lib/ipmi_mc.c
index 5b4a080..a594347 100644
--- a/lib/ipmi_mc.c
+++ b/lib/ipmi_mc.c
@@ -34,6 +34,10 @@
#include <string.h>
#include <stdio.h>
#include <time.h>
+#include <limits.h>
+#include <stdbool.h>
+
+#include <arpa/inet.h>
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
@@ -42,6 +46,7 @@
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_mc.h>
#include <ipmitool/ipmi_strings.h>
+#include <ipmitool/ipmi_time.h>
extern int verbose;
@@ -81,14 +86,14 @@ ipmi_mc_reset(struct ipmi_intf * intf, int cmd)
if (cmd == BMC_COLD_RESET)
intf->abort = 1;
- if (cmd == BMC_COLD_RESET && rsp == NULL) {
+ if (cmd == BMC_COLD_RESET && !rsp) {
/* This is expected. See 20.2 Cold Reset Command, p.243, IPMIv2.0 rev1.0 */
- } else if (rsp == NULL) {
+ } else if (!rsp) {
lprintf(LOG_ERR, "MC reset command failed.");
return (-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "MC reset command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return (-1);
}
@@ -181,13 +186,13 @@ printf_mc_usage(void)
struct bitfield_data * bf;
lprintf(LOG_NOTICE, "MC Commands:");
lprintf(LOG_NOTICE, " reset <warm|cold>");
- lprintf(LOG_NOTICE, " guid");
+ lprintf(LOG_NOTICE, " guid [auto|smbios|ipmi|rfc4122|dump]");
lprintf(LOG_NOTICE, " info");
lprintf(LOG_NOTICE, " watchdog <get|reset|off>");
lprintf(LOG_NOTICE, " selftest");
lprintf(LOG_NOTICE, " getenables");
lprintf(LOG_NOTICE, " setenables <option=on|off> ...");
- for (bf = mc_enables_bf; bf->name != NULL; bf++) {
+ for (bf = mc_enables_bf; bf->name; bf++) {
lprintf(LOG_NOTICE, " %-20s %s", bf->name, bf->desc);
}
printf_sysinfo_usage(0);
@@ -230,15 +235,38 @@ printf_sysinfo_usage(int full_help)
static void
print_watchdog_usage(void)
{
- lprintf(LOG_NOTICE, "usage: watchdog <command>:");
- lprintf(LOG_NOTICE, " get : Get Current Watchdog settings");
- lprintf(LOG_NOTICE, " reset : Restart Watchdog timer based on most recent settings");
- lprintf(LOG_NOTICE, " off : Shut off a running Watchdog timer");
+ lprintf(LOG_NOTICE,
+"usage: watchdog <command>:\n"
+"\n"
+" set <option[=value]> [<option[=value]> ...]\n"
+" Set Watchdog settings\n"
+" Options: (* = mandatory)\n"
+" timeout=<1-6553> - [0] Initial countdown value, sec\n"
+" pretimeout=<1-255> - [0] Pre-timeout interval, sec\n"
+" int=<smi|nmi|msg> - [-] Pre-timeout interrupt type\n"
+" use=<frb2|post|osload|sms|oem> - [-] Timer use\n"
+" clear=<frb2|post|osload|sms|oem> - [-] Clear timer use expiration\n"
+" flag, can be specified\n"
+" multiple times\n"
+" action=<reset|poweroff|cycle|none> - [none] Timer action\n"
+" nolog - [-] Don't log the timer use\n"
+" dontstop - [-] Don't stop the timer\n"
+" while applying settings\n"
+"\n"
+" get\n"
+" Get Current settings\n"
+"\n"
+" reset\n"
+" Restart Watchdog timer based on the most recent settings\n"
+"\n"
+" off\n"
+" Shut off a running Watchdog timer"
+ );
}
/* ipmi_mc_get_enables - print out MC enables
*
- * @intf: ipmi inteface
+ * @intf: ipmi interface
*
* returns 0 on success
* returns -1 on error
@@ -255,17 +283,17 @@ ipmi_mc_get_enables(struct ipmi_intf * intf)
req.msg.cmd = BMC_GET_GLOBAL_ENABLES;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Global Enables command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Global Enables command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return -1;
}
- for (bf = mc_enables_bf; bf->name != NULL; bf++) {
+ for (bf = mc_enables_bf; bf->name; bf++) {
printf("%-40s : %sabled\n", bf->desc,
rsp->data[0] & bf->mask ? "en" : "dis");
}
@@ -275,7 +303,7 @@ ipmi_mc_get_enables(struct ipmi_intf * intf)
/* ipmi_mc_set_enables - set MC enable flags
*
- * @intf: ipmi inteface
+ * @intf: ipmi interface
* @argc: argument count
* @argv: argument list
*
@@ -295,7 +323,7 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
printf_mc_usage();
return (-1);
}
- else if (strncmp(argv[0], "help", 4) == 0) {
+ else if (!strcmp(argv[0], "help")) {
printf_mc_usage();
return 0;
}
@@ -305,28 +333,28 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
req.msg.cmd = BMC_GET_GLOBAL_ENABLES;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Global Enables command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Global Enables command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return -1;
}
en = rsp->data[0];
for (i = 0; i < argc; i++) {
- for (bf = mc_enables_bf; bf->name != NULL; bf++) {
+ for (bf = mc_enables_bf; bf->name; bf++) {
int nl = strlen(bf->name);
- if (strncmp(argv[i], bf->name, nl) != 0)
+ if (strcmp(argv[i], bf->name))
continue;
- if (strncmp(argv[i]+nl+1, "off", 3) == 0) {
+ if (!strcmp(argv[i]+nl+1, "off")) {
printf("Disabling %s\n", bf->desc);
en &= ~bf->mask;
}
- else if (strncmp(argv[i]+nl+1, "on", 2) == 0) {
+ else if (!strcmp(argv[i]+nl+1, "on")) {
printf("Enabling %s\n", bf->desc);
en |= bf->mask;
}
@@ -347,13 +375,13 @@ ipmi_mc_set_enables(struct ipmi_intf * intf, int argc, char ** argv)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Global Enables command failed");
return -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Set Global Enables command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return -1;
}
@@ -397,13 +425,13 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Device ID command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Device ID command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return -1;
}
@@ -421,18 +449,15 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
printf("Manufacturer ID : %lu\n",
(long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id));
printf("Manufacturer Name : %s\n",
- val2str( (long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
- ipmi_oem_info) );
+ OEM_MFG_STRING(devid->manufacturer_id));
printf("Product ID : %u (0x%02x%02x)\n",
buf2short((uint8_t *)(devid->product_id)),
devid->product_id[1], devid->product_id[0]);
- product=oemval2str(IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id),
- (devid->product_id[1]<<8)+devid->product_id[0],
- ipmi_oem_product_info);
+ product = OEM_PROD_STRING(devid->manufacturer_id, devid->product_id);
- if (product!=NULL) {
+ if (product) {
printf("Product Name : %s\n", product);
}
@@ -462,73 +487,297 @@ ipmi_mc_get_deviceid(struct ipmi_intf * intf)
return 0;
}
-/* Structure follow the IPMI V.2 Rev 1.0
- * See Table 20-10 */
-#ifdef HAVE_PRAGMA_PACK
-#pragma pack(1)
-#endif
-
-struct ipmi_guid {
- uint32_t time_low; /* timestamp low field */
- uint16_t time_mid; /* timestamp middle field */
- uint16_t time_hi_and_version; /* timestamp high field and version number */
- uint8_t clock_seq_hi_variant;/* clock sequence high field and variant */
- uint8_t clock_seq_low; /* clock sequence low field */
- uint8_t node[6]; /* node */
-} ATTRIBUTE_PACKING;
-#ifdef HAVE_PRAGMA_PACK
-#pragma pack(0)
-#endif
-
-/* ipmi_mc_get_guid - print this MC GUID
+/* _ipmi_mc_get_guid - Gets BMCs GUID according to (22.14)
*
* @intf: ipmi interface
+ * @guid: pointer where to store BMC GUID
*
- * returns 0 on success
- * returns -1 on error
+ * returns - negative number means error, positive is a ccode.
*/
-static int
-ipmi_mc_get_guid(struct ipmi_intf * intf)
+int
+_ipmi_mc_get_guid(struct ipmi_intf *intf, ipmi_guid_t *guid)
{
- struct ipmi_rs * rsp;
+ struct ipmi_rs *rsp;
struct ipmi_rq req;
- struct ipmi_guid guid;
+ if (!guid) {
+ return (-3);
+ }
+ memset(guid, 0, sizeof(ipmi_guid_t));
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = BMC_GET_GUID;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_ERR, "Get GUID command failed");
- return -1;
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 16
+ || rsp->data_len != sizeof(ipmi_guid_t)) {
+ return (-2);
}
- if (rsp->ccode > 0) {
- lprintf(LOG_ERR, "Get GUID command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
- return -1;
+ memcpy(guid, &rsp->data[0], sizeof(ipmi_guid_t));
+ return 0;
+}
+
+/* A helper function to convert GUID time to time_t */
+static time_t _guid_time(uint64_t t_low, uint64_t t_mid, uint64_t t_hi)
+{
+ /* GUID time-stamp is a 60-bit value representing the
+ * count of 100ns intervals since 00:00:00.00, 15 Oct 1582 */
+
+ const uint64_t t100ns_in_sec = 10000000LL;
+
+ /* Seconds from 15 Oct 1582 to 1 Jan 1970 00:00:00 */
+ uint64_t epoch_since_gregorian = 12219292800;
+
+ /* 100ns intervals since 15 Oct 1582 00:00:00 */
+ uint64_t gregorian = (GUID_TIME_HI(t_hi) << 48)
+ | (t_mid << 32)
+ | t_low;
+ time_t unixtime; /* We need timestamp in seconds since UNIX epoch */
+
+ gregorian /= t100ns_in_sec; /* Convert to seconds */
+ unixtime = gregorian - epoch_since_gregorian;
+
+ return unixtime;
+}
+
+#define TM_YEAR_BASE 1900
+#define EPOCH_YEAR 1970
+static bool _is_time_valid(time_t t)
+{
+ time_t t_now = time(NULL);
+ struct tm tm;
+ struct tm now;
+
+ gmtime_r(&t, &tm);
+ gmtime_r(&t_now, &now);
+
+ /* It's enought to check that the year fits in [Epoch .. now] interval */
+
+ if (tm.tm_year + TM_YEAR_BASE < EPOCH_YEAR)
+ return false;
+
+ if (tm.tm_year > now.tm_year) {
+ /* GUID timestamp can't be in future */
+ return false;
+ }
+
+ return true;
+}
+
+/** ipmi_mc_parse_guid - print-out given BMC GUID
+ *
+ * The function parses the raw guid data according to the requested encoding
+ * mode. If GUID_AUTO mode is requested, then automatic detection of encoding
+ * is attempted using the version nibble of the time_hi_and_version field of
+ * each of the supported encodings.
+ *
+ * Considering the rather random nature of GUIDs, it may happen that the
+ * version nibble is valid for multiple encodings at the same time. That's why
+ * if the version is 1 (time-based), the function will also check validity of
+ * the time stamp. If a valid time stamp is found for a given mode, the mode is
+ * considered detected and no further checks are performed. Otherwise other
+ * encodings are probed the same way. If in neither encoding the valid version
+ * nibble happened to indicate time-based version or no valid time-stamp has
+ * been found, then the last probed encoding with valid version nibble is
+ * considered detected. If none of the probed encodings indicated a valid
+ * version nibble, then fall back to GUID_DUMP
+ *
+ * @param[in] guid - The original GUID data as received from BMC
+ * @param[in] mode - The requested mode/encoding
+ *
+ * @returns parsed GUID
+ */
+parsed_guid_t ipmi_parse_guid(void *guid, ipmi_guid_mode_t guid_mode)
+{
+ ipmi_guid_mode_t i;
+ ipmi_guid_t *ipmi_guid = guid;
+ rfc_guid_t *rfc_guid = guid;
+ parsed_guid_t parsed_guid = { 0 };
+ uint32_t t_low[GUID_REAL_MODES];
+ uint16_t t_mid[GUID_REAL_MODES];
+ uint16_t t_hi[GUID_REAL_MODES];
+ uint16_t clk[GUID_REAL_MODES];
+ time_t seconds[GUID_REAL_MODES];
+ bool detect = false;
+
+ /* Unless another mode is detected, default to dumping */
+ if (GUID_AUTO == guid_mode) {
+ detect = true;
+ guid_mode = GUID_DUMP;
}
- if (rsp->data_len == sizeof(struct ipmi_guid)) {
- char tbuf[40];
- time_t s;
- memset(tbuf, 0, 40);
- memset(&guid, 0, sizeof(struct ipmi_guid));
- memcpy(&guid, rsp->data, rsp->data_len);
+ /* Try to convert time using all possible methods to use
+ * the result later if GUID_AUTO is requested */
+
+ /* For IPMI all fields are little-endian (LSB first) */
+ t_hi[GUID_IPMI] = ipmi16toh(&ipmi_guid->time_hi_and_version);
+ t_mid[GUID_IPMI] = ipmi16toh(&ipmi_guid->time_mid);
+ t_low[GUID_IPMI] = ipmi32toh(&ipmi_guid->time_low);
+ clk[GUID_IPMI] = ipmi16toh(&ipmi_guid->clock_seq_and_rsvd);
+
+ /* For RFC4122 all fields are in network byte order (MSB first) */
+ t_hi[GUID_RFC4122] = ntohs(rfc_guid->time_hi_and_version);
+ t_mid[GUID_RFC4122] = ntohs(rfc_guid->time_mid);
+ t_low[GUID_RFC4122] = ntohl(rfc_guid->time_low);
+ clk[GUID_RFC4122] = ntohs(rfc_guid->clock_seq_and_rsvd);
+
+ /* For SMBIOS time fields are little-endian (as in IPMI), the rest is
+ * in network order (as in RFC4122) */
+ t_hi[GUID_SMBIOS] = ipmi16toh(&rfc_guid->time_hi_and_version);
+ t_mid[GUID_SMBIOS] = ipmi16toh(&rfc_guid->time_mid);
+ t_low[GUID_SMBIOS] = ipmi32toh(&rfc_guid->time_low);
+ clk[GUID_SMBIOS] = ntohs(rfc_guid->clock_seq_and_rsvd);
+
+ /* Using 0 here to allow for reordering of modes in ipmi_guid_mode_t */
+ for (i = 0; i < GUID_REAL_MODES; ++i) {
+ seconds[i] = _guid_time(t_low[i], t_mid[i], t_hi[i]);
+
+ /* If autodetection was initially requested and mode
+ * hasn't been detected yet */
+ if (detect) {
+ guid_version_t ver = GUID_VERSION(t_hi[i]);
+ if (is_guid_version_valid(ver)) {
+ guid_mode = i;
+ if (GUID_VERSION_TIME == ver && _is_time_valid(seconds[i])) {
+ break;
+ }
+ }
+ }
+ }
- /* Kipp - changed order of last field (node) to follow specification */
- printf("System GUID : %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x\n",
- guid.time_low, guid.time_mid, guid.time_hi_and_version,
- guid.clock_seq_hi_variant << 8 | guid.clock_seq_low,
- guid.node[0], guid.node[1], guid.node[2],
- guid.node[3], guid.node[4], guid.node[5]);
+ if (guid_mode >= GUID_REAL_MODES) {
+ guid_mode = GUID_DUMP;
+ /* The endianness and field order are irrelevant for dump mode */
+ memcpy(&parsed_guid, guid, sizeof(ipmi_guid_t));
+ goto out;
+ }
- s = (time_t)guid.time_low; /* Kipp - removed the BSWAP_32, it was not needed here */
- strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&s));
- printf("Timestamp : %s\n", tbuf);
+ /*
+ * Return only a valid version in the parsed version field.
+ * If one needs the raw value, they still may use
+ * GUID_VERSION(parsed_guid.time_hi_and_version)
+ */
+ parsed_guid.ver = GUID_VERSION(t_hi[guid_mode]);
+ if (parsed_guid.ver > GUID_VERSION_MAX) {
+ parsed_guid.ver = GUID_VERSION_UNKNOWN;
}
- else {
- lprintf(LOG_ERR, "Invalid GUID length %d", rsp->data_len);
+
+ if (GUID_VERSION_TIME == parsed_guid.ver) {
+ parsed_guid.time = seconds[guid_mode];
+ }
+
+ if (GUID_IPMI == guid_mode) {
+ /*
+ * In IPMI all fields are little-endian (LSB first)
+ * That is, first byte last. Hence, swap before copying.
+ */
+ memcpy(parsed_guid.node,
+ array_byteswap(ipmi_guid->node, GUID_NODE_SZ),
+ GUID_NODE_SZ);
+ } else {
+ /*
+ * For RFC4122 and SMBIOS the node field is in network byte order.
+ * That is first byte first. Hence, copy as is.
+ */
+ memcpy(parsed_guid.node, rfc_guid->node, GUID_NODE_SZ);
+ }
+
+ parsed_guid.time_low = t_low[guid_mode];
+ parsed_guid.time_mid = t_mid[guid_mode];
+ parsed_guid.time_hi_and_version = t_hi[guid_mode];
+ parsed_guid.clock_seq_and_rsvd = clk[guid_mode];
+
+out:
+ parsed_guid.mode = guid_mode;
+ return parsed_guid;
+}
+
+/* ipmi_mc_print_guid - print-out given BMC GUID
+ *
+ * @param[in] intf - The IPMI interface to request GUID from
+ * @param[in] guid_mode - GUID decoding mode
+ *
+ * @returns status code
+ * @retval 0 - Success
+ * @retval -1 - Error
+ */
+static int
+ipmi_mc_print_guid(struct ipmi_intf *intf, ipmi_guid_mode_t guid_mode)
+{
+ /* Allocate a byte array for ease of use in dump mode */
+ uint8_t guid_data[sizeof(ipmi_guid_t)];
+
+ /* These are host architecture specific */
+ parsed_guid_t guid;
+
+ const char *guid_ver_str[GUID_VERSION_COUNT] = {
+ [GUID_VERSION_UNKNOWN] = "Unknown/unsupported",
+ [GUID_VERSION_TIME] = "Time-based",
+ [GUID_VERSION_DCE] = "DCE Security with POSIX UIDs (not for IPMI)",
+ [GUID_VERSION_MD5] = "Name-based using MD5",
+ [GUID_VERSION_RND] = "Random or pseudo-random",
+ [GUID_VERSION_SHA1] = "Name-based using SHA-1"
+ };
+
+ const char *guid_mode_str[GUID_TOTAL_MODES] = {
+ [GUID_IPMI] = "IPMI",
+ [GUID_RFC4122] = "RFC4122",
+ [GUID_SMBIOS] = "SMBIOS",
+ [GUID_AUTO] = "Automatic (if you see this, report a bug)",
+ [GUID_DUMP] = "Unknown (data dumped)"
+ };
+
+ int rc;
+
+ rc = _ipmi_mc_get_guid(intf, (ipmi_guid_t *)guid_data);
+ if (eval_ccode(rc) != 0) {
+ return (-1);
+ }
+
+ printf("System GUID : ");
+
+ guid = ipmi_parse_guid(guid_data, guid_mode);
+ if (GUID_DUMP == guid.mode) {
+ size_t i;
+ for (i = 0; i < sizeof(guid_data); ++i) {
+ printf("%02X", guid_data[i]);
+ }
+ printf("\n");
+ return 0;
+ }
+
+ printf("%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x\n",
+ (int)guid.time_low,
+ (int)guid.time_mid,
+ (int)guid.time_hi_and_version,
+ guid.clock_seq_and_rsvd,
+ guid.node[0], guid.node[1], guid.node[2],
+ guid.node[3], guid.node[4], guid.node[5]);
+
+ if (GUID_AUTO == guid_mode) {
+ /* ipmi_parse_guid() returns only valid modes in guid.ver */
+ printf("GUID Encoding : %s", guid_mode_str[guid.mode]);
+ if (GUID_IPMI != guid.mode) {
+ printf(" (WARNING: IPMI Specification violation!)");
+ }
+ printf("\n");
+ }
+
+ printf("GUID Version : %s", guid_ver_str[guid.ver]);
+
+ switch (guid.ver) {
+ case GUID_VERSION_UNKNOWN:
+ printf(" (%d)\n", GUID_VERSION((int)guid.time_hi_and_version));
+ break;
+ case GUID_VERSION_TIME:
+ printf("\nTimestamp : %s\n", ipmi_timestamp_numeric(guid.time));
+ break;
+ default:
+ printf("\n");
}
return 0;
@@ -558,7 +807,7 @@ static int ipmi_mc_get_selftest(struct ipmi_intf * intf)
if (rsp->ccode) {
lprintf(LOG_ERR, "Bad response: (%s)",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return -1;
}
@@ -582,7 +831,7 @@ static int ipmi_mc_get_selftest(struct ipmi_intf * intf)
printf(" -> SEL device not accessible\n");
}
if (sft_res->test & IPM_SELFTEST_SDR_ERROR) {
- printf(" -> SDR repository not accesible\n");
+ printf(" -> SDR repository not accessible\n");
}
if (sft_res->test & IPM_SELFTEST_FRU_ERROR) {
printf("FRU device not accessible\n");
@@ -624,6 +873,63 @@ static int ipmi_mc_get_selftest(struct ipmi_intf * intf)
return rv;
}
+struct wdt_string_s {
+ const char *get; /* The name of 'timer use' for `watchdog get` command */
+ const char *set; /* The name of 'timer use' for `watchdog set` command */
+};
+
+
+#define WDTS(g,s) &(const struct wdt_string_s){ (g), (s) }
+
+const struct wdt_string_s *wdt_use[] = {
+ WDTS("Reserved", "none"),
+ WDTS("BIOS FRB2", "frb2"),
+ WDTS("BIOS/POST", "post"),
+ WDTS("OS Load", "osload"),
+ WDTS("SMS/OS", "sms"),
+ WDTS("OEM", "oem"),
+ WDTS("Reserved", NULL),
+ WDTS("Reserved", NULL),
+ NULL
+};
+
+const struct wdt_string_s *wdt_int[] = {
+ WDTS("None", "none"),
+ WDTS("SMI", "smi"),
+ WDTS("NMI/Diagnostic", "nmi"),
+ WDTS("Messaging", "msg"),
+ WDTS("Reserved", NULL),
+ WDTS("Reserved", NULL),
+ WDTS("Reserved", NULL),
+ WDTS("Reserved", NULL),
+ NULL
+};
+
+const struct wdt_string_s *wdt_action[] = {
+ WDTS("No action", "none"),
+ WDTS("Hard Reset", "reset"),
+ WDTS("Power Down", "poweroff"),
+ WDTS("Power Cycle", "cycle"),
+ WDTS("Reserved", NULL),
+ WDTS("Reserved", NULL),
+ WDTS("Reserved", NULL),
+ WDTS("Reserved", NULL),
+ NULL
+};
+
+int find_set_wdt_string(const struct wdt_string_s *w[], const char *s)
+{
+ int val = 0;
+ while (w[val]) {
+ if (!strcmp(s, w[val]->set)) break;
+ ++val;
+ }
+ if (!w[val]) {
+ return -1;
+ }
+ return val;
+}
+
/* ipmi_mc_get_watchdog
*
* @intf: ipmi interface
@@ -631,35 +937,15 @@ static int ipmi_mc_get_selftest(struct ipmi_intf * intf)
* returns 0 on success
* returns -1 on error
*/
-
-const char *wdt_use_string[8] = {
- "Reserved",
- "BIOS FRB2",
- "BIOS/POST",
- "OS Load",
- "SMS/OS",
- "OEM",
- "Reserved",
- "Reserved"
-};
-
-const char *wdt_action_string[8] = {
- "No action",
- "Hard Reset",
- "Power Down",
- "Power Cycle",
- "Reserved",
- "Reserved",
- "Reserved",
- "Reserved"
-};
-
static int
ipmi_mc_get_watchdog(struct ipmi_intf * intf)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct ipm_get_watchdog_rsp * wdt_res;
+ double init_cnt;
+ double pres_cnt;
+ size_t i;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
@@ -667,35 +953,226 @@ ipmi_mc_get_watchdog(struct ipmi_intf * intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Watchdog Timer command failed");
return -1;
}
if (rsp->ccode) {
lprintf(LOG_ERR, "Get Watchdog Timer command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return -1;
}
wdt_res = (struct ipm_get_watchdog_rsp *) rsp->data;
+ /* Convert 100ms intervals to seconds */
+ init_cnt = (double)ipmi16toh(&wdt_res->init_cnt_le) / 10.0;
+ pres_cnt = (double)ipmi16toh(&wdt_res->pres_cnt_le) / 10.0;
+
printf("Watchdog Timer Use: %s (0x%02x)\n",
- wdt_use_string[(wdt_res->timer_use & 0x07 )], wdt_res->timer_use);
+ wdt_use[IPMI_WDT_GET(wdt_res->use, USE)]->get, wdt_res->use);
printf("Watchdog Timer Is: %s\n",
- wdt_res->timer_use & 0x40 ? "Started/Running" : "Stopped");
- printf("Watchdog Timer Actions: %s (0x%02x)\n",
- wdt_action_string[(wdt_res->timer_actions&0x07)], wdt_res->timer_actions);
+ IS_WDT_BIT(wdt_res->use, USE_RUNNING)
+ ? "Started/Running"
+ : "Stopped");
+ printf("Watchdog Timer Logging: %s\n",
+ IS_WDT_BIT(wdt_res->use, USE_NOLOG)
+ ? "Off"
+ : "On");
+ printf("Watchdog Timer Action: %s (0x%02x)\n",
+ wdt_action[IPMI_WDT_GET(wdt_res->intr_action, ACTION)]->get,
+ wdt_res->intr_action);
+ printf("Pre-timeout interrupt: %s\n",
+ wdt_int[IPMI_WDT_GET(wdt_res->intr_action, INTR)]->get);
printf("Pre-timeout interval: %d seconds\n", wdt_res->pre_timeout);
- printf("Timer Expiration Flags: 0x%02x\n", wdt_res->timer_use_exp);
- printf("Initial Countdown: %i sec\n",
- ((wdt_res->initial_countdown_msb << 8) | wdt_res->initial_countdown_lsb)/10);
- printf("Present Countdown: %i sec\n",
- (((wdt_res->present_countdown_msb << 8) | wdt_res->present_countdown_lsb)) / 10);
+ printf("Timer Expiration Flags: %s(0x%02x)\n",
+ wdt_res->exp_flags ? "" : "None ",
+ wdt_res->exp_flags);
+ for (i = 0; i < sizeof(wdt_res->exp_flags) * CHAR_BIT; ++i) {
+ if (IS_SET(wdt_res->exp_flags, i)) {
+ printf(" * %s\n", wdt_use[i]->get);
+ }
+ }
+ printf("Initial Countdown: %0.1f sec\n", init_cnt);
+ printf("Present Countdown: %0.1f sec\n", pres_cnt);
return 0;
}
+/* Configuration to set with ipmi_mc_set_watchdog() */
+typedef struct ipmi_mc_set_wdt_conf_s {
+ uint16_t timeout;
+ uint8_t pretimeout;
+ uint8_t intr;
+ uint8_t use;
+ uint8_t clear;
+ uint8_t action;
+ bool nolog;
+ bool dontstop;
+} wdt_conf_t;
+
+/* Options parser for ipmi_mc_set_watchdog() */
+static bool
+parse_set_wdt_options(wdt_conf_t *conf, int argc, char *argv[])
+{
+ const int MAX_TIMEOUT = 6553; /* Seconds, makes almost USHRT_MAX when
+ converted to 100ms intervals */
+ const int MAX_PRETIMEOUT = 255; /* Seconds */
+ bool error = true;
+ int i;
+
+ if (!argc || !strcmp(argv[0], "help")) {
+ goto out;
+ }
+
+ for (i = 0; i < argc; ++i) {
+ long val;
+ char *vstr = strchr(argv[i], '=');
+ if (vstr)
+ vstr++; /* Point to the value */
+
+ switch (argv[i][0]) { /* only check the first letter to allow for
+ shortcuts */
+ case 't': /* timeout */
+ val = strtol(vstr, NULL, 10);
+ if (val < 1 || val > MAX_TIMEOUT) {
+ lprintf(LOG_ERR, "Timeout value %lu is out of range (1-%d)\n",
+ val, MAX_TIMEOUT);
+ goto out;
+ }
+ conf->timeout = val * 10; /* Convert seconds to 100ms intervals */
+ break;
+ case 'p': /* pretimeout */
+ val = strtol(vstr, NULL, 10);
+ if (val < 1 || val > MAX_PRETIMEOUT) {
+ lprintf(LOG_ERR,
+ "Pretimeout value %lu is out of range (1-%d)\n",
+ val, MAX_PRETIMEOUT);
+ goto out;
+ }
+ conf->pretimeout = val; /* Convert seconds to 100ms intervals */
+ break;
+ case 'i': /* int */
+ if (0 > (val = find_set_wdt_string(wdt_int, vstr))) {
+ lprintf(LOG_ERR, "Interrupt type '%s' is not valid\n", vstr);
+ goto out;
+ }
+ conf->intr = val;
+ break;
+ case 'u': /* use */
+ if (0 > (val = find_set_wdt_string(wdt_use, vstr))) {
+ lprintf(LOG_ERR, "Use '%s' is not valid\n", vstr);
+ goto out;
+ }
+ conf->use = val;
+ break;
+ case 'a': /* action */
+ if (0 > (val = find_set_wdt_string(wdt_action, vstr))) {
+ lprintf(LOG_ERR, "Use '%s' is not valid\n", vstr);
+ goto out;
+ }
+ conf->action = val;
+ break;
+ case 'c': /* clear */
+ if (0 > (val = find_set_wdt_string(wdt_use, vstr))) {
+ lprintf(LOG_ERR, "Use '%s' is not valid\n", vstr);
+ goto out;
+ }
+ conf->clear |= 1 << val;
+ break;
+ case 'n': /* nolog */
+ conf->nolog = true;
+ break;
+ case 'd': /* dontstop */
+ conf->dontstop = true;
+ break;
+
+ default:
+ lprintf(LOG_ERR, "Invalid option '%s'", argv[i]);
+ break;
+ }
+ }
+
+ error = false;
+
+out:
+ return error;
+}
+
+/* ipmi_mc_set_watchdog
+ *
+ * @intf: ipmi interface
+ * @argc: argument count
+ * @argv: arguments
+ *
+ * returns 0 on success
+ * returns non-zero (-1 or IPMI completion code) on error
+ */
+static int
+ipmi_mc_set_watchdog(struct ipmi_intf * intf, int argc, char *argv[])
+{
+ struct ipmi_rs * rsp;
+ struct ipmi_rq req = {0};
+ unsigned char msg_data[6] = {0};
+ int rc = -1;
+ wdt_conf_t conf = {0};
+ bool options_error = parse_set_wdt_options(&conf, argc, argv);
+
+ /* Fill data bytes according to IPMI 2.0 Spec section 27.6 */
+ msg_data[0] = conf.nolog << IPMI_WDT_USE_NOLOG_SHIFT;
+ msg_data[0] |= conf.dontstop << IPMI_WDT_USE_DONTSTOP_SHIFT;
+ msg_data[0] |= conf.use & IPMI_WDT_USE_MASK;
+
+ msg_data[1] = (conf.intr & IPMI_WDT_INTR_MASK) << IPMI_WDT_INTR_SHIFT;
+ msg_data[1] |= conf.action & IPMI_WDT_ACTION_MASK;
+
+ msg_data[2] = conf.pretimeout;
+
+ msg_data[3] = conf.clear;
+
+ htoipmi16(conf.timeout, &msg_data[4]);
+
+ req.msg.netfn = IPMI_NETFN_APP;
+ req.msg.cmd = BMC_SET_WATCHDOG_TIMER;
+ req.msg.data_len = 6;
+ req.msg.data = msg_data;
+
+ lprintf(LOG_INFO,
+ "Sending Set Watchdog command [%02X %02X %02X %02X %02X %02X]:"
+ , msg_data[0], msg_data[1], msg_data[2]
+ , msg_data[3], msg_data[4], msg_data[5]
+ );
+ lprintf(LOG_INFO, " - nolog = %d", conf.nolog);
+ lprintf(LOG_INFO, " - dontstop = %d", conf.dontstop);
+ lprintf(LOG_INFO, " - use = 0x%02hhX", conf.use);
+ lprintf(LOG_INFO, " - intr = 0x%02hhX", conf.intr);
+ lprintf(LOG_INFO, " - action = 0x%02hhX", conf.action);
+ lprintf(LOG_INFO, " - pretimeout = %hhu", conf.pretimeout);
+ lprintf(LOG_INFO, " - clear = 0x%02hhX", conf.clear);
+ lprintf(LOG_INFO, " - timeout = %hu", conf.timeout);
+
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ lprintf(LOG_ERR, "Set Watchdog Timer command failed");
+ goto out;
+ }
+
+ rc = rsp->ccode;
+ if (rc) {
+ lprintf(LOG_ERR, "Set Watchdog Timer command failed: %s",
+ CC_STRING(rsp->ccode));
+ goto out;
+ }
+
+ lprintf(LOG_NOTICE, "Watchdog Timer was successfully configured");
+
+out:
+ if (options_error) print_watchdog_usage();
+
+ return rc;
+}
+
/* ipmi_mc_shutoff_watchdog
*
* @intf: ipmi interface
@@ -736,14 +1213,14 @@ ipmi_mc_shutoff_watchdog(struct ipmi_intf * intf)
msg_data[5] = 0x0b; /* countdown msb - 5 mins */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Watchdog Timer Shutoff command failed!");
return -1;
}
if (rsp->ccode) {
lprintf(LOG_ERR, "Watchdog Timer Shutoff command failed! %s",
- val2str(rsp->ccode, completion_code_vals));
+ CC_STRING(rsp->ccode));
return -1;
}
@@ -771,16 +1248,16 @@ ipmi_mc_rst_watchdog(struct ipmi_intf * intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Reset Watchdog Timer command failed!");
return -1;
}
if (rsp->ccode) {
lprintf(LOG_ERR, "Reset Watchdog Timer command failed: %s",
- (rsp->ccode == IPM_WATCHDOG_RESET_ERROR) ?
- "Attempt to reset uninitialized watchdog" :
- val2str(rsp->ccode, completion_code_vals));
+ (rsp->ccode == IPM_WATCHDOG_RESET_ERROR)
+ ? "Attempt to reset uninitialized watchdog"
+ : CC_STRING(rsp->ccode));
return -1;
}
@@ -807,24 +1284,24 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
printf_mc_usage();
rc = (-1);
}
- else if (strncmp(argv[0], "help", 4) == 0) {
+ else if (!strcmp(argv[0], "help")) {
printf_mc_usage();
rc = 0;
}
- else if (strncmp(argv[0], "reset", 5) == 0) {
+ else if (!strcmp(argv[0], "reset")) {
if (argc < 2) {
lprintf(LOG_ERR, "Not enough parameters given.");
printf_mc_reset_usage();
rc = (-1);
}
- else if (strncmp(argv[1], "help", 4) == 0) {
+ else if (!strcmp(argv[1], "help")) {
printf_mc_reset_usage();
rc = 0;
}
- else if (strncmp(argv[1], "cold", 4) == 0) {
+ else if (!strcmp(argv[1], "cold")) {
rc = ipmi_mc_reset(intf, BMC_COLD_RESET);
}
- else if (strncmp(argv[1], "warm", 4) == 0) {
+ else if (!strcmp(argv[1], "warm")) {
rc = ipmi_mc_reset(intf, BMC_WARM_RESET);
}
else {
@@ -833,38 +1310,68 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = (-1);
}
}
- else if (strncmp(argv[0], "info", 4) == 0) {
+ else if (!strcmp(argv[0], "info")) {
rc = ipmi_mc_get_deviceid(intf);
}
- else if (strncmp(argv[0], "guid", 4) == 0) {
- rc = ipmi_mc_get_guid(intf);
+ else if (!strcmp(argv[0], "guid")) {
+ ipmi_guid_mode_t guid_mode = GUID_AUTO;
+
+ /* Allow for 'rfc' and 'rfc4122' */
+ if (argc > 1) {
+ if (!strcmp(argv[1], "rfc")) {
+ guid_mode = GUID_RFC4122;
+ }
+ else if (!strcmp(argv[1], "smbios")) {
+ guid_mode = GUID_SMBIOS;
+ }
+ else if (!strcmp(argv[1], "ipmi")) {
+ guid_mode = GUID_IPMI;
+ }
+ else if (!strcmp(argv[1], "auto")) {
+ guid_mode = GUID_AUTO;
+ }
+ else if (!strcmp(argv[1], "dump")) {
+ guid_mode = GUID_DUMP;
+ }
+ }
+ rc = ipmi_mc_print_guid(intf, guid_mode);
}
- else if (strncmp(argv[0], "getenables", 10) == 0) {
+ else if (!strcmp(argv[0], "getenables")) {
rc = ipmi_mc_get_enables(intf);
}
- else if (strncmp(argv[0], "setenables", 10) == 0) {
+ else if (!strcmp(argv[0], "setenables")) {
rc = ipmi_mc_set_enables(intf, argc-1, &(argv[1]));
}
- else if (!strncmp(argv[0], "selftest", 8)) {
+ else if (!strcmp(argv[0], "selftest")) {
rc = ipmi_mc_get_selftest(intf);
}
- else if (!strncmp(argv[0], "watchdog", 8)) {
+ else if (!strcmp(argv[0], "watchdog")) {
if (argc < 2) {
lprintf(LOG_ERR, "Not enough parameters given.");
print_watchdog_usage();
rc = (-1);
}
- else if (strncmp(argv[1], "help", 4) == 0) {
+ else if (!strcmp(argv[1], "help")) {
print_watchdog_usage();
rc = 0;
}
- else if (strncmp(argv[1], "get", 3) == 0) {
+ else if (!strcmp(argv[1], "set")) {
+ if (argc < 3) { /* Requires options */
+ lprintf(LOG_ERR, "Not enough parameters given.");
+ print_watchdog_usage();
+ rc = (-1);
+ }
+ else {
+ rc = ipmi_mc_set_watchdog(intf, argc - 2, &(argv[2]));
+ }
+ }
+ else if (!strcmp(argv[1], "get")) {
rc = ipmi_mc_get_watchdog(intf);
}
- else if(strncmp(argv[1], "off", 3) == 0) {
+ else if (!strcmp(argv[1], "off")) {
rc = ipmi_mc_shutoff_watchdog(intf);
}
- else if(strncmp(argv[1], "reset", 5) == 0) {
+ else if (!strcmp(argv[1], "reset")) {
rc = ipmi_mc_rst_watchdog(intf);
}
else {
@@ -873,10 +1380,10 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = (-1);
}
}
- else if (strncmp(argv[0], "getsysinfo", 10) == 0) {
+ else if (!strcmp(argv[0], "getsysinfo")) {
rc = ipmi_sysinfo_main(intf, argc, argv, 0);
}
- else if (strncmp(argv[0], "setsysinfo", 10) == 0) {
+ else if (!strcmp(argv[0], "setsysinfo")) {
rc = ipmi_sysinfo_main(intf, argc, argv, 1);
}
else {
@@ -968,10 +1475,10 @@ ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
* u8 data0[14]
*/
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL)
+ if (!rsp)
return (-1);
- if (rsp->ccode == 0) {
+ if (!rsp->ccode) {
if (len > rsp->data_len)
len = rsp->data_len;
if (len && buffer)
@@ -1010,7 +1517,7 @@ ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer)
* u8 data1[16]
*/
rsp = intf->sendrecv(intf, &req);
- if (rsp != NULL) {
+ if (rsp) {
return rsp->ccode;
}
return -1;
@@ -1021,10 +1528,10 @@ ipmi_sysinfo_main(struct ipmi_intf *intf, int argc, char ** argv, int is_set)
{
char *str;
unsigned char infostr[256];
- unsigned char paramdata[18];
+ char paramdata[18];
int len, maxset, param, pos, rc, set;
- if (argc == 2 && strcmp(argv[1], "help") == 0) {
+ if (argc == 2 && !strcmp(argv[1], "help")) {
printf_sysinfo_usage(1);
return 0;
}
@@ -1108,7 +1615,7 @@ ipmi_sysinfo_main(struct ipmi_intf *intf, int argc, char ** argv, int is_set)
}
else if (rc > 0) {
lprintf(LOG_ERR, "%s command failed: %s", argv[0],
- val2str(rc, completion_code_vals));
+ CC_STRING(rc));
}
return rc;
}
diff --git a/lib/ipmi_oem.c b/lib/ipmi_oem.c
index 96db2ea..d7cf9aa 100644
--- a/lib/ipmi_oem.c
+++ b/lib/ipmi_oem.c
@@ -37,8 +37,9 @@
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_sel.h>
-static int ipmi_oem_supermicro(struct ipmi_intf * intf);
-static int ipmi_oem_ibm(struct ipmi_intf * intf);
+static int ipmi_oem_supermicro(struct ipmi_intf *intf);
+static int ipmi_oem_ibm(struct ipmi_intf *intf);
+static int ipmi_oem_quanta(struct ipmi_intf *intf);
static struct ipmi_oem_handle ipmi_oem_list[] = {
{
@@ -71,36 +72,49 @@ static struct ipmi_oem_handle ipmi_oem_list[] = {
.name = "kontron",
.desc = "Kontron OEM big buffer support"
},
+ {
+ .name = "quanta",
+ .desc = "Quanta IPMIv1.5 BMC with OEM LAN authentication support",
+ .setup = ipmi_oem_quanta,
+ },
{ 0 }
};
/* Supermicro IPMIv2 BMCs use OEM authtype */
static int
-ipmi_oem_supermicro(struct ipmi_intf * intf)
+ipmi_oem_supermicro(struct ipmi_intf *intf)
{
ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
return 0;
}
static int
-ipmi_oem_ibm(struct ipmi_intf * intf)
+ipmi_oem_ibm(struct ipmi_intf *__UNUSED__(intf))
{
- char * filename;
- if ((filename = getenv("IPMI_OEM_IBM_DATAFILE")) == NULL) {
+ char *filename = getenv("IPMI_OEM_IBM_DATAFILE");
+ if (!filename) {
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
return -1;
}
return ipmi_sel_oem_init((const char *)filename);
}
+/* Quanta IPMIv2 BMCs use OEM authtype */
+static int
+ipmi_oem_quanta(struct ipmi_intf *intf)
+{
+ ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
+ return 0;
+}
+
/* ipmi_oem_print - print list of OEM handles
*/
void
ipmi_oem_print(void)
{
- struct ipmi_oem_handle * oem;
+ struct ipmi_oem_handle *oem;
lprintf(LOG_NOTICE, "\nOEM Support:");
- for (oem=ipmi_oem_list; oem->name != NULL && oem->desc != NULL; oem++) {
+ for (oem=ipmi_oem_list; oem->name && oem->desc; oem++) {
lprintf(LOG_NOTICE, "\t%-12s %s", oem->name, oem->desc);
}
lprintf(LOG_NOTICE, "");
@@ -120,26 +134,27 @@ ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
struct ipmi_oem_handle * oem;
int rc = 0;
- if (oemtype == NULL ||
- strncmp(oemtype, "help", 4) == 0 ||
- strncmp(oemtype, "list", 4) == 0) {
+ if (!oemtype
+ || !strcmp(oemtype, "help")
+ || !strcmp(oemtype, "list"))
+ {
ipmi_oem_print();
return -1;
}
- for (oem=ipmi_oem_list; oem->name != NULL; oem++) {
- if (strncmp(oemtype, oem->name, strlen(oem->name)) == 0)
+ for (oem=ipmi_oem_list; oem->name; oem++) {
+ if (!strcmp(oemtype, oem->name))
break;
}
- if (oem->name == NULL)
+ if (!oem->name)
return -1;
/* save pointer for later use */
intf->oem = oem;
/* run optional setup function if it is defined */
- if (oem->setup != NULL) {
+ if (oem->setup) {
lprintf(LOG_DEBUG, "Running OEM setup for \"%s\"", oem->desc);
rc = oem->setup(intf);
}
@@ -158,10 +173,10 @@ ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
int
ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype)
{
- if (intf->oem == NULL)
+ if (!intf->oem)
return 0;
- if (strncmp(intf->oem->name, oemtype, strlen(oemtype)) == 0)
+ if (!strcmp(intf->oem->name, oemtype))
return 1;
return 0;
diff --git a/lib/ipmi_pef.c b/lib/ipmi_pef.c
index 22f29e4..ef8c5d4 100644
--- a/lib/ipmi_pef.c
+++ b/lib/ipmi_pef.c
@@ -36,10 +36,14 @@
#include <ipmitool/bswap.h>
#include <ipmitool/helper.h>
-#include <ipmitool/log.h>
#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_channel.h>
#include <ipmitool/ipmi_intf.h>
+#include <ipmitool/ipmi_mc.h>
#include <ipmitool/ipmi_pef.h>
+#include <ipmitool/ipmi_sel.h>
+#include <ipmitool/ipmi_time.h>
+#include <ipmitool/log.h>
extern int verbose;
/*
@@ -75,6 +79,309 @@ static const char * pef_flag_fmts[][3] = {
};
static const char * listitem[] = {" | %s", ",%s", "%s"};
+static struct bit_desc_map
+pef_b2s_actions = {
+BIT_DESC_MAP_ALL,
+{ {"Alert", PEF_ACTION_ALERT},
+ {"Power-off", PEF_ACTION_POWER_DOWN},
+ {"Reset", PEF_ACTION_RESET},
+ {"Power-cycle", PEF_ACTION_POWER_CYCLE},
+ {"OEM-defined", PEF_ACTION_OEM},
+ {"Diagnostic-interrupt", PEF_ACTION_DIAGNOSTIC_INTERRUPT},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_severities = {
+BIT_DESC_MAP_ANY,
+{ {"Non-recoverable", PEF_SEVERITY_NON_RECOVERABLE},
+ {"Critical", PEF_SEVERITY_CRITICAL},
+ {"Warning", PEF_SEVERITY_WARNING},
+ {"OK", PEF_SEVERITY_OK},
+ {"Information", PEF_SEVERITY_INFORMATION},
+ {"Monitor", PEF_SEVERITY_MONITOR},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_sensortypes = {
+BIT_DESC_MAP_LIST,
+{ {"Any", 255},
+ {"Temperature", 1},
+ {"Voltage", 2},
+ {"Current", 3},
+ {"Fan", 4},
+ {"Chassis Intrusion", 5},
+ {"Platform security breach", 6},
+ {"Processor", 7},
+ {"Power supply", 8},
+ {"Power Unit", 9},
+ {"Cooling device", 10},
+ {"Other (units-based)", 11},
+ {"Memory", 12},
+ {"Drive Slot", 13},
+ {"POST memory resize", 14},
+ {"POST error", 15},
+ {"Logging disabled", 16},
+ {"Watchdog 1", 17},
+ {"System event", 18},
+ {"Critical Interrupt", 19},
+ {"Button", 20},
+ {"Module/board", 21},
+ {"uController/coprocessor", 22},
+ {"Add-in card", 23},
+ {"Chassis", 24},
+ {"Chipset", 25},
+ {"Other (FRU)", 26},
+ {"Cable/interconnect", 27},
+ {"Terminator", 28},
+ {"System boot", 29},
+ {"Boot error", 30},
+ {"OS boot", 31},
+ {"OS critical stop", 32},
+ {"Slot/connector", 33},
+ {"ACPI power state", 34},
+ {"Watchdog 2", 35},
+ {"Platform alert", 36},
+ {"Entity presence", 37},
+ {"Monitor ASIC/IC", 38},
+ {"LAN", 39},
+ {"Management subsystem health", 40},
+ {"Battery", 41},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_1 = {
+BIT_DESC_MAP_LIST,
+{ {"<LNC", 0}, /* '<' : getting worse */
+ {">LNC", 1}, /* '>' : getting better */
+ {"<LC", 2},
+ {">LC", 3},
+ {"<LNR", 4},
+ {">LNR", 5},
+ {">UNC", 6},
+ {"<UNC", 7},
+ {">UC", 8},
+ {"<UC", 9},
+ {">UNR", 10},
+ {"<UNR", 11},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_2 = {
+BIT_DESC_MAP_LIST,
+{ {"transition to idle", 0},
+ {"transition to active", 1},
+ {"transition to busy", 2},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_3 = {
+BIT_DESC_MAP_LIST,
+{ {"state deasserted", 0},
+ {"state asserted", 1},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_4 = {
+BIT_DESC_MAP_LIST,
+{ {"predictive failure deasserted", 0},
+ {"predictive failure asserted", 1},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_5 = {
+BIT_DESC_MAP_LIST,
+{ {"limit not exceeded", 0},
+ {"limit exceeded", 1},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_6 = {
+BIT_DESC_MAP_LIST,
+{ {"performance met", 0},
+ {"performance lags", 1},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_7 = {
+BIT_DESC_MAP_LIST,
+{ {"ok", 0},
+ {"<warn", 1}, /* '<' : getting worse */
+ {"<fail", 2},
+ {"<dead", 3},
+ {">warn", 4}, /* '>' : getting better */
+ {">fail", 5},
+ {"dead", 6},
+ {"monitor", 7},
+ {"informational", 8},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_8 = {
+BIT_DESC_MAP_LIST,
+{ {"device removed/absent", 0},
+ {"device inserted/present", 1},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_9 = {
+BIT_DESC_MAP_LIST,
+{ {"device disabled", 0},
+ {"device enabled", 1},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_10 = {
+BIT_DESC_MAP_LIST,
+{ {"transition to running", 0},
+ {"transition to in test", 1},
+ {"transition to power off", 2},
+ {"transition to online", 3},
+ {"transition to offline", 4},
+ {"transition to off duty", 5},
+ {"transition to degraded", 6},
+ {"transition to power save", 7},
+ {"install error", 8},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_11 = {
+BIT_DESC_MAP_LIST,
+{ {"fully redundant", 0},
+ {"redundancy lost", 1},
+ {"redundancy degraded", 2},
+ {"<non-redundant/sufficient", 3}, /* '<' : getting worse */
+ {">non-redundant/sufficient", 4}, /* '>' : getting better */
+ {"non-redundant/insufficient", 5},
+ {"<redundancy degraded", 6},
+ {">redundancy degraded", 7},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_gentype_12 = {
+BIT_DESC_MAP_LIST,
+{ {"D0 power state", 0},
+ {"D1 power state", 1},
+ {"D2 power state", 2},
+ {"D3 power state", 3},
+ {NULL}
+} };
+
+static struct bit_desc_map *
+pef_b2s_generic_ER[] = {
+ &pef_b2s_gentype_1,
+ &pef_b2s_gentype_2,
+ &pef_b2s_gentype_3,
+ &pef_b2s_gentype_4,
+ &pef_b2s_gentype_5,
+ &pef_b2s_gentype_6,
+ &pef_b2s_gentype_7,
+ &pef_b2s_gentype_8,
+ &pef_b2s_gentype_9,
+ &pef_b2s_gentype_10,
+ &pef_b2s_gentype_11,
+ &pef_b2s_gentype_12,
+};
+#define PEF_B2S_GENERIC_ER_ENTRIES ARRAY_SIZE(pef_b2s_generic_ER)
+
+static struct bit_desc_map
+pef_b2s_policies = {
+BIT_DESC_MAP_LIST,
+{ {"Match-always", PEF_POLICY_FLAGS_MATCH_ALWAYS},
+ {"Try-next-entry", PEF_POLICY_FLAGS_PREV_OK_SKIP},
+ {"Try-next-set", PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET},
+ {"Try-next-channel", PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET},
+ {"Try-next-destination", PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_ch_medium = {
+#define PEF_CH_MEDIUM_TYPE_IPMB 1
+#define PEF_CH_MEDIUM_TYPE_ICMB_10 2
+#define PEF_CH_MEDIUM_TYPE_ICMB_09 3
+#define PEF_CH_MEDIUM_TYPE_LAN 4
+#define PEF_CH_MEDIUM_TYPE_SERIAL 5
+#define PEF_CH_MEDIUM_TYPE_XLAN 6
+#define PEF_CH_MEDIUM_TYPE_PCI_SMBUS 7
+#define PEF_CH_MEDIUM_TYPE_SMBUS_V1X 8
+#define PEF_CH_MEDIUM_TYPE_SMBUS_V2X 9
+#define PEF_CH_MEDIUM_TYPE_USB_V1X 10
+#define PEF_CH_MEDIUM_TYPE_USB_V2X 11
+#define PEF_CH_MEDIUM_TYPE_SYSTEM 12
+BIT_DESC_MAP_LIST,
+{ {"IPMB (I2C)", PEF_CH_MEDIUM_TYPE_IPMB},
+ {"ICMB v1.0", PEF_CH_MEDIUM_TYPE_ICMB_10},
+ {"ICMB v0.9", PEF_CH_MEDIUM_TYPE_ICMB_09},
+ {"802.3 LAN", PEF_CH_MEDIUM_TYPE_LAN},
+ {"Serial/Modem (RS-232)", PEF_CH_MEDIUM_TYPE_SERIAL},
+ {"Other LAN", PEF_CH_MEDIUM_TYPE_XLAN},
+ {"PCI SMBus", PEF_CH_MEDIUM_TYPE_PCI_SMBUS},
+ {"SMBus v1.0/1.1", PEF_CH_MEDIUM_TYPE_SMBUS_V1X},
+ {"SMBus v2.0", PEF_CH_MEDIUM_TYPE_SMBUS_V2X},
+ {"USB 1.x", PEF_CH_MEDIUM_TYPE_USB_V1X},
+ {"USB 2.x", PEF_CH_MEDIUM_TYPE_USB_V2X},
+ {"System I/F (KCS,SMIC,BT)", PEF_CH_MEDIUM_TYPE_SYSTEM},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_control = {
+BIT_DESC_MAP_ALL,
+{ {"PEF", PEF_CONTROL_ENABLE},
+ {"PEF event messages", PEF_CONTROL_ENABLE_EVENT_MESSAGES},
+ {"PEF startup delay", PEF_CONTROL_ENABLE_STARTUP_DELAY},
+ {"Alert startup delay", PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_lan_desttype = {
+BIT_DESC_MAP_LIST,
+{ {"Acknowledged", PEF_LAN_DEST_TYPE_ACK},
+ {"PET", PEF_LAN_DEST_TYPE_PET},
+ {"OEM 1", PEF_LAN_DEST_TYPE_OEM_1},
+ {"OEM 2", PEF_LAN_DEST_TYPE_OEM_2},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_serial_desttype = {
+BIT_DESC_MAP_LIST,
+{ {"Acknowledged", PEF_SERIAL_DEST_TYPE_ACK},
+ {"TAP page", PEF_SERIAL_DEST_TYPE_TAP},
+ {"PPP PET", PEF_SERIAL_DEST_TYPE_PPP},
+ {"Basic callback", PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK},
+ {"PPP callback", PEF_SERIAL_DEST_TYPE_PPP_CALLBACK},
+ {"OEM 1", PEF_SERIAL_DEST_TYPE_OEM_1},
+ {"OEM 2", PEF_SERIAL_DEST_TYPE_OEM_2},
+ {NULL}
+} };
+
+static struct bit_desc_map
+pef_b2s_tap_svc_confirm = {
+BIT_DESC_MAP_LIST,
+{ {"ACK", PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX},
+ {"211+ACK", PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX},
+ {"{211|213}+ACK", PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX},
+ {NULL}
+} };
+
+static int ipmi_pef2_list_filters(struct ipmi_intf *);
+
const char *
ipmi_pef_bit_desc(struct bit_desc_map * map, uint32_t value)
{ /*
@@ -184,6 +491,31 @@ ipmi_pef_print_1xd(const char * text, uint32_t val)
ipmi_pef_print_field(pef_fld_fmts[F_1XD], text, val);
}
+/* ipmi_pef_print_guid - print-out GUID. */
+static int
+ipmi_pef_print_guid(uint8_t *guid)
+{
+ if (!guid) {
+ return (-1);
+ }
+
+ if (verbose) {
+ printf("%-*s : %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
+ KYWD_LENGTH, "System GUID",
+ guid[0], guid[1], guid[2], guid[3], guid[4],
+ guid[5], guid[6], guid[7], guid[8], guid[9],
+ guid[10],guid[11], guid[12], guid[13], guid[14],
+ guid[15]);
+ } else {
+ printf(" | %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ guid[0], guid[1], guid[2], guid[3], guid[4],
+ guid[5], guid[6], guid[7], guid[8], guid[9],
+ guid[10], guid[11], guid[12], guid[13], guid[14],
+ guid[15]);
+ }
+ return 0;
+}
+
static struct ipmi_rs *
ipmi_pef_msg_exchange(struct ipmi_intf * intf, struct ipmi_rq * req, char * txt)
{ /*
@@ -204,58 +536,424 @@ ipmi_pef_msg_exchange(struct ipmi_intf * intf, struct ipmi_rq * req, char * txt)
return(rsp);
}
-static uint8_t
-ipmi_pef_get_policy_table(struct ipmi_intf * intf,
- struct pef_cfgparm_policy_table_entry ** table)
-{ /*
- // get the PEF policy table: allocate space, fillin, and return its size
- // NB: the caller must free the returned area (when returned size > 0)
- */
- struct ipmi_rs * rsp;
+/* _ipmi_get_pef_capabilities - Requests and returns result of (30.1) Get PEF
+ * Capabilities.
+ *
+ * @pcap - pointer where to store results.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+int
+_ipmi_get_pef_capabilities(struct ipmi_intf *intf,
+ struct pef_capabilities *pcap)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ if (!pcap) {
+ return (-3);
+ }
+
+ memset(pcap, 0, sizeof(struct pef_capabilities));
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_GET_PEF_CAPABILITIES;
+
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 3) {
+ return (-2);
+ }
+ pcap->version = rsp->data[0];
+ pcap->actions = rsp->data[1];
+ pcap->event_filter_count = rsp->data[2];
+ return 0;
+}
+
+/* _ipmi_get_pef_filter_entry - Fetches one Entry from Event Filter Table
+ * identified by Filter ID.
+ *
+ * @filter_id - Filter ID of Entry in Event Filter Table.
+ * @filter_entry - Pointer where to copy Filter Entry data.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+static int
+_ipmi_get_pef_filter_entry(struct ipmi_intf *intf, uint8_t filter_id,
+ struct pef_cfgparm_filter_table_entry *filter_entry)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ uint8_t data[3];
+ uint8_t data_len = 3 * sizeof(uint8_t);
+ int dest_size;
+ if (!filter_entry) {
+ return (-3);
+ }
+
+ dest_size = (int)sizeof(struct pef_cfgparm_filter_table_entry);
+ memset(filter_entry, 0, dest_size);
+ memset(&data, 0, data_len);
+ data[0] = PEF_CFGPARM_ID_PEF_FILTER_TABLE_ENTRY;
+ data[1] = filter_id;
+
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
+ req.msg.data = (uint8_t *)&data;
+ req.msg.data_len = data_len;
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 22 || (rsp->data_len - 1) != dest_size) {
+ return (-2);
+ }
+ memcpy(filter_entry, &rsp->data[1], dest_size);
+ return 0;
+}
+
+/* _ipmi_get_pef_filter_entry_cfg - Fetches configuration of one Entry from
+ * Event Filter Table identified by Filter ID.
+ *
+ * @filter_id - Filter ID of Entry in Event Filter Table.
+ * @filter_entry_cfg - Pointer where to copy Filter Entry configuration.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+int
+_ipmi_get_pef_filter_entry_cfg(struct ipmi_intf *intf, uint8_t filter_id,
+ struct pef_cfgparm_filter_table_data_1 *filter_cfg)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ uint8_t data[3];
+ uint8_t data_len = 3 * sizeof(uint8_t);
+ int dest_size;
+ if (!filter_cfg) {
+ return (-3);
+ }
+
+ dest_size = (int)sizeof(struct pef_cfgparm_filter_table_data_1);
+ memset(filter_cfg, 0, dest_size);
+ memset(&data, 0, data_len);
+ data[0] = PEF_CFGPARM_ID_PEF_FILTER_TABLE_DATA_1;
+ data[1] = filter_id;
+
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
+ req.msg.data = (uint8_t *)&data;
+ req.msg.data_len = data_len;
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 3 || (rsp->data_len - 1) != dest_size) {
+ return (-2);
+ }
+ memcpy(filter_cfg, &rsp->data[1], dest_size);
+ return 0;
+}
+
+/* _ipmi_get_pef_policy_entry - Fetches one Entry from Alert Policy Table
+ * identified by Policy ID.
+ *
+ * @policy_id - Policy ID of Entry in Alert Policy Table.
+ * @policy_entry - Pointer where to copy Policy Entry data.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+static int
+_ipmi_get_pef_policy_entry(struct ipmi_intf *intf, uint8_t policy_id,
+ struct pef_cfgparm_policy_table_entry *policy_entry)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ uint8_t data[3];
+ uint8_t data_len = 3 * sizeof(uint8_t);
+ int dest_size;
+ if (!policy_entry) {
+ return (-3);
+ }
+
+ dest_size = (int)sizeof(struct pef_cfgparm_policy_table_entry);
+ memset(policy_entry, 0, dest_size);
+ memset(&data, 0, data_len);
+ data[0] = PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_ENTRY;
+ data[1] = policy_id & PEF_POLICY_TABLE_ID_MASK;
+
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
+ req.msg.data = (uint8_t *)&data;
+ req.msg.data_len = data_len;
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 5 || (rsp->data_len - 1) != dest_size) {
+ return (-2);
+ }
+ memcpy(policy_entry, &rsp->data[1], dest_size);
+ return 0;
+}
+
+/* _ipmi_get_pef_filter_table_size - Fetch the Number of Event Filter Entries.
+ * If the number is 0, it means feature is not supported.
+ *
+ * @table_size - ptr to where to store number of entries.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+static int
+_ipmi_get_pef_filter_table_size(struct ipmi_intf *intf, uint8_t *table_size)
+{
+ struct ipmi_rs *rsp;
struct ipmi_rq req;
struct pef_cfgparm_selector psel;
- struct pef_cfgparm_policy_table_entry * ptbl, * ptmp;
- uint32_t i;
- uint8_t tbl_size;
+ if (!table_size) {
+ return (-3);
+ }
+
+ *table_size = 0;
+ memset(&psel, 0, sizeof(psel));
+ psel.id = PEF_CFGPARM_ID_PEF_FILTER_TABLE_SIZE;
+ memset(&req, 0, sizeof(req));
+
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
+ req.msg.data = (uint8_t *)&psel;
+ req.msg.data_len = sizeof(psel);
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 2) {
+ return (-2);
+ }
+ *table_size = rsp->data[1] & 0x7F;
+ return 0;
+}
+
+/* _ipmi_get_pef_policy_table_size - Fetch the Number of Alert Policy Entries. If the
+ * number is 0, it means feature is not supported.
+ *
+ * @table_size - ptr to where to store number of entries.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+static int
+_ipmi_get_pef_policy_table_size(struct ipmi_intf *intf, uint8_t *table_size)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ struct pef_cfgparm_selector psel;
+
+ if (!table_size) {
+ return (-3);
+ }
+
+ *table_size = 0;
memset(&psel, 0, sizeof(psel));
psel.id = PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_SIZE;
memset(&req, 0, sizeof(req));
+
req.msg.netfn = IPMI_NETFN_SE;
req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
req.msg.data = (uint8_t *)&psel;
req.msg.data_len = sizeof(psel);
- rsp = ipmi_pef_msg_exchange(intf, &req, "Alert policy table size");
- if (!rsp)
- return(0);
- tbl_size = (rsp->data[1] & PEF_POLICY_TABLE_SIZE_MASK);
- i = (tbl_size * sizeof(struct pef_cfgparm_policy_table_entry));
- if (!i
- || (ptbl = (struct pef_cfgparm_policy_table_entry *)malloc(i)) == NULL)
- return(0);
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 2) {
+ return (-2);
+ }
+ *table_size = rsp->data[1] & 0x7F;
+ return 0;
+}
+/* _ipmi_get_pef_system_guid - Fetches System GUID from PEF. This configuration
+ * parameter is optional. If data1 is 0x0, then this GUID is ignored by BMC.
+ *
+ * @system_guid - pointer where to store received data.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+int
+_ipmi_get_pef_system_guid(struct ipmi_intf *intf,
+ struct pef_cfgparm_system_guid *system_guid)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ struct pef_cfgparm_selector psel;
+ if (!system_guid) {
+ return (-3);
+ }
+
+ memset(system_guid, 0, sizeof(struct pef_cfgparm_system_guid));
memset(&psel, 0, sizeof(psel));
- psel.id = PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_ENTRY;
- for (ptmp=ptbl, i=1; i<=tbl_size; i++) {
- psel.set = (i & PEF_POLICY_TABLE_ID_MASK);
- rsp = ipmi_pef_msg_exchange(intf, &req, "Alert policy table entry");
- if (!rsp
- || i != (rsp->data[1] & PEF_POLICY_TABLE_ID_MASK)) {
- lprintf(LOG_ERR, " **Error retrieving %s",
- "Alert policy table entry");
- free(ptbl);
- ptbl = NULL;
- tbl_size = 0;
- break;
- }
- memcpy(ptmp, &rsp->data[1], sizeof(*ptmp));
- ptmp++;
+ psel.id = PEF_CFGPARM_ID_SYSTEM_GUID;
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
+ req.msg.data = (uint8_t *)&psel;
+ req.msg.data_len = sizeof(psel);
+
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ } else if (rsp->data_len != 18
+ || (rsp->data_len - 2) != sizeof(system_guid->guid)) {
+ return (-2);
+ }
+ system_guid->data1 = rsp->data[1] & 0x1;
+ memcpy(system_guid->guid, &rsp->data[2], sizeof(system_guid->guid));
+ return 0;
+}
+
+/* _ipmi_set_pef_filter_entry_cfg - Sets/updates configuration of Entry in Event
+ * Filter Table identified by Filter ID.
+ *
+ * @filter_id - ID of Entry in Event Filter Table to be updated
+ * @filter_cfg - Pointer to configuration data.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+static int
+_ipmi_set_pef_filter_entry_cfg(struct ipmi_intf *intf, uint8_t filter_id,
+ struct pef_cfgparm_filter_table_data_1 *filter_cfg)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ uint8_t data[3];
+ uint8_t data_len = 3 * sizeof(uint8_t);
+ if (!filter_cfg) {
+ return (-3);
+ }
+
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_SET_PEF_CONFIG_PARMS;
+ req.msg.data = (uint8_t *)&data;
+ req.msg.data_len = data_len;
+
+ memset(&data, 0, data_len);
+ data[0] = PEF_CFGPARM_ID_PEF_FILTER_TABLE_DATA_1;
+ data[1] = filter_id;
+ data[2] = filter_cfg->cfg;
+
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ }
+ return 0;
+}
+
+/* _ipmi_set_pef_policy_entry - Sets/updates Entry in Alert Policy Table identified by
+ * Policy ID.
+ *
+ * @policy_id - Policy ID of Entry in Alert Policy Table to be updated
+ * @policy_entry - Pointer to data.
+ *
+ * returns - negative number means error, positive is a ccode.
+ */
+static int
+_ipmi_set_pef_policy_entry(struct ipmi_intf *intf, uint8_t policy_id,
+ struct pef_cfgparm_policy_table_entry *policy_entry)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ struct pef_cfgparm_set_policy_table_entry payload;
+ if (!policy_entry) {
+ return (-3);
}
- *table = ptbl;
- return(tbl_size);
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = IPMI_NETFN_SE;
+ req.msg.cmd = IPMI_CMD_SET_PEF_CONFIG_PARMS;
+ req.msg.data = (uint8_t *)&payload;
+ req.msg.data_len = sizeof(payload);
+
+ memset(&payload, 0, sizeof(payload));
+ payload.param_selector = PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_ENTRY;
+ payload.policy_id = policy_id & PEF_POLICY_TABLE_ID_MASK;
+ memcpy(&payload.entry, &policy_entry->entry,
+ sizeof(policy_entry->entry));
+
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ return (-1);
+ } else if (rsp->ccode) {
+ return rsp->ccode;
+ }
+ return 0;
+}
+
+static void
+ipmi_pef_print_oem_lan_dest(struct ipmi_intf *intf,
+ uint8_t dest)
+{
+ char address[128];
+ int len;
+ int rc;
+ int rlen;
+ int set;
+ uint8_t data[32];
+
+ if (ipmi_get_oem(intf) != IPMI_OEM_DELL) {
+ return;
+ }
+ /* Get # of IPV6 trap destinations */
+ rc = ipmi_mc_getsysinfo(intf, IPMI_SYSINFO_DELL_IPV6_COUNT, 0x00, 0x00, 4, data);
+ if (rc != 0 || dest > data[0]) {
+ return;
+ }
+ ipmi_pef_print_str("Alert destination type", "xxx");
+ ipmi_pef_print_str("PET Community", "xxx");
+ ipmi_pef_print_dec("ACK timeout/retry (secs)", 0);
+ ipmi_pef_print_dec("Retries", 0);
+
+ /* Get IPv6 destination string (may be in multiple sets) */
+ memset(address, 0, sizeof(address));
+ memset(data, 0, sizeof(data));
+ rc = ipmi_mc_getsysinfo(intf, IPMI_SYSINFO_DELL_IPV6_DESTADDR, 0x00, dest, 19, data);
+ if (rc != 0) {
+ return;
+ }
+ /* Total length of IPv6 string */
+ len = data[4];
+ if ((rlen = len) > (IPMI_SYSINFO_SET0_SIZE-3)) {
+ /* First set has 11 bytes */
+ rlen = IPMI_SYSINFO_SET0_SIZE - 3;
+ }
+ memcpy(address, data + 8, rlen);
+ for (set = 1; len > 11; set++) {
+ rc = ipmi_mc_getsysinfo(intf, IPMI_SYSINFO_DELL_IPV6_DESTADDR, set, dest, 19, data);
+ if ((rlen = len - 11) >= (IPMI_SYSINFO_SETN_SIZE - 2)) {
+ /* Remaining sets have 14 bytes */
+ rlen = IPMI_SYSINFO_SETN_SIZE - 2;
+ }
+ memcpy(address + (set * 11), data + 3, rlen);
+ len -= rlen+3;
+ }
+ ipmi_pef_print_str("IPv6 Address", address);
}
+/* TODO - rewrite */
static void
ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
{ /*
@@ -325,16 +1023,13 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
pinfo->ip[0], pinfo->ip[1], pinfo->ip[2], pinfo->ip[3]);
ipmi_pef_print_str("IP address", buf);
- sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x",
- pinfo->mac[0], pinfo->mac[1], pinfo->mac[2],
- pinfo->mac[3], pinfo->mac[4], pinfo->mac[5]);
- ipmi_pef_print_str("MAC address", buf);
+ ipmi_pef_print_str("MAC address", mac2str(pinfo->mac));
}
}
static void
-ipmi_pef_print_serial_dest_dial(struct ipmi_intf * intf, char * label,
- struct pef_serial_cfgparm_selector * ssel)
+ipmi_pef_print_serial_dest_dial(struct ipmi_intf *intf, char *label,
+ struct pef_serial_cfgparm_selector *ssel)
{ /*
// print a dial string
*/
@@ -381,8 +1076,8 @@ ipmi_pef_print_serial_dest_dial(struct ipmi_intf * intf, char * label,
}
static void
-ipmi_pef_print_serial_dest_tap(struct ipmi_intf * intf,
- struct pef_serial_cfgparm_selector * ssel)
+ipmi_pef_print_serial_dest_tap(struct ipmi_intf *intf,
+ struct pef_serial_cfgparm_selector *ssel)
{ /*
// print TAP destination info
*/
@@ -431,28 +1126,21 @@ ipmi_pef_print_serial_dest_tap(struct ipmi_intf * intf,
/* TODO : additional TAP settings? */
}
+/*
static void
-ipmi_pef_print_serial_dest_ppp(struct ipmi_intf * intf,
- struct pef_serial_cfgparm_selector * ssel)
-{ /*
- // print PPP destination info
- */
-
- /* TODO */
+ipmi_pef_print_serial_dest_ppp(struct ipmi_intf *intf,
+ struct pef_serial_cfgparm_selector *ssel)
+{
}
static void
-ipmi_pef_print_serial_dest_callback(struct ipmi_intf * intf,
- struct pef_serial_cfgparm_selector * ssel)
-{ /*
- // print callback destination info
- */
-
- /* TODO */
+ipmi_pef_print_serial_dest_callback(struct ipmi_intf *intf,
+ struct pef_serial_cfgparm_selector *ssel)
}
+*/
static void
-ipmi_pef_print_serial_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
+ipmi_pef_print_serial_dest(struct ipmi_intf *intf, uint8_t ch, uint8_t dest)
{ /*
// print Serial/PPP alert destination info
*/
@@ -479,6 +1167,10 @@ ipmi_pef_print_serial_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
tbl_size = (rsp->data[1] & PEF_SERIAL_DEST_TABLE_SIZE_MASK);
if (!dest || tbl_size == 0) /* Page alerting not supported */
return;
+ if (dest > tbl_size) {
+ ipmi_pef_print_oem_lan_dest(intf, dest - tbl_size);
+ return;
+ }
ssel.id = PEF_SERIAL_CFGPARM_ID_DESTINFO;
ssel.set = dest;
@@ -503,18 +1195,18 @@ ipmi_pef_print_serial_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
ipmi_pef_print_serial_dest_tap(intf, &ssel);
break;
case PEF_SERIAL_DEST_TYPE_PPP:
- ipmi_pef_print_serial_dest_ppp(intf, &ssel);
+ /* ipmi_pef_print_serial_dest_ppp(intf, &ssel); */
break;
case PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK:
case PEF_SERIAL_DEST_TYPE_PPP_CALLBACK:
- ipmi_pef_print_serial_dest_callback(intf, &ssel);
+ /* ipmi_pef_print_serial_dest_callback(intf, &ssel); */
break;
}
}
}
static void
-ipmi_pef_print_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
+ipmi_pef_print_dest(uint8_t dest)
{ /*
// print generic alert destination info
*/
@@ -529,7 +1221,7 @@ ipmi_pef_print_event_info(struct pef_cfgparm_filter_table_entry * pef, char * bu
static char * classes[] = {"Discrete", "Threshold", "OEM"};
uint16_t offmask;
char * p;
- int i;
+ unsigned int i;
uint8_t t;
ipmi_pef_print_str("Event severity",
@@ -574,174 +1266,237 @@ ipmi_pef_print_event_info(struct pef_cfgparm_filter_table_entry * pef, char * bu
ipmi_pef_print_str("Event trigger(s)", buf);
}
+/* ipmi_pef_print_filter_entry - Print-out Entry of Event Filter Table. */
static void
-ipmi_pef_print_entry(struct ipmi_rs * rsp, uint8_t id,
- struct pef_cfgparm_filter_table_entry * pef)
-{ /*
- // print a PEF table entry
- */
- uint8_t wrk, set;
+ipmi_pef_print_filter_entry(struct pef_cfgparm_filter_table_entry *filter_entry)
+{
char buf[128];
+ uint8_t filter_enabled;
+ uint8_t set;
- ipmi_pef_print_dec("PEF table entry", id);
+ ipmi_pef_print_dec("PEF Filter Table entry", filter_entry->data1);
- wrk = !!(pef->entry.config & PEF_CONFIG_ENABLED);
- sprintf(buf, "%sactive", (wrk ? "" : "in"));
- if (pef->entry.config & PEF_CONFIG_PRECONFIGURED)
- strcat(buf, ", pre-configured");
+ filter_enabled = filter_entry->entry.config & PEF_CONFIG_ENABLED;
+ sprintf(buf, "%sabled", (filter_enabled ? "en" : "dis"));
+ switch (filter_entry->entry.config & 0x60) {
+ case 0x40:
+ strcat(buf, ", pre-configured");
+ break;
+ case 0x00:
+ strcat(buf, ", configurable");
+ break;
+ default:
+ /* Covers 0x60 and 0x20 which are reserved */
+ strcat(buf, ", reserved");
+ break;
+ }
ipmi_pef_print_str("Status", buf);
- if (wrk != 0) {
- ipmi_pef_print_1xd("Version", rsp->data[0]);
- ipmi_pef_print_str("Sensor type",
- ipmi_pef_bit_desc(&pef_b2s_sensortypes, pef->entry.sensor_type));
+ if (!filter_enabled) {
+ return;
+ }
+
+ ipmi_pef_print_str("Sensor type",
+ ipmi_pef_bit_desc(&pef_b2s_sensortypes,
+ filter_entry->entry.sensor_type));
- if (pef->entry.sensor_number == PEF_SENSOR_NUMBER_MATCH_ANY)
- ipmi_pef_print_str("Sensor number", "Any");
- else
- ipmi_pef_print_dec("Sensor number", pef->entry.sensor_number);
+ if (filter_entry->entry.sensor_number == PEF_SENSOR_NUMBER_MATCH_ANY) {
+ ipmi_pef_print_str("Sensor number", "Any");
+ } else {
+ ipmi_pef_print_dec("Sensor number",
+ filter_entry->entry.sensor_number);
+ }
- ipmi_pef_print_event_info(pef, buf);
- ipmi_pef_print_str("Action",
- ipmi_pef_bit_desc(&pef_b2s_actions, pef->entry.action));
+ ipmi_pef_print_event_info(filter_entry, buf);
+ ipmi_pef_print_str("Action",
+ ipmi_pef_bit_desc(&pef_b2s_actions,
+ filter_entry->entry.action));
- if (pef->entry.action & PEF_ACTION_ALERT) {
- set = (pef->entry.policy_number & PEF_POLICY_NUMBER_MASK);
- ipmi_pef_print_int("Policy set", set);
- }
+ if (filter_entry->entry.action & PEF_ACTION_ALERT) {
+ set = (filter_entry->entry.policy_number & PEF_POLICY_NUMBER_MASK);
+ ipmi_pef_print_int("Policy set", set);
}
}
-static void
-ipmi_pef_list_entries(struct ipmi_intf * intf)
-{ /*
- // list all PEF table entries
- */
- struct ipmi_rs * rsp;
- struct ipmi_rq req;
- struct pef_cfgparm_selector psel;
- struct pef_cfgparm_filter_table_entry * pcfg;
- uint32_t i;
- uint8_t max_filters;
+/* ipmi_pef2_filter_enable - Enable/Disable specific PEF Event Filter.
+ *
+ * @enable - enable(1) or disable(0) PEF Event Filter.
+ * @filter_id - Filter ID of Entry in Event Filter Table.
+ *
+ * returns - 0 on success, any other value means error.
+ */
+static int
+ipmi_pef2_filter_enable(struct ipmi_intf *intf, uint8_t enable, uint8_t filter_id)
+{
+ struct pef_cfgparm_filter_table_data_1 filter_cfg;
+ int rc;
+ uint8_t filter_table_size;
+
+ rc = _ipmi_get_pef_filter_table_size(intf, &filter_table_size);
+ if (eval_ccode(rc) != 0) {
+ return (-1);
+ } else if (filter_table_size == 0) {
+ lprintf(LOG_ERR, "PEF Filter isn't supported.");
+ return (-1);
+ } else if (filter_id > filter_table_size) {
+ lprintf(LOG_ERR,
+ "PEF Filter ID out of range. Valid range is (1..%d).",
+ filter_table_size);
+ return (-1);
+ }
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_SE;
- req.msg.cmd = IPMI_CMD_GET_PEF_CAPABILITIES;
- rsp = ipmi_pef_msg_exchange(intf, &req, "PEF capabilities");
- if (!rsp
- || (max_filters = ((struct pef_capabilities *)rsp->data)->tblsize) == 0)
- return; /* sssh, not supported */
+ memset(&filter_cfg, 0, sizeof(filter_cfg));
+ rc = _ipmi_set_pef_filter_entry_cfg(intf, filter_id, &filter_cfg);
+ if (eval_ccode(rc) != 0) {
+ return (-1);
+ }
- memset(&psel, 0, sizeof(psel));
- psel.id = PEF_CFGPARM_ID_PEF_FILTER_TABLE_ENTRY;
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_SE;
- req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
- req.msg.data = (uint8_t *)&psel;
- req.msg.data_len = sizeof(psel);
- for (i=1; i<=max_filters; i++) {
- if (i > 1)
- printf("\n");
- psel.set = (i & PEF_FILTER_TABLE_ID_MASK);
- rsp = ipmi_pef_msg_exchange(intf, &req, "PEF table entry");
- if (!rsp
- || (psel.set != (rsp->data[1] & PEF_FILTER_TABLE_ID_MASK))) {
- lprintf(LOG_ERR, " **Error retrieving %s",
- "PEF table entry");
- continue;
- }
- pcfg = (struct pef_cfgparm_filter_table_entry *)&rsp->data[1];
- first_field = 1;
- ipmi_pef_print_entry(rsp, psel.set, pcfg);
+ if (enable != 0) {
+ /* Enable */
+ filter_cfg.cfg |= PEF_FILTER_ENABLED;
+ } else {
+ /* Disable */
+ filter_cfg.cfg &= PEF_FILTER_DISABLED;
+ }
+ rc = _ipmi_set_pef_filter_entry_cfg(intf, filter_id, &filter_cfg);
+ if (eval_ccode(rc) != 0) {
+ lprintf(LOG_ERR, "Failed to %s PEF Filter ID %d.",
+ enable ? "enable" : "disable",
+ filter_id);
+ return (-1);
}
+ printf("PEF Filter ID %" PRIu8 " is %s now.\n", filter_id,
+ enable ? "enabled" : "disabled");
+ return rc;
}
-static void
-ipmi_pef_list_policies(struct ipmi_intf * intf)
-{ /*
- // list PEF alert policies
- */
- struct ipmi_rs * rsp;
- struct ipmi_rq req;
- struct pef_cfgparm_policy_table_entry * ptbl = NULL;
- struct pef_cfgparm_policy_table_entry * ptmp = NULL;
- uint32_t i;
- uint8_t wrk, ch, medium, tbl_size;
-
- tbl_size = ipmi_pef_get_policy_table(intf, &ptbl);
- if (!tbl_size) {
- if (ptbl != NULL) {
- free(ptbl);
- ptbl = NULL;
+void
+ipmi_pef2_filter_help(void)
+{
+ lprintf(LOG_NOTICE,
+"usage: pef filter help");
+ lprintf(LOG_NOTICE,
+" pef filter list");
+ lprintf(LOG_NOTICE,
+" pef filter enable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef filter disable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef filter create <id = 1..n> <params>");
+ lprintf(LOG_NOTICE,
+" pef filter delete <id = 1..n>");
+}
+
+/* ipmi_pef2_filter - Handle processing of "filter" CLI args. */
+int
+ipmi_pef2_filter(struct ipmi_intf *intf, int argc, char **argv)
+{
+ int rc = 0;
+
+ if (argc < 1) {
+ lprintf(LOG_ERR, "Not enough parameters given.");
+ ipmi_pef2_filter_help();
+ rc = (-1);
+ } else if (!strcmp(argv[0], "help")) {
+ ipmi_pef2_filter_help();
+ rc = 0;
+ } else if (!strcmp(argv[0], "list")) {
+ rc = ipmi_pef2_list_filters(intf);
+ } else if (!strcmp(argv[0], "enable")
+ ||(!strcmp(argv[0], "disable"))) {
+ uint8_t enable;
+ uint8_t filter_id;
+ if (argc != 2) {
+ lprintf(LOG_ERR, "Not enough arguments given.");
+ ipmi_pef2_filter_help();
+ return (-1);
}
- return;
+ if (str2uchar(argv[1], &filter_id) != 0) {
+ lprintf(LOG_ERR, "Invalid PEF Event Filter ID given: %s", argv[1]);
+ return (-1);
+ } else if (filter_id < 1) {
+ lprintf(LOG_ERR, "PEF Event Filter ID out of range. "
+ "Valid range is <1..255>.");
+ return (-1);
+ }
+ if (!strcmp(argv[0], "enable")) {
+ enable = 1;
+ } else {
+ enable = 0;
+ }
+ rc = ipmi_pef2_filter_enable(intf, enable, filter_id);
+ } else if (!strcmp(argv[0], "create")) {
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else if (!strcmp(argv[0], "delete")) {
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else {
+ lprintf(LOG_ERR, "Invalid PEF Filter command: %s", argv[0]);
+ ipmi_pef2_filter_help();
+ rc = 1;
}
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_APP;
- req.msg.cmd = IPMI_CMD_GET_CHANNEL_INFO;
- req.msg.data = &ch;
- req.msg.data_len = sizeof(ch);
- for (ptmp=ptbl, i=1; i<=tbl_size; i++, ptmp++) {
- if ((ptmp->entry.policy & PEF_POLICY_ENABLED) == PEF_POLICY_ENABLED) {
- if (i > 1)
- printf("\n");
- first_field = 1;
- ipmi_pef_print_dec("Alert policy table entry",
- (ptmp->data1 & PEF_POLICY_TABLE_ID_MASK));
- ipmi_pef_print_dec("Policy set",
- (ptmp->entry.policy & PEF_POLICY_ID_MASK) >> PEF_POLICY_ID_SHIFT);
- ipmi_pef_print_str("Policy entry rule",
- ipmi_pef_bit_desc(&pef_b2s_policies, (ptmp->entry.policy & PEF_POLICY_FLAGS_MASK)));
-
- if (ptmp->entry.alert_string_key & PEF_POLICY_EVENT_SPECIFIC) {
- ipmi_pef_print_str("Event-specific", "true");
-// continue;
- }
- wrk = ptmp->entry.chan_dest;
-
- /* channel/description */
- ch = (wrk & PEF_POLICY_CHANNEL_MASK) >> PEF_POLICY_CHANNEL_SHIFT;
- rsp = ipmi_pef_msg_exchange(intf, &req, "Channel info");
- if (!rsp || rsp->data[0] != ch) {
- lprintf(LOG_ERR, " **Error retrieving %s",
- "Channel info");
- continue;
- }
- medium = rsp->data[1];
- ipmi_pef_print_dec("Channel number", ch);
- ipmi_pef_print_str("Channel medium",
- ipmi_pef_bit_desc(&pef_b2s_ch_medium, medium));
-
- /* destination/description */
- wrk &= PEF_POLICY_DESTINATION_MASK;
- switch (medium) {
- case PEF_CH_MEDIUM_TYPE_LAN:
- ipmi_pef_print_lan_dest(intf, ch, wrk);
- break;
- case PEF_CH_MEDIUM_TYPE_SERIAL:
- ipmi_pef_print_serial_dest(intf, ch, wrk);
- break;
- default:
- ipmi_pef_print_dest(intf, ch, wrk);
- break;
- }
+ return rc;
+}
+
+/* ipmi_pef2_get_info - Reports PEF capabilities + System GUID */
+static int
+ipmi_pef2_get_info(struct ipmi_intf *intf)
+{
+ struct pef_capabilities pcap;
+ struct pef_cfgparm_system_guid psys_guid;
+ ipmi_guid_t guid;
+ int rc;
+ uint8_t *guid_ptr = NULL;
+ uint8_t policy_table_size;
+
+ rc = _ipmi_get_pef_policy_table_size(intf, &policy_table_size);
+ if (eval_ccode(rc) != 0) {
+ lprintf(LOG_WARN, "Failed to get size of PEF Policy Table.");
+ policy_table_size = 0;
+ }
+ rc = _ipmi_get_pef_capabilities(intf, &pcap);
+ if (eval_ccode(rc) != 0) {
+ lprintf(LOG_ERR, "Failed to get PEF Capabilities.");
+ return (-1);
+ }
+
+ ipmi_pef_print_1xd("Version", pcap.version);
+ ipmi_pef_print_dec("PEF Event Filter count",
+ pcap.event_filter_count);
+ ipmi_pef_print_dec("PEF Alert Policy Table size",
+ policy_table_size);
+
+ rc = _ipmi_get_pef_system_guid(intf, &psys_guid);
+ if (rc != 0x80 && eval_ccode(rc) != 0) {
+ lprintf(LOG_ERR, "Failed to get PEF System GUID. %i", rc);
+ return (-1);
+ } else if (psys_guid.data1 == 0x1) {
+ /* IPMI_CMD_GET_SYSTEM_GUID */
+ guid_ptr = &psys_guid.guid[0];
+ } else {
+ rc = _ipmi_mc_get_guid(intf, &guid);
+ if (rc == 0) {
+ guid_ptr = (uint8_t *)&guid;
}
}
- free(ptbl);
- ptbl = NULL;
+ /* Got GUID? */
+ if (guid_ptr) {
+ ipmi_pef_print_guid(guid_ptr);
+ }
+ ipmi_pef_print_flags(&pef_b2s_actions, P_SUPP, pcap.actions);
+ putchar('\n');
+ return 0;
}
-static void
-ipmi_pef_get_status(struct ipmi_intf * intf)
-{ /*
- // report the PEF status
- */
- struct ipmi_rs * rsp;
+/* ipmi_pef2_get_status - TODO rewrite - report the PEF status */
+static int
+ipmi_pef2_get_status(struct ipmi_intf *intf)
+{
+ struct ipmi_rs *rsp;
struct ipmi_rq req;
struct pef_cfgparm_selector psel;
- char tbuf[40];
- uint32_t timei;
time_t ts;
memset(&req, 0, sizeof(req));
@@ -751,17 +1506,11 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
if (!rsp) {
lprintf(LOG_ERR, " **Error retrieving %s",
"Last S/W processed ID");
- return;
+ return (-1);
}
- memcpy(&timei, rsp->data, sizeof(timei));
-#if WORDS_BIGENDIAN
- timei = BSWAP_32(timei);
-#endif
- ts = (time_t)timei;
- strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", gmtime(&ts));
-
- ipmi_pef_print_str("Last SEL addition", tbuf);
+ ts = ipmi32toh(rsp->data);
+ ipmi_pef_print_str("Last SEL addition", ipmi_timestamp_numeric(ts));
ipmi_pef_print_2xd("Last SEL record ID", rsp->data[5], rsp->data[4]);
ipmi_pef_print_2xd("Last S/W processed ID", rsp->data[7], rsp->data[6]);
ipmi_pef_print_2xd("Last BMC processed ID", rsp->data[9], rsp->data[8]);
@@ -777,7 +1526,7 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
if (!rsp) {
lprintf(LOG_ERR, " **Error retrieving %s",
"PEF control");
- return;
+ return (-1);
}
ipmi_pef_print_flags(&pef_b2s_control, P_ABLE, rsp->data[1]);
@@ -786,102 +1535,313 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
if (!rsp) {
lprintf(LOG_ERR, " **Error retrieving %s",
"PEF action");
- return;
+ return (-1);
}
ipmi_pef_print_flags(&pef_b2s_actions, P_ACTV, rsp->data[1]);
+ putchar('\n');
+ return 0;
}
-static void
-ipmi_pef_get_info(struct ipmi_intf * intf)
-{ /*
- // report PEF capabilities + System GUID
- */
- struct ipmi_rs * rsp;
- struct ipmi_rq req;
- struct pef_capabilities * pcap;
- struct pef_cfgparm_selector psel;
- struct pef_cfgparm_policy_table_entry * ptbl = NULL;
- uint8_t * uid;
- uint8_t actions, tbl_size;
+/* ipmi_pef2_list_filters - List all entries in PEF Event Filter Table. */
+static int
+ipmi_pef2_list_filters(struct ipmi_intf *intf)
+{
+ struct pef_capabilities pcap;
+ struct pef_cfgparm_filter_table_entry filter_entry;
+ int rc;
+ uint8_t i;
+
+ rc = _ipmi_get_pef_capabilities(intf, &pcap);
+ if (eval_ccode(rc) != 0) {
+ return (-1);
+ } else if (pcap.event_filter_count == 0) {
+ lprintf(LOG_ERR, "PEF Event Filtering isn't supported.");
+ return (-1);
+ }
- tbl_size = ipmi_pef_get_policy_table(intf, &ptbl);
- if (ptbl != NULL) {
- free(ptbl);
- ptbl = NULL;
+ for (i = 1; i <= pcap.event_filter_count; i++) {
+ first_field = 1;
+ rc = _ipmi_get_pef_filter_entry(intf, i, &filter_entry);
+ if (eval_ccode(rc) != 0) {
+ lprintf(LOG_ERR, "Failed to get PEF Event Filter Entry %i.",
+ i);
+ continue;
+ }
+ ipmi_pef_print_filter_entry(&filter_entry);
+ printf("\n");
}
+ return 0;
+}
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_SE;
- req.msg.cmd = IPMI_CMD_GET_PEF_CAPABILITIES;
- rsp = ipmi_pef_msg_exchange(intf, &req, "PEF capabilities");
- if (!rsp)
- return;
- pcap = (struct pef_capabilities *)rsp->data;
+/* ipmi_pef2_list_policies - List Entries in PEF Alert Policy Table. */
+static int
+ipmi_pef2_list_policies(struct ipmi_intf *intf)
+{
+ struct channel_info_t channel_info;
+ struct pef_cfgparm_policy_table_entry entry;
+ int rc;
+ uint8_t dest;
+ uint8_t i;
+ uint8_t policy_table_size;
+
+ rc = _ipmi_get_pef_policy_table_size(intf, &policy_table_size);
+ if (eval_ccode(rc) != 0) {
+ return (-1);
+ } else if (policy_table_size == 0) {
+ lprintf(LOG_ERR, "PEF Alert Policy isn't supported.");
+ return (-1);
+ }
- ipmi_pef_print_1xd("Version", pcap->version);
- ipmi_pef_print_dec("PEF table size", pcap->tblsize);
- ipmi_pef_print_dec("Alert policy table size", tbl_size);
- actions = pcap->actions;
+ for (i = 1; i <= policy_table_size; i++) {
+ first_field = 1;
+ rc = _ipmi_get_pef_policy_entry(intf, i, &entry);
+ if (eval_ccode(rc) != 0) {
+ continue;
+ }
- memset(&psel, 0, sizeof(psel));
- psel.id = PEF_CFGPARM_ID_SYSTEM_GUID;
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_SE;
- req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
- req.msg.data = (uint8_t *)&psel;
- req.msg.data_len = sizeof(psel);
- rsp = ipmi_pef_msg_exchange(intf, &req, "System GUID");
- uid = NULL;
- if (rsp && (rsp->data[1] & PEF_SYSTEM_GUID_USED_IN_PET))
- uid = &rsp->data[2];
- else {
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_APP;
- req.msg.cmd = IPMI_CMD_GET_SYSTEM_GUID;
- rsp = ipmi_pef_msg_exchange(intf, &req, "System GUID");
- if (rsp)
- uid = &rsp->data[0];
- }
- if (uid) { /* got GUID? */
- if (verbose)
- printf(pef_fld_fmts[F_UID][0], KYWD_LENGTH, "System GUID",
- uid[0], uid[1], uid[2], uid[3], uid[4], uid[5], uid[6], uid[7],
- uid[8], uid[9], uid[10],uid[11],uid[12],uid[13],uid[14],uid[15]);
- else
- printf(pef_fld_fmts[F_UID][1],
- uid[0], uid[1], uid[2], uid[3], uid[4], uid[5], uid[6], uid[7],
- uid[8], uid[9], uid[10],uid[11],uid[12],uid[13],uid[14],uid[15]);
+ ipmi_pef_print_dec("Alert policy table entry",
+ (entry.data1 & PEF_POLICY_TABLE_ID_MASK));
+ ipmi_pef_print_dec("Policy set",
+ (entry.entry.policy & PEF_POLICY_ID_MASK) >> PEF_POLICY_ID_SHIFT);
+ ipmi_pef_print_str("State",
+ entry.entry.policy & PEF_POLICY_ENABLED ? "enabled" : "disabled");
+ ipmi_pef_print_str("Policy entry rule",
+ ipmi_pef_bit_desc(&pef_b2s_policies,
+ (entry.entry.policy & PEF_POLICY_FLAGS_MASK)));
+
+ if (entry.entry.alert_string_key & PEF_POLICY_EVENT_SPECIFIC) {
+ ipmi_pef_print_str("Event-specific", "true");
+ }
+ channel_info.channel = ((entry.entry.chan_dest &
+ PEF_POLICY_CHANNEL_MASK) >>
+ PEF_POLICY_CHANNEL_SHIFT);
+ rc = _ipmi_get_channel_info(intf, &channel_info);
+ if (eval_ccode(rc) != 0) {
+ continue;
+ }
+ ipmi_pef_print_dec("Channel number", channel_info.channel);
+ ipmi_pef_print_str("Channel medium",
+ ipmi_pef_bit_desc(&pef_b2s_ch_medium,
+ channel_info.medium));
+ dest = entry.entry.chan_dest & PEF_POLICY_DESTINATION_MASK;
+ switch (channel_info.medium) {
+ case PEF_CH_MEDIUM_TYPE_LAN:
+ ipmi_pef_print_lan_dest(intf, channel_info.channel,
+ dest);
+ break;
+ case PEF_CH_MEDIUM_TYPE_SERIAL:
+ ipmi_pef_print_serial_dest(intf, channel_info.channel,
+ dest);
+ break;
+ default:
+ ipmi_pef_print_dest(dest);
+ break;
+ }
+ printf("\n");
}
- ipmi_pef_print_flags(&pef_b2s_actions, P_SUPP, actions);
+ return 0;
}
-int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
-{ /*
- // PEF subcommand handling
- */
- int help = 0;
- int rc = 0;
-
- if (!argc || !strncmp(argv[0], "info", 4))
- ipmi_pef_get_info(intf);
- else if (!strncmp(argv[0], "help", 4))
- help = 1;
- else if (!strncmp(argv[0], "status", 6))
- ipmi_pef_get_status(intf);
- else if (!strncmp(argv[0], "policy", 6))
- ipmi_pef_list_policies(intf);
- else if (!strncmp(argv[0], "list", 4))
- ipmi_pef_list_entries(intf);
- else {
- help = 1;
- rc = -1;
- lprintf(LOG_ERR, "Invalid PEF command: '%s'\n", argv[0]);
+void
+ipmi_pef2_policy_help(void)
+{
+ lprintf(LOG_NOTICE,
+"usage: pef policy help");
+ lprintf(LOG_NOTICE,
+" pef policy list");
+ lprintf(LOG_NOTICE,
+" pef policy enable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef policy disable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef policy create <id = 1..n> <params>");
+ lprintf(LOG_NOTICE,
+" pef policy delete <id = 1..n>");
+}
+
+/* ipmi_pef2_policy_enable - Enable/Disable specific PEF policy
+ *
+ * @enable - enable(1) or disable(0) PEF Alert Policy
+ * @policy_id - Policy ID of Entry in Alert Policy Table.
+ *
+ * returns - 0 on success, any other value means error.
+ */
+static int
+ipmi_pef2_policy_enable(struct ipmi_intf *intf, int enable, uint8_t policy_id)
+{
+ struct pef_cfgparm_policy_table_entry policy_entry;
+ int rc;
+ uint8_t policy_table_size;
+
+ rc = _ipmi_get_pef_policy_table_size(intf, &policy_table_size);
+ if (eval_ccode(rc) != 0) {
+ return (-1);
+ } else if (policy_table_size == 0) {
+ lprintf(LOG_ERR, "PEF Policy isn't supported.");
+ return (-1);
+ } else if (policy_id > policy_table_size) {
+ lprintf(LOG_ERR,
+ "PEF Policy ID out of range. Valid range is (1..%d).",
+ policy_table_size);
+ return (-1);
}
- if (help)
- lprintf(LOG_NOTICE, "PEF commands: info status policy list");
- else if (!verbose)
- printf("\n");
+ memset(&policy_entry, 0, sizeof(policy_entry));
+ rc = _ipmi_get_pef_policy_entry(intf, policy_id, &policy_entry);
+ if (eval_ccode(rc) != 0) {
+ return (-1);
+ }
+ if (enable != 0) {
+ /* Enable */
+ policy_entry.entry.policy |= PEF_POLICY_ENABLED;
+ } else {
+ /* Disable */
+ policy_entry.entry.policy &= PEF_POLICY_DISABLED;
+ }
+ rc = _ipmi_set_pef_policy_entry(intf, policy_id, &policy_entry);
+ if (eval_ccode(rc) != 0) {
+ lprintf(LOG_ERR, "Failed to %s PEF Policy ID %d.",
+ enable ? "enable" : "disable",
+ policy_id);
+ return (-1);
+ }
+ printf("PEF Policy ID %" PRIu8 " is %s now.\n", policy_id,
+ enable ? "enabled" : "disabled");
+ return rc;
+}
+
+/* ipmi_pef2_policy - Handle processing of "policy" CLI args. */
+int
+ipmi_pef2_policy(struct ipmi_intf *intf, int argc, char **argv)
+{
+ int rc = 0;
+
+ if (argc < 1) {
+ lprintf(LOG_ERR, "Not enough parameters given.");
+ ipmi_pef2_policy_help();
+ rc = (-1);
+ } else if (!strcmp(argv[0], "help")) {
+ ipmi_pef2_policy_help();
+ rc = 0;
+ } else if (!strcmp(argv[0], "list")) {
+ rc = ipmi_pef2_list_policies(intf);
+ } else if (!strcmp(argv[0], "enable")
+ || !strcmp(argv[0], "disable")) {
+ uint8_t enable;
+ uint8_t policy_id;
+ if (argc != 2) {
+ lprintf(LOG_ERR, "Not enough arguments given.");
+ ipmi_pef2_policy_help();
+ return (-1);
+ }
+ if (str2uchar(argv[1], &policy_id) != 0) {
+ lprintf(LOG_ERR, "Invalid PEF Policy ID given: %s", argv[1]);
+ return (-1);
+ } else if (policy_id < 1 || policy_id > 127) {
+ lprintf(LOG_ERR, "PEF Policy ID out of range. Valid range is <1..127>.");
+ return (-1);
+ }
+ if (!strcmp(argv[0], "enable")) {
+ enable = 1;
+ } else {
+ enable = 0;
+ }
+ rc = ipmi_pef2_policy_enable(intf, enable, policy_id);
+ } else if (!strcmp(argv[0], "create")) {
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else if (!strcmp(argv[0], "delete")) {
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else {
+ lprintf(LOG_ERR, "Invalid PEF Policy command: %s", argv[0]);
+ ipmi_pef2_policy_help();
+ rc = 1;
+ }
+ return rc;
+}
+
+/* ipmi_pef2_help - print-out help text. */
+void
+ipmi_pef2_help(void)
+{
+ lprintf(LOG_NOTICE,
+"usage: pef help");
+ lprintf(LOG_NOTICE,
+" pef capabilities");
+ lprintf(LOG_NOTICE,
+" pef event <params>");
+ lprintf(LOG_NOTICE,
+" pef filter list");
+ lprintf(LOG_NOTICE,
+" pef filter enable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef filter disable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef filter create <id = 1..n> <params>");
+ lprintf(LOG_NOTICE,
+" pef filter delete <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef info");
+ lprintf(LOG_NOTICE,
+" pef policy list");
+ lprintf(LOG_NOTICE,
+" pef policy enable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef policy disable <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef policy create <id = 1..n> <params>");
+ lprintf(LOG_NOTICE,
+" pef policy delete <id = 1..n>");
+ lprintf(LOG_NOTICE,
+" pef pet ack <params>");
+ lprintf(LOG_NOTICE,
+" pef status");
+ lprintf(LOG_NOTICE,
+" pef timer get");
+ lprintf(LOG_NOTICE,
+" pef timer set <0x00-0xFF>");
+}
+
+int ipmi_pef_main(struct ipmi_intf *intf, int argc, char **argv)
+{
+ int rc = 0;
+
+ if (argc < 1) {
+ lprintf(LOG_ERR, "Not enough parameters given.");
+ ipmi_pef2_help();
+ rc = (-1);
+ } else if (!strcmp(argv[0], "help")) {
+ ipmi_pef2_help();
+ rc = 0;
+ } else if (!strcmp(argv[0], "capabilities")) {
+ /* rc = ipmi_pef2_get_capabilities(intf); */
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else if (!strcmp(argv[0], "event")) {
+ /* rc = ipmi_pef2_event(intf, (argc - 1), ++argv); */
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else if (!strcmp(argv[0], "filter")) {
+ rc = ipmi_pef2_filter(intf, (argc - 1), ++argv);
+ } else if (!strcmp(argv[0], "info")) {
+ rc = ipmi_pef2_get_info(intf);
+ } else if (!strcmp(argv[0], "pet")) {
+ /* rc = ipmi_pef2_pet(intf, (argc - 1), ++argv); */
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else if (!strcmp(argv[0], "policy")) {
+ rc = ipmi_pef2_policy(intf, (argc - 1), ++argv);
+ } else if (!strcmp(argv[0], "status")) {
+ rc = ipmi_pef2_get_status(intf);
+ } else if (!strcmp(argv[0], "timer")) {
+ /* rc = ipmi_pef2_timer(intf, (argc - 1), ++argv); */
+ lprintf(LOG_ERR, "Not implemented.");
+ rc = 1;
+ } else {
+ lprintf(LOG_ERR, "Invalid PEF command: '%s'\n", argv[0]);
+ rc = (-1);
+ }
return rc;
}
diff --git a/lib/ipmi_picmg.c b/lib/ipmi_picmg.c
index 70f845d..8becc78 100644
--- a/lib/ipmi_picmg.c
+++ b/lib/ipmi_picmg.c
@@ -37,11 +37,6 @@
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/log.h>
-#define PICMG_EXTENSION_ATCA_MAJOR_VERSION 2
-#define PICMG_EXTENSION_AMC0_MAJOR_VERSION 4
-#define PICMG_EXTENSION_UTCA_MAJOR_VERSION 5
-
-
#define PICMG_EKEY_MODE_QUERY 0
#define PICMG_EKEY_MODE_PRINT_ALL 1
#define PICMG_EKEY_MODE_PRINT_ENABLED 2
@@ -67,7 +62,84 @@ typedef enum picmg_card_type {
PICMG_CARD_TYPE_RESERVED
} t_picmg_card_type ;
-/* This is the version of the PICMG Extenstion */
+static const char* amc_link_type_str[] = {
+ "RESERVED",
+ "RESERVED1",
+ "PCI EXPRESS",
+ "ADVANCED SWITCHING1",
+ "ADVANCED SWITCHING2",
+ "ETHERNET",
+ "RAPIDIO",
+ "STORAGE",
+};
+
+static const char* amc_link_type_ext_str[][16] = {
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */
+ {
+ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
+ },
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */
+ {
+ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
+ },
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */
+ {
+ "Gen 1 - NSSC",
+ "Gen 1 - SSC",
+ "Gen 2 - NSSC",
+ "Gen 2 - SSC",
+ "", "", "", "",
+ "", "", "", "",
+ "", "", "", ""
+ },
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */
+ {
+ "Gen 1 - NSSC",
+ "Gen 1 - SSC",
+ "Gen 2 - NSSC",
+ "Gen 2 - SSC",
+ "", "", "", "",
+ "", "", "", "",
+ "", "", "", ""
+ },
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */
+ {
+ "Gen 1 - NSSC",
+ "Gen 1 - SSC",
+ "Gen 2 - NSSC",
+ "Gen 2 - SSC",
+ "", "", "", "",
+ "", "", "", "",
+ "", "", "", ""
+ },
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */
+ {
+ "1000BASE-BX (SerDES Gigabit)",
+ "10GBASE-BX410 Gigabit XAUI",
+ "", "",
+ "", "", "", "",
+ "", "", "", "",
+ "", "", "", ""
+ },
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */
+ {
+ "1.25 Gbaud transmission rate",
+ "2.5 Gbaud transmission rate",
+ "3.125 Gbaud transmission rate",
+ "", "", "", "", "",
+ "", "", "", "", "", "", "", ""
+ },
+ /* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */
+ {
+ "Fibre Channel",
+ "Serial ATA",
+ "Serial Attached SCSI",
+ "", "", "", "", "",
+ "", "", "", "", "", "", "", ""
+ }
+};
+
+/* This is the version of the PICMG Extension */
static t_picmg_card_type PicmgCardType = PICMG_CARD_TYPE_RESERVED;
void
@@ -130,6 +202,28 @@ struct sAmcAddrMap {
{0x88, "reserved", 0},
};
+/* the LED color capabilities */
+static const char *led_color_str[] = {
+ "reserved",
+ "BLUE",
+ "RED",
+ "GREEN",
+ "AMBER",
+ "ORANGE",
+ "WHITE",
+ "reserved"
+};
+
+const char *
+picmg_led_color_str(int color)
+{
+ if (color < 0 || (size_t)color >= ARRAY_SIZE(led_color_str)) {
+ return "invalid";
+ }
+
+ return led_color_str[color];
+}
+
/* is_amc_channel - wrapper to convert user input into integer
* AMC Channel range seems to be <0..255>, bits [7:0]
*
@@ -151,7 +245,7 @@ is_amc_channel(const char *argv_ptr, uint8_t *amc_chan_ptr)
return (-1);
}
/* is_amc_dev - wrapper to convert user input into integer.
- * AMC Dev ID limits are uknown.
+ * AMC Dev ID limits are unknown.
*
* @argv_ptr: source string to convert from; usually argv
* @amc_dev_ptr: pointer where to store result
@@ -172,7 +266,7 @@ is_amc_dev(const char *argv_ptr, int32_t *amc_dev_ptr)
return (-1);
}
/* is_amc_intf - wrapper to convert user input into integer.
- * AMC Interface (ID) limits are uknown.
+ * AMC Interface (ID) limits are unknown.
*
* @argv_ptr: source string to convert from; usually argv
* @amc_intf_ptr: pointer where to store result
@@ -193,7 +287,7 @@ is_amc_intf(const char *argv_ptr, int32_t *amc_intf_ptr)
return (-1);
}
/* is_amc_port - wrapper to convert user input into integer.
- * AMC Port limits are uknown.
+ * AMC Port limits are unknown.
*
* @argv_ptr: source string to convert from; usually argv
* @amc_port_ptr: pointer where to store result
@@ -213,7 +307,7 @@ is_amc_port(const char *argv_ptr, int32_t *amc_port_ptr)
return (-1);
}
/* is_clk_acc - wrapper to convert user input into integer.
- * Clock Accuracy limits are uknown[1byte by spec].
+ * Clock Accuracy limits are unknown[1byte by spec].
*
* @argv_ptr: source string to convert from; usually argv
* @clk_acc_ptr: pointer where to store result
@@ -234,7 +328,7 @@ is_clk_acc(const char *argv_ptr, uint8_t *clk_acc_ptr)
return (-1);
}
/* is_clk_family - wrapper to convert user input into integer.
- * Clock Family limits are uknown[1byte by spec].
+ * Clock Family limits are unknown[1byte by spec].
*
* @argv_ptr: source string to convert from; usually argv
* @clk_family_ptr: pointer where to store result
@@ -255,7 +349,7 @@ is_clk_family(const char *argv_ptr, uint8_t *clk_family_ptr)
return (-1);
}
/* is_clk_freq - wrapper to convert user input into integer.
- * Clock Frequency limits are uknown, but specification says
+ * Clock Frequency limits are unknown, but specification says
* 3Bytes + 1B checksum
*
* @argv_ptr: source string to convert from; usually argv
@@ -277,7 +371,7 @@ is_clk_freq(const char *argv_ptr, uint32_t *clk_freq_ptr)
return (-1);
}
/* is_clk_id - wrapper to convert user input into integer.
- * Clock ID limits are uknown, however it's 1B by specification and I've
+ * Clock ID limits are unknown, however it's 1B by specification and I've
* found two ranges: <1..5> or <0..15>
*
* @argv_ptr: source string to convert from; usually argv
@@ -298,7 +392,7 @@ is_clk_id(const char *argv_ptr, uint8_t *clk_id_ptr)
return (-1);
}
/* is_clk_index - wrapper to convert user input into integer.
- * Clock Index limits are uknown[1B by spec]
+ * Clock Index limits are unknown[1B by spec]
*
* @argv_ptr: source string to convert from; usually argv
* @clk_index_ptr: pointer where to store result
@@ -318,7 +412,7 @@ is_clk_index(const char *argv_ptr, uint8_t *clk_index_ptr)
return (-1);
}
/* is_clk_resid - wrapper to convert user input into integer.
- * Clock Resource Index(?) limits are uknown, but maximum seems to be 15.
+ * Clock Resource Index(?) limits are unknown, but maximum seems to be 15.
*
* @argv_ptr: source string to convert from; usually argv
* @clk_resid_ptr: pointer where to store result
@@ -661,7 +755,7 @@ ipmi_picmg_properties(struct ipmi_intf * intf, int show )
#define PICMG_FRU_ACTIVATE (unsigned char) 0x01
int
-ipmi_picmg_fru_activation(struct ipmi_intf * intf, int argc, char ** argv, unsigned char state)
+ipmi_picmg_fru_activation(struct ipmi_intf * intf, char ** argv, unsigned char state)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -695,7 +789,7 @@ ipmi_picmg_fru_activation(struct ipmi_intf * intf, int argc, char ** argv, unsig
int
-ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -734,7 +828,7 @@ ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, int argc, char **
}
int
-ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1029,7 +1123,7 @@ ipmi_picmg_amc_portstate_get(struct ipmi_intf * intf, int32_t device,
/* Removed endianness check here, probably not required
- as we dont use bitfields */
+ as we don't use bitfields */
port = d->linkInfo[0] & 0x0F;
type = ((d->linkInfo[0] & 0xF0) >> 4 )|(d->linkInfo[1] & 0x0F );
ext = ((d->linkInfo[1] & 0xF0) >> 4 );
@@ -1158,7 +1252,7 @@ ipmi_picmg_amc_portstate_set(struct ipmi_intf * intf, uint8_t channel,
int
-ipmi_picmg_get_led_properties(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_get_led_properties(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1197,7 +1291,7 @@ ipmi_picmg_get_led_properties(struct ipmi_intf * intf, int argc, char ** argv)
}
int
-ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, char ** argv)
{
int i;
struct ipmi_rs * rsp;
@@ -1234,20 +1328,20 @@ ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
printf("LED Color Capabilities: ");
for ( i=0 ; i<8 ; i++ ) {
if ( rsp->data[1] & (0x01 << i) ) {
- printf("%s, ", led_color_str[ i ]);
+ printf("%s, ", picmg_led_color_str(i));
}
}
printf("\n");
printf("Default LED Color in\n");
- printf(" LOCAL control: %s\n", led_color_str[ rsp->data[2] ] );
- printf(" OVERRIDE state: %s\n", led_color_str[ rsp->data[3] ] );
+ printf(" LOCAL control: %s\n", picmg_led_color_str(rsp->data[2]));
+ printf(" OVERRIDE state: %s\n", picmg_led_color_str(rsp->data[3]));
return 0;
}
int
-ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_get_led_state(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1308,7 +1402,9 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
}
printf(" Local Control On-Duration: %x\n", rsp->data[3] );
- printf(" Local Control Color: %x [%s]\n", rsp->data[4], led_color_str[ rsp->data[4] ]);
+ printf(" Local Control Color: %x [%s]\n",
+ rsp->data[4],
+ picmg_led_color_str(rsp->data[4]));
/* override state or lamp test */
if (rsp->data[1] & 0x02) {
@@ -1322,7 +1418,9 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
}
printf(" Override On-Duration: %x\n", rsp->data[6] );
- printf(" Override Color: %x [%s]\n", rsp->data[7], led_color_str[ rsp->data[7] ]);
+ printf(" Override Color: %x [%s]\n",
+ rsp->data[7],
+ picmg_led_color_str(rsp->data[7]));
}
@@ -1334,7 +1432,7 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
}
int
-ipmi_picmg_set_led_state(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_set_led_state(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1410,7 +1508,7 @@ ipmi_picmg_set_led_state(struct ipmi_intf * intf, int argc, char ** argv)
}
int
-ipmi_picmg_get_power_level(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_get_power_level(struct ipmi_intf * intf, char ** argv)
{
int i;
struct ipmi_rs * rsp;
@@ -1461,7 +1559,7 @@ ipmi_picmg_get_power_level(struct ipmi_intf * intf, int argc, char ** argv)
}
int
-ipmi_picmg_set_power_level(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_set_power_level(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1565,7 +1663,7 @@ ipmi_picmg_bused_resource(struct ipmi_intf * intf, t_picmg_bused_resource_mode m
}
int
-ipmi_picmg_fru_control(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_picmg_fru_control(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1654,7 +1752,7 @@ ipmi_picmg_clk_get(struct ipmi_intf * intf, uint8_t clk_id, int8_t clk_res,
return -1;
}
- if (rsp->ccode == 0 ) {
+ if (!rsp->ccode) {
enabled = (rsp->data[1]&0x8)!=0;
direction = (rsp->data[1]&0x4)!=0;
@@ -1785,24 +1883,24 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
int rc = 0;
int showProperties = 0;
- if (argc == 0 || (!strncmp(argv[0], "help", 4))) {
+ if (!argc || !strcmp(argv[0], "help")) {
ipmi_picmg_help();
return 0;
}
/* Get PICMG properties is called to obtain version information */
- if (argc !=0 && !strncmp(argv[0], "properties", 10)) {
+ if (!strcmp(argv[0], "properties")) {
showProperties =1;
}
rc = ipmi_picmg_properties(intf,showProperties);
/* address info command */
- if (!strncmp(argv[0], "addrinfo", 8)) {
+ if (!strcmp(argv[0], "addrinfo")) {
rc = ipmi_picmg_getaddr(intf, argc-1, &argv[1]);
}
- else if (!strncmp(argv[0], "busres", 6)) {
+ else if (!strcmp(argv[0], "busres")) {
if (argc > 1) {
- if (!strncmp(argv[1], "summary", 7)) {
+ if (!strcmp(argv[1], "summary")) {
ipmi_picmg_bused_resource(intf, PICMG_BUSED_RESOURCE_SUMMARY );
}
} else {
@@ -1810,9 +1908,9 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* fru control command */
- else if (!strncmp(argv[0], "frucontrol", 10)) {
+ else if (!strcmp(argv[0], "frucontrol")) {
if (argc > 2) {
- rc = ipmi_picmg_fru_control(intf, argc-1, &(argv[1]));
+ rc = ipmi_picmg_fru_control(intf, &(argv[1]));
}
else {
lprintf(LOG_NOTICE, "usage: frucontrol <FRU-ID> <OPTION>");
@@ -1830,9 +1928,9 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
/* fru activation command */
- else if (!strncmp(argv[0], "activate", 8)) {
+ else if (!strcmp(argv[0], "activate")) {
if (argc > 1) {
- rc = ipmi_picmg_fru_activation(intf, argc-1, &(argv[1]), PICMG_FRU_ACTIVATE);
+ rc = ipmi_picmg_fru_activation(intf, &(argv[1]), PICMG_FRU_ACTIVATE);
}
else {
lprintf(LOG_ERR, "Specify the FRU to activate.");
@@ -1841,9 +1939,9 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
/* fru deactivation command */
- else if (!strncmp(argv[0], "deactivate", 10)) {
+ else if (!strcmp(argv[0], "deactivate")) {
if (argc > 1) {
- rc = ipmi_picmg_fru_activation(intf, argc-1, &(argv[1]), PICMG_FRU_DEACTIVATE);
+ rc = ipmi_picmg_fru_activation(intf, &(argv[1]), PICMG_FRU_DEACTIVATE);
}else {
lprintf(LOG_ERR, "Specify the FRU to deactivate.");
return -1;
@@ -1851,17 +1949,17 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
/* activation policy command */
- else if (!strncmp(argv[0], "policy", 6)) {
+ else if (!strcmp(argv[0], "policy")) {
if (argc > 1) {
- if (!strncmp(argv[1], "get", 3)) {
+ if (!strcmp(argv[1], "get")) {
if (argc > 2) {
- rc = ipmi_picmg_fru_activation_policy_get(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_fru_activation_policy_get(intf, &(argv[2]));
} else {
lprintf(LOG_NOTICE, "usage: get <fruid>");
}
- } else if (!strncmp(argv[1], "set", 3)) {
+ } else if (!strcmp(argv[1], "set")) {
if (argc > 4) {
- rc = ipmi_picmg_fru_activation_policy_set(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_fru_activation_policy_set(intf, &(argv[2]));
} else {
lprintf(LOG_NOTICE, "usage: set <fruid> <lockmask> <lock>");
lprintf(LOG_NOTICE,
@@ -1884,18 +1982,18 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
/* portstate command */
- else if (!strncmp(argv[0], "portstate", 9)) {
+ else if (!strcmp(argv[0], "portstate")) {
lprintf(LOG_DEBUG,"PICMG: portstate API");
if (argc > 1) {
- if (!strncmp(argv[1], "get", 3)) {
+ if (!strcmp(argv[1], "get")) {
int32_t iface;
uint8_t channel = 0;
lprintf(LOG_DEBUG,"PICMG: get");
- if(!strncmp(argv[1], "getall", 6)) {
+ if(!strcmp(argv[1], "getall")) {
for(iface=0;iface<=PICMG_EKEY_MAX_INTERFACE;iface++) {
for(channel=1;channel<=PICMG_EKEY_MAX_CHANNEL;channel++) {
if(!(( iface == FRU_PICMGEXT_DESIGN_IF_FABRIC ) &&
@@ -1907,7 +2005,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
}
- else if(!strncmp(argv[1], "getgranted", 10)) {
+ else if(!strcmp(argv[1], "getgranted")) {
for(iface=0;iface<=PICMG_EKEY_MAX_INTERFACE;iface++) {
for(channel=1;channel<=PICMG_EKEY_MAX_CHANNEL;channel++) {
rc = ipmi_picmg_portstate_get(intf,iface,channel,
@@ -1915,7 +2013,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
}
- else if(!strncmp(argv[1], "getdenied", 9)){
+ else if(!strcmp(argv[1], "getdenied")){
for(iface=0;iface<=PICMG_EKEY_MAX_INTERFACE;iface++) {
for(channel=1;channel<=PICMG_EKEY_MAX_CHANNEL;channel++) {
rc = ipmi_picmg_portstate_get(intf,iface,channel,
@@ -1938,7 +2036,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, "<intf> <chn>|getall|getgranted|getdenied");
}
}
- else if (!strncmp(argv[1], "set", 3)) {
+ else if (!strcmp(argv[1], "set")) {
if (argc == 9) {
int32_t interface = 0;
int32_t port = 0;
@@ -1981,18 +2079,18 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* amc portstate command */
- else if (!strncmp(argv[0], "amcportstate", 12)) {
+ else if (!strcmp(argv[0], "amcportstate")) {
lprintf(LOG_DEBUG,"PICMG: amcportstate API");
if (argc > 1) {
- if (!strncmp(argv[1], "get", 3)){
+ if (!strcmp(argv[1], "get")){
int32_t device;
uint8_t channel;
lprintf(LOG_DEBUG,"PICMG: get");
- if(!strncmp(argv[1], "getall", 6)){
+ if(!strcmp(argv[1], "getall")){
int maxDevice = PICMG_EKEY_AMC_MAX_DEVICE;
if( PicmgCardType != PICMG_CARD_TYPE_ATCA ){
maxDevice = 0;
@@ -2004,7 +2102,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
}
- else if(!strncmp(argv[1], "getgranted", 10)){
+ else if(!strcmp(argv[1], "getgranted")){
int maxDevice = PICMG_EKEY_AMC_MAX_DEVICE;
if( PicmgCardType != PICMG_CARD_TYPE_ATCA ){
maxDevice = 0;
@@ -2016,7 +2114,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
}
- else if(!strncmp(argv[1], "getdenied", 9)){
+ else if(!strcmp(argv[1], "getdenied")){
int maxDevice = PICMG_EKEY_AMC_MAX_DEVICE;
if( PicmgCardType != PICMG_CARD_TYPE_ATCA ){
maxDevice = 0;
@@ -2049,7 +2147,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, "<chn> <device>|getall|getgranted|getdenied");
}
}
- else if (!strncmp(argv[1], "set", 3)) {
+ else if (!strcmp(argv[1], "set")) {
if (argc > 7) {
int32_t device = -1;
int32_t port = 0;
@@ -2096,35 +2194,35 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* ATCA led commands */
- else if (!strncmp(argv[0], "led", 3)) {
+ else if (!strcmp(argv[0], "led")) {
if (argc > 1) {
- if (!strncmp(argv[1], "prop", 4)) {
+ if (!strcmp(argv[1], "prop")) {
if (argc > 2) {
- rc = ipmi_picmg_get_led_properties(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_get_led_properties(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "led prop <FRU-ID>");
}
}
- else if (!strncmp(argv[1], "cap", 3)) {
+ else if (!strcmp(argv[1], "cap")) {
if (argc > 3) {
- rc = ipmi_picmg_get_led_capabilities(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_get_led_capabilities(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "led cap <FRU-ID> <LED-ID>");
}
}
- else if (!strncmp(argv[1], "get", 3)) {
+ else if (!strcmp(argv[1], "get")) {
if (argc > 3) {
- rc = ipmi_picmg_get_led_state(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_get_led_state(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "led get <FRU-ID> <LED-ID>");
}
}
- else if (!strncmp(argv[1], "set", 3)) {
+ else if (!strcmp(argv[1], "set")) {
if (argc > 6) {
- rc = ipmi_picmg_set_led_state(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_set_led_state(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE,
@@ -2164,11 +2262,11 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* power commands */
- else if (!strncmp(argv[0], "power", 5)) {
+ else if (!strcmp(argv[0], "power")) {
if (argc > 1) {
- if (!strncmp(argv[1], "get", 3)) {
+ if (!strcmp(argv[1], "get")) {
if (argc > 3) {
- rc = ipmi_picmg_get_power_level(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_get_power_level(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "power get <FRU-ID> <type>");
@@ -2181,9 +2279,9 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
}
- else if (!strncmp(argv[1], "set", 3)) {
+ else if (!strcmp(argv[1], "set")) {
if (argc > 4) {
- rc = ipmi_picmg_set_power_level(intf, argc-1, &(argv[2]));
+ rc = ipmi_picmg_set_power_level(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "power set <FRU-ID> <level> <present-desired>");
@@ -2208,9 +2306,9 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
}/* clk commands*/
- else if (!strncmp(argv[0], "clk", 3)) {
+ else if (!strcmp(argv[0], "clk")) {
if (argc > 1) {
- if (!strncmp(argv[1], "get", 3)) {
+ if (!strcmp(argv[1], "get")) {
int8_t clk_res = -1;
uint8_t clk_id;
uint8_t max_res = 15;
@@ -2219,7 +2317,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
max_res = 0;
}
- if(!strncmp(argv[1], "getall", 6)) {
+ if(!strcmp(argv[1], "getall")) {
if( verbose ) { printf("Getting all clock state\n") ;}
for(clk_res=0;clk_res<=max_res;clk_res++) {
for(clk_id=0;clk_id<=15;clk_id++) {
@@ -2228,7 +2326,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
}
- else if(!strncmp(argv[1], "getdenied", 6)) {
+ else if(!strcmp(argv[1], "getdenied")) {
if( verbose ) { printf("Getting disabled clocks\n") ;}
for(clk_res=0;clk_res<=max_res;clk_res++) {
for(clk_id=0;clk_id<=15;clk_id++) {
@@ -2237,7 +2335,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
}
}
- else if(!strncmp(argv[1], "getgranted", 6)) {
+ else if(!strcmp(argv[1], "getgranted")) {
if( verbose ) { printf("Getting enabled clocks\n") ;}
for(clk_res=0;clk_res<=max_res;clk_res++) {
for(clk_id=0;clk_id<=15;clk_id++) {
@@ -2266,7 +2364,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
}
- else if (!strncmp(argv[1], "set", 3)) {
+ else if (!strcmp(argv[1], "set")) {
if (argc > 7) {
rc = ipmi_picmg_clk_set(intf, argc-1, &(argv[2]));
}
@@ -2301,7 +2399,7 @@ uint8_t
ipmi_picmg_ipmb_address(struct ipmi_intf *intf) {
struct ipmi_rq req;
struct ipmi_rs *rsp;
- char msg_data;
+ uint8_t msg_data;
if (!intf->picmg_avail) {
return 0;
@@ -2330,18 +2428,19 @@ ipmi_picmg_ipmb_address(struct ipmi_intf *intf) {
uint8_t
picmg_discover(struct ipmi_intf *intf) {
/* Check if PICMG extension is available to use the function
- * GetDeviceLocator to retreive i2c address PICMG hack to set
+ * GetDeviceLocator to retrieve i2c address PICMG hack to set
* right IPMB address, If extension is not supported, should
* not give any problems
* PICMG Extension Version 2.0 (PICMG 3.0 Revision 1.0 ATCA) to
* PICMG Extension Version 2.3 (PICMG 3.0 Revision 3.0 ATCA)
* PICMG Extension Version 4.1 (PICMG 3.0 Revision 3.0 AMC)
+ * PICMG Extension Version 5.0 (MTCA.0 R1.0)
*/
/* First, check if PICMG extension is available and supported */
struct ipmi_rq req;
struct ipmi_rs *rsp;
- char msg_data;
+ uint8_t msg_data;
uint8_t picmg_avail = 0;
memset(&req, 0, sizeof(req));
@@ -2352,13 +2451,13 @@ picmg_discover(struct ipmi_intf *intf) {
req.msg.data_len = 1;
msg_data = 0;
- lprintf(LOG_INFO, "Running Get PICMG Properties my_addr %#x, transit %#x, target %#x",
+ lprintf(LOG_DEBUG, "Running Get PICMG Properties my_addr %#x, transit %#x, target %#x",
intf->my_addr, intf->transit_addr, intf->target_addr);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_INFO,"No response from Get PICMG Properties");
- } else if (rsp->ccode != 0) {
- lprintf(LOG_INFO,"Error response %#x from Get PICMG Properities",
+ if (!rsp) {
+ lprintf(LOG_DEBUG,"No response from Get PICMG Properties");
+ } else if (rsp->ccode) {
+ lprintf(LOG_DEBUG,"Error response %#x from Get PICMG Properties",
rsp->ccode);
} else if (rsp->data_len < 4) {
lprintf(LOG_INFO,"Invalid Get PICMG Properties response length %d",
@@ -2367,12 +2466,13 @@ picmg_discover(struct ipmi_intf *intf) {
lprintf(LOG_INFO,"Invalid Get PICMG Properties group extension %#x",
rsp->data[0]);
} else if ((rsp->data[1] & 0x0F) != PICMG_ATCA_MAJOR_VERSION
- && (rsp->data[1] & 0x0F) != PICMG_AMC_MAJOR_VERSION) {
+ && (rsp->data[1] & 0x0F) != PICMG_AMC_MAJOR_VERSION
+ && (rsp->data[1] & 0x0F) != PICMG_UTCA_MAJOR_VERSION) {
lprintf(LOG_INFO,"Unknown PICMG Extension Version %d.%d",
(rsp->data[1] & 0x0F), (rsp->data[1] >> 4));
} else {
picmg_avail = 1;
- lprintf(LOG_INFO, "Discovered PICMG Extension Version %d.%d",
+ lprintf(LOG_DEBUG, "Discovered PICMG Extension Version %d.%d",
(rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
}
diff --git a/lib/ipmi_quantaoem.c b/lib/ipmi_quantaoem.c
new file mode 100644
index 0000000..0ddcefd
--- /dev/null
+++ b/lib/ipmi_quantaoem.c
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2018 Quanta Computer Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Quanta Computer Inc. or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE
+ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
+ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
+ * Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
+ * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
+ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
+ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+#define _XOPEN_SOURCE
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <strings.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <time.h>
+#include <unistd.h>
+#include <signal.h>
+#include <ctype.h>
+#include <sys/time.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <sys/select.h>
+#include <termios.h>
+#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_mc.h>
+#include <ipmitool/ipmi_intf.h>
+#include <ipmitool/helper.h>
+#include <ipmitool/log.h>
+#include <ipmitool/ipmi_sel.h>
+#include <ipmitool/ipmi_sdr.h>
+#include <ipmitool/ipmi_strings.h>
+#include <ipmitool/ipmi_channel.h>
+#include <ipmitool/ipmi_quantaoem.h>
+#include <ipmitool/ipmi_raw.h>
+
+/* Max Size of the description String to be displyed for the Each sel entry */
+#define SIZE_OF_DESC 128
+
+#define CPU_SHIFT 6
+#define CPU_MASK 0X03
+#define CPU_NUM(x) (((x) >> CPU_SHIFT) & CPU_MASK)
+
+#define CHANNEL_BASE 0x41
+#define CHANNEL_SHIFT 3
+#define CHANNEL_MASK 0x07
+#define CHANNEL_OFFSET(x) (((x) >> CHANNEL_SHIFT) & CHANNEL_MASK)
+#define CHANNEL_NUM(x) (CHANNEL_BASE + CHANNEL_OFFSET(x))
+
+#define DIMM_MASK 0x07
+#define DIMM_NUM(x) ((x) & DIMM_MASK)
+
+#define GET_PLATFORM_ID_DATA_SIZE 4
+
+// Magic code to check if it's valid command
+#define QCT_MAGIC_1 0x4C
+#define QCT_MAGIC_2 0x1C
+#define QCT_MAGIC_3 0x00
+#define QCT_MAGIC_4 0x02
+
+qct_platform_t
+oem_qct_get_platform_id(struct ipmi_intf *intf)
+{
+ /* Execute a Get platform ID command to determine the board */
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ qct_platform_t platform_id;
+ uint8_t msg_data[GET_PLATFORM_ID_DATA_SIZE];
+
+ /* Ask for IPMI v2 data as well */
+ msg_data[0] = QCT_MAGIC_1;
+ msg_data[1] = QCT_MAGIC_2;
+ msg_data[2] = QCT_MAGIC_3;
+ msg_data[3] = QCT_MAGIC_4;
+
+ memset(&req, 0, sizeof(req));
+ req.msg.netfn = OEM_QCT_NETFN;
+ req.msg.cmd = OEM_QCT_GET_INFO;
+ req.msg.data = msg_data;
+ req.msg.data_len = sizeof(msg_data);
+
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ lprintf(LOG_ERR, "Get Platform ID command failed");
+ return 0;
+ }
+ if (rsp->ccode) {
+ lprintf(LOG_ERR, "Get Platform ID command failed: %#x %s",
+ rsp->ccode, val2str(rsp->ccode, completion_code_vals));
+ return 0;
+ }
+ platform_id = rsp->data[0];
+ lprintf(LOG_DEBUG,"Platform ID: %hhx", rsp->data[0]);
+ return platform_id;
+}
+
+char *
+oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
+{
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ char *desc = NULL;
+ int data;
+ int sensor_type;
+ qct_platform_t platform_id;
+
+ /* Get the OEM event Bytes of the SEL Records byte 15 to data */
+ data = rec->sel_type.standard_type.event_data[2];
+ /* Check for the Standard Event type == 0x6F */
+ if (rec->sel_type.standard_type.event_type != 0x6F) {
+ goto out;
+ }
+ /* Allocate mem for the Description string */
+ desc = malloc(SIZE_OF_DESC);
+ if (!desc) {
+ lprintf(LOG_ERR, "ipmitool: malloc failure");
+ goto out;
+ }
+ memset(desc, 0, SIZE_OF_DESC);
+ sensor_type = rec->sel_type.standard_type.sensor_type;
+ switch (sensor_type) {
+ case SENSOR_TYPE_MEMORY:
+ memset(&req, 0, sizeof (req));
+ req.msg.netfn = IPMI_NETFN_APP;
+ req.msg.lun = 0;
+ req.msg.cmd = BMC_GET_DEVICE_ID;
+ req.msg.data = NULL;
+ req.msg.data_len = 0;
+
+ rsp = intf->sendrecv(intf, &req);
+ if (!rsp) {
+ lprintf(LOG_ERR, " Error getting system info");
+ goto out;
+ } else if (rsp->ccode) {
+ lprintf(LOG_ERR, " Error getting system info: %s",
+ val2str(rsp->ccode, completion_code_vals));
+ goto out;
+ }
+ /* check the platform type */
+ platform_id = oem_qct_get_platform_id(intf);
+ if (OEM_QCT_PLATFORM_PURLEY == platform_id) {
+ snprintf(desc, SIZE_OF_DESC, "CPU%d_%c%d",
+ CPU_NUM(data),
+ CHANNEL_NUM(data),
+ DIMM_NUM(data));
+ }
+ break;
+ default:
+ goto out;
+ }
+ return desc;
+out:
+ if (desc) {
+ free(desc);
+ desc = NULL;
+ }
+ return desc;
+}
diff --git a/lib/ipmi_raw.c b/lib/ipmi_raw.c
index 92c0177..a8a42a0 100644
--- a/lib/ipmi_raw.c
+++ b/lib/ipmi_raw.c
@@ -101,11 +101,11 @@ ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
}
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "I2C Master Write-Read command failed");
return NULL;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
switch (rsp->ccode) {
case 0x81:
lprintf(LOG_ERR, "I2C Master Write-Read command failed: Lost Arbitration");
@@ -145,7 +145,7 @@ ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv)
memset(spd_data, 0, RAW_SPD_SIZE);
- if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc < 2 || !strcmp(argv[0], "help")) {
lprintf(LOG_NOTICE, "usage: spd <i2cbus> <i2caddr> [channel] [maxread]");
return 0;
}
@@ -171,7 +171,7 @@ ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv)
for (i = 0; i < RAW_SPD_SIZE; i+= msize) {
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr,
(uint8_t *)&i, 1, msize );
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
return -1;
}
@@ -190,6 +190,9 @@ static void rawi2c_usage(void)
lprintf(LOG_NOTICE, " chan=0 is default, bus= must be specified to use chan=");
}
+#define BUS_KW "bus="
+#define CHAN_KW "chan="
+
int
ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
{
@@ -203,25 +206,25 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
int i = 0;
/* handle bus= argument */
- if (argc > 2 && strncmp(argv[0], "bus=", 4) == 0) {
+ if (argc > 2 && !strncmp(argv[0], BUS_KW, strlen(BUS_KW))) {
i = 1;
- if (strncmp(argv[0], "bus=public", 10) == 0)
+ if (!strcmp(argv[0], BUS_KW "public"))
bus = 0;
- else if (sscanf(argv[0], "bus=%u", &rbus) == 1)
+ else if (sscanf(argv[0], BUS_KW "%u", &rbus) == 1)
bus = ((rbus & 7) << 1) | 1;
else
bus = 0;
/* handle channel= argument
* the bus= argument must be supplied first on command line */
- if (argc > 3 && strncmp(argv[1], "chan=", 5) == 0) {
+ if (argc > 3 && !strncmp(argv[1], CHAN_KW, strlen(CHAN_KW))) {
i = 2;
- if (sscanf(argv[1], "chan=%u", &rbus) == 1)
+ if (sscanf(argv[1], CHAN_KW "%u", &rbus) == 1)
bus |= rbus << 4;
}
}
- if ((argc-i) < 2 || strncmp(argv[0], "help", 4) == 0) {
+ if ((argc - i) < 2 || !strcmp(argv[0], "help")) {
rawi2c_usage();
return 0;
}
@@ -259,7 +262,7 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
printbuf(wdata, wsize, "WRITE DATA");
rsp = ipmi_master_write_read(intf, bus, i2caddr, wdata, wsize, rsize);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
return -1;
}
@@ -322,7 +325,7 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
int i;
uint8_t data[256];
- if (argc == 1 && strncmp(argv[0], "help", 4) == 0) {
+ if (argc == 1 && !strcmp(argv[0], "help")) {
ipmi_raw_help();
return 0;
}
@@ -379,13 +382,13 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to send RAW command "
"(channel=0x%x netfn=0x%x lun=0x%x cmd=0x%x)",
intf->target_channel & 0x0f, req.msg.netfn, req.msg.lun, req.msg.cmd);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Unable to send RAW command "
"(channel=0x%x netfn=0x%x lun=0x%x cmd=0x%x rsp=0x%x): %s",
intf->target_channel & 0x0f, req.msg.netfn, req.msg.lun, req.msg.cmd, rsp->ccode,
@@ -417,7 +420,7 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
*/
int
is_valid_param(const char *input_param, uint8_t *uchr_ptr, const char *label) {
- if (input_param == NULL || label == NULL) {
+ if (!input_param || !label) {
lprintf(LOG_ERROR, "ERROR: NULL pointer passed.");
return (-1);
}
diff --git a/lib/ipmi_sdr.c b/lib/ipmi_sdr.c
index e3122dc..42ae9f9 100644
--- a/lib/ipmi_sdr.c
+++ b/lib/ipmi_sdr.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012 Hewlett-Packard Development Company, L.P.
+ * Copyright 2020 Joyent, Inc.
*
* Based on code from
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
@@ -32,7 +33,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _BSD_SOURCE
#include <string.h>
@@ -53,6 +53,7 @@
#include <ipmitool/ipmi_entity.h>
#include <ipmitool/ipmi_constants.h>
#include <ipmitool/ipmi_strings.h>
+#include <ipmitool/ipmi_time.h>
#if HAVE_CONFIG_H
# include <config.h>
@@ -68,41 +69,211 @@ static struct sdr_record_list *sdr_list_head = NULL;
static struct sdr_record_list *sdr_list_tail = NULL;
static struct ipmi_sdr_iterator *sdr_list_itr = NULL;
-void printf_sdr_usage();
+/* IPMI 2.0 Table 43-15, Sensor Unit Type Codes */
+#define UNIT_TYPE_MAX 92 /* This is the ID of "grams" */
+#define UNIT_TYPE_LONGEST_NAME 19 /* This is the length of "color temp deg K" */
+static const char *unit_desc[] = {
+ "unspecified",
+ "degrees C",
+ "degrees F",
+ "degrees K",
+ "Volts",
+ "Amps",
+ "Watts",
+ "Joules",
+ "Coulombs",
+ "VA",
+ "Nits",
+ "lumen",
+ "lux",
+ "Candela",
+ "kPa",
+ "PSI",
+ "Newton",
+ "CFM",
+ "RPM",
+ "Hz",
+ "microsecond",
+ "millisecond",
+ "second",
+ "minute",
+ "hour",
+ "day",
+ "week",
+ "mil",
+ "inches",
+ "feet",
+ "cu in",
+ "cu feet",
+ "mm",
+ "cm",
+ "m",
+ "cu cm",
+ "cu m",
+ "liters",
+ "fluid ounce",
+ "radians",
+ "steradians",
+ "revolutions",
+ "cycles",
+ "gravities",
+ "ounce",
+ "pound",
+ "ft-lb",
+ "oz-in",
+ "gauss",
+ "gilberts",
+ "henry",
+ "millihenry",
+ "farad",
+ "microfarad",
+ "ohms",
+ "siemens",
+ "mole",
+ "becquerel",
+ "PPM",
+ "reserved",
+ "Decibels",
+ "DbA",
+ "DbC",
+ "gray",
+ "sievert",
+ "color temp deg K",
+ "bit",
+ "kilobit",
+ "megabit",
+ "gigabit",
+ "byte",
+ "kilobyte",
+ "megabyte",
+ "gigabyte",
+ "word",
+ "dword",
+ "qword",
+ "line",
+ "hit",
+ "miss",
+ "retry",
+ "reset",
+ "overflow",
+ "underrun",
+ "collision",
+ "packets",
+ "messages",
+ "characters",
+ "error",
+ "correctable error",
+ "uncorrectable error",
+ "fatal error",
+ "grams"
+};
+
+/* sensor type codes (IPMI v1.5 table 36.3)
+ / Updated to v2.0 Table 42-3, Sensor Type Codes */
+static const char *sensor_type_desc[] = {
+ "reserved",
+ "Temperature",
+ "Voltage",
+ "Current",
+ "Fan",
+ "Physical Security",
+ "Platform Security",
+ "Processor",
+ "Power Supply",
+ "Power Unit",
+ "Cooling Device",
+ "Other",
+ "Memory",
+ "Drive Slot / Bay",
+ "POST Memory Resize",
+ "System Firmwares",
+ "Event Logging Disabled",
+ "Watchdog1",
+ "System Event",
+ "Critical Interrupt",
+ "Button",
+ "Module / Board",
+ "Microcontroller",
+ "Add-in Card",
+ "Chassis",
+ "Chip Set",
+ "Other FRU",
+ "Cable / Interconnect",
+ "Terminator",
+ "System Boot Initiated",
+ "Boot Error",
+ "OS Boot",
+ "OS Critical Stop",
+ "Slot / Connector",
+ "System ACPI Power State",
+ "Watchdog2",
+ "Platform Alert",
+ "Entity Presence",
+ "Monitor ASIC",
+ "LAN",
+ "Management Subsys Health",
+ "Battery",
+ "Session Audit",
+ "Version Change",
+ "FRU State"
+};
-/* From src/plugins/ipmi_intf.c: */
-uint16_t
-ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf);
+void printf_sdr_usage();
-/* ipmi_sdr_get_unit_string - return units for base/modifier
+/** ipmi_sdr_get_unit_string - return units for base/modifier
*
- * @pct: units are a percentage
- * @type: unit type
- * @base: base
- * @modifier: modifier
+ * @param[in] pct Indicates that units are a percentage
+ * @param[in] relation Modifier unit to base unit relation
+ * (SDR_UNIT_MOD_NONE, SDR_UNIT_MOD_MUL,
+ * or SDR_UNIT_MOD_DIV)
+ * @param[in] base The base unit type id
+ * @param[in] modifier The modifier unit type id
*
- * returns pointer to static string
+ * @returns a pointer to static string
*/
const char *
-ipmi_sdr_get_unit_string(uint8_t pct, uint8_t type, uint8_t base, uint8_t modifier)
+ipmi_sdr_get_unit_string(bool pct, uint8_t relation,
+ uint8_t base, uint8_t modifier)
{
- static char unitstr[16];
+ /*
+ * Twice as long as the longest possible unit name, plus
+ * two characters for '%' and relation (either '*' or '/'),
+ * plus the terminating null-byte.
+ */
+ static char unitstr[2 * UNIT_TYPE_LONGEST_NAME + 2 + 1];
+
/*
* By default, if units are supposed to be percent, we will pre-pend
* the percent string to the textual representation of the units.
*/
- char *pctstr = pct ? "% " : "";
- memset(unitstr, 0, sizeof (unitstr));
- switch (type) {
- case 2:
- snprintf(unitstr, sizeof (unitstr), "%s%s * %s",
- pctstr, unit_desc[base], unit_desc[modifier]);
+ const char *pctstr = pct ? "% " : "";
+ const char *basestr;
+ const char *modstr;
+
+ if (base <= UNIT_TYPE_MAX) {
+ basestr = unit_desc[base];
+ }
+ else {
+ basestr = "invalid";
+ }
+
+ if (modifier <= UNIT_TYPE_MAX) {
+ modstr = unit_desc[modifier];
+ }
+ else {
+ modstr = "invalid";
+ }
+
+ switch (relation) {
+ case SDR_UNIT_MOD_MUL:
+ snprintf(unitstr, sizeof (unitstr), "%s%s*%s",
+ pctstr, basestr, modstr);
break;
- case 1:
+ case SDR_UNIT_MOD_DIV:
snprintf(unitstr, sizeof (unitstr), "%s%s/%s",
- pctstr, unit_desc[base], unit_desc[modifier]);
+ pctstr, basestr, modstr);
break;
- case 0:
+ case SDR_UNIT_MOD_NONE:
default:
/*
* Display the text "percent" only when the Base unit is
@@ -111,8 +282,8 @@ ipmi_sdr_get_unit_string(uint8_t pct, uint8_t type, uint8_t base, uint8_t modifi
if (base == 0 && pct) {
snprintf(unitstr, sizeof(unitstr), "percent");
} else {
- snprintf(unitstr, sizeof (unitstr), "%s%s",
- pctstr, unit_desc[base]);
+ snprintf(unitstr, sizeof (unitstr), "%s%s",
+ pctstr, basestr);
}
break;
}
@@ -138,8 +309,8 @@ sdr_sensor_has_analog_reading(struct ipmi_intf *intf,
* But... HP didn't interpret this as meaning that "Only Threshold
* Sensors" can provide analog readings. So, HP packed analog
* readings into some of their non-Threshold Sensor. There is
- * nothing that explictly prohibits this in the spec, so if
- * an Analog reading is available in a Non-Threshod sensor and
+ * nothing that explicitly prohibits this in the spec, so if
+ * an Analog reading is available in a Non-Threshold sensor and
* there are units specified for identifying the reading then
* we do an analog conversion even though the sensor is
* non-Threshold. To be safe, we provide this extension for
@@ -205,7 +376,7 @@ sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor, uint8_t val)
case 1:
if (val & 0x80)
val++;
- /* Deliberately fall through to case 2. */
+ /* fall through */
case 2:
result = (double) (((m * (int8_t) val) +
(b * pow(10, k1))) * pow(10, k2));
@@ -285,7 +456,7 @@ sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor, uint8_t val
case 1:
if (val & 0x80)
val++;
- /* Deliberately fall through to case 2. */
+ /* fall through */
case 2:
result = (double) (((m * (int8_t) val) ) * pow(10, k2));
break;
@@ -360,7 +531,7 @@ sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor, uint8_t val)
case 1:
if (val & 0x80)
val++;
- /* Deliberately fall through to case 2. */
+ /* fall through */
case 2:
result = (double) (((m * ((double)((int8_t) val)/2))) * pow(10, k2));
break;
@@ -689,35 +860,9 @@ ipmi_sdr_get_sensor_event_enable(struct ipmi_intf *intf, uint8_t sensor,
return rsp;
}
-/* ipmi_sdr_get_sensor_type_desc - Get sensor type descriptor
- *
- * @type: ipmi sensor type
- *
- * returns
- * string from sensor_type_desc
- * or "reserved"
- * or "OEM reserved"
- */
-const char *
-ipmi_sdr_get_sensor_type_desc(const uint8_t type)
-{
- static char desc[32];
- memset(desc, 0, 32);
- if (type <= SENSOR_TYPE_MAX)
- return sensor_type_desc[type];
- if (type < 0xc0)
- snprintf(desc, 32, "reserved #%02x", type);
- else
- {
- snprintf(desc, 32, oemval2str(sdriana,type,ipmi_oem_sdr_type_vals),
- type);
- }
- return desc;
-}
-
/* ipmi_sdr_get_thresh_status - threshold status indicator
*
- * @rsp: response from Get Sensor Reading comand
+ * @rsp: response from Get Sensor Reading command
* @validread: validity of the status field argument
* @invalidstr: string to return if status field is not valid
*
@@ -782,7 +927,7 @@ ipmi_sdr_get_thresh_status(struct sensor_reading *sr, const char *invalidstr)
return "ok";
}
-/* ipmi_sdr_get_header - retreive SDR record header
+/* ipmi_sdr_get_header - retrieve SDR record header
*
* @intf: ipmi interface
* @itr: sdr iterator
@@ -819,7 +964,7 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
for (try = 0; try < 5; try++) {
sdr_rq.reserve_id = itr->reservation;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SDR %04x command failed",
itr->next);
continue;
@@ -837,7 +982,7 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
"Unable to renew SDR reservation");
return NULL;
}
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Get SDR %04x command failed: %s",
itr->next, val2str(rsp->ccode,
completion_code_vals));
@@ -885,7 +1030,7 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
return &sdr_rs;
}
-/* ipmi_sdr_get_next_header - retreive next SDR header
+/* ipmi_sdr_get_next_header - retrieve next SDR header
*
* @intf: ipmi interface
* @itr: sdr iterator
@@ -902,7 +1047,7 @@ ipmi_sdr_get_next_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
return NULL;
header = ipmi_sdr_get_header(intf, itr);
- if (header == NULL)
+ if (!header)
return NULL;
itr->next = header->next;
@@ -985,13 +1130,13 @@ ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,
rsp = ipmi_sdr_get_sensor_event_status(intf, sensor_num,
target, lun, channel);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_DEBUG,
"Error reading event status for sensor #%02x",
sensor_num);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_DEBUG,
"Error reading event status for sensor #%02x: %s",
sensor_num, val2str(rsp->ccode, completion_code_vals));
@@ -1014,21 +1159,21 @@ ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,
switch (numeric_fmt) {
case DISCRETE_SENSOR:
if (rsp->data_len == 2) {
- ipmi_sdr_print_discrete_state("Assertion Events",
+ ipmi_sdr_print_discrete_state(intf, "Assertion Events",
sensor_type, event_type,
rsp->data[1], 0);
} else if (rsp->data_len > 2) {
- ipmi_sdr_print_discrete_state("Assertion Events",
+ ipmi_sdr_print_discrete_state(intf, "Assertion Events",
sensor_type, event_type,
rsp->data[1],
rsp->data[2]);
}
if (rsp->data_len == 4) {
- ipmi_sdr_print_discrete_state("Deassertion Events",
+ ipmi_sdr_print_discrete_state(intf, "Deassertion Events",
sensor_type, event_type,
rsp->data[3], 0);
} else if (rsp->data_len > 4) {
- ipmi_sdr_print_discrete_state("Deassertion Events",
+ ipmi_sdr_print_discrete_state(intf, "Deassertion Events",
sensor_type, event_type,
rsp->data[3],
rsp->data[4]);
@@ -1081,22 +1226,23 @@ ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,
}
static int
-ipmi_sdr_print_sensor_mask(struct sdr_record_mask *mask,
- uint8_t sensor_type,
- uint8_t event_type, int numeric_fmt)
+ipmi_sdr_print_sensor_mask(struct ipmi_intf *intf,
+ struct sdr_record_mask *mask,
+ uint8_t sensor_type,
+ uint8_t event_type, int numeric_fmt)
{
/* iceblink - don't print some event status fields - CVS rev1.53 */
return 0;
switch (numeric_fmt) {
case DISCRETE_SENSOR:
- ipmi_sdr_print_discrete_state("Assert Event Mask", sensor_type,
+ ipmi_sdr_print_discrete_state(intf, "Assert Event Mask", sensor_type,
event_type,
mask->type.discrete.
assert_event & 0xff,
(mask->type.discrete.
assert_event & 0xff00) >> 8);
- ipmi_sdr_print_discrete_state("Deassert Event Mask",
+ ipmi_sdr_print_discrete_state(intf, "Deassert Event Mask",
sensor_type, event_type,
mask->type.discrete.
deassert_event & 0xff,
@@ -1198,13 +1344,13 @@ ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf,
rsp = ipmi_sdr_get_sensor_event_enable(intf, sensor_num,
target, lun, channel);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_DEBUG,
"Error reading event enable for sensor #%02x",
sensor_num);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_DEBUG,
"Error reading event enable for sensor #%02x: %s",
sensor_num, val2str(rsp->ccode, completion_code_vals));
@@ -1224,21 +1370,21 @@ ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf,
case DISCRETE_SENSOR:
/* discrete */
if (rsp->data_len == 2) {
- ipmi_sdr_print_discrete_state("Assertions Enabled",
+ ipmi_sdr_print_discrete_state(intf, "Assertions Enabled",
sensor_type, event_type,
rsp->data[1], 0);
} else if (rsp->data_len > 2) {
- ipmi_sdr_print_discrete_state("Assertions Enabled",
+ ipmi_sdr_print_discrete_state(intf, "Assertions Enabled",
sensor_type, event_type,
rsp->data[1],
rsp->data[2]);
}
if (rsp->data_len == 4) {
- ipmi_sdr_print_discrete_state("Deassertions Enabled",
+ ipmi_sdr_print_discrete_state(intf, "Deassertions Enabled",
sensor_type, event_type,
rsp->data[3], 0);
} else if (rsp->data_len > 4) {
- ipmi_sdr_print_discrete_state("Deassertions Enabled",
+ ipmi_sdr_print_discrete_state(intf, "Deassertions Enabled",
sensor_type, event_type,
rsp->data[3],
rsp->data[4]);
@@ -1381,8 +1527,9 @@ print_sensor_min_max(struct sdr_record_full_sensor *full)
* returns void
*/
static void
-print_csv_discrete(struct sdr_record_common_sensor *sensor,
- const struct sensor_reading *sr)
+print_csv_discrete(struct ipmi_intf *intf,
+ struct sdr_record_common_sensor *sensor,
+ const struct sensor_reading *sr)
{
if (!sr->s_reading_valid || sr->s_reading_unavailable) {
printf("%02Xh,ns,%d.%d,No Reading",
@@ -1400,7 +1547,7 @@ print_csv_discrete(struct sdr_record_common_sensor *sensor,
printf("ok,%d.%d,",
sensor->entity.id,
sensor->entity.instance);
- ipmi_sdr_print_discrete_state_mini(NULL, ", ",
+ ipmi_sdr_print_discrete_state_mini(intf, NULL, ", ",
sensor->sensor.type,
sensor->event_type,
sr->s_data2,
@@ -1423,14 +1570,14 @@ ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
{
static struct sensor_reading sr;
- if (sensor == NULL)
+ if (!sensor)
return NULL;
/* Initialize to reading valid value of zero */
memset(&sr, 0, sizeof(sr));
switch (sdr_record_type) {
- int idlen;
+ unsigned int idlen;
case (SDR_RECORD_TYPE_FULL_SENSOR):
sr.full = (struct sdr_record_full_sensor *)sensor;
idlen = sr.full->id_code & 0x1f;
@@ -1463,7 +1610,7 @@ ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
sr.s_a_units = ""; /* no converted analog units units */
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_DEBUG, "Error reading sensor %s (#%02x)",
sr.s_id, sensor->keys.sensor_num);
return &sr;
@@ -1542,14 +1689,14 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
uint8_t sdr_record_type)
{
char sval[16];
- int i = 0;
+ unsigned int i = 0;
uint8_t target, lun, channel;
struct sensor_reading *sr;
sr = ipmi_sdr_read_sensor_value(intf, sensor, sdr_record_type, 2);
- if (sr == NULL)
+ if (!sr)
return -1;
target = sensor->keys.owner_id;
@@ -1567,7 +1714,7 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
printf("%s,", sr->s_id);
if (!IS_THRESHOLD_SENSOR(sensor)) {
/* Discrete/Non-Threshold */
- print_csv_discrete(sensor, sr);
+ print_csv_discrete(intf, sensor, sr);
printf("\n");
}
else {
@@ -1581,7 +1728,7 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
printf("%s,%s", sr->s_a_units,
ipmi_sdr_get_thresh_status(sr, "ns"));
} else { /* Discrete/Threshold */
- print_csv_discrete(sensor, sr);
+ print_csv_discrete(intf, sensor, sr);
}
} else {
printf(",,ns");
@@ -1589,10 +1736,9 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
if (verbose) {
printf(",%d.%d,%s,%s,",
- sensor->entity.id, sensor->entity.instance,
- val2str(sensor->entity.id, entity_id_vals),
- ipmi_sdr_get_sensor_type_desc(sensor->sensor.
- type));
+ sensor->entity.id, sensor->entity.instance,
+ val2str(sensor->entity.id, entity_id_vals),
+ ipmi_get_sensor_type(intf, sensor->sensor.type));
if (sr->full) {
SENSOR_PRINT_CSV(sr->full, sr->full->analog_flag.nominal_read,
@@ -1712,7 +1858,7 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
printf("%s %s", sr->s_a_str, sr->s_a_units);
header = ", ";
}
- ipmi_sdr_print_discrete_state_mini(header, ", ",
+ ipmi_sdr_print_discrete_state_mini(intf, header, ", ",
sensor->sensor.type,
sensor->event_type,
sr->s_data2,
@@ -1740,7 +1886,7 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
if (!IS_THRESHOLD_SENSOR(sensor)) {
/* Discrete */
printf(" Sensor Type (Discrete): %s (0x%02x)\n",
- ipmi_sdr_get_sensor_type_desc(sensor->sensor.type),
+ ipmi_get_sensor_type(intf, sensor->sensor.type),
sensor->sensor.type);
lprintf(LOG_DEBUG, " Event Type Code : 0x%02x",
sensor->event_type);
@@ -1776,12 +1922,12 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
break;
}
- ipmi_sdr_print_discrete_state("States Asserted",
+ ipmi_sdr_print_discrete_state(intf, "States Asserted",
sensor->sensor.type,
sensor->event_type,
sr->s_data2,
sr->s_data3);
- ipmi_sdr_print_sensor_mask(&sensor->mask, sensor->sensor.type,
+ ipmi_sdr_print_sensor_mask(intf, &sensor->mask, sensor->sensor.type,
sensor->event_type, DISCRETE_SENSOR);
ipmi_sdr_print_sensor_event_status(intf,
sensor->keys.sensor_num,
@@ -1804,7 +1950,7 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
return 0; /* done */
}
printf(" Sensor Type (Threshold) : %s (0x%02x)\n",
- ipmi_sdr_get_sensor_type_desc(sensor->sensor.type),
+ ipmi_get_sensor_type(intf, sensor->sensor.type),
sensor->sensor.type);
printf(" Sensor Reading : ");
@@ -1945,7 +2091,7 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
printf("\n");
}
- ipmi_sdr_print_sensor_mask(&sensor->mask,
+ ipmi_sdr_print_sensor_mask(intf, &sensor->mask,
sensor->sensor.type,
sensor->event_type, ANALOG_SENSOR);
ipmi_sdr_print_sensor_event_status(intf,
@@ -1988,46 +2134,43 @@ get_offset(uint8_t x)
* no meaningful return value
*/
void
-ipmi_sdr_print_discrete_state_mini(const char *header, const char *separator,
+ipmi_sdr_print_discrete_state_mini(struct ipmi_intf *intf,
+ const char *header, const char *separator,
uint8_t sensor_type, uint8_t event_type,
uint8_t state1, uint8_t state2)
{
- uint8_t typ;
- struct ipmi_event_sensor_types *evt;
+ const struct ipmi_event_sensor_types *evt;
int pre = 0, c = 0;
if (state1 == 0 && (state2 & 0x7f) == 0)
return;
- if (event_type == 0x6f) {
- evt = sensor_specific_types;
- typ = sensor_type;
- } else {
- evt = generic_event_types;
- typ = event_type;
- }
-
if (header)
printf("%s", header);
- for (; evt->type != NULL; evt++) {
- if ((evt->code != typ) ||
- (evt->data != 0xFF))
+ for (evt = ipmi_get_first_event_sensor_type(intf, sensor_type, event_type);
+ evt; evt = ipmi_get_next_event_sensor_type(evt)) {
+ if (evt->data != 0xFF) {
continue;
+ }
if (evt->offset > 7) {
if ((1 << (evt->offset - 8)) & (state2 & 0x7f)) {
- if (pre++ != 0)
+ if (pre++ != 0) {
printf("%s", separator);
- if (evt->desc)
+ }
+ if (evt->desc) {
printf("%s", evt->desc);
+ }
}
} else {
if ((1 << evt->offset) & state1) {
- if (pre++ != 0)
+ if (pre++ != 0) {
printf("%s", separator);
- if (evt->desc)
+ }
+ if (evt->desc) {
printf("%s", evt->desc);
+ }
}
}
c++;
@@ -2045,32 +2188,24 @@ ipmi_sdr_print_discrete_state_mini(const char *header, const char *separator,
* no meaningful return value
*/
void
-ipmi_sdr_print_discrete_state(const char *desc,
+ipmi_sdr_print_discrete_state(struct ipmi_intf *intf, const char *desc,
uint8_t sensor_type, uint8_t event_type,
uint8_t state1, uint8_t state2)
{
- uint8_t typ;
- struct ipmi_event_sensor_types *evt;
+ const struct ipmi_event_sensor_types *evt;
int pre = 0, c = 0;
if (state1 == 0 && (state2 & 0x7f) == 0)
return;
- if (event_type == 0x6f) {
- evt = sensor_specific_types;
- typ = sensor_type;
- } else {
- evt = generic_event_types;
- typ = event_type;
- }
-
- for (; evt->type != NULL; evt++) {
- if ((evt->code != typ) ||
- (evt->data != 0xFF))
+ for (evt = ipmi_get_first_event_sensor_type(intf, sensor_type, event_type);
+ evt; evt = ipmi_get_next_event_sensor_type(evt)) {
+ if (evt->data != 0xFF) {
continue;
+ }
if (pre == 0) {
- printf(" %-21s : %s\n", desc, evt->type);
+ printf(" %-21s : %s\n", desc, ipmi_get_sensor_type(intf, sensor_type));
pre = 1;
}
@@ -2116,11 +2251,11 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
{
char desc[17];
- if (sensor == NULL)
+ if (!sensor)
return -1;
memset(desc, 0, sizeof (desc));
- snprintf(desc, (sensor->id_code & 0x1f) + 1, "%s", sensor->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (sensor->id_code & 0x1f) + 1, sensor->id_string);
if (verbose) {
printf("Sensor ID : %s (0x%x)\n",
@@ -2129,7 +2264,7 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
sensor->entity.id, sensor->entity.instance,
val2str(sensor->entity.id, entity_id_vals));
printf("Sensor Type : %s (0x%02x)\n",
- ipmi_sdr_get_sensor_type_desc(sensor->sensor_type),
+ ipmi_get_sensor_type(intf, sensor->sensor_type),
sensor->sensor_type);
lprintf(LOG_DEBUG, "Event Type Code : 0x%02x",
sensor->event_type);
@@ -2155,23 +2290,21 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
/* ipmi_sdr_print_sensor_mc_locator - print SDR MC locator record
*
- * @intf: ipmi interface
* @mc: mc locator sdr record
*
* returns 0 on success
* returns -1 on error
*/
int
-ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf,
- struct sdr_record_mc_locator *mc)
+ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc)
{
char desc[17];
- if (mc == NULL)
+ if (!mc)
return -1;
memset(desc, 0, sizeof (desc));
- snprintf(desc, (mc->id_code & 0x1f) + 1, "%s", mc->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (mc->id_code & 0x1f) + 1, mc->id_string);
if (verbose == 0) {
if (csv_output)
@@ -2251,20 +2384,18 @@ ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf,
/* ipmi_sdr_print_sensor_generic_locator - print generic device locator record
*
- * @intf: ipmi interface
* @gen: generic device locator sdr record
*
* returns 0 on success
* returns -1 on error
*/
int
-ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf,
- struct sdr_record_generic_locator *dev)
+ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *dev)
{
char desc[17];
memset(desc, 0, sizeof (desc));
- snprintf(desc, (dev->id_code & 0x1f) + 1, "%s", dev->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (dev->id_code & 0x1f) + 1, dev->id_string);
if (!verbose) {
if (csv_output)
@@ -2308,20 +2439,18 @@ ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf,
/* ipmi_sdr_print_sensor_fru_locator - print FRU locator record
*
- * @intf: ipmi interface
* @fru: fru locator sdr record
*
* returns 0 on success
* returns -1 on error
*/
int
-ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf,
- struct sdr_record_fru_locator *fru)
+ipmi_sdr_print_sensor_fru_locator(struct sdr_record_fru_locator *fru)
{
char desc[17];
memset(desc, 0, sizeof (desc));
- snprintf(desc, (fru->id_code & 0x1f) + 1, "%s", fru->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (fru->id_code & 0x1f) + 1, fru->id_string);
if (!verbose) {
if (csv_output)
@@ -2365,32 +2494,15 @@ ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf,
return 0;
}
-/* ipmi_sdr_print_sensor_entity_assoc - print SDR entity association record
- *
- * @intf: ipmi interface
- * @mc: entity association sdr record
- *
- * returns 0 on success
- * returns -1 on error
- */
-int
-ipmi_sdr_print_sensor_entity_assoc(struct ipmi_intf *intf,
- struct sdr_record_entity_assoc *assoc)
-{
- return 0;
-}
-
/* ipmi_sdr_print_sensor_oem_intel - print Intel OEM sensors
*
- * @intf: ipmi interface
* @oem: oem sdr record
*
* returns 0 on success
* returns -1 on error
*/
static int
-ipmi_sdr_print_sensor_oem_intel(struct ipmi_intf *intf,
- struct sdr_record_oem *oem)
+ipmi_sdr_print_sensor_oem_intel(struct sdr_record_oem *oem)
{
switch (oem->data[3]) { /* record sub-type */
case 0x02: /* Power Unit Map */
@@ -2471,20 +2583,19 @@ ipmi_sdr_print_sensor_oem_intel(struct ipmi_intf *intf,
* a particular BMC might stuff into its OEM records. The
* records are keyed off manufacturer ID and record subtypes.
*
- * @intf: ipmi interface
* @oem: oem sdr record
*
* returns 0 on success
* returns -1 on error
*/
static int
-ipmi_sdr_print_sensor_oem(struct ipmi_intf *intf, struct sdr_record_oem *oem)
+ipmi_sdr_print_sensor_oem(struct sdr_record_oem *oem)
{
int rc = 0;
- if (oem == NULL)
+ if (!oem)
return -1;
- if (oem->data_len == 0 || oem->data == NULL)
+ if (oem->data_len == 0 || !oem->data)
return -1;
if (verbose > 2)
@@ -2493,7 +2604,7 @@ ipmi_sdr_print_sensor_oem(struct ipmi_intf *intf, struct sdr_record_oem *oem)
/* intel manufacturer id */
if (oem->data[0] == 0x57 &&
oem->data[1] == 0x01 && oem->data[2] == 0x00) {
- rc = ipmi_sdr_print_sensor_oem_intel(intf, oem);
+ rc = ipmi_sdr_print_sensor_oem_intel(oem);
}
return rc;
@@ -2501,7 +2612,6 @@ ipmi_sdr_print_sensor_oem(struct ipmi_intf *intf, struct sdr_record_oem *oem)
/* ipmi_sdr_print_name_from_rawentry - Print SDR name from raw data
*
- * @intf: ipmi interface
* @type: sensor type
* @raw: raw sensor data
*
@@ -2509,8 +2619,8 @@ ipmi_sdr_print_sensor_oem(struct ipmi_intf *intf, struct sdr_record_oem *oem)
* returns -1 on error
*/
int
-ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf,uint16_t id,
- uint8_t type,uint8_t * raw)
+ipmi_sdr_print_name_from_rawentry(uint16_t id,
+ uint8_t type, uint8_t *raw)
{
union {
struct sdr_record_full_sensor *full;
@@ -2525,35 +2635,43 @@ ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf,uint16_t id,
int rc =0;
char desc[17];
+ const char *id_string;
+ uint8_t id_code;
memset(desc, ' ', sizeof (desc));
switch ( type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
record.full = (struct sdr_record_full_sensor *) raw;
- snprintf(desc, (record.full->id_code & 0x1f) +1, "%s",
- (const char *)record.full->id_string);
+ id_code = record.full->id_code;
+ id_string = record.full->id_string;
break;
+
case SDR_RECORD_TYPE_COMPACT_SENSOR:
record.compact = (struct sdr_record_compact_sensor *) raw ;
- snprintf(desc, (record.compact->id_code & 0x1f) +1, "%s",
- (const char *)record.compact->id_string);
+ id_code = record.compact->id_code;
+ id_string = record.compact->id_string;
break;
+
case SDR_RECORD_TYPE_EVENTONLY_SENSOR:
record.eventonly = (struct sdr_record_eventonly_sensor *) raw ;
- snprintf(desc, (record.eventonly->id_code & 0x1f) +1, "%s",
- (const char *)record.eventonly->id_string);
- break;
+ id_code = record.eventonly->id_code;
+ id_string = record.eventonly->id_string;
+ break;
+
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
record.mcloc = (struct sdr_record_mc_locator *) raw ;
- snprintf(desc, (record.mcloc->id_code & 0x1f) +1, "%s",
- (const char *)record.mcloc->id_string);
+ id_code = record.mcloc->id_code;
+ id_string = record.mcloc->id_string;
break;
+
default:
rc = -1;
- break;
- }
+ }
+ if (!rc) {
+ snprintf(desc, sizeof(desc), "%.*s", (id_code & 0x1f) + 1, id_string);
+ }
- lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc);
+ lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc);
return rc;
}
@@ -2587,35 +2705,27 @@ ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type,
*) raw);
break;
case SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR:
- rc = ipmi_sdr_print_sensor_generic_locator(intf,
- (struct
+ rc = ipmi_sdr_print_sensor_generic_locator((struct
sdr_record_generic_locator
*) raw);
break;
case SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR:
- rc = ipmi_sdr_print_sensor_fru_locator(intf,
- (struct
+ rc = ipmi_sdr_print_sensor_fru_locator((struct
sdr_record_fru_locator
*) raw);
break;
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
- rc = ipmi_sdr_print_sensor_mc_locator(intf,
- (struct
+ rc = ipmi_sdr_print_sensor_mc_locator((struct
sdr_record_mc_locator *)
raw);
break;
case SDR_RECORD_TYPE_ENTITY_ASSOC:
- rc = ipmi_sdr_print_sensor_entity_assoc(intf,
- (struct
- sdr_record_entity_assoc
- *) raw);
break;
case SDR_RECORD_TYPE_OEM:{
struct sdr_record_oem oem;
oem.data = raw;
oem.data_len = len;
- rc = ipmi_sdr_print_sensor_oem(intf,
- (struct sdr_record_oem *)
+ rc = ipmi_sdr_print_sensor_oem((struct sdr_record_oem *)
&oem);
break;
}
@@ -2652,24 +2762,19 @@ ipmi_sdr_print_listentry(struct ipmi_intf *intf, struct sdr_record_list *entry)
entry->record.eventonly);
break;
case SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR:
- rc = ipmi_sdr_print_sensor_generic_locator(intf,
- entry->record.
+ rc = ipmi_sdr_print_sensor_generic_locator(entry->record.
genloc);
break;
case SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR:
- rc = ipmi_sdr_print_sensor_fru_locator(intf,
- entry->record.fruloc);
+ rc = ipmi_sdr_print_sensor_fru_locator(entry->record.fruloc);
break;
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
- rc = ipmi_sdr_print_sensor_mc_locator(intf,
- entry->record.mcloc);
+ rc = ipmi_sdr_print_sensor_mc_locator(entry->record.mcloc);
break;
case SDR_RECORD_TYPE_ENTITY_ASSOC:
- rc = ipmi_sdr_print_sensor_entity_assoc(intf,
- entry->record.entassoc);
break;
case SDR_RECORD_TYPE_OEM:
- rc = ipmi_sdr_print_sensor_oem(intf, entry->record.oem);
+ rc = ipmi_sdr_print_sensor_oem(entry->record.oem);
break;
case SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC:
case SDR_RECORD_TYPE_MC_CONFIRMATION:
@@ -2698,15 +2803,15 @@ ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type)
lprintf(LOG_DEBUG, "Querying SDR for sensor list");
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = ipmi_sdr_start(intf, 0);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return -1;
}
}
- for (e = sdr_list_head; e != NULL; e = e->next) {
+ for (e = sdr_list_head; e; e = e->next) {
if (type != e->type && type != 0xff && type != 0xfe)
continue;
if (type == 0xfe &&
@@ -2717,21 +2822,21 @@ ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type)
rc = -1;
}
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr))) {
uint8_t *rec;
struct sdr_record_list *sdrr;
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
- if (rec == NULL) {
+ if (!rec) {
lprintf(LOG_ERR, "ipmitool: ipmi_sdr_get_record() failed");
rc = -1;
continue;
}
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
- if (rec != NULL) {
+ if (rec) {
free(rec);
rec = NULL;
}
@@ -2770,7 +2875,7 @@ ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type)
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -2789,7 +2894,7 @@ ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type)
}
/* add to global record liset */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -2828,9 +2933,9 @@ ipmi_sdr_get_reservation(struct ipmi_intf *intf, int use_builtin,
rsp = intf->sendrecv(intf, &req);
/* be slient for errors, they are handled by calling function */
- if (rsp == NULL)
+ if (!rsp)
return -1;
- if (rsp->ccode > 0)
+ if (rsp->ccode)
return -1;
*reserve_id = ((struct sdr_reserve_repo_rs *) &(rsp->data))->reserve_id;
@@ -2856,7 +2961,7 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
struct ipm_devid_rsp *devid;
itr = malloc(sizeof (struct ipmi_sdr_iterator));
- if (itr == NULL) {
+ if (!itr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -2869,13 +2974,13 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Device ID command failed");
free(itr);
itr = NULL;
return NULL;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Device ID command failed: %#x %s",
rsp->ccode, val2str(rsp->ccode, completion_code_vals));
free(itr);
@@ -2911,13 +3016,13 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
req.msg.cmd = GET_SDR_REPO_INFO;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error obtaining SDR info");
free(itr);
itr = NULL;
return NULL;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error obtaining SDR info: %s",
val2str(rsp->ccode, completion_code_vals));
free(itr);
@@ -3009,7 +3114,7 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
return NULL;
data = malloc(len + 1);
- if (data == NULL) {
+ if (!data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -3055,7 +3160,8 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
sdr_rq.length, sdr_rq.offset);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+
+ if (!rsp || rsp->ccode == IPMI_CC_CANT_RET_NUM_REQ_BYTES) {
sdr_max_read_len = sdr_rq.length - 1;
if (sdr_max_read_len > 0) {
/* no response may happen if requests are bridged
@@ -3066,14 +3172,7 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
data = NULL;
return NULL;
}
- }
-
- switch (rsp->ccode) {
- case 0xca:
- /* read too many bytes at once */
- sdr_max_read_len = sdr_rq.length - 1;
- continue;
- case 0xc5:
+ } else if (rsp->ccode == IPMI_CC_RES_CANCELED) {
/* lost reservation */
lprintf(LOG_DEBUG, "SDR reservation cancelled. "
"Sleeping a bit and retrying...");
@@ -3091,14 +3190,14 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
}
/* special completion codes handled above */
- if (rsp->ccode > 0 || rsp->data_len == 0) {
+ if (rsp->ccode || rsp->data_len == 0) {
free(data);
data = NULL;
return NULL;
}
memcpy(data + i, rsp->data + 2, sdr_rq.length);
- i += sdr_max_read_len;
+ i += sdr_rq.length;
}
return data;
@@ -3106,13 +3205,12 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
/* ipmi_sdr_end - cleanup SDR iterator
*
- * @intf: ipmi interface
* @itr: SDR iterator
*
* no meaningful return code
*/
void
-ipmi_sdr_end(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
+ipmi_sdr_end(struct ipmi_sdr_iterator *itr)
{
if (itr) {
free(itr);
@@ -3134,11 +3232,11 @@ __sdr_list_add(struct sdr_record_list *head, struct sdr_record_list *entry)
struct sdr_record_list *e;
struct sdr_record_list *new;
- if (head == NULL)
+ if (!head)
return -1;
new = malloc(sizeof (struct sdr_record_list));
- if (new == NULL) {
+ if (!new) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -3163,7 +3261,7 @@ static void
__sdr_list_empty(struct sdr_record_list *head)
{
struct sdr_record_list *e, *f;
- for (e = head; e != NULL; e = f) {
+ for (e = head; e; e = f) {
f = e->next;
free(e);
e = NULL;
@@ -3173,18 +3271,16 @@ __sdr_list_empty(struct sdr_record_list *head)
/* ipmi_sdr_list_empty - clean global SDR list
*
- * @intf: ipmi interface
- *
* no meaningful return code
*/
void
-ipmi_sdr_list_empty(struct ipmi_intf *intf)
+ipmi_sdr_list_empty(void)
{
struct sdr_record_list *list, *next;
- ipmi_sdr_end(intf, sdr_list_itr);
+ ipmi_sdr_end(sdr_list_itr);
- for (list = sdr_list_head; list != NULL; list = next) {
+ for (list = sdr_list_head; list; list = next) {
switch (list->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
case SDR_RECORD_TYPE_COMPACT_SENSOR:
@@ -3251,16 +3347,16 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint16_t gen_id, uint8_t num
struct sdr_record_list *e;
int found = 0;
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = ipmi_sdr_start(intf, 0);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return NULL;
}
}
/* check what we've already read */
- for (e = sdr_list_head; e != NULL; e = e->next) {
+ for (e = sdr_list_head; e; e = e->next) {
switch (e->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
case SDR_RECORD_TYPE_COMPACT_SENSOR:
@@ -3279,12 +3375,12 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint16_t gen_id, uint8_t num
}
/* now keep looking */
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr))) {
uint8_t *rec;
struct sdr_record_list *sdrr;
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
break;
}
@@ -3293,8 +3389,8 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint16_t gen_id, uint8_t num
sdrr->type = header->type;
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
- if (rec == NULL) {
- if (sdrr != NULL) {
+ if (!rec) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3338,7 +3434,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint16_t gen_id, uint8_t num
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3346,7 +3442,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint16_t gen_id, uint8_t num
}
/* put in the global record list */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -3375,9 +3471,9 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
struct sdr_get_rs *header;
struct sdr_record_list *e;
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = ipmi_sdr_start(intf, 0);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return NULL;
}
@@ -3385,13 +3481,13 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
/* check what we've already read */
head = malloc(sizeof (struct sdr_record_list));
- if (head == NULL) {
+ if (!head) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
memset(head, 0, sizeof (struct sdr_record_list));
- for (e = sdr_list_head; e != NULL; e = e->next) {
+ for (e = sdr_list_head; e; e = e->next) {
switch (e->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
case SDR_RECORD_TYPE_COMPACT_SENSOR:
@@ -3406,12 +3502,12 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
}
/* now keep looking */
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr))) {
uint8_t *rec;
struct sdr_record_list *sdrr;
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
break;
}
@@ -3420,8 +3516,8 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
sdrr->type = header->type;
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
- if (rec == NULL) {
- if (sdrr != NULL) {
+ if (!rec) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3461,7 +3557,7 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3469,7 +3565,7 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
}
/* put in the global record list */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -3495,23 +3591,23 @@ ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity)
struct sdr_record_list *e;
struct sdr_record_list *head;
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = ipmi_sdr_start(intf, 0);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return NULL;
}
}
head = malloc(sizeof (struct sdr_record_list));
- if (head == NULL) {
+ if (!head) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
memset(head, 0, sizeof (struct sdr_record_list));
/* check what we've already read */
- for (e = sdr_list_head; e != NULL; e = e->next) {
+ for (e = sdr_list_head; e; e = e->next) {
switch (e->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
case SDR_RECORD_TYPE_COMPACT_SENSOR:
@@ -3560,12 +3656,12 @@ ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity)
}
/* now keep looking */
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr))) {
uint8_t *rec;
struct sdr_record_list *sdrr;
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
break;
}
@@ -3574,8 +3670,8 @@ ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity)
sdrr->type = header->type;
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
- if (rec == NULL) {
- if (sdrr != NULL) {
+ if (!rec) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3641,7 +3737,7 @@ ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity)
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3649,7 +3745,7 @@ ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity)
}
/* add to global record list */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -3675,33 +3771,33 @@ ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type)
struct sdr_record_list *e;
struct sdr_record_list *head;
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = ipmi_sdr_start(intf, 0);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return NULL;
}
}
head = malloc(sizeof (struct sdr_record_list));
- if (head == NULL) {
+ if (!head) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
memset(head, 0, sizeof (struct sdr_record_list));
/* check what we've already read */
- for (e = sdr_list_head; e != NULL; e = e->next)
+ for (e = sdr_list_head; e; e = e->next)
if (e->type == type)
__sdr_list_add(head, e);
/* now keep looking */
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr))) {
uint8_t *rec;
struct sdr_record_list *sdrr;
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
break;
}
@@ -3710,8 +3806,8 @@ ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type)
sdrr->type = header->type;
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
- if (rec == NULL) {
- if (sdrr != NULL) {
+ if (!rec) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3747,7 +3843,7 @@ ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type)
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3758,7 +3854,7 @@ ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type)
__sdr_list_add(head, sdrr);
/* add to global record list */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -3785,21 +3881,21 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
int found = 0;
int idlen;
- if (id == NULL)
+ if (!id)
return NULL;
idlen = strlen(id);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = ipmi_sdr_start(intf, 0);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return NULL;
}
}
/* check what we've already read */
- for (e = sdr_list_head; e != NULL; e = e->next) {
+ for (e = sdr_list_head; e; e = e->next) {
switch (e->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
if (!strncmp((const char *)e->record.full->id_string,
@@ -3841,12 +3937,12 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
}
/* now keep looking */
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr))) {
uint8_t *rec;
struct sdr_record_list *sdrr;
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
break;
}
@@ -3855,8 +3951,8 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
sdrr->type = header->type;
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
- if (rec == NULL) {
- if (sdrr != NULL) {
+ if (!rec) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3927,7 +4023,7 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -3935,7 +4031,7 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
}
/* add to global record liset */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -3951,14 +4047,13 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
/* ipmi_sdr_list_cache_fromfile - generate SDR cache for fast lookup from local file
*
- * @intf: ipmi interface
* @ifile: input filename
*
* returns pointer to SDR list
* returns NULL on error
*/
int
-ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
+ipmi_sdr_list_cache_fromfile(const char *ifile)
{
FILE *fp;
struct __sdr_header {
@@ -3971,13 +4066,13 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
uint8_t *rec;
int ret = 0, count = 0, bc = 0;
- if (ifile == NULL) {
+ if (!ifile) {
lprintf(LOG_ERR, "No SDR cache filename given");
return -1;
}
fp = ipmi_open_file_read(ifile);
- if (fp == NULL) {
+ if (!fp) {
lprintf(LOG_ERR, "Unable to open SDR cache %s for reading",
ifile);
return -1;
@@ -4009,7 +4104,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
}
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
ret = -1;
break;
@@ -4020,10 +4115,10 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
sdrr->type = header.type;
rec = malloc(header.length + 1);
- if (rec == NULL) {
+ if (!rec) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
ret = -1;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -4037,11 +4132,11 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
"record %04x read %d bytes, expected %d",
header.id, bc, header.length);
ret = -1;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
- if (rec != NULL) {
+ if (rec) {
free(rec);
rec = NULL;
}
@@ -4077,7 +4172,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -4085,7 +4180,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
}
/* add to global record liset */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -4098,9 +4193,9 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
sdrr->id);
}
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = malloc(sizeof (struct ipmi_sdr_iterator));
- if (sdr_list_itr != NULL) {
+ if (sdr_list_itr) {
sdr_list_itr->reservation = 0;
sdr_list_itr->total = count;
sdr_list_itr->next = 0xffff;
@@ -4123,20 +4218,20 @@ ipmi_sdr_list_cache(struct ipmi_intf *intf)
{
struct sdr_get_rs *header;
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
sdr_list_itr = ipmi_sdr_start(intf, 0);
- if (sdr_list_itr == NULL) {
+ if (!sdr_list_itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return -1;
}
}
- while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, sdr_list_itr))) {
uint8_t *rec;
struct sdr_record_list *sdrr;
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
break;
}
@@ -4145,8 +4240,8 @@ ipmi_sdr_list_cache(struct ipmi_intf *intf)
sdrr->type = header->type;
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
- if (rec == NULL) {
- if (sdrr != NULL) {
+ if (!rec) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -4182,7 +4277,7 @@ ipmi_sdr_list_cache(struct ipmi_intf *intf)
default:
free(rec);
rec = NULL;
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
@@ -4190,7 +4285,7 @@ ipmi_sdr_list_cache(struct ipmi_intf *intf)
}
/* add to global record liset */
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -4228,11 +4323,11 @@ ipmi_sdr_get_info(struct ipmi_intf *intf,
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SDR Repository Info command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get SDR Repository Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -4246,24 +4341,6 @@ ipmi_sdr_get_info(struct ipmi_intf *intf,
return 0;
}
-/* ipmi_sdr_timestamp - return string from timestamp value
- *
- * @stamp: 32bit timestamp
- *
- * returns pointer to static buffer
- */
-static char *
-ipmi_sdr_timestamp(uint32_t stamp)
-{
- static char tbuf[40];
- time_t s = (time_t) stamp;
- memset(tbuf, 0, 40);
- if (stamp)
- strftime(tbuf, sizeof (tbuf), "%m/%d/%Y %H:%M:%S",
- gmtime(&s));
- return tbuf;
-}
-
/*
* ipmi_sdr_print_info
*
@@ -4276,7 +4353,7 @@ ipmi_sdr_timestamp(uint32_t stamp)
int
ipmi_sdr_print_info(struct ipmi_intf *intf)
{
- uint32_t timestamp;
+ time_t timestamp;
uint16_t free_space;
struct get_sdr_repository_info_rsp sdr_repository_info;
@@ -4310,21 +4387,26 @@ ipmi_sdr_print_info(struct ipmi_intf *intf)
break;
}
- timestamp =
- (sdr_repository_info.most_recent_addition_timestamp[3] << 24) |
- (sdr_repository_info.most_recent_addition_timestamp[2] << 16) |
- (sdr_repository_info.most_recent_addition_timestamp[1] << 8) |
- sdr_repository_info.most_recent_addition_timestamp[0];
- printf("Most recent Addition : %s\n",
- ipmi_sdr_timestamp(timestamp));
+ printf("Most recent Addition : ");
+ if (sdr_repository_info.partial_add_sdr_supported)
+ {
+ timestamp = ipmi32toh(sdr_repository_info
+ .most_recent_addition_timestamp);
+ printf("%s\n", ipmi_timestamp_numeric(timestamp));
+ }
+ else {
+ printf("NA\n");
+ }
- timestamp =
- (sdr_repository_info.most_recent_erase_timestamp[3] << 24) |
- (sdr_repository_info.most_recent_erase_timestamp[2] << 16) |
- (sdr_repository_info.most_recent_erase_timestamp[1] << 8) |
- sdr_repository_info.most_recent_erase_timestamp[0];
- printf("Most recent Erase : %s\n",
- ipmi_sdr_timestamp(timestamp));
+ printf("Most recent Erase : ");
+ if(sdr_repository_info.delete_sdr_supported) {
+ timestamp = ipmi32toh(sdr_repository_info
+ .most_recent_erase_timestamp);
+ printf("%s\n", ipmi_timestamp_numeric(timestamp));
+ }
+ else {
+ printf("NA\n");
+ }
printf("SDR overflow : %s\n",
(sdr_repository_info.overflow_flag ? "yes" : "no"));
@@ -4357,7 +4439,7 @@ ipmi_sdr_print_info(struct ipmi_intf *intf)
reserve_sdr_repository_supported ? "yes" : "no");
printf("SDR Repository Alloc info supported : %s\n",
sdr_repository_info.
- get_sdr_repository_allo_info_supported ? "yes" : "no");
+ get_sdr_repository_allo_info_supported ? "yes" : "no");
return 0;
}
@@ -4383,7 +4465,7 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
/* open connection to SDR */
itr = ipmi_sdr_start(intf, 0);
- if (itr == NULL) {
+ if (!itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return -1;
}
@@ -4391,9 +4473,9 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
printf("Dumping Sensor Data Repository to '%s'\n", ofile);
/* generate list of records */
- while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, itr))) {
sdrr = malloc(sizeof(struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -4408,16 +4490,16 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
sdrr->length = header->length;
sdrr->raw = ipmi_sdr_get_record(intf, header, itr);
- if (sdrr->raw == NULL) {
+ if (!sdrr->raw) {
lprintf(LOG_ERR, "ipmitool: cannot obtain SDR record %04x", header->id);
- if (sdrr != NULL) {
+ if (sdrr) {
free(sdrr);
sdrr = NULL;
}
return -1;
}
- if (sdr_list_head == NULL)
+ if (!sdr_list_head)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
@@ -4425,14 +4507,14 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
sdr_list_tail = sdrr;
}
- ipmi_sdr_end(intf, itr);
+ ipmi_sdr_end(itr);
/* now write to file */
fp = ipmi_open_file_write(ofile);
- if (fp == NULL)
+ if (!fp)
return -1;
- for (sdrr = sdr_list_head; sdrr != NULL; sdrr = sdrr->next) {
+ for (sdrr = sdr_list_head; sdrr; sdrr = sdrr->next) {
int r;
uint8_t h[5];
@@ -4487,9 +4569,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
int x;
uint8_t sensor_type = 0;
- if (type == NULL ||
- strncasecmp(type, "help", 4) == 0 ||
- strncasecmp(type, "list", 4) == 0) {
+ if (!type ||
+ strcasecmp(type, "help") == 0 ||
+ strcasecmp(type, "list") == 0) {
printf("Sensor Types:\n");
for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
printf("\t%-25s (0x%02x) %-25s (0x%02x)\n",
@@ -4499,7 +4581,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
return 0;
}
- if (strncmp(type, "0x", 2) == 0) {
+ if (!strcmp(type, "0x")) {
/* begins with 0x so let it be entered as raw hex value */
if (str2uchar(type, &sensor_type) != 0) {
lprintf(LOG_ERR,
@@ -4509,9 +4591,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
}
} else {
for (x = 1; x < SENSOR_TYPE_MAX; x++) {
- if (strncasecmp(sensor_type_desc[x], type,
- __maxlen(type,
- sensor_type_desc[x])) == 0) {
+ if (strcasecmp(sensor_type_desc[x], type) == 0) {
sensor_type = x;
break;
}
@@ -4531,7 +4611,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
list = ipmi_sdr_find_sdr_bysensortype(intf, sensor_type);
- for (entry = list; entry != NULL; entry = entry->next) {
+ for (entry = list; entry; entry = entry->next) {
rc = ipmi_sdr_print_listentry(intf, entry);
}
@@ -4557,9 +4637,9 @@ ipmi_sdr_print_entity(struct ipmi_intf *intf, char *entitystr)
unsigned instance = 0;
int rc = 0;
- if (entitystr == NULL ||
- strncasecmp(entitystr, "help", 4) == 0 ||
- strncasecmp(entitystr, "list", 4) == 0) {
+ if (!entitystr ||
+ strcasecmp(entitystr, "help") == 0 ||
+ strcasecmp(entitystr, "list") == 0) {
print_valstr_2col(entity_id_vals, "Entity IDs", -1);
return 0;
}
@@ -4573,9 +4653,8 @@ ipmi_sdr_print_entity(struct ipmi_intf *intf, char *entitystr)
int i, j=0;
/* now try string input */
- for (i = 0; entity_id_vals[i].str != NULL; i++) {
- if (strncasecmp(entitystr, entity_id_vals[i].str,
- __maxlen(entitystr, entity_id_vals[i].str)) == 0) {
+ for (i = 0; entity_id_vals[i].str; i++) {
+ if (strcasecmp(entitystr, entity_id_vals[i].str) == 0) {
entity.id = entity_id_vals[i].val;
entity.instance = 0x7f;
j=1;
@@ -4596,7 +4675,7 @@ ipmi_sdr_print_entity(struct ipmi_intf *intf, char *entitystr)
list = ipmi_sdr_find_sdr_byentity(intf, &entity);
- for (entry = list; entry != NULL; entry = entry->next) {
+ for (entry = list; entry; entry = entry->next) {
rc = ipmi_sdr_print_listentry(intf, entry);
}
@@ -4631,7 +4710,7 @@ ipmi_sdr_print_entry_byid(struct ipmi_intf *intf, int argc, char **argv)
for (i = 0; i < argc; i++) {
sdr = ipmi_sdr_find_sdr_byid(intf, argv[i]);
- if (sdr == NULL) {
+ if (!sdr) {
lprintf(LOG_ERR, "Unable to find sensor id '%s'",
argv[i]);
} else {
@@ -4662,41 +4741,41 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
/* initialize random numbers used later */
srand(time(NULL));
- if (argc == 0)
+ if (argc == 0) {
return ipmi_sdr_print_sdr(intf, 0xfe);
- else if (strncmp(argv[0], "help", 4) == 0) {
+ } else if (!strcmp(argv[0], "help")) {
printf_sdr_usage();
- } else if (strncmp(argv[0], "list", 4) == 0
- || strncmp(argv[0], "elist", 5) == 0) {
-
- if (strncmp(argv[0], "elist", 5) == 0)
+ } else if (!strcmp(argv[0], "list")
+ || !strcmp(argv[0], "elist"))
+ {
+ if (!strcmp(argv[0], "elist"))
sdr_extended = 1;
else
sdr_extended = 0;
if (argc <= 1)
rc = ipmi_sdr_print_sdr(intf, 0xfe);
- else if (strncmp(argv[1], "all", 3) == 0)
+ else if (!strcmp(argv[1], "all"))
rc = ipmi_sdr_print_sdr(intf, 0xff);
- else if (strncmp(argv[1], "full", 4) == 0)
+ else if (!strcmp(argv[1], "full"))
rc = ipmi_sdr_print_sdr(intf,
SDR_RECORD_TYPE_FULL_SENSOR);
- else if (strncmp(argv[1], "compact", 7) == 0)
+ else if (!strcmp(argv[1], "compact"))
rc = ipmi_sdr_print_sdr(intf,
SDR_RECORD_TYPE_COMPACT_SENSOR);
- else if (strncmp(argv[1], "event", 5) == 0)
+ else if (!strcmp(argv[1], "event"))
rc = ipmi_sdr_print_sdr(intf,
SDR_RECORD_TYPE_EVENTONLY_SENSOR);
- else if (strncmp(argv[1], "mcloc", 5) == 0)
+ else if (!strcmp(argv[1], "mcloc"))
rc = ipmi_sdr_print_sdr(intf,
SDR_RECORD_TYPE_MC_DEVICE_LOCATOR);
- else if (strncmp(argv[1], "fru", 3) == 0)
+ else if (!strcmp(argv[1], "fru"))
rc = ipmi_sdr_print_sdr(intf,
SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR);
- else if (strncmp(argv[1], "generic", 7) == 0)
+ else if (!strcmp(argv[1], "generic"))
rc = ipmi_sdr_print_sdr(intf,
SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
- else if (strcmp(argv[1], "help") == 0) {
+ else if (!strcmp(argv[1], "help")) {
lprintf(LOG_NOTICE,
"usage: sdr %s [all|full|compact|event|mcloc|fru|generic]",
argv[0]);
@@ -4711,35 +4790,35 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
argv[0]);
return (-1);
}
- } else if (strncmp(argv[0], "type", 4) == 0) {
+ } else if (!strcmp(argv[0], "type")) {
sdr_extended = 1;
rc = ipmi_sdr_print_type(intf, argv[1]);
- } else if (strncmp(argv[0], "entity", 6) == 0) {
+ } else if (!strcmp(argv[0], "entity")) {
sdr_extended = 1;
rc = ipmi_sdr_print_entity(intf, argv[1]);
- } else if (strncmp(argv[0], "info", 4) == 0) {
+ } else if (!strcmp(argv[0], "info")) {
rc = ipmi_sdr_print_info(intf);
- } else if (strncmp(argv[0], "get", 3) == 0) {
+ } else if (!strcmp(argv[0], "get")) {
rc = ipmi_sdr_print_entry_byid(intf, argc - 1, &argv[1]);
- } else if (strncmp(argv[0], "dump", 4) == 0) {
+ } else if (!strcmp(argv[0], "dump")) {
if (argc < 2) {
lprintf(LOG_ERR, "Not enough parameters given.");
lprintf(LOG_NOTICE, "usage: sdr dump <file>");
return (-1);
}
rc = ipmi_sdr_dump_bin(intf, argv[1]);
- } else if (strncmp(argv[0], "fill", 4) == 0) {
+ } else if (!strcmp(argv[0], "fill")) {
if (argc <= 1) {
lprintf(LOG_ERR, "Not enough parameters given.");
lprintf(LOG_NOTICE, "usage: sdr fill sensors");
lprintf(LOG_NOTICE, "usage: sdr fill file <file>");
lprintf(LOG_NOTICE, "usage: sdr fill range <range>");
return (-1);
- } else if (strncmp(argv[1], "sensors", 7) == 0) {
+ } else if (!strcmp(argv[1], "sensors")) {
rc = ipmi_sdr_add_from_sensors(intf, 21);
- } else if (strncmp(argv[1], "nosat", 5) == 0) {
+ } else if (!strcmp(argv[1], "nosat")) {
rc = ipmi_sdr_add_from_sensors(intf, 0);
- } else if (strncmp(argv[1], "file", 4) == 0) {
+ } else if (!strcmp(argv[1], "file")) {
if (argc < 3) {
lprintf(LOG_ERR,
"Not enough parameters given.");
@@ -4748,7 +4827,7 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
return (-1);
}
rc = ipmi_sdr_add_from_file(intf, argv[2]);
- } else if (strncmp(argv[1], "range", 4) == 0) {
+ } else if (!strcmp(argv[1], "range")) {
if (argc < 3) {
lprintf(LOG_ERR,
"Not enough parameters given.");
diff --git a/lib/ipmi_sdradd.c b/lib/ipmi_sdradd.c
index 52848a3..87063bb 100644
--- a/lib/ipmi_sdradd.c
+++ b/lib/ipmi_sdradd.c
@@ -80,7 +80,7 @@ partial_send(struct ipmi_intf *intf, struct ipmi_rq *req, uint16_t *id)
{
struct ipmi_rs *rsp;
rsp = intf->sendrecv(intf, req);
- if (rsp == NULL) {
+ if (!rsp) {
return -1;
}
@@ -115,7 +115,7 @@ ipmi_sdr_add_record(struct ipmi_intf *intf, struct sdr_record_list *sdrr)
}
sdr_rq = (struct sdr_add_rq *)malloc(sizeof(*sdr_rq) + sdr_max_write_len);
- if (sdr_rq == NULL) {
+ if (!sdr_rq) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -202,11 +202,11 @@ ipmi_sdr_repo_clear(struct ipmi_intf *intf)
for (try = 0; try < 5; try++) {
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to clear SDRR");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Unable to clear SDRR: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -248,11 +248,11 @@ sdrr_get_records(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr,
queue->head = NULL;
queue->tail = NULL;
- while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, itr))) {
struct sdr_record_list *sdrr;
sdrr = malloc(sizeof (struct sdr_record_list));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -263,10 +263,10 @@ sdrr_get_records(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr,
sdrr->type = header->type;
sdrr->length = header->length;
sdrr->raw = ipmi_sdr_get_record(intf, header, itr);
- (void)ipmi_sdr_print_name_from_rawentry(intf, sdrr->id, sdrr->type,sdrr->raw);
+ (void)ipmi_sdr_print_name_from_rawentry(sdrr->id, sdrr->type,sdrr->raw);
/* put in the record queue */
- if (queue->head == NULL)
+ if (!queue->head)
queue->head = sdrr;
else
queue->tail->next = sdrr;
@@ -295,12 +295,12 @@ sdr_copy_to_sdrr(struct ipmi_intf *intf, int use_builtin,
printf("Load SDRs from 0x%x\n", from_addr);
rc = sdrr_get_records(intf, itr, &sdrr_queue);
- ipmi_sdr_end(intf, itr);
+ ipmi_sdr_end(itr);
/* ... */
/* write the SDRs to the destination SDR Repository */
intf->target_addr = to_addr;
- for (sdrr = sdrr_queue.head; sdrr != NULL; sdrr = sdrr_next) {
+ for (sdrr = sdrr_queue.head; sdrr; sdrr = sdrr_next) {
sdrr_next = sdrr->next;
rc = ipmi_sdr_add_record(intf, sdrr);
if(rc < 0){
@@ -433,7 +433,7 @@ int ipmi_parse_range_list(const char *rangeList, unsigned char * pHexList)
do
{
- if(nextString != NULL)
+ if(nextString)
{
(*nextString)= 0;
nextString ++;
@@ -446,8 +446,7 @@ int ipmi_parse_range_list(const char *rangeList, unsigned char * pHexList)
/* At this point, it is a single entry or a range */
rangeString = strstr( inProcessString, "-" );
- if(rangeString == NULL)
- {
+ if (!rangeString) {
unsigned char decValue = 0;
/* Single entry */
@@ -597,7 +596,7 @@ ipmi_sdr_read_records(const char *filename, struct sdrr_queue *queue)
lprintf(LOG_DEBUG, "binHdr[4] (length) = 0x%02x", binHdr[4]);
sdrr = malloc(sizeof(*sdrr));
- if (sdrr == NULL) {
+ if (!sdrr) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
rc = -1;
break;
@@ -607,7 +606,8 @@ ipmi_sdr_read_records(const char *filename, struct sdrr_queue *queue)
sdrr->type = binHdr[3];
sdrr->length = binHdr[4];
- if ((sdrr->raw = malloc(sdrr->length)) == NULL) {
+ sdrr->raw = malloc(sdrr->length);
+ if (!sdrr->raw) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
free(sdrr);
sdrr = NULL;
@@ -626,7 +626,7 @@ ipmi_sdr_read_records(const char *filename, struct sdrr_queue *queue)
}
/* put in the record queue */
- if (queue->head == NULL)
+ if (!queue->head)
queue->head = sdrr;
else
queue->tail->next = sdrr;
@@ -654,7 +654,7 @@ ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile)
}
/* write the SDRs to the SDR Repository */
- for (sdrr = sdrr_queue.head; sdrr != NULL; sdrr = sdrr_next) {
+ for (sdrr = sdrr_queue.head; sdrr; sdrr = sdrr_next) {
sdrr_next = sdrr->next;
rc = ipmi_sdr_add_record(intf, sdrr);
if(rc < 0){
diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c
index b6629a2..31c0eea 100644
--- a/lib/ipmi_sel.c
+++ b/lib/ipmi_sel.c
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _BSD_SOURCE
#include <string.h>
#include <strings.h>
@@ -38,6 +37,7 @@
#include <time.h>
#include <ctype.h>
#include <errno.h>
+#include <stdbool.h>
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
@@ -49,8 +49,10 @@
#include <ipmitool/ipmi_sdr.h>
#include <ipmitool/ipmi_fru.h>
#include <ipmitool/ipmi_sensor.h>
+#include <ipmitool/ipmi_strings.h>
+#include <ipmitool/ipmi_quantaoem.h>
+#include <ipmitool/ipmi_time.h>
-extern int verbose;
static int sel_extended = 0;
static int sel_oem_nrecs = 0;
@@ -122,13 +124,13 @@ int ipmi_sel_oem_init(const char * filename)
int i, j, k, n, byte;
char buf[15][150];
- if (filename == NULL) {
+ if (!filename) {
lprintf(LOG_ERR, "No SEL OEM filename provided");
return -1;
}
fp = ipmi_open_file_read(filename);
- if (fp == NULL) {
+ if (!fp) {
lprintf(LOG_ERR, "Could not open %s file", filename);
return -1;
}
@@ -192,7 +194,7 @@ int ipmi_sel_oem_init(const char * filename)
return 0;
}
-static void ipmi_sel_oem_message(struct sel_event_record * evt, int verbose)
+static void ipmi_sel_oem_message(struct sel_event_record * evt)
{
/*
* Note: although we have a verbose argument, currently the output
@@ -237,34 +239,6 @@ ipmi_get_event_type(uint8_t code)
}
static char *
-ipmi_sel_timestamp(uint32_t stamp)
-{
- static char tbuf[40];
- time_t s = (time_t)stamp;
- memset(tbuf, 0, 40);
- strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", gmtime(&s));
- return tbuf;
-}
-
-static char *
-ipmi_sel_timestamp_date(uint32_t stamp)
-{
- static char tbuf[11];
- time_t s = (time_t)stamp;
- strftime(tbuf, sizeof(tbuf), "%m/%d/%Y", gmtime(&s));
- return tbuf;
-}
-
-static char *
-ipmi_sel_timestamp_time(uint32_t stamp)
-{
- static char tbuf[9];
- time_t s = (time_t)stamp;
- strftime(tbuf, sizeof(tbuf), "%H:%M:%S", gmtime(&s));
- return tbuf;
-}
-
-static char *
hex2ascii (uint8_t * hexChars, uint8_t numBytes)
{
int count;
@@ -314,11 +288,11 @@ ipmi_get_oem(struct ipmi_intf * intf)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Device ID command failed");
return IPMI_OEM_UNKNOWN;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get Device ID command failed: %#x %s",
rsp->ccode, val2str(rsp->ccode, completion_code_vals));
return IPMI_OEM_UNKNOWN;
@@ -347,11 +321,11 @@ ipmi_sel_add_entry(struct ipmi_intf * intf, struct sel_event_record * rec)
ipmi_sel_print_std_entry(intf, rec);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Add SEL Entry failed");
return -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Add SEL Entry failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -372,15 +346,15 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
uint8_t rqdata[8];
struct sel_event_record sel_event;
- if (filename == NULL)
+ if (!filename)
return -1;
fp = ipmi_open_file_read(filename);
- if (fp == NULL)
+ if (!fp)
return -1;
while (feof(fp) == 0) {
- if (fgets(buf, 1024, fp) == NULL)
+ if (!fgets(buf, 1024, fp))
continue;
/* clip off optional comment tail indicated by # */
@@ -446,24 +420,26 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
return rc;
}
-static struct ipmi_event_sensor_types oem_kontron_event_reading_types[] __attribute__((unused)) = {
- { 0x70 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info 1", "Code Assert" },
- { 0x71 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info 2", "Code Assert" },
+static struct ipmi_event_sensor_types __UNUSED__(oem_kontron_event_reading_types[]) = {
+ { 0x70 , 0x00 , 0xff, "Code Assert" },
+ { 0x71 , 0x00 , 0xff, "Code Assert" },
+ { 0, 0, 0xFF, NULL }
};
-
+
+/* NOTE: unused paramter kept in for consistency. */
char *
-get_kontron_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
+get_kontron_evt_desc(struct ipmi_intf *__UNUSED__(intf), struct sel_event_record *rec)
{
- char * description = NULL;
+ char *description = NULL;
/*
* Kontron OEM events are described in the product's user manual, but are limited in favor of
- * sensor specific
+ * sensor specific
*/
/* Only standard records are defined so far */
if( rec->record_type < 0xC0 ){
- struct ipmi_event_sensor_types *st=NULL;
- for ( st=oem_kontron_event_reading_types ; st->type != NULL; st++){
+ const struct ipmi_event_sensor_types *st=NULL;
+ for (st = oem_kontron_event_types; st->desc; st++){
if (st->code == rec->sel_type.standard_type.event_type ){
size_t len =strlen(st->desc);
description = (char*)malloc( len + 1 );
@@ -478,10 +454,10 @@ get_kontron_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
}
char *
-get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
+get_viking_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
{
/*
- * Newisys OEM event descriptions can be retrieved through an
+ * Viking OEM event descriptions can be retrieved through an
* OEM IPMI command.
*/
struct ipmi_rs * rsp;
@@ -504,12 +480,12 @@ get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
req.msg.data = msg_data;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
if (verbose)
lprintf(LOG_ERR, "Error issuing OEM command");
return NULL;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
if (verbose)
lprintf(LOG_ERR, "OEM command returned error code: %s",
val2str(rsp->ccode, completion_code_vals));
@@ -519,17 +495,17 @@ get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
/* Verify our response before we use it */
if (rsp->data_len < 5)
{
- lprintf(LOG_ERR, "Newisys OEM response too short");
+ lprintf(LOG_ERR, "Viking OEM response too short");
return NULL;
}
else if (rsp->data_len != (4 + rsp->data[3]))
{
- lprintf(LOG_ERR, "Newisys OEM response has unexpected length");
+ lprintf(LOG_ERR, "Viking OEM response has unexpected length");
return NULL;
}
- else if (IPM_DEV_MANUFACTURER_ID(rsp->data) != IPMI_OEM_NEWISYS)
+ else if (IPM_DEV_MANUFACTURER_ID(rsp->data) != IPMI_OEM_VIKING)
{
- lprintf(LOG_ERR, "Newisys OEM response has unexpected length");
+ lprintf(LOG_ERR, "Viking OEM response has unexpected length");
return NULL;
}
@@ -546,7 +522,7 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
struct ipmi_rs *rsp;
struct ipmi_rq req;
char *desc = NULL;
- int chipset_type = 1;
+ int chipset_type = 4;
int data1;
int data2;
int data3;
@@ -563,9 +539,9 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
if (rec->sel_type.standard_type.event_type != 0x6F) {
return NULL;
}
- /* Allocate mem for te Description string */
+ /* Allocate mem for the Description string */
desc = malloc(sizeof(char) * SIZE_OF_DESC);
- if (desc == NULL) {
+ if (!desc) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -581,17 +557,17 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, " Error getting system info");
- if (desc != NULL) {
+ if (desc) {
free(desc);
desc = NULL;
}
return NULL;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, " Error getting system info: %s",
val2str(rsp->ccode, completion_code_vals));
- if (desc != NULL) {
+ if (desc) {
free(desc);
desc = NULL;
}
@@ -600,7 +576,7 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
/* check the chipset type */
oem_id = ipmi_get_oem_id(intf);
if (oem_id == 0) {
- if (desc != NULL) {
+ if (desc) {
free(desc);
desc = NULL;
}
@@ -612,12 +588,48 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
break;
}
}
+ for (i = 0; supermicro_older[i] != 0xFFFF; i++) {
+ if (oem_id == supermicro_older[i]) {
+ chipset_type = 0;
+ break;
+ }
+ }
+ for (i = 0; supermicro_romely[i] != 0xFFFF; i++) {
+ if (oem_id == supermicro_romely[i]) {
+ chipset_type = 1;
+ break;
+ }
+ }
for (i = 0; supermicro_x9[i] != 0xFFFF; i++) {
if (oem_id == supermicro_x9[i]) {
chipset_type = 2;
break;
}
}
+ for (i = 0; supermicro_brickland[i] != 0xFFFF; i++) {
+ if (oem_id == supermicro_brickland[i]) {
+ chipset_type = 3;
+ break;
+ }
+ }
+ for (i = 0; supermicro_x10QRH[i] != 0xFFFF; i++) {
+ if (oem_id == supermicro_x10QRH[i]) {
+ chipset_type = 4;
+ break;
+ }
+ }
+ for (i = 0; supermicro_x10QBL[i] != 0xFFFF; i++) {
+ if (oem_id == supermicro_x10QBL[i]) {
+ chipset_type = 4;
+ break;
+ }
+ }
+ for (i = 0; supermicro_x10OBi[i] != 0xFFFF; i++) {
+ if (oem_id == supermicro_x10OBi[i]) {
+ chipset_type = 5;
+ break;
+ }
+ }
if (chipset_type == 0) {
snprintf(desc, SIZE_OF_DESC, "@DIMM%2X(CPU%x)",
data2,
@@ -630,6 +642,21 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
snprintf(desc, SIZE_OF_DESC, "@DIMM%c%c(CPU%x)",
(data2 >> 4) + 0x40 + (data3 & 0x3) * 3,
(data2 & 0xf) + 0x27, (data3 & 0x03) + 1);
+ } else if (chipset_type == 3) {
+ snprintf(desc, SIZE_OF_DESC, "@DIMM%c%d(P%dM%d)",
+ ((data2 & 0xf) >> 4) > 4
+ ? '@' - 4 + ((data2 & 0xff) >> 4)
+ : '@' + ((data2 & 0xff) >> 4),
+ (data2 & 0xf) - 0x09, (data3 & 0x0f) + 1,
+ (data2 & 0xff) >> 4 > 4 ? 2 : 1);
+ } else if (chipset_type == 4) {
+ snprintf(desc, SIZE_OF_DESC, "@DIMM%c%c(CPU%x)",
+ (data2 >> 4) + 0x40,
+ (data2 & 0xf) + 0x27, (data3 & 0x03) + 1);
+ } else if (chipset_type == 5) {
+ snprintf(desc, SIZE_OF_DESC, "@DIMM%c%c(CPU%x)",
+ (data2 >> 4) + 0x40,
+ (data2 & 0xf) + 0x27, (data3 & 0x07) + 1);
} else {
/* No description. */
desc[0] = '\0';
@@ -652,7 +679,7 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
/*
* Function : Decoding the SEL OEM Bytes for the DELL Platforms.
- * Description : The below fucntion will decode the SEL Events OEM Bytes for the Dell specific Sensors only.
+ * Description : The below function will decode the SEL Events OEM Bytes for the Dell specific Sensors only.
* The below function will append the additional information Strings/description to the normal sel desc.
* With this the SEL will display additional information sent via OEM Bytes of the SEL Record.
* NOTE : Specific to DELL Platforms only.
@@ -685,7 +712,7 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
if (0x6F == rec->sel_type.standard_type.event_type)
{
sensor_type = rec->sel_type.standard_type.sensor_type;
- /* Allocate mem for te Description string */
+ /* Allocate mem for the Description string */
desc = (char*)malloc(SIZE_OF_DESC);
if(NULL == desc)
return NULL;
@@ -734,17 +761,17 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
if (NULL == rsp)
{
lprintf(LOG_ERR, " Error getting system info");
- if (desc != NULL) {
+ if (desc) {
free(desc);
desc = NULL;
}
return NULL;
}
- else if (rsp->ccode > 0)
+ else if (rsp->ccode)
{
lprintf(LOG_ERR, " Error getting system info: %s",
val2str(rsp->ccode, completion_code_vals));
- if (desc != NULL) {
+ if (desc) {
free(desc);
desc = NULL;
}
@@ -843,11 +870,11 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
if(SENSOR_TYPE_EVT_LOG == sensor_type)
{
if(0x03 == (data1 & MASK_LOWER_NIBBLE))
- snprintf(desc,SIZE_OF_DESC,"All Even Logging Dissabled");
+ snprintf(desc,SIZE_OF_DESC,"All Even Logging Disabled");
}
}
/*
- * Based on the above error, we need to find whcih memory slot or
+ * Based on the above error, we need to find which memory slot or
* Card has got the Errors/Sel Generated.
*/
if(data1 & OEM_CODE_IN_BYTE2 )
@@ -989,7 +1016,7 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
}
break;
- /* This Event is for BMC to Othe Hardware or CPU . */
+ /* This Event is for BMC to other Hardware or CPU . */
case SENSOR_TYPE_VER_CHANGE:
if((0x02 == (data1 & MASK_LOWER_NIBBLE))&&((data1 & OEM_CODE_IN_BYTE2) && (data1 & OEM_CODE_IN_BYTE3)))
{
@@ -1178,8 +1205,8 @@ ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
switch (ipmi_get_oem(intf))
{
- case IPMI_OEM_NEWISYS:
- desc = get_newisys_evt_desc(intf, rec);
+ case IPMI_OEM_VIKING:
+ desc = get_viking_evt_desc(intf, rec);
break;
case IPMI_OEM_KONTRON:
desc = get_kontron_evt_desc(intf, rec);
@@ -1191,6 +1218,9 @@ ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
case IPMI_OEM_SUPERMICRO_47488:
desc = get_supermicro_evt_desc(intf, rec);
break;
+ case IPMI_OEM_QUANTA:
+ desc = oem_qct_get_evt_desc(intf, rec);
+ break;
case IPMI_OEM_UNKNOWN:
default:
break;
@@ -1200,15 +1230,75 @@ ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
}
+const struct ipmi_event_sensor_types *
+ipmi_get_first_event_sensor_type(struct ipmi_intf *intf,
+ uint8_t sensor_type, uint8_t event_type)
+{
+ const struct ipmi_event_sensor_types *evt, *start, *next = NULL;
+ uint8_t code;
+
+ if (event_type == 0x6f) {
+ if (sensor_type >= 0xC0
+ && sensor_type < 0xF0
+ && ipmi_get_oem(intf) == IPMI_OEM_KONTRON) {
+ /* check Kontron OEM sensor event types */
+ start = oem_kontron_event_types;
+ } else if (intf->vita_avail) {
+ /* check VITA sensor event types first */
+ start = vita_sensor_event_types;
+
+ /* then check generic sensor types */
+ next = sensor_specific_event_types;
+ } else {
+ /* check generic sensor types */
+ start = sensor_specific_event_types;
+ }
+ code = sensor_type;
+ } else {
+ start = generic_event_types;
+ code = event_type;
+ }
+
+ for (evt = start; evt->desc || next; evt++) {
+ /* check if VITA sensor event types has finished */
+ if (!evt->desc) {
+ /* proceed with next table */
+ evt = next;
+ next = NULL;
+ }
+
+ if (code == evt->code)
+ return evt;
+ }
+
+ return NULL;
+}
+
+
+const struct ipmi_event_sensor_types *
+ipmi_get_next_event_sensor_type(const struct ipmi_event_sensor_types *evt)
+{
+ const struct ipmi_event_sensor_types *start = evt;
+
+ for (evt = start + 1; evt->desc; evt++) {
+ if (evt->code == start->code) {
+ return evt;
+ }
+ }
+
+ return NULL;
+}
+
+
void
ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc)
{
- uint8_t code, offset;
- struct ipmi_event_sensor_types *evt = NULL;
+ uint8_t offset;
+ const struct ipmi_event_sensor_types *evt = NULL;
char *sfx = NULL; /* This will be assigned if the Platform is DELL,
additional info is appended to the current Description */
- if (desc == NULL)
+ if (!desc)
return;
*desc = NULL;
@@ -1223,86 +1313,68 @@ ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char
case IPMI_OEM_KONTRON:
lprintf(LOG_DEBUG, "oem sensor type %x %d using oem type supplied description",
rec->sel_type.standard_type.sensor_type , iana);
-
- evt = oem_kontron_event_types;
- code = rec->sel_type.standard_type.sensor_type;
break;
case IPMI_OEM_DELL: /* OEM Bytes Decoding for DELLi */
- evt = sensor_specific_types;
- code = rec->sel_type.standard_type.sensor_type;
if ( (OEM_CODE_IN_BYTE2 == (rec->sel_type.standard_type.event_data[0] & DATA_BYTE2_SPECIFIED_MASK)) ||
(OEM_CODE_IN_BYTE3 == (rec->sel_type.standard_type.event_data[0] & DATA_BYTE3_SPECIFIED_MASK)) )
{
- if(rec->sel_type.standard_type.event_data[0] & DATA_BYTE2_SPECIFIED_MASK)
- evt->data = rec->sel_type.standard_type.event_data[1];
-
sfx = ipmi_get_oem_desc(intf, rec);
}
break;
case IPMI_OEM_SUPERMICRO:
case IPMI_OEM_SUPERMICRO_47488:
- evt = sensor_specific_types;
- code = rec->sel_type.standard_type.sensor_type;
sfx = ipmi_get_oem_desc(intf, rec);
break;
/* add your oem sensor assignation here */
+ case IPMI_OEM_QUANTA:
+ sfx = ipmi_get_oem_desc(intf, rec);
+ break;
default:
+ lprintf(LOG_DEBUG, "oem sensor type %x using standard type supplied description",
+ rec->sel_type.standard_type.sensor_type );
break;
- }
- if( evt == NULL ){
- lprintf(LOG_DEBUG, "oem sensor type %x using standard type supplied description",
- rec->sel_type.standard_type.sensor_type );
}
} else {
switch (ipmi_get_oem(intf)) {
case IPMI_OEM_SUPERMICRO:
case IPMI_OEM_SUPERMICRO_47488:
- evt = sensor_specific_types;
- code = rec->sel_type.standard_type.sensor_type;
sfx = ipmi_get_oem_desc(intf, rec);
- break;
+ break;
+ case IPMI_OEM_QUANTA:
+ sfx = ipmi_get_oem_desc(intf, rec);
+ break;
default:
- break;
+ break;
}
}
- if( evt == NULL ){
- evt = sensor_specific_types;
- code = rec->sel_type.standard_type.sensor_type;
- }
/*
* Check for the OEM DELL Interface based on the Dell Specific Vendor Code.
* If its Dell Platform, do the OEM Byte decode from the SEL Records.
* Additional information should be written by the ipmi_get_oem_desc()
*/
if(ipmi_get_oem(intf) == IPMI_OEM_DELL) {
- code = rec->sel_type.standard_type.sensor_type;
if ( (OEM_CODE_IN_BYTE2 == (rec->sel_type.standard_type.event_data[0] & DATA_BYTE2_SPECIFIED_MASK)) ||
(OEM_CODE_IN_BYTE3 == (rec->sel_type.standard_type.event_data[0] & DATA_BYTE3_SPECIFIED_MASK)) )
{
- if(rec->sel_type.standard_type.event_data[0] & DATA_BYTE2_SPECIFIED_MASK)
- evt->data = rec->sel_type.standard_type.event_data[1];
- sfx = ipmi_get_oem_desc(intf, rec);
-
+ sfx = ipmi_get_oem_desc(intf, rec);
}
else if(SENSOR_TYPE_OEM_SEC_EVENT == rec->sel_type.standard_type.event_data[0])
{
/* 0x23 : Sensor Number.*/
if(0x23 == rec->sel_type.standard_type.sensor_num)
- {
- evt->data = rec->sel_type.standard_type.event_data[1];
sfx = ipmi_get_oem_desc(intf, rec);
- }
}
}
- } else {
- evt = generic_event_types;
- code = rec->sel_type.standard_type.event_type;
}
offset = rec->sel_type.standard_type.event_data[0] & 0xf;
- while (evt->type) {
- if ((evt->code == code && evt->offset == offset && evt->desc != NULL) &&
+ for (evt = ipmi_get_first_event_sensor_type(intf,
+ rec->sel_type.standard_type.sensor_type,
+ rec->sel_type.standard_type.event_type);
+ evt; evt = ipmi_get_next_event_sensor_type(evt))
+ {
+ if ((evt->offset == offset && evt->desc) &&
((evt->data == ALL_OFFSETS_SPECIFIED) ||
((rec->sel_type.standard_type.event_data[0] & DATA_BYTE2_SPECIFIED_MASK) &&
(evt->data == rec->sel_type.standard_type.event_data[1]))))
@@ -1326,15 +1398,14 @@ ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char
sprintf(*desc, "%s", evt->desc);
}
return;
- }
- evt++;
+ }
}
/* The Above while Condition was not met beacouse the below sensor type were Newly defined OEM
Secondary Events. 0xC1, 0xC2, 0xC3. */
if((sfx) && (0x6F == rec->sel_type.standard_type.event_type))
{
uint8_t flag = 0x00;
- switch(code)
+ switch(rec->sel_type.standard_type.sensor_type)
{
case SENSOR_TYPE_FRM_PROG:
if(0x0F == offset)
@@ -1379,74 +1450,58 @@ ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char
}
-const char *
-ipmi_sel_get_oem_sensor_type(IPMI_OEM iana, uint8_t code)
+const char*
+ipmi_get_generic_sensor_type(uint8_t code)
{
- struct ipmi_event_sensor_types *st = NULL;
-
- switch(iana){
- case IPMI_OEM_KONTRON:
- st = oem_kontron_event_types;
- break;
- /* add you oem sensor type lookup assignement here */
- default:
- lprintf(LOG_DEBUG, "ipmitool: missing OEM sensor type for %ul",iana);
- break;
+ if (code <= SENSOR_TYPE_MAX) {
+ return ipmi_generic_sensor_type_vals[code];
}
- if( st != NULL )
- for (; st->type != NULL; st++)
- if (st->code == code)
- return st->type;
-
- return ipmi_sel_get_sensor_type(code);
+ return NULL;
}
+
const char *
-ipmi_sel_get_oem_sensor_type_offset(IPMI_OEM iana, uint8_t code, uint8_t offset)
+ipmi_get_oem_sensor_type(struct ipmi_intf *intf, uint8_t code)
{
- struct ipmi_event_sensor_types *st = NULL;
+ const struct oemvalstr *v, *found = NULL;
+ uint32_t iana = ipmi_get_oem(intf);
- switch(iana){
- case IPMI_OEM_KONTRON:
- st = oem_kontron_event_types;
- break;
- /* add you oem sensor type lookup assignement here */
- default:
- lprintf(LOG_DEBUG,
- "ipmitool: missing OEM sensor type offset for %ul",iana);
- break;
- }
+ for (v = ipmi_oem_sensor_type_vals; v->str; v++) {
+ if (v->oem == iana && v->val == code) {
+ return v->str;
+ }
- if( st != NULL )
- for (; st->type != NULL; st++)
- {
- if (st->code == code && st->offset == (offset&0xf))
- return st->type;
+ if ((intf->picmg_avail
+ && v->oem == IPMI_OEM_PICMG
+ && v->val == code)
+ || (intf->vita_avail
+ && v->oem == IPMI_OEM_VITA
+ && v->val == code)) {
+ found = v;
}
+ }
- return ipmi_sel_get_oem_sensor_type(iana,code);
+ return found ? found->str : NULL;
}
-const char *
-ipmi_sel_get_sensor_type(uint8_t code)
-{
- struct ipmi_event_sensor_types *st;
- for (st = sensor_specific_types; st->type != NULL; st++)
- if (st->code == code)
- return st->type;
- return "Unknown";
-}
const char *
-ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset)
+ipmi_get_sensor_type(struct ipmi_intf *intf, uint8_t code)
{
- struct ipmi_event_sensor_types *st;
- for (st = sensor_specific_types; st->type != NULL; st++)
- if (st->code == code && st->offset == (offset&0xf))
- return st->type;
+ const char *type;
+
+ if (code >= 0xC0) {
+ type = ipmi_get_oem_sensor_type(intf, code);
+ } else {
+ type = ipmi_get_generic_sensor_type(code);
+ }
+
+ if (!type) {
+ type = "Unknown";
+ }
- return ipmi_sel_get_sensor_type(code);
+ return type;
}
static int
@@ -1466,10 +1521,10 @@ ipmi_sel_get_info(struct ipmi_intf * intf)
req.msg.cmd = IPMI_CMD_GET_SEL_INFO;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SEL Info command failed");
return -1;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Get SEL Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1512,14 +1567,14 @@ ipmi_sel_get_info(struct ipmi_intf * intf)
printf("Last Add Time : Not Available\n");
else
printf("Last Add Time : %s\n",
- ipmi_sel_timestamp(buf2long(rsp->data + 5)));
+ ipmi_timestamp_numeric(buf2long(rsp->data + 5)));
if ((!memcmp(rsp->data + 9, &fs, 4)) ||
(!memcmp(rsp->data + 9, &zeros, 4)))
printf("Last Del Time : Not Available\n");
else
printf("Last Del Time : %s\n",
- ipmi_sel_timestamp(buf2long(rsp->data + 9)));
+ ipmi_timestamp_numeric(buf2long(rsp->data + 9)));
printf("Overflow : %s\n",
@@ -1547,12 +1602,12 @@ ipmi_sel_get_info(struct ipmi_intf * intf)
req.msg.cmd = IPMI_CMD_GET_SEL_ALLOC_INFO;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR,
"Get SEL Allocation Info command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR,
"Get SEL Allocation Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
@@ -1593,11 +1648,11 @@ ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id,
req.msg.data_len = 6;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SEL Entry %x command failed", id);
return 0;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get SEL Entry %x command failed: %s",
id, val2str(rsp->ccode, completion_code_vals));
return 0;
@@ -1680,7 +1735,7 @@ ipmi_sel_print_event_file(struct ipmi_intf * intf, struct sel_event_record * evt
{
char * description;
- if (fp == NULL)
+ if (!fp)
return;
ipmi_get_event_desc(intf, evt, &description);
@@ -1693,17 +1748,11 @@ ipmi_sel_print_event_file(struct ipmi_intf * intf, struct sel_event_record * evt
evt->sel_type.standard_type.event_data[0],
evt->sel_type.standard_type.event_data[1],
evt->sel_type.standard_type.event_data[2],
- (
- (evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
- ?
- ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- :
- ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- ),
+ ipmi_get_sensor_type(intf, evt->sel_type.standard_type.sensor_type),
evt->sel_type.standard_type.sensor_num,
- (description != NULL) ? description : "Unknown");
+ description ? description : "Unknown");
- if (description != NULL) {
+ if (description) {
free(description);
description = NULL;
}
@@ -1763,18 +1812,19 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
}
else {
if (evt->record_type < 0xc0)
- printf("%s", ipmi_sel_timestamp_date(evt->sel_type.standard_type.timestamp));
+ printf("%s", ipmi_timestamp_date(evt->sel_type.standard_type.timestamp));
else
- printf("%s", ipmi_sel_timestamp_date(evt->sel_type.oem_ts_type.timestamp));
+ printf("%s", ipmi_timestamp_date(evt->sel_type.oem_ts_type.timestamp));
+
if (csv_output)
printf(",");
else
printf(" | ");
-
+
if (evt->record_type < 0xc0)
- printf("%s", ipmi_sel_timestamp_time(evt->sel_type.standard_type.timestamp));
+ printf("%s", ipmi_timestamp_time(evt->sel_type.standard_type.timestamp));
else
- printf("%s", ipmi_sel_timestamp_time(evt->sel_type.oem_ts_type.timestamp));
+ printf("%s", ipmi_timestamp_time(evt->sel_type.oem_ts_type.timestamp));
if (csv_output)
printf(",");
@@ -1812,22 +1862,15 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
}
- ipmi_sel_oem_message(evt, 0);
+ ipmi_sel_oem_message(evt);
printf ("\n");
return;
}
/* lookup SDR entry based on sensor number and type */
- if (sdr != NULL) {
- printf("%s ",
- (
- (evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
- ?
- ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- :
- ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- )
- );
+ if (sdr) {
+ printf("%s ", ipmi_get_sensor_type(intf,
+ evt->sel_type.standard_type.sensor_type));
switch (sdr->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
printf("%s", sdr->record.full->id_string);
@@ -1852,13 +1895,8 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
break;
}
} else {
- printf("%s",(
- (evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
- ?
- ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- :
- ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- ));
+ printf("%s", ipmi_get_sensor_type(intf,
+ evt->sel_type.standard_type.sensor_type));
if (evt->sel_type.standard_type.sensor_num != 0)
printf(" #0x%02x", evt->sel_type.standard_type.sensor_num);
}
@@ -1887,7 +1925,7 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
printf("Asserted");
}
- if (sdr != NULL && evt->sel_type.standard_type.event_type == 1) {
+ if (sdr && evt->sel_type.standard_type.event_type == 1) {
/*
* Threshold Event
*/
@@ -1917,8 +1955,20 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
(trigger_reading==(int)trigger_reading) ? 0 : 2,
trigger_reading);
if (threshold_reading_provided) {
+ /* According to Table 29-6, Event Data byte 1 contains,
+ * among other info, the offset from the Threshold type
+ * code. According to Table 42-2, all even offsets
+ * are 'going low', and all odd offsets are 'going high'
+ */
+ bool going_high =
+ (evt->sel_type.standard_type.event_data[0]
+ & EVENT_OFFSET_MASK) % 2;
+ if (evt->sel_type.standard_type.event_dir) {
+ /* Event is de-asserted so the inequality is reversed */
+ going_high = !going_high;
+ }
printf(" %s Threshold %.*f %s",
- ((evt->sel_type.standard_type.event_data[0] & 0xf) % 2) ? ">" : "<",
+ going_high ? ">" : "<",
(threshold_reading==(int)threshold_reading) ? 0 : 2,
threshold_reading,
ipmi_sdr_get_unit_string(sdr->record.common->unit.pct,
@@ -1933,9 +1983,12 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
case IPMI_OEM_SUPERMICRO:
case IPMI_OEM_SUPERMICRO_47488:
print_sensor = 0;
- break;
+ break;
+ case IPMI_OEM_QUANTA:
+ print_sensor = 0;
+ break;
default:
- break;
+ break;
}
/*
* Sensor-Specific Discrete
@@ -1990,11 +2043,11 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
{
printf(" Timestamp : ");
if (evt->record_type < 0xc0)
- printf("%s %s", ipmi_sel_timestamp_date(evt->sel_type.standard_type.timestamp),
- ipmi_sel_timestamp_time(evt->sel_type.standard_type.timestamp));
+ printf("%s %s", ipmi_timestamp_date(evt->sel_type.standard_type.timestamp),
+ ipmi_timestamp_time(evt->sel_type.standard_type.timestamp));
else
- printf("%s %s", ipmi_sel_timestamp_date(evt->sel_type.oem_ts_type.timestamp),
- ipmi_sel_timestamp_time(evt->sel_type.oem_ts_type.timestamp));
+ printf("%s %s", ipmi_timestamp_date(evt->sel_type.oem_ts_type.timestamp),
+ ipmi_timestamp_time(evt->sel_type.oem_ts_type.timestamp));
printf("\n");
}
@@ -2015,7 +2068,7 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
printf(" [%s]\n\n",hex2ascii (evt->sel_type.oem_nots_type.oem_defined, SEL_OEM_NOTS_DATA_LEN));
- ipmi_sel_oem_message(evt, 1);
+ ipmi_sel_oem_message(evt);
}
return;
}
@@ -2025,14 +2078,8 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
printf(" EvM Revision : %02x\n",
evt->sel_type.standard_type.evm_rev);
printf(" Sensor Type : %s\n",
- (
- (evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
- ?
- ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- :
- ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
- )
- );
+ ipmi_get_sensor_type(intf,
+ evt->sel_type.standard_type.sensor_type));
printf(" Sensor Number : %02x\n",
evt->sel_type.standard_type.sensor_num);
printf(" Event Type : %s\n",
@@ -2064,7 +2111,7 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_
evt->sel_type.standard_type.gen_id,
evt->sel_type.standard_type.sensor_num,
evt->sel_type.standard_type.sensor_type);
- if (sdr == NULL)
+ if (!sdr)
{
ipmi_sel_print_std_entry_verbose(intf, evt);
return;
@@ -2086,8 +2133,8 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_
if (evt->record_type < 0xe0)
{
printf(" Timestamp : ");
- printf("%s %s\n", ipmi_sel_timestamp_date(evt->sel_type.standard_type.timestamp),
- ipmi_sel_timestamp_time(evt->sel_type.standard_type.timestamp));
+ printf("%s %s\n", ipmi_timestamp_date(evt->sel_type.standard_type.timestamp),
+ ipmi_timestamp_time(evt->sel_type.standard_type.timestamp));
}
@@ -2096,7 +2143,7 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_
printf(" EvM Revision : %02x\n",
evt->sel_type.standard_type.evm_rev);
printf(" Sensor Type : %s\n",
- ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]));
+ ipmi_get_sensor_type(intf, evt->sel_type.standard_type.sensor_type));
printf(" Sensor Number : %02x\n",
evt->sel_type.standard_type.sensor_num);
printf(" Event Type : %s\n",
@@ -2221,11 +2268,11 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
req.msg.cmd = IPMI_CMD_GET_SEL_INFO;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SEL Info command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get SEL Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2238,33 +2285,18 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
return 0;
}
- memset(&req, 0, sizeof(req));
- req.msg.netfn = IPMI_NETFN_STORAGE;
- req.msg.cmd = IPMI_CMD_RESERVE_SEL;
-
- rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_ERR, "Reserve SEL command failed");
- return -1;
- }
- if (rsp->ccode > 0) {
- lprintf(LOG_ERR, "Reserve SEL command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
- return -1;
- }
-
if (count < 0) {
/** Show only the most recent 'count' records. */
- int delta;
+ int i;
uint16_t entries;
req.msg.cmd = IPMI_CMD_GET_SEL_INFO;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SEL Info command failed");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get SEL Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2273,18 +2305,23 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
if (-count > entries)
count = -entries;
- /* Get first record. */
- next_id = ipmi_sel_get_std_entry(intf, 0, &evt);
-
- delta = next_id - evt.record_id;
-
- /* Get last record. */
- next_id = ipmi_sel_get_std_entry(intf, 0xffff, &evt);
-
- next_id = evt.record_id + count * delta + delta;
+ for(i = 0; i < entries + count; i++) {
+ next_id = ipmi_sel_get_std_entry(intf, next_id, &evt);
+ if (next_id == 0) {
+ /*
+ * usually next_id of zero means end but
+ * retry because some hardware has quirks
+ * and will return 0 randomly.
+ */
+ next_id = ipmi_sel_get_std_entry(intf, next_id, &evt);
+ if (next_id == 0) {
+ break;
+ }
+ }
+ }
}
- if (savefile != NULL) {
+ if (savefile) {
fp = ipmi_open_file_write(savefile);
}
@@ -2309,7 +2346,7 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
else
ipmi_sel_print_std_entry(intf, &evt);
- if (fp != NULL) {
+ if (fp) {
if (binary)
fwrite(&evt, 1, 16, fp);
else
@@ -2321,7 +2358,7 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
}
}
- if (fp != NULL)
+ if (fp)
fclose(fp);
return 0;
@@ -2358,7 +2395,7 @@ ipmi_sel_interpret(struct ipmi_intf *intf, unsigned long iana,
* the command line
*/
sel_iana = iana;
- if (strncmp("pps", format, 3) == 0) {
+ if (!strcmp("pps", format)) {
/* Parser for the following format */
/* 0x001F: Event: at Mar 27 06:41:10 2007;from:(0x9a,0,7);
* sensor:(0xc3,119); event:0x6f(asserted): 0xA3 0x00 0x88
@@ -2366,13 +2403,13 @@ ipmi_sel_interpret(struct ipmi_intf *intf, unsigned long iana,
* Supports a tweak for hotswap events that are already interpreted.
*/
fp = ipmi_open_file(readfile, 0);
- if (fp == NULL) {
+ if (!fp) {
lprintf(LOG_ERR, "Failed to open file '%s' for reading.",
readfile);
return (-1);
}
buffer = (char *)malloc((size_t)256);
- if (buffer == NULL) {
+ if (!buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
fclose(fp);
return (-1);
@@ -2381,7 +2418,7 @@ ipmi_sel_interpret(struct ipmi_intf *intf, unsigned long iana,
/* Only allow complete lines to be parsed,
* hardcoded maximum line length
*/
- if (fgets(buffer, 256, fp) == NULL) {
+ if (!fgets(buffer, 256, fp)) {
status = (-1);
break;
}
@@ -2402,7 +2439,7 @@ ipmi_sel_interpret(struct ipmi_intf *intf, unsigned long iana,
evt.sel_type.standard_type.evm_rev = 4;
/* FIXME: convert*/
- evt.sel_type.standard_type.timestamp;
+ /* evt.sel_type.standard_type.timestamp; */
/* skip timestamp */
cursor = index((const char *)cursor, ';');
@@ -2635,11 +2672,11 @@ ipmi_sel_reserve(struct ipmi_intf * intf)
req.msg.cmd = IPMI_CMD_RESERVE_SEL;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_WARN, "Unable to reserve SEL");
return 0;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
printf("Unable to reserve SEL: %s",
val2str(rsp->ccode, completion_code_vals));
return 0;
@@ -2661,8 +2698,6 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
- static char tbuf[40];
- uint32_t timei;
time_t time;
memset(&req, 0, sizeof(req));
@@ -2671,13 +2706,12 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_ERR, "Get SEL Time command failed");
- return -1;
- }
- if (rsp->ccode > 0) {
+ if (!rsp || rsp->ccode) {
lprintf(LOG_ERR, "Get SEL Time command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ rsp
+ ? val2str(rsp->ccode, completion_code_vals)
+ : "Unknown"
+ );
return -1;
}
if (rsp->data_len != 4) {
@@ -2686,15 +2720,8 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
return -1;
}
- memcpy(&timei, rsp->data, 4);
-#if WORDS_BIGENDIAN
- time = (time_t)(BSWAP_32(timei));
-#else
- time = (time_t)timei;
-#endif
-
- strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", gmtime(&time));
- printf("%s\n", tbuf);
+ time = ipmi32toh(rsp->data);
+ printf("%s\n", ipmi_timestamp_numeric(time));
return 0;
}
@@ -2710,76 +2737,65 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
static int
ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
{
- struct ipmi_rs * rsp;
- struct ipmi_rq req;
- struct tm tm = {0};
- time_t t;
- uint32_t timei;
- const char * time_format = "%m/%d/%Y %H:%M:%S";
+ struct ipmi_rs *rsp;
+ struct ipmi_rq req;
+ struct tm tm = {0};
+ uint8_t msg_data[4] = {0};
+ time_t t;
+ const char *time_format = "%x %X"; /* Use locale-defined format */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = IPMI_SET_SEL_TIME;
/* See if user requested set to current client system time */
- if (strncasecmp(time_string, "now", 3) == 0) {
+ if (strcasecmp(time_string, "now") == 0) {
t = time(NULL);
+ /*
+ * Now we have local time in t, but BMC requires UTC
+ */
+ t = ipmi_localtime2utc(t);
}
else {
- /* Now how do we get our time_t from our ascii version? */
- if (strptime(time_string, time_format, &tm) == 0) {
- lprintf(LOG_ERR, "Specified time could not be parsed");
- return -1;
+ bool error = true; /* Assume the string is invalid */
+ /* Now let's extract time_t from the supplied string */
+ if (strptime(time_string, time_format, &tm) != NULL) {
+ tm.tm_isdst = (-1); /* look up DST information */
+ t = mktime(&tm);
+ if (t >= 0) {
+ /* Surprisingly, the user hasn't mistaken ;) */
+ error = false;
+ }
}
- tm.tm_isdst = (-1); /* look up DST information */
- t = mktime(&tm);
- if (t < 0) {
+
+ if (error) {
lprintf(LOG_ERR, "Specified time could not be parsed");
return -1;
}
+
+ /*
+ * If `-c` wasn't specified then t we've just got is in local timesone
+ */
+ if (!time_in_utc) {
+ t = ipmi_localtime2utc(t);
+ }
}
- {
- //modify UTC time to local time expressed in number of seconds from 1/1/70 0:0:0 1970 GMT
- struct tm * tm_tmp = {0};
- int gt_year,gt_yday,gt_hour,gt_min,lt_year,lt_yday,lt_hour,lt_min;
- int delta_hour;
- tm_tmp=gmtime(&t);
- gt_year=tm_tmp->tm_year;
- gt_yday=tm_tmp->tm_yday;
- gt_hour=tm_tmp->tm_hour;
- gt_min=tm_tmp->tm_min;
- memset(&*tm_tmp, 0, sizeof(struct tm));
- tm_tmp=localtime(&t);
- lt_year=tm_tmp->tm_year;
- lt_yday=tm_tmp->tm_yday;
- lt_hour=tm_tmp->tm_hour;
- lt_min=tm_tmp->tm_min;
- delta_hour=lt_hour - gt_hour;
- if ( (lt_year > gt_year) || ((lt_year == gt_year) && (lt_yday > gt_yday)) )
- delta_hour += 24;
- if ( (lt_year < gt_year) || ((lt_year == gt_year) && (lt_yday < gt_yday)) )
- delta_hour -= 24;
-
- t += (delta_hour * 60 * 60) + (lt_min - gt_min) * 60;
- }
-
- timei = (uint32_t)t;
- req.msg.data = (uint8_t *)&timei;
- req.msg.data_len = 4;
-
-#if WORDS_BIGENDIAN
- timei = BSWAP_32(timei);
-#endif
+ /*
+ * At this point `t` is UTC. Convert it to LE and send.
+ */
+
+ req.msg.data = msg_data;
+ htoipmi32(t, req.msg.data);
+ req.msg.data_len = sizeof(msg_data);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
- lprintf(LOG_ERR, "Set SEL Time command failed");
- return -1;
- }
- if (rsp->ccode > 0) {
+ if (!rsp || rsp->ccode) {
lprintf(LOG_ERR, "Set SEL Time command failed: %s",
- val2str(rsp->ccode, completion_code_vals));
+ rsp
+ ? val2str(rsp->ccode, completion_code_vals)
+ : "Unknown"
+ );
return -1;
}
@@ -2788,8 +2804,6 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
return 0;
}
-
-
static int
ipmi_sel_clear(struct ipmi_intf * intf)
{
@@ -2817,11 +2831,11 @@ ipmi_sel_clear(struct ipmi_intf * intf)
req.msg.data_len = 6;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to clear SEL");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Unable to clear SEL: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2840,7 +2854,7 @@ ipmi_sel_delete(struct ipmi_intf * intf, int argc, char ** argv)
uint8_t msg_data[4];
int rc = 0;
- if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
+ if (!argc || !strcmp(argv[0], "help")) {
lprintf(LOG_ERR, "usage: delete <id>...<id>\n");
return -1;
}
@@ -2871,11 +2885,11 @@ ipmi_sel_delete(struct ipmi_intf * intf, int argc, char ** argv)
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to delete entry %d", id);
rc = -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Unable to delete entry %d: %s", id,
val2str(rsp->ccode, completion_code_vals));
rc = -1;
@@ -2901,16 +2915,11 @@ ipmi_sel_show_entry(struct ipmi_intf * intf, int argc, char ** argv)
int rc = 0;
uint16_t id;
- if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
+ if (!argc || !strcmp(argv[0], "help")) {
lprintf(LOG_ERR, "usage: sel get <id>...<id>");
return (-1);
}
- if (ipmi_sel_reserve(intf) == 0) {
- lprintf(LOG_ERR, "Unable to reserve SEL");
- return (-1);
- }
-
for (i = 0; i < argc; i++) {
if (str2ushort(argv[i], &id) != 0) {
lprintf(LOG_ERR, "Given SEL ID '%s' is invalid.",
@@ -2942,7 +2951,7 @@ ipmi_sel_show_entry(struct ipmi_intf * intf, int argc, char ** argv)
evt.sel_type.standard_type.gen_id,
evt.sel_type.standard_type.sensor_num,
evt.sel_type.standard_type.sensor_type);
- if (sdr == NULL) {
+ if (!sdr) {
continue;
}
@@ -2990,10 +2999,10 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
if (argc == 0)
rc = ipmi_sel_get_info(intf);
- else if (strncmp(argv[0], "help", 4) == 0)
+ else if (!strcmp(argv[0], "help"))
lprintf(LOG_ERR, "SEL Commands: "
"info clear delete list elist get add time save readraw writeraw interpret");
- else if (strncmp(argv[0], "interpret", 9) == 0) {
+ else if (!strcmp(argv[0], "interpret")) {
uint32_t iana = 0;
if (argc < 4) {
lprintf(LOG_NOTICE, "usage: sel interpret iana filename format(pps)");
@@ -3006,37 +3015,37 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
}
rc = ipmi_sel_interpret(intf, iana, argv[2], argv[3]);
}
- else if (strncmp(argv[0], "info", 4) == 0)
+ else if (!strcmp(argv[0], "info"))
rc = ipmi_sel_get_info(intf);
- else if (strncmp(argv[0], "save", 4) == 0) {
+ else if (!strcmp(argv[0], "save")) {
if (argc < 2) {
lprintf(LOG_NOTICE, "usage: sel save <filename>");
return 0;
}
rc = ipmi_sel_save_entries(intf, 0, argv[1]);
}
- else if (strncmp(argv[0], "add", 3) == 0) {
+ else if (!strcmp(argv[0], "add")) {
if (argc < 2) {
lprintf(LOG_NOTICE, "usage: sel add <filename>");
return 0;
}
rc = ipmi_sel_add_entries_fromfile(intf, argv[1]);
}
- else if (strncmp(argv[0], "writeraw", 8) == 0) {
+ else if (!strcmp(argv[0], "writeraw")) {
if (argc < 2) {
lprintf(LOG_NOTICE, "usage: sel writeraw <filename>");
return 0;
}
rc = ipmi_sel_writeraw(intf, argv[1]);
}
- else if (strncmp(argv[0], "readraw", 7) == 0) {
+ else if (!strcmp(argv[0], "readraw")) {
if (argc < 2) {
lprintf(LOG_NOTICE, "usage: sel readraw <filename>");
return 0;
}
rc = ipmi_sel_readraw(intf, argv[1]);
}
- else if (strncmp(argv[0], "ereadraw", 8) == 0) {
+ else if (!strcmp(argv[0], "ereadraw")) {
if (argc < 2) {
lprintf(LOG_NOTICE, "usage: sel ereadraw <filename>");
return 0;
@@ -3044,8 +3053,9 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
sel_extended = 1;
rc = ipmi_sel_readraw(intf, argv[1]);
}
- else if (strncmp(argv[0], "list", 4) == 0 ||
- strncmp(argv[0], "elist", 5) == 0) {
+ else if (!strcmp(argv[0], "list")
+ || !strcmp(argv[0], "elist"))
+ {
/*
* Usage:
* list - show all SEL entries
@@ -3056,7 +3066,7 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
int sign = 1;
char *countstr = NULL;
- if (strncmp(argv[0], "elist", 5) == 0)
+ if (!strcmp(argv[0], "elist"))
sel_extended = 1;
else
sel_extended = 0;
@@ -3067,10 +3077,10 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
else if (argc == 3) {
countstr = argv[2];
- if (strncmp(argv[1], "last", 4) == 0) {
+ if (!strcmp(argv[1], "last")) {
sign = -1;
}
- else if (strncmp(argv[1], "first", 5) != 0) {
+ else if (strcmp(argv[1], "first")) {
lprintf(LOG_ERR, "Unknown sel list option");
return -1;
}
@@ -3087,26 +3097,26 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
rc = ipmi_sel_list_entries(intf,count);
}
- else if (strncmp(argv[0], "clear", 5) == 0)
+ else if (!strcmp(argv[0], "clear"))
rc = ipmi_sel_clear(intf);
- else if (strncmp(argv[0], "delete", 6) == 0) {
+ else if (!strcmp(argv[0], "delete")) {
if (argc < 2)
lprintf(LOG_ERR, "usage: sel delete <id>...<id>");
else
rc = ipmi_sel_delete(intf, argc-1, &argv[1]);
}
- else if (strncmp(argv[0], "get", 3) == 0) {
+ else if (!strcmp(argv[0], "get")) {
if (argc < 2)
lprintf(LOG_ERR, "usage: sel get <entry>");
else
rc = ipmi_sel_show_entry(intf, argc-1, &argv[1]);
}
- else if (strncmp(argv[0], "time", 4) == 0) {
+ else if (!strcmp(argv[0], "time")) {
if (argc < 2)
lprintf(LOG_ERR, "sel time commands: get set");
- else if (strncmp(argv[1], "get", 3) == 0)
+ else if (!strcmp(argv[1], "get"))
ipmi_sel_get_time(intf);
- else if (strncmp(argv[1], "set", 3) == 0) {
+ else if (!strcmp(argv[1], "set")) {
if (argc < 3)
lprintf(LOG_ERR, "usage: sel time set \"mm/dd/yyyy hh:mm:ss\"");
else
diff --git a/lib/ipmi_sensor.c b/lib/ipmi_sensor.c
index 063dfb0..45d6d6d 100644
--- a/lib/ipmi_sensor.c
+++ b/lib/ipmi_sensor.c
@@ -62,7 +62,7 @@ ipmi_sensor_get_sensor_reading_factors(
char id[17];
- if (intf == NULL || sensor == NULL)
+ if (!intf || !sensor)
return -1;
memset(id, 0, sizeof(id));
@@ -80,7 +80,7 @@ ipmi_sensor_get_sensor_reading_factors(
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error updating reading factor for sensor %s (#%02x)",
id, sensor->cmn.keys.sensor_num);
return -1;
@@ -164,12 +164,30 @@ ipmi_sensor_print_fc_discrete(struct ipmi_intf *intf,
sr = ipmi_sdr_read_sensor_value(intf, sensor, sdr_record_type, 3);
- if (sr == NULL) {
+ if (!sr) {
return -1;
}
if (csv_output) {
- /* NOT IMPLEMENTED */
+ printf("%s", sr->s_id);
+ if (sr->s_reading_valid) {
+ if (sr->s_has_analog_value) {
+ /* don't show discrete component */
+ printf(",%s,%s,%s",
+ sr->s_a_str, sr->s_a_units, "ok");
+ } else {
+ printf(",0x%x,%s,0x%02x%02x",
+ sr->s_reading, "discrete",
+ sr->s_data2, sr->s_data3);
+ }
+ } else {
+ printf(",%s,%s,%s",
+ "na", "discrete", "na");
+ }
+ printf(",%s,%s,%s,%s,%s,%s",
+ "na", "na", "na", "na", "na", "na");
+
+ printf("\n");
} else {
if (verbose == 0) {
/* output format
@@ -200,14 +218,14 @@ ipmi_sensor_print_fc_discrete(struct ipmi_intf *intf,
printf(" Entity ID : %d.%d\n",
sensor->entity.id, sensor->entity.instance);
printf(" Sensor Type (Discrete): %s\n",
- ipmi_sdr_get_sensor_type_desc(sensor->sensor.
+ ipmi_get_sensor_type(intf, sensor->sensor.
type));
if( sr->s_reading_valid )
{
if (sr->s_has_analog_value) {
printf(" Sensor Reading : %s %s\n", sr->s_a_str, sr->s_a_units);
}
- ipmi_sdr_print_discrete_state("States Asserted",
+ ipmi_sdr_print_discrete_state(intf, "States Asserted",
sensor->sensor.type,
sensor->event_type,
sr->s_data2,
@@ -242,6 +260,184 @@ print_thresh_setting(struct sdr_record_full_sensor *full,
}
}
+static void
+dump_sensor_fc_thredshold_csv(
+ int thresh_available,
+ const char *thresh_status,
+ struct ipmi_rs *rsp,
+ struct sensor_reading *sr)
+{
+ printf("%s", sr->s_id);
+ if (sr->s_reading_valid) {
+ if (sr->s_has_analog_value)
+ printf(",%.3f,%s,%s",
+ sr->s_a_val, sr->s_a_units, thresh_status);
+ else
+ printf(",0x%x,%s,%s",
+ sr->s_reading, sr->s_a_units, thresh_status);
+ } else {
+ printf(",%s,%s,%s",
+ "na", sr->s_a_units, "na");
+ }
+ if (thresh_available && sr->full) {
+#define PTS(bit, dataidx) { \
+print_thresh_setting(sr->full, rsp->data[0] & (bit), \
+rsp->data[(dataidx)], ",", "%.3f", "0x%x", "%s"); \
+}
+ PTS(LOWER_NON_RECOV_SPECIFIED, 3);
+ PTS(LOWER_CRIT_SPECIFIED, 2);
+ PTS(LOWER_NON_CRIT_SPECIFIED, 1);
+ PTS(UPPER_NON_CRIT_SPECIFIED, 4);
+ PTS(UPPER_CRIT_SPECIFIED, 5);
+ PTS(UPPER_NON_RECOV_SPECIFIED, 6);
+#undef PTS
+ } else {
+ printf(",%s,%s,%s,%s,%s,%s",
+ "na", "na", "na", "na", "na", "na");
+ }
+ printf("\n");
+}
+
+/* output format
+ * id value units status thresholds....
+ */
+static void
+dump_sensor_fc_thredshold(
+ int thresh_available,
+ const char *thresh_status,
+ struct ipmi_rs *rsp,
+ struct sensor_reading *sr)
+{
+ printf("%-16s ", sr->s_id);
+ if (sr->s_reading_valid) {
+ if (sr->s_has_analog_value)
+ printf("| %-10.3f | %-10s | %-6s",
+ sr->s_a_val, sr->s_a_units, thresh_status);
+ else
+ printf("| 0x%-8x | %-10s | %-6s",
+ sr->s_reading, sr->s_a_units, thresh_status);
+ } else {
+ printf("| %-10s | %-10s | %-6s",
+ "na", sr->s_a_units, "na");
+ }
+ if (thresh_available && sr->full) {
+#define PTS(bit, dataidx) { \
+print_thresh_setting(sr->full, rsp->data[0] & (bit), \
+rsp->data[(dataidx)], "| ", "%-10.3f", "0x%-8x", "%-10s"); \
+}
+ PTS(LOWER_NON_RECOV_SPECIFIED, 3);
+ PTS(LOWER_CRIT_SPECIFIED, 2);
+ PTS(LOWER_NON_CRIT_SPECIFIED, 1);
+ PTS(UPPER_NON_CRIT_SPECIFIED, 4);
+ PTS(UPPER_CRIT_SPECIFIED, 5);
+ PTS(UPPER_NON_RECOV_SPECIFIED, 6);
+#undef PTS
+ } else {
+ printf("| %-10s| %-10s| %-10s| %-10s| %-10s| %-10s",
+ "na", "na", "na", "na", "na", "na");
+ }
+
+ printf("\n");
+}
+
+static void
+dump_sensor_fc_thredshold_verbose(
+ int thresh_available,
+ const char *thresh_status,
+ struct ipmi_intf *intf,
+ struct sdr_record_common_sensor *sensor,
+ struct ipmi_rs *rsp,
+ struct sensor_reading *sr)
+{
+ printf("Sensor ID : %s (0x%x)\n",
+ sr->s_id, sensor->keys.sensor_num);
+
+ printf(" Entity ID : %d.%d\n",
+ sensor->entity.id, sensor->entity.instance);
+
+ printf(" Sensor Type (Threshold) : %s\n",
+ ipmi_get_sensor_type(intf, sensor->sensor.type));
+
+ printf(" Sensor Reading : ");
+ if (sr->s_reading_valid) {
+ if (sr->full) {
+ uint16_t raw_tol = __TO_TOL(sr->full->mtol);
+ if (sr->s_has_analog_value) {
+ double tol =
+ sdr_convert_sensor_tolerance(sr->full,
+ raw_tol);
+ printf("%.*f (+/- %.*f) %s\n",
+ (sr->s_a_val == (int)
+ sr->s_a_val) ? 0 : 3,
+ sr->s_a_val,
+ (tol == (int) tol) ? 0 : 3, tol,
+ sr->s_a_units);
+ } else {
+ printf("0x%x (+/- 0x%x) %s\n",
+ sr->s_reading,
+ raw_tol,
+ sr->s_a_units);
+ }
+ } else {
+ printf("0x%x %s\n",
+ sr->s_reading, sr->s_a_units);
+ }
+ printf(" Status : %s\n", thresh_status);
+
+ if (thresh_available) {
+ if (sr->full) {
+#define PTS(bit, dataidx, str) { \
+print_thresh_setting(sr->full, rsp->data[0] & (bit), \
+ rsp->data[(dataidx)], \
+ (str), "%.3f\n", "0x%x\n", "%s\n"); \
+}
+ PTS(LOWER_NON_RECOV_SPECIFIED, 3, " Lower Non-Recoverable : ");
+ PTS(LOWER_CRIT_SPECIFIED, 2, " Lower Critical : ");
+ PTS(LOWER_NON_CRIT_SPECIFIED, 1, " Lower Non-Critical : ");
+ PTS(UPPER_NON_CRIT_SPECIFIED, 4, " Upper Non-Critical : ");
+ PTS(UPPER_CRIT_SPECIFIED, 5, " Upper Critical : ");
+ PTS(UPPER_NON_RECOV_SPECIFIED, 6, " Upper Non-Recoverable : ");
+#undef PTS
+
+ }
+ ipmi_sdr_print_sensor_hysteresis(sensor, sr->full,
+ sr->full ? sr->full->threshold.hysteresis.positive :
+ sr->compact->threshold.hysteresis.positive,
+ "Positive Hysteresis");
+
+ ipmi_sdr_print_sensor_hysteresis(sensor, sr->full,
+ sr->full ? sr->full->threshold.hysteresis.negative :
+ sr->compact->threshold.hysteresis.negative,
+ "Negative Hysteresis");
+ } else {
+ printf(" Sensor Threshold Settings not available\n");
+ }
+ } else {
+ printf(" Unable to read sensor: Device Not Present\n\n");
+ }
+
+ ipmi_sdr_print_sensor_event_status(intf,
+ sensor->keys.
+ sensor_num,
+ sensor->sensor.type,
+ sensor->event_type,
+ ANALOG_SENSOR,
+ sensor->keys.owner_id,
+ sensor->keys.lun,
+ sensor->keys.channel);
+ ipmi_sdr_print_sensor_event_enable(intf,
+ sensor->keys.
+ sensor_num,
+ sensor->sensor.type,
+ sensor->event_type,
+ ANALOG_SENSOR,
+ sensor->keys.owner_id,
+ sensor->keys.lun,
+ sensor->keys.channel);
+
+ printf("\n");
+}
+
static int
ipmi_sensor_print_fc_threshold(struct ipmi_intf *intf,
struct sdr_record_common_sensor *sensor,
@@ -253,7 +449,7 @@ ipmi_sensor_print_fc_threshold(struct ipmi_intf *intf,
sr = ipmi_sdr_read_sensor_value(intf, sensor, sdr_record_type, 3);
- if (sr == NULL) {
+ if (!sr) {
return -1;
}
@@ -266,137 +462,17 @@ ipmi_sensor_print_fc_threshold(struct ipmi_intf *intf,
sensor->keys.sensor_num, sensor->keys.owner_id,
sensor->keys.lun, sensor->keys.channel);
- if ((rsp == NULL) || (rsp->ccode > 0) || (rsp->data_len == 0))
+ if (!rsp || rsp->ccode || !rsp->data_len)
thresh_available = 0;
if (csv_output) {
- /* NOT IMPLEMENTED */
+ dump_sensor_fc_thredshold_csv(thresh_available, thresh_status, rsp, sr);
} else {
if (verbose == 0) {
- /* output format
- * id value units status thresholds....
- */
- printf("%-16s ", sr->s_id);
- if (sr->s_reading_valid) {
- if (sr->s_has_analog_value)
- printf("| %-10.3f | %-10s | %-6s",
- sr->s_a_val, sr->s_a_units, thresh_status);
- else
- printf("| 0x%-8x | %-10s | %-6s",
- sr->s_reading, sr->s_a_units, thresh_status);
- } else {
- printf("| %-10s | %-10s | %-6s",
- "na", sr->s_a_units, "na");
- }
- if (thresh_available && sr->full) {
-#define PTS(bit, dataidx) { \
- print_thresh_setting(sr->full, rsp->data[0] & (bit), \
- rsp->data[(dataidx)], "| ", "%-10.3f", "0x-8x", "%-10s"); \
-}
- PTS(LOWER_NON_RECOV_SPECIFIED, 3);
- PTS(LOWER_CRIT_SPECIFIED, 2);
- PTS(LOWER_NON_CRIT_SPECIFIED, 1);
- PTS(UPPER_NON_CRIT_SPECIFIED, 4);
- PTS(UPPER_CRIT_SPECIFIED, 5);
- PTS(UPPER_NON_RECOV_SPECIFIED, 6);
-#undef PTS
- } else {
- printf
- ("| %-10s| %-10s| %-10s| %-10s| %-10s| %-10s",
- "na", "na", "na", "na", "na", "na");
- }
-
- printf("\n");
+ dump_sensor_fc_thredshold(thresh_available, thresh_status, rsp, sr);
} else {
- printf("Sensor ID : %s (0x%x)\n",
- sr->s_id, sensor->keys.sensor_num);
-
- printf(" Entity ID : %d.%d\n",
- sensor->entity.id, sensor->entity.instance);
-
- printf(" Sensor Type (Threshold) : %s\n",
- ipmi_sdr_get_sensor_type_desc(sensor->sensor.
- type));
-
- printf(" Sensor Reading : ");
- if (sr->s_reading_valid) {
- if (sr->full) {
- uint16_t raw_tol = __TO_TOL(sr->full->mtol);
- if (sr->s_has_analog_value) {
- double tol =
- sdr_convert_sensor_tolerance(sr->full,
- raw_tol);
- printf("%.*f (+/- %.*f) %s\n",
- (sr->s_a_val == (int)
- sr->s_a_val) ? 0 : 3,
- sr->s_a_val,
- (tol == (int) tol) ? 0 : 3, tol,
- sr->s_a_units);
- } else {
- printf("0x%x (+/- 0x%x) %s\n",
- sr->s_reading,
- raw_tol,
- sr->s_a_units);
- }
- } else {
- printf("0x%x %s\n", sr->s_reading,
- sr->s_a_units);
- }
- printf(" Status : %s\n", thresh_status);
-
- if (thresh_available) {
- if (sr->full) {
-#define PTS(bit, dataidx, str) { \
-print_thresh_setting(sr->full, rsp->data[0] & (bit), \
- rsp->data[(dataidx)], \
- (str), "%.3f\n", "0x%x\n", "%s\n"); \
-}
-
- PTS(LOWER_NON_RECOV_SPECIFIED, 3, " Lower Non-Recoverable : ");
- PTS(LOWER_CRIT_SPECIFIED, 2, " Lower Critical : ");
- PTS(LOWER_NON_CRIT_SPECIFIED, 1, " Lower Non-Critical : ");
- PTS(UPPER_NON_CRIT_SPECIFIED, 4, " Upper Non-Critical : ");
- PTS(UPPER_CRIT_SPECIFIED, 5, " Upper Critical : ");
- PTS(UPPER_NON_RECOV_SPECIFIED, 6, " Upper Non-Recoverable : ");
-#undef PTS
-
- }
- ipmi_sdr_print_sensor_hysteresis(sensor, sr->full,
- sr->full ? sr->full->threshold.hysteresis.positive :
- sr->compact->threshold.hysteresis.positive,
- "Positive Hysteresis");
-
- ipmi_sdr_print_sensor_hysteresis(sensor, sr->full,
- sr->full ? sr->full->threshold.hysteresis.negative :
- sr->compact->threshold.hysteresis.negative,
- "Negative Hysteresis");
- } else {
- printf(" Sensor Threshold Settings not available\n");
- }
- } else {
- printf(" Unable to read sensor: Device Not Present\n\n");
- }
-
- ipmi_sdr_print_sensor_event_status(intf,
- sensor->keys.
- sensor_num,
- sensor->sensor.type,
- sensor->event_type,
- ANALOG_SENSOR,
- sensor->keys.owner_id,
- sensor->keys.lun,
- sensor->keys.channel);
- ipmi_sdr_print_sensor_event_enable(intf,
- sensor->keys.
- sensor_num,
- sensor->sensor.type,
- sensor->event_type,
- ANALOG_SENSOR,
- sensor->keys.owner_id,
- sensor->keys.lun,
- sensor->keys.channel);
-
- printf("\n");
+ dump_sensor_fc_thredshold_verbose(thresh_available, thresh_status,
+ intf, sensor, rsp, sr);
}
}
@@ -424,16 +500,16 @@ ipmi_sensor_list(struct ipmi_intf *intf)
lprintf(LOG_DEBUG, "Querying SDR for sensor list");
itr = ipmi_sdr_start(intf, 0);
- if (itr == NULL) {
+ if (!itr) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
return -1;
}
- while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
+ while ((header = ipmi_sdr_get_next_header(intf, itr))) {
uint8_t *rec;
rec = ipmi_sdr_get_record(intf, header, itr);
- if (rec == NULL) {
+ if (!rec) {
lprintf(LOG_DEBUG, "rec == NULL");
continue;
}
@@ -456,7 +532,7 @@ ipmi_sensor_list(struct ipmi_intf *intf)
/* rc = (r == 0) ? rc : r; */
}
- ipmi_sdr_end(intf, itr);
+ ipmi_sdr_end(itr);
return rc;
}
@@ -481,11 +557,11 @@ __ipmi_sensor_set_threshold(struct ipmi_intf *intf,
rsp = ipmi_sensor_set_sensor_thresholds(intf, num, mask, setting,
target, lun, channel);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error setting threshold");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Error setting threshold: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -529,7 +605,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
struct sdr_record_list *sdr;
- if (argc < 3 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc < 3 || !strcmp(argv[0], "help")) {
print_sensor_thresh_usage();
return 0;
}
@@ -537,7 +613,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
id = argv[0];
thresh = argv[1];
- if (strncmp(thresh, "upper", 5) == 0) {
+ if (!strcmp(thresh, "upper")) {
if (argc < 5) {
lprintf(LOG_ERR,
"usage: sensor thresh <id> upper <unc> <ucr> <unr>");
@@ -559,7 +635,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
argv[4]);
return (-1);
}
- } else if (strncmp(thresh, "lower", 5) == 0) {
+ } else if (!strcmp(thresh, "lower")) {
if (argc < 5) {
lprintf(LOG_ERR,
"usage: sensor thresh <id> lower <lnr> <lcr> <lnc>");
@@ -582,17 +658,17 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
return (-1);
}
} else {
- if (strncmp(thresh, "unr", 3) == 0)
+ if (!strcmp(thresh, "unr"))
settingMask = UPPER_NON_RECOV_SPECIFIED;
- else if (strncmp(thresh, "ucr", 3) == 0)
+ else if (!strcmp(thresh, "ucr"))
settingMask = UPPER_CRIT_SPECIFIED;
- else if (strncmp(thresh, "unc", 3) == 0)
+ else if (!strcmp(thresh, "unc"))
settingMask = UPPER_NON_CRIT_SPECIFIED;
- else if (strncmp(thresh, "lnc", 3) == 0)
+ else if (!strcmp(thresh, "lnc"))
settingMask = LOWER_NON_CRIT_SPECIFIED;
- else if (strncmp(thresh, "lcr", 3) == 0)
+ else if (!strcmp(thresh, "lcr"))
settingMask = LOWER_CRIT_SPECIFIED;
- else if (strncmp(thresh, "lnr", 3) == 0)
+ else if (!strcmp(thresh, "lnr"))
settingMask = LOWER_NON_RECOV_SPECIFIED;
else {
lprintf(LOG_ERR,
@@ -612,7 +688,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
/* lookup by sensor name */
sdr = ipmi_sdr_find_sdr_byid(intf, id);
- if (sdr == NULL) {
+ if (!sdr) {
lprintf(LOG_ERR, "Sensor data record not found!");
return -1;
}
@@ -721,7 +797,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
sdr->record.common->keys.owner_id,
sdr->record.common->keys.lun,
sdr->record.common->keys.channel);
- if ((rsp == NULL) || (rsp->ccode > 0)) {
+ if (!rsp || rsp->ccode) {
lprintf(LOG_ERR, "Sensor data record not found!");
return -1;
}
@@ -810,7 +886,7 @@ ipmi_sensor_get_reading(struct ipmi_intf *intf, int argc, char **argv)
struct sdr_record_list *sdr;
int i, rc=0;
- if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc < 1 || !strcmp(argv[0], "help")) {
lprintf(LOG_NOTICE, "sensor reading <id> ... [id]");
lprintf(LOG_NOTICE, " id : name of desired sensor");
return -1;
@@ -818,7 +894,7 @@ ipmi_sensor_get_reading(struct ipmi_intf *intf, int argc, char **argv)
for (i = 0; i < argc; i++) {
sdr = ipmi_sdr_find_sdr_byid(intf, argv[i]);
- if (sdr == NULL) {
+ if (!sdr) {
lprintf(LOG_ERR, "Sensor \"%s\" not found!",
argv[i]);
rc = -1;
@@ -833,7 +909,7 @@ ipmi_sensor_get_reading(struct ipmi_intf *intf, int argc, char **argv)
struct sdr_record_common_sensor *sensor = sdr->record.common;
sr = ipmi_sdr_read_sensor_value(intf, sensor, sdr->type, 3);
- if (sr == NULL) {
+ if (!sr) {
rc = -1;
continue;
}
@@ -874,7 +950,7 @@ ipmi_sensor_get(struct ipmi_intf *intf, int argc, char **argv)
lprintf(LOG_ERR, "Not enough parameters given.");
print_sensor_get_usage();
return (-1);
- } else if (strcmp(argv[0], "help") == 0) {
+ } else if (!strcmp(argv[0], "help")) {
print_sensor_get_usage();
return 0;
}
@@ -882,7 +958,7 @@ ipmi_sensor_get(struct ipmi_intf *intf, int argc, char **argv)
/* lookup by sensor name */
for (i = 0; i < argc; i++) {
sdr = ipmi_sdr_find_sdr_byid(intf, argv[i]);
- if (sdr == NULL) {
+ if (!sdr) {
lprintf(LOG_ERR, "Sensor data record \"%s\" not found!",
argv[i]);
rc = -1;
@@ -919,15 +995,15 @@ ipmi_sensor_main(struct ipmi_intf *intf, int argc, char **argv)
if (argc == 0) {
rc = ipmi_sensor_list(intf);
- } else if (strncmp(argv[0], "help", 4) == 0) {
+ } else if (!strcmp(argv[0], "help")) {
lprintf(LOG_NOTICE, "Sensor Commands: list thresh get reading");
- } else if (strncmp(argv[0], "list", 4) == 0) {
+ } else if (!strcmp(argv[0], "list")) {
rc = ipmi_sensor_list(intf);
- } else if (strncmp(argv[0], "thresh", 5) == 0) {
+ } else if (!strcmp(argv[0], "thresh")) {
rc = ipmi_sensor_set_threshold(intf, argc - 1, &argv[1]);
- } else if (strncmp(argv[0], "get", 3) == 0) {
+ } else if (!strcmp(argv[0], "get")) {
rc = ipmi_sensor_get(intf, argc - 1, &argv[1]);
- } else if (strncmp(argv[0], "reading", 7) == 0) {
+ } else if (!strcmp(argv[0], "reading")) {
rc = ipmi_sensor_get_reading(intf, argc - 1, &argv[1]);
} else {
lprintf(LOG_ERR, "Invalid sensor command: %s", argv[0]);
diff --git a/lib/ipmi_session.c b/lib/ipmi_session.c
index 4855bc4..70a3521 100644
--- a/lib/ipmi_session.c
+++ b/lib/ipmi_session.c
@@ -99,13 +99,8 @@ print_session_info_csv(const struct get_session_info_rsp * session_info,
buffer,
16));
- printf(",%02x:%02x:%02x:%02x:%02x:%02x",
- session_info->channel_data.lan_data.console_mac[0],
- session_info->channel_data.lan_data.console_mac[1],
- session_info->channel_data.lan_data.console_mac[2],
- session_info->channel_data.lan_data.console_mac[3],
- session_info->channel_data.lan_data.console_mac[4],
- session_info->channel_data.lan_data.console_mac[5]);
+ printf(",%s", mac2str(
+ session_info->channel_data.lan_data.console_mac));
console_port_tmp = session_info->channel_data.lan_data.console_port;
#if WORDS_BIGENDIAN
@@ -187,13 +182,8 @@ print_session_info_verbose(const struct get_session_info_rsp * session_info,
buffer,
16));
- printf("console mac : %02x:%02x:%02x:%02x:%02x:%02x\n",
- session_info->channel_data.lan_data.console_mac[0],
- session_info->channel_data.lan_data.console_mac[1],
- session_info->channel_data.lan_data.console_mac[2],
- session_info->channel_data.lan_data.console_mac[3],
- session_info->channel_data.lan_data.console_mac[4],
- session_info->channel_data.lan_data.console_mac[5]);
+ printf("console mac : %s\n", mac2str(
+ session_info->channel_data.lan_data.console_mac));
console_port_tmp = session_info->channel_data.lan_data.console_port;
#if WORDS_BIGENDIAN
@@ -298,12 +288,12 @@ ipmi_get_session_info(struct ipmi_intf * intf,
}
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL)
+ if (!rsp)
{
lprintf(LOG_ERR, "Get Session Info command failed");
retval = -1;
}
- else if (rsp->ccode > 0)
+ else if (rsp->ccode)
{
lprintf(LOG_ERR, "Get Session Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
@@ -312,15 +302,19 @@ ipmi_get_session_info(struct ipmi_intf * intf,
if (retval < 0)
{
- if ((session_request_type == IPMI_SESSION_REQUEST_CURRENT) &&
- (strncmp(intf->name, "lan", 3) != 0))
+ if (session_request_type == IPMI_SESSION_REQUEST_CURRENT
+ && strcmp(intf->name, "lan"))
+ {
lprintf(LOG_ERR, "It is likely that the channel in use "
"does not support sessions");
+ }
}
else
{
- memcpy(&session_info, rsp->data, rsp->data_len);
- print_session_info(&session_info, rsp->data_len);
+ memcpy(&session_info, rsp->data,
+ __min(rsp->data_len, sizeof(session_info)));
+ print_session_info(&session_info,
+ __min(rsp->data_len, sizeof(session_info)));
}
break;
@@ -332,13 +326,13 @@ ipmi_get_session_info(struct ipmi_intf * intf,
rqdata[0] = i++;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL)
+ if (!rsp)
{
lprintf(LOG_ERR, "Get Session Info command failed");
retval = -1;
break;
}
- else if (rsp->ccode > 0 && rsp->ccode != 0xCC && rsp->ccode != 0xCB)
+ else if (rsp->ccode && rsp->ccode != 0xCC && rsp->ccode != 0xCB)
{
lprintf(LOG_ERR, "Get Session Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
@@ -351,8 +345,10 @@ ipmi_get_session_info(struct ipmi_intf * intf,
break;
}
- memcpy(&session_info, rsp->data, rsp->data_len);
- print_session_info(&session_info, rsp->data_len);
+ memcpy(&session_info, rsp->data,
+ __min(rsp->data_len, sizeof(session_info)));
+ print_session_info(&session_info,
+ __min(rsp->data_len, sizeof(session_info)));
} while (i <= session_info.session_slot_count);
break;
@@ -375,14 +371,14 @@ ipmi_session_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int retval = 0;
- if (argc == 0 || strncmp(argv[0], "help", 4) == 0)
+ if (!argc || !strcmp(argv[0], "help"))
{
printf_session_usage();
}
- else if (strncmp(argv[0], "info", 4) == 0)
+ else if (!strcmp(argv[0], "info"))
{
- if ((argc < 2) || strncmp(argv[1], "help", 4) == 0)
+ if (argc < 2 || !strcmp(argv[1], "help"))
{
printf_session_usage();
}
@@ -391,11 +387,11 @@ ipmi_session_main(struct ipmi_intf * intf, int argc, char ** argv)
Ipmi_Session_Request_Type session_request_type = 0;
uint32_t id_or_handle = 0;
- if (strncmp(argv[1], "active", 6) == 0)
+ if (!strcmp(argv[1], "active"))
session_request_type = IPMI_SESSION_REQUEST_CURRENT;
- else if (strncmp(argv[1], "all", 3) == 0)
+ else if (!strcmp(argv[1], "all"))
session_request_type = IPMI_SESSION_REQUEST_ALL;
- else if (strncmp(argv[1], "id", 2) == 0)
+ else if (!strcmp(argv[1], "id"))
{
if (argc >= 3)
{
@@ -414,7 +410,7 @@ ipmi_session_main(struct ipmi_intf * intf, int argc, char ** argv)
retval = -1;
}
}
- else if (strncmp(argv[1], "handle", 6) == 0)
+ else if (!strcmp(argv[1], "handle"))
{
if (argc >= 3)
{
diff --git a/lib/ipmi_sol.c b/lib/ipmi_sol.c
index 333ce90..8e7285c 100644
--- a/lib/ipmi_sol.c
+++ b/lib/ipmi_sol.c
@@ -29,11 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE
-#define _BSD_SOURCE || \
- (_XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
- !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
#include <stdlib.h>
#include <string.h>
@@ -130,11 +125,11 @@ ipmi_sol_payload_access(struct ipmi_intf * intf, uint8_t channel,
/* payload 1 is SOL */
data[2] = 0x02;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error %sabling SOL payload for user %d on channel %d",
enable ? "en" : "dis", userid, channel);
rc = (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Error %sabling SOL payload for user %d on channel %d: %s",
enable ? "en" : "dis", userid, channel,
val2str(rsp->ccode, completion_code_vals));
@@ -164,7 +159,7 @@ ipmi_sol_payload_access_status(struct ipmi_intf * intf,
data[1] = userid & 0x3f; /* user id */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error. No valid response received.");
return -1;
}
@@ -219,7 +214,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -257,7 +252,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -295,7 +290,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -335,7 +330,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -374,7 +369,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -413,7 +408,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -451,7 +446,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -489,7 +484,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -528,7 +523,7 @@ ipmi_get_sol_info(
data[3] = 0x00; /* block selector */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error: No response requesting SOL parameter '%s'",
val2str(data[1], sol_parameter_vals));
return (-1);
@@ -546,7 +541,7 @@ ipmi_get_sol_info(
}
break;
case 0x80:
- if( intf->session != NULL ) {
+ if (intf->session) {
lprintf(LOG_ERR, "Info: SOL parameter '%s' not supported - defaulting to %d",
val2str(data[1], sol_parameter_vals), intf->ssn_params.port);
params->payload_port = intf->ssn_params.port;
@@ -653,13 +648,14 @@ ipmi_print_sol_info(struct ipmi_intf * intf, uint8_t channel)
*
* function will return -1 if value is not valid, or
* will return 0 if valid.
+ *
+ * base parameter currently unused, left in for extension.
*/
-int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
- const char *name,
- int base,
- uint8_t minval,
- uint8_t maxval,
- uint8_t *out_value)
+int ipmi_sol_set_param_isvalid_uint8_t(const char *strval,
+ const char *name,
+ uint8_t minval,
+ uint8_t maxval,
+ uint8_t *out_value)
{
if (str2uchar(strval, out_value) != 0 || (*out_value < minval)
|| (*out_value > maxval)) {
@@ -871,7 +867,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
/* validate user-supplied input */
- if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 1, 255, &data[2]))
+ if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 1, 255, &data[2]))
return -1;
/* We need other values to complete the request */
@@ -897,7 +893,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
/* validate user-supplied input */
- if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 255, &data[3]))
+ if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 255, &data[3]))
return -1;
/* We need other values to complete the request */
@@ -923,7 +919,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_SOL_RETRY;
/* validate user input, 7 is max value */
- if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 7, &data[2]))
+ if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 7, &data[2]))
return -1;
/* We need other values to complete the request */
@@ -949,7 +945,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_SOL_RETRY;
/* validate user-supplied input */
- if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 255, &data[3]))
+ if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 255, &data[3]))
return -1;
/* We need other values to complete the request */
@@ -1073,13 +1069,13 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
/* The command proper */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Error setting SOL parameter '%s'", param);
return -1;
}
- if (!(!strncmp(param, "set-in-progress", 15) && !strncmp(value, "commit-write", 12)) &&
- rsp->ccode > 0) {
+ if (!(!strcmp(param, "set-in-progress") && !strcmp(value, "commit-write")) &&
+ rsp->ccode) {
switch (rsp->ccode) {
case 0x80:
lprintf(LOG_ERR, "Error setting SOL parameter '%s': "
@@ -1491,7 +1487,7 @@ ipmi_sol_keepalive_using_sol(struct ipmi_intf * intf)
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
memset(&v2_payload, 0, sizeof(v2_payload));
v2_payload.payload.sol_packet.character_count = 0;
- if (intf->send_sol(intf, &v2_payload) == NULL)
+ if (!intf->send_sol(intf, &v2_payload))
return -1;
/* good return, reset start time */
gettimeofday(&_start_keepalive, 0);
@@ -1542,7 +1538,7 @@ ipmi_sol_red_pill(struct ipmi_intf * intf, int instance)
buffer_size -= 4;
buffer = (char*)malloc(buffer_size);
- if (buffer == NULL) {
+ if (!buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -1648,15 +1644,11 @@ ipmi_sol_red_pill(struct ipmi_intf * intf, int instance)
else if (FD_ISSET(intf->fd, &read_fds))
{
struct ipmi_rs * rs =intf->recv_sol(intf);
- if ( rs)
- {
+ if (rs) {
output(rs);
+ } else {
+ bShouldExit = bBmcClosedSession = 1;
}
- /*
- * Should recv_sol come back null, the incoming packet was not ours.
- * Just fall through, the keepalive logic will determine if
- * the BMC has dropped the session.
- */
}
@@ -1713,7 +1705,7 @@ ipmi_sol_activate(struct ipmi_intf * intf, int looptest, int interval,
* This command is only available over RMCP+ (the lanplus
* interface).
*/
- if (strncmp(intf->name, "lanplus", 7) != 0)
+ if (strcmp(intf->name, "lanplus"))
{
lprintf(LOG_ERR, "Error: This command is only available over the "
"lanplus interface");
@@ -1826,9 +1818,6 @@ ipmi_sol_activate(struct ipmi_intf * intf, int looptest, int interval,
(ap_rsp.payload_udp_port[1] << 8) |
ap_rsp.payload_udp_port[0];
- intf->session->timeout = 1;
-
-
/* NOTE: the spec does allow for SOL traffic to be sent on
* a different port. we do not yet support that feature. */
if (intf->session->sol_data.port != intf->ssn_params.port)
@@ -1919,10 +1908,13 @@ int
ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int retval = 0;
- if (!argc || !strncmp(argv[0], "help", 4)) {
+ const char *instance_kw = "instance=";
+ size_t instance_len = strlen(instance_kw);
+
+ if (!argc || !strcmp(argv[0], "help")) {
/* Help */
print_sol_usage();
- } else if (!strncmp(argv[0], "info", 4)) {
+ } else if (!strcmp(argv[0], "info")) {
/* Info */
uint8_t channel;
if (argc == 1) {
@@ -1937,7 +1929,7 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
retval = ipmi_print_sol_info(intf, channel);
- } else if (!strncmp(argv[0], "payload", 7)) {
+ } else if (!strcmp(argv[0], "payload")) {
/* Payload enable or disable */
uint8_t channel = 0xe;
uint8_t userid = 1;
@@ -1956,25 +1948,25 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
}
- if (!strncmp(argv[1], "enable", 6)) {
+ if (!strcmp(argv[1], "enable")) {
enable = 1;
- } else if (!strncmp(argv[1], "disable", 7)) {
+ } else if (!strcmp(argv[1], "disable")) {
enable = 0;
- } else if (!strncmp(argv[1], "status", 6)) {
+ } else if (!strcmp(argv[1], "status")) {
return ipmi_sol_payload_access_status(intf, channel, userid);
} else {
print_sol_usage();
return -1;
}
retval = ipmi_sol_payload_access(intf, channel, userid, enable);
- } else if (!strncmp(argv[0], "set", 3)) {
+ } else if (!strcmp(argv[0], "set")) {
/* Set a parameter value */
uint8_t channel = 0xe;
uint8_t guard = 1;
if (argc == 3) {
channel = 0xe;
} else if (argc == 4) {
- if (!strncmp(argv[3], "noguard", 7)) {
+ if (!strcmp(argv[3], "noguard")) {
guard = 0;
} else {
if (is_ipmi_channel_num(argv[3], &channel) != 0) {
@@ -1985,7 +1977,7 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
if (is_ipmi_channel_num(argv[3], &channel) != 0) {
return (-1);
}
- if (!strncmp(argv[4], "noguard", 7)) {
+ if (!strcmp(argv[4], "noguard")) {
guard = 0;
}
} else {
@@ -1993,16 +1985,16 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
retval = ipmi_sol_set_param(intf, channel, argv[1], argv[2], guard);
- } else if (!strncmp(argv[0], "activate", 8)) {
+ } else if (!strcmp(argv[0], "activate")) {
/* Activate */
int i;
uint8_t instance = 1;
for (i = 1; i < argc; i++) {
- if (!strncmp(argv[i], "usesolkeepalive", 15)) {
+ if (!strcmp(argv[i], "usesolkeepalive")) {
_use_sol_for_keepalive = 1;
- } else if (!strncmp(argv[i], "nokeepalive", 11)) {
+ } else if (!strcmp(argv[i], "nokeepalive")) {
_disable_keepalive = 1;
- } else if (!strncmp(argv[i], "instance=", 9)) {
+ } else if (!strncmp(argv[i], instance_kw, instance_len)) {
if (str2uchar(argv[i] + 9, &instance) != 0) {
lprintf(LOG_ERR, "Given instance '%s' is invalid.", argv[i] + 9);
print_sol_usage();
@@ -2014,12 +2006,12 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
}
}
retval = ipmi_sol_activate(intf, 0, 0, instance);
- } else if (!strncmp(argv[0], "deactivate", 10)) {
- /* Dectivate */
+ } else if (!strcmp(argv[0], "deactivate")) {
+ /* Deactivate */
int i;
uint8_t instance = 1;
for (i = 1; i < argc; i++) {
- if (!strncmp(argv[i], "instance=", 9)) {
+ if (!strncmp(argv[i], instance_kw, instance_len)) {
if (str2uchar(argv[i] + 9, &instance) != 0) {
lprintf(LOG_ERR,
"Given instance '%s' is invalid.",
@@ -2033,8 +2025,8 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
}
}
retval = ipmi_sol_deactivate(intf, instance);
- } else if (!strncmp(argv[0], "looptest", 8)) {
- /* SOL loop test: Activate and then Dectivate */
+ } else if (!strcmp(argv[0], "looptest")) {
+ /* SOL loop test: Activate and then Deactivate */
int cnt = 200;
int interval = 100; /* Unit is: ms */
uint8_t instance = 1;
diff --git a/lib/ipmi_strings.c b/lib/ipmi_strings.c
index 7fefee9..26b359f 100644
--- a/lib/ipmi_strings.c
+++ b/lib/ipmi_strings.c
@@ -30,76 +30,58 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#include <ctype.h>
+#include <limits.h>
#include <stddef.h>
+
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/ipmi_constants.h>
#include <ipmitool/ipmi_sensor.h>
#include <ipmitool/ipmi_sel.h> /* for IPMI_OEM */
+#include <ipmitool/log.h>
+
+/*
+ * These are put at the head so they are found first because they
+ * may overlap with IANA specified numbers found in the registry.
+ */
+static const struct valstr ipmi_oem_info_head[] = {
+ { IPMI_OEM_UNKNOWN, "Unknown" }, /* IPMI Unknown */
+ { IPMI_OEM_RESERVED, "Unspecified" }, /* IPMI Reserved */
+ { UINT32_MAX , NULL },
+};
-const struct valstr ipmi_oem_info[] = {
-
- { IPMI_OEM_UNKNOWN, "Unknown" },
- { IPMI_OEM_HP, "Hewlett-Packard" },
- { IPMI_OEM_SUN, "Sun Microsystems" },
- { IPMI_OEM_INTEL, "Intel Corporation" },
- { IPMI_OEM_LMC, "LMC" },
- { IPMI_OEM_RADISYS, "RadiSys Corporation" },
- { IPMI_OEM_TYAN, "Tyan Computer Corporation" },
- { IPMI_OEM_NEWISYS, "Newisys" },
- { IPMI_OEM_SUPERMICRO, "Supermicro" },
- { IPMI_OEM_GOOGLE, "Google" },
- { IPMI_OEM_KONTRON, "Kontron" },
- { IPMI_OEM_NOKIA, "Nokia" },
- { IPMI_OEM_PICMG, "PICMG" },
- { IPMI_OEM_PEPPERCON, "Peppercon AG" },
- { IPMI_OEM_DELL, "DELL Inc" },
- { IPMI_OEM_NEC, "NEC" },
- { IPMI_OEM_MAGNUM, "Magnum Technologies" },
- { IPMI_OEM_FUJITSU_SIEMENS, "Fujitsu Siemens" },
- { IPMI_OEM_TATUNG, "Tatung" },
- { IPMI_OEM_AMI, "AMI" },
- { IPMI_OEM_RARITAN, "Raritan" },
- { IPMI_OEM_AVOCENT, "Avocent" },
- { IPMI_OEM_OSA, "OSA" },
- { IPMI_OEM_TOSHIBA, "Toshiba" },
- { IPMI_OEM_HITACHI_116, "Hitachi" },
- { IPMI_OEM_HITACHI_399, "Hitachi" },
- { IPMI_OEM_NOKIA_SOLUTIONS_AND_NETWORKS, "Nokia Solutions and Networks (formerly 'Nokia Siemens Networks')" },
- { IPMI_OEM_BULL, "Bull Company" },
- { IPMI_OEM_PPS, "Pigeon Point Systems" },
- { IPMI_OEM_BROADCOM, "Broadcom Corporation" },
- { IPMI_OEM_ERICSSON, "Ericsson AB"},
- { IPMI_OEM_QUANTA, "Quanta" },
- { IPMI_OEM_ADVANTECH, "Advantech" },
- /************************************************************************
- * Add ID String for IANA Enterprise Number of IBM & ADLINK
- * https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
- * 2
- * IBM
- * Kristine Adamson
- * adamson&us.ibm.com
- * 4769
- * IBM Corporation
- * Victor Sample
- * vsample&us.ibm.com
- * 20301
- * IBM eServer X
- * Lynn Fore
- * sls&us.ibm.com
- * 24339
- * ADLINK TECHNOLOGY INC.
- * Ryan Hsu
- * ryan.hsu&adlinktech.com
- ************************************************************************/
- { IPMI_OEM_IBM_2, "IBM" },
- { IPMI_OEM_IBM_4769, "IBM Corporation" },
- { IPMI_OEM_IBM_20301, "IBM eServer X" },
- { IPMI_OEM_ADLINK_24339, "ADLINK Technology Inc." },
- { 0xffff , NULL },
+/*
+ * These are our own technical values. We don't want them to take precedence
+ * over IANA's defined values, so they go at the very end of the array.
+ */
+static const struct valstr ipmi_oem_info_tail[] = {
+ { IPMI_OEM_DEBUG, "A Debug Assisting Company, Ltd." },
+ { UINT32_MAX , NULL },
+};
+
+/*
+ * This is used when ipmi_oem_info couldn't be allocated.
+ * ipmitool would report all OEMs as unknown, but would be functional otherwise.
+ */
+static const struct valstr ipmi_oem_info_dummy[] = {
+ { UINT32_MAX , NULL },
};
+/* This will point to an array filled from IANA's enterprise numbers registry */
+const struct valstr *ipmi_oem_info;
+
+/* Single-linked list of OEM valstrs */
+typedef struct oem_valstr_list_s {
+ struct valstr valstr;
+ struct oem_valstr_list_s *next;
+} oem_valstr_list_t;
+
const struct oemvalstr ipmi_oem_product_info[] = {
/* Keep OEM grouped together */
+
+ /* For ipmitool debugging */
+ { IPMI_OEM_DEBUG, 0x1234, "Great Debuggable BMC" },
+
/* Intel stuff, thanks to Tim Bell */
{ IPMI_OEM_INTEL, 0x000C, "TSRLT2" },
{ IPMI_OEM_INTEL, 0x001B, "TIGPR2U" },
@@ -113,6 +95,7 @@ const struct oemvalstr ipmi_oem_product_info[] = {
{ IPMI_OEM_INTEL, 0x0808, "MPCBL0001" },
{ IPMI_OEM_INTEL, 0x0811, "TIGW1U" },
{ IPMI_OEM_INTEL, 0x4311, "NSI2U" },
+
/* Kontron */
{ IPMI_OEM_KONTRON,4000, "AM4000 AdvancedMC" },
{ IPMI_OEM_KONTRON,4001, "AM4001 AdvancedMC" },
@@ -140,10 +123,13 @@ const struct oemvalstr ipmi_oem_product_info[] = {
{ IPMI_OEM_KONTRON,5007, "AT8050" },
{ IPMI_OEM_KONTRON,5301, "AT8400" },
{ IPMI_OEM_KONTRON,5303, "AT8901" },
+
/* Broadcom */
{ IPMI_OEM_BROADCOM, 5725, "BCM5725" },
+
/* Ericsson */
{ IPMI_OEM_ERICSSON, 0x0054, "Phantom" },
+
/* Advantech */
/* ATCA Blades */
{ IPMI_OEM_ADVANTECH, 0x3393, "MIC-3393" },
@@ -226,6 +212,7 @@ const struct oemvalstr ipmi_oem_product_info[] = {
{ IPMI_OEM_ADVANTECH, 0x9212, "ESP-9212" },
{ IPMI_OEM_ADVANTECH, 0x6000, "CGS-6000" },
{ IPMI_OEM_ADVANTECH, 0x6010, "CGS-6010" },
+
/* ADLINK Technology Inc. */
/* AdvancedTCA Processor Blades */
{ IPMI_OEM_ADLINK_24339, 0x3100, "aTCA-3100" },
@@ -282,38 +269,729 @@ const struct oemvalstr ipmi_oem_product_info[] = {
{ IPMI_OEM_ADLINK_24339, 0x0410, "MXN-0410" },
{ IPMI_OEM_ADLINK_24339, 0x2600, "MCN-2600" },
{ IPMI_OEM_ADLINK_24339, 0x1500, "MCN-1500" },
+ /* Supermicro */
+ { IPMI_OEM_SUPERMICRO, 0x0001, "X8DT3/i/-LN4" },
+ { IPMI_OEM_SUPERMICRO, 0x0002, "C2SLM-OC012" },
+ { IPMI_OEM_SUPERMICRO, 0x0003, "X8DTW-3/i/-LN4" },
+ { IPMI_OEM_SUPERMICRO, 0x0006, "X8DTL-3/i" },
+ { IPMI_OEM_SUPERMICRO, 0x0007, "X8DTT-IBX" },
+ { IPMI_OEM_SUPERMICRO, 0x0008, "X8DTT-B-SG" },
+ { IPMI_OEM_SUPERMICRO, 0x0009, "X8STi-3/-LN4" },
+ { IPMI_OEM_SUPERMICRO, 0x000A, "B8DT3" },
+ { IPMI_OEM_SUPERMICRO, 0x0100, "X8DAH+" },
+ { IPMI_OEM_SUPERMICRO, 0x0101, "B8DTL" },
+ { IPMI_OEM_SUPERMICRO, 0x0400, "X8DTH-6/i" },
+ { IPMI_OEM_SUPERMICRO, 0x0401, "X8DTH-RC014" },
+ { IPMI_OEM_SUPERMICRO, 0x0403, "X8DA6/i-X" },
+ { IPMI_OEM_SUPERMICRO, 0x0404, "X8DT6/E" },
+ { IPMI_OEM_SUPERMICRO, 0x0409, "H8QI6/E(+)(-F)" },
+ { IPMI_OEM_SUPERMICRO, 0x040B, "X8DTW-6+/i+" },
+ { IPMI_OEM_SUPERMICRO, 0x040D, "X8SII/X8SI6" },
+ { IPMI_OEM_SUPERMICRO, 0x0410, "X8DTL-6/L" },
+ { IPMI_OEM_SUPERMICRO, 0x0600, "X8DTU" },
+ { IPMI_OEM_SUPERMICRO, 0x0601, "X8DAL-3/i" },
+ { IPMI_OEM_SUPERMICRO, 0x0602, "X7SLA" },
+ { IPMI_OEM_SUPERMICRO, 0x0603, "C2SEM-Q" },
+ { IPMI_OEM_SUPERMICRO, 0x0604, "winbond IPMI (Aten)" },
+ { IPMI_OEM_SUPERMICRO, 0x0605, "X8SIL" },
+ { IPMI_OEM_SUPERMICRO, 0x0606, "X8DTG-4" },
+ { IPMI_OEM_SUPERMICRO, 0x0607, "C2G41" },
+ { IPMI_OEM_SUPERMICRO, 0x0608, "X8DTG-DF" },
+ { IPMI_OEM_SUPERMICRO, 0x0609, "X8DTS" },
+ { IPMI_OEM_SUPERMICRO, 0x060A, "X7SPA" },
+ { IPMI_OEM_SUPERMICRO, 0x060B, "X8SIA" },
+ { IPMI_OEM_SUPERMICRO, 0x060C, "X8DTU+" },
+ { IPMI_OEM_SUPERMICRO, 0x060C, "X8DTU-LN4F+" },
+ { IPMI_OEM_SUPERMICRO, 0x060D, "X8DTU-6TF+" },
+ { IPMI_OEM_SUPERMICRO, 0x060E, "X8SIT" },
+ { IPMI_OEM_SUPERMICRO, 0x060F, "X8DTN+-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0610, "X8QB6/E" },
+ { IPMI_OEM_SUPERMICRO, 0x0611, "AOC-STGN-I2S" },
+ { IPMI_OEM_SUPERMICRO, 0x0612, "B8DTT" },
+ { IPMI_OEM_SUPERMICRO, 0x0613, "X8DTT-C-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0614, "X8DTU-F-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x061A, "X8SIU" },
+ { IPMI_OEM_SUPERMICRO, 0x061B, "X8DTT-HA" },
+ { IPMI_OEM_SUPERMICRO, 0x061C, "B8DT6-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x061D, "C7SIA" },
+ { IPMI_OEM_SUPERMICRO, 0x061E, "B8DTT-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x061E, "X9SCL" },
+ { IPMI_OEM_SUPERMICRO, 0x061F, "B8DTP" },
+ { IPMI_OEM_SUPERMICRO, 0x0620, "B8DTG" },
+ { IPMI_OEM_SUPERMICRO, 0x0621, "X8OBN" },
+ { IPMI_OEM_SUPERMICRO, 0x0622, "C7P67" },
+ { IPMI_OEM_SUPERMICRO, 0x0623, "C7Q67" },
+ { IPMI_OEM_SUPERMICRO, 0x0624, "X9SCM" },
+ { IPMI_OEM_SUPERMICRO, 0x0625, "B9DRi" },
+ { IPMI_OEM_SUPERMICRO, 0x0626, "X9DR3-LN4F+" },
+ { IPMI_OEM_SUPERMICRO, 0x0627, "X7SPT-DF-D525" },
+ { IPMI_OEM_SUPERMICRO, 0x0628, "X9DR3/i-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0629, "X9SRT-F" },
+ { IPMI_OEM_SUPERMICRO, 0x062A, "X9SRA" },
+ { IPMI_OEM_SUPERMICRO, 0x062B, "X9SRi" },
+ { IPMI_OEM_SUPERMICRO, 0x062C, "X9DAi" },
+ { IPMI_OEM_SUPERMICRO, 0x062D, "X8SIL-SIOM-FI005" },
+ { IPMI_OEM_SUPERMICRO, 0x062E, "X8STE-DS018" },
+ { IPMI_OEM_SUPERMICRO, 0x062F, "X9DRT-HF" },
+ { IPMI_OEM_SUPERMICRO, 0x0630, "X9DRW-3TF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0631, "X9SCA/X9SCI" },
+ { IPMI_OEM_SUPERMICRO, 0x0632, "X8DTG-QF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0633, "X9SCV-Q" },
+ { IPMI_OEM_SUPERMICRO, 0x0634, "X9SCD" },
+ { IPMI_OEM_SUPERMICRO, 0x0635, "X9DAL-6/i" },
+ { IPMI_OEM_SUPERMICRO, 0x0636, "X9DRW-3F" },
+ { IPMI_OEM_SUPERMICRO, 0x0637, "X9DBU-3F" },
+ { IPMI_OEM_SUPERMICRO, 0x0638, "X8QB6-LF" },
+ { IPMI_OEM_SUPERMICRO, 0x0640, "X9SCL/SCM-II" },
+ { IPMI_OEM_SUPERMICRO, 0x0641, "X9SCV-LN4F+" },
+ { IPMI_OEM_SUPERMICRO, 0x0642, "C7Q67-H" },
+ { IPMI_OEM_SUPERMICRO, 0x0644, "X9SAE" },
+ { IPMI_OEM_SUPERMICRO, 0x0645, "C7H61" },
+ { IPMI_OEM_SUPERMICRO, 0x0646, "X9SCFF" },
+ { IPMI_OEM_SUPERMICRO, 0x0647, "X9SCAA" },
+ { IPMI_OEM_SUPERMICRO, 0x0647, "X9SCE-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0648, "C7B75" },
+ { IPMI_OEM_SUPERMICRO, 0x0650, "X9SPV-M4" },
+ { IPMI_OEM_SUPERMICRO, 0x0651, "X9SBAA" },
+ { IPMI_OEM_SUPERMICRO, 0x0652, "AOC-CGP-i2" },
+ { IPMI_OEM_SUPERMICRO, 0x0653, "C7Z87" },
+ { IPMI_OEM_SUPERMICRO, 0x0654, "C7Q87" },
+ { IPMI_OEM_SUPERMICRO, 0x0655, "AOC-XEH-IN2" },
+ { IPMI_OEM_SUPERMICRO, 0x0656, "AOC-SGP-i2" },
+ { IPMI_OEM_SUPERMICRO, 0x0657, "C7Z87-OCE" },
+ { IPMI_OEM_SUPERMICRO, 0x0658, "AOC-STG-B4S" },
+ { IPMI_OEM_SUPERMICRO, 0x0659, "AOC-STGN-I1S" },
+ { IPMI_OEM_SUPERMICRO, 0x0660, "X9DRD-3/iF" },
+ { IPMI_OEM_SUPERMICRO, 0x0661, "B1SA4-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0661, "X9SRG" },
+ { IPMI_OEM_SUPERMICRO, 0x0662, "X9DRG-QF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0663, "X9SRW" },
+ { IPMI_OEM_SUPERMICRO, 0x0664, "X9DRH-7F" },
+ { IPMI_OEM_SUPERMICRO, 0x0665, "X9DRG-QF" },
+ { IPMI_OEM_SUPERMICRO, 0x0666, "X9DRT-D-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0667, "X9DRL-3/iF" },
+ { IPMI_OEM_SUPERMICRO, 0x0668, "X9SRD" },
+ { IPMI_OEM_SUPERMICRO, 0x0669, "X9DRX+-F" },
+ { IPMI_OEM_SUPERMICRO, 0x066A, "B9DRT" },
+ { IPMI_OEM_SUPERMICRO, 0x066B, "X9SRL-F" },
+ { IPMI_OEM_SUPERMICRO, 0x066C, "B9DRG" },
+ { IPMI_OEM_SUPERMICRO, 0x066D, "X9DR6+-F-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x066E, "X9DR6-LN4F+-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x066F, "X9DRW-LN4F+-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x0690, "2208" },
+ { IPMI_OEM_SUPERMICRO, 0x0691, "2308" },
+ { IPMI_OEM_SUPERMICRO, 0x0700, "X9DRT-HF-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x0701, "X9DRT-HIBQF-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x0702, "X9DRD-7LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x0703, "X9DBL-6F" },
+ { IPMI_OEM_SUPERMICRO, 0x0704, "X9DR7/E-TF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0705, "X9DR7/E-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x0706, "X9DRT-HF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0707, "X9QR7-TF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0708, "X9DRT-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0709, "X9DA7/E" },
+ { IPMI_OEM_SUPERMICRO, 0x070A, "X9DRF-F" },
+ { IPMI_OEM_SUPERMICRO, 0x070B, "X9SRL-CF" },
+ { IPMI_OEM_SUPERMICRO, 0x070C, "X9SRD-CD" },
+ { IPMI_OEM_SUPERMICRO, 0x070D, "B9DR7" },
+ { IPMI_OEM_SUPERMICRO, 0x070E, "X9DAX-7" },
+ { IPMI_OEM_SUPERMICRO, 0x070F, "X9QR7-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0710, "X9SRE" },
+ { IPMI_OEM_SUPERMICRO, 0x0711, "X9DRG-HTF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0712, "B9DRG-X" },
+ { IPMI_OEM_SUPERMICRO, 0x0713, "X9DRFF-7" },
+ { IPMI_OEM_SUPERMICRO, 0x0714, "X9SRH-7F" },
+ { IPMI_OEM_SUPERMICRO, 0x0715, "X9DRW-7TPF" },
+ { IPMI_OEM_SUPERMICRO, 0x0716, "X9DBU-3F-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0x0717, "X9DRFF-7+/i+" },
+ { IPMI_OEM_SUPERMICRO, 0x0718, "X9DRFF-7G+" },
+ { IPMI_OEM_SUPERMICRO, 0x0719, "B9DRP" },
+ { IPMI_OEM_SUPERMICRO, 0x0720, "X9DRW-7TPF+" },
+ { IPMI_OEM_SUPERMICRO, 0x0721, "X9DBS-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0722, "X9DB3-TPF" },
+ { IPMI_OEM_SUPERMICRO, 0x0723, "X9DRL-7F/EF" },
+ { IPMI_OEM_SUPERMICRO, 0x0724, "X9DRH-if-NV" },
+ { IPMI_OEM_SUPERMICRO, 0x0725, "X9DRG+HF+II" },
+ { IPMI_OEM_SUPERMICRO, 0x0726, "X10QBi" },
+ { IPMI_OEM_SUPERMICRO, 0x0727, "X9DRW-CF31/CTF31" },
+ { IPMI_OEM_SUPERMICRO, 0x0728, "X10DRI/T" },
+ { IPMI_OEM_SUPERMICRO, 0x0729, "B9DRG-E" },
+ { IPMI_OEM_SUPERMICRO, 0x0730, "X9DAX-HFT" },
+ { IPMI_OEM_SUPERMICRO, 0x0731, "X9DRT-P" },
+ { IPMI_OEM_SUPERMICRO, 0x0732, "X9DRG-OF" },
+ { IPMI_OEM_SUPERMICRO, 0x0733, "X9DB3-CPU-AI026" },
+ { IPMI_OEM_SUPERMICRO, 0x0734, "AOC-STG-I2T" },
+ { IPMI_OEM_SUPERMICRO, 0x0743, "X9SPU" },
+ { IPMI_OEM_SUPERMICRO, 0x0801, "X10SLL" },
+ { IPMI_OEM_SUPERMICRO, 0x0802, "X10SLA" },
+ { IPMI_OEM_SUPERMICRO, 0x0803, "X10SLH" },
+ { IPMI_OEM_SUPERMICRO, 0x0804, "X10SL7-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0805, "X10SAE" },
+ { IPMI_OEM_SUPERMICRO, 0x0806, "X10SLM-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x0807, "X10SLE" },
+ { IPMI_OEM_SUPERMICRO, 0x0808, "LSI3008" },
+ { IPMI_OEM_SUPERMICRO, 0x0809, "LSI3108" },
+ { IPMI_OEM_SUPERMICRO, 0x0810, "X10SLD" },
+ { IPMI_OEM_SUPERMICRO, 0x0811, "X10SLM-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0812, "X10SLL+-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0813, "X10SEAA-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x0814, "X10SLX-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0815, "X10SLV" },
+ { IPMI_OEM_SUPERMICRO, 0x0816, "X10SBA" },
+ { IPMI_OEM_SUPERMICRO, 0x0817, "X10SLE-DF" },
+ { IPMI_OEM_SUPERMICRO, 0x0818, "X10SAT" },
+ { IPMI_OEM_SUPERMICRO, 0x0819, "X10SLV-Q" },
+ { IPMI_OEM_SUPERMICRO, 0x0820, "A1SAM" },
+ { IPMI_OEM_SUPERMICRO, 0x0820, "X9SKV" },
+ { IPMI_OEM_SUPERMICRO, 0x0821, "X10DRW-i(T)" },
+ { IPMI_OEM_SUPERMICRO, 0x0822, "X10DRFF(-C)" },
+ { IPMI_OEM_SUPERMICRO, 0x0823, "AOC-CTG-I1S" },
+ { IPMI_OEM_SUPERMICRO, 0x0824, "X10DRT-P" },
+ { IPMI_OEM_SUPERMICRO, 0x0825, "X10SRE-DS018" },
+ { IPMI_OEM_SUPERMICRO, 0x0826, "X10SRE-EXP-SI030" },
+ { IPMI_OEM_SUPERMICRO, 0x0827, "X9QRH-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0828, "A1SA2-2750F" },
+ { IPMI_OEM_SUPERMICRO, 0x0829, "C7Z97-OCE" },
+ { IPMI_OEM_SUPERMICRO, 0x0830, "X10DRFR" },
+ { IPMI_OEM_SUPERMICRO, 0x0831, "X10DRL-i" },
+ { IPMI_OEM_SUPERMICRO, 0x0832, "X10SRL" },
+ { IPMI_OEM_SUPERMICRO, 0x0833, "X10SRW-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0834, "X10SRI" },
+ { IPMI_OEM_SUPERMICRO, 0x0835, "X10DRC/i-LN4+/T4+" },
+ { IPMI_OEM_SUPERMICRO, 0x0836, "X10DAi" },
+ { IPMI_OEM_SUPERMICRO, 0x0837, "X10DRT-D-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0838, "X10SRH-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0839, "AOC-SLG3-2E4" },
+ { IPMI_OEM_SUPERMICRO, 0x083A, "X10DBT-T" },
+ { IPMI_OEM_SUPERMICRO, 0x083B, "X10DDW-iT" },
+ { IPMI_OEM_SUPERMICRO, 0x083C, "A1SA7-2750F" },
+ { IPMI_OEM_SUPERMICRO, 0x083D, "LSI 2116" },
+ { IPMI_OEM_SUPERMICRO, 0x083E, "B10DRi" },
+ { IPMI_OEM_SUPERMICRO, 0x083F, "B9QR7" },
+ { IPMI_OEM_SUPERMICRO, 0x0840, "B9DRG-3M" },
+ { IPMI_OEM_SUPERMICRO, 0x0841, "X9DRD-iT+" },
+ { IPMI_OEM_SUPERMICRO, 0x0842, "X10SLH-N6-ST031" },
+ { IPMI_OEM_SUPERMICRO, 0x0843, "X10DRG-H(T)" },
+ { IPMI_OEM_SUPERMICRO, 0x0844, "X10DRU-i+" },
+ { IPMI_OEM_SUPERMICRO, 0x0845, "X10DDW-iN" },
+ { IPMI_OEM_SUPERMICRO, 0x0846, "B1DRi" },
+ { IPMI_OEM_SUPERMICRO, 0x0847, "AOC-UR-i4XT" },
+ { IPMI_OEM_SUPERMICRO, 0x0848, "AOC-2UR68-i4G" },
+ { IPMI_OEM_SUPERMICRO, 0x0849, "AOC-UR-i4G" },
+ { IPMI_OEM_SUPERMICRO, 0x084A, "AOC-S40G-i2Q" },
+ { IPMI_OEM_SUPERMICRO, 0x084B, "X10SRG" },
+ { IPMI_OEM_SUPERMICRO, 0x084C, "C7Z97" },
+ { IPMI_OEM_SUPERMICRO, 0x084C, "C7Z97-MF" },
+ { IPMI_OEM_SUPERMICRO, 0x084D, "AOC-STGN-i1SF" },
+ { IPMI_OEM_SUPERMICRO, 0x084F, "AOC-STGN-i2SF" },
+ { IPMI_OEM_SUPERMICRO, 0x0850, "AOC-PG-i4M" },
+ { IPMI_OEM_SUPERMICRO, 0x0851, "PMC PM8076" },
+ { IPMI_OEM_SUPERMICRO, 0x0852, "X10DRG-Q" },
+ { IPMI_OEM_SUPERMICRO, 0x0853, "X10QBL" },
+ { IPMI_OEM_SUPERMICRO, 0x0854, "X10DRU-X" },
+ { IPMI_OEM_SUPERMICRO, 0x0855, "H9SKV-420" },
+ { IPMI_OEM_SUPERMICRO, 0x0856, "C7X99" },
+ { IPMI_OEM_SUPERMICRO, 0x0857, "X10SRA" },
+ { IPMI_OEM_SUPERMICRO, 0x0858, "X10DRT-H" },
+ { IPMI_OEM_SUPERMICRO, 0x0859, "X10DRH-C" },
+ { IPMI_OEM_SUPERMICRO, 0x085A, "A1SRM-LN7F" },
+ { IPMI_OEM_SUPERMICRO, 0x085A, "A1SRM-LN7F" },
+ { IPMI_OEM_SUPERMICRO, 0x085B, "X10DRT-HA/HB-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x085C, "X10DRU-XLL" },
+ { IPMI_OEM_SUPERMICRO, 0x085D, "AOC-UR-i2XT" },
+ { IPMI_OEM_SUPERMICRO, 0x085E, "AOC-2UR6-i4XT" },
+ { IPMI_OEM_SUPERMICRO, 0x085F, "AOC-2UR68-i2XT" },
+ { IPMI_OEM_SUPERMICRO, 0x0860, "X10DRL-C/CT" },
+ { IPMI_OEM_SUPERMICRO, 0x0861, "B10DRT" },
+ { IPMI_OEM_SUPERMICRO, 0x0862, "B1SL1-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0863, "RSC-W2-66" },
+ { IPMI_OEM_SUPERMICRO, 0x0864, "X10DRW-E/NT" },
+ { IPMI_OEM_SUPERMICRO, 0x0865, "X10DRD-i/LTP" },
+ { IPMI_OEM_SUPERMICRO, 0x0866, "AOC-SLG3-2E4R" },
+ { IPMI_OEM_SUPERMICRO, 0x0867, "AOC-SLG3-4E4R" },
+ { IPMI_OEM_SUPERMICRO, 0x0868, "AOC-SLG3-2E4" },
+ { IPMI_OEM_SUPERMICRO, 0x0869, "AOC-URN2-i4XT" },
+ { IPMI_OEM_SUPERMICRO, 0x086A, "AOC-URN2-i2XT" },
+ { IPMI_OEM_SUPERMICRO, 0x086B, "X10DRS" },
+ { IPMI_OEM_SUPERMICRO, 0x086C, "X10DAL-i" },
+ { IPMI_OEM_SUPERMICRO, 0x086D, "X10SDV-TLN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x086E, "X10DDW-iN" },
+ { IPMI_OEM_SUPERMICRO, 0x086F, "X10DRT-L" },
+ { IPMI_OEM_SUPERMICRO, 0x0870, "AOC-URN2-ii2SX" },
+ { IPMI_OEM_SUPERMICRO, 0x0871, "AOC-2UR68-i2XS" },
+ { IPMI_OEM_SUPERMICRO, 0x0872, "X10QRH+" },
+ { IPMI_OEM_SUPERMICRO, 0x0873, "AOC-2URN4-i4XT" },
+ { IPMI_OEM_SUPERMICRO, 0x0874, "AOC-2UR8N4-i2XT" },
+ { IPMI_OEM_SUPERMICRO, 0x0875, "AOC-2UR66-i4G" },
+ { IPMI_OEM_SUPERMICRO, 0x0876, "A2SCL-IN001" },
+ { IPMI_OEM_SUPERMICRO, 0x0877, "X10DRT-HB-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0878, "RSC-S2-88" },
+ { IPMI_OEM_SUPERMICRO, 0x0879, "X10DRD-I/L/NT" },
+ { IPMI_OEM_SUPERMICRO, 0x087A, "B1SD2-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x087B, "AOC-XEH-i2M" },
+ { IPMI_OEM_SUPERMICRO, 0x087C, "AOC-XEH-i4M" },
+ { IPMI_OEM_SUPERMICRO, 0x087D, "X10SRD-F" },
+ { IPMI_OEM_SUPERMICRO, 0x087E, "AOC-STG-i4S" },
+ { IPMI_OEM_SUPERMICRO, 0x087F, "X10DRFF-iG" },
+ { IPMI_OEM_SUPERMICRO, 0x0880, "X10DRT-XA-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0881, "X10DRT-XB-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0882, "X10DRX" },
+ { IPMI_OEM_SUPERMICRO, 0x0883, "K1SPI" },
+ { IPMI_OEM_SUPERMICRO, 0x0884, "X11SSH-F/-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x0885, "X11SSL-CF/-NF" },
+ { IPMI_OEM_SUPERMICRO, 0x0886, "X11SSA(-F)/X11SSi-LN4(F)" },
+ { IPMI_OEM_SUPERMICRO, 0x0887, "AOC-S8076L-L16e" },
+ { IPMI_OEM_SUPERMICRO, 0x0888, "X11SSZ" },
+ { IPMI_OEM_SUPERMICRO, 0x0889, "B10DRG" },
+ { IPMI_OEM_SUPERMICRO, 0x088A, "AOC-URN6-i2XT" },
+ { IPMI_OEM_SUPERMICRO, 0x088B, "C7Z170-SQ" },
+ { IPMI_OEM_SUPERMICRO, 0x088C, "AOM-S3108-H8S-SB" },
+ { IPMI_OEM_SUPERMICRO, 0x088D, "AOC-S100G-i2C" },
+ { IPMI_OEM_SUPERMICRO, 0x088E, "AOC-PIO-i2G" },
+ { IPMI_OEM_SUPERMICRO, 0x088F, "AOM-PIO-i2XT" },
+ { IPMI_OEM_SUPERMICRO, 0x0890, "X11SSQ" },
+ { IPMI_OEM_SUPERMICRO, 0x0891, "X11SBA" },
+ { IPMI_OEM_SUPERMICRO, 0x0892, "X10DRG-O+-CPU" },
+ { IPMI_OEM_SUPERMICRO, 0x0893, "X10DGQ" },
+ { IPMI_OEM_SUPERMICRO, 0x0894, "X11SSV-Q" },
+ { IPMI_OEM_SUPERMICRO, 0x0895, "X11SAE" },
+ { IPMI_OEM_SUPERMICRO, 0x0896, "X11SSL/M-F" },
+ { IPMI_OEM_SUPERMICRO, 0x0897, "B1SD1-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0898, "X11SSE" },
+ { IPMI_OEM_SUPERMICRO, 0x0899, "X10DRH" },
+ { IPMI_OEM_SUPERMICRO, 0x089A, "X11SLL" },
+ { IPMI_OEM_SUPERMICRO, 0x089B, "X11SSW-F" },
+ { IPMI_OEM_SUPERMICRO, 0x089C, "X11SSH-CTF" },
+ { IPMI_OEM_SUPERMICRO, 0x089D, "X10DSC+" },
+ { IPMI_OEM_SUPERMICRO, 0x089E, "AOC-URN2-i4GXS" },
+ { IPMI_OEM_SUPERMICRO, 0x089F, "X11SAE-M" },
+ { IPMI_OEM_SUPERMICRO, 0x0901, "X11SSM" },
+ { IPMI_OEM_SUPERMICRO, 0x0902, "C7Z170-OCE" },
+ { IPMI_OEM_SUPERMICRO, 0x0903, "AOC-CTGS-i2T" },
+ { IPMI_OEM_SUPERMICRO, 0x0904, "AOC-2UR6N4-i4XT" },
+ { IPMI_OEM_SUPERMICRO, 0x0905, "K1SPI-KA-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0906, "K1SPi-KB-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x0907, "X11SAT(-F)" },
+ { IPMI_OEM_SUPERMICRO, 0x0908, "B2SS2" },
+ { IPMI_OEM_SUPERMICRO, 0x0909, "X11SSD-F" },
+ { IPMI_OEM_SUPERMICRO, 0x090A, "AOC-SLG3-4E4" },
+ { IPMI_OEM_SUPERMICRO, 0x090B, "AOC-MTG-i4S" },
+ { IPMI_OEM_SUPERMICRO, 0x090C, "AOC-MTG-I2s" },
+ { IPMI_OEM_SUPERMICRO, 0x090D, "X11SRE-DS018" },
+ { IPMI_OEM_SUPERMICRO, 0x090E, "K1SPE(-T)" },
+ { IPMI_OEM_SUPERMICRO, 0x090F, "A2SDi" },
+ { IPMI_OEM_SUPERMICRO, 0x0910, "A2SDi-H" },
+ { IPMI_OEM_SUPERMICRO, 0x0911, "X10DRT-PS" },
+ { IPMI_OEM_SUPERMICRO, 0x0912, "AOC-MG-i2" },
+ { IPMI_OEM_SUPERMICRO, 0x0913, "AOC-MG-i4" },
+ { IPMI_OEM_SUPERMICRO, 0x0914, "AOC-STGS-i1T" },
+ { IPMI_OEM_SUPERMICRO, 0x0915, "AOC-STGS-i2T" },
+ { IPMI_OEM_SUPERMICRO, 0x0916, "X10DSC-TP4S" },
+ { IPMI_OEM_SUPERMICRO, 0x0917, "X11DPi-N(T)" },
+ { IPMI_OEM_SUPERMICRO, 0x0918, "AOC-UR-i4GXS" },
+ { IPMI_OEM_SUPERMICRO, 0x0919, "X10SDD-F" },
+ { IPMI_OEM_SUPERMICRO, 0x091A, "AOC-2UR6-i4xT+" },
+ { IPMI_OEM_SUPERMICRO, 0x091B, "AOC-UR-i4XT+" },
+ { IPMI_OEM_SUPERMICRO, 0x091C, "X11DPU" },
+ { IPMI_OEM_SUPERMICRO, 0x091D, "X11SSW-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x091E, "X10SD7-AC107" },
+ { IPMI_OEM_SUPERMICRO, 0x091F, "AOC-MTG-i4T" },
+ { IPMI_OEM_SUPERMICRO, 0x0920, "AOC-MTG-i2T" },
+ { IPMI_OEM_SUPERMICRO, 0x0921, "X10SDV-7TP8F" },
+ { IPMI_OEM_SUPERMICRO, 0x0922, "X10SRW-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x0923, "AOM-X10OBI-PCH" },
+ { IPMI_OEM_SUPERMICRO, 0x0924, "X10SRM-(T)F" },
+ { IPMI_OEM_SUPERMICRO, 0x0925, "AOC-MHIBF-2QG" },
+ { IPMI_OEM_SUPERMICRO, 0x0926, "AOC-MHIBF-1QG" },
+ { IPMI_OEM_SUPERMICRO, 0x0927, "X11DPT-PS" },
+ { IPMI_OEM_SUPERMICRO, 0x0928, "AOC-S25G-b2S" },
+ { IPMI_OEM_SUPERMICRO, 0x0929, "AOC-2UR66-i4XTF" },
+ { IPMI_OEM_SUPERMICRO, 0x092A, "AOC-M25G-b2S" },
+ { IPMI_OEM_SUPERMICRO, 0x092B, "X10DSN-TS" },
+ { IPMI_OEM_SUPERMICRO, 0x092C, "AOC-S8069L-16xR" },
+ { IPMI_OEM_SUPERMICRO, 0x092D, "X10SDE-DF" },
+ { IPMI_OEM_SUPERMICRO, 0x092E, "AOC-2UR68-B2TS" },
+ { IPMI_OEM_SUPERMICRO, 0x092F, "AOC-S40G-i1Q" },
+ { IPMI_OEM_SUPERMICRO, 0x0930, "X11SSQ-L" },
+ { IPMI_OEM_SUPERMICRO, 0x0931, "B2SS1-CF" },
+ { IPMI_OEM_SUPERMICRO, 0x0932, "X10DRL-LN4" },
+ { IPMI_OEM_SUPERMICRO, 0x0933, "P8DTU" },
+ { IPMI_OEM_SUPERMICRO, 0x0934, "AOC-MHFI-i1C" },
+ { IPMI_OEM_SUPERMICRO, 0x0935, "AOC-STG-i4T" },
+ { IPMI_OEM_SUPERMICRO, 0x0936, "AOC-UR-i4XTF" },
+ { IPMI_OEM_SUPERMICRO, 0x0937, "X11DPT" },
+ { IPMI_OEM_SUPERMICRO, 0x0938, "X11DPT" },
+ { IPMI_OEM_SUPERMICRO, 0x0939, "X11SSV-M4" },
+ { IPMI_OEM_SUPERMICRO, 0x093A, "X11SSV-M4F" },
+ { IPMI_OEM_SUPERMICRO, 0x093B, "AOC-STGF-i2S" },
+ { IPMI_OEM_SUPERMICRO, 0x093C, "A2SAV" },
+ { IPMI_OEM_SUPERMICRO, 0x093D, "AOC-S3216L-L16iT" },
+ { IPMI_OEM_SUPERMICRO, 0x093E, "X10DRT-B+" },
+ { IPMI_OEM_SUPERMICRO, 0x093F, "C7Z270-CG-L" },
+ { IPMI_OEM_SUPERMICRO, 0x0940, "C7Z270-CG" },
+ { IPMI_OEM_SUPERMICRO, 0x0941, "X11SPi-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0942, "K1SPE" },
+ { IPMI_OEM_SUPERMICRO, 0x0943, "C7Z270-PG" },
+ { IPMI_OEM_SUPERMICRO, 0x0944, "C7H270-CG-ML" },
+ { IPMI_OEM_SUPERMICRO, 0x0945, "C7Q270-CB-ML" },
+ { IPMI_OEM_SUPERMICRO, 0x0946, "X10SDV" },
+ { IPMI_OEM_SUPERMICRO, 0x0947, "A2SAN" },
+ { IPMI_OEM_SUPERMICRO, 0x0948, "AOC-C25G-m2S" },
+ { IPMI_OEM_SUPERMICRO, 0x0949, "AOC-MH25G-m2S2T" },
+ { IPMI_OEM_SUPERMICRO, 0x094A, "AOC-2UR68-m2TS" },
+ { IPMI_OEM_SUPERMICRO, 0x094B, "AOC-S100G-m2C" },
+ { IPMI_OEM_SUPERMICRO, 0x094C, "AOC-S25G-m2S" },
+ { IPMI_OEM_SUPERMICRO, 0x094D, "AOC-MHIBF" },
+ { IPMI_OEM_SUPERMICRO, 0x094E, "AOC-MH25G-b2S2G" },
+ { IPMI_OEM_SUPERMICRO, 0x094F, "P8DNU" },
+ { IPMI_OEM_SUPERMICRO, 0x0950, "X10DRW-SE" },
+ { IPMI_OEM_SUPERMICRO, 0x0951, "B2SS1(2)-MTF" },
+ { IPMI_OEM_SUPERMICRO, 0x0952, "X11SPX-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0953, "X11SPW-(c)TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0954, "AOC-C25G-m1S" },
+ { IPMI_OEM_SUPERMICRO, 0x0955, "X11SSW" },
+ { IPMI_OEM_SUPERMICRO, 0x0956, "AOC-MHIBF-m1Q2G" },
+ { IPMI_OEM_SUPERMICRO, 0x0957, "AOC-MHIBF-m2Q2G" },
+ { IPMI_OEM_SUPERMICRO, 0x0958, "X11SSH" },
+ { IPMI_OEM_SUPERMICRO, 0x0959, "R10SR2" },
+ { IPMI_OEM_SUPERMICRO, 0x095A, "X10DGO" },
+ { IPMI_OEM_SUPERMICRO, 0x095B, "X11DPU-XLL" },
+ { IPMI_OEM_SUPERMICRO, 0x095C, "X11DPU-X" },
+ { IPMI_OEM_SUPERMICRO, 0x095D, "X11SPM-T(P)F" },
+ { IPMI_OEM_SUPERMICRO, 0x095E, "X11SPH-NCTPF" },
+ { IPMI_OEM_SUPERMICRO, 0x095F, "X11SAA" },
+ { IPMI_OEM_SUPERMICRO, 0x0960, "X11SAN" },
+ { IPMI_OEM_SUPERMICRO, 0x0961, "P9DSC" },
+ { IPMI_OEM_SUPERMICRO, 0x0962, "X11DPT-B+" },
+ { IPMI_OEM_SUPERMICRO, 0x0963, "H11DSU-i" },
+ { IPMI_OEM_SUPERMICRO, 0x0964, "H11DSi-NT" },
+ { IPMI_OEM_SUPERMICRO, 0x0965, "C7B250-CB-ML" },
+ { IPMI_OEM_SUPERMICRO, 0x0966, "B11DPT" },
+ { IPMI_OEM_SUPERMICRO, 0x0967, "X11DDW" },
+ { IPMI_OEM_SUPERMICRO, 0x0968, "X11DPL-i" },
+ { IPMI_OEM_SUPERMICRO, 0x0969, "A2SDi-HLN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x096A, "C7C232-CB-ML" },
+ { IPMI_OEM_SUPERMICRO, 0x096B, "X11DPT-P-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0x096C, "X11DPU-Z+" },
+ { IPMI_OEM_SUPERMICRO, 0x096D, "X11DPG-Qt" },
+ { IPMI_OEM_SUPERMICRO, 0x096E, "X11SPL-F" },
+ { IPMI_OEM_SUPERMICRO, 0x096F, "AOC-IBH-X4ED" },
+ { IPMI_OEM_SUPERMICRO, 0x0970, "C7Z270-CG-M" },
+ { IPMI_OEM_SUPERMICRO, 0x0971, "X11SRE-EXP-SI030" },
+ { IPMI_OEM_SUPERMICRO, 0x0972, "SAS3216" },
+ { IPMI_OEM_SUPERMICRO, 0x0973, "SAS3508" },
+ { IPMI_OEM_SUPERMICRO, 0x0974, "SAS3516" },
+ { IPMI_OEM_SUPERMICRO, 0x0975, "SAS3316" },
+ { IPMI_OEM_SUPERMICRO, 0x0976, "SAS3324" },
+ { IPMI_OEM_SUPERMICRO, 0x0977, "X11DPFR-SN" },
+ { IPMI_OEM_SUPERMICRO, 0x0978, "AOC-S25G-i2S" },
+ { IPMI_OEM_SUPERMICRO, 0x0979, "BMB-IBD-E3616" },
+ { IPMI_OEM_SUPERMICRO, 0x097A, "X11DAI-N" },
+ { IPMI_OEM_SUPERMICRO, 0x097B, "C7X299" },
+ { IPMI_OEM_SUPERMICRO, 0x097C, "AOC-IBH_X4ES" },
+ { IPMI_OEM_SUPERMICRO, 0x097D, "C7B250-CB-i" },
+ { IPMI_OEM_SUPERMICRO, 0x097E, "X11SPG-F" },
+ { IPMI_OEM_SUPERMICRO, 0x097F, "X11QPH+" },
+ { IPMI_OEM_SUPERMICRO, 0x0980, "X11OPi" },
+ { IPMI_OEM_SUPERMICRO, 0x0981, "X11DPH-i" },
+ { IPMI_OEM_SUPERMICRO, 0x0982, "A2SDV-TLN5F" },
+ { IPMI_OEM_SUPERMICRO, 0x0983, "AOC-M25G-m4S" },
+ { IPMI_OEM_SUPERMICRO, 0x0984, "X11SRM-(V)F" },
+ { IPMI_OEM_SUPERMICRO, 0x0985, "P9DSU-C" },
+ { IPMI_OEM_SUPERMICRO, 0x0986, "X11SDV" },
+ { IPMI_OEM_SUPERMICRO, 0x0987, "X11SDV-TLN2F" },
+ { IPMI_OEM_SUPERMICRO, 0x0988, "X11DGQ" },
+ { IPMI_OEM_SUPERMICRO, 0x0989, "B10DRE" },
+ { IPMI_OEM_SUPERMICRO, 0x098A, "H11DST-B" },
+ { IPMI_OEM_SUPERMICRO, 0x098B, "X11SSN" },
+ { IPMI_OEM_SUPERMICRO, 0x098C, "X11DPX-T" },
+ { IPMI_OEM_SUPERMICRO, 0x098D, "A2SAP-H/E/L" },
+ { IPMI_OEM_SUPERMICRO, 0x098E, "X11SRA-R/F" },
+ { IPMI_OEM_SUPERMICRO, 0x098F, "B11QPi" },
+ { IPMI_OEM_SUPERMICRO, 0x0991, "C7Z370-CG-L" },
+ { IPMI_OEM_SUPERMICRO, 0x0992, "B11SPi-CPU-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x0993, "AOC-URN4-i2TS" },
+ { IPMI_OEM_SUPERMICRO, 0x0994, "AOC-B25G-M2S" },
+ { IPMI_OEM_SUPERMICRO, 0x0995, "X11DPG-SN" },
+ { IPMI_OEM_SUPERMICRO, 0x0996, "AOC-MTG-b2T" },
+ { IPMI_OEM_SUPERMICRO, 0x0997, "B11DPE" },
+ { IPMI_OEM_SUPERMICRO, 0x0998, "C7Z370-CG-iW" },
+ { IPMI_OEM_SUPERMICRO, 0x0999, "AOC-MHIBE-m1CG" },
+ { IPMI_OEM_SUPERMICRO, 0x099A, "X11DPS-R" },
+ { IPMI_OEM_SUPERMICRO, 0x099B, "AOC-OPH-WFR" },
+ { IPMI_OEM_SUPERMICRO, 0x099C, "SAS 3616" },
+ { IPMI_OEM_SUPERMICRO, 0x099C, "SAS 3616" },
+ { IPMI_OEM_SUPERMICRO, 0x099D, "X11DSC+" },
+ { IPMI_OEM_SUPERMICRO, 0x099E, "C7Z390-PGW" },
+ { IPMI_OEM_SUPERMICRO, 0x099F, "C7Z390-CG-IW" },
+ { IPMI_OEM_SUPERMICRO, 0x1111, "H8DCR-3" },
+ { IPMI_OEM_SUPERMICRO, 0x1211, "H8DC8" },
+ { IPMI_OEM_SUPERMICRO, 0x1311, "H8QM8-2" },
+ { IPMI_OEM_SUPERMICRO, 0x1411, "H8DA8-2" },
+ { IPMI_OEM_SUPERMICRO, 0x1511, "H8DMR-82" },
+ { IPMI_OEM_SUPERMICRO, 0x1611, "H8DM8-2" },
+ { IPMI_OEM_SUPERMICRO, 0x1711, "H8SMI-2" },
+ { IPMI_OEM_SUPERMICRO, 0x1811, "H8SSL-I2" },
+ { IPMI_OEM_SUPERMICRO, 0x1911, "H8DMU" },
+ { IPMI_OEM_SUPERMICRO, 0x1A01, "C7B360-CB-M" },
+ { IPMI_OEM_SUPERMICRO, 0x1A02, "C7C242-CB-M" },
+ { IPMI_OEM_SUPERMICRO, 0x1A03, "H11SSL-i/c/nc" },
+ { IPMI_OEM_SUPERMICRO, 0x1A04, "B10KNM" },
+ { IPMI_OEM_SUPERMICRO, 0x1A05, "AOM-M25G-i2S" },
+ { IPMI_OEM_SUPERMICRO, 0x1A06, "X11DPG-OT-CPU" },
+ { IPMI_OEM_SUPERMICRO, 0x1A07, "B11SPE-CPU-TF/25G" },
+ { IPMI_OEM_SUPERMICRO, 0x1A08, "AOC-STG-b2T" },
+ { IPMI_OEM_SUPERMICRO, 0x1A09, "AOC-URN4-b2XT" },
+ { IPMI_OEM_SUPERMICRO, 0x1A1A, "A2SD1-3750F/3955F" },
+ { IPMI_OEM_SUPERMICRO, 0x1A1B, "X11SCE-F" },
+ { IPMI_OEM_SUPERMICRO, 0x1A1C, "X11DSF" },
+ { IPMI_OEM_SUPERMICRO, 0x1A1D, "X11SCA-F/W" },
+ { IPMI_OEM_SUPERMICRO, 0x1A1E, "X11DAC" },
+ { IPMI_OEM_SUPERMICRO, 0x1A1F, "X11SCL-F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B01, "X11DSN-TS" },
+ { IPMI_OEM_SUPERMICRO, 0x1B02, "X11DGO-T" },
+ { IPMI_OEM_SUPERMICRO, 0x1B03, "AOC-2UR688-i4XTF" },
+ { IPMI_OEM_SUPERMICRO, 0x1B04, "X11DPT-LC019" },
+ { IPMI_OEM_SUPERMICRO, 0x1B05, "X11SCQ" },
+ { IPMI_OEM_SUPERMICRO, 0x1B06, "X11SCQ-L" },
+ { IPMI_OEM_SUPERMICRO, 0x1B07, "X11SCW-F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B08, "C9X299-PG300" },
+ { IPMI_OEM_SUPERMICRO, 0x1B09, "X11SCZ-F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B0A, "B10DRT-IBF2" },
+ { IPMI_OEM_SUPERMICRO, 0x1B0B, "AOC-STG-b2T" },
+ { IPMI_OEM_SUPERMICRO, 0x1B0C, "AOC-B25G-6X4D" },
+ { IPMI_OEM_SUPERMICRO, 0x1B0D, "X11SCV-Q/L" },
+ { IPMI_OEM_SUPERMICRO, 0x1B0E, "X11SCL-IF" },
+ { IPMI_OEM_SUPERMICRO, 0x1B0F, "X11SCM" },
+ { IPMI_OEM_SUPERMICRO, 0x1B10, "A2SDV-LN8F/LN10PF" },
+ { IPMI_OEM_SUPERMICRO, 0x1B11, "X11SCH-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B12, "AOC-SGP-i4" },
+ { IPMI_OEM_SUPERMICRO, 0x1B13, "AOC-4UR66-i4XTF" },
+ { IPMI_OEM_SUPERMICRO, 0x1B14, "C9X299-PG300F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B15, "X11SCL-LN4F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B16, "AOM-PICO-3L" },
+ { IPMI_OEM_SUPERMICRO, 0x1B17, "X11DPFF-SN" },
+ { IPMI_OEM_SUPERMICRO, 0x1B18, "C7B360-CB-ML" },
+ { IPMI_OEM_SUPERMICRO, 0x1B19, "H11SSW-NT/iN" },
+ { IPMI_OEM_SUPERMICRO, 0x1B1A, "C9Z390-CG(W)" },
+ { IPMI_OEM_SUPERMICRO, 0x1B1B, "AOC-CTG-i2S" },
+ { IPMI_OEM_SUPERMICRO, 0x1B1C, "X11SDD" },
+ { IPMI_OEM_SUPERMICRO, 0x1B1D, "X11DPT-L" },
+ { IPMI_OEM_SUPERMICRO, 0x1B1E, "AOC-URN4-B2ts" },
+ { IPMI_OEM_SUPERMICRO, 0x1B1F, "X11DPG-HGX2" },
+ { IPMI_OEM_SUPERMICRO, 0x1B20, "AOC-SLG2-2TM2" },
+ { IPMI_OEM_SUPERMICRO, 0x1B21, "AOC-SLG2-4TM2" },
+ { IPMI_OEM_SUPERMICRO, 0x1B22, "AOC-SMG2-2TM2" },
+ { IPMI_OEM_SUPERMICRO, 0x1B23, "RSC-UM2R-8+-NI22" },
+ { IPMI_OEM_SUPERMICRO, 0x1B24, "BPN-6S3008S6" },
+ { IPMI_OEM_SUPERMICRO, 0x1B25, "X11DPU-ZE+" },
+ { IPMI_OEM_SUPERMICRO, 0x1B26, "AOC-2UR68-b2TS" },
+ { IPMI_OEM_SUPERMICRO, 0x1B27, "AOC-S100G-b1C" },
+ { IPMI_OEM_SUPERMICRO, 0x1B28, "X11SPA-TF" },
+ { IPMI_OEM_SUPERMICRO, 0x1B29, "B2SC1" },
+ { IPMI_OEM_SUPERMICRO, 0x1B2A, "AOC-2MG-i8" },
+ { IPMI_OEM_SUPERMICRO, 0x1B2B, "H12SSW-iN" },
+ { IPMI_OEM_SUPERMICRO, 0x1B2C, "H12SSW-NT" },
+ { IPMI_OEM_SUPERMICRO, 0x1B2D, "M11SDV" },
+ { IPMI_OEM_SUPERMICRO, 0x1B2E, "AOC-MG-b2" },
+ { IPMI_OEM_SUPERMICRO, 0x1B2F, "AOM-SMF-TP4F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B31, "AOC-M25G-m2S" },
+ { IPMI_OEM_SUPERMICRO, 0x1B32, "B11SRE-CPU" },
+ { IPMI_OEM_SUPERMICRO, 0x1B33, "B11SRE" },
+ { IPMI_OEM_SUPERMICRO, 0x1B34, "X11SPA-T" },
+ { IPMI_OEM_SUPERMICRO, 0x1B35, "X11SDW" },
+ { IPMI_OEM_SUPERMICRO, 0x1B36, "X11SCD-F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B37, "X11DPU-V" },
+ { IPMI_OEM_SUPERMICRO, 0x1B38, "X11DPT-BV" },
+ { IPMI_OEM_SUPERMICRO, 0x1B39, "B11SCG-ZTF" },
+ { IPMI_OEM_SUPERMICRO, 0x1B3A, "H12DST-B" },
+ { IPMI_OEM_SUPERMICRO, 0x1B3B, "X11SDS-8C" },
+ { IPMI_OEM_SUPERMICRO, 0x1B3C, "AOM-SDW-B16X2" },
+ { IPMI_OEM_SUPERMICRO, 0x1B3D, "B11SCG-CTF" },
+ { IPMI_OEM_SUPERMICRO, 0x1B3E, "AOC-S100G-b2C" },
+ { IPMI_OEM_SUPERMICRO, 0x1B3F, "X11SPD-F" },
+ { IPMI_OEM_SUPERMICRO, 0x1B41, "X11SRL-F" },
+ { IPMI_OEM_SUPERMICRO, 0x2011, "H8SMU" },
+ { IPMI_OEM_SUPERMICRO, 0x2111, "M8QME" },
+ { IPMI_OEM_SUPERMICRO, 0x2211, "H8DMT" },
+ { IPMI_OEM_SUPERMICRO, 0x2311, "BHDME" },
+ { IPMI_OEM_SUPERMICRO, 0x2411, "H8DMT-IBX" },
+ { IPMI_OEM_SUPERMICRO, 0x2511, "H8DME-2-LS006" },
+ { IPMI_OEM_SUPERMICRO, 0x8080, "X7DB8" },
+ { IPMI_OEM_SUPERMICRO, 0x8180, "X7DA8" },
+ { IPMI_OEM_SUPERMICRO, 0x8280, "PDSMI-LN4" },
+ { IPMI_OEM_SUPERMICRO, 0x8380, "X7DBP-X" },
+ { IPMI_OEM_SUPERMICRO, 0x8480, "X7DBR-8+" },
+ { IPMI_OEM_SUPERMICRO, 0x8580, "PDSML" },
+ { IPMI_OEM_SUPERMICRO, 0x8680, "X7DVL" },
+ { IPMI_OEM_SUPERMICRO, 0x8780, "PDSBA" },
+ { IPMI_OEM_SUPERMICRO, 0x8880, "X7DBX" },
+ { IPMI_OEM_SUPERMICRO, 0x8980, "X7DBP-8" },
+ { IPMI_OEM_SUPERMICRO, 0x9080, "X7DB8-X" },
+ { IPMI_OEM_SUPERMICRO, 0x9180, "PDSME+" },
+ { IPMI_OEM_SUPERMICRO, 0x9280, "X7DBR-3" },
+ { IPMI_OEM_SUPERMICRO, 0x9380, "PDSLM" },
+ { IPMI_OEM_SUPERMICRO, 0x9480, "X7DAL-E" },
+ { IPMI_OEM_SUPERMICRO, 0x9580, "X6QT8" },
+ { IPMI_OEM_SUPERMICRO, 0x9680, "X7DBN" },
+ { IPMI_OEM_SUPERMICRO, 0x9780, "X7DBU" },
+ { IPMI_OEM_SUPERMICRO, 0x9880, "PDSMU+" },
+ { IPMI_OEM_SUPERMICRO, 0x9980, "X7DBT" },
+ { IPMI_OEM_SUPERMICRO, 0xA011, "H8DM3-2" },
+ { IPMI_OEM_SUPERMICRO, 0xA080, "X7DVL-3" },
+ { IPMI_OEM_SUPERMICRO, 0xA111, "H8DA3-2" },
+ { IPMI_OEM_SUPERMICRO, 0xA211, "H8QM3-2" },
+ { IPMI_OEM_SUPERMICRO, 0xA280, "X7DW3+" },
+ { IPMI_OEM_SUPERMICRO, 0xA311, "H8QM3-EX" },
+ { IPMI_OEM_SUPERMICRO, 0xA380, "X7QC3" },
+ { IPMI_OEM_SUPERMICRO, 0xA480, "X7DCL-3" },
+ { IPMI_OEM_SUPERMICRO, 0xA511, "H8DI3+" },
+ { IPMI_OEM_SUPERMICRO, 0xA580, "AOC-USAS-L8I" },
+ { IPMI_OEM_SUPERMICRO, 0xA611, "BHQIE" },
+ { IPMI_OEM_SUPERMICRO, 0xA680, "X7DCA-3/i" },
+ { IPMI_OEM_SUPERMICRO, 0xA711, "H8SGL" },
+ { IPMI_OEM_SUPERMICRO, 0xA780, "B7DC3" },
+ { IPMI_OEM_SUPERMICRO, 0xA811, "H8DGU" },
+ { IPMI_OEM_SUPERMICRO, 0xA811, "H8DGU" },
+ { IPMI_OEM_SUPERMICRO, 0xA880, "X8DA3/i" },
+ { IPMI_OEM_SUPERMICRO, 0xA911, "H8DGG-QF" },
+ { IPMI_OEM_SUPERMICRO, 0xA980, "X7SB3" },
+ { IPMI_OEM_SUPERMICRO, 0xAA11, "H8DGT" },
+ { IPMI_OEM_SUPERMICRO, 0xAA80, "X7DWT-C-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0xAA80, "X7SBL-LN1/LN2" },
+ { IPMI_OEM_SUPERMICRO, 0xAB11, "H8QG6" },
+ { IPMI_OEM_SUPERMICRO, 0xAB80, "C2SBM-Q" },
+ { IPMI_OEM_SUPERMICRO, 0xAC11, "H8DGU-LN4" },
+ { IPMI_OEM_SUPERMICRO, 0xAC80, "X7DWU" },
+ { IPMI_OEM_SUPERMICRO, 0xAD11, "BHQME" },
+ { IPMI_OEM_SUPERMICRO, 0xAD11, "H8DGT-HIBQF-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0xAE11, "H8QGI-F-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0xAE80, "PDSMP-JN001" },
+ { IPMI_OEM_SUPERMICRO, 0xAF11, "H8DGU-LN4F+-AI034" },
+ { IPMI_OEM_SUPERMICRO, 0xAF80, "AOC-UTG-I2" },
+ { IPMI_OEM_SUPERMICRO, 0xB080, "B7DBE" },
+ { IPMI_OEM_SUPERMICRO, 0xB180, "X7DBI+" },
+ { IPMI_OEM_SUPERMICRO, 0xB280, "X7DVL-L" },
+ { IPMI_OEM_SUPERMICRO, 0xB380, "X7DWN" },
+ { IPMI_OEM_SUPERMICRO, 0xB480, "AOC-UG-i4" },
+ { IPMI_OEM_SUPERMICRO, 0xB580, "PDSBM-LN2" },
+ { IPMI_OEM_SUPERMICRO, 0xB680, "X7DGT-ATOKAP" },
+ { IPMI_OEM_SUPERMICRO, 0xB780, "C2SBA" },
+ { IPMI_OEM_SUPERMICRO, 0xB780, "X7DWT-CD-SG007" },
+ { IPMI_OEM_SUPERMICRO, 0xB880, "C2SEA" },
+ { IPMI_OEM_SUPERMICRO, 0xB980, "Winbond IPMI (AMI)" },
+ { IPMI_OEM_SUPERMICRO, 0xBA11, "H8SCM-F" },
+ { IPMI_OEM_SUPERMICRO, 0xBA80, "C2SBX" },
+ { IPMI_OEM_SUPERMICRO, 0xBA80, "X7SLM-L" },
+ { IPMI_OEM_SUPERMICRO, 0xBB11, "BHDGT" },
+ { IPMI_OEM_SUPERMICRO, 0xBB80, "B7DCE" },
+ { IPMI_OEM_SUPERMICRO, 0xBC11, "BHQG6/E" },
+ { IPMI_OEM_SUPERMICRO, 0xBC11, "H8DG6/i-F" },
+ { IPMI_OEM_SUPERMICRO, 0xBC80, "X7DWT/-INF" },
+ { IPMI_OEM_SUPERMICRO, 0xBD11, "H8DCT-IBQF" },
+ { IPMI_OEM_SUPERMICRO, 0xBD11, "H8DGT-C" },
+ { IPMI_OEM_SUPERMICRO, 0xBD80, "C2SBM" },
+ { IPMI_OEM_SUPERMICRO, 0xBE11, "H8DCT" },
+ { IPMI_OEM_SUPERMICRO, 0xBE80, "C2SBC" },
+ { IPMI_OEM_SUPERMICRO, 0xBE80, "C2SBC" },
+ { IPMI_OEM_SUPERMICRO, 0xBF11, "H8DME-EX-LS006" },
+ { IPMI_OEM_SUPERMICRO, 0xBF80, "C2SBi" },
+ { IPMI_OEM_SUPERMICRO, 0xC080, "AOC-USAS-H4i" },
+ { IPMI_OEM_SUPERMICRO, 0xC180, "AOC-USAS-H8i" },
+ { IPMI_OEM_SUPERMICRO, 0xC280, "B7DW3" },
+ { IPMI_OEM_SUPERMICRO, 0xC380, "AOC-USASLP-H8iR" },
+ { IPMI_OEM_SUPERMICRO, 0xCA11, "H8QGL" },
+ { IPMI_OEM_SUPERMICRO, 0xCB11, "H8DGT-CM" },
+ { IPMI_OEM_SUPERMICRO, 0xCD11, "H8DCL-6F" },
+ { IPMI_OEM_SUPERMICRO, 0xCE11, "H8DCT-HLN4F" },
+ { IPMI_OEM_SUPERMICRO, 0xCF11, "H8SML-7/i(F)" },
+ { IPMI_OEM_SUPERMICRO, 0xD011, "H8QG7" },
+ { IPMI_OEM_SUPERMICRO, 0xD080, "X7DWP" },
+ { IPMI_OEM_SUPERMICRO, 0xD111, "H8SME-F" },
+ { IPMI_OEM_SUPERMICRO, 0xD180, "X7SBi" },
+ { IPMI_OEM_SUPERMICRO, 0xD280, "X7SB4/E" },
+ { IPMI_OEM_SUPERMICRO, 0xD380, "X7SBA" },
+ { IPMI_OEM_SUPERMICRO, 0xD480, "X7SBi-LN4" },
+ { IPMI_OEM_SUPERMICRO, 0xD580, "X7SBF" },
+ { IPMI_OEM_SUPERMICRO, 0xD680, "X7DCA-3/i" },
+ { IPMI_OEM_SUPERMICRO, 0xDA80, "C2SBM-Q" },
+ { IPMI_OEM_SUPERMICRO, 0xDB80, "X7DCU" },
+ { IPMI_OEM_SUPERMICRO, 0xDC80, "X7DCA-L" },
+ { IPMI_OEM_SUPERMICRO, 0xDD80, "X7SBX" },
+ { IPMI_OEM_SUPERMICRO, 0xDE80, "X7DCT-10G" },
+ { IPMI_OEM_SUPERMICRO, 0xDF80, "X7DWE" },
+ { IPMI_OEM_SUPERMICRO, 0xF080, "X7SBT" },
+ { IPMI_OEM_SUPERMICRO, 0xF180, "X7SBU" },
+ { IPMI_OEM_SUPERMICRO, 0xF280, "X8DTN+" },
+ { IPMI_OEM_SUPERMICRO, 0xF380, "X8SAX" },
+ { IPMI_OEM_SUPERMICRO, 0xF480, "X7DCX" },
+ { IPMI_OEM_SUPERMICRO, 0xF580, "X8ST3" },
+ /* YADRO */
+ { IPMI_OEM_YADRO, 0x0001, "VESNIN BMC" },
+ { IPMI_OEM_YADRO, 0x000A, "TATLIN.UNIFIED Storage Controller BMC" },
+ { IPMI_OEM_YADRO, 0x0014, "VEGMAN Series BMC" },
+ { IPMI_OEM_YADRO, 0x0015, "TATLIN.ARCHIVE/xS BMC" },
{ 0xffffff , 0xffff , NULL },
};
-const struct oemvalstr ipmi_oem_sdr_type_vals[] = {
+const char *ipmi_generic_sensor_type_vals[] = {
+ "reserved",
+ "Temperature", "Voltage", "Current", "Fan",
+ "Physical Security", "Platform Security", "Processor",
+ "Power Supply", "Power Unit", "Cooling Device", "Other",
+ "Memory", "Drive Slot / Bay", "POST Memory Resize",
+ "System Firmwares", "Event Logging Disabled", "Watchdog1",
+ "System Event", "Critical Interrupt", "Button",
+ "Module / Board", "Microcontroller", "Add-in Card",
+ "Chassis", "Chip Set", "Other FRU", "Cable / Interconnect",
+ "Terminator", "System Boot Initiated", "Boot Error",
+ "OS Boot", "OS Critical Stop", "Slot / Connector",
+ "System ACPI Power State", "Watchdog2", "Platform Alert",
+ "Entity Presence", "Monitor ASIC", "LAN",
+ "Management Subsys Health", "Battery", "Session Audit",
+ "Version Change", "FRU State",
+ NULL
+};
+
+const struct oemvalstr ipmi_oem_sensor_type_vals[] = {
/* Keep OEM grouped together */
- { IPMI_OEM_KONTRON , 0xC0 , "OEM Firmware Info" },
- { IPMI_OEM_KONTRON , 0xC2 , "OEM Init Agent" },
- { IPMI_OEM_KONTRON , 0xC3 , "OEM IPMBL Link State" },
- { IPMI_OEM_KONTRON , 0xC4 , "OEM Board Reset" },
- { IPMI_OEM_KONTRON , 0xC5 , "OEM FRU Information Agent" },
- { IPMI_OEM_KONTRON , 0xC6 , "OEM POST Value Sensor" },
- { IPMI_OEM_KONTRON , 0xC7 , "OEM FWUM Status" },
- { IPMI_OEM_KONTRON , 0xC8 , "OEM Switch Mngt Software Status" },
- { IPMI_OEM_KONTRON , 0xC9 , "OEM OEM Diagnostic Status" },
- { IPMI_OEM_KONTRON , 0xCA , "OEM Component Firmware Upgrade" },
- { IPMI_OEM_KONTRON , 0xCB , "OEM FRU Over Current" },
- { IPMI_OEM_KONTRON , 0xCC , "OEM FRU Sensor Error" },
- { IPMI_OEM_KONTRON , 0xCD , "OEM FRU Power Denied" },
- { IPMI_OEM_KONTRON , 0xCE , "OEM Reserved" },
- { IPMI_OEM_KONTRON , 0xCF , "OEM Board Reset" },
- { IPMI_OEM_KONTRON , 0xD0 , "OEM Clock Resource Control" },
- { IPMI_OEM_KONTRON , 0xD1 , "OEM Power State" },
- { IPMI_OEM_KONTRON , 0xD2 , "OEM FRU Mngt Power Failure" },
- { IPMI_OEM_KONTRON , 0xD3 , "OEM Jumper Status" },
- { IPMI_OEM_KONTRON , 0xF2 , "OEM RTM Module Hotswap" },
-
- { IPMI_OEM_PICMG , 0xF0 , "PICMG FRU Hotswap" },
- { IPMI_OEM_PICMG , 0xF1 , "PICMG IPMB0 Link State" },
- { IPMI_OEM_PICMG , 0xF2 , "PICMG Module Hotswap" },
-
- { 0xffffff, 0x00, NULL }
+ { IPMI_OEM_KONTRON, 0xC0, "Firmware Info" },
+ { IPMI_OEM_KONTRON, 0xC2, "Init Agent" },
+ { IPMI_OEM_KONTRON, 0xC2, "Board Reset(cPCI)" },
+ { IPMI_OEM_KONTRON, 0xC3, "IPMBL Link State" },
+ { IPMI_OEM_KONTRON, 0xC4, "Board Reset" },
+ { IPMI_OEM_KONTRON, 0xC5, "FRU Information Agent" },
+ { IPMI_OEM_KONTRON, 0xC6, "POST Value Sensor" },
+ { IPMI_OEM_KONTRON, 0xC7, "FWUM Status" },
+ { IPMI_OEM_KONTRON, 0xC8, "Switch Mngt Software Status" },
+ { IPMI_OEM_KONTRON, 0xC9, "OEM Diagnostic Status" },
+ { IPMI_OEM_KONTRON, 0xCA, "Component Firmware Upgrade" },
+ { IPMI_OEM_KONTRON, 0xCB, "FRU Over Current" },
+ { IPMI_OEM_KONTRON, 0xCC, "FRU Sensor Error" },
+ { IPMI_OEM_KONTRON, 0xCD, "FRU Power Denied" },
+ { IPMI_OEM_KONTRON, 0xCE, "Reserved" },
+ { IPMI_OEM_KONTRON, 0xCF, "Board Reset" },
+ { IPMI_OEM_KONTRON, 0xD0, "Clock Resource Control" },
+ { IPMI_OEM_KONTRON, 0xD1, "Power State" },
+ { IPMI_OEM_KONTRON, 0xD2, "FRU Mngt Power Failure" },
+ { IPMI_OEM_KONTRON, 0xD3, "Jumper Status" },
+ { IPMI_OEM_KONTRON, 0xF2, "RTM Module Hotswap" },
+ /* PICMG Sensor Types */
+ { IPMI_OEM_PICMG, 0xF0, "FRU Hot Swap" },
+ { IPMI_OEM_PICMG, 0xF1,"IPMB Physical Link" },
+ { IPMI_OEM_PICMG, 0xF2, "Module Hot Swap" },
+ { IPMI_OEM_PICMG, 0xF3, "Power Channel Notification" },
+ { IPMI_OEM_PICMG, 0xF4, "Telco Alarm Input" },
+ /* VITA 46.11 Sensor Types */
+ { IPMI_OEM_VITA, 0xF0, "FRU State" },
+ { IPMI_OEM_VITA, 0xF1, "System IPMB Link" },
+ { IPMI_OEM_VITA, 0xF2, "FRU Health" },
+ { IPMI_OEM_VITA, 0xF3, "FRU Temperature" },
+ { IPMI_OEM_VITA, 0xF4, "Payload Test Results" },
+ { IPMI_OEM_VITA, 0xF5, "Payload Test Status" },
+
+ { 0xffffff, 0x00, NULL }
};
const struct valstr ipmi_netfn_vals[] = {
@@ -355,8 +1033,8 @@ const struct valstr ipmi_privlvl_vals[] = {
{ IPMI_SESSION_PRIV_OPERATOR, "OPERATOR" },
{ IPMI_SESSION_PRIV_ADMIN, "ADMINISTRATOR" },
{ IPMI_SESSION_PRIV_OEM, "OEM" },
- { 0xF, "NO ACCESS" },
- { 0xFF, NULL },
+ { IPMI_SESSION_PRIV_NOACCESS, "NO ACCESS" },
+ { UINT8_MAX, NULL },
};
@@ -587,10 +1265,32 @@ const struct valstr ipmi_chassis_power_control_vals[] = {
{ 0x00, NULL },
};
+/*
+ * See Table 28-11, Get System Restart Cause Command
+ */
+const struct valstr ipmi_chassis_restart_cause_vals[] = {
+ { 0x0, "unknown" },
+ { 0x1, "chassis power control command" },
+ { 0x2, "reset via pushbutton" },
+ { 0x3, "power-up via pushbutton" },
+ { 0x4, "watchdog expired" },
+ { 0x5, "OEM" },
+ { 0x6, "power-up due to always-restore power policy" },
+ { 0x7, "power-up due to restore-previous power policy" },
+ { 0x8, "reset via PEF" },
+ { 0x9, "power-cycle via PEF" },
+ { 0xa, "soft reset" },
+ { 0xb, "power-up via RTC wakeup" },
+ { 0xFF, NULL },
+};
+
const struct valstr ipmi_auth_algorithms[] = {
{ IPMI_AUTH_RAKP_NONE, "none" },
{ IPMI_AUTH_RAKP_HMAC_SHA1, "hmac_sha1" },
{ IPMI_AUTH_RAKP_HMAC_MD5, "hmac_md5" },
+#ifdef HAVE_CRYPTO_SHA256
+ { IPMI_AUTH_RAKP_HMAC_SHA256, "hmac_sha256" },
+#endif /* HAVE_CRYPTO_SHA256 */
{ 0x00, NULL }
};
@@ -599,6 +1299,9 @@ const struct valstr ipmi_integrity_algorithms[] = {
{ IPMI_INTEGRITY_HMAC_SHA1_96, "hmac_sha1_96" },
{ IPMI_INTEGRITY_HMAC_MD5_128, "hmac_md5_128" },
{ IPMI_INTEGRITY_MD5_128 , "md5_128" },
+#ifdef HAVE_CRYPTO_SHA256
+ { IPMI_INTEGRITY_HMAC_SHA256_128, "sha256_128" },
+#endif /* HAVE_CRYPTO_SHA256 */
{ 0x00, NULL }
};
@@ -610,6 +1313,14 @@ const struct valstr ipmi_encryption_algorithms[] = {
{ 0x00, NULL }
};
+const struct valstr ipmi_user_enable_status_vals[] = {
+ { 0x00, "unknown" },
+ { 0x40, "enabled" },
+ { 0x80, "disabled" },
+ { 0xC0, "reserved" },
+ { 0xFF, NULL },
+};
+
const struct valstr picmg_frucontrol_vals[] = {
{ 0, "Cold Reset" },
{ 1, "Warm Reset" },
@@ -743,3 +1454,327 @@ const struct oemvalstr picmg_busres_shmc_status_vals[] = {
{ 0xffffff, 0x00, NULL }
};
+
+
+/**
+ * A helper function to count repetitions of the same byte
+ * at the beginning of a string.
+ */
+static
+size_t count_bytes(const char *s, unsigned char c)
+{
+ size_t count;
+
+ for (count = 0; s && s[0] == c; ++s, ++count);
+
+ return count;
+}
+
+/**
+ * Parse the IANA PEN registry file.
+ *
+ * See https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
+ * The expected entry format is:
+ *
+ * Decimal
+ * | Organization
+ * | | Contact
+ * | | | Email
+ * | | | |
+ * 0
+ * Reserved
+ * Internet Assigned Numbers Authority
+ * iana&iana.org
+ *
+ * That is, IANA PEN at position 0, enterprise name at position 2.
+ */
+#define IANA_NAME_OFFSET 2
+#define IANA_PEN_REGISTRY "enterprise-numbers"
+static
+int oem_info_list_load(oem_valstr_list_t **list)
+{
+ FILE *in = NULL;
+ char *home;
+ oem_valstr_list_t *oemlist = *list;
+ int count = 0;
+
+ /*
+ * First try to open user's local registry if HOME is set
+ */
+ if ((home = getenv("HOME"))) {
+ char path[PATH_MAX + 1] = { 0 };
+ snprintf(path, PATH_MAX, "%s%s",
+ home,
+ PATH_SEPARATOR IANAUSERDIR PATH_SEPARATOR IANA_PEN_REGISTRY);
+ in = fopen(path, "r");
+ }
+
+ if (!in) {
+ /*
+ * Now open the system default file
+ */
+ in = fopen(IANADIR PATH_SEPARATOR IANA_PEN_REGISTRY, "r");
+ if (!in) {
+ lperror(LOG_ERR, "IANA PEN registry open failed");
+ return -1;
+ }
+ }
+
+ /*
+ * Read the registry file line by line, fill in the linked list,
+ * and count the entries. No sorting is done, entries will come in
+ * reverse registry order.
+ */
+ while (!feof(in)) {
+ oem_valstr_list_t *item;
+ char *line = NULL;
+ char *endptr = NULL;
+ size_t len = 0;
+ long iana;
+
+ if (!getline(&line, &len, in)) {
+ /* Either an EOF or an empty line. Start over. */
+ continue;
+ }
+
+ /*
+ * Check if the line starts with a digit. If so, take it as IANA PEN.
+ * Any numbers not starting at position 0 are discarded.
+ */
+ iana = strtol(line, &endptr, 10);
+ if (!isdigit(line[0]) || endptr == line) {
+ free_n(&line);
+ continue;
+ }
+ free_n(&line);
+
+ /*
+ * Now as we have the enterprise number, we're expecting the
+ * organization name to immediately follow.
+ */
+ len = 0;
+ if (!getline(&line, &len, in)) {
+ /*
+ * Either an EOF or an empty line. Neither one can happen in
+ * a valid registry entry. Start over.
+ */
+ continue;
+ }
+
+ if (len < IANA_NAME_OFFSET + 1
+ || count_bytes(line, ' ') != IANA_NAME_OFFSET)
+ {
+ /*
+ * This is not a valid line, it doesn't start with
+ * a correct-sized indentation or is too short.
+ * Start over.
+ */
+ free_n(&line);
+ continue;
+ }
+
+ /* Adjust to real line length, don't count the indentation */
+ len = strnlen(line + IANA_NAME_OFFSET, len - IANA_NAME_OFFSET);
+
+ /* Don't count the trailing newline */
+ if (line[IANA_NAME_OFFSET + len - 1] == '\n') {
+ --len;
+ }
+
+ item = malloc(sizeof(oem_valstr_list_t));
+ if (!item) {
+ lperror(LOG_ERR, "IANA PEN registry entry allocation failed");
+ free_n(&line);
+ /* Just stop reading, and process what has already been read */
+ break;
+ }
+
+ /*
+ * Looks like we have a valid entry, store it in the list.
+ */
+ item->valstr.val = iana;
+ item->valstr.str = malloc(len + 1); /* Add 1 for \0 terminator */
+ if (!item->valstr.str) {
+ lperror(LOG_ERR, "IANA PEN registry string allocation failed");
+ free_n(&line);
+ free_n(&item);
+ /* Just stop reading, and process what has already been read */
+ break;
+ }
+
+ /*
+ * Most other valstr arrays are constant and all of them aren't meant
+ * for modification, so the string inside 'struct valstr' is const.
+ * Here we're loading the strings dynamically so we intentionally
+ * cast to a non-const type to be able to modify data here and
+ * keep the compiler silent about it. Restrictions still apply to
+ * other places where these strings are used.
+ */
+ snprintf((void *)item->valstr.str, len + 1,
+ "%s", line + IANA_NAME_OFFSET);
+ free_n(&line);
+ item->next = oemlist;
+ oemlist = item;
+ ++count;
+ }
+ fclose (in);
+
+ *list = oemlist;
+ return count;
+}
+
+/**
+ * Free the allocated list items and, if needed, strings.
+ */
+static
+void
+oem_info_list_free(oem_valstr_list_t **list, bool free_strings)
+{
+ while ((*list)->next) {
+ oem_valstr_list_t *item = *list;
+ *list = item->next;
+ if (free_strings) {
+ free_n(&item->valstr.str);
+ }
+ free_n(&item);
+ }
+}
+
+/**
+ * Initialize the ipmi_oem_info array from a list
+ */
+static
+bool
+oem_info_init_from_list(oem_valstr_list_t *oemlist, size_t count)
+{
+ /* Do not count terminators */
+ size_t head_entries = ARRAY_SIZE(ipmi_oem_info_head) - 1;
+ size_t tail_entries = ARRAY_SIZE(ipmi_oem_info_tail) - 1;
+ static oem_valstr_list_t *item;
+ bool rc = false;
+ int oemlist_debug = LOG_DEBUG + 4; /* Require six -v options */
+
+ /* Include static entries and the terminator */
+ count += head_entries + tail_entries + 1;
+
+ /*
+ * Allocate as much memory as needed to accomodata all the entries
+ * of the loaded linked list, plus the static head and tail, not including
+ * their terminating entries, plus the terminating entry for the new
+ * array.
+ */
+ ipmi_oem_info = malloc(count * sizeof(*ipmi_oem_info));
+
+ if (!ipmi_oem_info) {
+ /*
+ * We can't identify OEMs without an allocated ipmi_oem_info.
+ * Report an error, set the pointer to dummy and clean up.
+ */
+ lperror(LOG_ERR, "IANA PEN registry array allocation failed");
+ ipmi_oem_info = ipmi_oem_info_dummy;
+ goto out;
+ }
+
+ lprintf(oemlist_debug, " Allocating %6zu entries", count);
+
+ /* Add a terminator at the very end */
+ --count;
+ ((struct valstr *)ipmi_oem_info)[count].val = -1;
+ ((struct valstr *)ipmi_oem_info)[count].str = NULL;
+
+ /* Add tail entries from the end */
+ while (count-- < SIZE_MAX && tail_entries--) {
+ ((struct valstr *)ipmi_oem_info)[count] =
+ ipmi_oem_info_tail[tail_entries];
+
+ lprintf(oemlist_debug, " [%6zu] %8d | %s", count,
+ ipmi_oem_info[count].val, ipmi_oem_info[count].str);
+ }
+
+ /* Now add the loaded entries */
+ item = oemlist;
+ while (count < SIZE_MAX && item->next) {
+ ((struct valstr *)ipmi_oem_info)[count] =
+ item->valstr;
+
+ lprintf(oemlist_debug, " [%6zu] %8d | %s", count,
+ ipmi_oem_info[count].val, ipmi_oem_info[count].str);
+
+ item = item->next;
+ --count;
+ }
+
+ /* Now add head entries */
+ while (count < SIZE_MAX && head_entries--) {
+ ((struct valstr *)ipmi_oem_info)[count] =
+ ipmi_oem_info_head[head_entries];
+ lprintf(oemlist_debug, " [%6zu] %8d | %s", count,
+ ipmi_oem_info[count].val, ipmi_oem_info[count].str);
+ --count;
+ }
+
+ rc = true;
+
+out:
+ return rc;
+}
+
+int ipmi_oem_info_init()
+{
+ oem_valstr_list_t terminator = { { -1, NULL}, NULL }; /* Terminator */
+ oem_valstr_list_t *oemlist = &terminator;
+ bool free_strings = true;
+ size_t count;
+ int rc = -4;
+
+ lprintf(LOG_INFO, "Loading IANA PEN Registry...");
+
+ if (ipmi_oem_info) {
+ lprintf(LOG_INFO, "IANA PEN Registry is already loaded");
+ rc = 0;
+ goto out;
+ }
+
+ if (!(count = oem_info_list_load(&oemlist))) {
+ /*
+ * We can't identify OEMs without a loaded registry.
+ * Set the pointer to dummy and return.
+ */
+ ipmi_oem_info = ipmi_oem_info_dummy;
+ goto out;
+ }
+
+ /* In the array was allocated, don't free the strings at cleanup */
+ free_strings = !oem_info_init_from_list(oemlist, count);
+
+ rc = IPMI_CC_OK;
+
+out:
+ oem_info_list_free(&oemlist, free_strings);
+ return rc;
+}
+
+void ipmi_oem_info_free()
+{
+ /* Start with the dynamically allocated entries */
+ size_t i = ARRAY_SIZE(ipmi_oem_info_head) - 1;
+
+ if (ipmi_oem_info == ipmi_oem_info_dummy) {
+ return;
+ }
+
+ /*
+ * Proceed dynamically allocated entries until we hit the first
+ * entry of ipmi_oem_info_tail[], which is statically allocated.
+ */
+ while (ipmi_oem_info
+ && ipmi_oem_info[i].val < UINT32_MAX
+ && ipmi_oem_info[i].str != ipmi_oem_info_tail[0].str)
+ {
+ free_n(&((struct valstr *)ipmi_oem_info)[i].str);
+ ++i;
+ }
+
+ /* Free the array itself */
+ free_n(&ipmi_oem_info);
+}
diff --git a/lib/ipmi_sunoem.c b/lib/ipmi_sunoem.c
index e4fae65..d03900d 100644
--- a/lib/ipmi_sunoem.c
+++ b/lib/ipmi_sunoem.c
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE
#include <stdlib.h>
#include <stdio.h>
@@ -197,7 +196,7 @@ static void
__sdr_list_empty(struct sdr_record_list * head)
{
struct sdr_record_list * e, *f;
- for (e = head; e != NULL; e = f) {
+ for (e = head; e; e = f) {
f = e->next;
free(e);
}
@@ -254,7 +253,7 @@ sunoem_led_get(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev,
uint8_t rqdata[7];
int rqdata_len;
- if (dev == NULL) {
+ if (!dev) {
*loc_rsp = NULL;
return (SUNOEM_EC_INVALID_ARG);
}
@@ -283,10 +282,10 @@ sunoem_led_get(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev,
* Just return NULL if there was
* an error.
*/
- if (rsp == NULL) {
+ if (!rsp) {
*loc_rsp = NULL;
return (SUNOEM_EC_BMC_NOT_RESPONDING);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
*loc_rsp = rsp;
return (SUNOEM_EC_BMC_CCODE_NONZERO);
} else {
@@ -304,7 +303,7 @@ sunoem_led_set(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev,
uint8_t rqdata[9];
int rqdata_len;
- if (dev == NULL)
+ if (!dev)
return NULL;
rqdata[0] = dev->dev_slave_addr;
@@ -330,10 +329,10 @@ sunoem_led_set(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev,
req.msg.data_len = rqdata_len;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM Set LED command failed.");
return NULL;
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM Set LED command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return NULL;
@@ -361,11 +360,11 @@ sunoem_led_get_byentity(struct ipmi_intf * intf, uint8_t entity_id,
elist = ipmi_sdr_find_sdr_byentity(intf, &entity);
- if (elist == NULL)
+ if (!elist)
ret_get = -1;
/* for each generic sensor get its led state */
- for (e = elist; e != NULL; e = e->next) {
+ for (e = elist; e; e = e->next) {
if (e->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
continue;
@@ -404,11 +403,11 @@ sunoem_led_set_byentity(struct ipmi_intf * intf, uint8_t entity_id,
elist = ipmi_sdr_find_sdr_byentity(intf, &entity);
- if (elist == NULL)
+ if (!elist)
ret_set = -1;
/* for each generic sensor set its led state */
- for (e = elist; e != NULL; e = e->next) {
+ for (e = elist; e; e = e->next) {
if (e->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
continue;
@@ -417,7 +416,7 @@ sunoem_led_set_byentity(struct ipmi_intf * intf, uint8_t entity_id,
if (rsp && rsp->data_len == 0) {
led_print((const char *) e->record.genloc->id_string, PRINT_NORMAL,
ledmode);
- } else if (rsp == NULL) {
+ } else if (!rsp) {
ret_set = -1;
}
}
@@ -435,14 +434,14 @@ sunoem_led_set_byentity(struct ipmi_intf * intf, uint8_t entity_id,
* Access Address" field, 0x20 if the LED is local
* [byte 3] hwInfo The OEM field from the SDR record
* [byte 4] force 1 = directly access the device
- * 0 = go thru its controller
+ * 0 = go through its controller
* Ignored if LED is local
*
* The format below is for Sun Blade Modular systems only
* [byte 4] entityID The entityID field from the SDR record
* [byte 5] entityIns The entityIns field from the SDR record
* [byte 6] force 1 = directly access the device
- * 0 = go thru its controller
+ * 0 = go through its controller
* Ignored if LED is local
*/
static int
@@ -460,7 +459,7 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
* sunoem led/sbled get <id> [type]
*/
- if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc < 1 || !strcmp(argv[0], "help")) {
ipmi_sunoem_usage();
return (0);
}
@@ -472,15 +471,15 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
"Unknown ledtype, will use data from the SDR oem field");
}
- if (strncasecmp(argv[0], "all", 3) == 0) {
+ if (strcasecmp(argv[0], "all") == 0) {
/* do all generic sensors */
alist = ipmi_sdr_find_sdr_bytype(intf,
SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
- if (alist == NULL)
+ if (!alist)
return (-1);
- for (a = alist; a != NULL; a = a->next) {
+ for (a = alist; a; a = a->next) {
if (a->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
continue;
if (a->record.genloc->entity.logical)
@@ -511,7 +510,7 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
/* look up generic device locator record in SDR */
sdr = ipmi_sdr_find_sdr_byid(intf, argv[0]);
- if (sdr == NULL) {
+ if (!sdr) {
lprintf(LOG_ERR, "No Sensor Data Record found for %s", argv[0]);
return (-1);
}
@@ -556,14 +555,14 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
/* get entity assoc records */
alist = ipmi_sdr_find_sdr_bytype(intf, SDR_RECORD_TYPE_ENTITY_ASSOC);
- if (alist == NULL)
+ if (!alist)
return (-1);
- for (a = alist; a != NULL; a = a->next) {
+ for (a = alist; a; a = a->next) {
if (a->type != SDR_RECORD_TYPE_ENTITY_ASSOC)
continue;
assoc = a->record.entassoc;
- if (assoc == NULL)
+ if (!assoc)
continue;
/* check that the entity id/instance matches our generic record */
@@ -625,7 +624,7 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
* [byte 3] hwInfo The OEM field from the SDR record
* [byte 4] mode LED Mode: OFF, ON, STANDBY, SLOW, FAST
* [byte 5] force TRUE - directly access the device
- * FALSE - go thru its controller
+ * FALSE - go through its controller
* Ignored if LED is local
* [byte 6] role Used by BMC for authorization purposes
*
@@ -633,7 +632,7 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
* [byte 5] entityID The entityID field from the SDR record
* [byte 6] entityIns The entityIns field from the SDR record
* [byte 7] force TRUE - directly access the device
- * FALSE - go thru its controller
+ * FALSE - go through its controller
* Ignored if LED is local
* [byte 8] role Used by BMC for authorization purposes
*
@@ -658,7 +657,7 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
* sunoem led/sbled set <id> <mode> [type]
*/
- if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
+ if (argc < 2 || !strcmp(argv[0], "help")) {
ipmi_sunoem_usage();
return (0);
}
@@ -679,21 +678,21 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
"Unknown ledtype, will use data from the SDR oem field");
}
- if (strncasecmp(argv[0], "all", 3) == 0) {
+ if (strcasecmp(argv[0], "all") == 0) {
/* do all generic sensors */
alist = ipmi_sdr_find_sdr_bytype(intf,
SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
- if (alist == NULL)
+ if (!alist)
return (-1);
- for (a = alist; a != NULL; a = a->next) {
+ for (a = alist; a; a = a->next) {
if (a->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR)
continue;
if (a->record.genloc->entity.logical)
continue;
rsp = sunoem_led_set(intf, a->record.genloc, ledtype, ledmode);
- if (rsp && rsp->ccode == 0)
+ if (rsp && !rsp->ccode)
led_print((const char *) a->record.genloc->id_string,
PRINT_NORMAL, ledmode);
else
@@ -710,7 +709,7 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
/* look up generic device locator records in SDR */
sdr = ipmi_sdr_find_sdr_byid(intf, argv[0]);
- if (sdr == NULL) {
+ if (!sdr) {
lprintf(LOG_ERR, "No Sensor Data Record found for %s", argv[0]);
return (-1);
}
@@ -725,7 +724,7 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
* handle physical entity
*/
rsp = sunoem_led_set(intf, sdr->record.genloc, ledtype, ledmode);
- if (rsp && rsp->ccode == 0)
+ if (rsp && !rsp->ccode)
led_print(argv[0], PRINT_NORMAL, ledmode);
else
return (-1);
@@ -742,14 +741,14 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
/* get entity assoc records */
alist = ipmi_sdr_find_sdr_bytype(intf, SDR_RECORD_TYPE_ENTITY_ASSOC);
- if (alist == NULL)
+ if (!alist)
return (-1);
- for (a = alist; a != NULL; a = a->next) {
+ for (a = alist; a; a = a->next) {
if (a->type != SDR_RECORD_TYPE_ENTITY_ASSOC)
continue;
assoc = a->record.entassoc;
- if (assoc == NULL)
+ if (!assoc)
continue;
/* check that the entity id/instance matches our generic record */
@@ -813,10 +812,10 @@ ipmi_sunoem_sshkey_del(struct ipmi_intf * intf, uint8_t uid)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to delete ssh key for UID %d", uid);
return (-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Unable to delete ssh key for UID %d: %s", uid,
val2str(rsp->ccode, completion_code_vals));
return (-1);
@@ -839,13 +838,13 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile)
int32_t r = 0;
int32_t size = 0;
- if (ifile == NULL) {
+ if (!ifile) {
lprintf(LOG_ERR, "Invalid or misisng input filename.");
return (-1);
}
fp = ipmi_open_file_read(ifile);
- if (fp == NULL) {
+ if (!fp) {
lprintf(LOG_ERR, "Unable to open file '%s' for reading.", ifile);
return (-1);
}
@@ -857,7 +856,7 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile)
if (fseek(fp, 0, SEEK_END) == (-1)) {
lprintf(LOG_ERR, "Failed to seek in file '%s'.", ifile);
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
@@ -866,13 +865,13 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile)
size = (int32_t) ftell(fp);
if (size < 0) {
lprintf(LOG_ERR, "Failed to seek in file '%s'.", ifile);
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
} else if (size == 0) {
lprintf(LOG_ERR, "File '%s' is empty.", ifile);
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
@@ -880,7 +879,7 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile)
if (fseek(fp, 0, SEEK_SET) == (-1)) {
lprintf(LOG_ERR, "Failed to seek in file '%s'.", ifile);
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
@@ -900,7 +899,7 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile)
printf("failed\n");
lprintf(LOG_ERR, "Unable to read %ld bytes from file '%s'.", i_size,
ifile);
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
@@ -917,7 +916,7 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile)
printf("failed\n");
lprintf(LOG_ERR, "Unable to pack byte %ld from file '%s'.", r,
ifile);
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
@@ -930,23 +929,23 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile)
req.msg.data_len = i_size + 3;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
printf("failed\n");
lprintf(LOG_ERR, "Unable to set ssh key for UID %d.", uid);
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
- } /* if (rsp == NULL) */
- if (rsp->ccode != 0) {
+ }
+ if (rsp->ccode) {
printf("failed\n");
lprintf(LOG_ERR, "Unable to set ssh key for UID %d, %s.", uid,
val2str(rsp->ccode, completion_code_vals));
- if (fp != NULL)
+ if (fp)
fclose(fp);
return (-1);
- } /* if (rsp->ccode != 0) */
+ }
}
printf("done\n");
@@ -1077,7 +1076,7 @@ ipmi_sunoem_cli(struct ipmi_intf * intf, int argc, char *argv[])
memset(&cli_req, 0, sizeof(cli_req));
cli_req.version = SunOemCliActingVersion;
cli_req.command_response = SUNOEM_CLI_CMD_OPEN;
- if (argc > 0 && strcmp(argv[0], "force") == 0) {
+ if (argc > 0 && !strcmp(argv[0], "force")) {
cli_req.command_response = SUNOEM_CLI_CMD_FORCE;
argc--;
argv++;
@@ -1091,16 +1090,15 @@ ipmi_sunoem_cli(struct ipmi_intf * intf, int argc, char *argv[])
while (1) {
cli_req.version = SunOemCliActingVersion;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM cli command failed");
return (-1);
}
cli_rsp = (sunoem_cli_msg_t *) rsp->data;
- if ((cli_rsp->command_response != 0) || (rsp->ccode != 0)) {
- if (strncmp(cli_rsp->buf, SUNOEM_CLI_INVALID_VER_ERR,
- sizeof(SUNOEM_CLI_INVALID_VER_ERR) - 1) == 0
- || strncmp(&(cli_rsp->buf[1]), SUNOEM_CLI_INVALID_VER_ERR,
- sizeof(SUNOEM_CLI_INVALID_VER_ERR) - 1) == 0) {
+ if (cli_rsp->command_response || rsp->ccode) {
+ if (!strcmp(cli_rsp->buf, SUNOEM_CLI_INVALID_VER_ERR)
+ || !strcmp(&(cli_rsp->buf[1]), SUNOEM_CLI_INVALID_VER_ERR))
+ {
if (SunOemCliActingVersion == SUNOEM_CLI_VERSION) {
/* Server doesn't support version SUNOEM_CLI_VERSION
Fall back to legacy version, and try again*/
@@ -1110,8 +1108,7 @@ ipmi_sunoem_cli(struct ipmi_intf * intf, int argc, char *argv[])
/* Server doesn't support legacy version either */
lprintf(LOG_ERR, "Failed to connect: %s", cli_rsp->buf);
return (-1);
- } else if (strncmp(cli_rsp->buf, SUNOEM_CLI_BUSY_ERR,
- sizeof(SUNOEM_CLI_BUSY_ERR) - 1) == 0) {
+ } else if (!strcmp(cli_rsp->buf, SUNOEM_CLI_BUSY_ERR)) {
if (retries++ < SUNOEM_CLI_MAX_RETRY) {
lprintf(LOG_INFO, "Failed to connect: %s, retrying",
cli_rsp->buf);
@@ -1155,7 +1152,7 @@ ipmi_sunoem_cli(struct ipmi_intf * intf, int argc, char *argv[])
return (-1);
}
}
- while (rsp->ccode == 0 && cli_rsp->command_response == 0) {
+ while (!rsp->ccode && cli_rsp->command_response == 0) {
int rc = 0;
int count = 0;
cli_req.buf[0] = '\0';
@@ -1197,7 +1194,7 @@ ipmi_sunoem_cli(struct ipmi_intf * intf, int argc, char *argv[])
} else if (arg_num >= argc) {
/* Last arg was sent. Set EOF */
cli_req.command_response = SUNOEM_CLI_CMD_EOF;
- } else if (strncmp(argv[arg_num], "@wait=", 6) == 0) {
+ } else if (!strcmp(argv[arg_num], "@wait=")) {
/* This is a wait command */
char *s = &argv[arg_num][6];
delay = 0;
@@ -1254,7 +1251,7 @@ ipmi_sunoem_cli(struct ipmi_intf * intf, int argc, char *argv[])
req.msg.data_len = SUNOEM_CLI_HEADER + count;
for (retries = 0; retries <= SUNOEM_CLI_MAX_RETRY; retries++) {
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Communication error.");
error = 1;
goto cleanup;
@@ -1281,7 +1278,7 @@ ipmi_sunoem_cli(struct ipmi_intf * intf, int argc, char *argv[])
fflush(NULL); /* Flush partial lines to stdout */
count = 0; /* Don't re-send the client's data */
if (cli_req.command_response == SUNOEM_CLI_CMD_EOF
- && cli_rsp->command_response != 0 && rsp->ccode == 0) {
+ && cli_rsp->command_response != 0 && !rsp->ccode) {
cli_rsp->command_response = 1;
}
} while (cli_rsp->command_response == 0 && cli_rsp->buf[0] != '\0');
@@ -1381,7 +1378,7 @@ ipmi_sunoem_echo(struct ipmi_intf * intf, int argc, char *argv[])
gettimeofday(&end_time, NULL);
resp_time = ((end_time.tv_sec - start_time.tv_sec) * 1000)
+ ((end_time.tv_usec - start_time.tv_usec) / 1000);
- if ((rsp == NULL) || (rsp->ccode != 0)) {
+ if (!rsp || rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM echo command failed. Seq # %d",
echo_req.seq_num);
rc = (-2);
@@ -1436,7 +1433,7 @@ ipmi_sunoem_echo(struct ipmi_intf * intf, int argc, char *argv[])
received++;
if (!quiet_mode) {
- printf("Receive %u Bytes - Seq. # %d time=%d ms\n",
+ printf("Receive %lu Bytes - Seq. # %d time=%d ms\n",
sizeof(sunoem_echo_msg_t), echo_rsp->seq_num, resp_time);
}
} /* for (i = 0; i < num; i++) */
@@ -1466,7 +1463,7 @@ typedef struct
/*
* When adding new fields (using the spare bytes),
* add it immediately after the spare field to
- * ensure backward compatability.
+ * ensure backward compatibility.
*
* e.g. char version[40];
* unsigned char spare[11];
@@ -1501,11 +1498,11 @@ ipmi_sunoem_getversion(struct ipmi_intf * intf,
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM Get SP Version Failed.");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM Get SP Version Failed: %d", rsp->ccode);
return (-1);
}
@@ -1651,11 +1648,11 @@ ipmi_sunoem_nacname(struct ipmi_intf * intf, int argc, char *argv[])
req.msg.data_len = sizeof(sunoem_nacname_t);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM nacname command failed.");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM nacname command failed: %d", rsp->ccode);
return (-1);
}
@@ -1800,7 +1797,7 @@ ipmi_sunoem_getval(struct ipmi_intf * intf, int argc, char *argv[])
}
if ((ipmi_sunoem_checkversion(intf, &supp_ver) < 0)
- && (!strncmp(argv[0], sp_path, strlen(sp_path)))) {
+ && (!strcmp(argv[0], sp_path))) {
argv[0][1] = 'X'; /*replace SP by X to gain access to hidden properties*/
memmove(&argv[0][2], &argv[0][3], strlen(argv[0]) - 2);
}
@@ -1821,11 +1818,11 @@ ipmi_sunoem_getval(struct ipmi_intf * intf, int argc, char *argv[])
req.msg.data_len = sizeof(sunoem_getval_t);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM getval1 command failed.");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM getval1 command failed: %d", rsp->ccode);
return (-1);
}
@@ -1843,12 +1840,12 @@ ipmi_sunoem_getval(struct ipmi_intf * intf, int argc, char *argv[])
req.msg.data_len = sizeof(sunoem_getval_t);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM getval2 command failed.");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM getval2 command failed: %d", rsp->ccode);
return (-1);
}
@@ -1911,12 +1908,12 @@ send_luapi_prop_name(struct ipmi_intf * intf, int len, char *prop_name,
req.msg.data_len = sizeof(sunoem_setval_t);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM setval prop name: response is NULL");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM setval prop name: request failed: %d",
rsp->ccode);
return (-1);
@@ -1984,12 +1981,12 @@ send_luapi_prop_value(struct ipmi_intf * intf, int len, char *prop_value,
req.msg.data_len = sizeof(sunoem_setval_t);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM setval prop value: response is NULL");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM setval prop value: request failed: %d",
rsp->ccode);
return (-1);
@@ -2077,12 +2074,12 @@ ipmi_sunoem_setval(struct ipmi_intf * intf, int argc, char *argv[])
req.msg.data_len = sizeof(sunoem_setval_t);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM setval command failed.");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM setval command failed: %d", rsp->ccode);
return (-1);
}
@@ -2167,7 +2164,7 @@ ipmi_sunoem_getfile(struct ipmi_intf * intf, int argc, char *argv[])
/* Create the destination file */
fp = ipmi_open_file_write(argv[1]);
- if (fp == NULL) {
+ if (!fp) {
lprintf(LOG_ERR, "Unable to open file: %s", argv[1]);
return (-1);
}
@@ -2188,12 +2185,12 @@ ipmi_sunoem_getfile(struct ipmi_intf * intf, int argc, char *argv[])
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM getfile command failed.");
fclose(fp);
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM getfile command failed: %d", rsp->ccode);
fclose(fp);
return (-1);
@@ -2301,12 +2298,12 @@ ipmi_sunoem_getbehavior(struct ipmi_intf * intf, int argc, char *argv[])
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Sun OEM getbehavior command failed.");
return (-1);
}
- if (rsp->ccode != 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Sun OEM getbehavior command failed: %d", rsp->ccode);
return (-1);
}
@@ -2323,27 +2320,29 @@ ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = 0;
- if (argc == 0 || strcmp(argv[0], "help") == 0) {
+ if (!argc || !strcmp(argv[0], "help")) {
ipmi_sunoem_usage();
return (0);
- } /* if (argc == 0 || strcmp(argv[0], "help") == 0) */
+ }
- if (strcmp(argv[0], "cli") == 0) {
+ if (!strcmp(argv[0], "cli")) {
rc = ipmi_sunoem_cli(intf, argc - 1, &argv[1]);
- } else if ((strcmp(argv[0], "led") == 0) || (strcmp(argv[0], "sbled") == 0)) {
+ } else if (!strcmp(argv[0], "led")
+ || !strcmp(argv[0], "sbled"))
+ {
if (argc < 2) {
ipmi_sunoem_usage();
return (-1);
}
- if (strcmp(argv[1], "get") == 0) {
+ if (!strcmp(argv[1], "get")) {
if (argc < 3) {
char * arg[] = { "all" };
rc = ipmi_sunoem_led_get(intf, 1, arg);
} else {
rc = ipmi_sunoem_led_get(intf, argc - 2, &(argv[2]));
}
- } else if (strcmp(argv[1], "set") == 0) {
+ } else if (!strcmp(argv[1], "set")) {
if (argc < 4) {
ipmi_sunoem_usage();
return (-1);
@@ -2353,7 +2352,7 @@ ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_sunoem_usage();
return (-1);
}
- } else if (strcmp(argv[0], "sshkey") == 0) {
+ } else if (!strcmp(argv[0], "sshkey")) {
uint8_t uid = 0;
if (argc < 3) {
ipmi_sunoem_usage();
@@ -2371,10 +2370,10 @@ ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
- if (strcmp(argv[1], "del") == 0) {
+ if (!strcmp(argv[1], "del")) {
/* number of arguments, three, is already checked at this point */
rc = ipmi_sunoem_sshkey_del(intf, uid);
- } else if (strcmp(argv[1], "set") == 0) {
+ } else if (!strcmp(argv[1], "set")) {
if (argc < 4) {
ipmi_sunoem_usage();
return (-1);
@@ -2384,39 +2383,39 @@ ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_sunoem_usage();
return (-1);
}
- } else if (strcmp(argv[0], "ping") == 0) {
+ } else if (!strcmp(argv[0], "ping")) {
if (argc < 2) {
ipmi_sunoem_usage();
return (-1);
}
rc = ipmi_sunoem_echo(intf, argc - 1, &(argv[1]));
- } else if (strcmp(argv[0], "version") == 0) {
+ } else if (!strcmp(argv[0], "version")) {
rc = ipmi_sunoem_version(intf);
- } else if (strcmp(argv[0], "nacname") == 0) {
+ } else if (!strcmp(argv[0], "nacname")) {
if (argc < 2) {
ipmi_sunoem_usage();
return (-1);
}
rc = ipmi_sunoem_nacname(intf, argc - 1, &(argv[1]));
- } else if (strcmp(argv[0], "getval") == 0) {
+ } else if (!strcmp(argv[0], "getval")) {
if (argc < 2) {
ipmi_sunoem_usage();
return (-1);
}
rc = ipmi_sunoem_getval(intf, argc - 1, &(argv[1]));
- } else if (strcmp(argv[0], "setval") == 0) {
+ } else if (!strcmp(argv[0], "setval")) {
if (argc < 3) {
ipmi_sunoem_usage();
return (-1);
}
rc = ipmi_sunoem_setval(intf, argc - 1, &(argv[1]));
- } else if (strcmp(argv[0], "getfile") == 0) {
+ } else if (!strcmp(argv[0], "getfile")) {
if (argc < 3) {
ipmi_sunoem_usage();
return (-1);
}
rc = ipmi_sunoem_getfile(intf, argc - 1, &(argv[1]));
- } else if (strcmp(argv[0], "getbehavior") == 0) {
+ } else if (!strcmp(argv[0], "getbehavior")) {
if (argc < 2) {
ipmi_sunoem_usage();
return (-1);
@@ -2425,7 +2424,7 @@ ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv)
} else {
lprintf(LOG_ERR, "Invalid sunoem command: %s", argv[0]);
return (-1);
- } /* if (strcmp(argv[0], "cli") == 0) */
+ }
return (rc);
}
diff --git a/lib/ipmi_time.c b/lib/ipmi_time.c
new file mode 100644
index 0000000..aecd656
--- /dev/null
+++ b/lib/ipmi_time.c
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2018 Alexander Amelkin. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of the copyright holder, nor the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * THE COPYRIGHT HOLDER AND ITS LICENSORS SHALL NOT BE LIABLE
+ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
+ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
+ * THE COPYRIGHT HOLDER OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
+ * PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
+ * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
+ * THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS
+ * SOFTWARE, EVEN IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGES.
+ */
+
+#include <time.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h> /* snprintf */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ipmitool/ipmi_time.h>
+
+bool time_in_utc; /* Set by '-Z' command line option */
+
+time_t
+ipmi_localtime2utc(time_t local)
+{
+ struct tm tm;
+ gmtime_r(&local, &tm);
+ tm.tm_isdst = (-1);
+ return mktime(&tm);
+}
+
+/**
+ * @brief Convert a timestamp to a formatted string,
+ * considering the '-Z' option. Acts as if tzset() was called.
+ *
+ * @param[out] s The output string buffer
+ * @param[in] max The size of the output string buffer including the
+ * terminating null byte
+ * @param[in] format The format string, as in strftime(), ignored for
+ * special timestamp values as per section 37.1 of
+ * IPMI v2.0 specification rev 1.1.
+ * @param[in] stamp The time stamp to convert
+ *
+ * @returns the number of bytes written to s or 0, see strftime()
+ */
+size_t
+ipmi_strftime(char *s, size_t max, const char *format, time_t stamp)
+{
+ struct tm tm;
+ /*
+ * There is a bug in gcc since 4.3.2 and still not fixed in 8.1.0.
+ * Even if __attribute__((format(strftime... is specified for a wrapper
+ * function around strftime, gcc still complains about strftime being
+ * called from the wrapper with a "non-literal" format argument.
+ *
+ * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39438
+ *
+ * The following macro uses an "ugly cast" from that discussion to
+ * silence the compiler. The format string is checked for the wrapper
+ * because __attribute__((format)) is specified in the header file.
+ */
+ #define wrapstrftime(buf, buflen, fmt, t) \
+ ((size_t (*)(char *, size_t, const char *, const struct tm *))\
+ strftime)(buf, buflen, fmt, t)
+
+
+ if (IPMI_TIME_UNSPECIFIED == stamp) {
+ return snprintf(s, max, "Unknown");
+ }
+ else if (stamp <= IPMI_TIME_INIT_DONE) {
+ /* Timestamp is relative to BMC start, no GMT offset */
+ gmtime_r(&stamp, &tm);
+
+ return wrapstrftime(s, max, format, &tm);
+ }
+
+ if (time_in_utc || ipmi_timestamp_is_special(stamp)) {
+ /*
+ * The user wants the time reported in UTC or the stamp represents the
+ * number of seconds since system power on. In any case, don't apply
+ * the timezone offset.
+ */
+ gmtime_r(&stamp, &tm);
+ daylight = -1;
+ } else {
+ /*
+ * The user wants the time reported in local time zone.
+ */
+ localtime_r(&stamp, &tm);
+ }
+ return wrapstrftime(s, max, format, &tm);
+}
+
+/**
+ * @brief Convert a timestamp to string, considering the '-Z' option.
+ * Similar to asctime_r(), but takes time_t instead of struct tm,
+ * and the string is in form "Wed Jun 30 21:49:08 1993 TZD" without
+ * the new line at the end.
+ *
+ * @param[in] stamp The timestamp to convert
+ * @param[out] outbuf The buffer to write the string to.
+ * @param[in] len The maximum length of the output buffer.
+ * Recommended size is IPMI_ASCTIME_SZ.
+ *
+ * @returns outbuf
+ */
+char *
+ipmi_asctime_r(const time_t stamp, ipmi_datebuf_t outbuf)
+{
+ if (ipmi_timestamp_is_special(stamp)) {
+ if (stamp < SECONDS_A_DAY) {
+ ipmi_strftime(outbuf, IPMI_ASCTIME_SZ, "S+%H:%M:%S", stamp);
+ }
+ /*
+ * IPMI_TIME_INIT_DONE is over 17 years. This should never
+ * happen normally, but we'll support this anyway.
+ */
+ else {
+ ipmi_strftime(outbuf, IPMI_ASCTIME_SZ, "S+%yy %jd %H:%M:%S", stamp);
+ }
+ }
+
+ ipmi_strftime(outbuf, IPMI_ASCTIME_SZ, "%c %Z", stamp);
+ return outbuf;
+}
+
+char *
+ipmi_timestamp_fmt(uint32_t stamp, const char *fmt)
+{
+ /*
+ * It's assumed that supplied 'fmt' is never longer
+ * than IPMI_ASCTIME_SZ
+ */
+ static ipmi_datebuf_t datebuf;
+ /*
+ * There is a bug in gcc since 4.3.2 and still not fixed in 8.1.0.
+ * Even if __attribute__((format(strftime... is specified for a wrapper
+ * function around strftime, gcc still complains about strftime being
+ * called from the wrapper with a "non-literal" format argument.
+ *
+ * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39438
+ *
+ * The following call uses an "ugly cast" from that discussion to
+ * silence the compiler. The format string is checked for the wrapper
+ * because __attribute__((format)) is specified in the header file.
+ */
+ ((size_t (*)(char *, size_t, const char *, time_t))
+ ipmi_strftime)(datebuf, sizeof(datebuf), fmt, stamp);
+
+ return datebuf;
+}
+
+char *
+ipmi_timestamp_string(uint32_t stamp)
+{
+ if (!ipmi_timestamp_is_valid(stamp)) {
+ return "Unspecified";
+ }
+
+ if (ipmi_timestamp_is_special(stamp)) {
+ if (stamp < SECONDS_A_DAY) {
+ return ipmi_timestamp_fmt(stamp, "S+ %H:%M:%S");
+ }
+ /*
+ * IPMI_TIME_INIT_DONE is over 17 years. This should never
+ * happen normally, but we'll support this anyway.
+ */
+ else {
+ return ipmi_timestamp_fmt(stamp, "S+ %y years %j days %H:%M:%S");
+ }
+ }
+ return ipmi_timestamp_fmt(stamp, "%c %Z");
+}
+
+char *
+ipmi_timestamp_numeric(uint32_t stamp)
+{
+ if (!ipmi_timestamp_is_valid(stamp)) {
+ return "Unspecified";
+ }
+
+ if (ipmi_timestamp_is_special(stamp)) {
+ if (stamp < SECONDS_A_DAY) {
+ return ipmi_timestamp_fmt(stamp, "S+ %H:%M:%S");
+ }
+ /*
+ * IPMI_TIME_INIT_DONE is over 17 years. This should never
+ * happen normally, but we'll support this anyway.
+ */
+ else {
+ return ipmi_timestamp_fmt(stamp, "S+ %y/%j %H:%M:%S");
+ }
+ }
+ return ipmi_timestamp_fmt(stamp, "%x %X %Z");
+}
+
+char *
+ipmi_timestamp_date(uint32_t stamp)
+{
+ if (!ipmi_timestamp_is_valid(stamp)) {
+ return "Unspecified";
+ }
+
+ if (ipmi_timestamp_is_special(stamp)) {
+ return ipmi_timestamp_fmt(stamp, "S+ %y/%j");
+ }
+ return ipmi_timestamp_fmt(stamp, "%x");
+}
+
+char *
+ipmi_timestamp_time(uint32_t stamp)
+{
+ if (!ipmi_timestamp_is_valid(stamp)) {
+ return "Unspecified";
+ }
+
+ /* Format is the same for both normal and special timestamps */
+ return ipmi_timestamp_fmt(stamp, "%X %Z");
+}
diff --git a/lib/ipmi_tsol.c b/lib/ipmi_tsol.c
index d89bcfd..7cf1bcc 100644
--- a/lib/ipmi_tsol.c
+++ b/lib/ipmi_tsol.c
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _DEFAULT_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
@@ -104,11 +103,11 @@ ipmi_tsol_command(struct ipmi_intf *intf, char *recvip, int port,
data[5] = (port & 0xff);
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to perform TSOL command");
return (-1);
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Unable to perform TSOL command: %s",
val2str(rsp->ccode, completion_code_vals));
return (-1);
@@ -149,11 +148,11 @@ ipmi_tsol_send_keystroke(struct ipmi_intf *intf, char *buff, int length)
rsp = intf->sendrecv(intf, &req);
if (verbose) {
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Unable to send keystroke");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Unable to send keystroke: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -377,12 +376,12 @@ ipmi_tsol_main(struct ipmi_intf *intf, int argc, char **argv)
char out_buff[IPMI_BUF_SIZE * 8];
char buff[IPMI_BUF_SIZE + 4];
int fd_socket, result, i;
- int out_buff_fill, in_buff_fill;
+ size_t out_buff_fill, in_buff_fill;
int ip1, ip2, ip3, ip4;
int read_only = 0, rows = 0, cols = 0;
int port = IPMI_TSOL_DEF_PORT;
- if (strlen(intf->name) < 3 || strncmp(intf->name, "lan", 3) != 0) {
+ if (strlen(intf->name) < 3 || strcmp(intf->name, "lan")) {
lprintf(LOG_ERR, "Error: Tyan SOL is only available over lan interface");
return (-1);
}
@@ -398,17 +397,13 @@ ipmi_tsol_main(struct ipmi_intf *intf, int argc, char **argv)
rows = ip1;
} else if (sscanf(argv[i], "cols=%d", &ip1) == 1) {
cols = ip1;
- } else if (strlen(argv[i]) == 2
- && strncmp(argv[i], "ro", 2) == 0) {
+ } else if (!strcmp(argv[i], "ro")) {
read_only = 1;
- } else if (strlen(argv[i]) == 2
- && strncmp(argv[i], "rw", 2) == 0) {
+ } else if (!strcmp(argv[i], "rw")) {
read_only = 0;
- } else if (strlen(argv[i]) == 7
- && strncmp(argv[i], "altterm", 7) == 0) {
+ } else if (!strcmp(argv[i], "altterm")) {
_altterm = 1;
- } else if (strlen(argv[i]) == 4
- && strncmp(argv[i], "help", 4) == 0) {
+ } else if (!strcmp(argv[i], "help")) {
print_tsol_usage();
return 0;
} else {
@@ -430,7 +425,7 @@ ipmi_tsol_main(struct ipmi_intf *intf, int argc, char **argv)
if (result <= 0) {
struct hostent *host = gethostbyname((const char *)intf->ssn_params.hostname);
- if (host == NULL ) {
+ if (!host ) {
lprintf(LOG_ERR, "Address lookup for %s failed",
intf->ssn_params.hostname);
return -1;
@@ -460,7 +455,7 @@ ipmi_tsol_main(struct ipmi_intf *intf, int argc, char **argv)
/*
* retrieve local IP address if not supplied on command line
*/
- if (recvip == NULL) {
+ if (!recvip) {
/* must connect first */
result = intf->open(intf);
if (result < 0) {
@@ -476,7 +471,7 @@ ipmi_tsol_main(struct ipmi_intf *intf, int argc, char **argv)
}
recvip = inet_ntoa(myaddr.sin_addr);
- if (recvip == NULL) {
+ if (!recvip) {
lprintf(LOG_ERR, "Unable to find local IP address");
close(fd_socket);
return -1;
@@ -539,7 +534,7 @@ ipmi_tsol_main(struct ipmi_intf *intf, int argc, char **argv)
if ((fds[0].revents & POLLIN) && (sizeof(out_buff) > out_buff_fill)) {
socklen_t sin_len = sizeof(sin);
- int buff_size = sizeof(buff);
+ size_t buff_size = sizeof(buff);
if ((sizeof(out_buff) - out_buff_fill + 4) < buff_size) {
buff_size = (sizeof(out_buff) - out_buff_fill) + 4;
if ((buff_size - 4) <= 0) {
diff --git a/lib/ipmi_user.c b/lib/ipmi_user.c
index 2780e61..2068c93 100644
--- a/lib/ipmi_user.c
+++ b/lib/ipmi_user.c
@@ -29,10 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _BSD_SOURCE || \
- (_XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
- !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
#include <stdlib.h>
#include <string.h>
@@ -72,27 +68,27 @@ _ipmi_get_user_access(struct ipmi_intf *intf,
struct ipmi_rq req = {0};
struct ipmi_rs *rsp;
uint8_t data[2];
- if (user_access_rsp == NULL) {
+ if (!user_access_rsp) {
return (-3);
}
data[0] = user_access_rsp->channel & 0x0F;
- data[1] = user_access_rsp->user_id & 0x3F;
+ data[1] = IPMI_UID(user_access_rsp->user_id);
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = IPMI_GET_USER_ACCESS;
req.msg.data = data;
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
return (-1);
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
return rsp->ccode;
} else if (rsp->data_len != 4) {
return (-2);
}
- user_access_rsp->max_user_ids = rsp->data[0] & 0x3F;
+ user_access_rsp->max_user_ids = IPMI_UID(rsp->data[0]);
user_access_rsp->enable_status = rsp->data[1] & 0xC0;
- user_access_rsp->enabled_user_ids = rsp->data[1] & 0x3F;
- user_access_rsp->fixed_user_ids = rsp->data[2] & 0x3F;
+ user_access_rsp->enabled_user_ids = IPMI_UID(rsp->data[1]);
+ user_access_rsp->fixed_user_ids = IPMI_UID(rsp->data[2]);
user_access_rsp->callin_callback = rsp->data[3] & 0x40;
user_access_rsp->link_auth = rsp->data[3] & 0x20;
user_access_rsp->ipmi_messaging = rsp->data[3] & 0x10;
@@ -114,18 +110,18 @@ _ipmi_get_user_name(struct ipmi_intf *intf, struct user_name_t *user_name_ptr)
struct ipmi_rq req = {0};
struct ipmi_rs *rsp;
uint8_t data[1];
- if (user_name_ptr == NULL) {
+ if (!user_name_ptr) {
return (-3);
}
- data[0] = user_name_ptr->user_id & 0x3F;
+ data[0] = IPMI_UID(user_name_ptr->user_id);
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = IPMI_GET_USER_NAME;
req.msg.data = data;
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
return (-1);
- } else if (rsp->ccode > 0) {
+ } else if (rsp->ccode) {
return rsp->ccode;
} else if (rsp->data_len != 16) {
return (-2);
@@ -151,7 +147,7 @@ _ipmi_set_user_access(struct ipmi_intf *intf,
uint8_t data[4];
struct ipmi_rq req = {0};
struct ipmi_rs *rsp;
- if (user_access_req == NULL) {
+ if (!user_access_req) {
return (-3);
}
data[0] = change_priv_limit_only ? 0x00 : 0x80;
@@ -165,7 +161,7 @@ _ipmi_set_user_access(struct ipmi_intf *intf,
data[0] |= 0x10;
}
data[0] |= (user_access_req->channel & 0x0F);
- data[1] = user_access_req->user_id & 0x3F;
+ data[1] = IPMI_UID(user_access_req->user_id);
data[2] = user_access_req->privilege_limit & 0x0F;
data[3] = user_access_req->session_limit & 0x0F;
req.msg.netfn = IPMI_NETFN_APP;
@@ -173,7 +169,7 @@ _ipmi_set_user_access(struct ipmi_intf *intf,
req.msg.data = data;
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
return (-1);
} else {
return rsp->ccode;
@@ -200,14 +196,14 @@ _ipmi_set_user_password(struct ipmi_intf *intf, uint8_t user_id,
uint8_t *data;
uint8_t data_len = (is_twenty_byte) ? 22 : 18;
data = malloc(sizeof(uint8_t) * data_len);
- if (data == NULL) {
+ if (!data) {
return (-4);
}
memset(data, 0, data_len);
data[0] = (is_twenty_byte) ? 0x80 : 0x00;
- data[0] |= (0x0F & user_id);
+ data[0] |= IPMI_UID(user_id);
data[1] = 0x03 & operation;
- if (password != NULL) {
+ if (password) {
size_t copy_len = strlen(password);
if (copy_len > (data_len - 2)) {
copy_len = data_len - 2;
@@ -224,7 +220,7 @@ _ipmi_set_user_password(struct ipmi_intf *intf, uint8_t user_id,
rsp = intf->sendrecv(intf, &req);
free(data);
data = NULL;
- if (rsp == NULL) {
+ if (!rsp) {
return (-1);
}
return rsp->ccode;
@@ -371,18 +367,20 @@ ipmi_user_set_username(
req.msg.data_len = sizeof(msg_data);
memset(msg_data, 0, sizeof(msg_data));
+ user_id = IPMI_UID(user_id);
+
/* The channel number will remain constant throughout this function */
msg_data[0] = user_id;
strncpy((char *)(msg_data + 1), name, strlen(name));
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set User Name command failed (user %d, name %s)",
user_id, name);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set User Name command failed (user %d, name %s): %s",
user_id, name, val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -436,7 +434,7 @@ print_user_usage(void)
lprintf(LOG_NOTICE,
" set name <user id> <username>");
lprintf(LOG_NOTICE,
-" set password <user id> [<password> <16|20>]");
+" set password <user id> [<password> [<16|20>]]");
lprintf(LOG_NOTICE,
" disable <user id>");
lprintf(LOG_NOTICE,
@@ -553,7 +551,7 @@ ipmi_user_test(struct ipmi_intf *intf, int argc, char **argv)
if (argc == 3) {
/* We need to prompt for a password */
password = ask_password(user_id);
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (-1);
}
@@ -615,7 +613,7 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv)
if (is_ipmi_user_id(argv[1], &user_id)) {
return (-1);
}
- operation = (strncmp(argv[0], "disable", 7) == 0) ?
+ operation = (!strcmp(argv[0], "disable")) ?
IPMI_PASSWORD_DISABLE_USER : IPMI_PASSWORD_ENABLE_USER;
ccode = _ipmi_set_user_password(intf, user_id, operation,
@@ -628,12 +626,17 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv)
return 0;
}
+#define USER_PW_IPMI15_LEN 16 /* IPMI 1.5 only allowed for 16 bytes */
+#define USER_PW_IPMI20_LEN 20 /* IPMI 2.0 allows for 20 bytes */
+#define USER_PW_MAX_LEN USER_PW_IPMI20_LEN
+
int
ipmi_user_password(struct ipmi_intf *intf, int argc, char **argv)
{
char *password = NULL;
int ccode = 0;
- uint8_t password_type = 16;
+ uint8_t password_type = USER_PW_IPMI15_LEN;
+ size_t password_len;
uint8_t user_id = 0;
if (is_ipmi_user_id(argv[2], &user_id)) {
return (-1);
@@ -642,52 +645,63 @@ ipmi_user_password(struct ipmi_intf *intf, int argc, char **argv)
if (argc == 3) {
/* We need to prompt for a password */
char *tmp;
+ size_t tmplen;
password = ask_password(user_id);
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (-1);
}
tmp = ask_password(user_id);
- if (tmp == NULL) {
+ tmplen = strnlen(tmp, USER_PW_MAX_LEN + 1);
+ if (!tmp) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return (-1);
}
- if (strlen(password) != strlen(tmp)
- || strncmp(password, tmp, strlen(tmp))) {
- lprintf(LOG_ERR, "Passwords do not match.");
+ if (strncmp(password, tmp, tmplen)) {
+ lprintf(LOG_ERR, "Passwords do not match or are "
+ "longer than %d", USER_PW_MAX_LEN);
return (-1);
}
} else {
password = argv[3];
- if (argc > 4) {
- if ((str2uchar(argv[4], &password_type) != 0)
- || (password_type != 16 && password_type != 20)) {
- lprintf(LOG_ERR, "Invalid password length '%s'", argv[4]);
- return (-1);
- }
- } else {
- password_type = 16;
- }
}
- if (password == NULL) {
+ if (!password) {
lprintf(LOG_ERR, "Unable to parse password argument.");
return (-1);
- } else if (strlen(password) > 20) {
- lprintf(LOG_ERR, "Password is too long (> 20 bytes)");
+ }
+
+ password_len = strnlen(password, USER_PW_MAX_LEN + 1);
+
+ if (argc > 4) {
+ if ((str2uchar(argv[4], &password_type) != 0)
+ || (password_type != USER_PW_IPMI15_LEN
+ && password_type != USER_PW_IPMI20_LEN))
+ {
+ lprintf(LOG_ERR, "Invalid password length '%s'",
+ argv[4]);
+ return (-1);
+ }
+ } else if (password_len > USER_PW_IPMI15_LEN) {
+ password_type = USER_PW_IPMI20_LEN;
+ }
+
+ if (password_len > password_type) {
+ lprintf(LOG_ERR, "Password is too long (> %d bytes)",
+ password_type);
return (-1);
}
ccode = _ipmi_set_user_password(intf, user_id,
- IPMI_PASSWORD_SET_PASSWORD, password,
- password_type > 16);
+ IPMI_PASSWORD_SET_PASSWORD, password,
+ password_type > USER_PW_IPMI15_LEN);
if (eval_ccode(ccode) != 0) {
lprintf(LOG_ERR, "Set User Password command failed (user %d)",
- user_id);
+ user_id);
return (-1);
} else {
printf("Set User Password command successful (user %d)\n",
- user_id);
+ user_id);
return 0;
}
}
@@ -726,32 +740,34 @@ ipmi_user_main(struct ipmi_intf *intf, int argc, char **argv)
print_user_usage();
return (-1);
}
- if (strncmp(argv[0], "help", 4) == 0) {
+ if (!strcmp(argv[0], "help")) {
/* Help */
print_user_usage();
return 0;
- } else if (strncmp(argv[0], "summary", 7) == 0) {
+ } else if (!strcmp(argv[0], "summary")) {
return ipmi_user_summary(intf, argc, argv);
- } else if (strncmp(argv[0], "list", 4) == 0) {
+ } else if (!strcmp(argv[0], "list")) {
return ipmi_user_list(intf, argc, argv);
- } else if (strncmp(argv[0], "test", 4) == 0) {
+ } else if (!strcmp(argv[0], "test")) {
return ipmi_user_test(intf, argc, argv);
- } else if (strncmp(argv[0], "set", 3) == 0) {
+ } else if (!strcmp(argv[0], "set")) {
/* Set */
- if ((argc >= 3)
- && (strncmp("password", argv[1], 8) == 0)) {
+ if (argc >= 3
+ && !strcmp("password", argv[1]))
+ {
return ipmi_user_password(intf, argc, argv);
- } else if ((argc >= 2)
- && (strncmp("name", argv[1], 4) == 0)) {
+ } else if (argc >= 2
+ && !strcmp("name", argv[1]))
+ {
return ipmi_user_name(intf, argc, argv);
} else {
print_user_usage();
return (-1);
}
- } else if (strncmp(argv[0], "priv", 4) == 0) {
+ } else if (!strcmp(argv[0], "priv")) {
return ipmi_user_priv(intf, argc, argv);
- } else if ((strncmp(argv[0], "disable", 7) == 0)
- || (strncmp(argv[0], "enable", 6) == 0)) {
+ } else if (!strcmp(argv[0], "disable")
+ || !strcmp(argv[0], "enable")) {
return ipmi_user_mod(intf, argc, argv);
} else {
lprintf(LOG_ERR, "Invalid user command: '%s'\n", argv[0]);
diff --git a/lib/ipmi_vita.c b/lib/ipmi_vita.c
index 3900974..2771809 100644
--- a/lib/ipmi_vita.c
+++ b/lib/ipmi_vita.c
@@ -190,7 +190,7 @@ vita_discover(struct ipmi_intf *intf)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received");
} else if (rsp->ccode == 0xC1) {
lprintf(LOG_INFO, "Invalid completion code received: %s",
@@ -198,7 +198,7 @@ vita_discover(struct ipmi_intf *intf)
} else if (rsp->ccode == 0xCC) {
lprintf(LOG_INFO, "Invalid data field received: %s",
val2str(rsp->ccode, completion_code_vals));
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_INFO, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
} else if (rsp->data_len < 5) {
@@ -240,9 +240,9 @@ ipmi_vita_ipmb_address(struct ipmi_intf *intf)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received");
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
} else if (rsp->data_len < 7) {
@@ -284,10 +284,10 @@ ipmi_vita_getaddr(struct ipmi_intf *intf, int argc, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -332,10 +332,10 @@ ipmi_vita_get_vso_capabilities(struct ipmi_intf *intf)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -402,10 +402,10 @@ ipmi_vita_set_fru_activation(struct ipmi_intf *intf,
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -444,10 +444,10 @@ ipmi_vita_get_fru_state_policy_bits(struct ipmi_intf *intf, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -499,10 +499,10 @@ ipmi_vita_set_fru_state_policy_bits(struct ipmi_intf *intf, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -540,10 +540,10 @@ ipmi_vita_get_led_properties(struct ipmi_intf *intf, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -585,10 +585,10 @@ ipmi_vita_get_led_color_capabilities(struct ipmi_intf *intf, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -603,14 +603,14 @@ ipmi_vita_get_led_color_capabilities(struct ipmi_intf *intf, char **argv)
printf("LED Color Capabilities: ");
for (i = 0; i < 8; i++) {
if (rsp->data[1] & (0x01 << i)) {
- printf("%s, ", led_color_str[i]);
+ printf("%s, ", picmg_led_color_str(i));
}
}
putchar('\n');
printf("Default LED Color in\n");
- printf(" LOCAL control: %s\n", led_color_str[rsp->data[2]]);
- printf(" OVERRIDE state: %s\n", led_color_str[rsp->data[3]]);
+ printf(" LOCAL control: %s\n", picmg_led_color_str(rsp->data[2]));
+ printf(" OVERRIDE state: %s\n", picmg_led_color_str(rsp->data[3]));
if (rsp->data_len == 5) {
printf("LED flags:\n");
@@ -649,10 +649,10 @@ ipmi_vita_get_led_state(struct ipmi_intf *intf, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -692,7 +692,7 @@ ipmi_vita_get_led_state(struct ipmi_intf *intf, char **argv)
}
printf(" Local Control On-Duration: %x\n", rsp->data[3]);
printf(" Local Control Color: %x\t[%s]\n",
- rsp->data[4], led_color_str[rsp->data[4] & 7]);
+ rsp->data[4], picmg_led_color_str(rsp->data[4] & 7));
}
/* override state or lamp test */
@@ -707,7 +707,7 @@ ipmi_vita_get_led_state(struct ipmi_intf *intf, char **argv)
}
printf(" Override On-Duration: %x\n", rsp->data[6]);
printf(" Override Color: %x\t[%s]\n",
- rsp->data[7], led_color_str[rsp->data[7] & 7]);
+ rsp->data[7], picmg_led_color_str(rsp->data[7] & 7));
if (rsp->data[1] == 0x04) {
printf(" Lamp test duration: %x\n", rsp->data[8]);
}
@@ -749,10 +749,10 @@ ipmi_vita_set_led_state(struct ipmi_intf *intf, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -796,10 +796,10 @@ ipmi_vita_fru_control(struct ipmi_intf *intf, char **argv)
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "No valid response received.");
return -1;
- } else if (rsp->ccode != 0) {
+ } else if (rsp->ccode) {
lprintf(LOG_ERR, "Invalid completion code received: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -819,48 +819,48 @@ ipmi_vita_fru_control(struct ipmi_intf *intf, char **argv)
static int
ipmi_vita_get_cmd(int argc, char **argv)
{
- if (argc < 1 || !strncmp(argv[0], "help", 4)) {
+ if (argc < 1 || !strcmp(argv[0], "help")) {
return VITA_CMD_HELP;
}
/* Get VSO Properties */
- if (!strncmp(argv[0], "properties", 10)) {
+ if (!strcmp(argv[0], "properties")) {
return VITA_CMD_PROPERTIES;
}
/* FRU Control command */
- if (!strncmp(argv[0], "frucontrol", 10)) {
+ if (!strcmp(argv[0], "frucontrol")) {
return VITA_CMD_FRUCONTROL;
}
/* Get FRU Address Info command */
- if (!strncmp(argv[0], "addrinfo", 8)) {
+ if (!strcmp(argv[0], "addrinfo")) {
return VITA_CMD_ADDRINFO;
}
/* Set FRU Activation (activate) command */
- if (!strncmp(argv[0], "activate", 8)) {
+ if (!strcmp(argv[0], "activate")) {
return VITA_CMD_ACTIVATE;
}
/* Set FRU Activation (deactivate) command */
- if (!strncmp(argv[0], "deactivate", 10)) {
+ if (!strcmp(argv[0], "deactivate")) {
return VITA_CMD_DEACTIVATE;
}
/* FRU State Policy Bits commands */
- if (!strncmp(argv[0], "policy", 6)) {
+ if (!strcmp(argv[0], "policy")) {
if (argc < 2) {
return VITA_CMD_UNKNOWN;
}
/* Get FRU State Policy Bits command */
- if (!strncmp(argv[1], "get", 3)) {
+ if (!strcmp(argv[1], "get")) {
return VITA_CMD_POLICY_GET;
}
/* Set FRU State Policy Bits command */
- if (!strncmp(argv[1], "set", 3)) {
+ if (!strcmp(argv[1], "set")) {
return VITA_CMD_POLICY_SET;
}
@@ -869,28 +869,28 @@ ipmi_vita_get_cmd(int argc, char **argv)
}
/* FRU LED commands */
- if (!strncmp(argv[0], "led", 3)) {
+ if (!strcmp(argv[0], "led")) {
if (argc < 2) {
return VITA_CMD_UNKNOWN;
}
/* FRU LED Get Properties */
- if (!strncmp(argv[1], "prop", 4)) {
+ if (!strcmp(argv[1], "prop")) {
return VITA_CMD_LED_PROP;
}
/* FRU LED Get Capabilities */
- if (!strncmp(argv[1], "cap", 3)) {
+ if (!strcmp(argv[1], "cap")) {
return VITA_CMD_LED_CAP;
}
/* FRU LED Get State */
- if (!strncmp(argv[1], "get", 3)) {
+ if (!strcmp(argv[1], "get")) {
return VITA_CMD_LED_GET;
}
/* FRU LED Set State */
- if (!strncmp(argv[1], "set", 3)) {
+ if (!strcmp(argv[1], "set")) {
return VITA_CMD_LED_SET;
}
diff --git a/lib/log.c b/lib/log.c
index 2738e18..ecc47a8 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -29,9 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
- /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
#include <unistd.h>
#include <stdio.h>
@@ -111,12 +108,12 @@ void log_init(const char * name, int isdaemon, int verbose)
if (!logpriv)
return;
- if (name != NULL)
+ if (name)
logpriv->name = strdup(name);
else
logpriv->name = strdup(LOG_NAME_DEFAULT);
- if (logpriv->name == NULL)
+ if (!logpriv->name)
fprintf(stderr, "ipmitool: malloc failure\n");
logpriv->daemon = isdaemon;
@@ -147,13 +144,8 @@ void log_halt(void)
logpriv = NULL;
}
-int log_level_get(void)
+void log_level_set(int verbose)
{
- return logpriv->level;
-}
-
-void log_level_set(int level)
-{
- logpriv->level = level;
+ logpriv->level = verbose + LOG_NOTICE;
}
diff --git a/ltmain.sh b/ltmain.sh
deleted file mode 100644
index bffda54..0000000
--- a/ltmain.sh
+++ /dev/null
@@ -1,9661 +0,0 @@
-
-# libtool (GNU libtool) 2.4.2
-# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-# --config show all configuration variables
-# --debug enable verbose shell tracing
-# -n, --dry-run display commands without modifying any files
-# --features display basic configuration information and exit
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --no-quiet, --no-silent
-# print informational messages (default)
-# --no-warn don't display warning messages
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print more informational messages than default
-# --no-verbose don't print the extra informational messages
-# --version print version information
-# -h, --help, --help-all print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-# clean remove files from the build directory
-# compile compile a source file into a libtool object
-# execute automatically set library path, then run a program
-# finish complete the installation of libtool libraries
-# install install libraries or executables
-# link create a library or an executable
-# uninstall remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE. When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11
-# automake: $automake_version
-# autoconf: $autoconf_version
-#
-# Report bugs to <bug-libtool@gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.11"
-TIMESTAMP=""
-package_revision=1.3337
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
- fi"
-done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-
-$lt_unset CDPATH
-
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-
-
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-} # func_dirname may be replaced by extended shell implementation
-
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
-
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname may be replaced by extended shell implementation
-
-
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
- s@/\./@/@g
- t dotsl
- s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
-
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-# value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
- # Start from root dir and reassemble the path.
- func_normal_abspath_result=
- func_normal_abspath_tpath=$1
- func_normal_abspath_altnamespace=
- case $func_normal_abspath_tpath in
- "")
- # Empty path, that just means $cwd.
- func_stripname '' '/' "`pwd`"
- func_normal_abspath_result=$func_stripname_result
- return
- ;;
- # The next three entries are used to spot a run of precisely
- # two leading slashes without using negated character classes;
- # we take advantage of case's first-match behaviour.
- ///*)
- # Unusual form of absolute path, do nothing.
- ;;
- //*)
- # Not necessarily an ordinary path; POSIX reserves leading '//'
- # and for example Cygwin uses it to access remote file shares
- # over CIFS/SMB, so we conserve a leading double slash if found.
- func_normal_abspath_altnamespace=/
- ;;
- /*)
- # Absolute path, do nothing.
- ;;
- *)
- # Relative path, prepend $cwd.
- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
- ;;
- esac
- # Cancel out all the simple stuff to save iterations. We also want
- # the path to end with a slash for ease of parsing, so make sure
- # there is one (and only one) here.
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
- while :; do
- # Processed it all yet?
- if test "$func_normal_abspath_tpath" = / ; then
- # If we ascended to the root using ".." the result may be empty now.
- if test -z "$func_normal_abspath_result" ; then
- func_normal_abspath_result=/
- fi
- break
- fi
- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcar"`
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcdr"`
- # Figure out what to do with it
- case $func_normal_abspath_tcomponent in
- "")
- # Trailing empty path component, ignore it.
- ;;
- ..)
- # Parent dir; strip last assembled component from result.
- func_dirname "$func_normal_abspath_result"
- func_normal_abspath_result=$func_dirname_result
- ;;
- *)
- # Actual path component, append it.
- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
- ;;
- esac
- done
- # Restore leading double-slash if one was found on entry.
- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-# value returned in "$func_relative_path_result"
-func_relative_path ()
-{
- func_relative_path_result=
- func_normal_abspath "$1"
- func_relative_path_tlibdir=$func_normal_abspath_result
- func_normal_abspath "$2"
- func_relative_path_tbindir=$func_normal_abspath_result
-
- # Ascend the tree starting from libdir
- while :; do
- # check if we have found a prefix of bindir
- case $func_relative_path_tbindir in
- $func_relative_path_tlibdir)
- # found an exact match
- func_relative_path_tcancelled=
- break
- ;;
- $func_relative_path_tlibdir*)
- # found a matching prefix
- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
- func_relative_path_tcancelled=$func_stripname_result
- if test -z "$func_relative_path_result"; then
- func_relative_path_result=.
- fi
- break
- ;;
- *)
- func_dirname $func_relative_path_tlibdir
- func_relative_path_tlibdir=${func_dirname_result}
- if test "x$func_relative_path_tlibdir" = x ; then
- # Have to descend all the way to the root!
- func_relative_path_result=../$func_relative_path_result
- func_relative_path_tcancelled=$func_relative_path_tbindir
- break
- fi
- func_relative_path_result=../$func_relative_path_result
- ;;
- esac
- done
-
- # Now calculate path; take care to avoid doubling-up slashes.
- func_stripname '' '/' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- func_stripname '/' '/' "$func_relative_path_tcancelled"
- if test "x$func_stripname_result" != x ; then
- func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
- fi
-
- # Normalisation. If bindir is libdir, return empty string,
- # else relative path ending with a slash; either way, target
- # file name can be directly appended.
- if test ! -z "$func_relative_path_result"; then
- func_stripname './' '' "$func_relative_path_result/"
- func_relative_path_result=$func_stripname_result
- fi
-}
-
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *[\\/]*)
- progdir=$func_dirname_result
- progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
- ;;
- *)
- save_IFS="$IFS"
- IFS=${PATH_SEPARATOR-:}
- for progdir in $PATH; do
- IFS="$save_IFS"
- test -x "$progdir/$progname" && break
- done
- IFS="$save_IFS"
- test -n "$progdir" || progdir=`pwd`
- progpath="$progdir/$progname"
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
-
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes. A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
- s/$bs4/&\\
-/g
- s/^$bs2$dollar/$bs&/
- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
- $opt_verbose && func_echo ${1+"$@"}
-
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
-}
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
-
- # bash bug again:
- :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
- func_error ${1+"$@"}
- exit $EXIT_FAILURE
-}
-
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
- func_error ${1+"$@"}
- func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information." ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
- $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
- my_directory_path="$1"
- my_dir_list=
-
- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
- # Protect directory names starting with `-'
- case $my_directory_path in
- -*) my_directory_path="./$my_directory_path" ;;
- esac
-
- # While some portion of DIR does not yet exist...
- while test ! -d "$my_directory_path"; do
- # ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
- my_dir_list="$my_directory_path:$my_dir_list"
-
- # If the last portion added has no slash in it, the list is done
- case $my_directory_path in */*) ;; *) break ;; esac
-
- # ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
- done
- my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
-
- save_mkdir_p_IFS="$IFS"; IFS=':'
- for my_dir in $my_dir_list; do
- IFS="$save_mkdir_p_IFS"
- # mkdir can fail with a `File exist' error if two processes
- # try to create one of the directories concurrently. Don't
- # stop in that case!
- $MKDIR "$my_dir" 2>/dev/null || :
- done
- IFS="$save_mkdir_p_IFS"
-
- # Bail out if we (or some other process) failed to create a directory.
- test -d "$my_directory_path" || \
- func_fatal_error "Failed to create \`$1'"
- fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$opt_dry_run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $MKDIR "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || \
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
- fi
-
- $ECHO "$my_tmpdir"
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
-{
- case $1 in
- *[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result="$1" ;;
- esac
-
- case $func_quote_for_eval_unquoted_result in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and and variable
- # expansion for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
- ;;
- *)
- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
- esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- case $1 in
- *[\\\`\"]*)
- my_arg=`$ECHO "$1" | $SED \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- my_arg="$1" ;;
- esac
-
- case $my_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- my_arg="\"$my_arg\""
- ;;
- esac
-
- func_quote_for_expand_result="$my_arg"
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$my_cmd"
- my_status=$?
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it. Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$lt_user_locale
- $my_cmd"
- my_status=$?
- eval "$lt_safe_locale"
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result. All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
- case $1 in
- [0-9]* | *[!a-zA-Z0-9_]*)
- func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
- ;;
- * )
- func_tr_sh_result=$1
- ;;
- esac
-}
-
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
- $opt_debug
-
- $SED -n '/(C)/!b go
- :more
- /\./!{
- N
- s/\n# / /
- b more
- }
- :go
- /^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- p
- }' < "$progpath"
- exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $opt_debug
-
- $SED -n '/^# Usage:/,/^# *.*--help/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- echo
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
-}
-
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
-func_help ()
-{
- $opt_debug
-
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- :print
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- s*\$host*'"$host"'*
- s*\$SHELL*'"$SHELL"'*
- s*\$LTCC*'"$LTCC"'*
- s*\$LTCFLAGS*'"$LTCFLAGS"'*
- s*\$LD*'"$LD"'*
- s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
- p
- d
- }
- /^# .* home page:/b print
- /^# General help using/b print
- ' < "$progpath"
- ret=$?
- if test -z "$1"; then
- exit $ret
- fi
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
- $opt_debug
-
- func_error "missing argument for $1."
- exit_cmd=exit
-}
-
-
-# func_split_short_opt shortopt
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
-{
- my_sed_short_opt='1s/^\(..\).*$/\1/;q'
- my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
-
- func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
- func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
-
-
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
-{
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- my_sed_long_arg='1s/^--[^=]*=//'
-
- func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
- func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
-
-exit_cmd=:
-
-
-
-
-
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
-
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
-
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
- func_quote_for_eval "${2}"
- eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
-
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
-
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
-
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
-
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
-
-
-# func_fatal_configuration arg...
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
- func_error ${1+"$@"}
- func_error "See the $PACKAGE documentation for more information."
- func_fatal_error "Fatal configuration error."
-}
-
-
-# func_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
- re_begincf='^# ### BEGIN LIBTOOL'
- re_endcf='^# ### END LIBTOOL'
-
- # Default configuration.
- $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
- done
-
- exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
- echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- echo "enable shared libraries"
- else
- echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- echo "enable static libraries"
- else
- echo "disable static libraries"
- fi
-
- exit $?
-}
-
-# func_enable_tag tagname
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
- # Global variable:
- tagname="$1"
-
- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
- sed_extractcf="/$re_begincf/,/$re_endcf/p"
-
- # Validate tagname.
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- func_fatal_error "invalid tag name: $tagname"
- ;;
- esac
-
- # Don't test for the "default" C tag, as we know it's
- # there but not specially marked.
- case $tagname in
- CC) ;;
- *)
- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
- taglist="$taglist $tagname"
-
- # Evaluate the configuration. Be careful to quote the path
- # and the sed script, to avoid splitting on whitespace, but
- # also don't use non-portable quotes within backquotes within
- # quotes we have to do it in 2 steps:
- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
- eval "$extractedcf"
- else
- func_error "ignoring unknown tag $tagname"
- fi
- ;;
- esac
-}
-
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
- fi
-
- exit $EXIT_MISMATCH
- fi
-}
-
-
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
-compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
-execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
-finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
-install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
-link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
-esac
-
-
-
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
-
-
-# Parse options once, thoroughly. This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
-{
- # this just eases exit handling
- while test $# -gt 0; do
- opt="$1"
- shift
- case $opt in
- --debug|-x) opt_debug='set -x'
- func_echo "enabling shell trace mode"
- $opt_debug
- ;;
- --dry-run|--dryrun|-n)
- opt_dry_run=:
- ;;
- --config)
- opt_config=:
-func_config
- ;;
- --dlopen|-dlopen)
- optarg="$1"
- opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
- shift
- ;;
- --preserve-dup-deps)
- opt_preserve_dup_deps=:
- ;;
- --features)
- opt_features=:
-func_features
- ;;
- --finish)
- opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
- ;;
- --help)
- opt_help=:
- ;;
- --help-all)
- opt_help_all=:
-opt_help=': help-all'
- ;;
- --mode)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_mode="$optarg"
-case $optarg in
- # Valid mode arguments:
- clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
-esac
- shift
- ;;
- --no-silent|--no-quiet)
- opt_silent=false
-func_append preserve_args " $opt"
- ;;
- --no-warning|--no-warn)
- opt_warning=false
-func_append preserve_args " $opt"
- ;;
- --no-verbose)
- opt_verbose=false
-func_append preserve_args " $opt"
- ;;
- --silent|--quiet)
- opt_silent=:
-func_append preserve_args " $opt"
- opt_verbose=false
- ;;
- --verbose|-v)
- opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
- ;;
- --tag)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
- shift
- ;;
-
- -\?|-h) func_usage ;;
- --help) func_help ;;
- --version) func_version ;;
-
- # Separate optargs to long options:
- --*=*)
- func_split_long_opt "$opt"
- set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
- shift
- ;;
-
- # Separate non-argument short options:
- -\?*|-h*|-n*|-v*)
- func_split_short_opt "$opt"
- set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
- shift
- ;;
-
- --) break ;;
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
- *) set dummy "$opt" ${1+"$@"}; shift; break ;;
- esac
- done
-
- # Validate options:
-
- # save first non-option argument
- if test "$#" -gt 0; then
- nonopt="$opt"
- shift
- fi
-
- # preserve --debug
- test "$opt_debug" = : || func_append preserve_args " --debug"
-
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
- ;;
- esac
-
- $opt_help || {
- # Sanity checks first:
- func_check_version_match
-
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
-
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$opt_mode' for more information."
- }
-
-
- # Bail if the options were screwed
- $exit_cmd $EXIT_FAILURE
-}
-
-
-
-
-## ----------- ##
-## Main. ##
-## ----------- ##
-
-# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
- test -f "$1" &&
- $SED -e 4q "$1" 2>/dev/null \
- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs. To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway. Works if `file' does not exist.
-func_lalib_unsafe_p ()
-{
- lalib_p=no
- if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
- for lalib_p_l in 1 2 3 4
- do
- read lalib_p_line
- case "$lalib_p_line" in
- \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
- esac
- done
- exec 0<&5 5<&-
- fi
- test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
- func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
- func_ltwrapper_exec_suffix=
- case $1 in
- *.exe) ;;
- *) func_ltwrapper_exec_suffix=.exe ;;
- esac
- $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
- func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
- $opt_debug
- save_ifs=$IFS; IFS='~'
- for cmd in $1; do
- IFS=$save_ifs
- eval cmd=\"$cmd\"
- func_show_eval "$cmd" "${2-:}"
- done
- IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)! Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
- $opt_debug
- case $1 in
- */* | *\\*) . "$1" ;;
- *) . "./$1" ;;
- esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot. Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
- func_resolve_sysroot_result=$1
- case $func_resolve_sysroot_result in
- =*)
- func_stripname '=' '' "$func_resolve_sysroot_result"
- func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
- ;;
- esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
- case "$lt_sysroot:$1" in
- ?*:"$lt_sysroot"*)
- func_stripname "$lt_sysroot" '' "$1"
- func_replace_sysroot_result="=$func_stripname_result"
- ;;
- *)
- # Including no sysroot.
- func_replace_sysroot_result=$1
- ;;
- esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- $opt_debug
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- func_append_quoted CC_quoted "$arg"
- done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- func_append_quoted CC_quoted "$arg"
- done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
- case "$@ " in
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
-# else
-# func_verbose "using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
- write_libobj=${1}
- if test "$build_libtool_libs" = yes; then
- write_lobj=\'${2}\'
- else
- write_lobj=none
- fi
-
- if test "$build_old_libs" = yes; then
- write_oldobj=\'${3}\'
- else
- write_oldobj=none
- fi
-
- $opt_dry_run || {
- cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
- $MV "${write_libobj}T" "${write_libobj}"
- }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
-{
- $opt_debug
- func_convert_core_file_wine_to_w32_result="$1"
- if test -n "$1"; then
- # Unfortunately, winepath does not exit with a non-zero error code, so we
- # are forced to check the contents of stdout. On the other hand, if the
- # command is not found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both error code of
- # zero AND non-empty stdout, which explains the odd construction:
- func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
- func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
- $SED -e "$lt_sed_naive_backslashify"`
- else
- func_convert_core_file_wine_to_w32_result=
- fi
- fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
- $opt_debug
- # unfortunately, winepath doesn't convert paths, only file names
- func_convert_core_path_wine_to_w32_result=""
- if test -n "$1"; then
- oldIFS=$IFS
- IFS=:
- for func_convert_core_path_wine_to_w32_f in $1; do
- IFS=$oldIFS
- func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
- if test -n "$func_convert_core_file_wine_to_w32_result" ; then
- if test -z "$func_convert_core_path_wine_to_w32_result"; then
- func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
- else
- func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
- fi
- fi
- done
- IFS=$oldIFS
- fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
- $opt_debug
- if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
- func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
- if test "$?" -ne 0; then
- # on failure, ensure result is empty
- func_cygpath_result=
- fi
- else
- func_cygpath_result=
- func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
- fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format. Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
- $opt_debug
- # awkward: cmd appends spaces to result
- func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
- $opt_debug
- if test -z "$2" && test -n "$1" ; then
- func_error "Could not determine host file name corresponding to"
- func_error " \`$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_file_result="$1"
- fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
- $opt_debug
- if test -z "$4" && test -n "$3"; then
- func_error "Could not determine the host path corresponding to"
- func_error " \`$3'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This is a deliberately simplistic "conversion" and
- # should not be "improved". See libtool.info.
- if test "x$1" != "x$2"; then
- lt_replace_pathsep_chars="s|$1|$2|g"
- func_to_host_path_result=`echo "$3" |
- $SED -e "$lt_replace_pathsep_chars"`
- else
- func_to_host_path_result="$3"
- fi
- fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
- $opt_debug
- case $4 in
- $1 ) func_to_host_path_result="$3$func_to_host_path_result"
- ;;
- esac
- case $4 in
- $2 ) func_append func_to_host_path_result "$3"
- ;;
- esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via `$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
- $opt_debug
- $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result. If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
- $opt_debug
- case ,$2, in
- *,"$to_tool_file_cmd",*)
- func_to_tool_file_result=$1
- ;;
- *)
- $to_tool_file_cmd "$1"
- func_to_tool_file_result=$func_to_host_file_result
- ;;
- esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
- func_to_host_file_result="$1"
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_msys_to_w32_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
- # LT_CYGPATH in this case.
- func_to_host_file_result=`cygpath -m "$1"`
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format. Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_file_wine_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_cygpath -u "$func_convert_core_msys_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
- $opt_debug
- func_to_host_file_result="$1"
- if test -n "$1"; then
- # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
- func_convert_core_file_wine_to_w32 "$1"
- func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via `$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format. If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-# file name conversion function : func_convert_file_X_to_Y ()
-# path conversion function : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same. If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
- $opt_debug
- if test -z "$to_host_path_cmd"; then
- func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
- to_host_path_cmd="func_convert_path_${func_stripname_result}"
- fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
- $opt_debug
- func_init_to_host_path_cmd
- $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
- func_to_host_path_result="$1"
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from ARG. MSYS
- # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
- # and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_msys_to_w32_result"
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format. Requires a wine environment and
-# a working winepath. Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
- fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
- $opt_debug
- func_to_host_path_result="$1"
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
- fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
- $opt_debug
- # Get the compilation command and the source file.
- base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
- pie_flag=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg="$arg"
- arg_mode=normal
- ;;
-
- target )
- libobj="$arg"
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- test -n "$libobj" && \
- func_fatal_error "you cannot specify \`-o' more than once"
- arg_mode=target
- continue
- ;;
-
- -pie | -fpie | -fPIE)
- func_append pie_flag " $arg"
- continue
- ;;
-
- -shared | -static | -prefer-pic | -prefer-non-pic)
- func_append later " $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
- func_append_quoted lastarg "$arg"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$lastarg"
- lastarg=$func_stripname_result
-
- # Add the arguments to base_compile.
- func_append base_compile " $lastarg"
- continue
- ;;
-
- *)
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg="$srcfile"
- srcfile="$arg"
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- func_append_quoted base_compile "$lastarg"
- done # for arg
-
- case $arg_mode in
- arg)
- func_fatal_error "you must specify an argument for -Xcompile"
- ;;
- target)
- func_fatal_error "you must specify a target with \`-o'"
- ;;
- *)
- # Get the name of the library object.
- test -z "$libobj" && {
- func_basename "$srcfile"
- libobj="$func_basename_result"
- }
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- case $libobj in
- *.[cCFSifmso] | \
- *.ada | *.adb | *.ads | *.asm | \
- *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
- func_xform "$libobj"
- libobj=$func_xform_result
- ;;
- esac
-
- case $libobj in
- *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
- *)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- continue
- ;;
-
- -static)
- build_libtool_libs=no
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
- && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && func_warning "libobj name \`$libobj' may not contain shell special characters."
- func_dirname_and_basename "$obj" "/" ""
- objname="$func_basename_result"
- xdir="$func_dirname_result"
- lobj=${xdir}$objdir/$objname
-
- test -z "$base_compile" && \
- func_fatal_help "you must specify a compilation command"
-
- # Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
- pic_mode=default
- ;;
- esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- $ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
- func_append removelist " $output_obj"
- $ECHO "$srcfile" > "$lockfile"
- fi
-
- $opt_dry_run || $RM $removelist
- func_append removelist " $lockfile"
- trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
- func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
- srcfile=$func_to_tool_file_result
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- func_mkdir_p "$xdir$objdir"
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- func_append command " -o $lobj"
- fi
-
- func_show_eval_locale "$command" \
- 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- func_show_eval '$MV "$output_obj" "$lobj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile$pie_flag"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- func_append command " -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- func_append command "$suppress_output"
- func_show_eval_locale "$command" \
- '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- func_show_eval '$MV "$output_obj" "$obj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
- fi
-
- $opt_dry_run || {
- func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- removelist=$lockfile
- $RM "$lockfile"
- fi
- }
-
- exit $EXIT_SUCCESS
-}
-
-$opt_help || {
- test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
- # We need to display help for each of the modes.
- case $opt_mode in
- "")
- # Generic help is extracted from the usage comments
- # at the start of this file.
- func_help
- ;;
-
- clean)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
- compile)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -no-suppress do not suppress compiler output for multiple passes
- -prefer-pic try to build PIC objects only
- -prefer-non-pic try to build non-PIC objects only
- -shared do not build a \`.o' file suitable for static linking
- -static only build a \`.o' file suitable for static linking
- -Wc,FLAG pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
- ;;
-
- execute)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
- finish)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
- ;;
-
- install)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
- -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
- link)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -bindir BINDIR specify path to binaries directory (for systems where
- libraries must be found in the PATH setting at runtime)
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -shared only do dynamic linking of libtool libraries
- -shrext SUFFIX override the standard shared library file extension
- -static do not do any dynamic linking of uninstalled libtool libraries
- -static-libtool-libs
- do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
- -weak LIBNAME declare that the target provides the LIBNAME interface
- -Wc,FLAG
- -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
- -Wl,FLAG
- -Xlinker FLAG pass linker-specific FLAG directly to the linker
- -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename. Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
- uninstall)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
- *)
- func_fatal_help "invalid operation mode \`$opt_mode'"
- ;;
- esac
-
- echo
- $ECHO "Try \`$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
- if test "$opt_help" = :; then
- func_mode_help
- else
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- func_mode_help
- done
- } | sed -n '1p; 2,$s/^Usage:/ or: /p'
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- echo
- func_mode_help
- done
- } |
- sed '1d
- /^When reporting/,/^Report/{
- H
- d
- }
- $x
- /information about other modes/d
- /more detailed .*MODE/d
- s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
- fi
- exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
- $opt_debug
- # The first argument is the command name.
- cmd="$nonopt"
- test -z "$cmd" && \
- func_fatal_help "you must specify a COMMAND"
-
- # Handle -dlopen flags immediately.
- for file in $opt_dlopen; do
- test -f "$file" \
- || func_fatal_help "\`$file' is not a file"
-
- dir=
- case $file in
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$lib' is not a valid libtool archive"
-
- # Read the libtool library.
- dlname=
- library_names=
- func_source "$file"
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && \
- func_warning "\`$file' was not linked with \`-export-dynamic'"
- continue
- fi
-
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
-
- if test -f "$dir/$objdir/$dlname"; then
- func_append dir "/$objdir"
- else
- if test ! -f "$dir/$dlname"; then
- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
- fi
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- ;;
-
- *)
- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic="$magic"
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -* | *.la | *.lo ) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if func_ltwrapper_script_p "$file"; then
- func_source "$file"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- elif func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- func_source "$func_ltwrapper_scriptname_result"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- func_append_quoted args "$file"
- done
-
- if test "X$opt_dry_run" = Xfalse; then
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- do
- eval "if test \"\${save_$lt_var+set}\" = set; then
- $lt_var=\$save_$lt_var; export $lt_var
- else
- $lt_unset $lt_var
- fi"
- done
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
- echo "export $shlibpath_var"
- fi
- $ECHO "$cmd$args"
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
- $opt_debug
- libs=
- libdirs=
- admincmds=
-
- for opt in "$nonopt" ${1+"$@"}
- do
- if test -d "$opt"; then
- func_append libdirs " $opt"
-
- elif test -f "$opt"; then
- if func_lalib_unsafe_p "$opt"; then
- func_append libs " $opt"
- else
- func_warning "\`$opt' is not a valid libtool archive"
- fi
-
- else
- func_fatal_error "invalid argument \`$opt'"
- fi
- done
-
- if test -n "$libs"; then
- if test -n "$lt_sysroot"; then
- sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
- sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
- else
- sysroot_cmd=
- fi
-
- # Remove sysroot references
- if $opt_dry_run; then
- for lib in $libs; do
- echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
- done
- else
- tmpdir=`func_mktempdir`
- for lib in $libs; do
- sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
- > $tmpdir/tmp-la
- mv -f $tmpdir/tmp-la $lib
- done
- ${RM}r "$tmpdir"
- fi
- fi
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || func_append admincmds "
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- $opt_silent && exit $EXIT_SUCCESS
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- echo "----------------------------------------------------------------------"
- echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $ECHO " $libdir"
- done
- echo
- echo "If you ever happen to want to link against installed libraries"
- echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- echo " during execution"
- fi
- if test -n "$runpath_var"; then
- echo " - add LIBDIR to the \`$runpath_var' environment variable"
- echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $ECHO " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $ECHO " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- echo
-
- echo "See any operating system documentation about shared libraries for"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- echo "pages."
- ;;
- *)
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- echo "----------------------------------------------------------------------"
- fi
- exit $EXIT_SUCCESS
-}
-
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
- $opt_debug
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
- # Allow the use of GNU shtool's install command.
- case $nonopt in *shtool*) :;; *) false;; esac; then
- # Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
- arg=$1
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- func_quote_for_eval "$arg"
- func_append install_prog "$func_quote_for_eval_result"
- install_shared_prog=$install_prog
- case " $install_prog " in
- *[\\\ /]cp\ *) install_cp=: ;;
- *) install_cp=false ;;
- esac
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=no
- stripme=
- no_mode=:
- for arg
- do
- arg2=
- if test -n "$dest"; then
- func_append files " $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=yes ;;
- -f)
- if $install_cp; then :; else
- prev=$arg
- fi
- ;;
- -g | -m | -o)
- prev=$arg
- ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- if test "x$prev" = x-m && test -n "$install_override_mode"; then
- arg2=$install_override_mode
- no_mode=false
- fi
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- func_append install_prog " $func_quote_for_eval_result"
- if test -n "$arg2"; then
- func_quote_for_eval "$arg2"
- fi
- func_append install_shared_prog " $func_quote_for_eval_result"
- done
-
- test -z "$install_prog" && \
- func_fatal_help "you must specify an install program"
-
- test -n "$prev" && \
- func_fatal_help "the \`$prev' option requires an argument"
-
- if test -n "$install_override_mode" && $no_mode; then
- if $install_cp; then :; else
- func_quote_for_eval "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_for_eval_result"
- fi
- fi
-
- if test -z "$files"; then
- if test -z "$dest"; then
- func_fatal_help "no file or destination specified"
- else
- func_fatal_help "you must specify a destination"
- fi
- fi
-
- # Strip any trailing slash from the destination.
- func_stripname '' '/' "$dest"
- dest=$func_stripname_result
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
- destname=
- else
- func_dirname_and_basename "$dest" "" "."
- destdir="$func_dirname_result"
- destname="$func_basename_result"
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files; shift
- test "$#" -gt 1 && \
- func_fatal_help "\`$dest' is not a directory"
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- func_fatal_help "\`$destdir' must be an absolute directory name"
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- func_append staticlibs " $file"
- ;;
-
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$file' is not a valid libtool archive"
-
- library_names=
- old_library=
- relink_command=
- func_source "$file"
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) func_append current_libdirs " $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) func_append future_libdirs " $libdir" ;;
- esac
- fi
-
- func_dirname "$file" "/" ""
- dir="$func_dirname_result"
- func_append dir "$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
- else
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
- fi
-
- func_warning "relinking \`$file'"
- func_show_eval "$relink_command" \
- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
- fi
-
- # See the names of the shared library.
- set dummy $library_names; shift
- if test -n "$1"; then
- realname="$1"
- shift
-
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
-
- # Install the shared library and build the symlinks.
- func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
- 'exit $?'
- tstripme="$stripme"
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- case $realname in
- *.dll.a)
- tstripme=""
- ;;
- esac
- ;;
- esac
- if test -n "$tstripme" && test -n "$striplib"; then
- func_show_eval "$striplib $destdir/$realname" 'exit $?'
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- test "$linkname" != "$realname" \
- && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
- done
- fi
-
- # Do each command in the postinstall commands.
- lib="$destdir/$realname"
- func_execute_cmds "$postinstall_cmds" 'exit $?'
- fi
-
- # Install the pseudo-library for information purposes.
- func_basename "$file"
- name="$func_basename_result"
- instname="$dir/$name"i
- func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
- # Maybe install the static library, too.
- test -n "$old_library" && func_append staticlibs " $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- func_lo2o "$destfile"
- staticdest=$func_lo2o_result
- ;;
- *.$objext)
- staticdest="$destfile"
- destfile=
- ;;
- *)
- func_fatal_help "cannot copy a libtool object to \`$destfile'"
- ;;
- esac
-
- # Install the libtool object if requested.
- test -n "$destfile" && \
- func_show_eval "$install_prog $file $destfile" 'exit $?'
-
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- func_lo2o "$file"
- staticobj=$func_lo2o_result
- func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=""
- case $file in
- *.exe)
- if test ! -f "$file"; then
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- stripped_ext=".exe"
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin* | *mingw*)
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- wrapper=$func_ltwrapper_scriptname_result
- else
- func_stripname '' '.exe' "$file"
- wrapper=$func_stripname_result
- fi
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if func_ltwrapper_script_p "$wrapper"; then
- notinst_deplibs=
- relink_command=
-
- func_source "$wrapper"
-
- # Check the variables that should have been set.
- test -z "$generated_by_libtool_version" && \
- func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
- finalize=yes
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- func_source "$lib"
- fi
- libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
- if test -n "$libdir" && test ! -f "$libfile"; then
- func_warning "\`$lib' has not been installed in \`$libdir'"
- finalize=no
- fi
- done
-
- relink_command=
- func_source "$wrapper"
-
- outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
- $opt_dry_run || {
- if test "$finalize" = yes; then
- tmpdir=`func_mktempdir`
- func_basename "$file$stripped_ext"
- file="$func_basename_result"
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
- $opt_silent || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
- }
- if eval "$relink_command"; then :
- else
- func_error "error: relink \`$file' with the above command before installing it"
- $opt_dry_run || ${RM}r "$tmpdir"
- continue
- fi
- file="$outputname"
- else
- func_warning "cannot relink \`$file'"
- fi
- }
- else
- # Install the binary that we compiled earlier.
- file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- func_stripname '' '.exe' "$destfile"
- destfile=$func_stripname_result
- ;;
- esac
- ;;
- esac
- func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
- $opt_dry_run || if test -n "$outputname"; then
- ${RM}r "$tmpdir"
- fi
- ;;
- esac
- done
-
- for file in $staticlibs; do
- func_basename "$file"
- name="$func_basename_result"
-
- # Set up the ranlib parameters.
- oldlib="$destdir/$name"
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
-
- func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
- fi
-
- # Do each command in the postinstall commands.
- func_execute_cmds "$old_postinstall_cmds" 'exit $?'
- done
-
- test -n "$future_libdirs" && \
- func_warning "remember to run \`$progname --finish$future_libdirs'"
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- $opt_dry_run && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
- $opt_debug
- my_outputname="$1"
- my_originator="$2"
- my_pic_p="${3-no}"
- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
- my_dlsyms=
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- my_dlsyms="${my_outputname}S.c"
- else
- func_error "not configured to extract global symbols from dlpreopened files"
- fi
- fi
-
- if test -n "$my_dlsyms"; then
- case $my_dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${my_outputname}.nm"
-
- func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
- # Parse the name list into a source file.
- func_verbose "creating $output_objdir/$my_dlsyms"
-
- $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test "$dlself" = yes; then
- func_verbose "generating symbol list for \`$output'"
-
- $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- for progfile in $progfiles; do
- func_to_tool_file "$progfile" func_convert_file_msys_to_w32
- func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
- $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $opt_dry_run || {
- eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- if test -n "$export_symbols_regex"; then
- $opt_dry_run || {
- eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
- $opt_dry_run || {
- $RM $export_symbols
- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- else
- $opt_dry_run || {
- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- fi
- fi
-
- for dlprefile in $dlprefiles; do
- func_verbose "extracting global C symbols from \`$dlprefile'"
- func_basename "$dlprefile"
- name="$func_basename_result"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- # if an import library, we need to obtain dlname
- if func_win32_import_lib_p "$dlprefile"; then
- func_tr_sh "$dlprefile"
- eval "curr_lafile=\$libfile_$func_tr_sh_result"
- dlprefile_dlbasename=""
- if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
- # Use subshell, to avoid clobbering current variable values
- dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
- if test -n "$dlprefile_dlname" ; then
- func_basename "$dlprefile_dlname"
- dlprefile_dlbasename="$func_basename_result"
- else
- # no lafile. user explicitly requested -dlpreopen <import library>.
- $sharedlib_from_linklib_cmd "$dlprefile"
- dlprefile_dlbasename=$sharedlib_from_linklib_result
- fi
- fi
- $opt_dry_run || {
- if test -n "$dlprefile_dlbasename" ; then
- eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
- else
- func_warning "Could not compute DLL name from $name"
- eval '$ECHO ": $name " >> "$nlist"'
- fi
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
- }
- else # not an import lib
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- fi
- ;;
- *)
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- ;;
- esac
- done
-
- $opt_dry_run || {
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $MV "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if $GREP -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- $GREP -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
- else
- echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
- fi
-
- echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols. */
-typedef struct {
- const char *name;
- void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
- { \"$my_originator\", (void *) 0 },"
-
- case $need_lib_prefix in
- no)
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- *)
- eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- esac
- echo >> "$output_objdir/$my_dlsyms" "\
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- } # !$opt_dry_run
-
- pic_flag_for_symtable=
- case "$compile_command " in
- *" -static "*) ;;
- *)
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
- *-*-hpux*)
- pic_flag_for_symtable=" $pic_flag" ;;
- *)
- if test "X$my_pic_p" != Xno; then
- pic_flag_for_symtable=" $pic_flag"
- fi
- ;;
- esac
- ;;
- esac
- symtab_cflags=
- for arg in $LTCFLAGS; do
- case $arg in
- -pie | -fpie | -fPIE) ;;
- *) func_append symtab_cflags " $arg" ;;
- esac
- done
-
- # Now compile the dynamic symbol file.
- func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
- # Clean up the generated files.
- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
- # Transform the symbol file into the correct name.
- symfileobj="$output_objdir/${my_outputname}S.$objext"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- if test -f "$output_objdir/$my_outputname.def"; then
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- else
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- fi
- ;;
- *)
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- ;;
- esac
- ;;
- *)
- func_fatal_error "unknown suffix for \`$my_dlsyms'"
- ;;
- esac
- else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
-
- # Nullify the symbol file.
- compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
- fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
- $opt_debug
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
- $SED -n -e '
- 1,100{
- / I /{
- s,.*,import,
- p
- q
- }
- }'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
- $opt_debug
- sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
- $opt_debug
- match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
- $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
- $SED '/^Contents of section '"$match_literal"':/{
- # Place marker at beginning of archive member dllname section
- s/.*/====MARK====/
- p
- d
- }
- # These lines can sometimes be longer than 43 characters, but
- # are always uninteresting
- /:[ ]*file format pe[i]\{,1\}-/d
- /^In archive [^:]*:/d
- # Ensure marker is printed
- /^====MARK====/p
- # Remove all lines with less than 43 characters
- /^.\{43\}/!d
- # From remaining lines, remove first 43 characters
- s/^.\{43\}//' |
- $SED -n '
- # Join marker and all lines until next marker into a single line
- /^====MARK====/ b para
- H
- $ b para
- b
- :para
- x
- s/\n//g
- # Remove the marker
- s/^====MARK====//
- # Remove trailing dots and whitespace
- s/[\. \t]*$//
- # Print
- /./p' |
- # we now have a list, one entry per line, of the stringified
- # contents of the appropriate section of all members of the
- # archive which possess that section. Heuristic: eliminate
- # all those which have a first or second character that is
- # a '.' (that is, objdump's representation of an unprintable
- # character.) This should work for all archives with less than
- # 0x302f exports -- but will fail for DLLs whose name actually
- # begins with a literal '.' or a single character followed by
- # a '.'.
- #
- # Of those that remain, print the first one.
- $SED -e '/^\./d;/^.\./d;q'
-}
-
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
- test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
- test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
- $opt_debug
- if func_cygming_gnu_implib_p "$1" ; then
- # binutils import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
- elif func_cygming_ms_implib_p "$1" ; then
- # ms-generated import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
- else
- # unknown
- sharedlib_from_linklib_result=""
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- $opt_debug
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
- if test "$lock_old_archive_extraction" = yes; then
- lockfile=$f_ex_an_ar_oldlib.lock
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
- fi
- func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
- 'stat=$?; rm -f "$lockfile"; exit $stat'
- if test "$lock_old_archive_extraction" = yes; then
- $opt_dry_run || rm -f "$lockfile"
- fi
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
- fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- $opt_debug
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- func_basename "$my_xlib"
- my_xlib="$func_basename_result"
- my_xlib_u=$my_xlib
- while :; do
- case " $extracted_archives " in
- *" $my_xlib_u "*)
- func_arith $extracted_serial + 1
- extracted_serial=$func_arith_result
- my_xlib_u=lt$extracted_serial-$my_xlib ;;
- *) break ;;
- esac
- done
- extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
-
- func_mkdir_p "$my_xdir"
-
- case $host in
- *-darwin*)
- func_verbose "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- $opt_dry_run || {
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`basename "$darwin_archive"`
- darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
- if test -n "$darwin_arches"; then
- darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we've a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
- $LIPO -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- $RM -rf unfat-$$
- cd "$darwin_orig_dir"
- else
- cd $darwin_orig_dir
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- } # !$opt_dry_run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
- done
-
- func_extract_archives_result="$my_oldobjs"
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable. Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take. If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
- func_emit_wrapper_arg1=${1-no}
-
- $ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variables:
- generated_by_libtool_version='$macro_version'
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$ECHO are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- file=\"\$0\""
-
- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
- $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
- ECHO=\"$qECHO\"
- fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
- lt_script_arg0=\$0
- shift
- for lt_opt
- do
- case \"\$lt_opt\" in
- --lt-debug) lt_option_debug=1 ;;
- --lt-dump-script)
- lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
- test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
- lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
- cat \"\$lt_dump_D/\$lt_dump_F\"
- exit 0
- ;;
- --lt-*)
- \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
- exit 1
- ;;
- esac
- done
-
- # Print the debug banner immediately:
- if test -n \"\$lt_option_debug\"; then
- echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
- fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
- lt_dump_args_N=1;
- for lt_arg
- do
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
- lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
- done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $ECHO "\
- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
- exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
- case \" \$* \" in
- *\\ --lt-*)
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done ;;
- esac
- func_exec_program_core \${1+\"\$@\"}
-}
-
- # Parse options
- func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
- # Find the directory that this script lives in.
- thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
- done
-
- # Usually 'no', except on cygwin/mingw when embedded into
- # the cwrapper.
- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
- if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
- # special case for '.'
- if test \"\$thisdir\" = \".\"; then
- thisdir=\`pwd\`
- fi
- # remove .libs from thisdir
- case \"\$thisdir\" in
- *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
- $objdir ) thisdir=. ;;
- esac
- fi
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test "$fast_install" = yes; then
- $ECHO "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" ||
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $MKDIR \"\$progdir\"
- else
- $RM \"\$progdir/\$file\"
- fi"
-
- $ECHO "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $ECHO \"\$relink_command_output\" >&2
- $RM \"\$progdir/\$file\"
- exit 1
- fi
- fi
-
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $RM \"\$progdir/\$program\";
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $RM \"\$progdir/\$file\"
- fi"
- else
- $ECHO "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $ECHO "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # fixup the dll searchpath if we need to.
- #
- # Fix the DLL searchpath if we need to. Do this before prepending
- # to shlibpath, because on Windows, both are PATH and uninstalled
- # libraries must come first.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- # Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $ECHO "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- $ECHO "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
- func_exec_program \${1+\"\$@\"}
- fi
- else
- # The program doesn't exist.
- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
- exit 1
- fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
- cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-*/
-EOF
- cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-# include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined(__CYGWIN__)
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined (other platforms) ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-# define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-# define _INTPTR_T_DEFINED
-# define intptr_t int
-# endif
-#elif defined(__MINGW32__)
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-#elif defined(__CYGWIN__)
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
-#endif
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#if defined(LT_DEBUGWRAPPER)
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
- cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_path "$temp_rpath"
- cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * LIB_PATH_VALUE = "";
-EOF
- fi
-
- if test -n "$dllsearchpath"; then
- func_to_host_path "$dllsearchpath:"
- cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE = "";
-EOF
- fi
-
- if test "$fast_install" = yes; then
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
- else
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
- fi
-
-
- cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int newargc;
- char *tmp_pathspec;
- char *actual_cwrapper_path;
- char *actual_cwrapper_name;
- char *target_name;
- char *lt_argv_zero;
- intptr_t rval = 127;
-
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- newargz = XMALLOC (char *, argc + 1);
-
- /* very simple arg parsing; don't want to rely on getopt
- * also, copy all non cwrapper options to newargz, except
- * argz[0], which is handled differently
- */
- newargc=0;
- for (i = 1; i < argc; i++)
- {
- if (strcmp (argv[i], dumpscript_opt) == 0)
- {
-EOF
- case "$host" in
- *mingw* | *cygwin* )
- # make stdout use "unix" line endings
- echo " setmode(1,_O_BINARY);"
- ;;
- esac
-
- cat <<"EOF"
- lt_dump_script (stdout);
- return 0;
- }
- if (strcmp (argv[i], debug_opt) == 0)
- {
- lt_debug = 1;
- continue;
- }
- if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
- {
- /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
- namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
- report an error. Otherwise, targets might begin to believe
- they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
- namespace. The first time any user complains about this, we'll
- need to make LTWRAPPER_OPTION_PREFIX a configure-time option
- or a configure.ac-settable value.
- */
- lt_fatal (__FILE__, __LINE__,
- "unrecognized %s option: '%s'",
- ltwrapper_option_prefix, argv[i]);
- }
- /* otherwise ... */
- newargz[++newargc] = xstrdup (argv[i]);
- }
- newargz[++newargc] = NULL;
-
-EOF
- cat <<EOF
- /* The GNU banner must be the first non-error debug message */
- lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
-EOF
- cat <<"EOF"
- lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
- lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
- tmp_pathspec = find_executable (argv[0]);
- if (tmp_pathspec == NULL)
- lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (before symlink chase) at: %s\n",
- tmp_pathspec);
-
- actual_cwrapper_path = chase_symlinks (tmp_pathspec);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (after symlink chase) at: %s\n",
- actual_cwrapper_path);
- XFREE (tmp_pathspec);
-
- actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
- strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
- /* wrapper name transforms */
- strendzap (actual_cwrapper_name, ".exe");
- tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
- XFREE (actual_cwrapper_name);
- actual_cwrapper_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- /* target_name transforms -- use actual target program name; might have lt- prefix */
- target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
- strendzap (target_name, ".exe");
- tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
- XFREE (target_name);
- target_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- lt_debugprintf (__FILE__, __LINE__,
- "(main) libtool target name: %s\n",
- target_name);
-EOF
-
- cat <<EOF
- newargz[0] =
- XMALLOC (char, (strlen (actual_cwrapper_path) +
- strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
- strcpy (newargz[0], actual_cwrapper_path);
- strcat (newargz[0], "$objdir");
- strcat (newargz[0], "/");
-EOF
-
- cat <<"EOF"
- /* stop here, and copy so we don't have to do this twice */
- tmp_pathspec = xstrdup (newargz[0]);
-
- /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
- strcat (newargz[0], actual_cwrapper_name);
-
- /* DO want the lt- prefix here if it exists, so use target_name */
- lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
- XFREE (tmp_pathspec);
- tmp_pathspec = NULL;
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- {
- char* p;
- while ((p = strchr (newargz[0], '\\')) != NULL)
- {
- *p = '/';
- }
- while ((p = strchr (lt_argv_zero, '\\')) != NULL)
- {
- *p = '/';
- }
- }
-EOF
- ;;
- esac
-
- cat <<"EOF"
- XFREE (target_name);
- XFREE (actual_cwrapper_path);
- XFREE (actual_cwrapper_name);
-
- lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
- lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
- be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
- because on Windows, both *_VARNAMEs are PATH but uninstalled
- libraries must come first. */
- lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
- lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
- nonnull (lt_argv_zero));
- for (i = 0; i < newargc; i++)
- {
- lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
- i, nonnull (newargz[i]));
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- /* execv doesn't actually work on mingw as expected on unix */
- newargz = prepare_spawn (newargz);
- rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
- if (rval == -1)
- {
- /* failed to start process */
- lt_debugprintf (__FILE__, __LINE__,
- "(main) failed to launch target \"%s\": %s\n",
- lt_argv_zero, nonnull (strerror (errno)));
- return 127;
- }
- return rval;
-EOF
- ;;
- *)
- cat <<"EOF"
- execv (lt_argv_zero, newargz);
- return rval; /* =127, but avoids unused variable warning */
-EOF
- ;;
- esac
-
- cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
- void *p = (void *) malloc (num);
- if (!p)
- lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
- string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char) name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable (const char *path)
-{
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0)
- && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
- return 1;
- else
- return 0;
-}
-
-int
-make_executable (const char *path)
-{
- int rval = 0;
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if (stat (path, &st) >= 0)
- {
- rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
- }
- return rval;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise
- Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
- int has_slash = 0;
- const char *p;
- const char *p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- int tmp_len;
- char *concat_name;
-
- lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
- nonempty (wrapper));
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char *path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char *q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR (*q))
- break;
- p_len = q - p;
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name =
- XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name =
- XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
- return xstrdup (pathspec);
-#else
- char buf[LT_PATHMAX];
- struct stat s;
- char *tmp_pathspec = xstrdup (pathspec);
- char *p;
- int has_symlinks = 0;
- while (strlen (tmp_pathspec) && !has_symlinks)
- {
- lt_debugprintf (__FILE__, __LINE__,
- "checking path component for symlinks: %s\n",
- tmp_pathspec);
- if (lstat (tmp_pathspec, &s) == 0)
- {
- if (S_ISLNK (s.st_mode) != 0)
- {
- has_symlinks = 1;
- break;
- }
-
- /* search backwards for last DIR_SEPARATOR */
- p = tmp_pathspec + strlen (tmp_pathspec) - 1;
- while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- p--;
- if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- {
- /* no more DIR_SEPARATORS left */
- break;
- }
- *p = '\0';
- }
- else
- {
- lt_fatal (__FILE__, __LINE__,
- "error accessing file \"%s\": %s",
- tmp_pathspec, nonnull (strerror (errno)));
- }
- }
- XFREE (tmp_pathspec);
-
- if (!has_symlinks)
- {
- return xstrdup (pathspec);
- }
-
- tmp_pathspec = realpath (pathspec, buf);
- if (tmp_pathspec == 0)
- {
- lt_fatal (__FILE__, __LINE__,
- "could not follow symlinks for %s", pathspec);
- }
- return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert (str != NULL);
- assert (pat != NULL);
-
- len = strlen (str);
- patlen = strlen (pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (strcmp (str, pat) == 0)
- *str = '\0';
- }
- return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
- va_list args;
- if (lt_debug)
- {
- (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
- va_start (args, fmt);
- (void) vfprintf (stderr, fmt, args);
- va_end (args);
- }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
- int line, const char *mode,
- const char *message, va_list ap)
-{
- fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
- va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
- return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
- return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_setenv) setting '%s' to '%s'\n",
- nonnull (name), nonnull (value));
- {
-#ifdef HAVE_SETENV
- /* always make a copy, for consistency with !HAVE_SETENV */
- char *str = xstrdup (value);
- setenv (name, str, 1);
-#else
- int len = strlen (name) + 1 + strlen (value) + 1;
- char *str = XMALLOC (char, len);
- sprintf (str, "%s=%s", name, value);
- if (putenv (str) != EXIT_SUCCESS)
- {
- XFREE (str);
- }
-#endif
- }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
- char *new_value;
- if (orig_value && *orig_value)
- {
- int orig_value_len = strlen (orig_value);
- int add_len = strlen (add);
- new_value = XMALLOC (char, add_len + orig_value_len + 1);
- if (to_end)
- {
- strcpy (new_value, orig_value);
- strcpy (new_value + orig_value_len, add);
- }
- else
- {
- strcpy (new_value, add);
- strcpy (new_value + add_len, orig_value);
- }
- }
- else
- {
- new_value = xstrdup (add);
- }
- return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- /* some systems can't cope with a ':'-terminated path #' */
- int len = strlen (new_value);
- while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
- {
- new_value[len-1] = '\0';
- }
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-EOF
- case $host_os in
- mingw*)
- cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
- Note that spawn() does not by itself call the command interpreter
- (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
- ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&v);
- v.dwPlatformId == VER_PLATFORM_WIN32_NT;
- }) ? "cmd.exe" : "command.com").
- Instead it simply concatenates the arguments, separated by ' ', and calls
- CreateProcess(). We must quote the arguments since Win32 CreateProcess()
- interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
- special way:
- - Space and tab are interpreted as delimiters. They are not treated as
- delimiters if they are surrounded by double quotes: "...".
- - Unescaped double quotes are removed from the input. Their only effect is
- that within double quotes, space and tab are treated like normal
- characters.
- - Backslashes not followed by double quotes are not special.
- - But 2*n+1 backslashes followed by a double quote become
- n backslashes followed by a double quote (n >= 0):
- \" -> "
- \\\" -> \"
- \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
- size_t argc;
- char **new_argv;
- size_t i;
-
- /* Count number of arguments. */
- for (argc = 0; argv[argc] != NULL; argc++)
- ;
-
- /* Allocate new argument vector. */
- new_argv = XMALLOC (char *, argc + 1);
-
- /* Put quoted arguments into the new argument vector. */
- for (i = 0; i < argc; i++)
- {
- const char *string = argv[i];
-
- if (string[0] == '\0')
- new_argv[i] = xstrdup ("\"\"");
- else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
- {
- int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
- size_t length;
- unsigned int backslashes;
- const char *s;
- char *quoted_string;
- char *p;
-
- length = 0;
- backslashes = 0;
- if (quote_around)
- length++;
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- length += backslashes + 1;
- length++;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- length += backslashes + 1;
-
- quoted_string = XMALLOC (char, length + 1);
-
- p = quoted_string;
- backslashes = 0;
- if (quote_around)
- *p++ = '"';
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- {
- unsigned int j;
- for (j = backslashes + 1; j > 0; j--)
- *p++ = '\\';
- }
- *p++ = c;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- {
- unsigned int j;
- for (j = backslashes; j > 0; j--)
- *p++ = '\\';
- *p++ = '"';
- }
- *p = '\0';
-
- new_argv[i] = quoted_string;
- }
- else
- new_argv[i] = (char *) string;
- }
- new_argv[argc] = NULL;
-
- return new_argv;
-}
-EOF
- ;;
- esac
-
- cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
- func_emit_wrapper yes |
- $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/ fputs ("\1", f);/p
-g
-D'
- cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
- $opt_debug
- case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
- *import*) : ;;
- *) false ;;
- esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
- $opt_debug
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args=$nonopt
- base_compile="$nonopt $@"
- compile_command=$nonopt
- finalize_command=$nonopt
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
- new_inherited_linker_flags=
-
- avoid_version=no
- bindir=
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
- weak_libs=
- single_module="${wl}-single_module"
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- break
- ;;
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- func_warning "complete static linking is impossible in this configuration"
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- -static)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- ;;
- -static-libtool-libs)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- esac
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg="$1"
- shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- func_append compile_command " @OUTPUT@"
- func_append finalize_command " @OUTPUT@"
- ;;
- esac
-
- case $prev in
- bindir)
- bindir="$arg"
- prev=
- continue
- ;;
- dlfiles|dlprefiles)
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- func_append compile_command " @SYMFILE@"
- func_append finalize_command " @SYMFILE@"
- preload=yes
- fi
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test "$dlself" = no; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test "$prev" = dlprefiles; then
- dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test "$prev" = dlfiles; then
- func_append dlfiles " $arg"
- else
- func_append dlprefiles " $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols="$arg"
- test -f "$arg" \
- || func_fatal_error "symbol file \`$arg' does not exist"
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex="$arg"
- prev=
- continue
- ;;
- framework)
- case $host in
- *-*-darwin*)
- case "$deplibs " in
- *" $qarg.ltframework "*) ;;
- *) func_append deplibs " $qarg.ltframework" # this is fixed later
- ;;
- esac
- ;;
- esac
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir="$arg"
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat "$save_arg"`
- do
-# func_append moreargs " $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- func_append dlfiles " $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- func_append dlprefiles " $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "\`$arg' is not a valid libtool object"
- fi
- fi
- done
- else
- func_fatal_error "link input file \`$arg' does not exist"
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- if test "$prev" = rpath; then
- case "$rpath " in
- *" $arg "*) ;;
- *) func_append rpath " $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) func_append xrpath " $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- shrext)
- shrext_cmds="$arg"
- prev=
- continue
- ;;
- weak)
- func_append weak_libs " $arg"
- prev=
- continue
- ;;
- xcclinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xcompiler)
- func_append compiler_flags " $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xlinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $wl$qarg"
- prev=
- func_append compile_command " $wl$qarg"
- func_append finalize_command " $wl$qarg"
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg="$arg"
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- # See comment for -static flag below, for more details.
- func_append compile_command " $link_static_flag"
- func_append finalize_command " $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- func_fatal_error "\`-allow-undefined' must not be used because it is the default"
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -bindir)
- prev=bindir
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- func_fatal_error "more than one -exported-symbols argument is not allowed"
- fi
- if test "X$arg" = "X-export-symbols"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework)
- prev=framework
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- func_stripname "-L" '' "$arg"
- if test -z "$func_stripname_result"; then
- if test "$#" -gt 0; then
- func_fatal_error "require no space between \`-L' and \`$1'"
- else
- func_fatal_error "need path for \`-L' option"
- fi
- fi
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- test -z "$absdir" && \
- func_fatal_error "cannot determine absolute directory name of \`$dir'"
- dir="$absdir"
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "* | *" $arg "*)
- # Will only happen for absolute or sysroot arguments
- ;;
- *)
- # Preserve sysroot, but never include relative directories
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
- *) func_append deplibs " -L$dir" ;;
- esac
- func_append lib_search_path " $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- ::) dllsearchpath=$dir;;
- *) func_append dllsearchpath ":$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- func_append deplibs " System.ltframework"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- func_append deplibs " $arg"
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- # Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- case "$new_inherited_linker_flags " in
- *" $arg "*) ;;
- * ) func_append new_inherited_linker_flags " $arg" ;;
- esac
- continue
- ;;
-
- -multi_module)
- single_module="${wl}-multi_module"
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
- # The PATH hackery in wrapper scripts is required on Windows
- # and Darwin in order for the loader to find any dlls it needs.
- func_warning "\`-no-install' is ignored for $host"
- func_warning "assuming \`-no-fast-install' instead"
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- func_stripname '-R' '' "$arg"
- dir=$func_stripname_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
- continue
- ;;
-
- -shared)
- # The effects of -shared are defined in a previous loop.
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -static | -static-libtool-libs)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
-
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -weak)
- prev=weak
- continue
- ;;
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$flag"
- func_append arg " $func_quote_for_eval_result"
- func_append compiler_flags " $func_quote_for_eval_result"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Wl,*)
- func_stripname '-Wl,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$flag"
- func_append arg " $wl$func_quote_for_eval_result"
- func_append compiler_flags " $wl$func_quote_for_eval_result"
- func_append linker_flags " $func_quote_for_eval_result"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # -msg_* for osf cc
- -msg_*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
-
- # Flags to be passed through unchanged, with rationale:
- # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
- # -r[0-9][0-9]* specify processor for the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
- # +DA*, +DD* enable 64-bit mode for the HP compiler
- # -q* compiler args for the IBM compiler
- # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
- # -F/path path to uninstalled frameworks, gcc on darwin
- # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
- # @file GCC response files
- # -tp=* Portland pgcc target processor selection
- # --sysroot=* for sysroot support
- # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- func_append compiler_flags " $arg"
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
-
- *.$objext)
- # A standard object.
- func_append objs " $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- func_append dlfiles " $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- func_append dlprefiles " $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "\`$arg' is not a valid libtool object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- func_append deplibs " $arg"
- func_append old_deplibs " $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- func_resolve_sysroot "$arg"
- if test "$prev" = dlfiles; then
- # This library was specified with -dlopen.
- func_append dlfiles " $func_resolve_sysroot_result"
- prev=
- elif test "$prev" = dlprefiles; then
- # The library was specified with -dlpreopen.
- func_append dlprefiles " $func_resolve_sysroot_result"
- prev=
- else
- func_append deplibs " $func_resolve_sysroot_result"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
- done # argument parsing loop
-
- test -n "$prev" && \
- func_fatal_help "the \`$prevarg' option requires an argument"
-
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- func_basename "$output"
- outputname="$func_basename_result"
- libobjs_save="$libobjs"
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- func_dirname "$output" "/" ""
- output_objdir="$func_dirname_result$objdir"
- func_to_tool_file "$output_objdir/"
- tool_output_objdir=$func_to_tool_file_result
- # Create the object directory.
- func_mkdir_p "$output_objdir"
-
- # Determine the type of output
- case $output in
- "")
- func_fatal_help "you must specify an output file"
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if $opt_preserve_dup_deps ; then
- case "$libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append libs " $deplib"
- done
-
- if test "$linkmode" = lib; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if $opt_duplicate_compiler_generated_deps; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
- esac
- func_append pre_post_deps " $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- notinst_path= # paths that contain not-installed libtool libraries
-
- case $linkmode in
- lib)
- passes="conv dlpreopen link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=no
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
-
- for pass in $passes; do
- # The preopen pass in lib mode reverses $deplibs; put it back here
- # so that -L comes before libs that need it for instance...
- if test "$linkmode,$pass" = "lib,link"; then
- ## FIXME: Find the place where the list is rebuilt in the wrong
- ## order, and fix it there properly
- tmp_deplibs=
- for deplib in $deplibs; do
- tmp_deplibs="$deplib $tmp_deplibs"
- done
- deplibs="$tmp_deplibs"
- fi
-
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
- if test "$linkmode" = prog; then
- case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
- link)
- libs="$deplibs %DEPLIBS%"
- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
- esac
- fi
- if test "$linkmode,$pass" = "lib,dlpreopen"; then
- # Collect and forward deplibs of preopened libtool libs
- for lib in $dlprefiles; do
- # Ignore non-libtool-libs
- dependency_libs=
- func_resolve_sysroot "$lib"
- case $lib in
- *.la) func_source "$func_resolve_sysroot_result" ;;
- esac
-
- # Collect preopened libtool deplibs, except any this library
- # has declared as weak libs
- for deplib in $dependency_libs; do
- func_basename "$deplib"
- deplib_base=$func_basename_result
- case " $weak_libs " in
- *" $deplib_base "*) ;;
- *) func_append deplibs " $deplib" ;;
- esac
- done
- done
- libs="$dlprefiles"
- fi
- if test "$pass" = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
-
- for deplib in $libs; do
- lib=
- found=no
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- func_append compiler_flags " $deplib"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- func_warning "\`-l' is ignored for archives/objects"
- continue
- fi
- func_stripname '-l' '' "$deplib"
- name=$func_stripname_result
- if test "$linkmode" = lib; then
- searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
- else
- searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
- fi
- for searchdir in $searchdirs; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
- if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
- else
- found=no
- fi
- break 2
- fi
- done
- done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if func_lalib_p "$lib"; then
- library_names=
- old_library=
- func_source "$lib"
- for l in $old_library $library_names; do
- ll="$l"
- done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
- lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- fi
- ;; # -l
- *.ltframework)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
- newdependency_libs="$deplib $newdependency_libs"
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- prog)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test "$pass" = scan; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- *)
- func_warning "\`-L' is ignored for archives/objects"
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test "$pass" = link; then
- func_stripname '-R' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la)
- func_resolve_sysroot "$deplib"
- lib=$func_resolve_sysroot_result
- ;;
- *.$libext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- # Linking convenience modules into shared libraries is allowed,
- # but linking other static libraries is non-portable.
- case " $dlpreconveniencelibs " in
- *" $deplib "*) ;;
- *)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
- valid_a_lib=yes
- ;;
- esac
- if test "$valid_a_lib" != yes; then
- echo
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because the file extensions .$libext of this argument makes me believe"
- echo "*** that it is just a static archive that I should not use here."
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- ;;
- esac
- continue
- ;;
- prog)
- if test "$pass" != link; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- func_append newdlprefiles " $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- func_append newdlfiles " $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=yes
- continue
- ;;
- esac # case $deplib
-
- if test "$found" = yes || test -f "$lib"; then :
- else
- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
- fi
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$lib" \
- || func_fatal_error "\`$lib' is not a valid libtool archive"
-
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- inherited_linker_flags=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- func_source "$lib"
-
- # Convert "-framework foo" to "foo.ltframework"
- if test -n "$inherited_linker_flags"; then
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
- for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- case " $new_inherited_linker_flags " in
- *" $tmp_inherited_linker_flag "*) ;;
- *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
- esac
- done
- fi
- dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && func_append dlfiles " $dlopen"
- test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
- fi
-
- if test "$pass" = conv; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
- fi
- # It is a libtool convenience library, so add in its objects.
- func_append convenience " $ladir/$objdir/$old_library"
- func_append old_convenience " $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
- fi
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- if test -n "$old_library" &&
- { test "$prefer_static_libs" = yes ||
- test "$prefer_static_libs,$installed" = "built,no"; }; then
- linklib=$old_library
- else
- for l in $old_library $library_names; do
- linklib="$l"
- done
- fi
- if test -z "$linklib"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
- fi
-
- # This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
- fi
- if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- func_append dlprefiles " $lib $dependency_libs"
- else
- func_append newdlfiles " $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- func_warning "cannot determine absolute directory name of \`$ladir'"
- func_warning "passing it literally to the linker, although it might fail"
- abs_ladir="$ladir"
- fi
- ;;
- esac
- func_basename "$lib"
- laname="$func_basename_result"
-
- # Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
- if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- func_warning "library \`$lib' was moved."
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
- else
- dir="$lt_sysroot$libdir"
- absdir="$lt_sysroot$libdir"
- fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
- # Remove this search path later
- func_append notinst_path " $abs_ladir"
- else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
- # Remove this search path later
- func_append notinst_path " $abs_ladir"
- fi
- fi # $installed = yes
- func_stripname 'lib' '.la' "$laname"
- name=$func_stripname_result
-
- # This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir" && test "$linkmode" = prog; then
- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
- fi
- case "$host" in
- # special handling for platforms with PE-DLLs.
- *cygwin* | *mingw* | *cegcc* )
- # Linker will automatically link against shared library if both
- # static and shared are present. Therefore, ensure we extract
- # symbols from the import library if a shared library is present
- # (otherwise, the dlopen module name will be incorrect). We do
- # this by putting the import library name into $newdlprefiles.
- # We recover the dlopen module name by 'saving' the la file
- # name in a special purpose variable, and (later) extracting the
- # dlname from the la file.
- if test -n "$dlname"; then
- func_tr_sh "$dir/$linklib"
- eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
- func_append newdlprefiles " $dir/$linklib"
- else
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- fi
- ;;
- * )
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- func_append newdlprefiles " $dir/$dlname"
- else
- func_append newdlprefiles " $dir/$linklib"
- fi
- ;;
- esac
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test "$linkmode" = lib; then
- deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test "$linkmode" = prog && test "$pass" != link; then
- func_append newlib_search_path " $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- esac
- # Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
- test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath:" in
- *"$absdir:"*) ;;
- *) func_append temp_rpath "$absdir:" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc*)
- # No point in relinking DLLs because paths are not encoded
- func_append notinst_deplibs " $lib"
- need_relink=no
- ;;
- *)
- if test "$installed" = no; then
- func_append notinst_deplibs " $lib"
- need_relink=yes
- fi
- ;;
- esac
- # This is a shared library
-
- # Warn about portability, can't link against -module's on some
- # systems (darwin). Don't bleat about dlopened modules though!
- dlopenmodule=""
- for dlpremoduletest in $dlprefiles; do
- if test "X$dlpremoduletest" = "X$lib"; then
- dlopenmodule="$dlpremoduletest"
- break
- fi
- done
- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
- echo
- if test "$linkmode" = prog; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
- else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $ECHO "*** $linklib is not portable!"
- fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- shift
- realname="$1"
- shift
- libname=`eval "\\$ECHO \"$libname_spec\""`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname="$dlname"
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw* | *cegcc*)
- func_arith $current - $age
- major=$func_arith_result
- versuffix="-$major"
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
- func_basename "$soroot"
- soname="$func_basename_result"
- func_stripname 'lib' '.dll' "$soname"
- newlib=libimp-$func_stripname_result.a
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- func_verbose "extracting exported symbol list from \`$soname'"
- func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- func_verbose "generating import library for \`$soname'"
- func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test "$linkmode" = prog || test "$opt_mode" != relink; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
- *-*-darwin* )
- # if the lib is a (non-dlopened) module then we can not
- # link against it, someone is ignoring the earlier warnings
- if /usr/bin/file -L $add 2> /dev/null |
- $GREP ": [^:]* bundle" >/dev/null ; then
- if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- echo
- echo "*** And there doesn't seem to be a static archive available"
- echo "*** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- elif test -n "$old_library"; then
- add="$dir/$old_library"
- fi
- fi
- esac
- elif test "$hardcode_minus_L" = no; then
- case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
- esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$absdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test "$lib_linked" != yes; then
- func_fatal_configuration "unsupported hardcode properties"
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) func_append compile_shlibpath "$add_shlibpath:" ;;
- esac
- fi
- if test "$linkmode" = prog; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes &&
- test "$hardcode_minus_L" != yes &&
- test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test "$linkmode" = prog || test "$opt_mode" = relink; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
- esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
- else
- add="$libdir/$linklib"
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- fi
-
- if test "$linkmode" = prog; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test "$linkmode" = prog; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test "$build_libtool_libs" = yes; then
- # Not a shared library
- if test "$deplibs_check_method" != pass_all; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
- # Just print a warning and add the library to dependency_libs so
- # that the program can be linked against the static library.
- echo
- $ECHO "*** Warning: This system can not link to static lib archive $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
- if test "$module" = yes; then
- echo "*** But as you try to build a module library, libtool will still create "
- echo "*** a static module, that should work as long as the dlopening application"
- echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
- if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- else
- deplibs="$dir/$old_library $deplibs"
- link_static=yes
- fi
- fi # link shared/static library?
-
- if test "$linkmode" = lib; then
- if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
- # Extract -R from dependency_libs
- temp_deplibs=
- for libdir in $dependency_libs; do
- case $libdir in
- -R*) func_stripname '-R' '' "$libdir"
- temp_xrpath=$func_stripname_result
- case " $xrpath " in
- *" $temp_xrpath "*) ;;
- *) func_append xrpath " $temp_xrpath";;
- esac;;
- *) func_append temp_deplibs " $libdir";;
- esac
- done
- dependency_libs="$temp_deplibs"
- fi
-
- func_append newlib_search_path " $absdir"
- # Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- # ... and its dependency_libs
- tmp_libs=
- for deplib in $dependency_libs; do
- newdependency_libs="$deplib $newdependency_libs"
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result";;
- *) func_resolve_sysroot "$deplib" ;;
- esac
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $func_resolve_sysroot_result "*)
- func_append specialdeplibs " $func_resolve_sysroot_result" ;;
- esac
- fi
- func_append tmp_libs " $func_resolve_sysroot_result"
- done
-
- if test "$link_all_deplibs" != no; then
- # Add the search paths of all dependency libraries
- for deplib in $dependency_libs; do
- path=
- case $deplib in
- -L*) path="$deplib" ;;
- *.la)
- func_resolve_sysroot "$deplib"
- deplib=$func_resolve_sysroot_result
- func_dirname "$deplib" "" "."
- dir=$func_dirname_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- func_warning "cannot determine absolute directory name of \`$dir'"
- absdir="$dir"
- fi
- ;;
- esac
- if $GREP "^installed=no" $deplib > /dev/null; then
- case $host in
- *-*-darwin*)
- depdepl=
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
- depdepl=$tmp
- done
- if test -f "$absdir/$objdir/$depdepl" ; then
- depdepl="$absdir/$objdir/$depdepl"
- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- if test -z "$darwin_install_name"; then
- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- fi
- func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
- path=
- fi
- fi
- ;;
- *)
- path="-L$absdir/$objdir"
- ;;
- esac
- else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- test "$absdir" != "$libdir" && \
- func_warning "\`$deplib' seems to be moved"
-
- path="-L$absdir"
- fi
- ;;
- esac
- case " $deplibs " in
- *" $path "*) ;;
- *) deplibs="$path $deplibs" ;;
- esac
- done
- fi # link_all_deplibs != no
- fi # linkmode = lib
- done # for deplib in $libs
- if test "$pass" = link; then
- if test "$linkmode" = "prog"; then
- compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
- finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
- else
- compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- fi
- fi
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
- # Link the dlpreopened libraries before other libraries
- for deplib in $save_deplibs; do
- deplibs="$deplib $deplibs"
- done
- fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
- # Make sure lib_search_path contains only unique directories.
- lib_search_path=
- for dir in $newlib_search_path; do
- case "$lib_search_path " in
- *" $dir "*) ;;
- *) func_append lib_search_path " $dir" ;;
- esac
- done
- newlib_search_path=
- fi
-
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
- else
- vars="compile_deplibs finalize_deplibs"
- fi
- for var in $vars dependency_libs; do
- # Add libraries to $var in reverse order
- eval tmp_libs=\"\$$var\"
- new_libs=
- for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
- *)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
- esac
- ;;
- esac
- done
- tmp_libs=
- for deplib in $new_libs; do
- case $deplib in
- -L*)
- case " $tmp_libs " in
- *" $deplib "*) ;;
- *) func_append tmp_libs " $deplib" ;;
- esac
- ;;
- *) func_append tmp_libs " $deplib" ;;
- esac
- done
- eval $var=\"$tmp_libs\"
- done # for var
- fi
- # Last step: remove runtime libs from dependency_libs
- # (they stay in deplibs)
- tmp_libs=
- for i in $dependency_libs ; do
- case " $predeps $postdeps $compiler_lib_search_path " in
- *" $i "*)
- i=""
- ;;
- esac
- if test -n "$i" ; then
- func_append tmp_libs " $i"
- fi
- done
- dependency_libs=$tmp_libs
- done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
- fi
- if test "$linkmode" = prog || test "$linkmode" = lib; then
- dlprefiles="$newdlprefiles"
- fi
-
- case $linkmode in
- oldlib)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for archives"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for archives" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for archives"
-
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for archives"
-
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for archives"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for archives"
-
- test -n "$export_symbols$export_symbols_regex" && \
- func_warning "\`-export-symbols' is ignored for archives"
-
- # Now set the variables for building old libraries.
- build_libtool_libs=no
- oldlibs="$output"
- func_append objs "$old_deplibs"
- ;;
-
- lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
- case $outputname in
- lib*)
- func_stripname 'lib' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- ;;
- *)
- test "$module" = no && \
- func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
- if test "$need_lib_prefix" != no; then
- # Add the "lib" prefix for modules if required
- func_stripname '' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- else
- func_stripname '' '.la' "$outputname"
- libname=$func_stripname_result
- fi
- ;;
- esac
-
- if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
- func_append libobjs " $objs"
- fi
- fi
-
- test "$dlself" != no && \
- func_warning "\`-dlopen self' is ignored for libtool libraries"
-
- set dummy $rpath
- shift
- test "$#" -gt 1 && \
- func_warning "ignoring multiple \`-rpath's for a libtool library"
-
- install_libdir="$1"
-
- oldlibs=
- if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
- # Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
- # convenience libraries should have the same extension an
- # archive normally would.
- oldlibs="$output_objdir/$libname.$libext $oldlibs"
- build_libtool_libs=convenience
- build_old_libs=yes
- fi
-
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for convenience libraries"
- else
-
- # Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
- set dummy $vinfo 0 0 0
- shift
- IFS="$save_ifs"
-
- test -n "$7" && \
- func_fatal_help "too many parameters to \`-version-info'"
-
- # convert absolute version numbers to libtool ages
- # this retains compatibility with .la files and attempts
- # to make the code below a bit more comprehensible
-
- case $vinfo_number in
- yes)
- number_major="$1"
- number_minor="$2"
- number_revision="$3"
- #
- # There are really only two kinds -- those that
- # use the current revision as the major version
- # and those that subtract age and use age as
- # a minor version. But, then there is irix
- # which has an extra 1 added just for fun
- #
- case $version_type in
- # correct linux to gnu/linux during the next big refactor
- darwin|linux|osf|windows|none)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age="$number_minor"
- revision="$number_revision"
- ;;
- freebsd-aout|freebsd-elf|qnx|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
- ;;
- irix|nonstopux)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age="$number_minor"
- revision="$number_minor"
- lt_irix_increment=no
- ;;
- *)
- func_fatal_configuration "$modename: unknown library version type \`$version_type'"
- ;;
- esac
- ;;
- no)
- current="$1"
- revision="$2"
- age="$3"
- ;;
- esac
-
- # Check that each of the things are valid numbers.
- case $current in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "CURRENT \`$current' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- case $revision in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "REVISION \`$revision' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- case $age in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "AGE \`$age' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- if test "$age" -gt "$current"; then
- func_error "AGE \`$age' is greater than the current interface number \`$current'"
- func_fatal_error "\`$vinfo' is not valid version information"
- fi
-
- # Calculate the version variables.
- major=
- versuffix=
- verstring=
- case $version_type in
- none) ;;
-
- darwin)
- # Like Linux, but with the current version available in
- # verstring for coding it into the library header
- func_arith $current - $age
- major=.$func_arith_result
- versuffix="$major.$age.$revision"
- # Darwin ld doesn't like 0 for these options...
- func_arith $current + 1
- minor_current=$func_arith_result
- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
- ;;
-
- freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
- ;;
-
- freebsd-elf)
- major=".$current"
- versuffix=".$current"
- ;;
-
- irix | nonstopux)
- if test "X$lt_irix_increment" = "Xno"; then
- func_arith $current - $age
- else
- func_arith $current - $age + 1
- fi
- major=$func_arith_result
-
- case $version_type in
- nonstopux) verstring_prefix=nonstopux ;;
- *) verstring_prefix=sgi ;;
- esac
- verstring="$verstring_prefix$major.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$revision
- while test "$loop" -ne 0; do
- func_arith $revision - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring="$verstring_prefix$major.$iface:$verstring"
- done
-
- # Before this point, $major must not contain `.'.
- major=.$major
- versuffix="$major.$revision"
- ;;
-
- linux) # correct to gnu/linux during the next big refactor
- func_arith $current - $age
- major=.$func_arith_result
- versuffix="$major.$age.$revision"
- ;;
-
- osf)
- func_arith $current - $age
- major=.$func_arith_result
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$age
- while test "$loop" -ne 0; do
- func_arith $current - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring="$verstring:${iface}.0"
- done
-
- # Make executables depend on our current version.
- func_append verstring ":${current}.0"
- ;;
-
- qnx)
- major=".$current"
- versuffix=".$current"
- ;;
-
- sunos)
- major=".$current"
- versuffix=".$current.$revision"
- ;;
-
- windows)
- # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
- func_arith $current - $age
- major=$func_arith_result
- versuffix="-$major"
- ;;
-
- *)
- func_fatal_configuration "unknown library version type \`$version_type'"
- ;;
- esac
-
- # Clear the version info if we defaulted, and they specified a release.
- if test -z "$vinfo" && test -n "$release"; then
- major=
- case $version_type in
- darwin)
- # we can't check for "0.0" in archive_cmds due to quoting
- # problems, so we reset it completely
- verstring=
- ;;
- *)
- verstring="0.0"
- ;;
- esac
- if test "$need_version" = no; then
- versuffix=
- else
- versuffix=".0.0"
- fi
- fi
-
- # Remove version info from name if versioning should be avoided
- if test "$avoid_version" = yes && test "$need_version" = no; then
- major=
- versuffix=
- verstring=""
- fi
-
- # Check to see if the archive will have undefined symbols.
- if test "$allow_undefined" = yes; then
- if test "$allow_undefined_flag" = unsupported; then
- func_warning "undefined symbols not allowed in $host shared libraries"
- build_libtool_libs=no
- build_old_libs=yes
- fi
- else
- # Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
- fi
-
- fi
-
- func_generate_dlsyms "$libname" "$libname" "yes"
- func_append libobjs " $symfileobj"
- test "X$libobjs" = "X " && libobjs=
-
- if test "$opt_mode" != relink; then
- # Remove our outputs, but don't remove object files since they
- # may have been created when compiling PIC objects.
- removelist=
- tempremovelist=`$ECHO "$output_objdir/*"`
- for p in $tempremovelist; do
- case $p in
- *.$objext | *.gcno)
- ;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
- if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
- continue
- fi
- fi
- func_append removelist " $p"
- ;;
- *) ;;
- esac
- done
- test -n "$removelist" && \
- func_show_eval "${RM}r \$removelist"
- fi
-
- # Now set the variables for building old libraries.
- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- func_append oldlibs " $output_objdir/$libname.$libext"
-
- # Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
- fi
-
- # Eliminate all temporary directories.
- #for path in $notinst_path; do
- # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
- # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
- # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
- #done
-
- if test -n "$xrpath"; then
- # If the user specified any rpath flags, then add them.
- temp_xrpath=
- for libdir in $xrpath; do
- func_replace_sysroot "$libdir"
- func_append temp_xrpath " -R$func_replace_sysroot_result"
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- dependency_libs="$temp_xrpath $dependency_libs"
- fi
- fi
-
- # Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
- dlfiles=
- for lib in $old_dlfiles; do
- case " $dlprefiles $dlfiles " in
- *" $lib "*) ;;
- *) func_append dlfiles " $lib" ;;
- esac
- done
-
- # Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
- dlprefiles=
- for lib in $old_dlprefiles; do
- case "$dlprefiles " in
- *" $lib "*) ;;
- *) func_append dlprefiles " $lib" ;;
- esac
- done
-
- if test "$build_libtool_libs" = yes; then
- if test -n "$rpath"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
- # these systems don't actually have a c library (as such)!
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C library is in the System framework
- func_append deplibs " System.ltframework"
- ;;
- *-*-netbsd*)
- # Don't link with libc until the a.out ld.so is fixed.
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
- # Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
- func_append deplibs " -lc"
- fi
- ;;
- esac
- fi
-
- # Transform deplibs into only deplibs that can be linked in shared.
- name_save=$name
- libname_save=$libname
- release_save=$release
- versuffix_save=$versuffix
- major_save=$major
- # I'm not sure if I'm treating the release correctly. I think
- # release should show up in the -l (ie -lgmp5) so we don't want to
- # add it in twice. Is that correct?
- release=""
- versuffix=""
- major=""
- newdeplibs=
- droppeddeps=no
- case $deplibs_check_method in
- pass_all)
- # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behavior.
- newdeplibs=$deplibs
- ;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which I believe you do not have"
- echo "*** because a test_compile did reveal that the linker did not use it for"
- echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because a test_compile did reveal that the linker did not use this one"
- echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- echo "*** make it link in! You will probably need to install it or some"
- echo "*** library that it depends on before this library will be fully"
- echo "*** functional. Installing it before continuing would be even better."
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method; shift
- file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- if test -n "$file_magic_glob"; then
- libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
- else
- libnameglob=$libname
- fi
- test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- if test "$want_nocaseglob" = yes; then
- shopt -s nocaseglob
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- $nocaseglob
- else
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- fi
- for potent_lib in $potential_libs; do
- # Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null |
- $GREP " -> " >/dev/null; then
- continue
- fi
- # The statement above tries to avoid entering an
- # endless loop below, in case of cyclic links.
- # We might still enter an endless loop, since a link
- # loop can be closed while we follow links,
- # but so what?
- potlib="$potent_lib"
- while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
- esac
- done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- $SED -e 10q |
- $EGREP "$file_magic_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a file magic. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
- $EGREP "$match_pattern_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a regex pattern. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- none | unknown | *)
- newdeplibs=""
- tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
- # can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
- done
- fi
- case $tmp_deplibs in
- *[!\ \ ]*)
- echo
- if test "X$deplibs_check_method" = "Xnone"; then
- echo "*** Warning: inter-library dependencies are not supported in this platform."
- else
- echo "*** Warning: inter-library dependencies are not known to be supported."
- fi
- echo "*** All declared inter-library dependencies are being dropped."
- droppeddeps=yes
- ;;
- esac
- ;;
- esac
- versuffix=$versuffix_save
- major=$major_save
- release=$release_save
- libname=$libname_save
- name=$name_save
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library with the System framework
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
- echo
- echo "*** Warning: libtool could not satisfy all declared inter-library"
- $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- echo "*** a static module, that should work as long as the dlopening"
- echo "*** application is linked with the -dlopen flag."
- if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- else
- echo "*** The inter-library dependencies that have been dropped here will be"
- echo "*** automatically added whenever a program is linked with this library"
- echo "*** or is declared to -dlopen it."
-
- if test "$allow_undefined" = no; then
- echo
- echo "*** Since this library must not contain undefined symbols,"
- echo "*** because either the platform does not support them or"
- echo "*** it was explicitly requested with -no-undefined,"
- echo "*** libtool will only create a static version of it."
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- fi
- fi
- # Done checking deplibs!
- deplibs=$newdeplibs
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- case $host in
- *-*-darwin*)
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- deplibs="$new_libs"
-
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
- # Test again, we may have decided not to build it any more
- if test "$build_libtool_libs" = yes; then
- # Remove ${wl} instances when linking with ld.
- # FIXME: should test the right _cmds variable.
- case $archive_cmds in
- *\$LD\ *) wl= ;;
- esac
- if test "$hardcode_into_libs" = yes; then
- # Hardcode the library paths
- hardcode_libdirs=
- dep_rpath=
- rpath="$finalize_rpath"
- test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
- for libdir in $rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- func_replace_sysroot "$libdir"
- libdir=$func_replace_sysroot_result
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append dep_rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
- fi
- if test -n "$runpath_var" && test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- func_append rpath "$dir:"
- done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- fi
-
- shlibpath="$finalize_shlibpath"
- test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
-
- # Get the real and link names of the library.
- eval shared_ext=\"$shrext_cmds\"
- eval library_names=\"$library_names_spec\"
- set dummy $library_names
- shift
- realname="$1"
- shift
-
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
- if test -z "$dlname"; then
- dlname=$soname
- fi
-
- lib="$output_objdir/$realname"
- linknames=
- for link
- do
- func_append linknames " $link"
- done
-
- # Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- test "X$libobjs" = "X " && libobjs=
-
- delfiles=
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- export_symbols="$output_objdir/$libname.uexp"
- func_append delfiles " $export_symbols"
- fi
-
- orig_export_symbols=
- case $host_os in
- cygwin* | mingw* | cegcc*)
- if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
- # exporting using user supplied symfile
- if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
- # and it's NOT already a .def file. Must figure out
- # which of the given symbols are data symbols and tag
- # them as such. So, trigger use of export_symbols_cmds.
- # export_symbols gets reassigned inside the "prepare
- # the list of exported symbols" if statement, so the
- # include_expsyms logic still works.
- orig_export_symbols="$export_symbols"
- export_symbols=
- always_export_symbols=yes
- fi
- fi
- ;;
- esac
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd1 in $cmds; do
- IFS="$save_ifs"
- # Take the normal branch if the nm_file_list_spec branch
- # doesn't work or if tool conversion is not needed.
- case $nm_file_list_spec~$to_tool_file_cmd in
- *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
- try_normal_branch=yes
- eval cmd=\"$cmd1\"
- func_len " $cmd"
- len=$func_len_result
- ;;
- *)
- try_normal_branch=no
- ;;
- esac
- if test "$try_normal_branch" = yes \
- && { test "$len" -lt "$max_cmd_len" \
- || test "$max_cmd_len" -le -1; }
- then
- func_show_eval "$cmd" 'exit $?'
- skipped_export=false
- elif test -n "$nm_file_list_spec"; then
- func_basename "$output"
- output_la=$func_basename_result
- save_libobjs=$libobjs
- save_output=$output
- output=${output_objdir}/${output_la}.nm
- func_to_tool_file "$output"
- libobjs=$nm_file_list_spec$func_to_tool_file_result
- func_append delfiles " $output"
- func_verbose "creating $NM input file list: $output"
- for obj in $save_libobjs; do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > "$output"
- eval cmd=\"$cmd1\"
- func_show_eval "$cmd" 'exit $?'
- output=$save_output
- libobjs=$save_libobjs
- skipped_export=false
- else
- # The command line is too long to execute in one step.
- func_verbose "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
- fi
- done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
- fi
-
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
-
- tmp_deplibs=
- for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- func_append tmp_deplibs " $test_deplib"
- ;;
- esac
- done
- deplibs="$tmp_deplibs"
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec" &&
- test "$compiler_needs_object" = yes &&
- test -z "$libobjs"; then
- # extract the archives, so we have objects to list.
- # TODO: could optimize this to just extract one archive.
- whole_archive_flag_spec=
- fi
- if test -n "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- else
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $convenience
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
- fi
-
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
- func_append linker_flags " $flag"
- fi
-
- # Make a backup of the uninstalled library when relinking
- if test "$opt_mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
- fi
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- eval test_cmds=\"$module_expsym_cmds\"
- cmds=$module_expsym_cmds
- else
- eval test_cmds=\"$module_cmds\"
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
- fi
- fi
-
- if test "X$skipped_export" != "X:" &&
- func_len " $test_cmds" &&
- len=$func_len_result &&
- test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- :
- else
- # The command line is too long to link in one step, link piecewise
- # or, if using GNU ld and skipped_export is not :, use a linker
- # script.
-
- # Save the value of $output and $libobjs because we want to
- # use them later. If we have whole_archive_flag_spec, we
- # want to use save_libobjs as it was before
- # whole_archive_flag_spec was expanded, because we can't
- # assume the linker understands whole_archive_flag_spec.
- # This may have to be revisited, in case too many
- # convenience libraries get linked in and end up exceeding
- # the spec.
- if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- fi
- save_output=$output
- func_basename "$output"
- output_la=$func_basename_result
-
- # Clear the reloadable object creation command queue and
- # initialize k to one.
- test_cmds=
- concat_cmds=
- objlist=
- last_robj=
- k=1
-
- if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- output=${output_objdir}/${output_la}.lnkscript
- func_verbose "creating GNU ld script: $output"
- echo 'INPUT (' > $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- output=${output_objdir}/${output_la}.lnk
- func_verbose "creating linker input file list: $output"
- : > $output
- set x $save_libobjs
- shift
- firstobj=
- if test "$compiler_needs_object" = yes; then
- firstobj="$1 "
- shift
- fi
- for obj
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
- else
- if test -n "$save_libobjs"; then
- func_verbose "creating reloadable object files..."
- output=$output_objdir/$output_la-${k}.$objext
- eval test_cmds=\"$reload_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
-
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- if test "X$objlist" = X ||
- test "$len" -lt "$max_cmd_len"; then
- func_append objlist " $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test "$k" -eq 1 ; then
- # The first file doesn't have a previous command to add.
- reload_objs=$objlist
- eval concat_cmds=\"$reload_cmds\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-${k}.$objext
- func_arith $k + 1
- k=$func_arith_result
- output=$output_objdir/$output_la-${k}.$objext
- objlist=" $obj"
- func_len " $last_robj"
- func_arith $len0 + $func_len_result
- len=$func_arith_result
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
- fi
- func_append delfiles " $output"
-
- else
- output=
- fi
-
- if ${skipped_export-false}; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
- fi
- fi
-
- test -n "$save_libobjs" &&
- func_verbose "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
- for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- if test -n "$export_symbols_regex" && ${skipped_export-false}; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
-
- if ${skipped_export-false}; then
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
- fi
-
- libobjs=$output
- # Restore the value of output.
- output=$save_output
-
- if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- fi
- # Expand the library linking commands again to reset the
- # value of $libobjs for piecewise linking.
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- cmds=$module_expsym_cmds
- else
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
- fi
- fi
- fi
-
- if test -n "$delfiles"; then
- # Append the command to remove temporary files to $cmds.
- eval cmds=\"\$cmds~\$RM $delfiles\"
- fi
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $dlprefiles
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
-
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- # Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- func_show_eval '${RM}r "$gentop"'
- fi
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- # Create links to the real library.
- for linkname in $linknames; do
- if test "$realname" != "$linkname"; then
- func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
- fi
- done
-
- # If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
- # On all known operating systems, these are identical.
- dlname="$soname"
- fi
- fi
- ;;
-
- obj)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for objects"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for objects" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for objects"
-
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for objects"
-
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for objects"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for objects"
-
- case $output in
- *.lo)
- test -n "$objs$old_deplibs" && \
- func_fatal_error "cannot build library object \`$output' from non-libtool objects"
-
- libobj=$output
- func_lo2o "$libobj"
- obj=$func_lo2o_result
- ;;
- *)
- libobj=
- obj="$output"
- ;;
- esac
-
- # Delete the old objects.
- $opt_dry_run || $RM $obj $libobj
-
- # Objects from convenience libraries. This assumes
- # single-version convenience libraries. Whenever we create
- # different ones for PIC/non-PIC, this we'll have to duplicate
- # the extraction.
- reload_conv_objs=
- gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
- wl=
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
- else
- gentop="$output_objdir/${obj}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $convenience
- reload_conv_objs="$reload_objs $func_extract_archives_result"
- fi
- fi
-
- # If we're not building shared, we need to use non_pic_objs
- test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
-
- # Create the old-style object.
- reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
- output="$obj"
- func_execute_cmds "$reload_cmds" 'exit $?'
-
- # Exit if we aren't doing a library object file.
- if test -z "$libobj"; then
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$build_libtool_libs" != yes; then
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- # Create an invalid libtool object if no PIC, so that we don't
- # accidentally link it into a program.
- # $show "echo timestamp > $libobj"
- # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test -n "$pic_flag" || test "$pic_mode" != default; then
- # Only do commands if we really have different PIC objects.
- reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
- func_execute_cmds "$reload_cmds" 'exit $?'
- fi
-
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- prog)
- case $host in
- *cygwin*) func_stripname '' '.exe' "$output"
- output=$func_stripname_result.exe;;
- esac
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for programs"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for programs"
-
- test "$preload" = yes \
- && test "$dlopen_support" = unknown \
- && test "$dlopen_self" = unknown \
- && test "$dlopen_self_static" = unknown && \
- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- case $host in
- *-*-darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- # But is supposedly fixed on 10.4 or later (yay!).
- if test "$tagname" = CXX ; then
- case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 10.[0123])
- func_append compile_command " ${wl}-bind_at_load"
- func_append finalize_command " ${wl}-bind_at_load"
- ;;
- esac
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- compile_deplibs="$new_libs"
-
-
- func_append compile_command " $compile_deplibs"
- func_append finalize_command " $finalize_deplibs"
-
- if test -n "$rpath$xrpath"; then
- # If the user specified any rpath flags, then add them.
- for libdir in $rpath $xrpath; do
- # This is the magic to use -rpath.
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- done
- fi
-
- # Now hardcode the library paths
- rpath=
- hardcode_libdirs=
- for libdir in $compile_rpath $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
- esac
- fi
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$libdir:"*) ;;
- ::) dllsearchpath=$libdir;;
- *) func_append dllsearchpath ":$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
- esac
- ;;
- esac
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- compile_rpath="$rpath"
-
- rpath=
- hardcode_libdirs=
- for libdir in $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$finalize_perm_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_perm_rpath " $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- finalize_rpath="$rpath"
-
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
- # Transform all the library objects into standard objects.
- compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
- finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
- fi
-
- func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
-
- # template prelinking step
- if test -n "$prelink_cmds"; then
- func_execute_cmds "$prelink_cmds" 'exit $?'
- fi
-
- wrappers_required=yes
- case $host in
- *cegcc* | *mingw32ce*)
- # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
- wrappers_required=no
- ;;
- *cygwin* | *mingw* )
- if test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- *)
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- esac
- if test "$wrappers_required" = no; then
- # Replace the output file specification.
- compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- link_command="$compile_command$compile_rpath"
-
- # We have no uninstalled library dependencies, so finalize right now.
- exit_status=0
- func_show_eval "$link_command" 'exit_status=$?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- # Delete the generated files.
- if test -f "$output_objdir/${outputname}S.${objext}"; then
- func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
- fi
-
- exit $exit_status
- fi
-
- if test -n "$compile_shlibpath$finalize_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- fi
- if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- fi
-
- compile_var=
- finalize_var=
- if test -n "$runpath_var"; then
- if test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- func_append rpath "$dir:"
- done
- compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- if test -n "$finalize_perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $finalize_perm_rpath; do
- func_append rpath "$dir:"
- done
- finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- fi
-
- if test "$no_install" = yes; then
- # We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
- # Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- # Delete the old output file.
- $opt_dry_run || $RM $output
- # Link the executable and exit
- func_show_eval "$link_command" 'exit $?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
-
- func_warning "this platform does not like uninstalled shared libraries"
- func_warning "\`$output' will be relinked during installation"
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
- else
- # fast_install is set to needless
- relink_command=
- fi
- else
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
- fi
- fi
-
- # Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- # Delete the old output files.
- $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- func_show_eval "$link_command" 'exit $?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output_objdir/$outputname"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- # Now create the wrapper script.
- func_verbose "creating $output"
-
- # Quote the relink command for shipping.
- if test -n "$relink_command"; then
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- fi
-
- # Only actually do things if not in dry run mode.
- $opt_dry_run || {
- # win32 will think the script is a binary if it has
- # a .exe suffix, so we strip it off here.
- case $output in
- *.exe) func_stripname '' '.exe' "$output"
- output=$func_stripname_result ;;
- esac
- # test for cygwin because mv fails w/o .exe extensions
- case $host in
- *cygwin*)
- exeext=.exe
- func_stripname '' '.exe' "$outputname"
- outputname=$func_stripname_result ;;
- *) exeext= ;;
- esac
- case $host in
- *cygwin* | *mingw* )
- func_dirname_and_basename "$output" "" "."
- output_name=$func_basename_result
- output_path=$func_dirname_result
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
- $RM $cwrappersource $cwrapper
- trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_cwrapperexe_src > $cwrappersource
-
- # The wrapper executable is built using the $host compiler,
- # because it contains $host paths and files. If cross-
- # compiling, it, like the target executable, must be
- # executed on the $host or under an emulation environment.
- $opt_dry_run || {
- $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
- $STRIP $cwrapper
- }
-
- # Now, create the wrapper script for func_source use:
- func_ltwrapper_scriptname $cwrapper
- $RM $func_ltwrapper_scriptname_result
- trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
- $opt_dry_run || {
- # note: this script will not be executed, so do not chmod.
- if test "x$build" = "x$host" ; then
- $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
- else
- func_emit_wrapper no > $func_ltwrapper_scriptname_result
- fi
- }
- ;;
- * )
- $RM $output
- trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_wrapper no > $output
- chmod +x $output
- ;;
- esac
- }
- exit $EXIT_SUCCESS
- ;;
- esac
-
- # See if we need to build an old-fashioned archive.
- for oldlib in $oldlibs; do
-
- if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save $symfileobj"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
- build_libtool_libs=no
- else
- oldobjs="$old_deplibs $non_pic_objects"
- if test "$preload" = yes && test -f "$symfileobj"; then
- func_append oldobjs " $symfileobj"
- fi
- fi
- addlibs="$old_convenience"
- fi
-
- if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $addlibs
- func_append oldobjs " $func_extract_archives_result"
- fi
-
- # Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=$old_archive_from_new_cmds
- else
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
-
- func_extract_archives $gentop $dlprefiles
- func_append oldobjs " $func_extract_archives_result"
- fi
-
- # POSIX demands no paths to be encoded in archives. We have
- # to avoid creating archives with duplicate basenames if we
- # might have to extract them afterwards, e.g., when creating a
- # static archive out of a convenience library, or when linking
- # the entirety of a libtool archive into another (currently
- # not supported by libtool).
- if (for obj in $oldobjs
- do
- func_basename "$obj"
- $ECHO "$func_basename_result"
- done | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- echo "copying selected object files to avoid basename conflicts..."
- gentop="$output_objdir/${outputname}x"
- func_append generated " $gentop"
- func_mkdir_p "$gentop"
- save_oldobjs=$oldobjs
- oldobjs=
- counter=1
- for obj in $save_oldobjs
- do
- func_basename "$obj"
- objbase="$func_basename_result"
- case " $oldobjs " in
- " ") oldobjs=$obj ;;
- *[\ /]"$objbase "*)
- while :; do
- # Make sure we don't pick an alternate name that also
- # overlaps.
- newobj=lt$counter-$objbase
- func_arith $counter + 1
- counter=$func_arith_result
- case " $oldobjs " in
- *[\ /]"$newobj "*) ;;
- *) if test ! -f "$gentop/$newobj"; then break; fi ;;
- esac
- done
- func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- func_append oldobjs " $gentop/$newobj"
- ;;
- *) func_append oldobjs " $obj" ;;
- esac
- done
- fi
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
- eval cmds=\"$old_archive_cmds\"
-
- func_len " $cmds"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- elif test -n "$archiver_list_spec"; then
- func_verbose "using command file archive linking..."
- for obj in $oldobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > $output_objdir/$libname.libcmd
- func_to_tool_file "$output_objdir/$libname.libcmd"
- oldobjs=" $archiver_list_spec$func_to_tool_file_result"
- cmds=$old_archive_cmds
- else
- # the command line is too long to link in one step, link in parts
- func_verbose "using piecewise archive linking..."
- save_RANLIB=$RANLIB
- RANLIB=:
- objlist=
- concat_cmds=
- save_oldobjs=$oldobjs
- oldobjs=
- # Is there a better way of finding the last object in the list?
- for obj in $save_oldobjs
- do
- last_oldobj=$obj
- done
- eval test_cmds=\"$old_archive_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
- for obj in $save_oldobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- func_append objlist " $obj"
- if test "$len" -lt "$max_cmd_len"; then
- :
- else
- # the above command should be used before it gets too long
- oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
- RANLIB=$save_RANLIB
- fi
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
- objlist=
- len=$len0
- fi
- done
- RANLIB=$save_RANLIB
- oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
- eval cmds=\"\$concat_cmds\"
- else
- eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- fi
- fi
- fi
- func_execute_cmds "$cmds" 'exit $?'
- done
-
- test -n "$generated" && \
- func_show_eval "${RM}r$generated"
-
- # Now create the libtool archive.
- case $output in
- *.la)
- old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
- func_verbose "creating $output"
-
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- # Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- if test "$hardcode_automatic" = yes ; then
- relink_command=
- fi
-
- # Only create the output if not a dry run.
- $opt_dry_run || {
- for installed in no yes; do
- if test "$installed" = yes; then
- if test -z "$install_libdir"; then
- break
- fi
- output="$output_objdir/$outputname"i
- # Replace all uninstalled libtool libraries with the installed ones
- newdependency_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- *.la)
- func_basename "$deplib"
- name="$func_basename_result"
- func_resolve_sysroot "$deplib"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
- ;;
- -L*)
- func_stripname -L '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -L$func_replace_sysroot_result"
- ;;
- -R*)
- func_stripname -R '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -R$func_replace_sysroot_result"
- ;;
- *) func_append newdependency_libs " $deplib" ;;
- esac
- done
- dependency_libs="$newdependency_libs"
- newdlfiles=
-
- for lib in $dlfiles; do
- case $lib in
- *.la)
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- *) func_append newdlfiles " $lib" ;;
- esac
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- *.la)
- # Only pass preopened files to the pseudo-archive (for
- # eventual linking with the app. that links it) if we
- # didn't already link the preopened objects directly into
- # the library:
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- esac
- done
- dlprefiles="$newdlprefiles"
- else
- newdlfiles=
- for lib in $dlfiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- func_append newdlfiles " $abs"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- func_append newdlprefiles " $abs"
- done
- dlprefiles="$newdlprefiles"
- fi
- $RM $output
- # place dlname in correct position for cygwin
- # In fact, it would be nice if we could use this code for all target
- # systems that can't hard-code library paths into their executables
- # and that have no shared library path variable independent of PATH,
- # but it turns out we can't easily determine that from inspecting
- # libtool variables, so we have to hard-code the OSs to which it
- # applies here; at the moment, that means platforms that use the PE
- # object format with DLL files. See the long comment at the top of
- # tests/bindir.at for full details.
- tdlname=$dlname
- case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
- # If a -bindir argument was supplied, place the dll there.
- if test "x$bindir" != x ;
- then
- func_relative_path "$install_libdir" "$bindir"
- tdlname=$func_relative_path_result$dlname
- else
- # Otherwise fall back on heuristic.
- tdlname=../bin/$dlname
- fi
- ;;
- esac
- $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
- $ECHO >> $output "\
-relink_command=\"$relink_command\""
- fi
- done
- }
-
- # Do a symbolic link so that the libtool archive can be found in
- # LD_LIBRARY_PATH before the program is installed.
- func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
- ;;
- esac
- exit $EXIT_SUCCESS
-}
-
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
- func_mode_link ${1+"$@"}
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
- $opt_debug
- RM="$nonopt"
- files=
- rmforce=
- exit_status=0
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- for arg
- do
- case $arg in
- -f) func_append RM " $arg"; rmforce=yes ;;
- -*) func_append RM " $arg" ;;
- *) func_append files " $arg" ;;
- esac
- done
-
- test -z "$RM" && \
- func_fatal_help "you must specify an RM program"
-
- rmdirs=
-
- for file in $files; do
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- if test "X$dir" = X.; then
- odir="$objdir"
- else
- odir="$dir/$objdir"
- fi
- func_basename "$file"
- name="$func_basename_result"
- test "$opt_mode" = uninstall && odir="$dir"
-
- # Remember odir for removal later, being careful to avoid duplicates
- if test "$opt_mode" = clean; then
- case " $rmdirs " in
- *" $odir "*) ;;
- *) func_append rmdirs " $odir" ;;
- esac
- fi
-
- # Don't error if the file doesn't exist and rm -f was used.
- if { test -L "$file"; } >/dev/null 2>&1 ||
- { test -h "$file"; } >/dev/null 2>&1 ||
- test -f "$file"; then
- :
- elif test -d "$file"; then
- exit_status=1
- continue
- elif test "$rmforce" = yes; then
- continue
- fi
-
- rmfiles="$file"
-
- case $name in
- *.la)
- # Possibly a libtool archive, so verify it.
- if func_lalib_p "$file"; then
- func_source $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- func_append rmfiles " $odir/$n"
- done
- test -n "$old_library" && func_append rmfiles " $odir/$old_library"
-
- case "$opt_mode" in
- clean)
- case " $library_names " in
- *" $dlname "*) ;;
- *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
- esac
- test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
- ;;
- uninstall)
- if test -n "$library_names"; then
- # Do each command in the postuninstall commands.
- func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
- fi
-
- if test -n "$old_library"; then
- # Do each command in the old_postuninstall commands.
- func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
- fi
- # FIXME: should reinstall the best remaining shared library.
- ;;
- esac
- fi
- ;;
-
- *.lo)
- # Possibly a libtool object, so verify it.
- if func_lalib_p "$file"; then
-
- # Read the .lo file
- func_source $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" &&
- test "$pic_object" != none; then
- func_append rmfiles " $dir/$pic_object"
- fi
-
- # Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" &&
- test "$non_pic_object" != none; then
- func_append rmfiles " $dir/$non_pic_object"
- fi
- fi
- ;;
-
- *)
- if test "$opt_mode" = clean ; then
- noexename=$name
- case $file in
- *.exe)
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- func_stripname '' '.exe' "$name"
- noexename=$func_stripname_result
- # $file with .exe has already been added to rmfiles,
- # add $file without .exe
- func_append rmfiles " $file"
- ;;
- esac
- # Do a test to see if this is a libtool program.
- if func_ltwrapper_p "$file"; then
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- relink_command=
- func_source $func_ltwrapper_scriptname_result
- func_append rmfiles " $func_ltwrapper_scriptname_result"
- else
- relink_command=
- func_source $dir/$noexename
- fi
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- func_append rmfiles " $odir/lt-$name"
- fi
- if test "X$noexename" != "X$name" ; then
- func_append rmfiles " $odir/lt-${noexename}.c"
- fi
- fi
- fi
- ;;
- esac
- func_show_eval "$RM $rmfiles" 'exit_status=1'
- done
-
- # Try to remove the ${objdir}s in the directories where we deleted files
- for dir in $rmdirs; do
- if test -d "$dir"; then
- func_show_eval "rmdir $dir >/dev/null 2>&1"
- fi
- done
-
- exit $exit_status
-}
-
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
- func_mode_uninstall ${1+"$@"}
-
-test -z "$opt_mode" && {
- help="$generic_help"
- func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$opt_mode'"
-
-if test -n "$exec_cmd"; then
- eval exec "$exec_cmd"
- exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them. This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration. But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
-# vi:sw=2
-
diff --git a/missing b/missing
deleted file mode 100755
index db98974..0000000
--- a/missing
+++ /dev/null
@@ -1,215 +0,0 @@
-#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
-
-scriptversion=2013-10-28.13; # UTC
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
-fi
-
-case $1 in
-
- --is-lightweight)
- # Used by our autoconf macros to check whether the available missing
- # script is modern enough.
- exit 0
- ;;
-
- --run)
- # Back-compat with the calling convention used by older automake.
- shift
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
-to PROGRAM being missing or too old.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
-
-Supported PROGRAM values:
- aclocal autoconf autoheader autom4te automake makeinfo
- bison yacc flex lex help2man
-
-Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
-'g' are ignored when checking the name.
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: unknown '$1' option"
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Run the given program, remember its exit status.
-"$@"; st=$?
-
-# If it succeeded, we are done.
-test $st -eq 0 && exit 0
-
-# Also exit now if we it failed (or wasn't found), and '--version' was
-# passed; such an option is passed most likely to detect whether the
-# program is present and works.
-case $2 in --version|--help) exit $st;; esac
-
-# Exit code 63 means version mismatch. This often happens when the user
-# tries to use an ancient version of a tool on a file that requires a
-# minimum version.
-if test $st -eq 63; then
- msg="probably too old"
-elif test $st -eq 127; then
- # Program was missing.
- msg="missing on your system"
-else
- # Program was found and executed, but failed. Give up.
- exit $st
-fi
-
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
-
-program_details ()
-{
- case $1 in
- aclocal|automake)
- echo "The '$1' program is part of the GNU Automake package:"
- echo "<$gnu_software_URL/automake>"
- echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/autoconf>"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- autoconf|autom4te|autoheader)
- echo "The '$1' program is part of the GNU Autoconf package:"
- echo "<$gnu_software_URL/autoconf/>"
- echo "It also requires GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- esac
-}
-
-give_advice ()
-{
- # Normalize program name to check for.
- normalized_program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
- printf '%s\n' "'$1' is $msg."
-
- configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
- case $normalized_program in
- autoconf*)
- echo "You should only need it if you modified 'configure.ac',"
- echo "or m4 files included by it."
- program_details 'autoconf'
- ;;
- autoheader*)
- echo "You should only need it if you modified 'acconfig.h' or"
- echo "$configure_deps."
- program_details 'autoheader'
- ;;
- automake*)
- echo "You should only need it if you modified 'Makefile.am' or"
- echo "$configure_deps."
- program_details 'automake'
- ;;
- aclocal*)
- echo "You should only need it if you modified 'acinclude.m4' or"
- echo "$configure_deps."
- program_details 'aclocal'
- ;;
- autom4te*)
- echo "You might have modified some maintainer files that require"
- echo "the 'autom4te' program to be rebuilt."
- program_details 'autom4te'
- ;;
- bison*|yacc*)
- echo "You should only need it if you modified a '.y' file."
- echo "You may want to install the GNU Bison package:"
- echo "<$gnu_software_URL/bison/>"
- ;;
- lex*|flex*)
- echo "You should only need it if you modified a '.l' file."
- echo "You may want to install the Fast Lexical Analyzer package:"
- echo "<$flex_URL>"
- ;;
- help2man*)
- echo "You should only need it if you modified a dependency" \
- "of a man page."
- echo "You may want to install the GNU Help2man package:"
- echo "<$gnu_software_URL/help2man/>"
- ;;
- makeinfo*)
- echo "You should only need it if you modified a '.texi' file, or"
- echo "any other file indirectly affecting the aspect of the manual."
- echo "You might want to install the Texinfo package:"
- echo "<$gnu_software_URL/texinfo/>"
- echo "The spurious makeinfo call might also be the consequence of"
- echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
- echo "want to install GNU make:"
- echo "<$gnu_software_URL/make/>"
- ;;
- *)
- echo "You might have modified some files without having the proper"
- echo "tools for further handling them. Check the 'README' file, it"
- echo "often tells you about the needed prerequisites for installing"
- echo "this package. You may also peek at any GNU archive site, in"
- echo "case some other package contains this missing '$1' program."
- ;;
- esac
-}
-
-give_advice "$1" | sed -e '1s/^/WARNING: /' \
- -e '2,$s/^/ /' >&2
-
-# Propagate the correct exit status (expected to be 127 for a program
-# not found, 63 for a program that failed due to version mismatch).
-exit $st
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644
index 07e255d..0000000
--- a/src/Makefile.in
+++ /dev/null
@@ -1,860 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-bin_PROGRAMS = ipmitool$(EXEEXT)
-sbin_PROGRAMS = ipmievd$(EXEEXT)
-subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"
-PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
-am_ipmievd_OBJECTS = ipmievd.$(OBJEXT)
-ipmievd_OBJECTS = $(am_ipmievd_OBJECTS)
-ipmievd_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la \
- plugins/libintf.la
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-am_ipmitool_OBJECTS = ipmitool.$(OBJEXT) ipmishell.$(OBJEXT)
-ipmitool_OBJECTS = $(am_ipmitool_OBJECTS)
-ipmitool_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la \
- plugins/libintf.la
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(ipmievd_SOURCES) $(ipmitool_SOURCES)
-DIST_SOURCES = $(ipmievd_SOURCES) $(ipmitool_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-SUBDIRS = plugins
-MAINTAINERCLEANFILES = Makefile.in
-ipmitool_SOURCES = ipmitool.c ipmishell.c
-ipmitool_LDADD = $(top_builddir)/lib/libipmitool.la plugins/libintf.la
-ipmievd_SOURCES = ipmievd.c
-ipmievd_LDADD = $(top_builddir)/lib/libipmitool.la plugins/libintf.la
-all: all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-install-sbinPROGRAMS: $(sbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-sbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(sbindir)" && rm -f $$files
-
-clean-sbinPROGRAMS:
- @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-
-ipmievd$(EXEEXT): $(ipmievd_OBJECTS) $(ipmievd_DEPENDENCIES) $(EXTRA_ipmievd_DEPENDENCIES)
- @rm -f ipmievd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(ipmievd_OBJECTS) $(ipmievd_LDADD) $(LIBS)
-
-ipmitool$(EXEEXT): $(ipmitool_OBJECTS) $(ipmitool_DEPENDENCIES) $(EXTRA_ipmitool_DEPENDENCIES)
- @rm -f ipmitool$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(ipmitool_OBJECTS) $(ipmitool_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmievd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmishell.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmitool.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(PROGRAMS)
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool \
- clean-sbinPROGRAMS mostlyclean-am
-
-distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-binPROGRAMS clean-generic clean-libtool \
- clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-binPROGRAMS install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-sbinPROGRAMS install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-sbinPROGRAMS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/ipmievd.c b/src/ipmievd.c
index caefd95..6a94b1f 100644
--- a/src/ipmievd.c
+++ b/src/ipmievd.c
@@ -29,8 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE 700
-#define _BSD_SOURCE
#include <stdio.h>
#include <fcntl.h>
@@ -56,8 +54,8 @@
# include <paths.h>
#endif
-#ifndef _PATH_VARRUN
-# define _PATH_VARRUN "/var/run/"
+#ifndef _PATH_RUN
+# define _PATH_RUN "/run/"
#endif
#ifdef IPMI_INTF_OPEN
@@ -84,7 +82,7 @@
#include <ipmitool/ipmi_main.h>
#define WARNING_THRESHOLD 80
-#define DEFAULT_PIDFILE _PATH_VARRUN "ipmievd.pid"
+#define DEFAULT_PIDFILE _PATH_RUN "ipmievd.pid"
char pidfile[64];
/* global variables */
@@ -125,7 +123,7 @@ static int openipmi_wait(struct ipmi_event_intf * eintf);
static int openipmi_read(struct ipmi_event_intf * eintf);
static struct ipmi_event_intf openipmi_event_intf = {
.name = "open",
- .desc = "OpenIPMI asyncronous notification of events",
+ .desc = "OpenIPMI asynchronous notification of events",
.prefix = "",
.setup = openipmi_setup,
.wait = openipmi_wait,
@@ -175,7 +173,7 @@ ipmievd_usage(void)
*
* @name: interface name to try and load
*
- * returns pointer to inteface structure if found
+ * returns pointer to interface structure if found
* returns NULL on error
*/
static struct ipmi_event_intf *
@@ -184,16 +182,17 @@ ipmi_event_intf_load(char * name)
struct ipmi_event_intf ** intf;
struct ipmi_event_intf * i;
- if (name == NULL) {
+ if (!name) {
i = ipmi_event_intf_table[0];
return i;
}
for (intf = ipmi_event_intf_table;
- ((intf != NULL) && (*intf != NULL));
- intf++) {
+ intf && *intf;
+ intf++)
+ {
i = *intf;
- if (strncmp(name, i->name, strlen(name)) == 0) {
+ if (!strcmp(name, i->name)) {
return i;
}
}
@@ -225,7 +224,7 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
float trigger_reading = 0.0;
float threshold_reading = 0.0;
- if (evt == NULL)
+ if (!evt)
return;
if (evt->record_type == 0xf0) {
@@ -239,15 +238,14 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
return;
}
- type = ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type,
- evt->sel_type.standard_type.event_data[0]);
+ type = ipmi_get_sensor_type(intf, evt->sel_type.standard_type.sensor_type);
ipmi_get_event_desc(intf, evt, &desc);
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.gen_id, evt->sel_type.standard_type.sensor_num,
evt->sel_type.standard_type.sensor_type);
- if (sdr == NULL) {
+ if (!sdr) {
/* could not find matching SDR record */
if (desc) {
lprintf(LOG_NOTICE, "%s%s sensor - %s",
@@ -333,7 +331,7 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
break;
default:
- lprintf(LOG_NOTICE, "%s%s sensor - %s",
+ lprintf(LOG_NOTICE, "%s%s sensor (0x%02x) - %s",
eintf->prefix, type,
evt->sel_type.standard_type.sensor_num, desc ? desc : "");
break;
@@ -364,11 +362,11 @@ openipmi_enable_event_msg_buffer(struct ipmi_intf * intf)
req.msg.cmd = 0x2f; /* Get BMC Global Enables */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get BMC Global Enables command failed");
return -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Get BMC Global Enables command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -380,11 +378,11 @@ openipmi_enable_event_msg_buffer(struct ipmi_intf * intf)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set BMC Global Enables command failed");
return -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Set BMC Global Enables command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -424,7 +422,7 @@ static int
openipmi_read(struct ipmi_event_intf * eintf)
{
struct ipmi_addr addr;
- struct ipmi_recv recv;
+ struct ipmi_recv recv = {};
uint8_t data[80];
int rv;
@@ -509,11 +507,11 @@ selwatch_get_data(struct ipmi_intf * intf, struct sel_data *data)
req.msg.cmd = IPMI_CMD_GET_SEL_INFO;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SEL Info command failed");
return 0;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get SEL Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return 0;
@@ -580,7 +578,7 @@ selwatch_setup(struct ipmi_event_intf * eintf)
/* save current last record ID */
selwatch_lastid = selwatch_get_lastid(eintf->intf);
lprintf(LOG_DEBUG, "Current SEL lastid is %04x", selwatch_lastid);
- /* display alert/warning immediatly as startup if relevant */
+ /* display alert/warning immediately as startup if relevant */
if (selwatch_pctused >= WARNING_THRESHOLD) {
lprintf(LOG_WARNING, "SEL buffer used at %d%%, please consider clearing the SEL buffer", selwatch_pctused);
}
@@ -684,7 +682,7 @@ selwatch_wait(struct ipmi_event_intf * eintf)
/*************************************************************************/
static void
-ipmievd_cleanup(int signal)
+ipmievd_cleanup(int __UNUSED__(signal))
{
struct stat st1;
@@ -707,32 +705,32 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum);
for (i = 0; i < argc; i++) {
- if (strncasecmp(argv[i], "help", 4) == 0) {
+ if (strcasecmp(argv[i], "help") == 0) {
ipmievd_usage();
return 0;
}
- if (strncasecmp(argv[i], "daemon", 6) == 0) {
+ if (strcasecmp(argv[i], "daemon") == 0) {
daemon = 1;
}
- else if (strncasecmp(argv[i], "nodaemon", 8) == 0) {
+ else if (strcasecmp(argv[i], "nodaemon") == 0) {
daemon = 0;
}
- else if (strncasecmp(argv[i], "daemon=", 7) == 0) {
- if (strncasecmp(argv[i]+7, "on", 2) == 0 ||
- strncasecmp(argv[i]+7, "yes", 3) == 0)
+ else if (strcasecmp(argv[i], "daemon=") == 0) {
+ if (strcasecmp(argv[i]+7, "on") == 0 ||
+ strcasecmp(argv[i]+7, "yes") == 0)
daemon = 1;
- else if (strncasecmp(argv[i]+7, "off", 3) == 0 ||
- strncasecmp(argv[i]+7, "no", 2) == 0)
+ else if (strcasecmp(argv[i]+7, "off") == 0 ||
+ strcasecmp(argv[i]+7, "no") == 0)
daemon = 0;
}
- else if (strncasecmp(argv[i], "timeout=", 8) == 0) {
+ else if (strcasecmp(argv[i], "timeout=") == 0) {
if ( (str2int(argv[i]+8, &selwatch_timeout) != 0) ||
selwatch_timeout < 0) {
lprintf(LOG_ERR, "Invalid input given or out of range for time-out.");
return (-1);
}
}
- else if (strncasecmp(argv[i], "pidfile=", 8) == 0) {
+ else if (strcasecmp(argv[i], "pidfile=") == 0) {
memset(pidfile, 0, 64);
strncpy(pidfile, argv[i]+8,
__min(strlen((const char *)(argv[i]+8)), 63));
@@ -766,7 +764,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
umask(022);
fp = ipmi_open_file_write(pidfile);
- if (fp == NULL) {
+ if (!fp) {
/* Failed to get fp on PID file -> exit. */
log_halt();
log_init("ipmievd", daemon, verbose);
@@ -797,7 +795,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
/* call event handler setup routine */
- if (eintf->setup != NULL) {
+ if (eintf->setup) {
rc = eintf->setup(eintf);
if (rc < 0) {
lprintf(LOG_ERR, "Error setting up Event Interface %s", eintf->name);
@@ -808,7 +806,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
lprintf(LOG_NOTICE, "Waiting for events...");
/* now launch event wait loop */
- if (eintf->wait != NULL) {
+ if (eintf->wait) {
rc = eintf->wait(eintf);
if (rc < 0) {
lprintf(LOG_ERR, "Error waiting for events!");
@@ -825,14 +823,14 @@ ipmievd_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
struct ipmi_event_intf * eintf;
eintf = ipmi_event_intf_load("sel");
- if (eintf == NULL) {
+ if (!eintf) {
lprintf(LOG_ERR, "Unable to load event interface");
return -1;
}
eintf->intf = intf;
- if (intf->session != NULL) {
+ if (intf->session) {
snprintf(eintf->prefix,
strlen((const char *)intf->ssn_params.hostname) + 3,
"%s: ", intf->ssn_params.hostname);
@@ -847,13 +845,13 @@ ipmievd_open_main(struct ipmi_intf * intf, int argc, char ** argv)
struct ipmi_event_intf * eintf;
/* only one interface works for this */
- if (strncmp(intf->name, "open", 4) != 0) {
+ if (strcmp(intf->name, "open")) {
lprintf(LOG_ERR, "Invalid Interface for OpenIPMI Event Handler: %s", intf->name);
return -1;
}
eintf = ipmi_event_intf_load("open");
- if (eintf == NULL) {
+ if (!eintf) {
lprintf(LOG_ERR, "Unable to load event interface");
return -1;
}
@@ -865,7 +863,7 @@ ipmievd_open_main(struct ipmi_intf * intf, int argc, char ** argv)
struct ipmi_cmd ipmievd_cmd_list[] = {
#ifdef IPMI_INTF_OPEN
- { ipmievd_open_main, "open", "Use OpenIPMI for asyncronous notification of events" },
+ { ipmievd_open_main, "open", "Use OpenIPMI for asynchronous notification of events" },
#endif
{ ipmievd_sel_main, "sel", "Poll SEL for notification of events" },
{ NULL }
diff --git a/src/ipmishell.c b/src/ipmishell.c
index 205cbf9..cf526f9 100644
--- a/src/ipmishell.c
+++ b/src/ipmishell.c
@@ -29,9 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
- /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
#include <stdio.h>
#include <unistd.h>
@@ -81,9 +78,9 @@ static int rl_event_keepalive(void)
{
static int internal_timer = 0;
- if (shell_intf == NULL)
+ if (!shell_intf)
return -1;
- if (shell_intf->keepalive == NULL)
+ if (!shell_intf->keepalive)
return 0;
#if defined (RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402
if (internal_timer++ < RL_TIMEOUT)
@@ -99,7 +96,7 @@ static int rl_event_keepalive(void)
return 0;
}
-int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
+int ipmi_shell_main(struct ipmi_intf *intf, int argc, char **argv)
{
char *ptr, *pbuf, **ap, *__argv[EXEC_ARG_SIZE];
int __argc, rc=0;
@@ -122,20 +119,18 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
#endif
}
- while ((pbuf = (char *)readline(RL_PROMPT)) != NULL) {
+ while ((pbuf = (char *)readline(RL_PROMPT))) {
if (strlen(pbuf) == 0) {
free(pbuf);
pbuf = NULL;
continue;
}
- if (strncmp(pbuf, "quit", 4) == 0 ||
- strncmp(pbuf, "exit", 4) == 0) {
+ if (!strcmp(pbuf, "quit") || !strcmp(pbuf, "exit")) {
free(pbuf);
pbuf = NULL;
return 0;
}
- if (strncmp(pbuf, "help", 4) == 0 ||
- strncmp(pbuf, "?", 1) == 0) {
+ if (!strcmp(pbuf, "help") || !strcmp(pbuf, "?")) {
ipmi_cmd_print(intf->cmdlist);
free(pbuf);
pbuf = NULL;
@@ -171,8 +166,9 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
ap = __argv;
for (*ap = strtok(pbuf, " \t");
- *ap != NULL;
- *ap = strtok(NULL, " \t")) {
+ *ap;
+ *ap = strtok(NULL, " \t"))
+ {
__argc++;
ptr = *ap;
@@ -217,7 +213,9 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
#else /* HAVE_READLINE */
int
-ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_shell_main(struct ipmi_intf *__UNUSED__(intf),
+ int __UNUSED__(argc),
+ char **__UNUSED__(argv))
{
lprintf(LOG_ERR, "Compiled without readline, shell is disabled");
return -1;
@@ -225,7 +223,8 @@ ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
#endif /* HAVE_READLINE */
-int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv)
+int ipmi_echo_main(struct ipmi_intf *__UNUSED__(intf), int argc,
+ char **argv)
{
int i;
@@ -257,13 +256,13 @@ ipmi_set_usage(void)
int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
{
- if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
+ if (!argc || !strcmp(argv[0], "help")) {
ipmi_set_usage();
return -1;
}
/* these options can have no arguments */
- if (strncmp(argv[0], "verbose", 7) == 0) {
+ if (!strcmp(argv[0], "verbose")) {
if (argc > 1) {
if (str2int(argv[1], &verbose) != 0) {
lprintf(LOG_ERR,
@@ -276,7 +275,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
}
return 0;
}
- if (strncmp(argv[0], "csv", 3) == 0) {
+ if (!strcmp(argv[0], "csv")) {
if (argc > 1) {
if (str2int(argv[1], &csv_output) != 0) {
lprintf(LOG_ERR,
@@ -296,36 +295,36 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
- if (strncmp(argv[0], "host", 4) == 0 ||
- strncmp(argv[0], "hostname", 8) == 0) {
+ if (!strcmp(argv[0], "host") ||
+ !strcmp(argv[0], "hostname")) {
ipmi_intf_session_set_hostname(intf, argv[1]);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session hostname.");
return (-1);
}
printf("Set session hostname to %s\n",
intf->ssn_params.hostname);
}
- else if (strncmp(argv[0], "user", 4) == 0 ||
- strncmp(argv[0], "username", 8) == 0) {
+ else if (!strcmp(argv[0], "user") ||
+ !strcmp(argv[0], "username")) {
ipmi_intf_session_set_username(intf, argv[1]);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session username.");
return (-1);
}
printf("Set session username to %s\n",
intf->ssn_params.username);
}
- else if (strncmp(argv[0], "pass", 4) == 0 ||
- strncmp(argv[0], "password", 8) == 0) {
+ else if (!strcmp(argv[0], "pass") ||
+ !strcmp(argv[0], "password")) {
ipmi_intf_session_set_password(intf, argv[1]);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session password.");
return (-1);
}
printf("Set session password\n");
}
- else if (strncmp(argv[0], "authtype", 8) == 0) {
+ else if (!strcmp(argv[0], "authtype")) {
int authtype;
authtype = str2val(argv[1], ipmi_authtype_session_vals);
if (authtype == 0xFF) {
@@ -334,7 +333,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
ipmi_intf_session_set_authtype(intf, authtype);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session authtype.");
return (-1);
}
@@ -342,7 +341,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
val2str(intf->ssn_params.authtype_set,
ipmi_authtype_session_vals));
}
- else if (strncmp(argv[0], "privlvl", 7) == 0) {
+ else if (!strcmp(argv[0], "privlvl")) {
int privlvl;
privlvl = str2val(argv[1], ipmi_privlvl_vals);
if (privlvl == 0xFF) {
@@ -351,7 +350,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
ipmi_intf_session_set_privlvl(intf, privlvl);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR,
"Failed to set session privilege level.");
return (-1);
@@ -360,7 +359,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
val2str(intf->ssn_params.privlvl,
ipmi_privlvl_vals));
}
- else if (strncmp(argv[0], "port", 4) == 0) {
+ else if (!strcmp(argv[0], "port")) {
int port = 0;
if (str2int(argv[1], &port) != 0 || port > MAX_PORT) {
lprintf(LOG_ERR, "Given port '%s' is invalid.",
@@ -368,13 +367,13 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
ipmi_intf_session_set_port(intf, port);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session port.");
return (-1);
}
printf("Set session port to %d\n", intf->ssn_params.port);
}
- else if (strncmp(argv[0], "localaddr", 9) == 0) {
+ else if (!strcmp(argv[0], "localaddr")) {
uint8_t my_addr = 0;
if (str2uchar(argv[1], &my_addr) != 0) {
lprintf(LOG_ERR, "Given localaddr '%s' is invalid.",
@@ -384,7 +383,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
intf->my_addr = my_addr;
printf("Set local IPMB address to 0x%02x\n", intf->my_addr);
}
- else if (strncmp(argv[0], "targetaddr", 10) == 0) {
+ else if (!strcmp(argv[0], "targetaddr")) {
uint8_t target_addr = 0;
if (str2uchar(argv[1], &target_addr) != 0) {
lprintf(LOG_ERR, "Given targetaddr '%s' is invalid.",
@@ -416,12 +415,12 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
}
fp = ipmi_open_file_read(argv[0]);
- if (fp == NULL)
+ if (!fp)
return -1;
while (feof(fp) == 0) {
ret = fgets(buf, EXEC_BUF_SIZE, fp);
- if (ret == NULL)
+ if (!ret)
continue;
/* clip off optional comment tail indicated by # */
@@ -465,10 +464,10 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
/* parse it and make argument list */
__argc = 0;
- for (tok = strtok(ptr, " "); tok != NULL; tok = strtok(NULL, " ")) {
+ for (tok = strtok(ptr, " "); tok; tok = strtok(NULL, " ")) {
if (__argc < EXEC_ARG_SIZE) {
__argv[__argc++] = strdup(tok);
- if (__argv[__argc-1] == NULL) {
+ if (!__argv[__argc-1]) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
if (fp) {
fclose(fp);
@@ -505,7 +504,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
/* free argument list */
for (i=0; i<__argc; i++) {
- if (__argv[i] != NULL) {
+ if (__argv[i]) {
free(__argv[i]);
__argv[i] = NULL;
}
diff --git a/src/ipmitool.c b/src/ipmitool.c
index 164fd44..3ee8b50 100644
--- a/src/ipmitool.c
+++ b/src/ipmitool.c
@@ -66,6 +66,7 @@
#include <ipmitool/ipmi_ime.h>
#include <ipmitool/ipmi_dcmi.h>
#include <ipmitool/ipmi_vita.h>
+#include <ipmitool/ipmi_quantaoem.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -77,7 +78,7 @@ extern int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv);
extern int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv);
extern int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv);
extern int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv);
-
+extern int ipmi_lan6_main(struct ipmi_intf *intf, int argc, char **argv);
int csv_output = 0;
int verbose = 0;
@@ -122,6 +123,7 @@ struct ipmi_cmd ipmitool_cmd_list[] = {
{ ipmi_ekanalyzer_main,"ekanalyzer", "run FRU-Ekeying analyzer using FRU files"},
{ ipmi_ime_main, "ime", "Update Intel Manageability Engine Firmware"},
{ ipmi_vita_main, "vita", "Run a VITA 46.11 extended cmd"},
+ { ipmi_lan6_main, "lan6", "Configure IPv6 LAN Channels"},
{ NULL },
};
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 7ad8173..14acbcf 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -32,11 +32,12 @@ MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = -I$(top_srcdir)/include
-SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@ @INTF_DUMMY@ @INTF_USB@
-DIST_SUBDIRS = lan lanplus open lipmi imb bmc free serial dummy usb
+SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@ @INTF_DUMMY@ @INTF_USB@ @INTF_DBUS@
+DIST_SUBDIRS = lan lanplus open lipmi imb bmc free serial dummy usb dbus
noinst_LTLIBRARIES = libintf.la
libintf_la_SOURCES = ipmi_intf.c
+libintf_la_CFLAGS = -DDEFAULT_INTF='"@DEFAULT_INTF@"'
libintf_la_LDFLAGS = -export-dynamic
libintf_la_LIBADD = @IPMITOOL_INTF_LIB@
libintf_la_DEPENDENCIES = @IPMITOOL_INTF_LIB@
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
deleted file mode 100644
index 262ff90..0000000
--- a/src/plugins/Makefile.in
+++ /dev/null
@@ -1,757 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-am_libintf_la_OBJECTS = ipmi_intf.lo
-libintf_la_OBJECTS = $(am_libintf_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libintf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(libintf_la_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_la_SOURCES)
-DIST_SOURCES = $(libintf_la_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@ @INTF_DUMMY@ @INTF_USB@
-DIST_SUBDIRS = lan lanplus open lipmi imb bmc free serial dummy usb
-noinst_LTLIBRARIES = libintf.la
-libintf_la_SOURCES = ipmi_intf.c
-libintf_la_LDFLAGS = -export-dynamic
-libintf_la_LIBADD = @IPMITOOL_INTF_LIB@
-libintf_la_DEPENDENCIES = @IPMITOOL_INTF_LIB@
-all: all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf.la: $(libintf_la_OBJECTS) $(libintf_la_DEPENDENCIES) $(EXTRA_libintf_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libintf_la_LINK) $(libintf_la_OBJECTS) $(libintf_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_intf.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(LTLIBRARIES)
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-generic clean-libtool \
- clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/bmc/Makefile.in b/src/plugins/bmc/Makefile.in
deleted file mode 100644
index 3cb831b..0000000
--- a/src/plugins/bmc/Makefile.in
+++ /dev/null
@@ -1,640 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/bmc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_bmc_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_bmc_la_OBJECTS = bmc.lo
-libintf_bmc_la_OBJECTS = $(am_libintf_bmc_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_bmc_la_SOURCES)
-DIST_SOURCES = $(libintf_bmc_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_bmc.la
-noinst_LTLIBRARIES = @INTF_BMC_LIB@
-libintf_bmc_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_bmc_la_SOURCES = \
- bmc.c bmc.h \
- bmc_intf.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/bmc/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/bmc/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_bmc.la: $(libintf_bmc_la_OBJECTS) $(libintf_bmc_la_DEPENDENCIES) $(EXTRA_libintf_bmc_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_bmc_la_OBJECTS) $(libintf_bmc_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmc.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/bmc/bmc.c b/src/plugins/bmc/bmc.c
index b88b077..eee6936 100644
--- a/src/plugins/bmc/bmc.c
+++ b/src/plugins/bmc/bmc.c
@@ -68,11 +68,12 @@ static struct ipmi_rs *ipmi_bmc_send_cmd_putmsg(struct ipmi_intf *intf,
#define MESSAGE_BUFSIZE 1024
struct ipmi_intf ipmi_bmc_intf = {
- name: "bmc",
- desc: "IPMI v2.0 BMC interface",
- open: ipmi_bmc_open,
- close: ipmi_bmc_close,
- sendrecv: ipmi_bmc_send_cmd};
+ .name = "bmc",
+ .desc = "IPMI v2.0 BMC interface",
+ .open = ipmi_bmc_open,
+ .close = ipmi_bmc_close,
+ .sendrecv = ipmi_bmc_send_cmd
+};
void
ipmi_bmc_close(struct ipmi_intf *intf)
diff --git a/src/plugins/bmc/bmc.h b/src/plugins/bmc/bmc.h
index 0138710..5274897 100644
--- a/src/plugins/bmc/bmc.h
+++ b/src/plugins/bmc/bmc.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef _IPMI_BMC_H_
-#define _IPMI_BMC_H_
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -48,5 +47,3 @@ void ipmi_bmc_close(struct ipmi_intf *intf);
#ifdef __cplusplus
}
#endif
-
-#endif /* _IPMI_BMC_H_ */
diff --git a/src/plugins/bmc/bmc_intf.h b/src/plugins/bmc/bmc_intf.h
index c73e4c1..1d322ba 100644
--- a/src/plugins/bmc/bmc_intf.h
+++ b/src/plugins/bmc/bmc_intf.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef _BMC_INTF_H
-#define _BMC_INTF_H
+#pragma once
#pragma ident "@(#)bmc_intf.h 1.2 05/03/07 SMI"
@@ -203,5 +202,3 @@ typedef struct bmc_msg {
#ifdef __cplusplus
}
#endif
-
-#endif /* _BMC_INTF_H */
diff --git a/src/plugins/dbus/Makefile.am b/src/plugins/dbus/Makefile.am
new file mode 100644
index 0000000..208f0ad
--- /dev/null
+++ b/src/plugins/dbus/Makefile.am
@@ -0,0 +1,41 @@
+ #
+ # Copyright (c) 2015 IBM Corporation
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification,are permitted provided that the following conditions are met:
+ #
+ # 1. Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
+ # this list of conditions and the following disclaimer in the documentation
+ # and/or other materials provided with the distribution.
+ #
+ # 3. Neither the name of the copyright holder nor the names of its contributors
+ # may be used to endorse or promote products derived from this software
+ # without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ # POSSIBILITY OF SUCH DAMAGE.
+ #
+
+MAINTAINERCLEANFILES = Makefile.in
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+EXTRA_LTLIBRARIES = libintf_dbus.la
+noinst_LTLIBRARIES = @INTF_DBUS_LIB@
+libintf_dbus_la_LDFLAGS = -lsystemd
+libintf_dbus_la_LIBADD = $(top_builddir)/lib/libipmitool.la
+libintf_dbus_la_SOURCES = dbus.c
+
diff --git a/src/plugins/dbus/dbus.c b/src/plugins/dbus/dbus.c
new file mode 100644
index 0000000..be72dcb
--- /dev/null
+++ b/src/plugins/dbus/dbus.c
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2015 IBM Corporation
+ * Copyright (c) 2019 Intel Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#include <systemd/sd-bus.h>
+
+#include <ipmitool/log.h>
+#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_intf.h>
+
+static sd_bus *bus;
+
+static
+struct ipmi_rs *
+ipmi_dbus_sendrecv(struct ipmi_intf *intf,
+ struct ipmi_rq *req)
+{
+ static const char *destination = "xyz.openbmc_project.Ipmi.Host";
+ static const char *object_path = "/xyz/openbmc_project/Ipmi";
+ static const char *interface = "xyz.openbmc_project.Ipmi.Server";
+ static const char *method_name = "execute";
+ static const char SD_BUS_TYPE_3_BYTES[] = {
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE, 0
+ };
+ static const char SD_BUS_TYPE_4_BYTES[] = {
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE,
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE, 0
+ };
+ static const char SD_BUS_TYPE_DICT_OF_VARIANTS[] = {
+ SD_BUS_TYPE_ARRAY,
+ SD_BUS_TYPE_DICT_ENTRY_BEGIN,
+ SD_BUS_TYPE_STRING, SD_BUS_TYPE_VARIANT,
+ SD_BUS_TYPE_DICT_ENTRY_END, 0
+ };
+ static const char SD_BUS_TYPE_IPMI_RESPONSE[] = {
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE,
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE,
+ SD_BUS_TYPE_ARRAY, SD_BUS_TYPE_BYTE, 0
+ };
+
+ sd_bus_message *request = NULL;
+ int rc;
+ sd_bus_error error = SD_BUS_ERROR_NULL;
+ sd_bus_message* reply = NULL;
+ uint8_t recv_netfn;
+ uint8_t recv_lun;
+ uint8_t recv_cmd;
+ uint8_t recv_cc;
+ const void *data;
+ size_t data_len;
+ static struct ipmi_rs rsp;
+ struct ipmi_rs *ipmi_response = NULL;
+
+ if (!intf->opened || !bus)
+ {
+ goto out_no_free;
+ }
+
+ rsp.ccode = IPMI_CC_UNSPECIFIED_ERROR;
+ rsp.data_len = 0;
+ memset(rsp.data, 0, sizeof(rsp.data));
+
+ /* The D-Bus xyz.openbmc_project.Ipmi.Server.execute interface
+ * looks like this:
+ *
+ * Request:
+ * byte: net function
+ * byte: lun
+ * byte: command
+ * byte array: data (possibly zero length)
+ * array of (string,variant): options
+ * Response:
+ * byte: net function
+ * byte: lun
+ * byte: command
+ * byte: completion code
+ * byte array: response data (possibly zero length)
+ */
+ rc = sd_bus_message_new_method_call(bus, &request, destination,
+ object_path, interface,
+ method_name);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to create message: %s\n",
+ __func__, strerror(-rc));
+ goto out_no_free;
+ }
+ /* pack the header: netfn, lun, cmd */
+ rc = sd_bus_message_append(request, SD_BUS_TYPE_3_BYTES, req->msg.netfn,
+ req->msg.lun, req->msg.cmd);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to append parameters\n", __func__);
+ goto out_free_request;
+ }
+ /* pack the variable length data */
+ rc = sd_bus_message_append_array(request, SD_BUS_TYPE_BYTE,
+ req->msg.data, req->msg.data_len);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to append body\n", __func__);
+ goto out_free_request;
+ }
+
+ /* Options are only needed for session-based channels, but
+ * in order to fulfill the correct signature, an empty array
+ * must be packed */
+ rc = sd_bus_message_append(request, SD_BUS_TYPE_DICT_OF_VARIANTS,
+ NULL, 0);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to append options\n", __func__);
+ goto out_free_request;
+ }
+
+ rc = sd_bus_call(bus, request, 0, &error, &reply);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to send dbus message (%s)\n",
+ __func__, error.message);
+ goto out_free_request;
+ }
+
+ /* unpack the response; check that it has the expected types */
+ rc = sd_bus_message_enter_container(reply, SD_BUS_TYPE_STRUCT,
+ SD_BUS_TYPE_IPMI_RESPONSE);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to parse reply\n", __func__);
+ goto out_free_reply;
+ }
+ /* read the header: CC netfn lun cmd */
+ rc = sd_bus_message_read(reply, SD_BUS_TYPE_4_BYTES, &recv_netfn,
+ &recv_lun, &recv_cmd, &recv_cc);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to read reply\n", __func__);
+ goto out_free_reply;
+ }
+ /* read the variable length data */
+ rc = sd_bus_message_read_array(reply, SD_BUS_TYPE_BYTE,
+ &data, &data_len);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to read reply data\n", __func__);
+ goto out_free_reply;
+ }
+ rc = sd_bus_message_exit_container(reply);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: final unpack of message failed\n",
+ __func__);
+ goto out_free_reply;
+ }
+
+ if (data_len > sizeof(rsp.data)) {
+ lprintf(LOG_ERR, "%s: data too long!\n", __func__);
+ goto out_free_reply;
+ }
+
+ /* At this point, all the parts are available for a response
+ * other than unspecified error. */
+ rsp.ccode = recv_cc;
+ rsp.data_len = data_len;
+ memcpy(rsp.data, data, data_len);
+ ipmi_response = &rsp;
+
+out_free_reply:
+ /* message unref will free resources owned by the message */
+ sd_bus_message_unref(reply);
+out_free_request:
+ sd_bus_message_unref(request);
+out_no_free:
+ return ipmi_response;
+}
+
+static
+int
+ipmi_dbus_setup(struct ipmi_intf *intf)
+{
+ int rc;
+
+ rc = sd_bus_default_system(&bus);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "Can't connect to session bus: %s\n",
+ strerror(-rc));
+ return -1;
+ }
+ intf->opened = 1;
+
+ return 0;
+}
+
+static
+void
+ipmi_dbus_close(struct ipmi_intf *intf)
+{
+ if (intf->opened)
+ {
+ sd_bus_close(bus);
+ }
+ intf->opened = 0;
+}
+
+struct ipmi_intf ipmi_dbus_intf = {
+ .name = "dbus",
+ .desc = "OpenBMC D-Bus interface",
+ .setup = ipmi_dbus_setup,
+ .close = ipmi_dbus_close,
+ .sendrecv = ipmi_dbus_sendrecv,
+};
+
+
diff --git a/src/plugins/dummy/Makefile.in b/src/plugins/dummy/Makefile.in
deleted file mode 100644
index 1850430..0000000
--- a/src/plugins/dummy/Makefile.in
+++ /dev/null
@@ -1,607 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/dummy
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_dummy_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_dummy_la_OBJECTS = dummy.lo
-libintf_dummy_la_OBJECTS = $(am_libintf_dummy_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_dummy_la_SOURCES)
-DIST_SOURCES = $(libintf_dummy_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_dummy.la
-noinst_LTLIBRARIES = @INTF_DUMMY_LIB@
-libintf_dummy_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_dummy_la_SOURCES = dummy.c dummy.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/dummy/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/dummy/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_dummy.la: $(libintf_dummy_la_OBJECTS) $(libintf_dummy_la_DEPENDENCIES) $(EXTRA_libintf_dummy_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_dummy_la_OBJECTS) $(libintf_dummy_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/dummy/dummy.c b/src/plugins/dummy/dummy.c
index 8600a84..3a86656 100644
--- a/src/plugins/dummy/dummy.c
+++ b/src/plugins/dummy/dummy.c
@@ -179,10 +179,9 @@ ipmi_dummyipmi_open(struct ipmi_intf *intf)
char *dummy_sock_path;
dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
- if (dummy_sock_path == NULL) {
- lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
- intf->opened = 1;
- return intf->fd;
+ if (!dummy_sock_path) {
+ lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Using " IPMI_DUMMY_DEFAULTSOCK);
+ dummy_sock_path = IPMI_DUMMY_DEFAULTSOCK;
}
if (intf->opened == 1) {
@@ -218,13 +217,8 @@ ipmi_dummyipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
static struct ipmi_rs rsp;
struct dummy_rq req_dummy;
struct dummy_rs rsp_dummy;
- char *dummy_sock_path;
- dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
- if (dummy_sock_path == NULL) {
- lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
- return NULL;
- }
- if (intf == NULL || intf->fd < 0 || intf->opened != 1) {
+
+ if (!intf || intf->fd < 0 || intf->opened != 1) {
lprintf(LOG_ERR, "dummy failed on intf check.");
return NULL;
}
diff --git a/src/plugins/dummy/dummy.h b/src/plugins/dummy/dummy.h
index bbe3aa3..e6a170a 100644
--- a/src/plugins/dummy/dummy.h
+++ b/src/plugins/dummy/dummy.h
@@ -1,5 +1,6 @@
-#ifndef IPMI_DUMMYIPMI_H
-# define IPMI_DUMMYIPMI_H
+#pragma once
+
+#define IPMI_DUMMY_DEFAULTSOCK "/tmp/.ipmi_dummy"
struct dummy_rq {
struct {
@@ -24,5 +25,3 @@ struct dummy_rs {
int data_len;
uint8_t *data;
};
-
-#endif
diff --git a/src/plugins/free/Makefile.in b/src/plugins/free/Makefile.in
deleted file mode 100644
index cc33b93..0000000
--- a/src/plugins/free/Makefile.in
+++ /dev/null
@@ -1,612 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/free
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_free_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_free_la_OBJECTS = free.lo
-libintf_free_la_OBJECTS = $(am_libintf_free_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libintf_free_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(libintf_free_la_LDFLAGS) $(LDFLAGS) \
- -o $@
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_free_la_SOURCES)
-DIST_SOURCES = $(libintf_free_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_free.la
-noinst_LTLIBRARIES = @INTF_FREE_LIB@
-libintf_free_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_free_la_SOURCES = free.c
-libintf_free_la_LDFLAGS = -lfreeipmi
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/free/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/free/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_free.la: $(libintf_free_la_OBJECTS) $(libintf_free_la_DEPENDENCIES) $(EXTRA_libintf_free_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libintf_free_la_LINK) $(libintf_free_la_OBJECTS) $(libintf_free_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/free/free.c b/src/plugins/free/free.c
index 56c8157..832f29b 100644
--- a/src/plugins/free/free.c
+++ b/src/plugins/free/free.c
@@ -42,9 +42,11 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <unistd.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
+#include <ipmitool/ipmi_sel.h>
#include <freeipmi/freeipmi.h>
#if IPMI_INTF_FREE_0_3_0 || IPMI_INTF_FREE_0_4_0 || IPMI_INTF_FREE_0_5_0
@@ -61,8 +63,6 @@ extern int verbose;
static int ipmi_free_open(struct ipmi_intf * intf)
{
- int kcs_ret = -1, ssif_ret = -1;
-
if (getuid() != 0) {
fprintf(stderr, "Permission denied, must be root\n");
return -1;
@@ -308,11 +308,11 @@ static struct ipmi_rs * ipmi_free_send_cmd(struct ipmi_intf * intf, struct ipmi_
}
struct ipmi_intf ipmi_free_intf = {
- name: "free",
- desc: "FreeIPMI IPMI Interface",
- open: ipmi_free_open,
- close: ipmi_free_close,
- sendrecv: ipmi_free_send_cmd,
- target_addr: IPMI_BMC_SLAVE_ADDR,
+ .name = "free",
+ .desc = "FreeIPMI IPMI Interface",
+ .open = ipmi_free_open,
+ .close = ipmi_free_close,
+ .sendrecv = ipmi_free_send_cmd,
+ .target_addr = IPMI_BMC_SLAVE_ADDR,
};
diff --git a/src/plugins/imb/Makefile.in b/src/plugins/imb/Makefile.in
deleted file mode 100644
index 1e40e15..0000000
--- a/src/plugins/imb/Makefile.in
+++ /dev/null
@@ -1,638 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/imb
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_imb_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_imb_la_OBJECTS = imbapi.lo imb.lo
-libintf_imb_la_OBJECTS = $(am_libintf_imb_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_imb_la_SOURCES)
-DIST_SOURCES = $(libintf_imb_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_imb.la
-noinst_LTLIBRARIES = @INTF_IMB_LIB@
-libintf_imb_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_imb_la_SOURCES = imbapi.c imbapi.h imb.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/imb/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/imb/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_imb.la: $(libintf_imb_la_OBJECTS) $(libintf_imb_la_DEPENDENCIES) $(EXTRA_libintf_imb_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_imb_la_OBJECTS) $(libintf_imb_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imb.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imbapi.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/imb/imb.c b/src/plugins/imb/imb.c
index 1514fa7..27d59e8 100644
--- a/src/plugins/imb/imb.c
+++ b/src/plugins/imb/imb.c
@@ -62,7 +62,7 @@ static int ipmi_imb_open(struct ipmi_intf * intf)
printf("Error: no IMB driver found at %s!\n", IPMI_IMB_DEV);
return -1;
}
-
+
intf->opened = 1;
intf->manufacturer_id = ipmi_get_oem(intf);
@@ -75,10 +75,10 @@ static void ipmi_imb_close(struct ipmi_intf * intf)
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
}
-static struct ipmi_rs * ipmi_imb_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
+static struct ipmi_rs * ipmi_imb_send_cmd(struct ipmi_intf *__UNUSED__(intf), struct ipmi_rq *req)
{
IMBPREQUESTDATA imbreq;
- static struct ipmi_rs rsp;
+ static struct ipmi_rs rsp;
int status, i;
unsigned char ccode;
diff --git a/src/plugins/imb/imbapi.c b/src/plugins/imb/imbapi.c
index 84eec2e..b27486d 100644
--- a/src/plugins/imb/imbapi.c
+++ b/src/plugins/imb/imbapi.c
@@ -1,1889 +1,1238 @@
-/*M*
-// PVCS:
-// $Workfile: imbapi.c $
-// $Revision: 1.5 $
-// $Modtime: 06 Aug 2001 13:16:56 $
-// $Author: stybla $
-//
-// Purpose: This file contains the entry point that opens the IMB device in
-// order to issue the IMB driver API related IOCTLs.
-// This file implements the IMB driver API for the Server
-// Management Agents
-//
-//
-*M*/
-/*----------------------------------------------------------------------*
-The BSD License
-Copyright (c) 2002, Intel Corporation
-All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- a.. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- b.. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- c.. Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *----------------------------------------------------------------------*/
/*
- * $Log: imbapi.c,v $
- * Revision 1.5 2013/07/22 08:35:23 stybla
- * ID: 65 - Fixes for configure.in for cross compilation
+ * Copyright (c) 2002, Intel Corporation
*
- * 'src/plugins/imb/imbapi.c' - don't cast NULL to int, ever!!!
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
*
- * Revision 1.4 2013/07/21 11:33:57 stybla
- * ID: 65 - Fixes for configure.in for cross compilation
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * NULL should never be cast to an int.
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * Commit for Dan Gora
+ * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * Revision 1.3 2013/01/18 12:46:52 ledva
- * 3600962 descriptor leaks
- *
- * Revision 1.2 2004/08/31 23:52:58 iceblink
- * fix lots of little errors that show up with -Werror -Wall
- *
- * Revision 1.1 2004/08/27 16:33:25 iceblink
- * add support for Intel IMB kernel driver (for legacy kernel support)
- * imbapi.[ch] code is BSD licensed and taken from panicsel.sf.net
- *
- *
- * Rev 1.12ac 04 Apr 2002 13:17:58 arcress
- * Mods for open-source & various compile cleanup mods
- *
- * Rev 1.12 06 Aug 2001 13:17:58 spoola
- * Fixed tracker items #15667, #15666, #15664
- *
- * Rev 1.0 05 Sep 1999 17:20:30 mramacha
- * Linux checkin
- *
- * Note: This file is derived from the NTWORK version of the imbapi.c
- * It was decided to create OS specific ones for Linux and Solaris.
- * It has all the fixes that went into the imbapi.c up to Rev 1.12
- * in the 2.2 NTWORK branch.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Purpose: This file contains the entry point that opens the IMB device in
+ * order to issue the IMB driver API related IOCTLs. This file implements the
+ * IMB driver API for the Server Management Agents
+ */
+
+
+/* Use -DLINUX_DEBUG_MAX in the Makefile, resp. CFLAGS if you want a dump of the
+ * memory to debug mmap system call in MapPhysicalMemory() below.
*/
#define IMB_API
#ifdef WIN32
-#define NO_MACRO_ARGS 1
-#include <windows.h>
-#include <stdio.h>
-
-#else /* LINUX, SCO_UW, UNIX */
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <string.h>
+# define NO_MACRO_ARGS 1
+# include <stdio.h>
+# include <windows.h>
+#else /* LINUX, SCO_UW, UNIX */
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <sys/ioctl.h>
+# include <sys/mman.h>
+# include <sys/param.h>
+# include <sys/stat.h>
+# include <sys/types.h>
+# include <unistd.h>
#endif
+
#include "imbapi.h"
#include <sys/socket.h>
+#include <ipmitool/helper.h>
+#include <ipmitool/log.h>
#ifdef SCO_UW
-#define NO_MACRO_ARGS 1
-#define __FUNCTION__ "func"
-#define IMB_DEVICE "/dev/instru/mismic"
+# define NO_MACRO_ARGS 1
+# define __func__ "func"
+# define IMB_DEVICE "/dev/instru/mismic"
#else
-#define IMB_DEVICE "/dev/imb"
+# define IMB_DEVICE "/dev/imb"
#endif
#if !defined(PAGESIZE) && defined(PAGE_SIZE)
-# define PAGESIZE PAGE_SIZE
+# define PAGESIZE PAGE_SIZE
#endif
#if !defined(_SC_PAGESIZE) && defined(_SC_PAGE_SIZE)
-# define _SC_PAGESIZE _SC_PAGE_SIZE
-#endif
-
-/*Just to make the DEBUG code cleaner.*/
-#ifndef NO_MACRO_ARGS
-#ifdef LINUX_DEBUG
-#define DEBUG(format, args...) printf(format, ##args)
-#else
-#define DEBUG(format, args...)
+# define _SC_PAGESIZE _SC_PAGE_SIZE
#endif
-#endif
-
-/* uncomment out the #define below or use -DLINUX_DEBUG_MAX in the makefile
-// if you want a dump of the memory to debug mmap system call in
-// MapPhysicalMemory() below.
-//
-//#define LINUX_DEBUG_MAX */
-
-/*keep it simple. use global varibles for event objects and handles
-//pai 10/8 */
-
-/* UnixWare should eventually have its own source code file. Right now
-// new code has been added based on the exsisting policy of using
-// pre-processor directives to separate os-specific code (pai 11/21) */
-
-HANDLE AsyncEventHandle = 0;
-//static void * AsyncEventObject = 0;
+HANDLE AsyncEventHandle = 0;
static int IpmiVersion;
-/*////////////////////////////////////////////////////////////////////////////
-// GLOBAL VARIABLES
-///////////////////////////////////////////////////////////////////////////// */
-
-IO_STATUS_BLOCK NTstatus; /*dummy place holder. See deviceiocontrol. */
+/* GLOBAL VARIABLES */
+/* dummy place holder. See deviceiocontrol. */
+IO_STATUS_BLOCK NTstatus;
static HANDLE hDevice1;
static HANDLE hDevice;
-/*mutex_t deviceMutex; */
-static int fDriverTyp; /*from ipmicmd.c*/
+static int fDriverTyp; /* from ipmicmd.c */
-/*////////////////////////////////////////////////////////////////////
-// open_imb
-////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: open_imb
-// Purpose: To open imb device
-// Context: Called from each routine to make sure that open is done.
-// Returns: returns 0 for Fail and 1 for Success, sets hDevice to open
-// handle.
-// Parameters: none
-// Notes: none
-*F*/
+/* open_imb - Open IMB device. Called from each routine to make sure that open
+ * is done.
+ *
+ * Returns: returns 0 for Fail and 1 for Success, sets hDevice to open handle.
+ */
#ifdef WIN32
-int open_imb(void)
+int
+open_imb(void)
{
-/* This routine will be called from all other routines before doing any
- interfacing with imb driver. It will open only once. */
- IMBPREQUESTDATA requestData;
- BYTE respBuffer[16];
- DWORD respLength;
- BYTE completionCode;
-
- if (hDevice1 == 0) /*INVALID_HANDLE_VALUE*/
- {
- //
- // Open IMB driver device
- //
- hDevice = CreateFile( "\\\\.\\Imb",
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL
- );
- if (hDevice == NULL || hDevice == INVALID_HANDLE_VALUE)
- return (0); /*FALSE*/
-
- // Detect the IPMI version for processing requests later.
- // This is a crude but most reliable method to differentiate
- // between old IPMI versions and the 1.0 version. If we had used the
- // version field instead then we would have had to revalidate all the
- // older platforms (pai 4/27/99)
- requestData.cmdType = GET_DEVICE_ID;
- requestData.rsSa = BMC_SA;
- requestData.rsLun = BMC_LUN;
- requestData.netFn = APP_NETFN ;
- requestData.busType = PUBLIC_BUS;
- requestData.data = NULL;
- requestData.dataLength = 0;
- respLength = 16;
- if ( (SendTimedImbpRequest ( &requestData, (DWORD)400,
- respBuffer, &respLength, &completionCode
- ) != ACCESN_OK ) || ( completionCode != 0) )
- {
- CloseHandle(hDevice);
- return (0); /*FALSE*/
- }
- hDevice1 = hDevice;
+ /* This routine will be called from all other routines before doing any
+ * interfacing with imb driver. It will open only once.
+ */
+ IMBPREQUESTDATA requestData;
+ BYTE respBuffer[16];
+ DWORD respLength;
+ BYTE completionCode;
- if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH-1))
- IpmiVersion = IPMI_09_VERSION;
- else {
- if ( respBuffer[4] == 0x51 )
- IpmiVersion = IPMI_15_VERSION;
- else
- IpmiVersion = IPMI_10_VERSION;
- }
- }
- return (1); /*TRUE*/
+ if (hDevice1 != 0) {
+ return 1;
+ }
-} /*end open_imb for Win32 */
+ /* Open IMB driver device */
+ hDevice = CreateFile("\\\\.\\Imb",
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+ if (!hDevice || INVALID_HANDLE_VALUE == hDevice) {
+ return 0;
+ }
+ /* Detect the IPMI version for processing requests later. This
+ * is a crude but most reliable method to differentiate between
+ * old IPMI versions and the 1.0 version. If we had used the
+ * version field instead then we would have had to revalidate
+ * all the older platforms (pai 4/27/99)
+ */
+ requestData.cmdType = GET_DEVICE_ID;
+ requestData.rsSa = BMC_SA;
+ requestData.rsLun = BMC_LUN;
+ requestData.netFn = APP_NETFN ;
+ requestData.busType = PUBLIC_BUS;
+ requestData.data = NULL;
+ requestData.dataLength = 0;
+ respLength = 16;
+ if ((SendTimedImbpRequest(&requestData, (DWORD)400, respBuffer,
+ &respLength, &completionCode) != ACCESN_OK)
+ || (completionCode != 0)) {
+ CloseHandle(hDevice);
+ return 0;
+ }
+ hDevice1 = hDevice;
+ if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH - 1)) {
+ IpmiVersion = IPMI_09_VERSION;
+ } else {
+ if (respBuffer[4] == 0x51) {
+ IpmiVersion = IPMI_15_VERSION;
+ } else {
+ IpmiVersion = IPMI_10_VERSION;
+ }
+ }
+ return 1;
+} /* end open_imb for Win32 */
#else /* LINUX, SCO_UW, etc. */
-int open_imb(void)
+int
+open_imb(void)
{
-/* This routine will be called from all other routines before doing any
- interfacing with imb driver. It will open only once. */
- IMBPREQUESTDATA requestData;
- BYTE respBuffer[16];
- DWORD respLength;
- BYTE completionCode;
-
+ /* This routine will be called from all other routines before doing any
+ * interfacing with imb driver. It will open only once.
+ */
+ IMBPREQUESTDATA requestData;
+ BYTE respBuffer[16];
+ DWORD respLength;
+ BYTE completionCode;
int my_ret_code;
- if (hDevice1 == 0)
- {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: opening the driver\n", __FUNCTION__);
-#endif
- /*
- printf("open_imb: "
+ if (hDevice1 != 0) {
+ return 1;
+ }
+ lprintf(LOG_DEBUG, "%s: opening the driver", __func__);
+ /* printf("open_imb: "
"IOCTL_IMB_SEND_MESSAGE =%x \n" "IOCTL_IMB_GET_ASYNC_MSG=%x \n"
"IOCTL_IMB_MAP_MEMORY = %x \n" "IOCTL_IMB_UNMAP_MEMORY= %x \n"
"IOCTL_IMB_SHUTDOWN_CODE=%x \n" "IOCTL_IMB_REGISTER_ASYNC_OBJ =%x \n"
"IOCTL_IMB_DEREGISTER_ASYNC_OBJ=%x \n"
"IOCTL_IMB_CHECK_EVENT =%x \n" "IOCTL_IMB_POLL_ASYNC =%x \n",
- IOCTL_IMB_SEND_MESSAGE, IOCTL_IMB_GET_ASYNC_MSG,
+ IOCTL_IMB_SEND_MESSAGE, IOCTL_IMB_GET_ASYNC_MSG,
IOCTL_IMB_MAP_MEMORY, IOCTL_IMB_UNMAP_MEMORY, IOCTL_IMB_SHUTDOWN_CODE,
IOCTL_IMB_REGISTER_ASYNC_OBJ, IOCTL_IMB_DEREGISTER_ASYNC_OBJ,
- IOCTL_IMB_CHECK_EVENT , IOCTL_IMB_POLL_ASYNC); *%%%%*/
-
- /*O_NDELAY flag will cause problems later when driver makes
- //you wait. Hence removing it. */
- /*if ((hDevice1 = open(IMB_DEVICE,O_RDWR|O_NDELAY)) <0) */
- if ((hDevice1 = open(IMB_DEVICE,O_RDWR)) <0)
- {
- char buf[128];
-
- hDevice1 = 0;
- if (fDriverTyp != 0) { /*not 1st time*/
- sprintf(buf,"%s %s: open(%s) failed",
- __FILE__,__FUNCTION__,IMB_DEVICE);
- perror(buf);
- }
- return (0);
- }
-
- /* Detect the IPMI version for processing requests later.
- // This is a crude but most reliable method to differentiate
- // between old IPMI versions and the 1.0 version. If we had used the
- // version field instead then we would have had to revalidate all
- // the older platforms (pai 4/27/99) */
- requestData.cmdType = GET_DEVICE_ID;
- requestData.rsSa = BMC_SA;
- requestData.rsLun = BMC_LUN;
- requestData.netFn = APP_NETFN ;
- requestData.busType = PUBLIC_BUS;
- requestData.data = NULL;
- requestData.dataLength = 0;
- respLength = 16;
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: opened driver, getting IPMI version\n", __FUNCTION__);
-#endif
- if ( ((my_ret_code = SendTimedImbpRequest(&requestData, (DWORD)400,
- respBuffer, (int *)&respLength, &completionCode)
- ) != ACCESN_OK ) || ( completionCode != 0) )
- {
- printf("%s: SendTimedImbpRequest error. Ret = %d CC = 0x%X\n",
- __FUNCTION__, my_ret_code, completionCode);
- close(hDevice1);
- hDevice1 = 0;
- return (0);
- }
+ IOCTL_IMB_CHECK_EVENT , IOCTL_IMB_POLL_ASYNC);
+ */
- if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH-1))
- IpmiVersion = IPMI_09_VERSION;
- else {
- if ( respBuffer[4] == 0x51 )
- IpmiVersion = IPMI_15_VERSION;
- else
- IpmiVersion = IPMI_10_VERSION;
- }
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: IPMI version 0x%x\n", __FUNCTION__, IpmiVersion);
-#endif
-
-/*
-//initialise a mutex
- if(mutex_init(&deviceMutex , USYNC_THREAD, NULL) != 0)
- {
- return(0);
+ /* O_NDELAY flag will cause problems later when driver makes
+ * you wait. Hence removing it.
+ */
+ if ((hDevice1 = open(IMB_DEVICE, O_RDWR)) < 0) {
+ char buf[128];
+ hDevice1 = 0;
+ if (fDriverTyp != 0) {
+ /* not 1st time */
+ sprintf(buf,"%s %s: open(%s) failed",
+ __FILE__, __func__, IMB_DEVICE);
+ perror(buf);
}
-*/
+ return 0;
+ }
+ /* Detect the IPMI version for processing requests later.
+ * This is a crude but most reliable method to differentiate
+ * between old IPMI versions and the 1.0 version. If we had used the
+ * version field instead then we would have had to revalidate all
+ * the older platforms (pai 4/27/99)
+ */
+ requestData.cmdType = GET_DEVICE_ID;
+ requestData.rsSa = BMC_SA;
+ requestData.rsLun = BMC_LUN;
+ requestData.netFn = APP_NETFN ;
+ requestData.busType = PUBLIC_BUS;
+ requestData.data = NULL;
+ requestData.dataLength = 0;
+ respLength = 16;
+ lprintf(LOG_DEBUG, "%s: opened driver, getting IPMI version", __func__);
+ if (((my_ret_code = SendTimedImbpRequest(&requestData, (DWORD)400,
+ respBuffer,
+ (int *)&respLength,
+ &completionCode)) != ACCESN_OK)
+ || (completionCode != 0)) {
+ printf("%s: SendTimedImbpRequest error. Ret = %d CC = 0x%X\n",
+ __func__, my_ret_code, completionCode);
+ close(hDevice1);
+ hDevice1 = 0;
+ return 0;
+ }
+ if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH - 1)) {
+ IpmiVersion = IPMI_09_VERSION;
+ } else {
+ if (respBuffer[4] == 0x51) {
+ IpmiVersion = IPMI_15_VERSION;
+ } else {
+ IpmiVersion = IPMI_10_VERSION;
+ }
}
-
- return (1);
-} /*end open_imb()*/
+ lprintf(LOG_DEBUG, "%s: IPMI version 0x%x", __func__,
+ IpmiVersion);
+ return 1;
+} /* end open_imb() */
#endif
-/*---------------------------------------------------------------------*
- * ipmi_open_ia & ipmi_close_ia
- *---------------------------------------------------------------------*/
-int ipmi_open_ia(void)
+/* ipmi_open_ia */
+int
+ipmi_open_ia(void)
{
- int rc = 0;
- rc = open_imb(); /*sets hDevice1*/
- if (rc == 1) rc = 0;
- else rc = -1;
- return(rc);
+ int rc = 0;
+ /* sets hDevice1 */
+ rc = open_imb();
+ if (rc == 1) {
+ rc = 0;
+ } else {
+ rc = -1;
+ }
+ return rc;
}
-int ipmi_close_ia(void)
+/* ipmi_close_ia */
+int
+ipmi_close_ia(void)
{
- int rc = 0;
- if (hDevice1 != 0) {
+ int rc = 0;
+ if (hDevice1 != 0) {
#ifdef WIN32
- CloseHandle(hDevice1);
+ CloseHandle(hDevice1);
#else
- rc = close(hDevice1);
+ rc = close(hDevice1);
#endif
- }
- return(rc);
+ }
+ return rc;
}
#ifndef WIN32
-/*///////////////////////////////////////////////////////////////////////////
-// DeviceIoControl
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: DeviceIoControl
-// Purpose: Simulate NT DeviceIoControl using unix calls and structures.
-// Context: called for every NT DeviceIoControl
-// Returns: FALSE for fail and TRUE for success. Same as standarad NTOS call
-// as it also sets Ntstatus.status.
-// Parameters: Standard NT call parameters, see below.
-// Notes: none
-*F*/
+/* DeviceIoControl - Simulate NT DeviceIoControl using unix calls and structures.
+ *
+ * @dummy_hDevice - handle of device
+ * @dwIoControlCode - control code of operation to perform
+ * @lpvInBuffer, address of buffer for input data
+ * @cbInBuffer, size of input buffer
+ * @lpvOutBuffer, address of output buffer
+ * @cbOutBuffer, size of output buffer
+ * @lpcbBytesReturned, address of actual bytes of output
+ * @lpoOverlapped address of overlapped struct
+ *
+ * returns - FALSE for fail and TRUE for success. Same as standard NTOS call as
+ * it also sets Ntstatus.status.
+ */
static BOOL
-DeviceIoControl(
- HANDLE dummey_hDevice, /* handle of device */
- DWORD dwIoControlCode, /* control code of operation to perform*/
- LPVOID lpvInBuffer, /* address of buffer for input data */
- DWORD cbInBuffer, /* size of input buffer */
- LPVOID lpvOutBuffer, /* address of output buffer */
- DWORD cbOutBuffer, /* size of output buffer */
- LPDWORD lpcbBytesReturned, /* address of actual bytes of output */
- LPOVERLAPPED lpoOverlapped /* address of overlapped struct */
- )
+DeviceIoControl(HANDLE __UNUSED__(dummey_hDevice), DWORD dwIoControlCode, LPVOID
+ lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer,
+ DWORD cbOutBuffer, LPDWORD lpcbBytesReturned,
+ LPOVERLAPPED lpoOverlapped)
{
struct smi s;
int rc;
int ioctl_status;
- rc = open_imb();
- if (rc == 0) {
- return FALSE;
- }
+ rc = open_imb();
+ if (rc == 0) {
+ return FALSE;
+ }
+ lprintf(LOG_DEBUG, "%s: ioctl cmd = 0x%lx", __func__,
+ dwIoControlCode);
+ lprintf(LOG_DEBUG, "cbInBuffer %d cbOutBuffer %d", cbInBuffer,
+ cbOutBuffer);
+ if (cbInBuffer > 41) {
+ cbInBuffer = 41; /* Intel driver max buf */
+ }
- /*
- //lock the mutex, before making the request....
- if(mutex_lock(&deviceMutex) != 0)
- {
- return(FALSE);
- }
- */
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: ioctl cmd = 0x%lx ", __FUNCTION__,dwIoControlCode);
- DEBUG("cbInBuffer %d cbOutBuffer %d\n", cbInBuffer, cbOutBuffer);
-#endif
- if (cbInBuffer > 41) cbInBuffer = 41; /* Intel driver max buf */
-
- s.lpvInBuffer = lpvInBuffer;
- s.cbInBuffer = cbInBuffer;
- s.lpvOutBuffer = lpvOutBuffer;
- s.cbOutBuffer = cbOutBuffer;
- s.lpcbBytesReturned = lpcbBytesReturned;
- s.lpoOverlapped = lpoOverlapped;
- s.ntstatus = (LPVOID)&NTstatus; /*dummy place holder. Linux IMB driver
- //doesnt return status or info via it.*/
-
- if ( (ioctl_status = ioctl(hDevice1, dwIoControlCode,&s) ) <0) {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s %s: ioctl cmd = 0x%x failed",
- __FILE__,__FUNCTION__,dwIoControlCode);
-#endif
- /* mutex_unlock(&deviceMutex); */
- return FALSE;
- }
- /* mutex_unlock(&deviceMutex); */
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: ioctl_status %d bytes returned = %d \n",
- __FUNCTION__, ioctl_status, *lpcbBytesReturned);
-#endif
+ s.lpvInBuffer = lpvInBuffer;
+ s.cbInBuffer = cbInBuffer;
+ s.lpvOutBuffer = lpvOutBuffer;
+ s.cbOutBuffer = cbOutBuffer;
+ s.lpcbBytesReturned = lpcbBytesReturned;
+ s.lpoOverlapped = lpoOverlapped;
+ /* dummy place holder. Linux IMB driver doesn't return status or info
+ * via it
+ */
+ s.ntstatus = (LPVOID)&NTstatus;
-/*MR commented this just as in Sol1.10. lpcbBytesReturned has the right data
-// *lpcbBytesReturned = NTstatus.Information; */
-
+ if ((ioctl_status = ioctl(hDevice1, dwIoControlCode,&s)) < 0) {
+ lprintf(LOG_DEBUG, "%s %s: ioctl cmd = 0x%x failed",
+ __FILE__, __func__, dwIoControlCode);
+ return FALSE;
+ }
+ lprintf(LOG_DEBUG, "%s: ioctl_status %d bytes returned = %d",
+ __func__, ioctl_status, *lpcbBytesReturned);
if (ioctl_status == STATUS_SUCCESS) {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s returning true\n", __FUNCTION__);
-#endif
- return (TRUE);
+ lprintf(LOG_DEBUG, "%s returning true", __func__);
+ return (TRUE);
+ } else {
+ lprintf(LOG_DEBUG, "%s returning false", __func__);
+ return (FALSE);
}
- else {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s returning false\n", __FUNCTION__);
-#endif
- return (FALSE);
- }
}
#endif
-/*Used only by UW. Left here for now. IMB driver will not accept this
-//ioctl. */
+/* Used only by UW. Left here for now. IMB driver will not accept this ioctl. */
ACCESN_STATUS
StartAsyncMesgPoll()
{
+ DWORD retLength;
+ BOOL status;
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl cmd = %x",
+ __func__, IOCTL_IMB_POLL_ASYNC);
- DWORD retLength;
- BOOL status;
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl cmd = %x\n",__FUNCTION__,IOCTL_IMB_POLL_ASYNC);
-#endif
- status = DeviceIoControl ( hDevice,
- IOCTL_IMB_POLL_ASYNC,
- NULL,
- 0,
- NULL,
- 0,
- & retLength,
- 0
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ status = DeviceIoControl(hDevice, IOCTL_IMB_POLL_ASYNC, NULL, 0, NULL,
+ 0, &retLength, 0);
- if( status == TRUE ) {
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status == TRUE) {
return ACCESN_OK;
} else {
return ACCESN_ERROR;
}
-
}
-/*/////////////////////////////////////////////////////////////////////////////
-// SendTimedI2cRequest
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SendTimedI2cRequest
-// Purpose: This function sends a request to a I2C device
-// Context: Used by Upper level agents (sis modules) to access dumb I2c devices
-// Returns: ACCESN_OK else error status code
-// Parameters:
-// reqPtr
-// timeOut
-// respDataPtr
-// respLen
-// Notes: none
-*F*/
-
+/* SendTimedI2cRequest - This function sends a request to a I2C device. Used by
+ * Upper level agents (sis modules) to access dumb I2c devices.
+ *
+ * @reqPtr - pointer to I2C request
+ * timeOut - how long to wait, mSec units
+ * @respDataPtr - where to put response data
+ * @respDataLen - size of response buffer and size of returned data
+ * @completionCode - request status from BMC
+ *
+ * returns - ACCESN_OK else error status code
+ */
ACCESN_STATUS
-SendTimedI2cRequest (
- I2CREQUESTDATA *reqPtr, /* I2C request */
- int timeOut, /* how long to wait, mSec units */
- BYTE *respDataPtr, /* where to put response data */
- int *respDataLen, /* size of response buffer and */
- /* size of returned data */
- BYTE *completionCode /* request status from BMC */
- )
+SendTimedI2cRequest(I2CREQUESTDATA *reqPtr, int timeOut, BYTE *respDataPtr,
+ int *respDataLen, BYTE *completionCode)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData;
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
-
- struct WriteReadI2C { /* format of a write/read I2C request */
+/* size of write/read request minus any data */
+# define MIN_WRI2C_SIZE 3
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ ImbResponseBuffer *resp = (ImbResponseBuffer *)responseData;
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+
+ /* format of a write/read I2C request */
+ struct WriteReadI2C {
BYTE busType;
BYTE rsSa;
BYTE count;
BYTE data[1];
- } * wrReq = (struct WriteReadI2C *) req->req.data;
-
-#define MIN_WRI2C_SIZE 3 /* size of write/read request minus any data */
-
-
- /*
- // If the Imb driver is not present return AccessFailed
- */
-
- req->req.rsSa = BMC_SA;
- req->req.cmd = WRITE_READ_I2C;
- req->req.netFn = APP_NETFN;
- req->req.rsLun = BMC_LUN;
- req->req.dataLength = reqPtr->dataLength + MIN_WRI2C_SIZE;
-
- wrReq->busType = reqPtr->busType;
- wrReq->rsSa = reqPtr->rsSa;
- wrReq->count = reqPtr->numberOfBytesToRead;
-
- memcpy( wrReq->data, reqPtr->data, reqPtr->dataLength );
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof( requestData ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE ) {
+ } *wrReq = (struct WriteReadI2C *)req->req.data;
+
+ /* If the IMB driver is not present return AccessFailed */
+ req->req.rsSa = BMC_SA;
+ req->req.cmd = WRITE_READ_I2C;
+ req->req.netFn = APP_NETFN;
+ req->req.rsLun = BMC_LUN;
+ req->req.dataLength = reqPtr->dataLength + MIN_WRI2C_SIZE;
+
+ wrReq->busType = reqPtr->busType;
+ wrReq->rsSa = reqPtr->rsSa;
+ wrReq->count = reqPtr->numberOfBytesToRead;
+
+ memcpy(wrReq->data, reqPtr->data, reqPtr->dataLength);
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), &responseData,
+ sizeof(responseData), &respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
DWORD error;
error = GetLastError();
return error;
}
- if( respLength == 0 ) {
+ if (respLength == 0) {
return ACCESN_ERROR;
}
-
- /*
- // give the caller his response
- */
+ /* give the caller his response */
*completionCode = resp->cCode;
- *respDataLen = respLength - 1;
-
- if(( *respDataLen ) && (respDataPtr))
- memcpy( respDataPtr, resp->data, *respDataLen);
-
+ *respDataLen = respLength - 1;
+ if ((*respDataLen) && (respDataPtr)) {
+ memcpy(respDataPtr, resp->data, *respDataLen);
+ }
return ACCESN_OK;
-
}
-/*This is not a API exported by the driver in stricter sense. It is
-//added to support EMP functionality. Upper level software could have
-//implemented this function.(pai 5/4/99) */
-/*/////////////////////////////////////////////////////////////////////////////
-// SendTimedEmpMessageResponse
-///////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedEmpMessageResponse
-// Purpose: This function sends a response message to the EMP port
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
+/* SendTimedEmpMessageResponse - This function sends a response message to the
+ * EMP port.
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen
+ * @timeOut - how long to wait, in mSec units
+ *
+ * returns - OK else error status code
+ */
ACCESN_STATUS
-SendTimedEmpMessageResponse (
- ImbPacket *ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut /* how long to wait, in mSec units */
- )
+SendTimedEmpMessageResponse (ImbPacket *ptr, char *responseDataBuf,
+ int responseDataLen, int timeOut)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /*ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
- /*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
- req->req.rsLun = 0;
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
+ /* form the response packet first */
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ req->req.rsLun = 0;
i = 0;
- if (IpmiVersion != IPMI_09_VERSION)
- req->req.data[i++] = EMP_CHANNEL;
-
- req->req.data[i++] = ptr->rqSa;
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
-
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMCs slave address as responder
- //address. */
-
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- req->req.data[i++] = ptr->cmd;
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- j = 1;
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
- ++i;
- req->req.dataLength = i;
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ if (IpmiVersion != IPMI_09_VERSION) {
+ req->req.data[i++] = EMP_CHANNEL;
+ }
+ req->req.data[i++] = ptr->rqSa;
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ }
+ /* though software is responding, we have to provide BMCs slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ req->req.data[i++] = ptr->cmd;
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ req->req.data[i] = 0;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ j = 1;
+ }
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
+ ++i;
+ req->req.dataLength = i;
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
}
-
-/*This is not a API exported by the driver in stricter sense. It is added to support
-// EMP functionality. Upper level software could have implemented this function.(pai 5/4/99) */
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedEmpMessageResponse_Ex
-//////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedEmpMessageResponse_Ex
-// Purpose: This function sends a response message to the EMP port
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
-
-
+/* SendTimedEmpMessageResponse_Ex - sends response message to the EMP port.
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen
+ * @timeOut - how long to wait, in mSec units
+ * @sessionHandle - This is introduced in IPMI1.5,this is required to be sent in
+ * sendd message command as a parameter, which is then used by BMC
+ * to identify the correct DPC session to send the message to.
+ * @channelNumber - There are 3 different channels on which DPC communication
+ * goes on:
+ * * Emp - 1
+ * * Lan channel one - 6,
+ * * Lan channel two(primary channel) - 7
+ *
+ * returns - OK else error status code
+ */
ACCESN_STATUS
-SendTimedEmpMessageResponse_Ex (
-
- ImbPacket * ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut, /* how long to wait, in mSec units*/
- BYTE sessionHandle, /*This is introduced in IPMI1.5,this is required to be sent in
- //send message command as a parameter,which is then used by BMC
- //to identify the correct DPC session to send the mesage to. */
- BYTE channelNumber /*There are 3 different channels on which DPC communication goes on
- //Emp - 1,Lan channel one - 6,Lan channel two(primary channel) - 7. */
- )
+SendTimedEmpMessageResponse_Ex (ImbPacket *ptr, char *responseDataBuf, int
+ responseDataLen, int timeOut, BYTE sessionHandle, BYTE
+ channelNumber)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /* ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
/*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
- req->req.rsLun = 0;
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ req->req.rsLun = 0;
i = 0;
+ /* checking for the IPMI version & then assigning the channel number for
+ * EMP. Actually the channel number is same in both the versions.This is
+ * just to maintain the consistancy with the same method for LAN. This
+ * is the 1st byte of the SEND MESSAGE command.
+ */
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = EMP_CHANNEL;
+ } else if (IpmiVersion == IPMI_15_VERSION) {
+ req->req.data[i++] = channelNumber;
+ }
- /*checking for the IPMI version & then assigning the channel number for EMP
- //Actually the channel number is same in both the versions.This is just to
- //maintain the consistancy with the same method for LAN.
- //This is the 1st byte of the SEND MESSAGE command. */
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = EMP_CHANNEL;
- else if (IpmiVersion == IPMI_15_VERSION)
- req->req.data[i++] = channelNumber;
-
- /*The second byte of data for SEND MESSAGE starts with session handle */
+ /* The second byte of data for SEND MESSAGE starts with session
+ * handle
+ */
req->req.data[i++] = sessionHandle;
-
- /*Then it is the response slave address for SEND MESSAGE. */
- req->req.data[i++] = ptr->rqSa;
-
- /*Then the net function + lun for SEND MESSAGE command. */
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
-
- /*Here the checksum is calculated.The checksum calculation starts after the channel number.
- //so for the IPMI 1.5 version its a checksum of 3 bytes that is session handle,response slave
- //address & netfun+lun. */
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[2]+ req->req.data[3])) +1);
- }
-
- /*This is the next byte of the message data for SEND MESSAGE command.It is the request
- //slave address. */
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMCs slave address as responder
- //address. */
-
- /*This is just the sequence number,which is the next byte of data for SEND MESSAGE */
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- /*The next byte is the command like get software ID(00).*/
- req->req.data[i++] = ptr->cmd;
-
- /*after the cmd the data ,which is sent by DPC & is retrived using the get message earlier
- // is sent back to DPC. */
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
-
- /*The last byte of data for SEND MESSAGE command is the check sum ,which is calculated
- //from the next byte of the previous checksum that is the request slave address. */
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
+ /* Then it is the response slave address for SEND MESSAGE. */
+ req->req.data[i++] = ptr->rqSa;
+ /* Then the net function + lun for SEND MESSAGE command. */
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ /* Here the checksum is calculated.The checksum calculation starts after
+ * the channel number. So for the IPMI 1.5 version its a checksum of 3
+ * bytes that is session handle,response slave address & netfun+lun.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[2] + req->req.data[3])) + 1);
+ }
+ }
+ /* This is the next byte of the message data for SEND MESSAGE command.It
+ * is the request slave address.
+ */
+ /* though software is responding, we have to provide BMCs slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ /* This is just the sequence number,which is the next byte of data for
+ * SEND MESSAGE
+ */
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ /* The next byte is the command like get software ID(00). */
+ req->req.data[i++] = ptr->cmd;
+ /* after the cmd the data, which is sent by DPC & is retrieved using the
+ * get message earlier is sent back to DPC.
+ */
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
+
+ req->req.data[i] = 0;
+ /* The last byte of data for SEND MESSAGE command is the check sum, which
+ * is calculated from the next byte of the previous checksum that is the
+ * request slave address.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
j = 1;
- else
+ } else {
j = 2;
- }
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
+ }
+ }
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
++i;
- req->req.dataLength = i;
-
- /*The flags & timeouts are used by the driver internally. */
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
-
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ req->req.dataLength = i;
+ /* The flags & timeouts are used by the driver internally. */
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
-
-
-
}
-/*This is not a API exported by the driver in stricter sense. It is
-//added to support EMP functionality. Upper level software could have
-//implemented this function.(pai 5/4/99) */
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedLanMessageResponse
-///////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedLanMessageResponse
-// Purpose: This function sends a response message to the DPC Over Lan
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
+/* SendTimedLanMessageResponse - sends a response message to the DPC Over Lan
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen,
+ * @timeOut - how long to wait, in mSec units
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendTimedLanMessageResponse(
- ImbPacket *ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut /* how long to wait, in mSec units */
- )
+SendTimedLanMessageResponse(ImbPacket *ptr, char *responseDataBuf,
+ int responseDataLen, int timeOut)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /* ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
- /*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
-
- /* After discussion with firmware team (Shailendra), the lun number needs to stay at 0
- // even though the DPC over Lan firmware EPS states that the lun should be 1 for DPC
- // Over Lan. - Simont (5/17/00) */
- req->req.rsLun = 0;
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
+ /* Form the response packet first */
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ /* After discussion with firmware team (Shailendra), the lun number
+ * needs to stay at 0 even though the DPC over Lan firmware EPS states
+ * that the lun should be 1 for DPC Over Lan. - Simont (5/17/00)
+ */
+ req->req.rsLun = 0;
i = 0;
- if (IpmiVersion != IPMI_09_VERSION)
- req->req.data[i++] = LAN_CHANNEL;
-
- req->req.data[i++] = ptr->rqSa;
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
-
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMCs slave address as responder
- //address. */
-
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- req->req.data[i++] = ptr->cmd;
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- j = 1;
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
- ++i;
- req->req.dataLength = i;
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
+ if (IpmiVersion != IPMI_09_VERSION) {
+ req->req.data[i++] = LAN_CHANNEL;
+ }
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
+ req->req.data[i++] = ptr->rqSa;
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ }
+ /* Though software is responding, we have to provide BMCs slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ req->req.data[i++] = ptr->cmd;
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ req->req.data[i] = 0;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ j = 1;
+ }
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
+ ++i;
+ req->req.dataLength = i;
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
}
-/*This is not a API exported by the driver in stricter sense. It is
-//added to support EMP functionality. Upper level software could have
-//implemented this function.(pai 5/4/99) */
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedLanMessageResponse_Ex
-///////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedLanMessageResponse_Ex
-// Purpose: This function sends a response message to the DPC Over Lan
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
+/* SendTimedLanMessageResponse_Ex - sends a response message to the DPC Over
+ * LAN.
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen
+ * @timeOut - how long to wait, in mSec units
+ * @sessionHandle - This is introduced in IPMI1.5,this is required to be sent in
+ * send message command as a parameter,which is then used by BMC to identify the
+ * correct DPC session to send the message to.
+ * @channelNumber - There are 3 different channels on which DPC communication
+ * goes on:
+ * * Emp - 1
+ * * Lan channel one - 6
+ * * Lan channel two(primary channel) - 7
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendTimedLanMessageResponse_Ex(
- ImbPacket *ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut , /* how long to wait, in mSec units */
- BYTE sessionHandle, /*This is introduced in IPMI1.5,this is required to be sent in
- //send message command as a parameter,which is then used by BMC
- //to identify the correct DPC session to send the mesage to. */
- BYTE channelNumber /*There are 3 different channels on which DPC communication goes on
- //Emp - 1,Lan channel one - 6,Lan channel two(primary channel) - 7. */
- )
+SendTimedLanMessageResponse_Ex(ImbPacket *ptr, char *responseDataBuf, int
+ responseDataLen, int timeOut, BYTE sessionHandle, BYTE
+ channelNumber)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /* ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
- /*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
-
- /* After discussion with firmware team (Shailendra), the lun number needs to stay at 0
- // even though the DPC over Lan firmware EPS states that the lun should be 1 for DPC
- // Over Lan. - Simont (5/17/00) */
- req->req.rsLun = 0;
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
+ /* form the response packet first */
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ /* After discussion with firmware team (Shailendra), the lun number
+ * needs to stay at 0 even though the DPC over Lan firmware EPS states
+ * that the lun should be 1 for DPC Over Lan. - Simont (5/17/00)
+ */
+ req->req.rsLun = 0;
i = 0;
-
- /*checking for the IPMI version & then assigning the channel number for Lan accordingly.
- //This is the 1st byte of the SEND MESSAGE command. */
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = LAN_CHANNEL;
- else if (IpmiVersion == IPMI_15_VERSION)
- req->req.data[i++] = channelNumber;
-
- /*The second byte of data for SEND MESSAGE starts with session handle */
+ /* checking for the IPMI version & then assigning the channel number for
+ * LAN accordingly.
+ * This is the 1st byte of the SEND MESSAGE command.
+ */
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = LAN_CHANNEL;
+ } else if (IpmiVersion == IPMI_15_VERSION) {
+ req->req.data[i++] = channelNumber;
+ }
+ /* The second byte of data for SEND MESSAGE starts with session handle
+ */
req->req.data[i++] = sessionHandle;
-
- /*Then it is the response slave address for SEND MESSAGE. */
- req->req.data[i++] = ptr->rqSa;
-
- /*Then the net function + lun for SEND MESSAGE command. */
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
-
- /*Here the checksum is calculated.The checksum calculation starts after the channel number.
- //so for the IPMI 1.5 version its a checksum of 3 bytes that is session handle,response slave
- //address & netfun+lun. */
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[2]+ req->req.data[3])) +1);
- }
-
- /*This is the next byte of the message data for SEND MESSAGE command.It is the request
- //slave address. */
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMC's slave address as responder
- //address. */
-
- /*This is just the sequence number,which is the next byte of data for SEND MESSAGE */
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- /*The next byte is the command like get software ID(00). */
- req->req.data[i++] = ptr->cmd;
-
- /*after the cmd the data ,which is sent by DPC & is retrived using the get message earlier
- // is sent back to DPC. */
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
-
- /*The last byte of data for SEND MESSAGE command is the check sum ,which is calculated
- //from the next byte of the previous checksum that is the request slave address. */
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
+ /* Then it is the response slave address for SEND MESSAGE. */
+ req->req.data[i++] = ptr->rqSa;
+ /* Then the net function + lun for SEND MESSAGE command. */
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ /* Here the checksum is calculated.The checksum calculation starts after
+ * the channel number. So for the IPMI 1.5 version its a checksum of 3
+ * bytes that is session handle,response slave address & netfun+lun.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) + 1);
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[2] + req->req.data[3])) + 1);
+ }
+ }
+ /* This is the next byte of the message data for SEND MESSAGE command.It
+ * is the request slave address.
+ */
+ /* Though software is responding, we have to provide BMC's slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ /* This is just the sequence number,which is the next byte of data for
+ * SEND MESSAGE
+ */
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ /* The next byte is the command like get software ID(00). */
+ req->req.data[i++] = ptr->cmd;
+ /* After the cmd the data ,which is sent by DPC & is retrieved using the
+ * get message earlier is sent back to DPC.
+ */
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
+ req->req.data[i] = 0;
+ /* The last byte of data for SEND MESSAGE command is the check sum which
+ * is calculated from the next byte of the previous checksum that is the
+ * request slave address.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
j = 1;
- else
+ } else {
j = 2;
- }
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
+ }
+ }
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
++i;
- req->req.dataLength = i;
-
- /*The flags & timeouts are used by the driver internally */
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ req->req.dataLength = i;
+ /* The flags & timeouts are used by the driver internally */
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
}
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedImbpRequest
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SendTimedImbpRequest
-// Purpose: This function sends a request for BMC implemented function
-// Context: Used by Upper level agents (sis modules) to access BMC implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// reqPtr
-// timeOut
-// respDataPtr
-// respLen
-// Notes: none
-*F*/
+/* SendTimedImbpRequest - This function sends a request for BMC implemented function
+ *
+ * @reqPtr - request info and data
+ * @timeOut - how long to wait, in mSec units
+ * @respDataPtr - where to put response data
+ * @respDataLen - how much response data there is
+ * @completionCode - request status from dest controller
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendTimedImbpRequest (
- IMBPREQUESTDATA *reqPtr, /* request info and data */
- int timeOut, /* how long to wait, in mSec units */
- BYTE *respDataPtr, /* where to put response data */
- int *respDataLen, /* how much response data there is */
- BYTE *completionCode /* request status from dest controller */
- )
+SendTimedImbpRequest(IMBPREQUESTDATA *reqPtr, int timeOut, BYTE *respDataPtr,
+ int *respDataLen, BYTE *completionCode)
{
- BYTE responseData[MAX_BUFFER_SIZE];
- ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData;
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_BUFFER_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- BOOL status;
-
-
- req->req.rsSa = reqPtr->rsSa;
- req->req.cmd = reqPtr->cmdType;
- req->req.netFn = reqPtr->netFn;
- req->req.rsLun = reqPtr->rsLun;
- req->req.dataLength = reqPtr->dataLength;
-
-#ifndef NO_MACRO_ARGS
- DEBUG("cmd=%02x, pdata=%p, datalen=%x\n", req->req.cmd,
- reqPtr->data, reqPtr->dataLength );
-#endif
- memcpy( req->req.data, reqPtr->data, reqPtr->dataLength );
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: rsSa 0x%x cmd 0x%x netFn 0x%x rsLun 0x%x\n", __FUNCTION__,
- req->req.rsSa, req->req.cmd, req->req.netFn, req->req.rsLun);
-#endif
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof( requestData ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl returned status = %d\n",__FUNCTION__, status);
-#endif
+ BYTE responseData[MAX_BUFFER_SIZE];
+ ImbResponseBuffer *resp = (ImbResponseBuffer *)responseData;
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_BUFFER_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ BOOL status;
+
+ req->req.rsSa = reqPtr->rsSa;
+ req->req.cmd = reqPtr->cmdType;
+ req->req.netFn = reqPtr->netFn;
+ req->req.rsLun = reqPtr->rsLun;
+ req->req.dataLength = reqPtr->dataLength;
+
+ lprintf(LOG_DEBUG, "cmd=%02x, pdata=%p, datalen=%x", req->req.cmd,
+ reqPtr->data, reqPtr->dataLength);
+ memcpy(req->req.data, reqPtr->data, reqPtr->dataLength);
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ lprintf(LOG_DEBUG, "%s: rsSa 0x%x cmd 0x%x netFn 0x%x rsLun 0x%x",
+ __func__, req->req.rsSa, req->req.cmd,
+ req->req.netFn, req->req.rsLun);
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), &responseData,
+ sizeof(responseData), &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl returned status = %d",
+ __func__, status);
#ifdef DBG_IPMI
- printf("%s: rsSa %x cmd %x netFn %x lun %x, status=%d, cc=%x, rlen=%d\n",
- __FUNCTION__, req->req.rsSa, req->req.cmd, req->req.netFn,
- req->req.rsLun, status, resp->cCode, respLength );
+ /* TODO */
+ printf("%s: rsSa %x cmd %x netFn %x lun %x, status=%d, cc=%x, rlen=%d\n",
+ __func__, req->req.rsSa, req->req.cmd,
+ req->req.netFn, req->req.rsLun, status, resp->cCode,
+ respLength);
#endif
- if( status != TRUE ) {
+ if (status != TRUE) {
DWORD error;
error = GetLastError();
return error;
- }
- if( respLength == 0 ) {
+ } else if (respLength == 0) {
return ACCESN_ERROR;
}
-
- /*
- * give the caller his response
- */
+ /* give the caller his response */
*completionCode = resp->cCode;
- *respDataLen = 0;
+ *respDataLen = 0;
- if(( respLength > 1 ) && ( respDataPtr))
- {
- *respDataLen = respLength - 1;
- memcpy( respDataPtr, resp->data, *respDataLen);
+ if ((respLength > 1) && (respDataPtr)) {
+ *respDataLen = respLength - 1;
+ memcpy(respDataPtr,resp->data, *respDataLen);
}
-
-
return ACCESN_OK;
}
-
-/*/////////////////////////////////////////////////////////////////////////
-//SendAsyncImbpRequest
-/////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SendAsyncImbpRequest
-// Purpose: This function sends a request for Asynchronous IMB implemented function
-// Context: Used by Upper level agents (sis modules) to access Asynchronous IMB implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// reqPtr Pointer to Async IMB request
-// seqNo Sequence Munber
-// Notes: none
-*F*/
+/* SendAsyncImbpRequest - sends a request for Asynchronous IMB implemented function.
+ *
+ * @reqPtr - Pointer to Async IMB request
+ * @seqNo -Sequence Munber
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendAsyncImbpRequest (
- IMBPREQUESTDATA *reqPtr, /* request info and data */
- BYTE * seqNo /* sequence number used in creating IMB msg */
- )
+SendAsyncImbpRequest(IMBPREQUESTDATA *reqPtr, BYTE *seqNo)
{
-
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData;
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
-
- req->req.rsSa = reqPtr->rsSa;
- req->req.cmd = reqPtr->cmdType;
- req->req.netFn = reqPtr->netFn;
- req->req.rsLun = reqPtr->rsLun;
- req->req.dataLength = reqPtr->dataLength;
-
- memcpy( req->req.data, reqPtr->data, reqPtr->dataLength );
-
- req->flags = NO_RESPONSE_EXPECTED;
- req->timeOut = 0; /* no timeouts for async sends */
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof( requestData ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE ) {
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ ImbResponseBuffer *resp = (ImbResponseBuffer *)responseData;
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+
+ req->req.rsSa = reqPtr->rsSa;
+ req->req.cmd = reqPtr->cmdType;
+ req->req.netFn = reqPtr->netFn;
+ req->req.rsLun = reqPtr->rsLun;
+ req->req.dataLength = reqPtr->dataLength;
+ memcpy(req->req.data, reqPtr->data, reqPtr->dataLength);
+
+ req->flags = NO_RESPONSE_EXPECTED;
+ /* no timeouts for async sends */
+ req->timeOut = 0;
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), &responseData,
+ sizeof(responseData), &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
DWORD error;
error = GetLastError();
return error;
- }
- if( respLength != 2 ) {
+ } else if (respLength != 2) {
return ACCESN_ERROR;
}
- /*
- // give the caller his sequence number
- */
+ /* give the caller his sequence number */
*seqNo = resp->data[0];
-
return ACCESN_OK;
-
}
-/*///////////////////////////////////////////////////////////////////////////
-//GetAsyncImbpMessage
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: GetAsyncImbpMessage
-// Purpose: This function gets the next available async message with a message id
-// greater than SeqNo. The message looks like an IMB packet
-// and the length and Sequence number is returned
-// Context: Used by Upper level agents (sis modules) to access Asynchronous IMB implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// msgPtr Pointer to Async IMB request
-// msgLen Length
-// timeOut Time to wait
-// seqNo Sequence Munber
-// Notes: none
-*F*/
-
+/* GetAsyncImbpMessage - This function gets the next available async message
+ * with a message ID greater than SeqNo. The message looks like an IMB packet
+ * and the length and Sequence number is returned.
+ *
+ * @msgPtr - request info and data
+ * @msgLen - IN - length of buffer, OUT - msg len
+ * @timeOut - how long to wait for the message
+ * @seqNo - previously returned seq number(or ASYNC_SEQ_START)
+ * @channelNumber
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-GetAsyncImbpMessage (
- ImbPacket * msgPtr, /* request info and data */
- DWORD *msgLen, /* IN - length of buffer, OUT - msg len */
- DWORD timeOut, /* how long to wait for the message */
- ImbAsyncSeq *seqNo, /* previously returned seq number */
- /* (or ASYNC_SEQ_START) */
- DWORD channelNumber
- )
+GetAsyncImbpMessage (ImbPacket *msgPtr, DWORD *msgLen, DWORD timeOut,
+ ImbAsyncSeq *seqNo, DWORD channelNumber)
{
-
- BOOL status;
- BYTE responseData[MAX_ASYNC_RESP_SIZE], lun;
- ImbAsyncResponse * resp = (ImbAsyncResponse *) responseData;
- DWORD respLength = sizeof( responseData );
- ImbAsyncRequest req;
-
- while(1)
- {
-
-
- if( (msgPtr == NULL) || (msgLen == NULL) || ( seqNo == NULL) )
- return ACCESN_ERROR;
-
- req.timeOut = timeOut * 1000; /* convert to uSec units */
- req.lastSeq = *seqNo;
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_GET_ASYNC_MSG,
- & req,
- sizeof( req ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE ) {
- DWORD error = GetLastError();
- /*
- // handle "msg not available" specially. it is
- // different from a random old error.
- */
- switch( error ) {
- case IMB_MSG_NOT_AVAILABLE:
- return ACCESN_END_OF_DATA;
- default:
- return ACCESN_ERROR;
- }
- return ACCESN_ERROR;
- }
- if( respLength < MIN_ASYNC_RESP_SIZE ) {
- return ACCESN_ERROR;
- }
- respLength -= MIN_ASYNC_RESP_SIZE;
-
- if( *msgLen < respLength ) {
- return ACCESN_ERROR;
- }
-
-
- /*same code as in NT section */
- if ( IpmiVersion == IPMI_09_VERSION)
- {
-
- switch( channelNumber) {
- case IPMB_CHANNEL:
- lun = IPMB_LUN;
- break;
-
- case EMP_CHANNEL:
- lun = EMP_LUN;
- break;
-
- default:
- lun = RESERVED_LUN;
- break;
- }
-
- if ( (lun == RESERVED_LUN) ||
- (lun != ((((ImbPacket *)(resp->data))->nfLn) & 0x3 ))
- )
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
-
- memcpy( msgPtr, resp->data, respLength );
- *msgLen = respLength;
-
- }
- else
- {
- /* it is a 1.0 or above version */
-
- if (resp->data[0] != (BYTE)channelNumber)
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
- memcpy( msgPtr, &(resp->data[1]), respLength-1 );
- *msgLen = respLength-1;
-
-
- }
-
- /*
- // give the caller his sequence number
- */
- *seqNo = resp->thisSeq;
-
- return ACCESN_OK;
-
- } /*while (1) */
+ /* This function does exactly the same as GetAsuncImbpMessage_Ex(),
+ * but doesn't return session handle and privilege
+ */
+ return GetAsyncImbpMessage_Ex(msgPtr, msgLen, timeOut,
+ seqNo, channelNumber,
+ NULL, NULL);
}
-
-/*///////////////////////////////////////////////////////////////////////////
-//GetAsyncImbpMessage_Ex
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: GetAsyncImbpMessage_Ex
-// Purpose: This function gets the next available async message with a message id
-// greater than SeqNo. The message looks like an IMB packet
-// and the length and Sequence number is returned
-// Context: Used by Upper level agents (sis modules) to access Asynchronous IMB implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// msgPtr Pointer to Async IMB request
-// msgLen Length
-// timeOut Time to wait
-// seqNo Sequence Munber
-// Notes: none
-*F*/
-
+/* GetAsyncImbpMessage_Ex - gets the next available async message with a message
+ * ID greater than SeqNo. The message looks like an IMB packet and the length
+ * and Sequence number is returned.
+ *
+ * @msgPtr - request info and data
+ * @msgLen - IN - length of buffer, OUT - msg len
+ * @timeOut - how long to wait for the message
+ * @seqNo - previously returned seq number(or ASYNC_SEQ_START)
+ * @channelNumber
+ * @sessionHandle
+ * @privilege
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-GetAsyncImbpMessage_Ex (
- ImbPacket * msgPtr, /* request info and data */
- DWORD *msgLen, /* IN - length of buffer, OUT - msg len */
- DWORD timeOut, /* how long to wait for the message */
- ImbAsyncSeq *seqNo, /* previously returned seq number */
- /* (or ASYNC_SEQ_START) */
- DWORD channelNumber,
- BYTE * sessionHandle,
- BYTE * privilege
- )
+GetAsyncImbpMessage_Ex(ImbPacket *msgPtr, DWORD *msgLen, DWORD timeOut,
+ ImbAsyncSeq *seqNo, DWORD channelNumber, BYTE *sessionHandle,
+ BYTE *privilege)
{
+ BOOL status;
+ BYTE responseData[MAX_ASYNC_RESP_SIZE];
+ BYTE lun;
+ ImbAsyncResponse *resp = (ImbAsyncResponse *)responseData;
+ DWORD respLength = sizeof(responseData);
+ ImbAsyncRequest req;
+
+ while (1) {
+ if (!msgPtr || !msgLen || !seqNo) {
+ return ACCESN_ERROR;
+ }
- BOOL status;
- BYTE responseData[MAX_ASYNC_RESP_SIZE], lun;
- ImbAsyncResponse * resp = (ImbAsyncResponse *) responseData;
- DWORD respLength = sizeof( responseData );
- ImbAsyncRequest req;
-
- while(1)
- {
-
-
- if( (msgPtr == NULL) || (msgLen == NULL) || ( seqNo == NULL) )
+ /* convert to uSec units */
+ req.timeOut = timeOut * 1000;
+ req.lastSeq = *seqNo;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_GET_ASYNC_MSG, &req,
+ sizeof(req), &responseData,
+ sizeof(responseData), &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d",
+ __func__, status);
+ if (status != TRUE) {
+ DWORD error = GetLastError();
+ /* handle "msg not available" specially. it is
+ * different from a random old error.
+ */
+ switch (error) {
+ case IMB_MSG_NOT_AVAILABLE:
+ return ACCESN_END_OF_DATA;
+ break;
+ default:
return ACCESN_ERROR;
+ break;
+ }
+ } else if (respLength < MIN_ASYNC_RESP_SIZE) {
+ return ACCESN_ERROR;
+ }
- req.timeOut = timeOut * 1000; /* convert to uSec units */
- req.lastSeq = *seqNo;
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_GET_ASYNC_MSG,
- & req,
- sizeof( req ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
+ respLength -= MIN_ASYNC_RESP_SIZE;
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ if (*msgLen < respLength) {
+ return ACCESN_ERROR;
+ }
- if( status != TRUE ) {
- DWORD error = GetLastError();
- /*
- // handle "msg not available" specially. it is
- // different from a random old error.
- */
- switch( error ) {
- case IMB_MSG_NOT_AVAILABLE:
- return ACCESN_END_OF_DATA;
- default:
- return ACCESN_ERROR;
- }
- return ACCESN_ERROR;
+ /* same code as in NT section */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ switch (channelNumber) {
+ case IPMB_CHANNEL:
+ lun = IPMB_LUN;
+ break;
+ case EMP_CHANNEL:
+ lun = EMP_LUN;
+ break;
+ default:
+ lun = RESERVED_LUN;
+ break;
}
- if( respLength < MIN_ASYNC_RESP_SIZE ) {
- return ACCESN_ERROR;
- }
- respLength -= MIN_ASYNC_RESP_SIZE;
- if( *msgLen < respLength ) {
- return ACCESN_ERROR;
+ if ((lun == RESERVED_LUN)
+ || (lun != ((((ImbPacket *)(resp->data))->nfLn) & 0x3))) {
+ *seqNo = resp->thisSeq;
+ continue;
}
-
- /*same code as in NT section */
- if ( IpmiVersion == IPMI_09_VERSION)
- {
-
- switch( channelNumber) {
- case IPMB_CHANNEL:
- lun = IPMB_LUN;
- break;
-
- case EMP_CHANNEL:
- lun = EMP_LUN;
- break;
-
- default:
- lun = RESERVED_LUN;
- break;
- }
-
- if ( (lun == RESERVED_LUN) ||
- (lun != ((((ImbPacket *)(resp->data))->nfLn) & 0x3 ))
- )
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
-
- memcpy( msgPtr, resp->data, respLength );
- *msgLen = respLength;
-
- }
- else
- {
- if((sessionHandle ==NULL) || (privilege ==NULL))
- return ACCESN_ERROR;
-
- /*With the new IPMI version the get message command returns the
- //channel number along with the privileges.The 1st 4 bits of the
- //second byte of the response data for get message command represent
- //the channel number & the last 4 bits are the privileges. */
- *privilege = (resp->data[0] & 0xf0)>> 4;
-
- if ((resp->data[0] & 0x0f) != (BYTE)channelNumber)
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
-
- /*The get message command according to IPMI 1.5 spec now even
- //returns the session handle.This is required to be captured
- //as it is required as request data for send message command. */
+ memcpy(msgPtr, resp->data, respLength);
+ *msgLen = respLength;
+ } else {
+ /* it is version 1.0 or better */
+ if ((resp->data[0] & 0x0f) != (BYTE)channelNumber) {
+ *seqNo = resp->thisSeq;
+ continue;
+ }
+ /* With the new IPMI version the get message command
+ * returns the channel number along with the
+ * privileges. The 1st 4 bits of the second byte of the
+ * response data for get message command represent the
+ * channel number & the last 4 bits are the privileges.
+ */
+ if (sessionHandle && privilege) {
+ *privilege = (resp->data[0] & 0xf0) >> 4;
+ /* The get message command according to IPMI 1.5 spec
+ * now even returns the session handle. This is required
+ * to be captured as it is required as request data for
+ * send message command.
+ */
*sessionHandle = resp->data[1];
- memcpy( msgPtr, &(resp->data[2]), respLength-1 );
- *msgLen = respLength-1;
-
-
}
-
- /*
- // give the caller his sequence number
- */
+ memcpy(msgPtr, &(resp->data[2]), (respLength - 1));
+ *msgLen = respLength - 1;
+ }
+ /* give the caller his sequence number */
*seqNo = resp->thisSeq;
-
return ACCESN_OK;
-
- } /*while (1) */
-}
-
-
-
-/*//////////////////////////////////////////////////////////////////////////////
-//IsAsyncMessageAvailable
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: IsMessageAvailable
-// Purpose: This function waits for an Async Message
-//
-// Context: Used by Upper level agents access Asynchronous IMB based
-// messages
-// Returns: OK else error status code
-// Parameters:
-// eventId
-//
-// Notes: This call will block the calling thread if no Async events are
-// are available in the queue.
-//
-*F*/
-ACCESN_STATUS
-IsAsyncMessageAvailable (unsigned int eventId )
-{
- int dummy;
- int respLength = 0;
- BOOL status;
-
- /* confirm that app is not using a bad Id */
-
-
- if ( AsyncEventHandle != (HANDLE) eventId)
- return ACCESN_ERROR;
-
- status = DeviceIoControl(hDevice,
- IOCTL_IMB_CHECK_EVENT,
- &AsyncEventHandle,
- sizeof(HANDLE ),
- &dummy,
- sizeof(int),
- (LPDWORD) & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE )
- return ACCESN_ERROR;
-
-
- return ACCESN_OK;
+ }
}
-
-/*I have retained this commented code because later we may want to use
-//DPC message specific Processing (pai 11/21) */
-
-#ifdef NOT_COMPILED_BUT_LEFT_HERE_FOR_NOW
-
-/*//////////////////////////////////////////////////////////////////////////////
-//GetAsyncDpcMessage
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: GetAsyncDpcMessage
-// Purpose: This function gets the next available async message from
-// the DPC client.
-//
-// Context: Used by Upper level agents access Asynchronous IMB based
-// messages sent by the DPC client.
-// Returns: OK else error status code
-// Parameters:
-// msgPtr Pointer to Async IMB request
-// msgLen Length
-// timeOut Time to wait
-// seqNo Sequence Munber
-// Notes: This call will block the calling thread if no Async events are
-// are available in the queue.
-//
-*F*/
-
+/* IsAsyncMessageAvailable - Waits for an Async Message. This call will block
+ * the calling thread if no Async events are are available in the queue.
+ *
+ * @dummy
+ * @respLength
+ * @status
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-GetAsyncDpcMessage (
- ImbPacket * msgPtr, /* request info and data */
- DWORD * msgLen, /* IN - length of buffer, OUT - msg len */
- DWORD timeOut, /* how long to wait for the message */
- ImbAsyncSeq * seqNo, /* previously returned seq number (or ASYNC_SEQ_START) */
- )
+IsAsyncMessageAvailable(unsigned int eventId)
{
- BOOL status;
- BYTE responseData[MAX_ASYNC_RESP_SIZE];
- ImbAsyncResponse * resp = (ImbAsyncResponse *) responseData;
- DWORD respLength = sizeof( responseData );
- ImbAsyncRequest req;
-
- if( msgPtr == NULL || msgLen == NULL || seqNo == NULL )
- return ACCESN_ERROR;
-
- req.lastSeq = *seqNo;
-
-
- hEvt = CreateEvent (NULL, TRUE, FALSE, NULL) ;
- if (!hEvt) {
+ int dummy;
+ int respLength = 0;
+ BOOL status;
+ /* confirm that app is not using a bad Id */
+ if (AsyncEventHandle != (HANDLE)eventId) {
return ACCESN_ERROR;
}
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_GET_DPC_MSG,
- & req,
- sizeof( req ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- &ovl
- );
-
- if( status != TRUE ) {
- DWORD error = GetLastError();
- /*
- // handle "msg not available" specially. it is different from
- // a random old error.
- //
- */
- if (!status)
- {
- switch (error )
- {
- case ERROR_IO_PENDING:
-
- WaitForSingleObject (hEvt, INFINITE) ;
- ResetEvent (hEvt) ;
- break;
-
- case IMB_MSG_NOT_AVAILABLE:
-
- CloseHandle(hEvt);
- return ACCESN_END_OF_DATA;
-
- default:
- CloseHandle(hEvt);
- return ACCESN_ERROR;
-
- }
- }
-
-
-
- if (
- ( GetOverlappedResult(hDevice,
- &ovl,
- (LPDWORD)&respLength,
- TRUE
- ) == 0 ) || (respLength <= 0)
- )
-
- {
-
- CloseHandle(hEvt);
- return ACCESN_ERROR;
-
- }
-
-
- }
-
- if( respLength < MIN_ASYNC_RESP_SIZE ) {
- CloseHandle(hEvt);
- return ACCESN_ERROR;
- }
-
- respLength -= MIN_ASYNC_RESP_SIZE;
-
- if( *msgLen < respLength ) {
-
- /* The following code should have been just return ACCESN_out_of_range */
- CloseHandle(hEvt);
+ status = DeviceIoControl(hDevice, IOCTL_IMB_CHECK_EVENT,
+ &AsyncEventHandle, sizeof(HANDLE), &dummy, sizeof(int),
+ (LPDWORD)&respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
return ACCESN_ERROR;
}
-
- memcpy( msgPtr, resp->data, respLength );
-
- *msgLen = respLength;
- /*
- // give the caller his sequence number
- */
- *seqNo = resp->thisSeq;
-
- CloseHandle(hEvt);
-
-
return ACCESN_OK;
-
}
-#endif /*NOT_COMPILED_BUT_LEFT_HERE_FOR_NOW*/
-
-
-/*/////////////////////////////////////////////////////////////////////////////
-//RegisterForImbAsyncMessageNotification
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: RegisterForImbAsyncMessageNotification
-// Purpose: This function Registers the calling application
-// for Asynchronous notification when a sms message
-// is available with the IMB driver.
-//
-// Context: Used by Upper level agents to know that an async
-// SMS message is available with the driver.
-// Returns: OK else error status code
-// Parameters:
-// handleId pointer to the registration handle
-//
-// Notes: The calling application should use the returned handle to
-// get the Async messages..
-*F*/
+/* RegisterForImbAsyncMessageNotification - This function Registers the calling
+ * application for Asynchronous notification when a sms message is available
+ * with the IMB driver.
+ *
+ * Notes: The calling application should use the returned handle to
+ * get the Async messages..
+ *
+ * @handleId - pointer to the registration handle
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-RegisterForImbAsyncMessageNotification (unsigned int *handleId)
-
+RegisterForImbAsyncMessageNotification(unsigned int *handleId)
{
- BOOL status;
- DWORD respLength ;
- int dummy;
-
+ BOOL status;
+ DWORD respLength ;
+ int dummy;
/*allow only one app to register */
-
- if( (handleId == NULL ) || (AsyncEventHandle) )
+ if (!handleId || AsyncEventHandle) {
return ACCESN_ERROR;
-
-
- status = DeviceIoControl(hDevice,
- IOCTL_IMB_REGISTER_ASYNC_OBJ,
- &dummy,
- sizeof( int ),
- &AsyncEventHandle,
- (DWORD)sizeof(HANDLE ),
- (LPDWORD) & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( (respLength != sizeof(int)) || (status != TRUE ))
- return ACCESN_ERROR;
-
+ }
+ status = DeviceIoControl(hDevice, IOCTL_IMB_REGISTER_ASYNC_OBJ, &dummy,
+ sizeof(int), &AsyncEventHandle, (DWORD)sizeof(HANDLE),
+ (LPDWORD)&respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((respLength != sizeof(int)) || (status != TRUE)) {
+ return ACCESN_ERROR;
+ }
/* printf("imbapi: Register handle = %x\n",AsyncEventHandle); *//*++++*/
- *handleId = (unsigned int) AsyncEventHandle;
-
-#ifndef NO_MACRO_ARGS
- DEBUG("handleId = %x AsyncEventHandle %x\n", *handleId, AsyncEventHandle);
-#endif
+ *handleId = (unsigned int)AsyncEventHandle;
+ lprintf(LOG_DEBUG, "handleId = %x AsyncEventHandle %x", *handleId,
+ AsyncEventHandle);
return ACCESN_OK;
}
-
-
-
-
-/*/////////////////////////////////////////////////////////////////////////////
-//UnRegisterForImbAsyncMessageNotification
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: UnRegisterForImbAsyncMessageNotification
-// Purpose: This function un-registers the calling application
-// for Asynchronous notification when a sms message
-// is available with the IMB driver.
-//
-// Context: Used by Upper level agents to un-register
-// for async. notification of sms messages
-// Returns: OK else error status code
-// Parameters:
-// handleId pointer to the registration handle
-// iFlag value used to determine where this function was called from
-// _it is used currently on in NetWare environment_
-//
-// Notes:
-*F*/
+/* UnRegisterForImbAsyncMessageNotification - This function un-registers the
+ * calling application for Asynchronous notification when a sms message is
+ * available with the IMB driver. It is used by Upper level agents to
+ * un-register for async. notification of sms messages.
+ *
+ * @handleId - pointer to the registration handle
+ * @iFlag - value used to determine where this function was called from. It is
+ * used currently on in NetWare environment.
+ *
+ * returns - status
+ */
ACCESN_STATUS
-UnRegisterForImbAsyncMessageNotification (unsigned int handleId, int iFlag)
-
+UnRegisterForImbAsyncMessageNotification(unsigned int handleId, int iFlag)
{
- BOOL status;
- DWORD respLength ;
- int dummy;
-
- iFlag = iFlag; /* to keep compiler happy We are not using this flag*/
-
- if ( AsyncEventHandle != (HANDLE) handleId)
- return ACCESN_ERROR;
-
- status = DeviceIoControl(hDevice,
- IOCTL_IMB_DEREGISTER_ASYNC_OBJ,
- &AsyncEventHandle,
- (DWORD)sizeof(HANDLE ),
- &dummy,
- (DWORD)sizeof(int ),
- (LPDWORD) & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ BOOL status;
+ DWORD respLength ;
+ int dummy;
+ /* to keep compiler happy. We are not using this flag*/
+ iFlag = iFlag;
- if( status != TRUE )
- return ACCESN_ERROR;
+ if (AsyncEventHandle != (HANDLE)handleId) {
+ return ACCESN_ERROR;
+ }
+ status = DeviceIoControl(hDevice, IOCTL_IMB_DEREGISTER_ASYNC_OBJ,
+ &AsyncEventHandle, (DWORD)sizeof(HANDLE ), &dummy,
+ (DWORD)sizeof(int), (LPDWORD)&respLength, NULL );
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
+ return ACCESN_ERROR;
+ }
return ACCESN_OK;
}
-
-/*///////////////////////////////////////////////////////////////////////////
-// SetShutDownCode
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SetShutDownCode
-// Purpose: To set the shutdown action code
-// Context: Called by the System Control Subsystem
-// Returns: none
-// Parameters:
-// code shutdown action code which can be either
-// SD_NO_ACTION, SD_RESET, SD_POWER_OFF as defined in imb_if.h
-*F*/
-
-ACCESN_STATUS
-SetShutDownCode (
- int delayTime, /* time to delay in 100ms units */
- int code /* what to do when time expires */
- )
-{
- DWORD retLength;
- BOOL status;
- ShutdownCmdBuffer cmd;
-
- /*
- // If Imb driver is not present return AccessFailed
- */
- if(hDevice == INVALID_HANDLE_VALUE)
+/* SetShutDownCode - To set the shutdown action code.
+ *
+ * @code - shutdown action code which can be either SD_NO_ACTION, SD_RESET,
+ * SD_POWER_OFF as defined in imb_if.h
+ * @delayTime - time to delay in 100ms units
+ *
+ * returns - status
+ */
+ACCESN_STATUS
+SetShutDownCode(int delayTime, int code)
+{
+ DWORD retLength;
+ BOOL status;
+ ShutdownCmdBuffer cmd;
+ /* If IMB interface isn't open, return AccessFailed */
+ if (hDevice == INVALID_HANDLE_VALUE) {
return ACCESN_ERROR;
-
- cmd.code = code;
- cmd.delayTime = delayTime;
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SHUTDOWN_CODE,
- & cmd,
- sizeof( cmd ),
- NULL,
- 0,
- & retLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if(status == TRUE)
+ }
+ cmd.code = code;
+ cmd.delayTime = delayTime;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SHUTDOWN_CODE, &cmd,
+ sizeof(cmd), NULL, 0, &retLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status == TRUE) {
return ACCESN_OK;
- else
+ } else {
return ACCESN_ERROR;
+ }
}
/*/////////////////////////////////////////////////////////////////////////
@@ -1919,36 +1268,27 @@ SetShutDownCode (
*F*/
#ifdef WIN32
ACCESN_STATUS
-MapPhysicalMemory (
- int startAddress, // physical address to map in
- int addressLength, // how much to map
- int *virtualAddress // where it got mapped to
- )
+MapPhysicalMemory(int startAddress, int addressLength, int *virtualAddress)
{
- DWORD retLength;
- BOOL status;
+ DWORD retLength;
+ BOOL status;
PHYSICAL_MEMORY_INFO pmi;
- if (startAddress == 0 || addressLength <= 0)
+ if (startAddress == 0 || addressLength <= 0) {
return ACCESN_OUT_OF_RANGE;
+ }
- pmi.InterfaceType = Internal;
- pmi.BusNumber = 0;
+ pmi.InterfaceType = Internal;
+ pmi.BusNumber = 0;
pmi.BusAddress.HighPart = (LONG)0x0;
- pmi.BusAddress.LowPart = (LONG)startAddress;
- pmi.AddressSpace = (LONG) 0;
- pmi.Length = addressLength;
-
- status = DeviceIoControl ( hDevice,
- IOCTL_IMB_MAP_MEMORY,
- & pmi,
- sizeof(PHYSICAL_MEMORY_INFO),
- virtualAddress,
- sizeof(PVOID),
- & retLength,
- 0
- );
- if( status == TRUE ) {
+ pmi.BusAddress.LowPart = (LONG)startAddress;
+ pmi.AddressSpace = (LONG)0;
+ pmi.Length = addressLength;
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_MAP_MEMORY, &pmi,
+ sizeof(PHYSICAL_MEMORY_INFO), virtualAddress,
+ sizeof(PVOID), &retLength, 0);
+ if (status == TRUE) {
return ACCESN_OK;
} else {
return ACCESN_ERROR;
@@ -1956,40 +1296,27 @@ MapPhysicalMemory (
}
ACCESN_STATUS
-UnmapPhysicalMemory (
- int virtualAddress, // what memory to unmap
- int Length )
+UnmapPhysicalMemory(int virtualAddress, int Length)
{
- DWORD retLength;
- BOOL status;
-
- status = DeviceIoControl ( hDevice,
- IOCTL_IMB_UNMAP_MEMORY,
- & virtualAddress,
- sizeof(PVOID),
- NULL,
- 0,
- & retLength,
- 0
- );
-
- if( status == TRUE ) {
+ DWORD retLength;
+ BOOL status;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_UNMAP_MEMORY,
+ &virtualAddress, sizeof(PVOID), NULL, 0, &retLength, 0);
+ if (status == TRUE) {
return ACCESN_OK;
} else {
return ACCESN_ERROR;
}
}
-
-#else /*Linux, SCO, UNIX, etc.*/
-
+#else /* Linux, SCO, UNIX, etc. */
ACCESN_STATUS
-MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
+MapPhysicalMemory(int startAddress, int addressLength, int *virtualAddress)
{
- int fd;
- unsigned int length = addressLength;
- off_t startpAddress = (off_t)startAddress;
- unsigned int diff;
- char *startvAddress;
+ int fd;
+ unsigned int length = addressLength;
+ off_t startpAddress = (off_t)startAddress;
+ unsigned int diff;
+ char *startvAddress;
#if defined(PAGESIZE)
long int pagesize = PAGESIZE;
#elif defined(_SC_PAGESIZE)
@@ -1998,64 +1325,47 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
perror("Invalid pagesize");
}
#else
-# error PAGESIZE unsupported
+# error PAGESIZE unsupported
#endif
-
- if ((startAddress == 0) || (addressLength <= 0))
+ if ((startAddress == 0) || (addressLength <= 0)) {
return ACCESN_ERROR;
-
- if ( (fd = open("/dev/mem", O_RDONLY)) < 0) {
+ }
+ if ((fd = open("/dev/mem", O_RDONLY)) < 0) {
char buf[128];
-
sprintf(buf,"%s %s: open(%s) failed",
- __FILE__,__FUNCTION__,IMB_DEVICE);
+ __FILE__, __func__, IMB_DEVICE);
perror(buf);
- return ACCESN_ERROR ;
+ return ACCESN_ERROR;
}
-
/* aliging the offset to a page boundary and adjusting the length */
diff = (int)startpAddress % pagesize;
startpAddress -= diff;
length += diff;
-
- if ( (startvAddress = mmap(0,
- length,
- PROT_READ,
- MAP_SHARED,
- fd,
- startpAddress
- ) ) == MAP_FAILED)
- {
+ if ((startvAddress = mmap(0, length, PROT_READ, MAP_SHARED, fd,
+ startpAddress)) == MAP_FAILED) {
char buf[128];
-
- sprintf(buf,"%s %s: mmap failed", __FILE__,__FUNCTION__);
+ sprintf(buf, "%s %s: mmap failed", __FILE__, __func__);
perror(buf);
close(fd);
return ACCESN_ERROR;
}
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: mmap of 0x%x success\n",__FUNCTION__,startpAddress);
-#endif
+ lprintf(LOG_DEBUG, "%s: mmap of 0x%x success", __func__,
+ startpAddress);
#ifdef LINUX_DEBUG_MAX
-/* dont want this memory dump for normal level of debugging.
-// So, I have put it under a stronger debug symbol. mahendra */
-
- for(i=0; i < length; i++)
- {
+ for (int i = 0; i < length; i++) {
printf("0x%x ", (startvAddress[i]));
if(isascii(startvAddress[i])) {
printf("%c ", (startvAddress[i]));
}
- }
-#endif /*LINUX_DEBUG_MAX */
-
+ }
+#endif /* LINUX_DEBUG_MAX */
*virtualAddress = (long)(startvAddress + diff);
close(fd);
return ACCESN_OK;
}
ACCESN_STATUS
-UnmapPhysicalMemory( int virtualAddress, int Length )
+UnmapPhysicalMemory(int virtualAddress, int Length)
{
unsigned int diff = 0;
#if defined(PAGESIZE)
@@ -2066,53 +1376,29 @@ UnmapPhysicalMemory( int virtualAddress, int Length )
perror("Invalid pagesize");
}
#else
-# error PAGESIZE unsupported
+# error PAGESIZE unsupported
#endif
-
/* page align the virtual address and adjust length accordingly */
- diff = ((unsigned int) virtualAddress) % pagesize;
+ diff = ((unsigned int)virtualAddress) % pagesize;
virtualAddress -= diff;
Length += diff;
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: calling munmap(0x%x,%d)\n",__FUNCTION__,virtualAddress,Length);
-#endif
-
- if(munmap(&virtualAddress, Length) != 0)
- {
+ lprintf(LOG_DEBUG, "%s: calling munmap(0x%x,%d)", __func__,
+ virtualAddress,Length);
+ if (munmap(&virtualAddress, Length) != 0) {
char buf[128];
-
- sprintf(buf,"%s %s: munmap failed", __FILE__,__FUNCTION__);
+ sprintf(buf, "%s %s: munmap failed", __FILE__, __func__);
perror(buf);
return ACCESN_ERROR;
-
}
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: munmap(0x%x,%d) success\n",__FUNCTION__,virtualAddress,Length);
-#endif
-
+ lprintf(LOG_DEBUG, "%s: munmap(0x%x,%d) success", __func__,
+ virtualAddress, Length);
return ACCESN_OK;
}
-#endif /*unix*/
+#endif /* unix */
-
-/*/////////////////////////////////////////////////////////////////////////////
-// GetIpmiVersion
-//////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: GetIpmiVersion
-// Purpose: This function returns current IPMI version
-// Context:
-// Returns: IPMI version
-// Parameters:
-// reqPtr
-// timeOut
-// respDataPtr
-// respLen
-// Notes: svuppula
-*F*/
-BYTE GetIpmiVersion()
+/* GetIpmiVersion - returns current IPMI version. */
+BYTE
+GetIpmiVersion()
{
- return IpmiVersion;
+ return IpmiVersion;
}
-
diff --git a/src/plugins/imb/imbapi.h b/src/plugins/imb/imbapi.h
index 6ba4121..67fdc84 100644
--- a/src/plugins/imb/imbapi.h
+++ b/src/plugins/imb/imbapi.h
@@ -33,8 +33,14 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*----------------------------------------------------------------------*/
+
+#pragma once
+
#ifndef _WINDEFS_H
#define _WINDEFS_H
+
+#include <stddef.h>
+
#ifndef FALSE
#define FALSE 0
#endif
@@ -261,7 +267,7 @@ typedef struct {
#define SD_POWER_OFF 2
#pragma pack(1)
/*
- * This is the generic IMB packet format, the final checksum cant be
+ * This is the generic IMB packet format, the final checksum can't be
* represented in this structure and will show up as the last data byte
*/
typedef struct {
@@ -318,7 +324,7 @@ typedef struct {
} ImbRequest;
typedef struct {
DWORD flags; /* request flags*/
-#define NO_RESPONSE_EXPECTED 0x01 /*dont wait around for an IMB response*/
+#define NO_RESPONSE_EXPECTED 0x01 /*don't wait around for an IMB response*/
DWORD timeOut; /* in uSec units*/
ImbRequest req; /* message buffer*/
} ImbRequestBuffer;
@@ -541,7 +547,7 @@ typedef struct
*/
#define ASYNC_SEQ_START 0
/*
- * This is the generic IMB packet format, the final checksum cant be
+ * This is the generic IMB packet format, the final checksum can't be
* represented in this structure and will show up as the last data byte
*/
/*
diff --git a/src/plugins/ipmi_intf.c b/src/plugins/ipmi_intf.c
index 6cf0553..e424a64 100644
--- a/src/plugins/ipmi_intf.c
+++ b/src/plugins/ipmi_intf.c
@@ -29,9 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE 700
-#define _GNU_SOURCE 1
-#define _DARWIN_C_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
@@ -89,6 +86,9 @@ extern struct ipmi_intf ipmi_dummy_intf;
#ifdef IPMI_INTF_USB
extern struct ipmi_intf ipmi_usb_intf;
#endif
+#ifdef IPMI_INTF_DBUS
+extern struct ipmi_intf ipmi_dbus_intf;
+#endif
struct ipmi_intf * ipmi_intf_table[] = {
#ifdef IPMI_INTF_OPEN
@@ -122,9 +122,32 @@ struct ipmi_intf * ipmi_intf_table[] = {
#ifdef IPMI_INTF_USB
&ipmi_usb_intf,
#endif
+#ifdef IPMI_INTF_DBUS
+ &ipmi_dbus_intf,
+#endif
NULL
};
+/* get_default_interface - return the interface that was chosen by configure
+ *
+ * returns a valid interface pointer
+ */
+static struct ipmi_intf *get_default_interface(void)
+{
+ static const char *default_intf_name = DEFAULT_INTF;
+ struct ipmi_intf ** intf;
+ for (intf = ipmi_intf_table; intf && *intf; intf++) {
+ if (!strcmp(default_intf_name, (*intf)->name)) {
+ return *intf;
+ }
+ }
+ /* code should never reach this because the configure script checks
+ * to see that the default interface is actually enabled, but we have
+ * to return some valid value here, so the first entry works
+ */
+ return ipmi_intf_table[0];
+}
+
/* ipmi_intf_print - Print list of interfaces
*
* no meaningful return code
@@ -132,20 +155,20 @@ struct ipmi_intf * ipmi_intf_table[] = {
void ipmi_intf_print(struct ipmi_intf_support * intflist)
{
struct ipmi_intf ** intf;
+ struct ipmi_intf *def_intf;
struct ipmi_intf_support * sup;
- int def = 1;
int found;
+ def_intf = get_default_interface();
lprintf(LOG_NOTICE, "Interfaces:");
for (intf = ipmi_intf_table; intf && *intf; intf++) {
- if (intflist != NULL) {
+ if (intflist) {
found = 0;
- for (sup=intflist; sup->name != NULL; sup++) {
- if (strncmp(sup->name, (*intf)->name, strlen(sup->name)) == 0 &&
- strncmp(sup->name, (*intf)->name, strlen((*intf)->name)) == 0 &&
- sup->supported == 1)
+ for (sup=intflist; sup->name; sup++) {
+ if (!strcmp(sup->name, (*intf)->name)
+ && sup->supported)
found = 1;
}
if (found == 0)
@@ -154,8 +177,7 @@ void ipmi_intf_print(struct ipmi_intf_support * intflist)
lprintf(LOG_NOTICE, "\t%-12s %s %s",
(*intf)->name, (*intf)->desc,
- def ? "[default]" : "");
- def = 0;
+ def_intf == (*intf) ? "[default]" : "");
}
lprintf(LOG_NOTICE, "");
}
@@ -173,9 +195,9 @@ struct ipmi_intf * ipmi_intf_load(char * name)
struct ipmi_intf ** intf;
struct ipmi_intf * i;
- if (name == NULL) {
- i = ipmi_intf_table[0];
- if (i->setup != NULL && (i->setup(i) < 0)) {
+ if (!name) {
+ i = get_default_interface();
+ if (i->setup && (i->setup(i) < 0)) {
lprintf(LOG_ERR, "Unable to setup "
"interface %s", name);
return NULL;
@@ -184,11 +206,12 @@ struct ipmi_intf * ipmi_intf_load(char * name)
}
for (intf = ipmi_intf_table;
- ((intf != NULL) && (*intf != NULL));
- intf++) {
+ intf && *intf;
+ intf++)
+ {
i = *intf;
- if (strncmp(name, i->name, strlen(name)) == 0) {
- if (i->setup != NULL && (i->setup(i) < 0)) {
+ if (!strcmp(name, i->name)) {
+ if (i->setup && (i->setup(i) < 0)) {
lprintf(LOG_ERR, "Unable to setup "
"interface %s", name);
return NULL;
@@ -203,11 +226,11 @@ struct ipmi_intf * ipmi_intf_load(char * name)
void
ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname)
{
- if (intf->ssn_params.hostname != NULL) {
+ if (intf->ssn_params.hostname) {
free(intf->ssn_params.hostname);
intf->ssn_params.hostname = NULL;
}
- if (hostname == NULL) {
+ if (!hostname) {
return;
}
intf->ssn_params.hostname = strdup(hostname);
@@ -218,7 +241,7 @@ ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username)
{
memset(intf->ssn_params.username, 0, 17);
- if (username == NULL)
+ if (!username)
return;
memcpy(intf->ssn_params.username, username, __min(strlen(username), 16));
@@ -229,7 +252,7 @@ ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password)
{
memset(intf->ssn_params.authcode_set, 0, IPMI_AUTHCODE_BUFFER_SIZE);
- if (password == NULL) {
+ if (!password) {
intf->ssn_params.password = 0;
return;
}
@@ -251,11 +274,14 @@ ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit)
intf->ssn_params.lookupbit = lookupbit;
}
+#ifdef IPMI_INTF_LANPLUS
void
-ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id)
+ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf,
+ enum cipher_suite_ids cipher_suite_id)
{
intf->ssn_params.cipher_suite_id = cipher_suite_id;
}
+#endif /* IPMI_INTF_LANPLUS */
void
ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char)
@@ -264,15 +290,9 @@ ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_c
}
void
-ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey)
+ipmi_intf_session_set_kgkey(struct ipmi_intf *intf, const uint8_t *kgkey)
{
- memset(intf->ssn_params.kg, 0, IPMI_KG_BUFFER_SIZE);
-
- if (kgkey == NULL)
- return;
-
- memcpy(intf->ssn_params.kg, kgkey,
- __min(strlen(kgkey), IPMI_KG_BUFFER_SIZE));
+ memcpy(intf->ssn_params.kg, kgkey, IPMI_KG_BUFFER_SIZE);
}
void
@@ -308,7 +328,7 @@ ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry)
void
ipmi_intf_session_cleanup(struct ipmi_intf *intf)
{
- if (intf->session == NULL) {
+ if (!intf->session) {
return;
}
@@ -319,7 +339,7 @@ ipmi_intf_session_cleanup(struct ipmi_intf *intf)
void
ipmi_cleanup(struct ipmi_intf * intf)
{
- ipmi_sdr_list_empty(intf);
+ ipmi_sdr_list_empty();
ipmi_intf_session_set_hostname(intf, NULL);
}
@@ -340,7 +360,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
params = &intf->ssn_params;
- if (params->hostname == NULL || strlen((const char *)params->hostname) == 0) {
+ if (!params->hostname || strlen((const char *)params->hostname) == 0) {
lprintf(LOG_ERR, "No hostname specified!");
return -1;
}
@@ -368,7 +388,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
* and) try the next address.
*/
- for (rp = rp0; rp != NULL; rp = rp->ai_next) {
+ for (rp = rp0; rp; rp = rp->ai_next) {
/* We are only interested in IPv4 and IPv6 */
if ((rp->ai_family != AF_INET6) && (rp->ai_family != AF_INET)) {
continue;
@@ -412,8 +432,8 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
break;
}
- for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL) {
+ for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) {
+ if (!ifa->ifa_addr) {
continue;
}
@@ -430,7 +450,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
len = sizeof(struct sockaddr_in6);
if ( getnameinfo((struct sockaddr *)tmp6, len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) == 0) {
lprintf(LOG_DEBUG, "Testing %s interface address: %s scope=%d",
- ifa->ifa_name != NULL ? ifa->ifa_name : "???",
+ ifa->ifa_name ? ifa->ifa_name : "???",
hbuf,
tmp6->sin6_scope_id);
}
@@ -482,13 +502,14 @@ uint16_t
ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
{
int16_t size;
+ uint8_t bridging_level = ipmi_intf_get_bridging_level(intf);
size = intf->max_request_data_size;
/* check if request size is not specified */
if (!size) {
/*
- * The IPMB standard overall message length for ‘non -bridging’
+ * The IPMB standard overall message length for non-bridging
* messages is specified as 32 bytes, maximum, including slave
* address. This sets the upper limit for typical IPMI messages.
* With the exception of messages used for bridging messages to
@@ -501,14 +522,14 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
size = IPMI_DEFAULT_PAYLOAD_SIZE;
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/* add Send Message request size */
size += 8;
}
}
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/* subtract send message request size */
size -= 8;
@@ -521,7 +542,7 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
}
/* check for double bridging */
- if (intf->transit_addr && intf->transit_addr != intf->target_addr) {
+ if (bridging_level == 2) {
/* subtract inner send message request size */
size -= 8;
}
@@ -539,13 +560,14 @@ uint16_t
ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
{
int16_t size;
+ uint8_t bridging_level = ipmi_intf_get_bridging_level(intf);
size = intf->max_response_data_size;
/* check if response size is not specified */
if (!size) {
/*
- * The IPMB standard overall message length for ‘non -bridging’
+ * The IPMB standard overall message length for non-bridging
* messages is specified as 32 bytes, maximum, including slave
* address. This sets the upper limit for typical IPMI messages.
* With the exception of messages used for bridging messages to
@@ -558,14 +580,14 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
size = IPMI_DEFAULT_PAYLOAD_SIZE; /* response length with subtracted header and checksum byte */
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/* add Send Message header size */
size += 7;
}
}
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/*
* Some IPMI controllers like PICMG AMC Carriers embed responses
* to the forwarded messages into the Send Message response.
@@ -583,7 +605,7 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
}
/* check for double bridging */
- if (intf->transit_addr && intf->transit_addr != intf->target_addr) {
+ if (bridging_level == 2) {
/* subtract inner send message header size */
size -= 8;
}
@@ -597,6 +619,25 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
return size;
}
+uint8_t
+ipmi_intf_get_bridging_level(const struct ipmi_intf *intf)
+{
+ uint8_t bridging_level;
+
+ if (intf->target_addr && (intf->target_addr != intf->my_addr)) {
+ if (intf->transit_addr &&
+ (intf->transit_addr != intf->target_addr || intf->transit_channel != intf->target_channel)) {
+ bridging_level = 2;
+ } else {
+ bridging_level = 1;
+ }
+ } else {
+ bridging_level = 0;
+ }
+
+ return bridging_level;
+}
+
void
ipmi_intf_set_max_request_data_size(struct ipmi_intf * intf, uint16_t size)
{
diff --git a/src/plugins/lan/Makefile.in b/src/plugins/lan/Makefile.in
deleted file mode 100644
index 2abda0d..0000000
--- a/src/plugins/lan/Makefile.in
+++ /dev/null
@@ -1,639 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/lan
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_lan_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_lan_la_OBJECTS = lan.lo auth.lo md5.lo
-libintf_lan_la_OBJECTS = $(am_libintf_lan_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_lan_la_SOURCES)
-DIST_SOURCES = $(libintf_lan_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_lan.la
-noinst_LTLIBRARIES = @INTF_LAN_LIB@
-libintf_lan_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_lan_la_SOURCES = lan.c lan.h asf.h rmcp.h auth.c auth.h md5.c md5.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/lan/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/lan/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_lan.la: $(libintf_lan_la_OBJECTS) $(libintf_lan_la_DEPENDENCIES) $(EXTRA_libintf_lan_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_lan_la_OBJECTS) $(libintf_lan_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lan.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/lan/asf.h b/src/plugins/lan/asf.h
index ab36d6f..eb1004f 100644
--- a/src/plugins/lan/asf.h
+++ b/src/plugins/lan/asf.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_ASF_H
-#define IPMI_ASF_H
+#pragma once
#include <ipmitool/helper.h>
#include "lan.h"
@@ -41,20 +40,6 @@
#define ASF_TYPE_PING 0x80
#define ASF_TYPE_PONG 0x40
-static const struct valstr asf_type_vals[] __attribute__((unused)) = {
- { 0x10, "Reset" },
- { 0x11, "Power-up" },
- { 0x12, "Unconditional Power-down" },
- { 0x13, "Power Cycle" },
- { 0x40, "Presence Pong" },
- { 0x41, "Capabilities Response" },
- { 0x42, "System State Response" },
- { 0x80, "Presence Ping" },
- { 0x81, "Capabilities Request" },
- { 0x82, "System State Request" },
- { 0x00, NULL }
-};
-
/* ASF message header */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -71,5 +56,3 @@ struct asf_hdr {
#endif
int handle_asf(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_ASF_H */
diff --git a/src/plugins/lan/auth.c b/src/plugins/lan/auth.c
index 7410e3c..a5304d6 100644
--- a/src/plugins/lan/auth.c
+++ b/src/plugins/lan/auth.c
@@ -119,14 +119,23 @@ uint8_t * ipmi_auth_md5(struct ipmi_session * s, uint8_t * data, int data_len)
#endif /*HAVE_CRYPTO_MD5*/
}
-/*
+#ifdef HAVE_CRYPTO_MD2
+ #define __MD2_ONLY__(x) x
+#else
+ #define __MD2_ONLY__(x) __UNUSED__(x)
+#endif
+
+/*
* multi-session authcode generation for MD2
* H(password + session_id + msg + session_seq + password)
*
* Use OpenSSL implementation of MD2 algorithm if found.
* This function is analogous to ipmi_auth_md5
*/
-uint8_t * ipmi_auth_md2(struct ipmi_session * s, uint8_t * data, int data_len)
+uint8_t * ipmi_auth_md2(
+ struct ipmi_session *__MD2_ONLY__(s),
+ uint8_t *__MD2_ONLY__(data),
+ int __MD2_ONLY__(data_len))
{
#ifdef HAVE_CRYPTO_MD2
MD2_CTX ctx;
diff --git a/src/plugins/lan/auth.h b/src/plugins/lan/auth.h
index b9866ba..b7acbba 100644
--- a/src/plugins/lan/auth.h
+++ b/src/plugins/lan/auth.h
@@ -30,11 +30,8 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_AUTH_H
-#define IPMI_AUTH_H
+#pragma once
uint8_t * ipmi_auth_md2(struct ipmi_session * s, uint8_t * data, int data_len);
uint8_t * ipmi_auth_md5(struct ipmi_session * s, uint8_t * data, int data_len);
uint8_t * ipmi_auth_special(struct ipmi_session * s);
-
-#endif /*IPMI_AUTH_H*/
diff --git a/src/plugins/lan/lan.c b/src/plugins/lan/lan.c
index 40ba233..2e5f212 100644
--- a/src/plugins/lan/lan.c
+++ b/src/plugins/lan/lan.c
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
@@ -95,7 +94,6 @@ static struct ipmi_rs * ipmi_lan_recv_sol(struct ipmi_intf * intf);
static struct ipmi_rs * ipmi_lan_send_sol(struct ipmi_intf * intf,
struct ipmi_v2_payload * payload);
static struct ipmi_rs * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req);
-static int ipmi_lan_send_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp);
static int ipmi_lan_open(struct ipmi_intf * intf);
static void ipmi_lan_close(struct ipmi_intf * intf);
static int ipmi_lan_ping(struct ipmi_intf * intf);
@@ -109,7 +107,6 @@ struct ipmi_intf ipmi_lan_intf = {
.open = ipmi_lan_open,
.close = ipmi_lan_close,
.sendrecv = ipmi_lan_send_cmd,
- .sendrsp = ipmi_lan_send_rsp,
.recv_sol = ipmi_lan_recv_sol,
.send_sol = ipmi_lan_send_sol,
.keepalive = ipmi_lan_keepalive,
@@ -124,7 +121,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
struct ipmi_rq_entry * e;
e = malloc(sizeof(struct ipmi_rq_entry));
- if (e == NULL) {
+ if (!e) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -135,7 +132,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
e->intf = intf;
e->rq_seq = req_seq;
- if (ipmi_req_entries == NULL)
+ if (!ipmi_req_entries)
ipmi_req_entries = e;
else
ipmi_req_entries_tail->next = e;
@@ -151,7 +148,7 @@ ipmi_req_lookup_entry(uint8_t seq, uint8_t cmd)
{
struct ipmi_rq_entry * e = ipmi_req_entries;
while (e && (e->rq_seq != seq || e->req.msg.cmd != cmd)) {
- if (e->next == NULL || e == e->next)
+ if (!e->next || e == e->next)
return NULL;
e = e->next;
}
@@ -206,7 +203,7 @@ ipmi_req_clear_entries(void)
while (e) {
lprintf(LOG_DEBUG+3, "cleared list entry seq=0x%02x cmd=0x%02x",
e->rq_seq, e->req.msg.cmd);
- if (e->next != NULL) {
+ if (e->next) {
p = e->next;
free(e);
e = p;
@@ -341,11 +338,11 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
* asf.data[f:a]= 0x000000000000
*/
static int
-ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
+ipmi_handle_pong(struct ipmi_rs *rsp)
{
- struct rmcp_pong * pong;
+ struct rmcp_pong *pong;
- if (rsp == NULL)
+ if (!rsp)
return -1;
pong = (struct rmcp_pong *)rsp->data;
@@ -402,7 +399,7 @@ ipmi_lan_ping(struct ipmi_intf * intf)
int rv;
data = malloc(len);
- if (data == NULL) {
+ if (!data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -463,7 +460,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
rsp = ipmi_lan_recv_packet(intf);
- while (rsp != NULL) {
+ while (rsp) {
/* parse response headers */
memcpy(&rmcp_rsp, rsp->data, 4);
@@ -471,7 +468,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
switch (rmcp_rsp.class) {
case RMCP_CLASS_ASF:
/* ping response packet */
- rv = ipmi_handle_pong(intf, rsp);
+ rv = ipmi_handle_pong(rsp);
return (rv <= 0) ? NULL : rsp;
case RMCP_CLASS_IPMI:
/* handled by rest of function */
@@ -613,7 +610,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
rsp = !rsp->ccode ? ipmi_lan_recv_packet(intf) : NULL;
if (!entry->bridging_level)
entry->req.msg.cmd = entry->req.msg.target_cmd;
- if (rsp == NULL) {
+ if (!rsp) {
ipmi_req_remove_entry(entry->rq_seq, entry->req.msg.cmd);
}
continue;
@@ -736,10 +733,10 @@ ipmi_lan_build_cmd(struct ipmi_intf * intf, struct ipmi_rq * req, int isRetry)
}
else
{
- // We dont have this request in the list so we can add it
+ // We don't have this request in the list so we can add it
// to the list
entry = ipmi_req_add_entry(intf, req, curr_seq);
- if (entry == NULL)
+ if (!entry)
return NULL;
}
@@ -749,7 +746,7 @@ ipmi_lan_build_cmd(struct ipmi_intf * intf, struct ipmi_rq * req, int isRetry)
if (intf->transit_addr != intf->my_addr && intf->transit_addr != 0)
len += 8;
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -909,7 +906,7 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
lprintf(LOG_DEBUG, "ipmi_lan_send_cmd:opened=[%d], open=[%d]",
intf->opened, intf->open);
- if (intf->opened == 0 && intf->open != NULL) {
+ if (!intf->opened && intf->open) {
if (intf->open(intf) < 0) {
lprintf(LOG_DEBUG, "Failed to open LAN interface");
return NULL;
@@ -922,7 +919,7 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
isRetry = ( try > 0 ) ? 1 : 0;
entry = ipmi_lan_build_cmd(intf, req, isRetry);
- if (entry == NULL) {
+ if (!entry) {
lprintf(LOG_ERR, "Aborting send command, unable to build");
return NULL;
}
@@ -947,7 +944,7 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
/* Duplicate Request ccode most likely indicates a response to
a previous retry. Ignore and keep polling. */
- if((rsp != NULL) && (rsp->ccode == 0xcf)) {
+ if(rsp && rsp->ccode == 0xcf) {
rsp = NULL;
rsp = ipmi_lan_poll_recv(intf);
}
@@ -968,14 +965,14 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
// This is the corner case where the remote controller responds very slowly.
//
// Example: We have to send command 23 and 2d.
- // If we send command,seq as 23,10 and if we dont get any response it will
+ // If we send command,seq as 23,10 and if we don't get any response it will
// retry 4 times with 23,10 and then come out here and indicate that there is no
// response from the remote controller and will send the next command for
// ie 2d,11. And if the BMC is slow to respond and returns 23,10 then it
// will match it in the list and will take response of command 23 as response
// for command 2d and return success. So ideally when retries are done and
// are out of this function we should be clearing the list to be safe so that
- // we dont match the old response with new request.
+ // we don't match the old response with new request.
// [23, 10] --> BMC
// [23, 10] --> BMC
// [23, 10] --> BMC
@@ -989,135 +986,6 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
return rsp;
}
-static uint8_t *
-ipmi_lan_build_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp, int * llen)
-{
- struct rmcp_hdr rmcp = {
- .ver = RMCP_VERSION_1,
- .class = RMCP_CLASS_IPMI,
- .seq = 0xff,
- };
- struct ipmi_session * s = intf->session;
- int cs, mp, ap = 0, tmp;
- int len;
- uint8_t * msg;
-
- len = rsp->data_len + 22;
- if (s->active)
- len += 16;
-
- msg = malloc(len);
- if (msg == NULL) {
- lprintf(LOG_ERR, "ipmitool: malloc failure");
- return NULL;
- }
- memset(msg, 0, len);
-
- /* rmcp header */
- memcpy(msg, &rmcp, 4);
- len = sizeof(rmcp);
-
- /* ipmi session header */
- msg[len++] = s->active ? s->authtype : 0;
-
- if (s->in_seq) {
- s->in_seq++;
- if (s->in_seq == 0)
- s->in_seq++;
- }
- memcpy(msg+len, &s->in_seq, 4);
- len += 4;
- memcpy(msg+len, &s->session_id, 4);
- len += 4;
-
- /* session authcode, if session active and authtype is not none */
- if (s->active && s->authtype) {
- ap = len;
- memcpy(msg+len, s->authcode, 16);
- len += 16;
- }
-
- /* message length */
- msg[len++] = rsp->data_len + 8;
-
- /* message header */
- cs = mp = len;
- msg[len++] = IPMI_REMOTE_SWID;
- msg[len++] = rsp->msg.netfn << 2;
- tmp = len - cs;
- msg[len++] = ipmi_csum(msg+cs, tmp);
- cs = len;
- msg[len++] = IPMI_BMC_SLAVE_ADDR;
- msg[len++] = (rsp->msg.seq << 2) | (rsp->msg.lun & 3);
- msg[len++] = rsp->msg.cmd;
-
- /* completion code */
- msg[len++] = rsp->ccode;
-
- /* message data */
- if (rsp->data_len) {
- memcpy(msg+len, rsp->data, rsp->data_len);
- len += rsp->data_len;
- }
-
- /* second checksum */
- tmp = len - cs;
- msg[len++] = ipmi_csum(msg+cs, tmp);
-
- if (s->active) {
- uint8_t * d;
- switch (s->authtype) {
- case IPMI_SESSION_AUTHTYPE_MD5:
- d = ipmi_auth_md5(s, msg+mp, msg[mp-1]);
- memcpy(msg+ap, d, 16);
- break;
- case IPMI_SESSION_AUTHTYPE_MD2:
- d = ipmi_auth_md2(s, msg+mp, msg[mp-1]);
- memcpy(msg+ap, d, 16);
- break;
- }
- }
-
- *llen = len;
- return msg;
-}
-
-static int
-ipmi_lan_send_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp)
-{
- uint8_t * msg;
- int len = 0;
- int rv;
-
- msg = ipmi_lan_build_rsp(intf, rsp, &len);
- if (len <= 0 || msg == NULL) {
- lprintf(LOG_ERR, "Invalid response packet");
- if (msg != NULL) {
- free(msg);
- msg = NULL;
- }
- return -1;
- }
-
- rv = sendto(intf->fd, msg, len, 0,
- (struct sockaddr *)&intf->session->addr,
- intf->session->addrlen);
- if (rv < 0) {
- lprintf(LOG_ERR, "Packet send failed");
- if (msg != NULL) {
- free(msg);
- msg = NULL;
- }
- return -1;
- }
-
- if (msg != NULL) {
- free(msg);
- msg = NULL;
- }
- return 0;
-}
-
/*
* IPMI SOL Payload Format
* +--------------------+
@@ -1163,7 +1031,7 @@ uint8_t * ipmi_lan_build_sol_msg(struct ipmi_intf * intf,
payload->payload.sol_packet.character_count; // The actual payload
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -1256,15 +1124,15 @@ ipmi_lan_send_sol_payload(struct ipmi_intf * intf,
int len;
int try = 0;
- if (intf->opened == 0 && intf->open != NULL) {
+ if (!intf->opened && intf->open) {
if (intf->open(intf) < 0)
return NULL;
}
msg = ipmi_lan_build_sol_msg(intf, payload, &len);
- if (len <= 0 || msg == NULL) {
+ if (len <= 0 || !msg) {
lprintf(LOG_ERR, "Invalid SOL payload packet");
- if (msg != NULL) {
+ if (msg) {
free(msg);
msg = NULL;
}
@@ -1312,7 +1180,7 @@ ipmi_lan_send_sol_payload(struct ipmi_intf * intf,
}
}
- if (msg != NULL) {
+ if (msg) {
free(msg);
msg = NULL;
}
@@ -1442,8 +1310,7 @@ ipmi_lan_send_sol(struct ipmi_intf * intf,
*
*/
static int
-check_sol_packet_for_new_data(struct ipmi_intf * intf,
- struct ipmi_rs *rsp)
+check_sol_packet_for_new_data(struct ipmi_rs *rsp)
{
static uint8_t last_received_sequence_number = 0;
static uint8_t last_received_byte_count = 0;
@@ -1476,7 +1343,7 @@ check_sol_packet_for_new_data(struct ipmi_intf * intf,
}
/*
- *Rember the data for next round
+ * Remember the data for next round
*/
if (rsp && rsp->payload.sol_packet.packet_sequence_number)
{
@@ -1543,7 +1410,7 @@ ipmi_lan_recv_sol(struct ipmi_intf * intf)
* Remembers the data sent, and alters the data to just
* include the new stuff.
*/
- check_sol_packet_for_new_data(intf, rsp);
+ check_sol_packet_for_new_data(rsp);
return rsp;
}
@@ -1564,9 +1431,7 @@ ipmi_lan_keepalive(struct ipmi_intf * intf)
return 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL)
- return -1;
- if (rsp->ccode > 0)
+ if (!rsp || rsp->ccode)
return -1;
return 0;
@@ -1594,14 +1459,14 @@ ipmi_get_auth_capabilities_cmd(struct ipmi_intf * intf)
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_INFO, "Get Auth Capabilities command failed");
return -1;
}
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "get_auth_capabilities");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_INFO, "Get Auth Capabilities command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1709,14 +1574,14 @@ ipmi_get_session_challenge_cmd(struct ipmi_intf * intf)
req.msg.data_len = 17; /* 1 byte for authtype, 16 for user */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Session Challenge command failed");
return -1;
}
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "get_session_challenge");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
switch (rsp->ccode) {
case 0x81:
lprintf(LOG_ERR, "Invalid user name");
@@ -1784,7 +1649,7 @@ ipmi_activate_session_cmd(struct ipmi_intf * intf)
val2str(s->authtype, ipmi_authtype_session_vals));
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Activate Session command failed");
s->active = 0;
return -1;
@@ -1875,7 +1740,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
rsp = intf->sendrecv(intf, &req);
bridge_possible = backup_bridge_possible;
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed",
val2str(privlvl, ipmi_privlvl_vals));
return -1;
@@ -1883,7 +1748,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "set_session_privlvl");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed: %s",
val2str(privlvl, ipmi_privlvl_vals),
val2str(rsp->ccode, completion_code_vals));
@@ -1919,7 +1784,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Close Session command failed");
return -1;
}
@@ -1931,7 +1796,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
"session ID %08lx", (long)session_id);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Close Session command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2028,7 +1893,7 @@ ipmi_lan_open(struct ipmi_intf * intf)
struct ipmi_session *s;
struct ipmi_session_params *p;
- if (intf == NULL || intf->opened)
+ if (!intf || intf->opened)
return -1;
s = intf->session;
@@ -2043,7 +1908,7 @@ ipmi_lan_open(struct ipmi_intf * intf)
if (p->retry == 0)
p->retry = IPMI_LAN_RETRY;
- if (p->hostname == NULL || strlen((const char *)p->hostname) == 0) {
+ if (!p->hostname || strlen((const char *)p->hostname) == 0) {
lprintf(LOG_ERR, "No hostname specified!");
return -1;
}
diff --git a/src/plugins/lan/lan.h b/src/plugins/lan/lan.h
index 3ba3055..4b26922 100644
--- a/src/plugins/lan/lan.h
+++ b/src/plugins/lan/lan.h
@@ -30,12 +30,9 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LAN_H
-#define IPMI_LAN_H
+#pragma once
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
extern struct ipmi_intf ipmi_lan_intf;
-
-#endif /*IPMI_LAN_H*/
diff --git a/src/plugins/lan/rmcp.h b/src/plugins/lan/rmcp.h
index b979d92..f283bf3 100644
--- a/src/plugins/lan/rmcp.h
+++ b/src/plugins/lan/rmcp.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_RMCP_H
-#define IPMI_RMCP_H
+#pragma once
#include <ipmitool/helper.h>
#include "lan.h"
@@ -46,24 +45,11 @@
#define RMCP_TYPE_NORM 0x00
#define RMCP_TYPE_ACK 0x01
-static const struct valstr rmcp_type_vals[] __attribute__((unused)) = {
- { RMCP_TYPE_NORM, "Normal RMCP" },
- { RMCP_TYPE_ACK, "RMCP ACK" },
- { 0, NULL }
-};
-
#define RMCP_CLASS_MASK 0x1f
#define RMCP_CLASS_ASF 0x06
#define RMCP_CLASS_IPMI 0x07
#define RMCP_CLASS_OEM 0x08
-static const struct valstr rmcp_class_vals[] __attribute__((unused)) = {
- { RMCP_CLASS_ASF, "ASF" },
- { RMCP_CLASS_IPMI, "IPMI" },
- { RMCP_CLASS_OEM, "OEM" },
- { 0, NULL }
-};
-
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
@@ -95,5 +81,3 @@ struct rmcp_pong {
#endif
int handle_rmcp(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_RMCP_H */
diff --git a/src/plugins/lanplus/Makefile.in b/src/plugins/lanplus/Makefile.in
deleted file mode 100644
index d24775b..0000000
--- a/src/plugins/lanplus/Makefile.in
+++ /dev/null
@@ -1,649 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/lanplus
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_lanplus_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_lanplus_la_OBJECTS = lanplus.lo lanplus_strings.lo \
- lanplus_crypt.lo lanplus_dump.lo lanplus_crypt_impl.lo
-libintf_lanplus_la_OBJECTS = $(am_libintf_lanplus_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_lanplus_la_SOURCES)
-DIST_SOURCES = $(libintf_lanplus_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_lanplus.la
-noinst_LTLIBRARIES = @INTF_LANPLUS_LIB@
-libintf_lanplus_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_lanplus_la_SOURCES = \
- rmcp.h asf.h \
- lanplus.c lanplus.h \
- lanplus_strings.c \
- lanplus_crypt.c lanplus_crypt.h \
- lanplus_dump.h lanplus_dump.c \
- lanplus_crypt_impl.h lanplus_crypt_impl.c
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/lanplus/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/lanplus/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_lanplus.la: $(libintf_lanplus_la_OBJECTS) $(libintf_lanplus_la_DEPENDENCIES) $(EXTRA_libintf_lanplus_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_lanplus_la_OBJECTS) $(libintf_lanplus_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_crypt.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_crypt_impl.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_dump.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_strings.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/lanplus/README.lanplus b/src/plugins/lanplus/README.lanplus
new file mode 100644
index 0000000..4406d5b
--- /dev/null
+++ b/src/plugins/lanplus/README.lanplus
@@ -0,0 +1,74 @@
+This interface exists to provide a means of connecting to an IPMIv2 enabled
+BMC. In some places, the IPMIv2 specification is either unclear or
+inconsistent, and interpretations of the intent of the specification had to
+be made at the discretion of the implementor. The purpose of this
+document is to make those decisions clear so that 1) they can be reviewed
+by others and 2) so that the rationale for those decisions can be made
+clear.
+
+* Though it's not stated explicitly with which algorithm the K1 and K2 keys
+should be generated, we chose to use the authentication algorithm. The
+specification states that K1 and K2 are generated with an HMAC algorithm,
+and all of the authentication algorithms (except for "none") are HMAC
+algorithms, whereas the integrity algorithms are not all HMAC. See section
+13.32 for details about K1 and K2, and section
+
+
+* The IPMIv2 specification describes a key, Kg, that is the "BMC key".
+This key functions as a global key that is required to be known in addition
+to the user's key, by authenticating users. If the BMC has a null Kg, the
+users key, Kuid, is used in its place in algorithms where Kg is required,
+per the specification section 13.33. A user can obtain the status of Kg by
+querying the BMC with the Get Channel Authentication Capabilities command.
+Currently, this implementation does not provide a way for a user to specify
+Kg for BMCs that require it.
+
+
+* The specification is unclear as to which key is used for HMAC based
+integrity checking. One the one hand, section 13.28.4 states explicitly
+that HMAC integrity algorithms use the session integrity key as the HMAC
+key. Confusing that matter is a statement in section 13.32 regarding the
+creation of additional keying material. In this section it is stated that
+"all keying material for the RSP integrity and confidentiality algorithms
+will be generated by processing a pre-defined set of constants using HMAC
+per [RFC2104], keyed by sik". And "For the mandatory-to-implement
+integrity and confidentiality algorithms defined in this specification,
+processing the first two (2) constants will generate the require amount of
+keying material." We decided to use K1 as our HMAC key for the generation
+of authentication codes (integrity checking). Furthermore, we are using
+all 20 bytes of K1.
+
+
+* IPMIv2 compliant BMCs are supposed to support 20 byte passwords, as well
+store metadata describing whether the password was stored as a 16 byte or
+20 byte class password. We do not currently support 20 byte passwords. It
+should be noted that there are obvious mistakes in the SET USER PASSWORD
+command specification, as it mentions the ability to query for 16/20 byte
+password status, but the packet format does not support this.
+
+
+* The IPMIv2 specification describes a type of login called a "role only
+login." This feature allows a user to login providing only a requested
+privilege level and a password. We do not currently support this feature.
+Supporting this feature would only require the ability to specify
+username/privilege lookups in the RAKP 1 message sent from ipmitool. We
+currently specify the use of username only lookups for authentication.
+
+
+* In the IPMIv2 packet description in table 13-8 of the IPMv2
+specification, there are two fields that are rather ambiguous in meaning.
+The fields are "Pad Length" and "Next Header". Although neither field is
+listed as belonging to the IPMIv2 packet format, we include/expect them
+both in our IPMIv2 packets. Are rationale is 1) the Next Headers field's
+comment states what the value of that field should be for IPMIv2, and 2)
+for the most part the ASF and IPMIv2 fields seem to parallel each other,
+and we feel that the Pad Length and Next Header fields were left out of the
+IPMIv2 column by mistake.
+
+
+* The GET CHANNEL CIPHER SUITES command documentation seems to have
+mistakes. The "start of record" byte is stated to be either 0x30 or 0x31,
+whereas the detailed description in table 22-18 leads us to believe that
+this byte should really be 0xC0 or 0xC1. Also the description of bits 5:0
+in the start of record byte should probably be 00_0000 rather than 00_000.
+
diff --git a/src/plugins/lanplus/README.sol b/src/plugins/lanplus/README.sol
new file mode 100644
index 0000000..4c64e2a
--- /dev/null
+++ b/src/plugins/lanplus/README.sol
@@ -0,0 +1,76 @@
+This document was last updated for release 1.8.8.
+
+This document explains how Serial Over Lan is implemented on in the
+ipmitool IPMI client. Obviously, the code itself is authoritative, but
+this document should serve as a good starting point.
+
+Serial Over Lan (SOL) is defined in the IPMI v2 specification published by
+Intel and available at http://www.intel.com/design/servers/ipmi/. SOL
+functionality is built on top of the RMCP+ protocol as an additional
+payload type (type 1).
+
+The high end SOL logic is implemented in src/ipmitool/lib/ipmi_sol.c. SOL
+sessions are begun in ipmitool using the "sol activate" command. This
+command maps directly to the IPMI Activate Payload command. It first
+verifies that an RMCP+ session (lanplus interface) is being used to
+establish the session. Although the spec allows for a SOL connection to be
+established on a port different than the RMCP+ port that the "activate
+payload" command issued, ipmitool does not support this.
+
+Once a session has been established (the activate payload command
+succeeds), ipmitool simply loops over a select() on user input and data
+returned from the BMC. All user input is first filtered so that special
+escape sequences can suspend or deactivate the SOL session and so that data
+can be broken into chunks no greater than N bytes. This maximum is
+specified by the BMC in the response to the Activate Payload command.
+
+User input to the BMC is handled in ipmitool/src/plugins/lanplus/lanplus.c.
+Every SOL packet (with one exception) traveling in either direction causes
+the recipient to return an acknowledgement packet, though acks themself are
+not acknowledged. The transport layer in lanplus.c handles the logic
+regarding acks, partial acks, sequence numbers. SOL acknowledgements
+packets be acks, partial acks (the remote destination processed only some
+of the data), and nacks (requests to stop sending packets). Nacks are not
+honored by ipmitool.
+
+Note that one way that SOL communication differs from standard IPMI
+commands, is that it is not simply a request response protocol. Packets
+may be returned asynchronously from the BMC. When establishing a SOL
+session, ipmitool registers a callback for asynchronously received data.
+This call back simply prints text returned from the BMC.
+
+Once a user has chosen to exit the SOL session (with ~.) ipmitool sends the
+IPMI SOL Deactivate command to the BMC.
+
+The standard code path for SOL logic follows:
+ ipmi_sol_main (ipmi_sol.c):
+
+ ipmi_sol_activate (ipmi_sol.c):
+ Argument validation
+ Creation and dispatch of IPMI Activate Payload command
+
+ ipmi_sol_red_pill (ipmi_sol.c):
+ Loop on select() for user input and data returned from the BMC
+ Periodic dispatch of "keep alive" packet to the BMC.
+ Send user input to the BMC and BMC data to the console.
+
+ processSolUserInput (ipmi_sol.c):
+ Process possible escape sequences (~., ~B, etc.)
+ Send (with retries) user data to the BMC
+ Partial creation of packet payload
+
+ ipmi_lanplus_send_sol (lanplus.c):
+ Completion of packet payload
+ Send (with retries) of SOL packet
+
+ ipmi_lanplus_send_payload (lanplus.c):
+ Creation of RMCP+ packet
+ Details general to all V2 packet processing, as
+ well as a some logic to handle ack reception.
+
+ is_sol_partial_ack (lanplus.c):
+ Determine whether a data needs to be resent
+
+ ipmi_lanplus_recv_sol (lanplus.c):
+ Handle data received by the BMC. Ack as appropriate.
+
diff --git a/src/plugins/lanplus/asf.h b/src/plugins/lanplus/asf.h
index 7a30418..6453363 100644
--- a/src/plugins/lanplus/asf.h
+++ b/src/plugins/lanplus/asf.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_ASF_H
-#define IPMI_ASF_H
+#pragma once
#include <ipmitool/helper.h>
#include "lanplus.h"
@@ -41,20 +40,6 @@
#define ASF_TYPE_PING 0x80
#define ASF_TYPE_PONG 0x40
-static const struct valstr asf_type_vals[] __attribute__((unused)) = {
- { 0x10, "Reset" },
- { 0x11, "Power-up" },
- { 0x12, "Unconditional Power-down" },
- { 0x13, "Power Cycle" },
- { 0x40, "Presence Pong" },
- { 0x41, "Capabilities Response" },
- { 0x42, "System State Response" },
- { 0x80, "Presence Ping" },
- { 0x81, "Capabilities Request" },
- { 0x82, "System State Request" },
- { 0x00, NULL }
-};
-
/* ASF message header */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -71,5 +56,3 @@ struct asf_hdr {
#endif
int handle_asf(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_ASF_H */
diff --git a/src/plugins/lanplus/lanplus.c b/src/plugins/lanplus/lanplus.c
index 2a89a14..ed41380 100644
--- a/src/plugins/lanplus/lanplus.c
+++ b/src/plugins/lanplus/lanplus.c
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
@@ -103,15 +102,14 @@ static void getIpmiPayloadWireRep(
uint8_t rq_seq,
uint8_t curr_seq);
static void getSolPayloadWireRep(
- struct ipmi_intf * intf,
uint8_t * msg,
struct ipmi_v2_payload * payload);
static void read_open_session_response(struct ipmi_rs * rsp, int offset);
static void read_rakp2_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
static void read_rakp4_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
-static void read_session_data(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
-static void read_session_data_v15(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
-static void read_session_data_v2x(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
+static void read_session_data(struct ipmi_rs * rsp, int * offset);
+static void read_session_data_v15(struct ipmi_rs * rsp, int * offset);
+static void read_session_data_v2x(struct ipmi_rs * rsp, int * offset);
static void read_ipmi_response(struct ipmi_rs * rsp, int * offset);
static void read_sol_packet(struct ipmi_rs * rsp, int * offset);
static struct ipmi_rs * ipmi_lanplus_recv_sol(struct ipmi_intf * intf);
@@ -119,7 +117,6 @@ static struct ipmi_rs * ipmi_lanplus_send_sol(
struct ipmi_intf * intf,
struct ipmi_v2_payload * payload);
static int check_sol_packet_for_new_data(
- struct ipmi_intf * intf,
struct ipmi_rs *rsp);
static void ack_sol_packet(
struct ipmi_intf * intf,
@@ -164,119 +161,115 @@ extern int verbose;
* returns 0 on success
* 1 on failure
*/
-int lanplus_get_requested_ciphers(int cipher_suite_id,
- uint8_t * auth_alg,
- uint8_t * integrity_alg,
- uint8_t * crypt_alg)
+int
+lanplus_get_requested_ciphers(enum cipher_suite_ids cipher_suite_id,
+ uint8_t *auth_alg,
+ uint8_t *integrity_alg,
+ uint8_t *crypt_alg)
{
- if ((cipher_suite_id < 0) || (cipher_suite_id > 14))
- return 1;
-
/* See table 22-19 for the source of the statement */
switch (cipher_suite_id)
{
- case 0:
+ case IPMI_LANPLUS_CIPHER_SUITE_0:
*auth_alg = IPMI_AUTH_RAKP_NONE;
*integrity_alg = IPMI_INTEGRITY_NONE;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 1:
+ case IPMI_LANPLUS_CIPHER_SUITE_1:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_NONE;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 2:
+ case IPMI_LANPLUS_CIPHER_SUITE_2:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 3:
+ case IPMI_LANPLUS_CIPHER_SUITE_3:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_AES_CBC_128;
break;
- case 4:
+ case IPMI_LANPLUS_CIPHER_SUITE_4:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_XRC4_128;
break;
- case 5:
+ case IPMI_LANPLUS_CIPHER_SUITE_5:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_XRC4_40;
break;
- case 6:
+ case IPMI_LANPLUS_CIPHER_SUITE_6:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_NONE;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 7:
+ case IPMI_LANPLUS_CIPHER_SUITE_7:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 8:
+ case IPMI_LANPLUS_CIPHER_SUITE_8:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_AES_CBC_128;
break;
- case 9:
+ case IPMI_LANPLUS_CIPHER_SUITE_9:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_128;
break;
- case 10:
+ case IPMI_LANPLUS_CIPHER_SUITE_10:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_40;
break;
- case 11:
+ case IPMI_LANPLUS_CIPHER_SUITE_11:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 12:
+ case IPMI_LANPLUS_CIPHER_SUITE_12:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_AES_CBC_128;
break;
- case 13:
+ case IPMI_LANPLUS_CIPHER_SUITE_13:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_128;
break;
- case 14:
+ case IPMI_LANPLUS_CIPHER_SUITE_14:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_40;
break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_LANPLUS_CIPHER_SUITE_15:
+ *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256;
+ *integrity_alg = IPMI_INTEGRITY_NONE;
+ *crypt_alg = IPMI_CRYPT_NONE;
+ break;
+ case IPMI_LANPLUS_CIPHER_SUITE_16:
+ *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256;
+ *integrity_alg = IPMI_INTEGRITY_HMAC_SHA256_128;
+ *crypt_alg = IPMI_CRYPT_NONE;
+ break;
+ case IPMI_LANPLUS_CIPHER_SUITE_17:
+ *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256;
+ *integrity_alg = IPMI_INTEGRITY_HMAC_SHA256_128;
+ *crypt_alg = IPMI_CRYPT_AES_CBC_128;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ case IPMI_LANPLUS_CIPHER_SUITE_RESERVED:
+ default:
+ return 1;
}
return 0;
}
-
-
-/*
- * Reverse the order of arbitrarily long strings of bytes
- */
-void lanplus_swap(
- uint8_t * buffer,
- int length)
-{
- int i;
- uint8_t temp;
-
- for (i =0; i < length/2; ++i)
- {
- temp = buffer[i];
- buffer[i] = buffer[length - 1 - i];
- buffer[length - 1 - i] = temp;
- }
-}
-
-
-
static const struct valstr plus_payload_types_vals[] = {
{ IPMI_PAYLOAD_TYPE_IPMI, "IPMI (0)" }, // IPMI Message
{ IPMI_PAYLOAD_TYPE_SOL, "SOL (1)" }, // SOL (Serial over LAN)
@@ -298,7 +291,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
struct ipmi_rq_entry * e;
e = malloc(sizeof(struct ipmi_rq_entry));
- if (e == NULL) {
+ if (!e) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -309,7 +302,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
e->intf = intf;
e->rq_seq = req_seq;
- if (ipmi_req_entries == NULL)
+ if (!ipmi_req_entries)
ipmi_req_entries = e;
else
ipmi_req_entries_tail->next = e;
@@ -501,7 +494,7 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
* asf.data[f:a]= 0x000000000000
*/
static int
-ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
+ipmi_handle_pong(struct ipmi_rs *rsp)
{
struct rmcp_pong {
struct rmcp_hdr rmcp;
@@ -511,7 +504,7 @@ ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
uint8_t sup_entities;
uint8_t sup_interact;
uint8_t reserved[6];
- } * pong;
+ } *pong;
if (!rsp)
return -1;
@@ -573,7 +566,7 @@ ipmiv2_lan_ping(struct ipmi_intf * intf)
int rv;
data = malloc(len);
- if (data == NULL) {
+ if (!data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -622,7 +615,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
rsp = ipmi_lan_recv_packet(intf);
/* check if no packet has come */
- if (rsp == NULL) {
+ if (!rsp) {
return NULL;
}
@@ -631,7 +624,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
if (rmcp_rsp->class == RMCP_CLASS_ASF) {
/* might be ping response packet */
- rv = ipmi_handle_pong(intf, rsp);
+ rv = ipmi_handle_pong(rsp);
return (rv <= 0) ? NULL : rsp;
}
@@ -661,7 +654,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
* -------------------------------------------------------------------
*/
- read_session_data(rsp, &offset, intf->session);
+ read_session_data(rsp, &offset);
/*
* Skip packets that are not intended for this session
@@ -742,14 +735,12 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
entry = ipmi_req_lookup_entry(rsp->payload.ipmi_response.rq_seq,
rsp->payload.ipmi_response.cmd);
- if (entry == NULL) {
+ if (!entry) {
lprintf(LOG_INFO, "IPMI Request Match NOT FOUND");
/* read one more packet */
return (struct ipmi_rs *)1;
};
- uint8_t target_cmd = entry->req.msg.target_cmd;
-
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
if (entry->bridging_level) {
@@ -769,12 +760,6 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
printbuf(&rsp->data[offset], (rsp->data_len-offset-1),
"bridge command response");
/*
- * decrement payload size
- * (cks2 for outer Send Message)
- */
- payload_size--;
-
- /*
* need to make a loop for embedded bridged response
*/
loop++;
@@ -797,9 +782,12 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
* rsp->data_len becomes the length of that data
*/
extra_data_length = payload_size - (offset - payload_start) - 1;
- if (extra_data_length) {
+ if (extra_data_length > 0) {
rsp->data_len = extra_data_length;
memmove(rsp->data, rsp->data + offset, extra_data_length);
+ offset = 0;
+ payload_start = 0;
+ payload_size = extra_data_length;
} else {
rsp->data_len = 0;
}
@@ -851,7 +839,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
}
read_sol_packet(rsp, &offset);
extra_data_length = payload_size - (offset - payload_start);
- if (rsp && extra_data_length) {
+ if (extra_data_length > 0) {
rsp->data_len = extra_data_length;
memmove(rsp->data, rsp->data + offset, extra_data_length);
} else {
@@ -968,7 +956,7 @@ read_open_session_response(struct ipmi_rs * rsp, int offset)
*
* param rsp [in/out] reading from the data variable and writing to the rakp 2
* section
- * param offset [in] tells us where hte rakp2 payload starts
+ * param offset [in] tells us where the rakp2 payload starts
* param auth_alg [in] describes the authentication algorithm was agreed upon in
* the open session request/response phase. We need to know that here so
* that we know how many bytes (if any) to read fromt the packet.
@@ -989,31 +977,19 @@ read_rakp2_message(
/* RAKP response code */
rsp->payload.rakp2_message.rakp_return_code = rsp->data[offset + 1];
- /* Console session ID */
- memcpy(&(rsp->payload.rakp2_message.console_id),
- rsp->data + offset + 4,
- 4);
- #if WORDS_BIGENDIAN
- rsp->payload.rakp2_message.console_id =
- BSWAP_32(rsp->payload.rakp2_message.console_id);
- #endif
+ /* Console session ID */
+ rsp->payload.rakp2_message.console_id = ipmi32toh(&rsp->data[offset + 4]);
- /* BMC random number */
- memcpy(&(rsp->payload.rakp2_message.bmc_rand),
- rsp->data + offset + 8,
- 16);
- #if WORDS_BIGENDIAN
- lanplus_swap(rsp->payload.rakp2_message.bmc_rand, 16);
- #endif
+ /* BMC random number */
+ memcpy(&(rsp->payload.rakp2_message.bmc_rand),
+ array_letoh(&rsp->data[offset + 8], 16),
+ 16);
+
+ /* BMC GUID */
+ memcpy(&(rsp->payload.rakp2_message.bmc_guid),
+ array_letoh(&rsp->data[offset + 24], 16),
+ 16);
- /* BMC GUID */
- memcpy(&(rsp->payload.rakp2_message.bmc_guid),
- rsp->data + offset + 24,
- 16);
- #if WORDS_BIGENDIAN
- lanplus_swap(rsp->payload.rakp2_message.bmc_guid, 16);
- #endif
-
/* Key exchange authentication code */
switch (auth_alg)
{
@@ -1022,15 +998,34 @@ read_rakp2_message(
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
- /* We need to copy 20 bytes */
- for (i = 0; i < 20; ++i)
- rsp->payload.rakp2_message.key_exchange_auth_code[i] =
- rsp->data[offset + 40 + i];
- break;
+ /* We need to copy 20 bytes */
+ for (i = 0; i < IPMI_SHA_DIGEST_LENGTH; ++i) {
+ rsp->payload.rakp2_message.key_exchange_auth_code[i] =
+ rsp->data[offset + 40 + i];
+ }
+ break;
case IPMI_AUTH_RAKP_HMAC_MD5:
- lprintf(LOG_ERR, "read_rakp2_message: no support for "
- "IPMI_AUTH_RAKP_HMAC_MD5");
+ /* We need to copy 16 bytes */
+ for (i = 0; i < IPMI_MD5_DIGEST_LENGTH; ++i) {
+ rsp->payload.rakp2_message.key_exchange_auth_code[i] =
+ rsp->data[offset + 40 + i];
+ }
+ break;
+
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ /* We need to copy 32 bytes */
+ for (i = 0; i < IPMI_SHA256_DIGEST_LENGTH; ++i) {
+ rsp->payload.rakp2_message.key_exchange_auth_code[i] =
+ rsp->data[offset + 40 + i];
+ }
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+
+ default:
+ lprintf(LOG_ERR, "read_rakp2_message: no support "
+ "for authentication algorithm 0x%x", auth_alg);
assert(0);
break;
}
@@ -1048,7 +1043,7 @@ read_rakp2_message(
*
* param rsp [in/out] reading from the data variable and writing to the rakp
* 4 section
- * param offset [in] tells us where hte rakp4 payload starts
+ * param offset [in] tells us where the rakp4 payload starts
* param integrity_alg [in] describes the authentication algorithm was
* agreed upon in the open session request/response phase. We need
* to know that here so that we know how many bytes (if any) to read
@@ -1070,16 +1065,9 @@ read_rakp4_message(
/* RAKP response code */
rsp->payload.rakp4_message.rakp_return_code = rsp->data[offset + 1];
- /* Console session ID */
- memcpy(&(rsp->payload.rakp4_message.console_id),
- rsp->data + offset + 4,
- 4);
- #if WORDS_BIGENDIAN
- rsp->payload.rakp4_message.console_id =
- BSWAP_32(rsp->payload.rakp4_message.console_id);
- #endif
+ /* Console session ID */
+ rsp->payload.rakp4_message.console_id = ipmi32toh(&rsp->data[offset + 4]);
-
/* Integrity check value */
switch (auth_alg)
{
@@ -1088,13 +1076,32 @@ read_rakp4_message(
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
- /* We need to copy 12 bytes */
- for (i = 0; i < 12; ++i)
- rsp->payload.rakp4_message.integrity_check_value[i] =
- rsp->data[offset + 8 + i];
- break;
+ /* We need to copy 12 bytes */
+ for (i = 0; i < IPMI_SHA1_AUTHCODE_SIZE; ++i) {
+ rsp->payload.rakp4_message.integrity_check_value[i] =
+ rsp->data[offset + 8 + i];
+ }
+ break;
case IPMI_AUTH_RAKP_HMAC_MD5:
+ /* We need to copy 16 bytes */
+ for (i = 0; i < IPMI_HMAC_MD5_AUTHCODE_SIZE; ++i) {
+ rsp->payload.rakp4_message.integrity_check_value[i] =
+ rsp->data[offset + 8 + i];
+ }
+ break;
+
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ /* We need to copy 16 bytes */
+ for (i = 0; i < IPMI_HMAC_SHA256_AUTHCODE_SIZE; ++i) {
+ rsp->payload.rakp4_message.integrity_check_value[i] =
+ rsp->data[offset + 8 + i];
+ }
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+
+ default:
lprintf(LOG_ERR, "read_rakp4_message: no support "
"for authentication algorithm 0x%x", auth_alg);
assert(0);
@@ -1118,21 +1125,19 @@ read_rakp4_message(
* param offset [in/out] should point to the beginning of the session when
* this function is called. The offset will be adjusted to
* point to the end of the session when this function exits.
- * param session holds our session state
*/
void
read_session_data(
struct ipmi_rs * rsp,
- int * offset,
- struct ipmi_session * s)
+ int * offset)
{
/* We expect to read different stuff depending on the authtype */
rsp->session.authtype = rsp->data[*offset];
if (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS)
- read_session_data_v2x(rsp, offset, s);
+ read_session_data_v2x(rsp, offset);
else
- read_session_data_v15(rsp, offset, s);
+ read_session_data_v15(rsp, offset);
}
@@ -1158,8 +1163,7 @@ read_session_data(
void
read_session_data_v2x(
struct ipmi_rs * rsp,
- int * offset,
- struct ipmi_session * s)
+ int * offset)
{
rsp->session.authtype = rsp->data[(*offset)++];
@@ -1171,25 +1175,15 @@ read_session_data_v2x(
rsp->session.payloadtype = rsp->data[(*offset)++] & 0x3F;
/* Session ID */
- memcpy(&rsp->session.id, rsp->data + *offset, 4);
+ rsp->session.id = ipmi32toh(&rsp->data[*offset]);
*offset += 4;
- #if WORDS_BIGENDIAN
- rsp->session.id = BSWAP_32(rsp->session.id);
- #endif
-
/* Ignored, so far */
- memcpy(&rsp->session.seq, rsp->data + *offset, 4);
+ rsp->session.seq = ipmi32toh(&rsp->data[*offset]);
*offset += 4;
- #if WORDS_BIGENDIAN
- rsp->session.seq = BSWAP_32(rsp->session.seq);
- #endif
- memcpy(&rsp->session.msglen, rsp->data + *offset, 2);
+ rsp->session.msglen = ipmi16toh(&rsp->data[*offset]);
*offset += 2;
- #if WORDS_BIGENDIAN
- rsp->session.msglen = BSWAP_16(rsp->session.msglen);
- #endif
}
@@ -1197,7 +1191,7 @@ read_session_data_v2x(
/*
* read_session_data_v15
*
- * Initialize the ipmi_rsp from the session header of the packet.
+ * Initialize the ipmi_rsp from the session header of the packet.
*
* The offset should point the first byte of the the IPMI session when this
* function is called. When this function exits, the offset will point to
@@ -1212,8 +1206,7 @@ read_session_data_v2x(
*/
void read_session_data_v15(
struct ipmi_rs * rsp,
- int * offset,
- struct ipmi_session * s)
+ int * offset)
{
/* All v15 messages are IPMI messages */
rsp->session.payloadtype = IPMI_PAYLOAD_TYPE_IPMI;
@@ -1477,7 +1470,6 @@ void getIpmiPayloadWireRep(
* param payload [in] holds the v2 payload with our SOL data
*/
void getSolPayloadWireRep(
- struct ipmi_intf * intf, /* in out */
uint8_t * msg, /* output */
struct ipmi_v2_payload * payload) /* input */
{
@@ -1607,7 +1599,7 @@ ipmi_lanplus_build_v2x_msg(
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return;
}
@@ -1683,7 +1675,7 @@ ipmi_lanplus_build_v2x_msg(
break;
case IPMI_PAYLOAD_TYPE_SOL:
- getSolPayloadWireRep(intf,
+ getSolPayloadWireRep(
msg + IPMI_LANPLUS_OFFSET_PAYLOAD,
payload);
@@ -1760,7 +1752,11 @@ ipmi_lanplus_build_v2x_msg(
if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) &&
(session->v2_data.integrity_alg != IPMI_INTEGRITY_NONE))
{
- uint32_t i, hmac_length, integrity_pad_size = 0, hmac_input_size;
+ uint32_t i;
+ uint32_t hmac_length;
+ uint32_t auth_length = 0;
+ uint32_t integrity_pad_size = 0;
+ uint32_t hmac_input_size;
uint8_t * hmac_output;
uint32_t start_of_session_trailer =
IPMI_LANPLUS_OFFSET_PAYLOAD +
@@ -1818,22 +1814,43 @@ ipmi_lanplus_build_v2x_msg(
/* Auth Code */
lanplus_HMAC(session->v2_data.integrity_alg,
session->v2_data.k1, /* key */
- 20, /* key length */
+ session->v2_data.k1_len, /* key length */
msg + IPMI_LANPLUS_OFFSET_AUTHTYPE, /* hmac input */
hmac_input_size,
hmac_output,
&hmac_length);
- assert(hmac_length == 20);
+ switch(session->v2_data.integrity_alg) {
+ case IPMI_INTEGRITY_HMAC_SHA1_96:
+ assert(hmac_length == IPMI_SHA_DIGEST_LENGTH);
+ auth_length = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_INTEGRITY_HMAC_MD5_128 :
+ assert(hmac_length == IPMI_MD5_DIGEST_LENGTH);
+ auth_length = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_INTEGRITY_HMAC_SHA256_128:
+ assert(hmac_length == IPMI_SHA256_DIGEST_LENGTH);
+ auth_length = IPMI_HMAC_SHA256_AUTHCODE_SIZE;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
if (verbose > 2)
- printbuf(hmac_output, 12, "authcode output");
+ printbuf(hmac_output, auth_length, "authcode output");
/* Set session_trailer_length appropriately */
session_trailer_length =
integrity_pad_size +
2 + /* pad length + next header */
- 12; /* Size of the authcode (we only use the first 12 bytes) */
+ auth_length; /* Size of the authcode. We only
+ * use the first 12(SHA1) or
+ * 16(MD5/SHA256) bytes.
+ */
}
@@ -1886,8 +1903,6 @@ ipmi_lanplus_build_v2x_ipmi_cmd(
entry = ipmi_req_add_entry(intf, req, curr_seq);
/* it's a bridge command */
} else {
- unsigned char backup_cmd;
-
/* Add entry for cmd */
entry = ipmi_req_add_entry(intf, req, curr_seq);
@@ -1903,7 +1918,7 @@ ipmi_lanplus_build_v2x_ipmi_cmd(
}
}
- if (entry == NULL)
+ if (!entry)
return NULL;
// Build our payload
@@ -1969,13 +1984,13 @@ ipmi_lanplus_build_v15_ipmi_cmd(
struct ipmi_rq_entry * entry;
entry = ipmi_req_add_entry(intf, req, 0);
- if (entry == NULL)
+ if (!entry)
return NULL;
len = req->msg.data_len + 21;
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -2166,7 +2181,7 @@ ipmi_lanplus_send_payload(
entry = ipmi_lanplus_build_v2x_ipmi_cmd(intf, ipmi_request, isRetry);
}
- if (entry == NULL) {
+ if (!entry) {
lprintf(LOG_ERR, "Aborting send command, unable to build");
return NULL;
}
@@ -2284,6 +2299,10 @@ ipmi_lanplus_send_payload(
rsp = ipmi_lanplus_recv_sol(intf); /* Grab the next packet */
+ if (!is_sol_packet(rsp)) {
+ break;
+ }
+
if (sol_response_acks_packet(rsp, payload))
break;
@@ -2296,6 +2315,7 @@ ipmi_lanplus_send_payload(
intf->session->sol_data.sol_input_handler(rsp);
/* In order to avoid duplicate output, just set data_len to 0 */
rsp->data_len = 0;
+ break;
}
}
@@ -2307,7 +2327,7 @@ ipmi_lanplus_send_payload(
/* Duplicate Request ccode most likely indicates a response to
a previous retry. Ignore and keep polling. */
- while ((rsp != NULL) && (rsp->ccode == 0xcf))
+ while (rsp && rsp->ccode == 0xcf)
{
rsp = NULL;
rsp = ipmi_lan_poll_recv(intf);
@@ -2494,7 +2514,6 @@ ipmi_lanplus_send_sol(
*/
static int
check_sol_packet_for_new_data(
- struct ipmi_intf * intf,
struct ipmi_rs *rsp)
{
static uint8_t last_received_sequence_number = 0;
@@ -2533,7 +2552,7 @@ check_sol_packet_for_new_data(
/*
- *Rember the data for next round
+ * Remember the data for next round
*/
if (rsp->payload.sol_packet.packet_sequence_number)
{
@@ -2610,7 +2629,7 @@ ipmi_lanplus_recv_sol(struct ipmi_intf * intf)
* Remembers the data sent, and alters the data to just
* include the new stuff.
*/
- check_sol_packet_for_new_data(intf, rsp);
+ check_sol_packet_for_new_data(rsp);
}
return rsp;
}
@@ -2680,7 +2699,7 @@ ipmi_get_auth_capabilities_cmd(
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL || rsp->ccode > 0) {
+ if (!rsp || rsp->ccode) {
/*
* It's very possible that this failed because we asked for IPMI
* v2 data. Ask again, without requesting IPMI v2 data.
@@ -2689,11 +2708,11 @@ ipmi_get_auth_capabilities_cmd(
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_INFO, "Get Auth Capabilities error");
return 1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_INFO, "Get Auth Capabilities error: %s",
val2str(rsp->ccode, completion_code_vals));
return 1;
@@ -2718,10 +2737,9 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
- uint32_t bmc_session_lsbf;
uint8_t backupBridgePossible;
- if (intf->session == NULL
+ if (!intf->session
|| intf->session->v2_data.session_state != LANPLUS_STATE_ACTIVE)
return -1;
@@ -2730,12 +2748,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
intf->target_addr = IPMI_BMC_SLAVE_ADDR;
bridgePossible = 0;
- bmc_session_lsbf = intf->session->v2_data.bmc_id;
-#if WORDS_BIGENDIAN
- bmc_session_lsbf = BSWAP_32(bmc_session_lsbf);
-#endif
-
- memcpy(&msg_data, &bmc_session_lsbf, 4);
+ htoipmi32(intf->session->v2_data.bmc_id, msg_data);
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
@@ -2744,7 +2757,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
/* Looks like the session was closed */
lprintf(LOG_ERR, "Close Session command failed");
return -1;
@@ -2758,7 +2771,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
(long)intf->session->v2_data.bmc_id);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Close Session command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2795,7 +2808,7 @@ ipmi_lanplus_open_session(struct ipmi_intf * intf)
* Build an Open Session Request Payload
*/
msg = (uint8_t*)malloc(IPMI_OPEN_SESSION_REQUEST_SIZE);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -2876,7 +2889,7 @@ ipmi_lanplus_open_session(struct ipmi_intf * intf)
free(msg);
msg = NULL;
- if (rsp == NULL ) {
+ if (!rsp ) {
lprintf(LOG_DEBUG, "Timeout in open session response message.");
return 2;
}
@@ -2981,7 +2994,7 @@ ipmi_lanplus_rakp1(struct ipmi_intf * intf)
* Build a RAKP 1 message
*/
msg = (uint8_t*)malloc(IPMI_RAKP1_MESSAGE_SIZE);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -3012,9 +3025,7 @@ ipmi_lanplus_rakp1(struct ipmi_intf * intf)
return 1;
}
memcpy(msg + 8, session->v2_data.console_rand, 16);
- #if WORDS_BIGENDIAN
- lanplus_swap(msg + 8, 16);
- #endif
+ array_letoh(msg + 8, 16);
if (verbose > 1)
printbuf(session->v2_data.console_rand, 16,
@@ -3062,7 +3073,7 @@ ipmi_lanplus_rakp1(struct ipmi_intf * intf)
free(msg);
msg = NULL;
- if (rsp == NULL)
+ if (!rsp)
{
lprintf(LOG_WARNING, "> Error: no response from RAKP 1 message");
return 2;
@@ -3146,7 +3157,7 @@ ipmi_lanplus_rakp3(struct ipmi_intf * intf)
* Build a RAKP 3 message
*/
msg = (uint8_t*)malloc(IPMI_RAKP3_MESSAGE_MAX_SIZE);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -3235,7 +3246,7 @@ ipmi_lanplus_rakp3(struct ipmi_intf * intf)
*/
return 1;
}
- else if (rsp == NULL)
+ else if (!rsp)
{
lprintf(LOG_WARNING, "> Error: no response from RAKP 3 message");
return 2;
@@ -3326,7 +3337,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed",
val2str(privlvl, ipmi_privlvl_vals));
bridgePossible = backupBridgePossible;
@@ -3335,7 +3346,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "set_session_privlvl");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed: %s",
val2str(privlvl, ipmi_privlvl_vals),
val2str(rsp->ccode, completion_code_vals));
@@ -3351,6 +3362,62 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
return 0;
}
+static uint8_t
+ipmi_find_best_cipher_suite(struct ipmi_intf *intf)
+{
+ enum cipher_suite_ids best_suite = IPMI_LANPLUS_CIPHER_SUITE_RESERVED;
+#ifdef HAVE_CRYPTO_SHA256
+ struct cipher_suite_info suites[MAX_CIPHER_SUITE_COUNT];
+ size_t nr_suites = ARRAY_SIZE(suites);
+
+ /* cipher suite best order is chosen with this criteria:
+ * HMAC-MD5 and MD5 are BAD; xRC4 is bad; AES128 is required
+ * HMAC-SHA256 > HMAC-SHA1
+ * secure authentication > encrypted content
+ *
+ * With xRC4 out, all cipher suites with MD5 out, and cipher suite 3
+ * being required by the spec, the only better defined standard cipher
+ * suite is 17. So if SHA256 is available, we should try to use that,
+ * otherwise, fall back to 3.
+ */
+ const enum cipher_suite_ids cipher_order_preferred[] = {
+ IPMI_LANPLUS_CIPHER_SUITE_17,
+ IPMI_LANPLUS_CIPHER_SUITE_3,
+ };
+ const size_t nr_preferred = ARRAY_SIZE(cipher_order_preferred);
+ size_t ipref, i;
+
+ if (ipmi_get_channel_cipher_suites(intf, "ipmi", IPMI_LAN_CHANNEL_E,
+ suites, &nr_suites) < 0)
+ {
+ /* default legacy behavior - fall back to cipher suite 3 */
+ return IPMI_LANPLUS_CIPHER_SUITE_3;
+ }
+ for (ipref = 0;
+ ipref < nr_preferred &&
+ IPMI_LANPLUS_CIPHER_SUITE_RESERVED == best_suite;
+ ipref++)
+ {
+ for (i = 0; i < nr_suites; i++) {
+ if (cipher_order_preferred[ipref]
+ == suites[i].cipher_suite_id)
+ {
+ best_suite = cipher_order_preferred[ipref];
+ break;
+ }
+ }
+ }
+#endif /* HAVE_CRYPTO_SHA256 */
+ if (IPMI_LANPLUS_CIPHER_SUITE_RESERVED == best_suite) {
+ /* IPMI 2.0 spec requires that cipher suite 3 is implemented
+ * so we should always be able to fall back to that if better
+ * options are not available. */
+ best_suite = IPMI_LANPLUS_CIPHER_SUITE_3;
+ }
+ lprintf(LOG_INFO, "Using best available cipher suite %d\n", best_suite);
+ return best_suite;
+}
+
/**
* ipmi_lanplus_open
*/
@@ -3380,7 +3447,7 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
if (!params->retry)
params->retry = IPMI_LAN_RETRY;
- if (params->hostname == NULL || strlen((const char *)params->hostname) == 0) {
+ if (!params->hostname || strlen((const char *)params->hostname) == 0) {
lprintf(LOG_ERR, "No hostname specified!");
return -1;
}
@@ -3401,7 +3468,9 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
/* Setup our lanplus session state */
memset(session, 0, sizeof(struct ipmi_session));
session->timeout = params->timeout;
- memcpy(&session->authcode, &params->authcode_set, sizeof(session->authcode));
+ memcpy(&session->authcode,
+ &params->authcode_set,
+ sizeof(session->authcode));
session->v2_data.auth_alg = IPMI_AUTH_RAKP_NONE;
session->v2_data.crypt_alg = IPMI_CRYPT_NONE;
session->sol_data.sequence_number = 1;
@@ -3420,15 +3489,30 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
goto fail;
}
- if (!ipmi_oem_active(intf, "i82571spt") && ! auth_cap.v20_data_available) {
+ if (!ipmi_oem_active(intf, "i82571spt") &&
+ !auth_cap.v20_data_available)
+ {
lprintf(LOG_INFO, "This BMC does not support IPMI v2 / RMCP+");
goto fail;
}
/*
- * If the open/rakp1/rakp3 sequence encounters a timeout, the whole sequence
- * needs to restart. The individual messages are not individually retryable,
- * as the session state is advancing.
+ * If no cipher suite was provided, query the channel cipher suite list
+ * and pick the best one available
+ */
+ if (IPMI_LANPLUS_CIPHER_SUITE_RESERVED ==
+ intf->ssn_params.cipher_suite_id)
+ {
+ ipmi_intf_session_set_cipher_suite_id(
+ intf,
+ ipmi_find_best_cipher_suite(intf)
+ );
+ }
+
+ /*
+ * If the open/rakp1/rakp3 sequence encounters a timeout, the whole
+ * sequence needs to restart. The individual messages are not
+ * individually retryable, as the session state is advancing.
*/
for (retry = 0; retry < IPMI_LAN_RETRY; retry++) {
session->v2_data.session_state = LANPLUS_STATE_PRESESSION;
@@ -3597,21 +3681,19 @@ ipmi_lanplus_keepalive(struct ipmi_intf * intf)
return 0;
rsp = intf->sendrecv(intf, &req);
- while (rsp != NULL && is_sol_packet(rsp)) {
+ while (rsp && is_sol_packet(rsp)) {
/* rsp was SOL data instead of our answer */
/* since it didn't go through the sol recv, do sol recv stuff here */
ack_sol_packet(intf, rsp);
- check_sol_packet_for_new_data(intf, rsp);
+ check_sol_packet_for_new_data(rsp);
if (rsp->data_len)
intf->session->sol_data.sol_input_handler(rsp);
rsp = ipmi_lan_poll_recv(intf);
- if (rsp == NULL) /* the get device id answer never got back, but retry mechanism was bypassed by SOL data */
+ if (!rsp) /* the get device id answer never got back, but retry mechanism was bypassed by SOL data */
return 0; /* so get device id command never returned, the connection is still alive */
}
- if (rsp == NULL)
- return -1;
- if (rsp->ccode > 0)
+ if (!rsp || rsp->ccode)
return -1;
return 0;
@@ -3638,7 +3720,7 @@ static int ipmi_lanplus_setup(struct ipmi_intf * intf)
static void ipmi_lanp_set_max_rq_data_size(struct ipmi_intf * intf, uint16_t size)
{
- if (intf->ssn_params.cipher_suite_id == 3) {
+ if (intf->ssn_params.cipher_suite_id == IPMI_LANPLUS_CIPHER_SUITE_3) {
/*
* encrypted payload can only be multiple of 16 bytes
*/
@@ -3656,7 +3738,7 @@ static void ipmi_lanp_set_max_rq_data_size(struct ipmi_intf * intf, uint16_t siz
static void ipmi_lanp_set_max_rp_data_size(struct ipmi_intf * intf, uint16_t size)
{
- if (intf->ssn_params.cipher_suite_id == 3) {
+ if (intf->ssn_params.cipher_suite_id == IPMI_LANPLUS_CIPHER_SUITE_3) {
/*
* encrypted payload can only be multiple of 16 bytes
*/
diff --git a/src/plugins/lanplus/lanplus.h b/src/plugins/lanplus/lanplus.h
index 4b6ae1e..3e287ae 100644
--- a/src/plugins/lanplus/lanplus.h
+++ b/src/plugins/lanplus/lanplus.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LANPLUS_H
-#define IPMI_LANPLUS_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -96,20 +95,28 @@
#define IPMI_MAX_CONF_HEADER_SIZE 0x20
#define IPMI_MAX_PAYLOAD_SIZE 0xFFFF /* Includes confidentiality header/trailer */
#define IPMI_MAX_CONF_TRAILER_SIZE 0x20
-#define IPMI_MAX_INTEGRITY_PAD_SIZE 0x20
-#define IPMI_MAX_AUTH_CODE_SIZE 0x20
+#define IPMI_MAX_INTEGRITY_PAD_SIZE IPMI_MAX_MD_SIZE
+#define IPMI_MAX_AUTH_CODE_SIZE IPMI_MAX_MD_SIZE
#define IPMI_REQUEST_MESSAGE_SIZE 0x07
-#define IPMI_MAX_MAC_SIZE 0x14 /* The largest mac we ever expect to generate */
-#define IPMI_SHA1_AUTHCODE_SIZE 0x0C
+#define IPMI_MAX_MAC_SIZE IPMI_MAX_MD_SIZE /* The largest mac we ever expect to generate */
+
+#define IPMI_SHA1_AUTHCODE_SIZE 12
+#define IPMI_HMAC_MD5_AUTHCODE_SIZE 16
+#define IPMI_MD5_AUTHCODE_SIZE 16
+#define IPMI_HMAC_SHA256_AUTHCODE_SIZE 16
+
+#define IPMI_SHA_DIGEST_LENGTH 20
+#define IPMI_MD5_DIGEST_LENGTH 16
+#define IPMI_SHA256_DIGEST_LENGTH 32
/*
*This is accurate, as long as we're only passing 1 auth algorithm,
- * one integrity algorithm, and 1 encyrption alogrithm
+ * one integrity algorithm, and 1 encyrption algorithm
*/
#define IPMI_OPEN_SESSION_REQUEST_SIZE 32
#define IPMI_RAKP1_MESSAGE_SIZE 44
-#define IPMI_RAKP3_MESSAGE_MAX_SIZE 28
+#define IPMI_RAKP3_MESSAGE_MAX_SIZE (8 + IPMI_MAX_MD_SIZE)
#define IPMI_MAX_USER_NAME_LENGTH 16
@@ -122,5 +129,3 @@ struct ipmi_rs * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req
int ipmi_lanplus_open(struct ipmi_intf * intf);
void ipmi_lanplus_close(struct ipmi_intf * intf);
int ipmiv2_lan_ping(struct ipmi_intf * intf);
-
-#endif /*IPMI_LAN_H*/
diff --git a/src/plugins/lanplus/lanplus_crypt.c b/src/plugins/lanplus/lanplus_crypt.c
index 1cdd050..b4d677b 100644
--- a/src/plugins/lanplus/lanplus_crypt.c
+++ b/src/plugins/lanplus/lanplus_crypt.c
@@ -74,7 +74,7 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
{
uint8_t * buffer;
int bufferLength, i;
- uint8_t mac[20];
+ uint8_t mac[IPMI_MAX_MD_SIZE];
uint32_t macLength;
uint32_t SIDm_lsbf, SIDc_lsbf;
@@ -84,7 +84,16 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
return 1;
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
bufferLength =
@@ -98,7 +107,7 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
strlen((const char *)intf->ssn_params.username); /* optional */
buffer = malloc(bufferLength);
- if (buffer == NULL) {
+ if (!buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -228,8 +237,9 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
{
uint8_t * buffer;
int bufferLength, i;
- uint8_t mac[20];
+ uint8_t mac[IPMI_MAX_MD_SIZE];
uint32_t macLength;
+ uint32_t cmpLength;
uint32_t SIDc_lsbf;
if (ipmi_oem_active(intf, "intelplus")){
@@ -238,13 +248,23 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
return 1;
/* We don't yet support other algorithms */
- assert(session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96);
+ assert((session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96)
+ || (session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_MD5_128));
} else {
if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE)
return 1;
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
}
bufferLength =
@@ -253,7 +273,7 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
16; /* GUIDc */
buffer = (uint8_t *)malloc(bufferLength);
- if (buffer == NULL) {
+ if (!buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -294,7 +314,8 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
if (verbose > 2)
{
printbuf((const uint8_t *)buffer, bufferLength, ">> rakp4 mac input buffer");
- printbuf(session->v2_data.sik, 20l, ">> rakp4 mac key (sik)");
+ printbuf(session->v2_data.sik, session->v2_data.sik_len,
+ ">> rakp4 mac key (sik)");
}
@@ -305,7 +326,7 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
? session->v2_data.integrity_alg
: session->v2_data.auth_alg ,
session->v2_data.sik,
- IPMI_SIK_BUFFER_SIZE,
+ session->v2_data.sik_len,
buffer,
bufferLength,
mac,
@@ -317,12 +338,48 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
printbuf(mac, macLength, ">> rakp4 mac as computed by the remote console");
}
-
+ if (ipmi_oem_active(intf, "intelplus")) {
+ /* Intel BMC responds with the integrity Algorithm in RAKP4 */
+ switch(session->v2_data.integrity_alg) {
+ case IPMI_INTEGRITY_HMAC_SHA1_96:
+ assert(macLength == IPMI_SHA_DIGEST_LENGTH);
+ cmpLength = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_INTEGRITY_HMAC_MD5_128:
+ assert(macLength == IPMI_MD5_DIGEST_LENGTH);
+ cmpLength = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+ } else {
+ /* We don't yet support other algorithms */
+ switch(session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(macLength == IPMI_SHA_DIGEST_LENGTH);
+ cmpLength = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(macLength == IPMI_MD5_DIGEST_LENGTH);
+ cmpLength = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(macLength == IPMI_SHA256_DIGEST_LENGTH);
+ cmpLength = IPMI_HMAC_SHA256_AUTHCODE_SIZE;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+ }
free(buffer);
buffer = NULL;
- assert(macLength == 20);
- return (memcmp(bmc_mac, mac, 12) == 0);
+ assert(macLength >= cmpLength);
+ return (memcmp(bmc_mac, mac, cmpLength) == 0);
}
@@ -368,7 +425,16 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
}
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
input_buffer_length =
16 + /* Rc */
@@ -378,7 +444,7 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
strlen((const char *)intf->ssn_params.username);
input_buffer = malloc(input_buffer_length);
- if (input_buffer == NULL) {
+ if (!input_buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -458,7 +524,7 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
* <USERNAME> - Usename (absent for null usernames)
*
* The key used to generated the SIK is Kg if Kg is not null (two-key logins are
- * enabled). Otherwise Kuid (the user authcode) is used as the key to genereate
+ * enabled). Otherwise Kuid (the user authcode) is used as the key to generate
* the SIK.
*
* I am aware that the subscripts look backwards, but that is the way they are
@@ -478,13 +544,23 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
uint32_t mac_length;
- memset(session->v2_data.sik, 0, IPMI_SIK_BUFFER_SIZE);
+ memset(session->v2_data.sik, 0, sizeof(session->v2_data.sik));
+ session->v2_data.sik_len = 0;
if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE)
return 0;
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
input_buffer_length =
16 + /* Rm */
@@ -494,7 +570,7 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
strlen((const char *)intf->ssn_params.username);
input_buffer = malloc(input_buffer_length);
- if (input_buffer == NULL) {
+ if (!input_buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -572,15 +648,33 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
free(input_buffer);
input_buffer = NULL;
- assert(mac_length == 20);
+ switch (session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(mac_length == IPMI_SHA_DIGEST_LENGTH);
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(mac_length == IPMI_MD5_DIGEST_LENGTH);
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(mac_length == IPMI_SHA256_DIGEST_LENGTH);
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+
+ session->v2_data.sik_len = mac_length;
/*
* The key MAC generated is 20 bytes, but we will only be using the first
* 12 for SHA1 96
*/
- if (verbose >= 2)
- printbuf(session->v2_data.sik, 20, "Generated session integrity key");
-
+ if (verbose >= 2) {
+ printbuf(session->v2_data.sik, session->v2_data.sik_len,
+ "Generated session integrity key");
+ }
return 0;
}
@@ -614,16 +708,32 @@ lanplus_generate_k1(struct ipmi_session * session)
{
lanplus_HMAC(session->v2_data.auth_alg,
session->v2_data.sik,
- IPMI_SIK_BUFFER_SIZE, /* SIK length */
+ session->v2_data.sik_len, /* SIK length */
CONST_1,
20,
session->v2_data.k1,
&mac_length);
- assert(mac_length == 20);
+ switch (session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(mac_length == IPMI_SHA_DIGEST_LENGTH);
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(mac_length == IPMI_MD5_DIGEST_LENGTH);
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(mac_length == IPMI_SHA256_DIGEST_LENGTH);
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+ session->v2_data.k1_len = mac_length;
}
if (verbose >= 2)
- printbuf(session->v2_data.k1, 20, "Generated K1");
+ printbuf(session->v2_data.k1, session->v2_data.k1_len, "Generated K1");
return 0;
}
@@ -658,16 +768,32 @@ lanplus_generate_k2(struct ipmi_session * session)
{
lanplus_HMAC(session->v2_data.auth_alg,
session->v2_data.sik,
- IPMI_SIK_BUFFER_SIZE, /* SIK length */
+ session->v2_data.sik_len, /* SIK length */
CONST_2,
20,
session->v2_data.k2,
&mac_length);
- assert(mac_length == 20);
+ switch (session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(mac_length == IPMI_SHA_DIGEST_LENGTH);
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(mac_length == IPMI_MD5_DIGEST_LENGTH);
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(mac_length == IPMI_SHA256_DIGEST_LENGTH);
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+ session->v2_data.k2_len = mac_length;
}
if (verbose >= 2)
- printbuf(session->v2_data.k2, 20, "Generated K2");
+ printbuf(session->v2_data.k2, session->v2_data.k2_len, "Generated K2");
return 0;
}
@@ -726,7 +852,7 @@ lanplus_encrypt_payload(uint8_t crypt_alg,
pad_length = IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE - mod;
padded_input = (uint8_t*)malloc(input_length + pad_length + 1);
- if (padded_input == NULL) {
+ if (!padded_input) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -743,7 +869,7 @@ lanplus_encrypt_payload(uint8_t crypt_alg,
if (lanplus_rand(output, IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE))
{
lprintf(LOG_ERR, "lanplus_encrypt_payload: Error generating IV");
- if (padded_input != NULL) {
+ if (padded_input) {
free(padded_input);
padded_input = NULL;
}
@@ -787,7 +913,7 @@ lanplus_encrypt_payload(uint8_t crypt_alg,
*
* The authcode is computed using the specified integrity algorithm starting
* with the AuthType / Format field, and ending with the field immediately
- * preceeding the authcode itself.
+ * preceding the authcode itself.
*
* The key key used to generate the authcode MAC is K1.
*
@@ -803,6 +929,7 @@ lanplus_has_valid_auth_code(struct ipmi_rs * rs, struct ipmi_session * session)
uint8_t * bmc_authcode;
uint8_t generated_authcode[IPMI_MAX_MAC_SIZE];
uint32_t generated_authcode_length;
+ uint32_t authcode_length;
if ((rs->session.authtype != IPMI_SESSION_AUTHTYPE_RMCP_PLUS) ||
@@ -811,36 +938,51 @@ lanplus_has_valid_auth_code(struct ipmi_rs * rs, struct ipmi_session * session)
(session->v2_data.integrity_alg == IPMI_INTEGRITY_NONE))
return 1;
- /* We only support SHA1-96 now */
- assert(session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96);
+ switch (session->v2_data.integrity_alg) {
+ case IPMI_INTEGRITY_HMAC_SHA1_96:
+ authcode_length = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_INTEGRITY_HMAC_MD5_128:
+ authcode_length = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_INTEGRITY_HMAC_SHA256_128:
+ authcode_length = IPMI_HMAC_SHA256_AUTHCODE_SIZE;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ /* Unsupported */
+ default:
+ assert(0);
+ break;
+ }
/*
* For SHA1-96, the authcode will be the last 12 bytes in the packet
+ * For SHA256-128 or MD5-128, the authcode will be the last 16 bytes in the packet
*/
- bmc_authcode = rs->data + (rs->data_len - IPMI_SHA1_AUTHCODE_SIZE);
+ bmc_authcode = rs->data + (rs->data_len - authcode_length);
lanplus_HMAC(session->v2_data.integrity_alg,
session->v2_data.k1,
- IPMI_AUTHCODE_BUFFER_SIZE,
+ session->v2_data.k1_len,
rs->data + IPMI_LANPLUS_OFFSET_AUTHTYPE,
- rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - IPMI_SHA1_AUTHCODE_SIZE,
+ rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - authcode_length,
generated_authcode,
&generated_authcode_length);
if (verbose > 3)
{
lprintf(LOG_DEBUG+2, "Validating authcode");
- printbuf(session->v2_data.k1, 20, "K1");
+ printbuf(session->v2_data.k1, session->v2_data.k1_len, "K1");
printbuf(rs->data + IPMI_LANPLUS_OFFSET_AUTHTYPE,
- rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - IPMI_SHA1_AUTHCODE_SIZE,
+ rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - authcode_length,
"Authcode Input Data");
- printbuf(generated_authcode, 12, "Generated authcode");
- printbuf(bmc_authcode, 12, "Expected authcode");
+ printbuf(generated_authcode, generated_authcode_length, "Generated authcode");
+ printbuf(bmc_authcode, authcode_length, "Expected authcode");
}
-
- assert(generated_authcode_length == 20);
- return (memcmp(bmc_authcode, generated_authcode, 12) == 0);
+ assert(generated_authcode_length >= authcode_length);
+ return (memcmp(bmc_authcode, generated_authcode, authcode_length) == 0);
}
@@ -877,7 +1019,7 @@ lanplus_decrypt_payload(uint8_t crypt_alg, const uint8_t * key,
assert(crypt_alg == IPMI_CRYPT_AES_CBC_128);
decrypted_payload = (uint8_t*)malloc(input_length);
- if (decrypted_payload == NULL) {
+ if (!decrypted_payload) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -903,7 +1045,7 @@ lanplus_decrypt_payload(uint8_t crypt_alg, const uint8_t * key,
bytes_decrypted);
/*
- * We have to determine the payload size, by substracting the padding, etc.
+ * We have to determine the payload size, by subtracting the padding, etc.
* The last byte of the decrypted payload is the confidentiality pad length.
*/
conf_pad_length = decrypted_payload[bytes_decrypted - 1];
diff --git a/src/plugins/lanplus/lanplus_crypt.h b/src/plugins/lanplus/lanplus_crypt.h
index d69cc9b..1c306dd 100644
--- a/src/plugins/lanplus/lanplus_crypt.h
+++ b/src/plugins/lanplus/lanplus_crypt.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LANPLUS_CRYPT_H
-#define IPMI_LANPLUS_CRYPT_H
+#pragma once
#include <ipmitool/ipmi_intf.h>
@@ -68,8 +67,3 @@ int lanplus_decrypt_payload(uint8_t crypt_alg,
uint16_t * payload_size);
int lanplus_has_valid_auth_code(struct ipmi_rs * rs,
struct ipmi_session * session);
-
-
-
-
-#endif /* IPMI_LANPLUS_CRYPT_H */
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index cde6c54..7603e6d 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -99,9 +99,10 @@ lanplus_rand(uint8_t * buffer, uint32_t num_bytes)
/*
* lanplus_HMAC
*
- * param mac specifies the algorithm to be used, currently only SHA1 is supported
+ * param mac specifies the algorithm to be used, currently SHA1, SHA256 and MD5
+ * are supported
* param key is the key used for HMAC generation
- * param key_len is the lenght of key
+ * param key_len is the length of key
* param d is the data to be MAC'd
* param n is the length of the data at d
* param md is the result of the HMAC algorithm
@@ -123,6 +124,14 @@ lanplus_HMAC(uint8_t mac,
if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) ||
(mac == IPMI_INTEGRITY_HMAC_SHA1_96))
evp_md = EVP_sha1();
+ else if ((mac == IPMI_AUTH_RAKP_HMAC_MD5) ||
+ (mac == IPMI_INTEGRITY_HMAC_MD5_128))
+ evp_md = EVP_md5();
+#ifdef HAVE_CRYPTO_SHA256
+ else if ((mac == IPMI_AUTH_RAKP_HMAC_SHA256) ||
+ (mac == IPMI_INTEGRITY_HMAC_SHA256_128))
+ evp_md = EVP_sha256();
+#endif /* HAVE_CRYPTO_SHA256 */
else
{
lprintf(LOG_DEBUG, "Invalid mac type 0x%x in lanplus_HMAC\n", mac);
@@ -155,11 +164,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
-
+ EVP_CIPHER_CTX *ctx = NULL;
*bytes_written = 0;
@@ -173,6 +178,18 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
printbuf(input, input_length, "encrypting this data");
}
+ ctx = EVP_CIPHER_CTX_new();
+ if (!ctx) {
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_init(ctx);
+#else
+ EVP_CIPHER_CTX_reset(ctx);
+#endif
+ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
/*
* The default implementation adds a whole block of padding if the input
@@ -182,28 +199,28 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
*bytes_written = 0;
- return;
}
else
{
uint32_t tmplen;
- if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
+ /* Error */
*bytes_written = 0;
- return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
}
}
+ /* performs cleanup and free */
+ EVP_CIPHER_CTX_free(ctx);
}
@@ -230,11 +247,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
-
+ EVP_CIPHER_CTX *ctx = NULL;
if (verbose >= 5)
{
@@ -243,12 +256,24 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
printbuf(input, input_length, "decrypting this data");
}
-
*bytes_written = 0;
if (input_length == 0)
return;
+ ctx = EVP_CIPHER_CTX_new();
+ if (!ctx) {
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_init(ctx);
+#else
+ EVP_CIPHER_CTX_reset(ctx);
+#endif
+ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
+
/*
* The default implementation adds a whole block of padding if the input
* data is perfectly aligned. We would like to keep that from happening.
@@ -257,33 +282,33 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
*bytes_written = 0;
- return;
}
else
{
uint32_t tmplen;
- if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
+ /* Error */
char buffer[1000];
ERR_error_string(ERR_get_error(), buffer);
lprintf(LOG_DEBUG, "the ERR error %s", buffer);
lprintf(LOG_DEBUG, "ERROR: decrypt final failed");
*bytes_written = 0;
- return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
}
}
+ /* performs cleanup and free */
+ EVP_CIPHER_CTX_free(ctx);
if (verbose >= 5)
{
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.h b/src/plugins/lanplus/lanplus_crypt_impl.h
index ff534bc..a48c6b7 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.h
+++ b/src/plugins/lanplus/lanplus_crypt_impl.h
@@ -30,9 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LANPLUS_CRYPT_IMPL_H
-#define IPMI_LANPLUS_CRYPT_IMPL_H
-
+#pragma once
int
lanplus_seed_prng(uint32_t bytes);
@@ -61,6 +59,3 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint32_t input_length,
uint8_t * output,
uint32_t * bytes_written);
-
-
-#endif /* IPMI_LANPLUS_CRYPT_IMPL_H */
diff --git a/src/plugins/lanplus/lanplus_dump.c b/src/plugins/lanplus/lanplus_dump.c
index 8d52fab..bbfc1b0 100644
--- a/src/plugins/lanplus/lanplus_dump.c
+++ b/src/plugins/lanplus/lanplus_dump.c
@@ -31,6 +31,7 @@
*/
#include "lanplus.h"
+#include "lanplus_crypt.h"
#include "lanplus_dump.h"
extern const struct valstr ipmi_rakp_return_codes[];
@@ -127,16 +128,27 @@ void lanplus_dump_rakp2_message(const struct ipmi_rs * rsp, uint8_t auth_alg)
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
printf("%s Key exchange auth code [sha1] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 20; ++i)
+ for (i = 0; i < IPMI_SHA_DIGEST_LENGTH; ++i) {
printf("%02x", rsp->payload.rakp2_message.key_exchange_auth_code[i]);
- printf("\n");
+ }
+ printf("\n");
break;
case IPMI_AUTH_RAKP_HMAC_MD5:
printf("%s Key exchange auth code [md5] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 16; ++i)
+ for (i = 0; i < IPMI_MD5_DIGEST_LENGTH; ++i) {
printf("%02x", rsp->payload.rakp2_message.key_exchange_auth_code[i]);
- printf("\n");
+ }
+ printf("\n");
break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ printf("%s Key exchange auth code [sha256]: 0x", DUMP_PREFIX_INCOMING);
+ for (i = 0; i < IPMI_SHA256_DIGEST_LENGTH; ++i) {
+ printf("%02x", rsp->payload.rakp2_message.key_exchange_auth_code[i]);
+ }
+ printf("\n");
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
default:
printf("%s Key exchange auth code : invalid", DUMP_PREFIX_INCOMING);
}
@@ -174,16 +186,27 @@ void lanplus_dump_rakp4_message(const struct ipmi_rs * rsp, uint8_t auth_alg)
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
printf("%s Key exchange auth code [sha1] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 12; ++i)
+ for (i = 0; i < IPMI_SHA1_AUTHCODE_SIZE; ++i) {
printf("%02x", rsp->payload.rakp4_message.integrity_check_value[i]);
- printf("\n");
+ }
+ printf("\n");
break;
case IPMI_AUTH_RAKP_HMAC_MD5:
printf("%s Key exchange auth code [md5] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 12; ++i)
+ for (i = 0; i < IPMI_HMAC_MD5_AUTHCODE_SIZE; ++i) {
+ printf("%02x", rsp->payload.rakp4_message.integrity_check_value[i]);
+ }
+ printf("\n");
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ printf("%s Key exchange auth code [sha256]: 0x", DUMP_PREFIX_INCOMING);
+ for (i = 0; i < IPMI_HMAC_SHA256_AUTHCODE_SIZE; ++i) {
printf("%02x", rsp->payload.rakp4_message.integrity_check_value[i]);
- printf("\n");
+ }
+ printf("\n");
break;
+#endif /* HAVE_CRYPTO_SHA256 */
default:
printf("%s Key exchange auth code : invalid", DUMP_PREFIX_INCOMING);
}
diff --git a/src/plugins/lanplus/lanplus_dump.h b/src/plugins/lanplus/lanplus_dump.h
index 4e29ebb..d4c8a8d 100644
--- a/src/plugins/lanplus/lanplus_dump.h
+++ b/src/plugins/lanplus/lanplus_dump.h
@@ -30,9 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-
-#ifndef IPMI_LANPLUS_DUMP_H
-#define IPMI_LANPLUS_DUMP_H
+#pragma once
#include <ipmitool/ipmi_intf.h>
@@ -40,6 +38,3 @@
void lanplus_dump_open_session_response(const struct ipmi_rs * rsp);
void lanplus_dump_rakp2_message(const struct ipmi_rs * rsp, uint8_t auth_alg);
void lanplus_dump_rakp4_message(const struct ipmi_rs * rsp, uint8_t auth_alg);
-
-
-#endif /* IPMI_LANPLUS_DUMP_H */
diff --git a/src/plugins/lanplus/rmcp.h b/src/plugins/lanplus/rmcp.h
index 51dc44d..df07f2f 100644
--- a/src/plugins/lanplus/rmcp.h
+++ b/src/plugins/lanplus/rmcp.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_RMCP_H
-#define IPMI_RMCP_H
+#pragma once
#include <ipmitool/helper.h>
#include "lanplus.h"
@@ -45,24 +44,11 @@
#define RMCP_TYPE_NORM 0x00
#define RMCP_TYPE_ACK 0x01
-static const struct valstr rmcp_type_vals[] __attribute__((unused)) = {
- { RMCP_TYPE_NORM, "Normal RMCP" },
- { RMCP_TYPE_ACK, "RMCP ACK" },
- { 0, NULL }
-};
-
#define RMCP_CLASS_MASK 0x1f
#define RMCP_CLASS_ASF 0x06
#define RMCP_CLASS_IPMI 0x07
#define RMCP_CLASS_OEM 0x08
-static const struct valstr rmcp_class_vals[] __attribute__((unused)) = {
- { RMCP_CLASS_ASF, "ASF" },
- { RMCP_CLASS_IPMI, "IPMI" },
- { RMCP_CLASS_OEM, "OEM" },
- { 0, NULL }
-};
-
/* RMCP message header */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -78,5 +64,3 @@ struct rmcp_hdr {
#endif
int handle_rmcp(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_RMCP_H */
diff --git a/src/plugins/lipmi/Makefile.in b/src/plugins/lipmi/Makefile.in
deleted file mode 100644
index be4996d..0000000
--- a/src/plugins/lipmi/Makefile.in
+++ /dev/null
@@ -1,637 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/lipmi
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_lipmi_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_lipmi_la_OBJECTS = lipmi.lo
-libintf_lipmi_la_OBJECTS = $(am_libintf_lipmi_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_lipmi_la_SOURCES)
-DIST_SOURCES = $(libintf_lipmi_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_lipmi.la
-noinst_LTLIBRARIES = @INTF_LIPMI_LIB@
-libintf_lipmi_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_lipmi_la_SOURCES = lipmi.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/lipmi/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/lipmi/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_lipmi.la: $(libintf_lipmi_la_OBJECTS) $(libintf_lipmi_la_DEPENDENCIES) $(EXTRA_libintf_lipmi_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_lipmi_la_OBJECTS) $(libintf_lipmi_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lipmi.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/lipmi/lipmi.c b/src/plugins/lipmi/lipmi.c
index fa7845d..f3db7ab 100644
--- a/src/plugins/lipmi/lipmi.c
+++ b/src/plugins/lipmi/lipmi.c
@@ -119,11 +119,11 @@ static struct ipmi_rs * ipmi_lipmi_send_cmd(struct ipmi_intf * intf, struct ipmi
}
struct ipmi_intf ipmi_lipmi_intf = {
- name: "lipmi",
- desc: "Solaris x86 LIPMI Interface",
- open: ipmi_lipmi_open,
- close: ipmi_lipmi_close,
- sendrecv: ipmi_lipmi_send_cmd,
- target_addr: IPMI_BMC_SLAVE_ADDR,
+ .name = "lipmi",
+ .desc = "Solaris x86 LIPMI Interface",
+ .open = ipmi_lipmi_open,
+ .close = ipmi_lipmi_close,
+ .sendrecv = ipmi_lipmi_send_cmd,
+ .target_addr = IPMI_BMC_SLAVE_ADDR,
};
diff --git a/src/plugins/lipmi/lipmi.h b/src/plugins/lipmi/lipmi.h
new file mode 100644
index 0000000..37a01fb
--- /dev/null
+++ b/src/plugins/lipmi/lipmi.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
+ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
+ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
+ * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
+ * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
+ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
+ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#pragma once
+
+#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_intf.h>
+
+#define LIPMI_DEV "/dev/lipmi"
+
+struct ipmi_rs * ipmi_lipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req);
+int ipmi_lipmi_open(struct ipmi_intf * intf);
+void ipmi_lipmi_close(struct ipmi_intf * intf);
+int lipmi_intf_setup(struct ipmi_intf ** intf);
diff --git a/src/plugins/open/Makefile.in b/src/plugins/open/Makefile.in
deleted file mode 100644
index c4b7714..0000000
--- a/src/plugins/open/Makefile.in
+++ /dev/null
@@ -1,637 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Sun Microsystems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/open
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_open_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_open_la_OBJECTS = open.lo
-libintf_open_la_OBJECTS = $(am_libintf_open_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_open_la_SOURCES)
-DIST_SOURCES = $(libintf_open_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_open.la
-noinst_LTLIBRARIES = @INTF_OPEN_LIB@
-libintf_open_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_open_la_SOURCES = open.c open.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/open/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/open/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_open.la: $(libintf_open_la_OBJECTS) $(libintf_open_la_DEPENDENCIES) $(EXTRA_libintf_open_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_open_la_OBJECTS) $(libintf_open_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/open/open.c b/src/plugins/open/open.c
index df56172..39c8ea2 100644
--- a/src/plugins/open/open.c
+++ b/src/plugins/open/open.c
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,6 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _POSIX_SOURCE
#include <stdio.h>
#include <fcntl.h>
@@ -89,11 +88,10 @@
extern int verbose;
-static int
-ipmi_openipmi_open(struct ipmi_intf * intf)
+static
+int
+ipmi_openipmi_open(struct ipmi_intf *intf)
{
- int i = 0;
-
char ipmi_dev[16];
char ipmi_devfs[16];
char ipmi_devfs2[16];
@@ -115,32 +113,35 @@ ipmi_openipmi_open(struct ipmi_intf * intf)
}
if (intf->fd < 0) {
lperror(LOG_ERR, "Could not open device at %s or %s or %s",
- ipmi_dev, ipmi_devfs , ipmi_devfs2);
+ ipmi_dev, ipmi_devfs, ipmi_devfs2);
return -1;
}
}
- if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &i) < 0) {
+ int receive_events = TRUE;
+
+ if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &receive_events) < 0) {
lperror(LOG_ERR, "Could not enable event receiver");
return -1;
}
-
+
intf->opened = 1;
- /* This is never set to 0, the default is IPMI_BMC_SLAVE_ADDR */
+ /* This is never set to 0, the default is IPMI_BMC_SLAVE_ADDR */
if (intf->my_addr != 0) {
if (intf->set_my_addr(intf, intf->my_addr) < 0) {
lperror(LOG_ERR, "Could not set IPMB address");
return -1;
}
- lprintf(LOG_DEBUG, "Set IPMB address to 0x%x",
- intf->my_addr );
+ lprintf(LOG_DEBUG, "Set IPMB address to 0x%x", intf->my_addr);
}
intf->manufacturer_id = ipmi_get_oem(intf);
return intf->fd;
}
-static int
+
+static
+int
ipmi_openipmi_set_my_addr(struct ipmi_intf *intf, uint8_t addr)
{
unsigned int a = addr;
@@ -152,8 +153,9 @@ ipmi_openipmi_set_my_addr(struct ipmi_intf *intf, uint8_t addr)
return 0;
}
-static void
-ipmi_openipmi_close(struct ipmi_intf * intf)
+static
+void
+ipmi_openipmi_close(struct ipmi_intf *intf)
{
if (intf->fd >= 0) {
close(intf->fd);
@@ -164,10 +166,11 @@ ipmi_openipmi_close(struct ipmi_intf * intf)
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
}
-static struct ipmi_rs *
-ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
+static
+struct ipmi_rs *
+ipmi_openipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
{
- struct ipmi_recv recv;
+ struct ipmi_recv recv = {};
struct ipmi_addr addr;
struct ipmi_system_interface_addr bmc_addr = {
.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE,
@@ -182,28 +185,26 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
static int curr_seq = 0;
fd_set rset;
- uint8_t * data = NULL;
+ uint8_t *data = NULL;
int data_len = 0;
int retval = 0;
-
- if (intf == NULL || req == NULL)
+ if (!intf || !req)
return NULL;
ipmb_addr.channel = intf->target_channel & 0x0f;
- if (intf->opened == 0 && intf->open != NULL)
+ if (!intf->opened && intf->open)
if (intf->open(intf) < 0)
return NULL;
if (verbose > 2) {
fprintf(stderr, "OpenIPMI Request Message Header:\n");
- fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn );
+ fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn);
fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
- printbuf(req->msg.data, req->msg.data_len, "OpenIPMI Request Message Data");
+ printbuf(req->msg.data, req->msg.data_len,
+ "OpenIPMI Request Message Data");
}
-
-
/*
* setup and send message
@@ -212,111 +213,113 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
memset(&_req, 0, sizeof(struct ipmi_req));
if (intf->target_addr != 0 &&
- intf->target_addr != intf->my_addr) {
+ intf->target_addr != intf->my_addr)
+ {
/* use IPMB address if needed */
ipmb_addr.slave_addr = intf->target_addr;
ipmb_addr.lun = req->msg.lun;
- lprintf(LOG_DEBUG, "Sending request 0x%x to "
- "IPMB target @ 0x%x:0x%x (from 0x%x)",
- req->msg.cmd,
- intf->target_addr,intf->target_channel, intf->my_addr);
-
- if(intf->transit_addr != 0 && intf->transit_addr != intf->my_addr) {
- uint8_t index = 0;
-
- lprintf(LOG_DEBUG, "Encapsulating data sent to "
- "end target [0x%02x,0x%02x] using transit [0x%02x,0x%02x] from 0x%x ",
- (0x40 | intf->target_channel),
- intf->target_addr,
- intf->transit_channel,
- intf->transit_addr,
- intf->my_addr
- );
-
- /* Convert Message to 'Send Message' */
- /* Supplied req : req , internal req : _req */
-
- if (verbose > 4) {
- fprintf(stderr, "Converting message:\n");
- fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn );
- fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
- if (req->msg.data && req->msg.data_len) {
- fprintf(stderr, " data_len = %d\n", req->msg.data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(req->msg.data,req->msg.data_len));
- }
- }
-
- /* Modify target address to use 'transit' instead */
- ipmb_addr.slave_addr = intf->transit_addr;
- ipmb_addr.channel = intf->transit_channel;
-
- /* FIXME backup "My address" */
- data_len = req->msg.data_len + 8;
- data = malloc(data_len);
- if (data == NULL) {
- lprintf(LOG_ERR, "ipmitool: malloc failure");
- return NULL;
- }
-
- memset(data, 0, data_len);
-
- data[index++] = (0x40|intf->target_channel);
- data[index++] = intf->target_addr;
- data[index++] = ( req->msg.netfn << 2 ) | req->msg.lun ;
- data[index++] = ipmi_csum(data+1, 2);
- data[index++] = 0xFF; /* normally 0x20 , overwritten by IPMC */
- data[index++] = ( (0) << 2) | 0 ; /* FIXME */
- data[index++] = req->msg.cmd;
- memcpy( (data+index) , req->msg.data, req->msg.data_len);
- index += req->msg.data_len;
- data[index++] = ipmi_csum( (data+4),(req->msg.data_len + 3) );
-
- if (verbose > 4) {
- fprintf(stderr, "Encapsulated message:\n");
- fprintf(stderr, " netfn = 0x%x\n", IPMI_NETFN_APP );
- fprintf(stderr, " cmd = 0x%x\n", 0x34 );
- if (data && data_len) {
- fprintf(stderr, " data_len = %d\n", data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(data,data_len));
- }
- }
+ lprintf(LOG_DEBUG,
+ "Sending request 0x%x to "
+ "IPMB target @ 0x%x:0x%x (from 0x%x)",
+ req->msg.cmd, intf->target_addr, intf->target_channel,
+ intf->my_addr);
+
+ if (intf->transit_addr != 0 &&
+ intf->transit_addr != intf->my_addr)
+ {
+ uint8_t index = 0;
+
+ lprintf(LOG_DEBUG,
+ "Encapsulating data sent to "
+ "end target [0x%02x,0x%02x] using "
+ "transit [0x%02x,0x%02x] from 0x%x ",
+ (0x40 | intf->target_channel),
+ intf->target_addr,
+ intf->transit_channel,
+ intf->transit_addr,
+ intf->my_addr);
+
+ /* Convert Message to 'Send Message' */
+ /* Supplied req : req , internal req : _req */
+
+ if (verbose > 4) {
+ fprintf(stderr, "Converting message:\n");
+ fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn);
+ fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
+ if (req->msg.data && req->msg.data_len) {
+ fprintf(stderr, " data_len = %d\n", req->msg.data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(req->msg.data, req->msg.data_len));
+ }
+ }
+
+ /* Modify target address to use 'transit' instead */
+ ipmb_addr.slave_addr = intf->transit_addr;
+ ipmb_addr.channel = intf->transit_channel;
+
+ /* FIXME backup "My address" */
+ data_len = req->msg.data_len + 8;
+ data = malloc(data_len);
+ if (!data) {
+ lprintf(LOG_ERR, "ipmitool: malloc failure");
+ return NULL;
+ }
+
+ memset(data, 0, data_len);
+
+ data[index++] = (0x40 | intf->target_channel);
+ data[index++] = intf->target_addr;
+ data[index++] = (req->msg.netfn << 2) | req->msg.lun;
+ data[index++] = ipmi_csum(data + 1, 2);
+ data[index++] = 0xFF; /* normally 0x20 , overwritten by IPMC */
+ data[index++] = ((0) << 2) | 0; /* FIXME */
+ data[index++] = req->msg.cmd;
+ memcpy((data + index), req->msg.data, req->msg.data_len);
+ index += req->msg.data_len;
+ data[index++] = ipmi_csum((data + 4), (req->msg.data_len + 3));
+
+ if (verbose > 4) {
+ fprintf(stderr, "Encapsulated message:\n");
+ fprintf(stderr, " netfn = 0x%x\n", IPMI_NETFN_APP);
+ fprintf(stderr, " cmd = 0x%x\n", 0x34);
+ if (data && data_len) {
+ fprintf(stderr, " data_len = %d\n", data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(data, data_len));
+ }
+ }
}
- _req.addr = (unsigned char *) &ipmb_addr;
+ _req.addr = (unsigned char *)&ipmb_addr;
_req.addr_len = sizeof(ipmb_addr);
} else {
- /* otherwise use system interface */
- lprintf(LOG_DEBUG+2, "Sending request 0x%x to "
- "System Interface", req->msg.cmd);
- bmc_addr.lun = req->msg.lun;
- _req.addr = (unsigned char *) &bmc_addr;
- _req.addr_len = sizeof(bmc_addr);
+ /* otherwise use system interface */
+ lprintf(LOG_DEBUG + 2, "Sending request 0x%x to System Interface",
+ req->msg.cmd);
+ bmc_addr.lun = req->msg.lun;
+ _req.addr = (unsigned char *)&bmc_addr;
+ _req.addr_len = sizeof(bmc_addr);
}
_req.msgid = curr_seq++;
/* In case of a bridge request */
- if( data != NULL && data_len != 0 ) {
- _req.msg.data = data;
- _req.msg.data_len = data_len;
- _req.msg.netfn = IPMI_NETFN_APP;
- _req.msg.cmd = 0x34;
+ if (data && data_len != 0) {
+ _req.msg.data = data;
+ _req.msg.data_len = data_len;
+ _req.msg.netfn = IPMI_NETFN_APP;
+ _req.msg.cmd = 0x34;
} else {
- _req.msg.data = req->msg.data;
- _req.msg.data_len = req->msg.data_len;
- _req.msg.netfn = req->msg.netfn;
- _req.msg.cmd = req->msg.cmd;
+ _req.msg.data = req->msg.data;
+ _req.msg.data_len = req->msg.data_len;
+ _req.msg.netfn = req->msg.netfn;
+ _req.msg.cmd = req->msg.cmd;
}
-
+
if (ioctl(intf->fd, IPMICTL_SEND_COMMAND, &_req) < 0) {
- lperror(LOG_ERR, "Unable to send command");
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
+ lperror(LOG_ERR, "Unable to send command");
+ free_n(&data);
+ return NULL;
}
/*
@@ -324,99 +327,102 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
*/
if (intf->noanswer) {
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
+ free_n(&data);
+ return NULL;
}
FD_ZERO(&rset);
FD_SET(intf->fd, &rset);
read_timeout.tv_sec = IPMI_OPENIPMI_READ_TIMEOUT;
read_timeout.tv_usec = 0;
- retval = select(intf->fd+1, &rset, NULL, NULL, &read_timeout);
- if (retval < 0) {
- lperror(LOG_ERR, "I/O Error");
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
- } else if (retval == 0) {
- lprintf(LOG_ERR, "No data available");
- if (data != NULL) {
- free(data);
- data = NULL;
+ do {
+ do {
+ retval = select(intf->fd + 1, &rset, NULL, NULL, &read_timeout);
+ } while (retval < 0 && errno == EINTR);
+ if (retval < 0) {
+ lperror(LOG_ERR, "I/O Error");
+ free_n(&data);
+ return NULL;
+ } else if (retval == 0) {
+ lprintf(LOG_ERR, "No data available");
+ free_n(&data);
+ return NULL;
+ }
+ if (FD_ISSET(intf->fd, &rset) == 0) {
+ lprintf(LOG_ERR, "No data available");
+ free_n(&data);
+ return NULL;
}
- return NULL;
- }
- if (FD_ISSET(intf->fd, &rset) == 0) {
- lprintf(LOG_ERR, "No data available");
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
- }
- recv.addr = (unsigned char *) &addr;
- recv.addr_len = sizeof(addr);
- recv.msg.data = rsp.data;
- recv.msg.data_len = sizeof(rsp.data);
-
- /* get data */
- if (ioctl(intf->fd, IPMICTL_RECEIVE_MSG_TRUNC, &recv) < 0) {
- lperror(LOG_ERR, "Error receiving message");
- if (errno != EMSGSIZE) {
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
- }
- }
+ recv.addr = (unsigned char *)&addr;
+ recv.addr_len = sizeof(addr);
+ recv.msg.data = rsp.data;
+ recv.msg.data_len = sizeof(rsp.data);
+
+ /* get data */
+ if (ioctl(intf->fd, IPMICTL_RECEIVE_MSG_TRUNC, &recv) < 0) {
+ lperror(LOG_ERR, "Error receiving message");
+ if (errno != EMSGSIZE) {
+ free_n(&data);
+ return NULL;
+ }
+ }
+
+ /* If the message received wasn't expected, try to grab the
+ * next message until it's out of messages. -EAGAIN is
+ * returned if the list empty, but basically if it returns a
+ * message, check if it's alright.
+ */
+ if (_req.msgid != recv.msgid) {
+ lprintf(LOG_NOTICE,
+ "Received a response with unexpected ID %ld vs. %ld",
+ recv.msgid, _req.msgid);
+ }
+ } while (_req.msgid != recv.msgid);
if (verbose > 4) {
- fprintf(stderr, "Got message:");
- fprintf(stderr, " type = %d\n", recv.recv_type);
- fprintf(stderr, " channel = 0x%x\n", addr.channel);
- fprintf(stderr, " msgid = %ld\n", recv.msgid);
- fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn);
- fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
- if (recv.msg.data && recv.msg.data_len) {
- fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(recv.msg.data, recv.msg.data_len));
- }
+ fprintf(stderr, "Got message:");
+ fprintf(stderr, " type = %d\n", recv.recv_type);
+ fprintf(stderr, " channel = 0x%x\n", addr.channel);
+ fprintf(stderr, " msgid = %ld\n", recv.msgid);
+ fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn);
+ fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
+ if (recv.msg.data && recv.msg.data_len) {
+ fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(recv.msg.data, recv.msg.data_len));
+ }
}
- if(intf->transit_addr != 0 && intf->transit_addr != intf->my_addr) {
- /* ipmb_addr.transit_slave_addr = intf->transit_addr; */
- lprintf(LOG_DEBUG, "Decapsulating data received from transit "
- "IPMB target @ 0x%x", intf->transit_addr);
-
- /* comp code */
- /* Check data */
-
- if( recv.msg.data[0] == 0 ) {
- recv.msg.netfn = recv.msg.data[2] >> 2;
- recv.msg.cmd = recv.msg.data[6];
-
- recv.msg.data = memmove(recv.msg.data ,recv.msg.data+7 , recv.msg.data_len - 7);
- recv.msg.data_len -=8;
-
- if (verbose > 4) {
- fprintf(stderr, "Decapsulated message:\n");
- fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn );
- fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
- if (recv.msg.data && recv.msg.data_len) {
- fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(recv.msg.data,recv.msg.data_len));
- }
- }
- }
+ if (intf->transit_addr != 0 && intf->transit_addr != intf->my_addr) {
+ /* ipmb_addr.transit_slave_addr = intf->transit_addr; */
+ lprintf(LOG_DEBUG,
+ "Decapsulating data received from transit "
+ "IPMB target @ 0x%x",
+ intf->transit_addr);
+
+ /* comp code */
+ /* Check data */
+
+ if (recv.msg.data[0] == 0) {
+ recv.msg.netfn = recv.msg.data[2] >> 2;
+ recv.msg.cmd = recv.msg.data[6];
+
+ recv.msg.data = memmove(recv.msg.data, recv.msg.data + 7,
+ recv.msg.data_len - 7);
+ recv.msg.data_len -= 8;
+
+ if (verbose > 4) {
+ fprintf(stderr, "Decapsulated message:\n");
+ fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn);
+ fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
+ if (recv.msg.data && recv.msg.data_len) {
+ fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(recv.msg.data, recv.msg.data_len));
+ }
+ }
+ }
}
/* save completion code */
@@ -424,20 +430,18 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
rsp.data_len = recv.msg.data_len - 1;
/* save response data for caller */
- if (rsp.ccode == 0 && rsp.data_len > 0) {
- memmove(rsp.data, rsp.data + 1, rsp.data_len);
- rsp.data[rsp.data_len] = 0;
+ if (!rsp.ccode && rsp.data_len > 0) {
+ memmove(rsp.data, rsp.data + 1, rsp.data_len);
+ rsp.data[rsp.data_len] = 0;
}
- if (data != NULL) {
- free(data);
- data = NULL;
- }
+ free_n(&data);
return &rsp;
}
-int ipmi_openipmi_setup(struct ipmi_intf * intf)
+int
+ipmi_openipmi_setup(struct ipmi_intf *intf)
{
/* set default payload size */
intf->max_request_data_size = IPMI_OPENIPMI_MAX_RQ_DATA_SIZE;
diff --git a/src/plugins/open/open.h b/src/plugins/open/open.h
index 5d7aa5b..aab3085 100644
--- a/src/plugins/open/open.h
+++ b/src/plugins/open/open.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_OPENIPMI_H
-#define IPMI_OPENIPMI_H
+#pragma once
#define IPMI_MAX_ADDR_SIZE 0x20
#define IPMI_BMC_CHANNEL 0xf
@@ -102,5 +101,3 @@ struct ipmi_ipmb_addr {
#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
#define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
-
-#endif /*IPMI_OPENIPMI_H*/
diff --git a/src/plugins/serial/Makefile.in b/src/plugins/serial/Makefile.in
deleted file mode 100644
index aa03dd8..0000000
--- a/src/plugins/serial/Makefile.in
+++ /dev/null
@@ -1,638 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# * Copyright (c) 2012 Pigeon Point Systems. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistribution of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistribution in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# Neither the name of Pigeon Point Systems, Inc. or the names of
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# This software is provided "AS IS," without a warranty of any kind.
-# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
-# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
-# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
-# PIGEON POINT SYSTEMS ("PPS") AND ITS LICENSORS SHALL NOT BE LIABLE
-# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
-# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
-# PPS OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
-# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
-# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
-# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
-# EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/serial
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_serial_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_serial_la_OBJECTS = serial_terminal.lo serial_basic.lo
-libintf_serial_la_OBJECTS = $(am_libintf_serial_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_serial_la_SOURCES)
-DIST_SOURCES = $(libintf_serial_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_serial.la
-noinst_LTLIBRARIES = @INTF_SERIAL_LIB@
-libintf_serial_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_serial_la_SOURCES = serial_terminal.c serial_basic.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/serial/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/serial/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_serial.la: $(libintf_serial_la_OBJECTS) $(libintf_serial_la_DEPENDENCIES) $(EXTRA_libintf_serial_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_serial_la_OBJECTS) $(libintf_serial_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serial_basic.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serial_terminal.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/serial/serial_basic.c b/src/plugins/serial/serial_basic.c
index e3322c1..e134c9c 100644
--- a/src/plugins/serial/serial_basic.c
+++ b/src/plugins/serial/serial_basic.c
@@ -29,11 +29,12 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _GNU_SOURCE 1
/* Serial Interface, Basic Mode plugin. */
+#if defined HAVE_ALLOCA_H
#include <alloca.h>
+#endif
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
@@ -79,7 +80,7 @@ struct ipmb_msg_hdr {
unsigned char rqSA;
unsigned char rqSeq; /* RQ SEQ | RQ LUN */
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -101,7 +102,7 @@ struct ipmi_get_message_rp {
unsigned char rsSA;
unsigned char rqSeq;
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -128,7 +129,7 @@ struct serial_bm_parse_ctx{
* Receiving context
*/
struct serial_bm_recv_ctx {
- char buffer[SERIAL_BM_MAX_BUFFER_SIZE];
+ uint8_t buffer[SERIAL_BM_MAX_BUFFER_SIZE];
size_t buffer_size;
size_t max_buffer_size;
};
@@ -240,12 +241,12 @@ serial_bm_open(struct ipmi_intf * intf)
return -1;
}
- for (i = 0; i < sizeof(rates) / sizeof(rates[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(rates); i++) {
if (rates[i].baudrate == rate) {
break;
}
}
- if (i >= sizeof(rates) / sizeof(rates[0])) {
+ if (i >= ARRAY_SIZE(rates)) {
lprintf(LOG_ERR, "Unsupported baud rate %i specified", rate);
return -1;
}
@@ -611,18 +612,7 @@ serial_bm_build_msg(const struct ipmi_intf * intf,
uint8_t * data = msg, seq;
struct ipmb_msg_hdr * hdr = (struct ipmb_msg_hdr *) msg;
struct ipmi_send_message_rq * inner_rq = NULL, * outer_rq = NULL;
- int bridging_level;
-
- /* acquire bridging level */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
- if (intf->transit_addr != 0) {
- bridging_level = 2;
- } else {
- bridging_level = 1;
- }
- } else {
- bridging_level = 0;
- }
+ int bridging_level = ipmi_intf_get_bridging_level(intf);
/* check overall packet length */
if(req->msg.data_len + 7 + bridging_level * 8 > max_len) {
@@ -654,7 +644,7 @@ serial_bm_build_msg(const struct ipmi_intf * intf,
/* inner send message request is further */
inner_rq = (outer_rq + 1);
} else {
- /* there is only outer send message reuest */
+ /* there is only outer send message request */
inner_rq = outer_rq;
}
@@ -815,12 +805,14 @@ serial_bm_wait_response(struct ipmi_intf * intf,
/*
* Get message from receive message queue
+ *
+ * Note: kept max_len in case later use.
*/
static int
serial_bm_get_message(struct ipmi_intf * intf,
struct serial_bm_request_ctx * req_ctx,
struct serial_bm_recv_ctx * read_ctx,
- uint8_t * msg, size_t max_len)
+ uint8_t * msg, size_t __UNUSED__(max_len))
{
uint8_t data[SERIAL_BM_MAX_MSG_SIZE];
struct serial_bm_request_ctx tmp_ctx;
diff --git a/src/plugins/serial/serial_terminal.c b/src/plugins/serial/serial_terminal.c
index cd33422..58bca17 100644
--- a/src/plugins/serial/serial_terminal.c
+++ b/src/plugins/serial/serial_terminal.c
@@ -29,11 +29,12 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _GNU_SOURCE 1
/* Serial Interface, Terminal Mode plugin. */
+#if defined HAVE_ALLOCA_H
#include <alloca.h>
+#endif
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
@@ -77,7 +78,7 @@ struct ipmb_msg_hdr {
unsigned char rqSA;
unsigned char rqSeq; /* RQ SEQ | RQ LUN */
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -99,7 +100,7 @@ struct ipmi_get_message_rp {
unsigned char rsSA;
unsigned char rqSeq;
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -148,7 +149,7 @@ ipmi_serial_term_open(struct ipmi_intf * intf)
struct termios ti;
unsigned int rate = 9600;
char *p;
- int i;
+ size_t i;
if (!intf->devfile) {
lprintf(LOG_ERR, "Serial device is not specified");
@@ -187,12 +188,12 @@ ipmi_serial_term_open(struct ipmi_intf * intf)
return -1;
}
- for (i = 0; i < sizeof(rates) / sizeof(rates[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(rates); i++) {
if (rates[i].baudrate == rate) {
break;
}
}
- if (i >= sizeof(rates) / sizeof(rates[0])) {
+ if (i >= ARRAY_SIZE(rates)) {
lprintf(LOG_ERR, "Unsupported baud rate %i specified", rate);
return -1;
}
@@ -352,7 +353,7 @@ serial_flush(struct ipmi_intf * intf)
/*
* Receive IPMI response from the device
* Len: buffer size
- * Returns: -1 or response lenth on success
+ * Returns: -1 or response length on success
*/
static int
recv_response(struct ipmi_intf * intf, unsigned char *data, int len)
@@ -371,8 +372,9 @@ recv_response(struct ipmi_intf * intf, unsigned char *data, int len)
}
p += rv;
resp_len += rv;
- if (*(p - 2) == ']' && (*(p - 1) == '\n' || *(p - 1) == '\r')) {
- *p = 0;
+ if (resp_len >= 2 && *(p - 2) == ']'
+ && (*(p - 1) == '\n' || *(p - 1) == '\r')) {
+ *(p - 1) = 0; /* overwrite EOL */
break;
}
}
@@ -392,7 +394,7 @@ recv_response(struct ipmi_intf * intf, unsigned char *data, int len)
*pp = 0;
/* was it an error? */
- if (strncmp(p, "ERR ", 4) == 0) {
+ if (!strcmp(p, "ERR ")) {
serial_write_line(intf, "\r\r\r\r");
sleep(1);
serial_flush(intf);
@@ -471,18 +473,7 @@ serial_term_build_msg(const struct ipmi_intf * intf,
struct serial_term_hdr * term_hdr = (struct serial_term_hdr *) msg;
struct ipmi_send_message_rq * outer_rq = NULL;
struct ipmi_send_message_rq * inner_rq = NULL;
- int bridging_level;
-
- /* acquire bridging level */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
- if (intf->transit_addr != 0) {
- bridging_level = 2;
- } else {
- bridging_level = 1;
- }
- } else {
- bridging_level = 0;
- }
+ int bridging_level = ipmi_intf_get_bridging_level(intf);
/* check overall packet length */
if(req->msg.data_len + 3 + bridging_level * 8 > max_len) {
@@ -633,7 +624,7 @@ serial_term_send_msg(struct ipmi_intf * intf, uint8_t * msg, int msg_len)
/* body */
for (i = 0; i < msg_len; i++) {
- buf += sprintf( buf, "%02x", msg[i]);
+ buf += sprintf((char*) buf, "%02x", msg[i]);
}
/* stop character */
@@ -712,11 +703,13 @@ serial_term_wait_response(struct ipmi_intf * intf,
/*
* Get message from receive message queue
+ *
+ * Note: Kept max_len in case it's useful later.
*/
static int
serial_term_get_message(struct ipmi_intf * intf,
struct serial_term_request_ctx * req_ctx,
- uint8_t * msg, size_t max_len)
+ uint8_t * msg, size_t __UNUSED__(max_len))
{
uint8_t data[IPMI_SERIAL_MAX_RESPONSE];
struct serial_term_request_ctx tmp_ctx;
diff --git a/src/plugins/usb/Makefile.in b/src/plugins/usb/Makefile.in
deleted file mode 100644
index c3cfc41..0000000
--- a/src/plugins/usb/Makefile.in
+++ /dev/null
@@ -1,637 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = src/plugins/usb
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_usb_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_usb_la_OBJECTS = usb.lo
-libintf_usb_la_OBJECTS = $(am_libintf_usb_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_usb_la_SOURCES)
-DIST_SOURCES = $(libintf_usb_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ARCH = @ARCH@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BASEDIR = @BASEDIR@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTRO = @DISTRO@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTF_BMC = @INTF_BMC@
-INTF_BMC_LIB = @INTF_BMC_LIB@
-INTF_DUMMY = @INTF_DUMMY@
-INTF_DUMMY_LIB = @INTF_DUMMY_LIB@
-INTF_FREE = @INTF_FREE@
-INTF_FREE_LIB = @INTF_FREE_LIB@
-INTF_IMB = @INTF_IMB@
-INTF_IMB_LIB = @INTF_IMB_LIB@
-INTF_LAN = @INTF_LAN@
-INTF_LANPLUS = @INTF_LANPLUS@
-INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@
-INTF_LAN_LIB = @INTF_LAN_LIB@
-INTF_LIPMI = @INTF_LIPMI@
-INTF_LIPMI_LIB = @INTF_LIPMI_LIB@
-INTF_OPEN = @INTF_OPEN@
-INTF_OPEN_LIB = @INTF_OPEN_LIB@
-INTF_SERIAL = @INTF_SERIAL@
-INTF_SERIAL_LIB = @INTF_SERIAL_LIB@
-INTF_USB = @INTF_USB@
-INTF_USB_LIB = @INTF_USB_LIB@
-IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OS = @OS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POW_LIB = @POW_LIB@
-PSTAMP = @PSTAMP@
-RANLIB = @RANLIB@
-RPMBUILD = @RPMBUILD@
-RPM_RELEASE = @RPM_RELEASE@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_configure_args = @ac_configure_args@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_usb.la
-noinst_LTLIBRARIES = @INTF_USB_LIB@
-libintf_usb_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_usb_la_SOURCES = usb.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/usb/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/usb/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_usb.la: $(libintf_usb_la_OBJECTS) $(libintf_usb_la_DEPENDENCIES) $(EXTRA_libintf_usb_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_usb_la_OBJECTS) $(libintf_usb_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
- #
- # Copyright (c) 2015 American Megatrends, Inc.
- # All rights reserved.
- #
- # Redistribution and use in source and binary forms, with or without
- # modification,are permitted provided that the following conditions are met:
- #
- # 1. Redistributions of source code must retain the above copyright notice,
- # this list of conditions and the following disclaimer.
- #
- # 2. Redistributions in binary form must reproduce the above copyright notice,
- # this list of conditions and the following disclaimer in the documentation
- # and/or other materials provided with the distribution.
- #
- # 3. Neither the name of the copyright holder nor the names of its contributors
- # may be used to endorse or promote products derived from this software
- # without specific prior written permission.
- #
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- # AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- # POSSIBILITY OF SUCH DAMAGE.
- #
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/plugins/usb/usb.c b/src/plugins/usb/usb.c
index 0049400..d6dced3 100644
--- a/src/plugins/usb/usb.c
+++ b/src/plugins/usb/usb.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#define _BSD_SOURCE
-
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
#include <ipmitool/bswap.h>
@@ -123,19 +121,19 @@ scsiProbeNew(int *num_ami_devices, int *sg_nos)
FILE *fp;
fp = fopen("/proc/scsi/sg/device_strs", "r");
- if (fp == NULL) {
+ if (!fp) {
/* Return 1 on error */
return 1;
}
while (1) {
/* Read line by line and search for "AMI" */
- if (fgets(linebuf, 80, fp) == NULL) {
+ if (!fgets(linebuf, 80, fp)) {
break;
}
if (sscanf(linebuf, "%s", vendor) == 1) {
- if (strncmp(vendor, "AMI", strlen("AMI")) == 0) {
+ if (!strcmp(vendor, "AMI")) {
numdevfound++;
sg_nos[numdevfound - 1] = lineno;
if (numdevfound == inplen) {
@@ -147,7 +145,7 @@ scsiProbeNew(int *num_ami_devices, int *sg_nos)
}
*num_ami_devices = numdevfound;
- if (fp != NULL) {
+ if (fp) {
fclose(fp);
fp = NULL;
}
@@ -251,7 +249,7 @@ IsG2Drive(int cd_desc)
return 1;
}
- if (strncmp(szSignature, "$$$AMI$$$", strlen("$$$AMI$$$")) != 0) {
+ if (strcmp(szSignature, "$$$AMI$$$")) {
lprintf(LOG_ERR,
"IsG2Drive:Signature mismatch when ID command sent");
return 1;
@@ -605,7 +603,7 @@ ipmi_usb_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
rsp.ccode = rsp.data[0];
/* Save response data for caller */
- if ((rsp.ccode == 0) && (rsp.data_len > 0)) {
+ if (!rsp.ccode && rsp.data_len > 0) {
memmove(rsp.data, rsp.data + 1, rsp.data_len - 1);
rsp.data[rsp.data_len] = 0;
rsp.data_len -= 1;