bopm-3.1.3-autotools.patch 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. --- bopm-3.1.3/configure.ac
  2. +++ bopm-3.1.3/configure.ac
  3. @@ -1,5 +1,6 @@
  4. dnl Process this file with autoconf to produce a configure script.
  5. AC_INIT(bopm, [3.1.3])
  6. +AC_CONFIG_MACRO_DIR([src/libopm/m4])
  7. AC_CONFIG_SRCDIR(src/opercmd.h)
  8. AM_CONFIG_HEADER(src/setup.h)
  9. AM_INIT_AUTOMAKE()
  10. --- bopm-3.1.3/Makefile.am
  11. +++ bopm-3.1.3/Makefile.am
  12. @@ -2,22 +2,9 @@
  13. SUBDIRS = src
  14. -data_DATA = bopm.conf.sample bopm.conf.blitzed
  15. +dist_doc_DATA = bopm.conf.sample bopm.conf.blitzed
  16. -EXTRA_DIST = ChangeLog contrib INSTALL README bopm.conf.sample bopm.conf.blitzed network-bopm
  17. +EXTRA_DIST = ChangeLog contrib INSTALL README network-bopm
  18. -install-data-local:
  19. - @if test -f $(sysconfdir)/bopm.conf ; then \
  20. - echo "$@ will not overwrite existing $(sysconfdir)/bopm.conf"; \
  21. - else \
  22. - $(mkinstalldirs) $(sysconfdir); \
  23. - echo "$(INSTALL_DATA) bopm.conf.sample $(sysconfdir)/bopm.conf"; \
  24. - $(INSTALL_DATA) bopm.conf.sample $(sysconfdir)/bopm.conf; \
  25. - fi
  26. - $(mkinstalldirs) $(localstatedir)
  27. +dist_sysconf_DATA = bopm.conf
  28. -uninstall-local:
  29. - @if test -f $(sysconfdir)/bopm.conf ; then \
  30. - echo "rm -f $(sysconfdir)/bopm.conf"; \
  31. - $(RM) -f $(sysconfdir)/bopm.conf; \
  32. - fi
  33. --- bopm-3.1.3/src/libopm/configure.ac
  34. +++ bopm-3.1.3/src/libopm/configure.ac
  35. @@ -1,5 +1,6 @@
  36. dnl Process this file with autoconf to produce a configure script.
  37. AC_INIT(libopm, [0.1])
  38. +AC_CONFIG_MACRO_DIR([m4])
  39. AC_CONFIG_SRCDIR(src/libopm.h)
  40. AM_CONFIG_HEADER(src/setup.h)
  41. AM_INIT_AUTOMAKE()
  42. --- bopm-3.1.3/src/libopm/m4/ax_func_snprintf.m4
  43. +++ bopm-3.1.3/src/libopm/m4/ax_func_snprintf.m4
  44. @@ -0,0 +1,85 @@
  45. +# ===========================================================================
  46. +# http://www.gnu.org/software/autoconf-archive/ax_func_snprintf.html
  47. +# ===========================================================================
  48. +#
  49. +# SYNOPSIS
  50. +#
  51. +# AX_FUNC_SNPRINTF
  52. +#
  53. +# DESCRIPTION
  54. +#
  55. +# Checks for a fully C99 compliant snprintf, in particular checks whether
  56. +# it does bounds checking and returns the correct string length; does the
  57. +# same check for vsnprintf. If no working snprintf or vsnprintf is found,
  58. +# request a replacement and warn the user about it. Note: the mentioned
  59. +# replacement is freely available and may be used in any project
  60. +# regardless of it's license.
  61. +#
  62. +# LICENSE
  63. +#
  64. +# Copyright (c) 2008 Ruediger Kuhlmann <info@ruediger-kuhlmann.de>
  65. +#
  66. +# Copying and distribution of this file, with or without modification, are
  67. +# permitted in any medium without royalty provided the copyright notice
  68. +# and this notice are preserved. This file is offered as-is, without any
  69. +# warranty.
  70. +
  71. +#serial 5
  72. +
  73. +AU_ALIAS([AC_FUNC_SNPRINTF], [AX_FUNC_SNPRINTF])
  74. +AC_DEFUN([AX_FUNC_SNPRINTF],
  75. +[AC_CHECK_FUNCS(snprintf vsnprintf)
  76. +AC_MSG_CHECKING(for working snprintf)
  77. +AC_CACHE_VAL(ac_cv_have_working_snprintf,
  78. +[AC_TRY_RUN(
  79. +[#include <stdio.h>
  80. +
  81. +int main(void)
  82. +{
  83. + char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
  84. + char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
  85. + int i;
  86. + i = snprintf (bufs, 2, "%s", "111");
  87. + if (strcmp (bufs, "1")) exit (1);
  88. + if (i != 3) exit (1);
  89. + i = snprintf (bufd, 2, "%d", 111);
  90. + if (strcmp (bufd, "1")) exit (1);
  91. + if (i != 3) exit (1);
  92. + exit(0);
  93. +}], ac_cv_have_working_snprintf=yes, ac_cv_have_working_snprintf=no, ac_cv_have_working_snprintf=cross)])
  94. +AC_MSG_RESULT([$ac_cv_have_working_snprintf])
  95. +AC_MSG_CHECKING(for working vsnprintf)
  96. +AC_CACHE_VAL(ac_cv_have_working_vsnprintf,
  97. +[AC_TRY_RUN(
  98. +[#include <stdio.h>
  99. +#include <stdarg.h>
  100. +
  101. +int my_vsnprintf (char *buf, const char *tmpl, ...)
  102. +{
  103. + int i;
  104. + va_list args;
  105. + va_start (args, tmpl);
  106. + i = vsnprintf (buf, 2, tmpl, args);
  107. + va_end (args);
  108. + return i;
  109. +}
  110. +
  111. +int main(void)
  112. +{
  113. + char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
  114. + char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
  115. + int i;
  116. + i = my_vsnprintf (bufs, "%s", "111");
  117. + if (strcmp (bufs, "1")) exit (1);
  118. + if (i != 3) exit (1);
  119. + i = my_vsnprintf (bufd, "%d", 111);
  120. + if (strcmp (bufd, "1")) exit (1);
  121. + if (i != 3) exit (1);
  122. + exit(0);
  123. +}], ac_cv_have_working_vsnprintf=yes, ac_cv_have_working_vsnprintf=no, ac_cv_have_working_vsnprintf=cross)])
  124. +AC_MSG_RESULT([$ac_cv_have_working_vsnprintf])
  125. +if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != "xyesyes"; then
  126. + AC_LIBOBJ(snprintf)
  127. + AC_MSG_WARN([Replacing missing/broken (v)snprintf() with version from http://www.ijs.si/software/snprintf/.])
  128. + AC_DEFINE(PREFER_PORTABLE_SNPRINTF, 1, "enable replacement (v)snprintf if system (v)snprintf is broken")
  129. +fi])
  130. --- bopm-3.1.3/src/libopm/m4/etr_socket_nsl.m4
  131. +++ bopm-3.1.3/src/libopm/m4/etr_socket_nsl.m4
  132. @@ -0,0 +1,81 @@
  133. +dnl @synopsis ETR_SOCKET_NSL
  134. +dnl
  135. +dnl @obsoleted Use LIB_SOCKET_NSL instead.
  136. +dnl
  137. +dnl This macro figures out what libraries are required on this platform
  138. +dnl to link sockets programs. It's usually -lsocket and/or -lnsl or
  139. +dnl neither. We test for all three combinations.
  140. +dnl
  141. +dnl @category Obsolete
  142. +dnl @author Warren Young <warren@etr-usa.com>
  143. +dnl @version 2005-09-02
  144. +dnl @license AllPermissive
  145. +
  146. +AC_DEFUN([ETR_SOCKET_NSL],
  147. +[
  148. +AC_CACHE_CHECK(for libraries containing socket functions,
  149. +ac_cv_socket_libs, [
  150. + oCFLAGS=$CFLAGS
  151. +
  152. + AC_TRY_LINK([
  153. + #include <sys/types.h>
  154. + #include <sys/socket.h>
  155. + #include <netinet/in.h>
  156. + #include <arpa/inet.h>
  157. + ],
  158. + [
  159. + struct in_addr add;
  160. + int sd = socket(AF_INET, SOCK_STREAM, 0);
  161. + inet_ntoa(add);
  162. + ],
  163. + ac_cv_socket_libs=-lc, ac_cv_socket_libs=no)
  164. +
  165. + if test x"$ac_cv_socket_libs" = "xno"
  166. + then
  167. + CFLAGS="$oCFLAGS -lsocket"
  168. + AC_TRY_LINK([
  169. + #include <sys/types.h>
  170. + #include <sys/socket.h>
  171. + #include <netinet/in.h>
  172. + #include <arpa/inet.h>
  173. + ],
  174. + [
  175. + struct in_addr add;
  176. + int sd = socket(AF_INET, SOCK_STREAM, 0);
  177. + inet_ntoa(add);
  178. + ],
  179. + ac_cv_socket_libs=-lsocket, ac_cv_socket_libs=no)
  180. + fi
  181. +
  182. + if test x"$ac_cv_socket_libs" = "xno"
  183. + then
  184. + CFLAGS="$oCFLAGS -lsocket -lnsl"
  185. + AC_TRY_LINK([
  186. + #include <sys/types.h>
  187. + #include <sys/socket.h>
  188. + #include <netinet/in.h>
  189. + #include <arpa/inet.h>
  190. + ],
  191. + [
  192. + struct in_addr add;
  193. + int sd = socket(AF_INET, SOCK_STREAM, 0);
  194. + inet_ntoa(add);
  195. + ],
  196. + ac_cv_socket_libs="-lsocket -lnsl", ac_cv_socket_libs=no)
  197. + fi
  198. +
  199. + CFLAGS=$oCFLAGS
  200. +])
  201. +
  202. + if test x"$ac_cv_socket_libs" = "xno"
  203. + then
  204. + AC_MSG_ERROR([Cannot find socket libraries])
  205. + elif test x"$ac_cv_socket_libs" = "x-lc"
  206. + then
  207. + ETR_SOCKET_LIBS=""
  208. + else
  209. + ETR_SOCKET_LIBS="$ac_cv_socket_libs"
  210. + fi
  211. +
  212. + AC_SUBST(ETR_SOCKET_LIBS)
  213. +]) dnl ETR_SOCKET_NSL