810db5c4480ff5df7ddf8f7bac2c6cf4bb99000c
[oweals/opkg-lede.git] / configure.ac
1 # Process this file with autoconf to produce a configure script
2 AC_INIT(ipkg.c)
3 AM_INIT_AUTOMAKE([ipkg], [0.99.163])
4 AM_CONFIG_HEADER(config.h)
5
6 AC_CANONICAL_HOST
7
8
9 for top_builddir in . .. ../.. $ac_auxdir $ac_auxdir/..; do
10   test -f $top_builddir/configure && break
11 done
12
13
14 # Checks for programs
15 AC_PROG_AWK
16 AC_PROG_CC
17 AC_PROG_INSTALL
18 AC_PROG_LN_S
19 AM_PROG_INSTALL_STRIP
20 AC_PROG_LIBTOOL
21
22 # Checks for libraries (hah! ipkg is pretty much self-contained)
23 PKG_CHECK_MODULES(CURL, libcurl)
24
25 # Checks for header files
26 AC_HEADER_DIRENT
27 AC_HEADER_STDC
28 AC_HEADER_SYS_WAIT
29 AC_CHECK_HEADERS([errno.h fcntl.h memory.h regex.h stddef.h stdlib.h string.h strings.h unistd.h utime.h])
30
31 # Checks for typedefs, structures, and compiler characteristics.
32 AC_C_CONST
33 AC_TYPE_UID_T
34 AC_TYPE_MODE_T
35 AC_TYPE_OFF_T
36 AC_TYPE_PID_T
37 AC_TYPE_SIZE_T
38 AC_CHECK_MEMBERS([struct stat.st_rdev])
39
40 # Don't do annoying tests that don't work when cross-compiling, just trust them.
41 # The AC_FUNC_MEMCMP test doesn't work during a cross-compile, disable.
42 # AC_FUNC_MEMCMP
43 # The AC_FUNC_STAT test doesn't work during a cross-compile, disable.
44 # AC_FUNC_STAT
45
46 # Checks for library functions
47 AC_FUNC_CHOWN
48 AC_FUNC_FORK
49 AC_TYPE_SIGNAL
50 AC_FUNC_UTIME_NULL
51 AC_FUNC_VPRINTF
52 AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup strerror strndup strrchr strstr strtol strtoul sysinfo utime])
53
54 ipkglibdir=
55 AC_ARG_WITH(ipkglibdir,
56 [  --with-ipkglibdir=DIR   specifies directory to put status and info files.
57                           "/ipkg" is always added so if you want your files 
58                           to be in /usr/lib/ipkg you should indicate 
59                           --with-ipkglibdir=/usr/lib ],
60 [case "${withval}" in
61 yes)    AC_MSG_ERROR(bad value ${withval} given for ipkg libs directories ) ;;
62 no)     ;;
63 *)      ipkglibdir=$with_ipkglibdir ;;
64 esac])
65
66 # Default local prefix if it is empty
67 if test x$ipkglibdir = x; then
68         ipkglibdir=/usr/lib
69 fi
70
71 AC_SUBST(ipkglibdir)
72
73 AC_OUTPUT(Makefile etc/Makefile familiar/Makefile familiar/control familiar/control-unstripped familiar/libipkg-control  familiar/libipkg-dev-control libbb/Makefile libipkg.pc ipkg.h)