Guest User

script capture of building Zakay/geoip php extension

a guest
Sep 18th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.46 KB | None | 0 0
  1. Script started on Sun Sep 18 22:56:27 2011
  2. bash-3.2$ pwd
  3. /Users/tamara/Projects/ZakayGeoIP-PECL
  4. bash-3.2$ make clean
  5. find . -name \*.gcno -o -name \*.gcda | xargs rm -f
  6. find . -name \*.lo -o -name \*.o | xargs rm -f
  7. find . -name \*.la -o -name \*.a | xargs rm -f
  8. find . -name \*.so | xargs rm -f
  9. find . -name .libs -a -type d|xargs rm -rf
  10. rm -f libphp.la modules/* libs/*
  11. bash-3.2$ ./configure --prefix=/usr/local --with-php-config=/usr/local/bin/php-config --with-geoip
  12. checking for grep that handles long lines and -e... /usr/bin/grep
  13. checking for egrep... /usr/bin/grep -E
  14. checking for a sed that does not truncate output... /usr/bin/sed
  15. checking for cc... cc
  16. checking for C compiler default output file name... a.out
  17. checking whether the C compiler works... yes
  18. checking whether we are cross compiling... no
  19. checking for suffix of executables...
  20. checking for suffix of object files... o
  21. checking whether we are using the GNU C compiler... yes
  22. checking whether cc accepts -g... yes
  23. checking for cc option to accept ISO C89... none needed
  24. checking how to run the C preprocessor... cc -E
  25. checking for icc... no
  26. checking for suncc... no
  27. checking whether cc understands -c and -o together... yes
  28. checking for system library directory... lib
  29. checking if compiler supports -R... no
  30. checking if compiler supports -Wl,-rpath,... yes
  31. checking build system type... i386-apple-darwin9.8.0
  32. checking host system type... i386-apple-darwin9.8.0
  33. checking target system type... i386-apple-darwin9.8.0
  34. checking for PHP prefix... /usr/local
  35. checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
  36. checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20090626
  37. checking for PHP installed headers prefix... /usr/local/include/php
  38. checking if debug is enabled... rm: conftest.dSYM: is a directory
  39. no
  40. checking if zts is enabled... rm: conftest.dSYM: is a directory
  41. no
  42. checking for re2c... no
  43. configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
  44. checking for gawk... no
  45. checking for nawk... no
  46. checking for awk... awk
  47. checking if awk is broken... no
  48. checking for geoip support... yes, shared
  49. checking for geoip files in default path... found in /usr/local
  50. found in /opt/local
  51. checking for GeoIP_open in -lGeoIP... yes
  52. checking for GeoIP_setup_custom_directory in -lGeoIP... yes
  53. checking for GeoIP_set_charset in -lGeoIP... yes
  54. checking for GeoIP_continent_by_id in -lGeoIP... yes
  55. checking for LGPL compatible GeoIP libs... expr: non-numeric argument
  56. cannot detect
  57. checking library features to determine version (not acurate)... found 1004005
  58. checking for ld used by cc... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
  59. checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
  60. checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r
  61. checking for BSD-compatible nm... /usr/bin/nm -p
  62. checking whether ln -s works... yes
  63. checking how to recognize dependent libraries... pass_all
  64. checking for ANSI C header files... rm: conftest.dSYM: is a directory
  65. rm: conftest.dSYM: is a directory
  66. yes
  67. checking for sys/types.h... yes
  68. checking for sys/stat.h... yes
  69. checking for stdlib.h... yes
  70. checking for string.h... yes
  71. checking for memory.h... yes
  72. checking for strings.h... yes
  73. checking for inttypes.h... yes
  74. checking for stdint.h... yes
  75. checking for unistd.h... yes
  76. checking dlfcn.h usability... yes
  77. checking dlfcn.h presence... yes
  78. checking for dlfcn.h... yes
  79. checking the maximum length of command line arguments... 196608
  80. checking command to parse /usr/bin/nm -p output from cc object... rm: conftest.dSYM: is a directory
  81. ok
  82. checking for objdir... .libs
  83. checking for ar... ar
  84. checking for ranlib... ranlib
  85. checking for strip... strip
  86. checking for dsymutil... dsymutil
  87. checking for nmedit... nmedit
  88. checking for -single_module linker flag... yes
  89. checking for -exported_symbols_list linker flag... yes
  90. checking if cc supports -fno-rtti -fno-exceptions... no
  91. checking for cc option to produce PIC... -fno-common
  92. checking if cc PIC flag -fno-common works... yes
  93. checking if cc static flag -static works... no
  94. checking if cc supports -c -o file.o... yes
  95. checking whether the cc linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
  96. checking dynamic linker characteristics... darwin9.8.0 dyld
  97. checking how to hardcode library paths into programs... immediate
  98. checking whether stripping libraries is possible... yes
  99. checking if libtool supports shared libraries... yes
  100. checking whether to build shared libraries... yes
  101. checking whether to build static libraries... no
  102.  
  103. creating libtool
  104. appending configuration tag "CXX" to libtool
  105. configure: creating ./config.status
  106. config.status: creating config.h
  107. config.status: config.h is unchanged
  108. bash-3.2$ make
  109. /bin/sh /Users/tamara/Projects/ZakayGeoIP-PECL/libtool --mode=compile cc -I. -I/Users/tamara/Projects/ZakayGeoIP-PECL -DPHP_ATOM_INC -I/Users/tamara/Projects/ZakayGeoIP-PECL/include -I/Users/tamara/Projects/ZakayGeoIP-PECL/main -I/Users/tamara/Projects/ZakayGeoIP-PECL -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/tamara/Projects/ZakayGeoIP-PECL/geoip.c -o geoip.lo
  110. mkdir .libs
  111. cc -I. -I/Users/tamara/Projects/ZakayGeoIP-PECL -DPHP_ATOM_INC -I/Users/tamara/Projects/ZakayGeoIP-PECL/include -I/Users/tamara/Projects/ZakayGeoIP-PECL/main -I/Users/tamara/Projects/ZakayGeoIP-PECL -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/tamara/Projects/ZakayGeoIP-PECL/geoip.c -fno-common -DPIC -o .libs/geoip.o
  112. /bin/sh /Users/tamara/Projects/ZakayGeoIP-PECL/libtool --mode=link cc -DPHP_ATOM_INC -I/Users/tamara/Projects/ZakayGeoIP-PECL/include -I/Users/tamara/Projects/ZakayGeoIP-PECL/main -I/Users/tamara/Projects/ZakayGeoIP-PECL -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -o geoip.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/tamara/Projects/ZakayGeoIP-PECL/modules geoip.lo -Wl,-rpath,/opt/local/lib -L/opt/local/lib -lGeoIP
  113. cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/geoip.so -bundle .libs/geoip.o -L/opt/local/lib /opt/local/lib/libGeoIP.dylib -Wl,-rpath -Wl,/opt/local/lib
  114. dsymutil .libs/geoip.so || :
  115. creating geoip.la
  116. (cd .libs && rm -f geoip.la && ln -s ../geoip.la geoip.la)
  117. /bin/sh /Users/tamara/Projects/ZakayGeoIP-PECL/libtool --mode=install cp ./geoip.la /Users/tamara/Projects/ZakayGeoIP-PECL/modules
  118. cp ./.libs/geoip.so /Users/tamara/Projects/ZakayGeoIP-PECL/modules/geoip.so
  119. cp ./.libs/geoip.lai /Users/tamara/Projects/ZakayGeoIP-PECL/modules/geoip.la
  120. ----------------------------------------------------------------------
  121. Libraries have been installed in:
  122. /Users/tamara/Projects/ZakayGeoIP-PECL/modules
  123.  
  124. If you ever happen to want to link against installed libraries
  125. in a given directory, LIBDIR, you must either use libtool, and
  126. specify the full pathname of the library, or use the `-LLIBDIR'
  127. flag during linking and do at least one of the following:
  128. - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
  129. during execution
  130.  
  131. See any operating system documentation about shared libraries for
  132. more information, such as the ld(1) and ld.so(8) manual pages.
  133. ----------------------------------------------------------------------
  134.  
  135. Build complete.
  136. Don't forget to run 'make test'.
  137.  
  138. bash-3.2$ sudo make install
  139. Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
  140. bash-3.2$ find /opt/local -name 'libGeoIP*'
  141. /opt/local/lib/libGeoIP.1.dylib
  142. /opt/local/lib/libGeoIP.a
  143. /opt/local/lib/libGeoIP.dylib
  144. /opt/local/lib/libGeoIP.la
  145. /opt/local/lib/libGeoIPUpdate.0.dylib
  146. /opt/local/lib/libGeoIPUpdate.a
  147. /opt/local/lib/libGeoIPUpdate.dylib
  148. /opt/local/lib/libGeoIPUpdate.la
  149. bash-3.2$ ls -lh /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
  150. total 368
  151. -rwxr-xr-x 1 root wheel 25K Sep 18 22:57 geoip.so*
  152. -rwxr-xr-x 1 root wheel 113K Jul 13 16:55 iconv.a*
  153. -rwxr-xr-x 1 root wheel 40K Jul 13 16:55 iconv.so*
  154. bash-3.2$ grep '^extension=' /usr/local/etc/php.ini
  155. extension=iconv.so
  156. extension=geoip.so
  157. bash-3.2$ php -i | grep -E '(iconv|geoip)'
  158. Registered Stream Filters => zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed
  159. iconv
  160. iconv support => enabled
  161. iconv implementation => libiconv
  162. iconv library version => 1.11
  163. iconv.input_encoding => ISO-8859-1 => ISO-8859-1
  164. iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
  165. iconv.output_encoding => ISO-8859-1 => ISO-8859-1
  166. base-3.2$ cat ~/Sites/testgeoip.php
  167. <?php
  168. /*
  169. * test geoip lookup functions (From Zakay/geoip library - PECL fork)
  170. */
  171.  
  172. error_reporting(E_ALL || E_STRICT);
  173. ini_set('display_errors','on');
  174. ini_set('display_startup_errors','on');
  175.  
  176. $ipaddress='tamnet.homeip.net'; /* target for lookups */
  177.  
  178. ?>
  179. <html>
  180. <head>
  181. <title>Testing geoip</title>
  182. </head>
  183. <body>
  184.  
  185. <h1>Looking up geoip info for: <?php echo $ipaddress; ?></h1>
  186.  
  187. <ul>
  188. <li>continent code: <?php echo geoip_continent_code_by_name($ipaddress); ?></li>
  189. <li>country code by name: <?php echo geoip_country_code_by_name($ipaddress); ?></li>
  190. <li>geoip_country_code3_by_name: <?php echo geoip_country_code3_by_name($ipaddress); ?> </li>
  191. <li>geoip_country_name_by_name: <?php echo geoip_country_name_by_name($ipaddress); ?> </li>
  192. <li>geoip_database_info: GEOIP_COUNTRY_EDITION <?php echo geoip_db_available(GEOIP_COUNTRY_EDITION) ? geoip_database_info(GEOIP_COUNTRY_EDITION) : "no country edition"; ?></li>
  193. <li>geoip_database_info: GEOIP_CITY_EDITION <?php echo geoip_db_available(GEOIP_CITY_EDITION) ? geoip_database_info(GEOIP_CITY_EDITION) : "no city edition"; ?></li>
  194. <li>geoip_db_get_all_info:</li>
  195. <pre>
  196. <?php var_dump(geoip_db_get_all_info()); ?>
  197. </pre>
  198. <li>geoip_id_by_name:
  199. <?php
  200. $netspeed = geoip_id_by_name($ipaddress);
  201.  
  202. echo 'The connection type is ';
  203.  
  204. switch ($netspeed) {
  205. case GEOIP_DIALUP_SPEED:
  206. echo 'dial-up';
  207. break;
  208. case GEOIP_CABLEDSL_SPEED:
  209. echo 'cable or DSL';
  210. break;
  211. case GEOIP_CORPORATE_SPEED:
  212. echo 'corporate';
  213. break;
  214. case GEOIP_UNKNOWN_SPEED:
  215. default:
  216. echo 'unknown';
  217. }
  218. ?>
  219. </li>
  220. <li>geoip_isp_by_name: <?php echo geoip_isp_by_name($ipaddress); ?></li>
  221. <li>geoip_org_by_name: <?php echo geoip_org_by_name($ipaddress); ?></li>
  222. <li>geoip_record_by_name:</li>
  223. <pre><?php var_dump(geoip_record_by_name($ipaddress)); ?></pre>
  224. <li>geoip_region_by_name: <?php echo geoip_region_by_name($ipaddress); ?></li>
  225. </ul>
  226.  
  227. </body>
  228. </html>
  229.  
  230. bash-3.2$ php ~/Sites/testgeoip.php
  231. <html>
  232. <head>
  233. <title>Testing geoip</title>
  234. </head>
  235. <body>
  236.  
  237. <h1>Looking up geoip info for: tamnet.homeip.net</h1>
  238.  
  239. <ul>
  240. <li>continent code:
  241. Fatal error: Call to undefined function geoip_continent_code_by_name() in /Users/tamara/Sites/testgeoip.php on line 22
  242. bash-3.2$ exit
  243. exit
  244.  
  245. Script done on Sun Sep 18 23:01:01 2011
Advertisement
Add Comment
Please, Sign In to add comment