a5615ca2ce43f17a48b7036edfb99f53d63ce8ef
[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
24 # Checks for header files
25 AC_HEADER_DIRENT
26 AC_HEADER_STDC
27 AC_HEADER_SYS_WAIT
28 AC_CHECK_HEADERS([errno.h fcntl.h memory.h regex.h stddef.h stdlib.h string.h strings.h unistd.h utime.h])
29
30 # Checks for typedefs, structures, and compiler characteristics.
31 AC_C_CONST
32 AC_TYPE_UID_T
33 AC_TYPE_MODE_T
34 AC_TYPE_OFF_T
35 AC_TYPE_PID_T
36 AC_TYPE_SIZE_T
37 AC_CHECK_MEMBERS([struct stat.st_rdev])
38
39 # Don't do annoying tests that don't work when cross-compiling, just trust them.
40 # The AC_FUNC_MEMCMP test doesn't work during a cross-compile, disable.
41 # AC_FUNC_MEMCMP
42 # The AC_FUNC_STAT test doesn't work during a cross-compile, disable.
43 # AC_FUNC_STAT
44
45 # Checks for library functions
46 AC_FUNC_CHOWN
47 AC_FUNC_FORK
48 AC_TYPE_SIGNAL
49 AC_FUNC_UTIME_NULL
50 AC_FUNC_VPRINTF
51 AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup strerror strndup strrchr strstr strtol strtoul sysinfo utime])
52
53 ipkglibdir=
54 AC_ARG_WITH(ipkglibdir,
55 [  --with-ipkglibdir=DIR   specifies directory to put status and info files.
56                           "/ipkg" is always added so if you want your files 
57                           to be in /usr/lib/ipkg you should indicate 
58                           --with-ipkglibdir=/usr/lib ],
59 [case "${withval}" in
60 yes)    AC_MSG_ERROR(bad value ${withval} given for ipkg libs directories ) ;;
61 no)     ;;
62 *)      ipkglibdir=$with_ipkglibdir ;;
63 esac])
64
65 # Default local prefix if it is empty
66 if test x$ipkglibdir = x; then
67         ipkglibdir=/usr/lib
68 fi
69
70 AC_SUBST(ipkglibdir)
71
72 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)