File: check_msys_zlib.m4

package info (click to toggle)
simulavr 1.0.0%2Bgit20160221.e53413b-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 5,748 kB
  • sloc: cpp: 35,491; python: 6,991; ansic: 3,567; makefile: 1,072; sh: 653; asm: 414; tcl: 320
file content (45 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# AVR_CHECK_FOR_ZLIB(msg, root_path, lib_ext)

AC_DEFUN([AVR_CHECK_FOR_ZLIB], [ 
  if test x"$zlib_a_location" = "x"; then
    AC_MSG_CHECKING($1 $2 in "$3")
    zlib_a_location=$2/$3
    if test -f ${zlib_a_location}/libz.a ; then
      AC_MSG_RESULT(yes)
        zlib_root_location="$2"
    else
      AC_MSG_RESULT(no)
      zlib_a_location=""
    fi
  fi
])

# AVR_ZLIB_SEARCH_STEP(root_path)

AC_DEFUN([AVR_ZLIB_SEARCH_STEP], [
  AVR_CHECK_FOR_ZLIB([zlib: search],[$1],[lib])
])

# AVR_CHECK_ZLIB_MSYS()
# set make variable LIBZ_FLAGS

AC_DEFUN([AVR_CHECK_ZLIB_MSYS], [
  # configure option to define the right path for zlib
  AC_ARG_WITH([zlib],
          [AS_HELP_STRING([--with-zlib=path  location of zlib on MSYS/MingW where lib/libz.a is found])],
          [],
          [with_zlib=check])
  AC_MSG_RESULT([with_zlib = $with_zlib])
  
  # seek for the lib
  if test "${with_zlib}" != "check"; then
    AVR_ZLIB_SEARCH_STEP($with_zlib)
  else
    AVR_ZLIB_SEARCH_STEP(/usr)
  fi
  
  # set variables for make
  AC_SUBST([LIBZ_FLAGS], ["-L${zlib_root_location}/lib -lz"])
])

# EOF