configure.ac (4116B)
1 # Process this file with autoconf to produce a configure script. 2 AC_PREREQ(2.57) 3 AC_INIT([libextractor-java], [1.0.0], [bug-libextractor@gnu.org]) 4 AC_REVISION($Revision: 1.67 $) 5 AM_INIT_AUTOMAKE([libextractor-java], [1.0.0]) 6 AM_CONFIG_HEADER(native/config.h) 7 8 AH_TOP([#define _GNU_SOURCE 1]) 9 10 # Checks for programs. 11 AC_CANONICAL_HOST 12 13 # The problem that I'm trying to solve here by specifying gcc-3.3 and gcc2 14 # in the search list ahead of the other stuff is that gcc-3.1 on Mac OS X 15 # does not work for some of the pdf extractor code. Now, it would seem 16 # that we could have a conditional on $host_os that puts just the right 17 # amount of crazyness into the checks only on the Mac. Unfortunately, this 18 # will not work, because (according to some mailing lists and painful 19 # personal experiences) AC_PROG_CXX does not work inside of conditionals. 20 # So, instead, we do this crazyness globally. The list of compilers that 21 # you see below is taken right out of the autoconf (version 2.57) sources, 22 # so it should not impede our portability. 23 AC_PROG_CC(gcc-3.3 gcc2 gcc cc /usr/ucb/cc cl) 24 AC_PROG_CPP 25 AC_PROG_CXX(g++-3.3 g++2 g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC) 26 27 AC_CHECK_CLASSPATH 28 AC_PROG_JAVAC 29 AC_PROG_JAVA 30 AC_PROG_JAR 31 AC_DISABLE_STATIC 32 AC_PROG_LIBTOOL 33 34 AC_PROG_INSTALL 35 AC_PROG_LN_S 36 AC_PROG_MAKE_SET 37 38 case "$host_os" in 39 linux*) 40 AC_DEFINE(LINUX,1,[This is a Linux system]) 41 ;; 42 freebsd*) 43 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) 44 ;; 45 openbsd*) 46 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) 47 ;; 48 netbsd*) 49 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) 50 ;; 51 *solaris*) 52 AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system]) 53 XTRA_CPPLIBS=-lstdc++ 54 ;; 55 darwin*) 56 AC_DEFINE_UNQUOTED(DARWIN,1,[This is a Darwin system]) 57 ;; 58 cygwin*) 59 AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a CYGWIN system]) 60 LDFLAGS="$LDFLAGS -no-undefined" 61 ;; 62 mingw*) 63 AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) 64 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) 65 LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32 -lplibc" 66 ;; 67 *) 68 AC_MSG_RESULT(Unrecognised OS $host_os) 69 AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) 70 AC_MSG_RESULT(otheros) 71 ;; 72 esac 73 74 # use '-fno-strict-aliasing', but only if the compiler can take it 75 if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; 76 then 77 CFLAGS="-fno-strict-aliasing $CFLAGS" 78 fi 79 80 # Special check for broken Operating Systems (OS X) 81 AC_CACHE_CHECK(whether ${CC-cc} accepts -no-cpp-precomp, 82 cv_prog_cc_darwin_cpp_precomp, 83 [echo 'void f(){}' > conftest.c 84 if test -z "`${CC-cc} -no-cpp-precomp -c conftest.c 2>&1`"; then 85 cv_prog_cc_darwin_cpp_precomp=yes 86 else 87 cv_prog_cc_darwin_cpp_precomp=no 88 fi 89 rm -f conftest* 90 ]) 91 if test $cv_prog_cc_darwin_cpp_precomp = yes; then 92 CFLAGS="$CFLAGS -no-cpp-precomp" 93 fi 94 95 AC_HEADER_STDC 96 97 # check for GNU LD 98 AC_LIB_PROG_LD_GNU 99 100 AC_SUBST(CPPFLAGS) 101 AC_SUBST(LDFLAGS) 102 103 # test for libextractor 104 extractor=0 105 AC_MSG_CHECKING(for libextractor) 106 AC_ARG_WITH(extractor, 107 [ --with-extractor=PFX Base of libextractor installation], 108 [AC_MSG_RESULT([$with_extractor]) 109 case $with_extractor in 110 no) 111 ;; 112 yes) 113 AC_CHECK_HEADERS(extractor.h, 114 AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults], 115 extractor=1)) 116 ;; 117 *) 118 LDFLAGS="-L$with_extractor/lib $LDFLAGS" 119 CPPFLAGS="-I$with_extractor/include $CPPFLAGS" 120 AC_CHECK_HEADERS(extractor.h, 121 AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults], 122 EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH" 123 extractor=1)) 124 ;; 125 esac 126 ], 127 [AC_MSG_RESULT([--with-extractor not specified]) 128 AC_CHECK_HEADERS(extractor.h, 129 AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults], 130 extractor=1))]) 131 if test "$extractor" != 1 132 then 133 AC_MSG_ERROR([libextractor-java requires libextractor]) 134 fi 135 136 137 AC_CONFIG_FILES([ 138 Makefile 139 native/Makefile 140 org/Makefile 141 org/gnu/Makefile 142 org/gnu/libextractor/Makefile 143 ]) 144 145 AC_OUTPUT