1dnl Process this file with autoconf to produce a configure script.
2
3dnl Initialization
4AC_INIT([Lincity],[1.13.1],[lincity-users@lists.sourceforge.net],[lincity])
5AC_CONFIG_SRCDIR([colour.pal])
6AM_INIT_AUTOMAKE
7
8AC_ARG_WITH(gzip,  [  --with-gzip             use gzip])
9AC_ARG_WITH(svga,  [  --with-svga             use svga library])
10
11dnl Checks for programs.
12AC_ISC_POSIX
13AC_PROG_CC
14AC_AIX
15AC_PROG_MAKE_SET
16AC_PROG_LIBTOOL
17
18dnl Autodetect presence of gzip
19if eval "test x$with_gzip = x"; then
20  AC_CHECK_PROG(with_gzip,gzip,"yes")
21fi
22if eval "test x$with_gzip = xyes"; then
23  AC_DEFINE(HAVE_GZIP)
24fi
25
26dnl -------------------------------------------------------
27dnl GCS: This is idiotic. The only way to expand autoconf's own
28dnl variables is to use the script I stole from freeciv???
29dnl What if directories other than $prefix and $exec_prefix need
30dnl to be expanded?
31dnl FC_EXPAND_DIR(DEFAULT_LIBDIR,"${datadir}/lincity")
32dnl AC_DEFINE_UNQUOTED(DEFAULT_LIBDIR,"$DEFAULT_LIBDIR")
33dnl -------------------------------------------------------
34FC_EXPAND_DIR(DEFAULT_LIBDIR,[${datadir}/lincity])
35AC_DEFINE_UNQUOTED(DEFAULT_LIBDIR,"$DEFAULT_LIBDIR")
36
37dnl -------------------------------------------------------
38dnl GCS Jan 19, 2003
39dnl New autoheader stuff
40dnl -------------------------------------------------------
41AH_TEMPLATE([DEFAULT_LIBDIR],[The default value of LIBDIR.])
42AH_TEMPLATE([HAVE_GZIP],[Define if the system has gzip.])
43
44
45dnl Checks for libraries.
46AC_PATH_XTRA
47
48dnl "$LIBS"          (blank)
49dnl "$X_LIBS"        (-L/usr/X11R6/lib)
50dnl "$X_PRE_LIBS"    (-lSM -lICE)
51dnl "$X_EXTRA_LIBS"  (blank)
52CFLAGS="$CFLAGS $X_CFLAGS -Wall"
53LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
54
55dnl Checks for header files.
56AC_CONFIG_HEADERS([config.h])
57dnl AC_HEADER_STDC([])
58AC_HEADER_DIRENT
59AC_HEADER_TIME
60dnl AC_CHECK_HEADERS(string.h strings.h sys/time.h unistd.h)
61
62dnl Checks for typedefs, structures, and compiler characteristics.
63AC_C_CONST
64AC_C_INLINE
65AC_EXEEXT
66AC_CHECK_SIZEOF(char)
67AC_CHECK_SIZEOF(short)
68AC_CHECK_SIZEOF(int)
69AC_CHECK_SIZEOF(long)
70AC_PROG_RANLIB
71
72dnl Checks for library functions (GCS - add 'select' to enable networking).
73AC_CHECK_FUNCS(gettimeofday mkdir popen)
74
75dnl If the system has X, make the X version
76dnl If the system has SVGA, make the SVGA version.
77dnl If the system has both, make both.
78dnl If the system has neither, exit
79
80LCLIBS=""
81PROGS=""
82AC_SUBST(LCLIBS)
83AC_SUBST(PROGS)
84if eval "test x$with_x = xyes"; then
85  LCLIBS="$LCLIBS LCX_LIBS"
86else
87  if eval "test x$with_x = x"; then
88    AC_CHECK_LIB(X11,XOpenDisplay, LCLIBS="$LCLIBS LCX_LIBS";
89				   PROGS="$PROGS X_PROGS")
90  fi
91fi
92if eval "test x$with_svga = xyes"; then
93  LCLIBS="$LCLIBS LCSVGA_LIBS"
94else
95  if eval "test x$with_svga = x"; then
96    AC_CHECK_LIB(vgagl, gl_putbox,
97	[AC_CHECK_HEADERS(vga.h, LCLIBS="$LCLIBS LCSVGA_LIBS";
98				 PROGS="$PROGS SVGA_PROGS")], , -lvga)
99  fi
100fi
101if test -z "$LCLIBS"; then
102  AC_MSG_ERROR("Found neither SVGA nor X on your system.")
103fi
104
105
106dnl -------------------------------------------------------
107dnl Internationalization
108dnl ALL_LINGUAS="ca"
109AM_GNU_GETTEXT
110dnl -------------------------------------------------------
111dnl GCS: I stole the following from freeciv
112dnl Why doesn't AM_GNU_GETTEXT set LIBS appropriately
113dnl when -lintl is required??
114dnl if test "$gt_cv_func_gettext_libintl" = "yes"; then
115dnl      LIBS="-lintl  $LIBS"
116dnl fi
117dnl DATADIRNAME is generated by AM_GNU_GETTEXT;
118dnl note this has to match the path installed by po/Makefile
119FC_EXPAND_DIR(LOCALEDIR, '${prefix}/${DATADIRNAME}/locale')
120AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
121
122
123dnl -------------------------------------------------------
124dnl GCS May 05, 2003
125dnl Newest i18n hack (gettext 11.5 ??).  Sigh.
126dnl -------------------------------------------------------
127dnl AC_MSG_WARN([libintl is $LIBINTL])
128LIBS="$LIBS $LIBINTL"
129
130dnl -------------------------------------------------------
131dnl GCS Jan 19, 2003
132dnl New autoheader stuff
133dnl -------------------------------------------------------
134AH_TEMPLATE([LOCALEDIR],[The location of the locale message files.])
135
136dnl -------------------------------------------------------
137dnl GCS Jan 19, 2003
138dnl Remove internationalization.  Pushed off to the next version.
139dnl -------------------------------------------------------
140AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in m4/Makefile modules/Makefile])
141
142dnl AC_CONFIG_FILES([Makefile])
143
144AC_OUTPUT
145