我正在尝试在我的Mac机器上安装Gammu。我已经安装了cmake和Apple开发人员命令行工具。
当我运行./configure
时,我得到以下信息:
Avi-MacBook-Pro:gammu-1.32.0 avi$ ./configure
Wrapper script for configuring CMake for Gammu.
This provides limited compatibility with configure, if you want full
configuration control, use directly CMake. More information about CMake
is available at <http://www.cmake.org>.
-- Configuring Gammu 1.32.0
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Could NOT find Threads (missing: Threads_FOUND)
-- MySQL not found.
-- Found PostgreSQL: /usr/include, /usr/lib/libpq.dylib
-- libdbi not found.
-- Could NOT find Libintl (missing: LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND)
-- glib-2.0 not found.
-- gobject-2.0 not found.
-- Bluez not found.
-- Using OSX Bluetooth stack
-- Bluetooth support enabled
-- libusb-1.0 not found.
-- Nokia support enabled
-- Nokia MBUS2 protocol enabled
-- Nokia FBUS2 protocol enabled
-- Nokia FBUS2DLR3 protocol enabled
-- Nokia DKU2PHONET protocol enabled
-- Nokia DKU2AT protocol enabled
-- Nokia DKU5FBUS2 protocol enabled
-- Nokia FBUS2PL2303 protocol enabled
-- Nokia FBUS2BLUE protocol enabled
-- Nokia PHONETBLUE protocol enabled
-- Nokia BLUEFBUS2 protocol enabled
-- Nokia BLUEPHONET protocol enabled
-- Nokia 3320 and compatible phones support enabled
-- Nokia 650 and compatible phones support enabled
-- Nokia 61xx and compatible phones support enabled
-- Nokia 6510 and compatible phones support enabled
-- Force using 6210 frames for calendar for DCT4 phones disabled
-- Nokia 7110 and compatible phones support enabled
-- Nokia 9210 and compatible phones support enabled
-- Nokia 3650 and compatible phones support enabled
-- AT support enabled
-- AT protocol enabled
-- AT protocol over Bluetooth enabled
-- AT phones support enabled
-- Alcatel support enabled
-- Alcatel protocol enabled
-- Alcatel phones support enabled
-- OBEX compatible phones support enabled
-- OBEX protocol over Bluetooth enabled
-- Generic OBEX phones support enabled
-- AT with OBEX phones support enabled
-- Symbian phones support (S60) enabled
-- Symbian phones support (gnapplet) enabled
-- GNAPBUS protocol over Bluetooth enabled
-- Gnapplet phones support enabled
-- S60 phones support enabled
-- Cell Broadcast messages support enabled
-- Backup/Restore functions enabled
/var/lock is not writable, skipping locking tests!
-- Init script not being installed, install it by -DINSTALL_LSB_INIT=ON
-- Udev rules not being installed, install it by -DINSTALL_UDEV_RULES=ON
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/avi/Desktop/gam/gammu-1.32.0/build-configure
当我运行make
时,我得到错误:
Avi-MacBook-Pro:gammu-1.32.0 avi$ make
make -C build-configure
[ 1%] Building C object helper/CMakeFiles/string.dir/string.o
In file included from /Users/avi/Desktop/gam/gammu-1.32.0/helper/string.c:1:
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:14:10: error: 'string.h'
file not found with <angled> include; use "quotes" instead
#include <string.h>
^~~~~~~~~~
"string.h"
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:39:57: error: unknown type
name 'size_t'
extern int strncasecmp (const char *s1, const char *s2, size_t n);
^
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:58:1: error: unknown type
name 'wchar_t'
wchar_t towlower (wchar_t c);
^
/Users/avi/Desktop/gam/gammu-1.32.0/helper/string.h:58:22: error: unknown type
name 'wchar_t'
wchar_t towlower (wchar_t c);
^
In file included from /Users/avi/Desktop/gam/gammu-1.32.0/helper/string.c:3:
/Users/avi/Desktop/gam/gammu-1.32.0/build-configure/helper/../include/gammu-unicode.h:18:10: fatal error:
'wchar.h' file not found
#include <wchar.h>
^
5 errors generated.
make[3]: *** [helper/CMakeFiles/string.dir/string.o] Error 1
make[2]: *** [helper/CMakeFiles/string.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
您的问题与 CMake 无关。C 编译器找不到 C 标准中定义的某些标头。这很奇怪,可能与Gammu无关。
你能检查一下你是否可以编译一个简单的hello word C测试程序,其中包括?如果失败,则必须修复编译器。
缺少很多文件,你必须得到几个丢失的文件,特别是当你为服务器使用 MAMP 时。这就是我成功在Mac上安装gammu的方式
要在 Mac OS X 上安装 gammu,您需要:Mac OS X 10.8.4,Xcode 4.6.3,来自 mysql.com 的MAMP 2.1.4和Mysql(用于头文件和库文件)伽姆 1.33.0,Cmake 2.8.11.2 并使用 Homebrew 包管理器安装它。
使用命令行工具安装 xcode安装 MAMP
要安装自制软件:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
然后,您可以使用以下命令安装 cmake:
$ brew install cmake
下载伽姆
http://sourceforge.net/projects/gammu/files/gammu/1.33.0/gammu-1.33.0.tar.gz
解压缩它并放入您的主文件夹
$ ./configure
$ make
使用 MAMP 时:
MAMP没有必要的头文件和库文件,因此要获取它们,只需从中选择64位osx 10.8 mysql.com 安装mysql
从源安装或包含它们的二进制安装(Mountain Lion 的股票 MySQL 二进制文件包括这些)从/usr/local/mysql/include 复制到/Applications/MAMP/Library/include。
要访问/usr/local,您可以在 Safari 中键入/usr/local/mysql/lib/libmysqlclient_r.dylib 并单击 Enter,您将在 Finder 中被定向到该文件。
$ /bin/ls -1 /usr/local/mysql/lib/libmysqlclient* | xargs -t -n1 -I% ln -fs % /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient.18.dylib /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient.a /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient.dylib /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient_r.18.dylib /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient_r.a /Applications/MAMP/Library/lib/
ln -fs /usr/local/mysql/lib/libmysqlclient_r.dylib /Applications/MAMP/Library/lib/
现在,让我们编译支持 mysql 的 gammu,像往常一样提取 gammu,编辑 cmake/FindMySQL.cmake,添加你的 MAMP mysql 路径,它应该看起来像这样:
find_program(MYSQL_CONFIG mysql_config
${MYSQL_CONFIG_PREFER_PATH}
/usr/local/bin/
/usr/bin/
/Applications/MAMP/Library/bin
/Applications/MAMP/Library
)
然后,让我们配置 cmake:
$ mkdir build
$ cd build
$ cmake -DMYSQL_LIBRARIES=/Applications/MAMP/Library/lib/libmysqlclient_r.dylib ..
$ make
$ sudo make install
我希望这能帮助您安装 gammu。