Reference - https://developer.gnome.org/glib/stable/glib-building.html
1. Downloading glib code.
http://ftp.gnome.org/pub/gnome/sources/glib/
2. Extract the archive and run ./configure
sanchoui-MacBook-Air:glib-2.39.2 sancho$ ./configure
....
configure: error: in `/Users/sancho/Downloads/glib-2.39.2':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
There is no pkg-config.. we need to find and install it.
2-1. Download pkg-config code and install
http://www.freedesktop.org/wiki/Software/pkg-config/
http://pkgconfig.freedesktop.org/releases/
sanchoui-MacBook-Air:pkg-config-0.28 sancho$ ./configure
...
checking for GLIB... no
configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy.
shit.. we should use the glib in pkg-config source internally to build it.
sanchoui-MacBook-Air:pkg-config-0.28 sancho$ ./configure --with-internal-glib
sanchoui-MacBook-Air:pkg-config-0.28 sancho$ make
sanchoui-MacBook-Air:pkg-config-0.28 sancho$ sudo make install
sanchoui-MacBook-Air:pkg-config-0.28 sancho$ pkg-config
Must specify package names on the command line
success.. let's retry ./configure in glib source directory.
sanchoui-MacBook-Air:glib-2.39.2 sancho$ ./configure
...
checking for LIBFFI... no
configure: error: Package requirements (libffi >= 3.0.0) were not met:
No package 'libffi' found
2-2. Download libffi code and install
sanchoui-MacBook-Air:libffi-3.0.13 sancho$ ./configure
sanchoui-MacBook-Air:libffi-3.0.13 sancho$ make
sanchoui-MacBook-Air:libffi-3.0.13 sancho$ sudo make install
success without any exception! let's retry again ./configure in glib source directory..
sanchoui-MacBook-Air:glib-2.39.2 sancho$ ./configure
...
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
sanchoui-MacBook-Air:gettext-0.18.3.1 sancho$ ./configure
sanchoui-MacBook-Air:gettext-0.18.3.1 sancho$ make
sanchoui-MacBook-Air:gettext-0.18.3.1 sancho$ sudo make install
Good. Fortunately, success without any error. If it is, I would stop this fucking build!
Let's retry again ./configure in glib source directory :)
sanchoui-MacBook-Air:glib-2.39.2 sancho$ ./configure
...
checking for libintl.h... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
fuck!!!! I installed it!!!!! hmm.. what's the problem? Once, I checked the location of libintl.h
sanchoui-MacBook-Air:glib-2.39.2 sancho$ find /usr -name "libintl.h"
/usr/local/include/libintl.h
find: /usr/sbin/authserver: Permission denied
It is in /usr/local/include. Once, I checked the config.log and found the problem like below.
639 configure:7963: checking libintl.h usability
640 configure:7963: gcc -c -g -O2 conftest.c >&5
641 conftest.c:66:10: fatal error: 'libintl.h' file not found
642 #include <libintl.h>
643 ^
644 1 error generated.
645 configure:7963: $? = 1
sanchoui-MacBook-Air:gettext-0.18.3.1 sancho$ ./configure --prefix=/usr
sanchoui-MacBook-Air:gettext-0.18.3.1 sancho$ make
sanchoui-MacBook-Air:gettext-0.18.3.1 sancho$ sudo make install
sanchoui-MacBook-Air:gettext-0.18.3.1 sancho$ ls -al /usr/include/libintl.h
-rw-r--r-- 1 root wheel 16654 12 31 22:34 /usr/include/libintl.h
Ok, let's retry ./configure again in glib source directory.
sanchoui-MacBook-Air:glib-2.39.2 sancho$ ./configure
...
checking for libintl.h... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
failed...... :( what's the problem? default include path?
I set the default include path like below and retry configure.
sanchoui-MacBook-Air:Downloads sancho$ declare -x C_INCLUDE_PATH="/usr/include/"
sanchoui-MacBook-Air:glib-2.39.2 sancho$ ./configure
...
checking for libintl.h... yes
checking for ngettext in libc... no
checking for bindtextdomain in -lintl... no
checking if -liconv is needed to use gettext...
checking for ngettext in -lintl... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
fortunately, it found the libintl.h but there is library dependency problem.
libiconv may be required to link gettext. This problem was already mentioned in glib manual page.
2-4. Download iconv and install it.
http://www.gnu.org/software/libiconv/
sanchoui-MacBook-Air:libiconv-1.14 sancho$ ./configure --prefix=/usr
sanchoui-MacBook-Air:libiconv-1.14 sancho$ make
sanchoui-MacBook-Air:libiconv-1.14 sancho$ make install
retry configure in glib directory.
sanchoui-MacBook-Air:glib-2.39.2 sancho$ ./configure --prefix=/usr
...
checking for LIBFFI... no
configure: error: in `/Users/sancho/Downloads/glib-2.39.2':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
But......
libcups2 could not find a symbol in iconv, so pkg-config was not be operated!!!
Furthermore, some applications were not be launched normally also..
I guessed that the version of iconv just installed is improper with libcups2 in my macbook..
I rebooted my macbook and checked it could not be booted also. :(
Eventually I initialized again my macbook. shit.
'Code' 카테고리의 다른 글
dbus - 2 (0) | 2014.01.23 |
---|---|
dbus - 1 (0) | 2014.01.15 |
Homebrew 설치기 - 2 (0) | 2014.01.03 |
Homebrew 설치기 - 1 (0) | 2014.01.02 |
bash shell script #1 (0) | 2013.12.01 |