File: configure.in

package info (click to toggle)
ace-of-penguins 1.5~rc2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,532 kB
  • sloc: sh: 13,542; ansic: 9,852; makefile: 249; perl: 36
file content (132 lines) | stat: -rw-r--r-- 2,912 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
dnl Process this file with autoconf to produce a configure script.
AC_INIT(ace,1.4)
AC_CONFIG_SRCDIR(lib/cards.h)
AM_INIT_AUTOMAKE

AC_ARG_WITH(cross,[  --with-cross=TARGET      select cross development], [
  target=$withval
  host=$withval
  echo Cross compiling for $withval
  CC=$target-gcc
  AR=$target-ar
  RANLIB=$target-ranlib
  LD=$target-ld
  STRIP=$target-strip
  PDA=-DPDA

  for dir in x `$CC --print-search-dirs | grep libraries: | sed -e 's/libraries: //' -e 's/:/ /g'`
  do
    dir=`echo $dir | sed 's@/$@@'`
    echo testing $dir/X11
    if test -d $dir/X11
    then
      x_libraries=$dir/X11
      break;
    fi
  done
  echo x_libraries=$x_libraries
  case $x_libraries in
    *lib/X11 ) dir=`echo $x_libraries | sed 's@lib/X11$@include@'` ;;
    *gcc-lib* ) dir=`echo $x_libraries | sed -e 's@gcc-lib@@' -e 's@X11$@include@'` ;;
    *) dir=`echo $x_libraries | sed 's@X11$@include@'` ;;
  esac
  test -d $dir/. && x_includes=$dir
  export CC AR RANLIB LD STRIP PDA
])

AC_LANG_C

AM_PROG_LIBTOOL

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

AC_CHECK_PROGS(BUILD_CC,gcc cc ${CC},gcc)
AC_CHECK_PROG(AR,${AR:-ar},${AR:-ar},ar)
AC_CHECK_PROG(LD,${LD:-ld},${LD:-ld},ld)
AC_CHECK_PROG(STRIP,${STRIP:-strip},${STRIP:-strip},strip)

dnl Checks for libraries.
dnl Replace `main' with a function in -lgd:
dnl doesn't work if gd isn't where the compiler can find it
dnl AC_CHECK_LIB(gd, gdImageCreateFromGif)

dnl Checks for header files.

AC_PATH_XTRA
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_HEADER_TIME

dnl Checks for library functions.
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS(gettimeofday mkdir strdup strstr)

opt_gd=
AC_ARG_WITH(z,[  --with-z=DIR           location of the ZLIB library],opt_z=$withval)
AC_ARG_WITH(png,[  --with-png=DIR          location of the PNG library],opt_png=$withval)

case "$with_z" in
  yes|no) AC_MSG_ERROR([
*** Directory must be specified for --with-z])
    ;;
  "")
    Z_CFLAGS=
    Z_LIBS=-lz
    ;;
  *)
    if test -f $with_z/include/z.h
    then
      Z_CFLAGS=-I$with_z/include
    else
      Z_CFLAGS=-I$with_z
    fi
    if test -f $with_z/lib/libz.a
    then
      Z_LIBS=$with_z/lib/libz.a
    else
      Z_LIBS=$with_z/libz.a
    fi
    ;;
esac

case "$with_png" in
  yes|no) AC_MSG_ERROR([
*** Directory must be specified for --with-png])
    ;;
  "")
    PNG_CFLAGS=
    PNG_LIBS=
    ;;
  *)
    if test -f $with_png/lib/png.h
    then
      PNG_CFLAGS=-I$with_png/lib
    else
      PNG_CFLAGS=-I$with_png/include/X11
    fi
    if test -f $with_png/lib/libPng.a
    then
      PNG_LIBS="-L$with_png/lib"
    else
      PNG_LIBS="-L$with_png"
    fi
    ;;
esac

AC_SUBST(Z_CFLAGS)
AC_SUBST(Z_LIBS)

AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)

AC_SUBST(PDA)

AC_OUTPUT(Makefile lib/Makefile games/Makefile tests/Makefile)