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 | # |
---|
20 | # configure.ac for hadoop native code. |
---|
21 | # |
---|
22 | |
---|
23 | # Notes: |
---|
24 | # 1. This configure.ac depends on the following environment variables to function correctly: |
---|
25 | # * HADOOP_NATIVE_SRCDIR |
---|
26 | # * JAVA_HOME |
---|
27 | # * JVM_DATA_MODEL |
---|
28 | # * OS_NAME |
---|
29 | # * OS_ARCH |
---|
30 | # All these are setup by build.xml. |
---|
31 | |
---|
32 | # -*- Autoconf -*- |
---|
33 | # Process this file with autoconf to produce a configure script. |
---|
34 | # |
---|
35 | |
---|
36 | AC_PREREQ(2.59) |
---|
37 | AC_INIT(src/org_apache_hadoop.h) |
---|
38 | AC_CONFIG_SRCDIR([src/org_apache_hadoop.h]) |
---|
39 | AC_CONFIG_AUX_DIR(config) |
---|
40 | AC_CONFIG_HEADER([config.h]) |
---|
41 | |
---|
42 | AM_INIT_AUTOMAKE(hadoop,1.0.0) |
---|
43 | |
---|
44 | # Checks for programs. |
---|
45 | AC_PROG_CC |
---|
46 | AC_PROG_LIBTOOL |
---|
47 | |
---|
48 | # Checks for libraries. |
---|
49 | dnl Check for '-ldl' |
---|
50 | AC_CHECK_LIB([dl], [dlopen]) |
---|
51 | |
---|
52 | dnl Check for '-ljvm' |
---|
53 | JNI_LDFLAGS="" |
---|
54 | if test $JAVA_HOME != "" |
---|
55 | then |
---|
56 | JNI_LDFLAGS="-L$JAVA_HOME/jre/lib/$OS_ARCH/server" |
---|
57 | fi |
---|
58 | ldflags_bak=$LDFLAGS |
---|
59 | LDFLAGS="$LDFLAGS $JNI_LDFLAGS" |
---|
60 | AC_CHECK_LIB([jvm], [JNI_GetCreatedJavaVMs]) |
---|
61 | LDFLAGS=$ldflags_bak |
---|
62 | AC_SUBST([JNI_LDFLAGS]) |
---|
63 | |
---|
64 | # Checks for header files. |
---|
65 | dnl Check for Ansi C headers |
---|
66 | AC_HEADER_STDC |
---|
67 | |
---|
68 | dnl Check for other standard C headers |
---|
69 | AC_CHECK_HEADERS([stdio.h stddef.h], [], AC_MSG_ERROR(Some system headers not found... please ensure their presence on your platform.)) |
---|
70 | |
---|
71 | dnl Check for JNI headers |
---|
72 | JNI_CPPFLAGS="" |
---|
73 | if test $JAVA_HOME != "" |
---|
74 | then |
---|
75 | for dir in `find $JAVA_HOME/include -follow -type d` |
---|
76 | do |
---|
77 | JNI_CPPFLAGS="$JNI_CPPFLAGS -I$dir" |
---|
78 | done |
---|
79 | fi |
---|
80 | cppflags_bak=$CPPFLAGS |
---|
81 | CPPFLAGS="$CPPFLAGS $JNI_CPPFLAGS" |
---|
82 | AC_CHECK_HEADERS([jni.h], [], AC_MSG_ERROR([Native java headers not found. Is \$JAVA_HOME set correctly?])) |
---|
83 | CPPFLAGS=$cppflags_bak |
---|
84 | AC_SUBST([JNI_CPPFLAGS]) |
---|
85 | |
---|
86 | dnl Check for zlib headers |
---|
87 | 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.)) |
---|
88 | |
---|
89 | # Checks for typedefs, structures, and compiler characteristics. |
---|
90 | AC_C_CONST |
---|
91 | |
---|
92 | # Checks for library functions. |
---|
93 | AC_CHECK_FUNCS([memset]) |
---|
94 | |
---|
95 | AC_CONFIG_FILES([Makefile |
---|
96 | src/org/apache/hadoop/io/compress/zlib/Makefile |
---|
97 | lib/Makefile]) |
---|
98 | AC_OUTPUT |
---|
99 | |
---|
100 | # |
---|
101 | #vim: sw=2: ts=2: noet |
---|
102 | # |
---|