configure.ac 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. #
  19. # configure.ac for hadoop native code.
  20. #
  21. # Notes:
  22. # 1. This configure.ac depends on the following environment variables to function correctly:
  23. # * HADOOP_NATIVE_SRCDIR
  24. # * JAVA_HOME
  25. # * JVM_DATA_MODEL
  26. # * OS_NAME
  27. # * OS_ARCH
  28. # All these are setup by build.xml.
  29. # -*- Autoconf -*-
  30. # Process this file with autoconf to produce a configure script.
  31. #
  32. AC_PREREQ(2.59)
  33. AC_INIT(src/org_apache_hadoop.h)
  34. AC_CONFIG_SRCDIR([src/org_apache_hadoop.h])
  35. AC_CONFIG_AUX_DIR([config])
  36. AC_CONFIG_MACRO_DIR([m4])
  37. AC_CONFIG_HEADER([config.h])
  38. AC_SYS_LARGEFILE
  39. AC_GNU_SOURCE
  40. AM_INIT_AUTOMAKE(hadoop,1.0.0)
  41. # Checks for programs.
  42. AC_PROG_CC
  43. AC_PROG_LIBTOOL
  44. # Checks for libraries.
  45. dnl Check for '-ldl'
  46. AC_CHECK_LIB([dl], [dlopen])
  47. dnl Check for '-ljvm'
  48. JNI_LDFLAGS=""
  49. if test $JAVA_HOME != ""
  50. then
  51. JNI_LDFLAGS="-L$JAVA_HOME/jre/lib/$OS_ARCH/server"
  52. fi
  53. LDFLAGS="$LDFLAGS $JNI_LDFLAGS"
  54. AC_CHECK_LIB([jvm], [JNI_GetCreatedJavaVMs])
  55. AC_SUBST([JNI_LDFLAGS])
  56. # Checks for header files.
  57. dnl Check for Ansi C headers
  58. AC_HEADER_STDC
  59. dnl Check for other standard C headers
  60. AC_CHECK_HEADERS([stdio.h stddef.h], [], AC_MSG_ERROR(Some system headers not found... please ensure their presence on your platform.))
  61. dnl Check for JNI headers
  62. JNI_CPPFLAGS=""
  63. if test $JAVA_HOME != ""
  64. then
  65. for dir in `find $JAVA_HOME/include -follow -type d`
  66. do
  67. JNI_CPPFLAGS="$JNI_CPPFLAGS -I$dir"
  68. done
  69. fi
  70. cppflags_bak=$CPPFLAGS
  71. CPPFLAGS="$CPPFLAGS $JNI_CPPFLAGS"
  72. AC_CHECK_HEADERS([jni.h], [], AC_MSG_ERROR([Native java headers not found. Is \$JAVA_HOME set correctly?]))
  73. CPPFLAGS=$cppflags_bak
  74. AC_SUBST([JNI_CPPFLAGS])
  75. dnl Check for zlib headers
  76. AC_CHECK_HEADERS([zlib.h zconf.h], AC_COMPUTE_NEEDED_DSO(z,HADOOP_ZLIB_LIBRARY), AC_MSG_ERROR(Zlib headers were not found... native-hadoop library needs zlib to build. Please install the requisite zlib development package.))
  77. dnl Check for snappy headers
  78. AC_CHECK_HEADERS([snappy-c.h], AC_COMPUTE_NEEDED_DSO(snappy,HADOOP_SNAPPY_LIBRARY), AC_MSG_WARN(Snappy headers were not found... building without snappy.))
  79. dnl Check for headers needed by the native Group resolution implementation
  80. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h], [], AC_MSG_ERROR(Some system headers not found... please ensure their presence on your platform.))
  81. dnl check for posix_fadvise
  82. AC_CHECK_HEADERS(fcntl.h, [AC_CHECK_FUNCS(posix_fadvise)])
  83. dnl check for sync_file_range
  84. AC_CHECK_HEADERS(fcntl.h, [AC_CHECK_FUNCS(sync_file_range)])
  85. # Checks for typedefs, structures, and compiler characteristics.
  86. AC_C_CONST
  87. # Checks for library functions.
  88. AC_CHECK_FUNCS([memset])
  89. # Check for nonstandard STRERROR_R
  90. AC_FUNC_STRERROR_R
  91. AM_CONDITIONAL([SPECIFY_DATA_MODEL], [case $host_cpu in arm*) false;; *) true;; esac])
  92. AC_CONFIG_FILES([Makefile])
  93. AC_OUTPUT
  94. #
  95. #vim: sw=2: ts=2: noet
  96. #