8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHPをソースからコンパイルした際に前回のconfigureのオプションを調べる方法

Last updated at Posted at 2012-05-11

PHPをソースからインストールしていて、バージョンアップのときに「あれ?前回コンパイルした際のオプションなんだったっけ?」って時には、ソースディレクトリ内にあるconfig.niceまたはconfig.statusを見れば、前回configure時に指定したオプションが記録されています。

config.nice
#! /bin/sh
#
# Created by configure

LDFLAGS='-lstdc++' \
'./configure' \
'--with-apxs2=/usr/sbin/apxs' \
'--enable-mbstring' \
'--enable-zend-multibyte' \
'--without-mysql' \
'--with-ldap' \
'--with-openssl' \
'--with-curl' \
'--enable-sockets' \
"$@"

config.statusの場合は、ファイルの最初の方に書かれています。紛れているので取り出して加工が必要ですが。

config.status
ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
for ac_option
do
  case "$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running ${CONFIG_SHELL-/bin/sh} ./configure  --with-apxs2=/usr/sbin/apxs --enable-mbstring --enable-zend-multibyte --with-ldap --with-openssl --with-curl --enable-sockets --no-create --no-recursion"
    exec ${CONFIG_SHELL-/bin/sh} ./configure  --with-apxs2=/usr/sbin/apxs --enable-mbstring --enable-zend-multibyte --with-ldap --with-openssl --with-curl --enable-sockets --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "./config.status generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "$ac_cs_usage"; exit 0 ;;
  *) echo "$ac_cs_usage"; exit 1 ;;
  esac
done
8
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?