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 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.63)
  3. dnl remember to edit the .pc file name
  4. dnl and lqr/Makefile.am if you change these
  5. m4_define([library_base_name], [lqr])
  6. m4_define([api_version], [1])
  7. dnl Name of library
  8. m4_define([library_sname], [library_base_name-api_version])
  9. m4_define([library_name], [liblqr-api_version])
  10. dnl These three define the library version number
  11. m4_define([package_major_version], [0])
  12. m4_define([package_minor_version], [4])
  13. m4_define([package_micro_version], [2])
  14. m4_define([package_version],
  15. [package_major_version.package_minor_version.package_micro_version])
  16. m4_define([ltversion_current], [3])
  17. m4_define([ltversion_revision], [2])
  18. m4_define([ltversion_age], [3])
  19. AC_INIT([library_name], [package_version])
  20. AC_PREFIX_DEFAULT([/usr])
  21. AC_DEFINE(LIBRARY_NAME, PACKAGE_NAME, [Library name])
  22. AC_DEFINE(PACKAGE_MAJOR_VERSION, package_major_version, [Package major version])
  23. AC_DEFINE(PACKAGE_MINOR_VERSION, package_minor_version, [Package minor version])
  24. AC_DEFINE(PACKAGE_MICRO_VERSION, package_micro_version, [Package micro version])
  25. AC_DEFINE(LTVERSION_CURRENT, ltversion_current, [Library current version])
  26. AC_DEFINE(LTVERSION_REVISON, ltversion_revision, [Library revision])
  27. AC_DEFINE(LTVERSION_AGE, ltversion_age, [Library age])
  28. LIBRARY_BASE_NAME=library_base_name
  29. AC_SUBST(LIBRARY_BASE_NAME)
  30. API_VERSION=api_version
  31. AC_SUBST(API_VERSION)
  32. LIBRARY_NAME=library_name
  33. AC_SUBST(LIBRARY_NAME)
  34. LIBRARY_SNAME=library_sname
  35. AC_SUBST(LIBRARY_SNAME)
  36. PACKAGE_VERSION=package_major_version.package_minor_version.package_micro_version
  37. AC_SUBST(PACKAGE_VERSION)
  38. LTVERSION=ltversion_current:ltversion_revision:ltversion_age
  39. AC_SUBST(LTVERSION)
  40. AC_CONFIG_SRCDIR([lqr/lqr_carver.c])
  41. AC_CONFIG_HEADERS([config.h])
  42. AC_CONFIG_MACRO_DIR([m4])
  43. AM_INIT_AUTOMAKE([-Wall -Werror])
  44. AC_ISC_POSIX
  45. AC_PROG_CC
  46. AC_PROG_CXX
  47. AM_PROG_CC_STDC
  48. AC_PROG_INSTALL
  49. AC_PROG_LN_S
  50. AC_PROG_MAKE_SET
  51. AC_PROG_RANLIB
  52. AC_HEADER_STDC
  53. AC_C_INLINE
  54. AC_C_VOLATILE
  55. AC_DISABLE_STATIC
  56. LT_INIT([win32-dll])
  57. ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
  58. AM_MAINTAINER_MODE
  59. dnl Use -Wall if we have gcc.
  60. changequote(,)dnl
  61. if test "x$GCC" = "xyes"; then
  62. case " $CFLAGS " in
  63. *[\ \ ]-Wall[\ \ ]*) ;;
  64. *) CFLAGS="$CFLAGS -Wall" ;;
  65. esac
  66. fi
  67. changequote([,])dnl
  68. GLIB_REQUIRED_VERSION=2.8.0
  69. PKG_CHECK_MODULES(GLIB,
  70. glib-2.0 >= $GLIB_REQUIRED_VERSION)
  71. GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
  72. AC_SUBST(GLIB_CFLAGS)
  73. GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
  74. AC_SUBST(GLIB_LIBS)
  75. GLIB_DIR=`$PKG_CONFIG --variable=libdir glib-2.0`
  76. AC_SUBST(GLIB_DIR)
  77. AC_CHECK_FUNCS(bind_textdomain_codeset)
  78. DATADIR="${datadir}/library_name"
  79. AC_SUBST(DATADIR)
  80. AC_ARG_ENABLE([install-man],
  81. [AS_HELP_STRING([--enable-install-man], [Install man pages])],
  82. [AS_CASE(["${enableval}"],
  83. [yes], [install_man=true],
  84. [no], [install_man=false],
  85. [AC_MSG_ERROR([bad value ${enableval} for --enable-install-man])]
  86. )],
  87. [install_man=false])
  88. AM_CONDITIONAL([INSTMAN], [test x$install_man = xtrue])
  89. AC_ARG_ENABLE([legacy-macros],
  90. [AS_HELP_STRING([--disable-legacy-macros], [Disable legacy macros])],
  91. [AS_CASE([["${enableval}"]],
  92. [yes], [legacy_macros=true],
  93. [no], [legacy_macros=false],
  94. [AC_MSG_ERROR([bad value ${enableval} for --enable-legacy-macros])]
  95. )],
  96. [legacy_macros=true])
  97. AS_IF([test "x$legacy_macros" = "xfalse"],
  98. [AC_DEFINE([LQR_DISABLE_LEGACY_MACROS],[],[Disable legacy macros])],
  99. [:]
  100. )
  101. AC_ARG_ENABLE([declspec],
  102. [AS_HELP_STRING([--disable-declspec], [Disable Win32 __declspec directives (only meaningful for building static library on MinGW)])],
  103. [AS_CASE([["${enableval}"]],
  104. [yes], [declspec=true],
  105. [no], [declspec=false],
  106. [AC_MSG_ERROR([bad value ${enableval} for --enable-declspec])]
  107. )],
  108. [declspec=true])
  109. AS_IF([test "x$declspec" = "xfalse"],
  110. [AC_DEFINE([LQR_DISABLE_DECLSPEC],[],[Disable __declspec directives])],
  111. [:]
  112. )
  113. AC_MSG_CHECKING([[if we are on Win32]])
  114. AC_LANG([C])
  115. AC_PREPROC_IFELSE([[
  116. #ifndef WIN32
  117. #errrrrrrrrorrrrr
  118. #endif
  119. ]],
  120. [[is_win32=true]],
  121. [[is_win32=false]]
  122. )
  123. AS_IF([test "x$is_win32" = "xtrue"],
  124. [AC_MSG_RESULT([yes]); LT_NOUNDEF_FLAG="-no-undefined"; FVISIBILITY_FLAG=""],
  125. [AC_MSG_RESULT([no]); LT_NOUNDEF_FLAG=""; FVISIBILITY_FLAG="-fvisibility=\"hidden\""],
  126. )
  127. AC_SUBST(LT_NOUNDEF_FLAG)
  128. AC_SUBST(FVISIBILITY_FLAG)
  129. AC_DEFINE([LQR_EXPORTS],[],[Flag for Windows DLL creation])
  130. AC_CONFIG_FILES([
  131. Makefile
  132. lqr/Makefile
  133. man/Makefile
  134. lqr-1.pc
  135. ])
  136. AC_OUTPUT