You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac.in 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. dnl
  2. dnl Process this file with autoconf to produce a configure script.
  3. dnl
  4. dnl $Id: configure.in,v 1.33 2008/02/08 15:10:17 adeniz Exp $
  5. dnl
  6. dnl autoconf input for the MicroNeil SNFServer distribution.
  7. dnl
  8. dnl Author: Alban Deniz
  9. dnl
  10. dnl Copyright (C) 2008 by MicroNeil Corporation. All rights reserved.
  11. dnl See www.armresearch.com for the copyright terms.
  12. dnl
  13. dnl
  14. AC_PREREQ(2.52)
  15. AC_INIT(snf-server, REPLACE_WITH_VERSION)
  16. AC_CONFIG_SRCDIR(source/SNFMulti/snfCFGmgr.cpp)
  17. AC_CONFIG_AUX_DIR(config)
  18. AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
  19. AM_CONFIG_HEADER(config.h)
  20. AC_LANG(C++)
  21. AC_PROG_LIBTOOL
  22. AC_PROG_CXX
  23. AC_PROG_CC
  24. AC_PROG_INSTALL
  25. AC_PROG_MAKE_SET
  26. dnl
  27. dnl Check for programs.
  28. dnl
  29. AC_CHECK_PROG(haveCURL, curl, true, false)
  30. if [[ $haveCURL == "false" ]]
  31. then
  32. AC_MSG_ERROR([The CURL program was not found]);
  33. fi
  34. dnl
  35. dnl Load the user-specified OS.
  36. dnl
  37. AC_ARG_ENABLE(os-type,
  38. [AS_HELP_STRING([--enable-os-type=TYPE],
  39. [where TYPE is OpenBSD, FreeBSD, RedHat, Suse, Ubuntu, or ArchLinux])],
  40. [SNF_OSTYPE="${enableval}" ])
  41. case "$SNF_OSTYPE" in
  42. OpenBSD|FreeBSD|Suse|Ubuntu)
  43. SNF_RPM_SENDMAIL_OTHER_REQUIRES=""
  44. ;;
  45. RedHat)
  46. SNF_RPM_SENDMAIL_OTHER_REQUIRES="Requires: sendmail-cf"
  47. ;;
  48. *)
  49. AC_MSG_ERROR([Invalid OS type: "$SNF_OSTYPE".
  50. You must specify a valid OS type with --enable-os-type=TYPE, where TYPE is one of:
  51. OpenBSD
  52. FreeBSD
  53. Suse
  54. RedHat
  55. Ubuntu
  56. ArchLinux])
  57. ;;
  58. esac
  59. AC_SUBST(SNF_OSTYPE)
  60. AM_CONDITIONAL([OpenBSD], [test x$SNF_OSTYPE = xOpenBSD])
  61. AM_CONDITIONAL([FreeBSD], [test x$SNF_OSTYPE = xFreeBSD])
  62. AM_CONDITIONAL([Suse], [test x$SNF_OSTYPE = xSuse])
  63. AM_CONDITIONAL([RedHat], [test x$SNF_OSTYPE = xRedHat])
  64. AM_CONDITIONAL([Ubuntu], [test x$SNF_OSTYPE = xUbuntu])
  65. AM_CONDITIONAL([ArchLinux], [test x$SNF_OSTYPE = xArchLinux])
  66. dnl
  67. dnl Load whether this is for a package.
  68. dnl
  69. AC_ARG_ENABLE(for-package,
  70. [AS_HELP_STRING([--enable-for-package],
  71. [enable if building for a package])],
  72. [FOR_PACKAGE="${enableval}" ])
  73. AM_CONDITIONAL([ForPackage], [test x$FOR_PACKAGE = xyes])
  74. dnl
  75. dnl Check libraries.
  76. dnl
  77. dnl
  78. dnl pthread library.
  79. dnl
  80. AC_CHECK_LIB(pthread, pthread_create,,
  81. AC_MSG_ERROR([libpthread is required to build AC_PACKAGE_NAME]))
  82. dnl
  83. dnl Additional compile-time and link-time flags.
  84. dnl
  85. OTHER_CXXFLAGS='-O3'
  86. SNF_CXXFLAGS='$(OTHER_CXXFLAGS) -pthread'
  87. SNF_LIBS=''
  88. AC_SUBST(OTHER_CXXFLAGS)
  89. AC_SUBST(SNF_CXXFLAGS)
  90. AC_SUBST(SNF_LIBS)
  91. AC_SUBST(SNF_RPM_SENDMAIL_OTHER_REQUIRES)
  92. dnl
  93. dnl Output the makefiles.
  94. dnl
  95. AC_OUTPUT([Makefile
  96. ${PACKAGE_NAME}.spec
  97. ${PACKAGE_NAME}-postfix.spec
  98. ${PACKAGE_NAME}-sendmail.spec
  99. binary/SNFServer/Makefile
  100. binary/SNFClient/Makefile
  101. binary/SNF2Check/Makefile
  102. binary/SNFServerConfig/Makefile
  103. Scripts/Makefile
  104. config_files/Makefile
  105. Docs/Makefile])
  106. echo "
  107. Type "make" to build the system using the default (optimized) parameters.
  108. Type "make SNF_CXXFLAGS='-g -pthread'" to build the system for debugging.
  109. Type "make OTHER_CXXFLAGS=flags" to build the system with compiler
  110. flags 'flags'.
  111. For example:
  112. Type "make OTHER_CXXFLAGS=-g" to build the system for debugging.
  113. Type "make OTHER_CXXFLAGS=-Wall" to enable all warnings.
  114. Type "make OTHER_CXXFLAGS=-Wall -O3" to enable warnings and O3
  115. optimizations.
  116. Default value: $OTHER_CXXFLAGS
  117. OS type: $SNF_OSTYPE
  118. The software will be installed in $prefix.
  119. Done
  120. "