我在XP平臺上編譯了一些PHP擴展庫(使用C/C++)。我現在已經將源代碼移到我的Ubuntu盒子中,並且想要構建在我的Linux機器上使用的庫。在Ubuntu上編譯PHP擴展庫(Karmic Koala)
不過,我來翻過了一些障礙:
- 我不能找到phpize
- 我找不到ext_skel生成骨架腳本/文件(即使安裝php5dev包後)
[編輯]
感謝帕斯卡·馬丁和this question,我有馬用來建立和測試我的一個小型圖書館。我只想仔細檢查我的.m4文件的內容(因爲我對格式不熟悉),然後繼續處理其他庫。
這是自動生成的.m4文件的內容 - 任何熟悉格式的人都可以解釋它的含義 - 這樣我可以更加確定我已經取消註釋了文件的正確部分。
的的config.m4文件的內容顯示在下面的所有血腥的細節:
dnl $Id$
dnl config.m4 for extension tanlib
dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.
dnl If your extension references something external, use with:
dnl PHP_ARG_WITH(tanlib, for tanlib support,
dnl Make sure that the comment is aligned:
dnl [ --with-tanlib Include tanlib support])
dnl Otherwise use enable:
PHP_ARG_ENABLE(tanlib, whether to enable tanlib support,
dnl Make sure that the comment is aligned:
[ --enable-tanlib Enable tanlib support])
if test "$PHP_TANLIB" != "no"; then
dnl Write more examples of tests here...
dnl # --with-tanlib -> check with-path
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
dnl SEARCH_FOR="/include/tanlib.h" # you most likely want to change this
dnl if test -r $PHP_TANLIB/$SEARCH_FOR; then # path given as parameter
dnl TANLIB_DIR=$PHP_TANLIB
dnl else # search default path list
dnl AC_MSG_CHECKING([for tanlib files in default path])
dnl for i in $SEARCH_PATH ; do
dnl if test -r $i/$SEARCH_FOR; then
dnl TANLIB_DIR=$i
dnl AC_MSG_RESULT(found in $i)
dnl fi
dnl done
dnl fi
dnl
dnl if test -z "$TANLIB_DIR"; then
dnl AC_MSG_RESULT([not found])
dnl AC_MSG_ERROR([Please reinstall the tanlib distribution])
dnl fi
dnl # --with-tanlib -> add include path
dnl PHP_ADD_INCLUDE($TANLIB_DIR/include)
dnl # --with-tanlib -> check for lib and symbol presence
dnl LIBNAME=tanlib # you may want to change this
dnl LIBSYMBOL=tanlib # you most likely want to change this
dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
dnl [
dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $TANLIB_DIR/lib, TANLIB_SHARED_LIBADD)
AC_DEFINE(HAVE_TANLIBLIB,1,[ Whether you have tanlib])
dnl ],[
dnl AC_MSG_ERROR([wrong tanlib lib version or lib not found])
dnl ],[
dnl -L$TANLIB_DIR/lib -lm -ldl
dnl ])
dnl
dnl PHP_SUBST(TANLIB_SHARED_LIBADD)
PHP_NEW_EXTENSION(tanlib, tanlib.c, $ext_shared)
fi
有誰神交以上? 。
BTW,使用的Autoconf 2.50生成以上的config.m4文件(我也剛剛看到的文檔here和我慢慢消化它
你有沒有安裝php devel軟件包? – Neel