| 1 | ## Process this file with autoconf to produce a configure script. |
|---|
| 2 | # try CFLAGS="$CFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes -Werror" |
|---|
| 3 | AC_INIT(ObexFTP, 0.23, zany@triq.net) |
|---|
| 4 | #AC_CONFIG_SRCDIR(src/foo.c) |
|---|
| 5 | AM_INIT_AUTOMAKE(dist-bzip2) |
|---|
| 6 | AM_CONFIG_HEADER(config.h) |
|---|
| 7 | |
|---|
| 8 | # note: AC_HELP_STRING is deprecated in autoconf 2.59 and later but |
|---|
| 9 | # AS_HELP_STRING is not available in autoconf 2.57 or earlier. |
|---|
| 10 | |
|---|
| 11 | dnl AM_MAINTAINER_MODE |
|---|
| 12 | |
|---|
| 13 | # Checks for programs. |
|---|
| 14 | AC_ISC_POSIX |
|---|
| 15 | AC_PROG_CC |
|---|
| 16 | AC_PROG_INSTALL |
|---|
| 17 | AC_PROG_LN_S |
|---|
| 18 | |
|---|
| 19 | # Initialize libtool |
|---|
| 20 | AC_PROG_LIBTOOL |
|---|
| 21 | |
|---|
| 22 | # Checks for header files. |
|---|
| 23 | AC_HEADER_STDC |
|---|
| 24 | AC_HEADER_DIRENT |
|---|
| 25 | AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h termios.h unistd.h sys/select.h sys/times.h]) |
|---|
| 26 | |
|---|
| 27 | AC_PATH_WIN32 |
|---|
| 28 | |
|---|
| 29 | # Checks for libraries. |
|---|
| 30 | PKG_CHECK_MODULES(OPENOBEX,openobex) |
|---|
| 31 | REQUIRES="openobex" |
|---|
| 32 | |
|---|
| 33 | AM_ICONV |
|---|
| 34 | AC_CHECK_HEADERS([langinfo.h]) |
|---|
| 35 | dnl IRDA_CHECK |
|---|
| 36 | BLUETOOTH_CHECK |
|---|
| 37 | if test "${bluez_found}" = "yes"; then |
|---|
| 38 | REQUIRES="$REQUIRES bluez" |
|---|
| 39 | SDPLIB_CHECK |
|---|
| 40 | fi |
|---|
| 41 | USB_CHECK |
|---|
| 42 | if test "${am_cv_usb_found}" = "yes"; then |
|---|
| 43 | REQUIRES="$REQUIRES libusb" |
|---|
| 44 | fi |
|---|
| 45 | |
|---|
| 46 | # check for optional swig rebuild |
|---|
| 47 | AC_ARG_ENABLE([swig], |
|---|
| 48 | [AC_HELP_STRING([--enable-swig], |
|---|
| 49 | [Rebuild language bindings @<:@default=no@:>@])], |
|---|
| 50 | [case "${enableval}" in |
|---|
| 51 | yes) want_swig_rebuild=true ;; |
|---|
| 52 | no) want_swig_rebuild=false ;; |
|---|
| 53 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-swig) ;; |
|---|
| 54 | esac],[want_swig_rebuild=false]) |
|---|
| 55 | AM_CONDITIONAL(ENABLE_SWIG, test x$want_swig_rebuild = xtrue) |
|---|
| 56 | if test x$want_swig_rebuild = xtrue; then |
|---|
| 57 | AC_PROG_SWIG(1.3.7) dnl how low can we go? |
|---|
| 58 | fi |
|---|
| 59 | |
|---|
| 60 | # check for language bindings |
|---|
| 61 | AC_ARG_ENABLE([perl], |
|---|
| 62 | [AC_HELP_STRING([--disable-perl], |
|---|
| 63 | [Disables perl language bindings @<:@default=auto@:>@])], |
|---|
| 64 | [ac_perl_enabled=$enableval], |
|---|
| 65 | [AC_CHECK_PROG([ac_perl_enabled],[perl],[yes],[no])]) |
|---|
| 66 | |
|---|
| 67 | if test "$ac_perl_enabled" = yes; then |
|---|
| 68 | AC_PATH_PROG([PERL], [perl], []) |
|---|
| 69 | fi |
|---|
| 70 | AM_CONDITIONAL([ENABLE_PERL], [test x"$PERL" != x""]) |
|---|
| 71 | |
|---|
| 72 | AC_ARG_ENABLE([python], |
|---|
| 73 | [AC_HELP_STRING([--disable-python], |
|---|
| 74 | [Disables python language bindings @<:@default=auto@:>@])], |
|---|
| 75 | [ac_python_enabled=$enableval], |
|---|
| 76 | [AC_CHECK_PROG([ac_python_enabled],[python[$PYTHON_VERSION]],[yes],[no])]) |
|---|
| 77 | |
|---|
| 78 | if test "$ac_python_enabled" = yes; then |
|---|
| 79 | AM_PATH_PYTHON |
|---|
| 80 | fi |
|---|
| 81 | AM_CONDITIONAL([ENABLE_PYTHON], [test x"$PYTHON" != x""]) |
|---|
| 82 | |
|---|
| 83 | AC_ARG_ENABLE([ruby], |
|---|
| 84 | [AC_HELP_STRING([--disable-ruby], |
|---|
| 85 | [Disables ruby language bindings @<:@default=auto@:>@])], |
|---|
| 86 | [ac_ruby_enabled=$enableval], |
|---|
| 87 | [AC_CHECK_PROG([ac_ruby_enabled],[ruby],[yes],[no])]) |
|---|
| 88 | |
|---|
| 89 | if test "$ac_ruby_enabled" = yes; then |
|---|
| 90 | AC_PATH_PROG([RUBY], [ruby], []) |
|---|
| 91 | fi |
|---|
| 92 | AM_CONDITIONAL([ENABLE_RUBY], [test x"$RUBY" != x""]) |
|---|
| 93 | |
|---|
| 94 | AC_ARG_ENABLE([tcl], |
|---|
| 95 | [AC_HELP_STRING([--enable-tcl], |
|---|
| 96 | [Enables tcl language bindings @<:@default=off@:>@])], |
|---|
| 97 | [ac_tcl_enabled=$enableval], |
|---|
| 98 | [AC_CHECK_PROG([ac_tcl_enabled],[tclsh],[yes],[no])]) |
|---|
| 99 | |
|---|
| 100 | if test "$ac_tcl_enabled" = yes; then |
|---|
| 101 | AC_PATH_PROG([TCLSH], [tclsh], []) |
|---|
| 102 | fi |
|---|
| 103 | AM_CONDITIONAL([ENABLE_TCL], [test x"$TCLSH" != x""]) |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | dnl no need to build docs by default |
|---|
| 107 | AC_ARG_ENABLE(builddocs, |
|---|
| 108 | AC_HELP_STRING([--enable-builddocs], |
|---|
| 109 | [Compile documentation @<:@default=no@:>@]), |
|---|
| 110 | [case "${enableval}" in |
|---|
| 111 | yes) builddocs=true ;; |
|---|
| 112 | no) builddocs=false ;; |
|---|
| 113 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-builddocs) ;; |
|---|
| 114 | esac],[builddocs=false]) |
|---|
| 115 | AM_CONDITIONAL(BUILD_DOCS, test x$builddocs = xtrue) |
|---|
| 116 | |
|---|
| 117 | dnl Check for C99 __func__ |
|---|
| 118 | AC_TRY_COMPILE([ |
|---|
| 119 | #include<stdio.h>], |
|---|
| 120 | [printf(__func__)],, |
|---|
| 121 | [AC_DEFINE(__func__, "", [non-C99 fake support for __func__])]) |
|---|
| 122 | |
|---|
| 123 | dnl Turn on all warnings but no debugging when using gcc |
|---|
| 124 | if test "$ac_cv_prog_gcc" = "yes"; then |
|---|
| 125 | CFLAGS="$CFLAGS -W -Wundef -Wmissing-declarations -Wmissing-prototypes" |
|---|
| 126 | fi |
|---|
| 127 | |
|---|
| 128 | AC_SUBST(CFLAGS) |
|---|
| 129 | AC_SUBST(LDFLAGS) |
|---|
| 130 | |
|---|
| 131 | CFLAGS="$CFLAGS -Wall" |
|---|
| 132 | |
|---|
| 133 | # Project-specific settings |
|---|
| 134 | # VERSION="..." already set my AM_INIT_AUTOMAKE above |
|---|
| 135 | # libtool uses current:revision:age to produce .c-a.a.r |
|---|
| 136 | # http://www.gnu.org/software/libtool/manual.html#Updating-version-info |
|---|
| 137 | OBEXFTP_VERSION="3\:0\:3" |
|---|
| 138 | MULTICOBEX_VERSION="1\:1\:0" |
|---|
| 139 | BFB_VERSION="0\:5\:0" |
|---|
| 140 | AC_SUBST(VERSION) |
|---|
| 141 | AC_SUBST(OBEXFTP_VERSION) |
|---|
| 142 | AC_SUBST(MULTICOBEX_VERSION) |
|---|
| 143 | AC_SUBST(BFB_VERSION) |
|---|
| 144 | AC_SUBST(REQUIRES) |
|---|
| 145 | |
|---|
| 146 | # should use AC_CONFIG_FILES |
|---|
| 147 | AC_OUTPUT([ |
|---|
| 148 | Makefile |
|---|
| 149 | swig/perl/Makefile |
|---|
| 150 | swig/perl/Makefile.PL |
|---|
| 151 | swig/python/Makefile |
|---|
| 152 | swig/python/setup.py |
|---|
| 153 | swig/ruby/Makefile |
|---|
| 154 | swig/tcl/Makefile |
|---|
| 155 | swig/Makefile |
|---|
| 156 | examples/Makefile |
|---|
| 157 | doc/Makefile |
|---|
| 158 | apps/Makefile |
|---|
| 159 | bfb/Makefile |
|---|
| 160 | multicobex/Makefile |
|---|
| 161 | obexftp/Makefile |
|---|
| 162 | obexftp.spec |
|---|
| 163 | obexftp.pc |
|---|
| 164 | ]) |
|---|