File: configure.ac

package info (click to toggle)
twlog 2.5-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,236 kB
  • ctags: 191
  • sloc: sh: 5,458; ansic: 2,766; makefile: 76
file content (109 lines) | stat: -rw-r--r-- 3,085 bytes parent folder | download
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
# Copyright (C) 2005 Ted Williams (wa0eir) <wa0eir@mchsi.com>
#  
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without 
# modifications, as long as this notice is preserved.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

AC_INIT([twlog], [2.5], [wa0eir@mchsi.com])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE()

# Checks for programs.
AC_PROG_CC

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h],
                 [], [AC_MSG_ERROR(This header file is missing)])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM

# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([mkdir putenv setenv strncasecmp strstr tzset])

#
# Find headers and libraries for X11, Xpm, Xm and Xbae
#
AC_DEFINE([HAVE_LIBXPM], [0], ["for xpm"])
AC_DEFINE([HAVE_LIB_XP], [0], ["for xp"])
AC_DEFINE([HAVE_MOTIF], [0], ["for motif/lesstif"])
AC_DEFINE([HAVE_XBAE], [0], ["for Xbae"])

AC_CHECK_HEADERS([X11/xpm.h],
   [tw_XPM_header="yes"],
   [AC_MSG_WARN("Cant't find the Xpm header file on your system")
    AC_MSG_WARN("The window icon will not be created")])

# Check for X11, Motif/Lesstif and Xbae
AC_FIND_XBAE
if test "$with_motif" = "no"
then
   AC_MSG_ERROR("Can't find Motif or LessTif on your system")
fi

if test "$with_xbae" = "no"
then
   AC_MSG_ERROR("Can't find Xbae on your system")
fi

# If the Xpm header file was found, look for the Xpm library in
# some typical places.  More places needed.
tw_XPM_lib="no"
if test "$tw_XPM_header" = "yes"
then
   tw_save_LDFLAGS="$LDFLAGS"
   for i in                          \
      /usr/lib                       \
      /usr/lib/X11                   \
      /usr/X11R6/lib                 \
      /usr/X11/lib
   do
      LDFLAGS="$tw_save_LDFLAGS -L$i"
      AC_CHECK_FILE([$i/libXpm.so],
         [AC_CHECK_LIB([Xpm], [XpmCreatePixmapFromData])
          tw_XPM_lib="yes"
          break])
   done

   if test "$tw_XPM_lib" = "no"
   then
      AC_MSG_WARN("Can't find the Xpm library on your system.")
      AC_MSG_WARN("The window icon will not be created.")
   fi
fi

###########################################################################
CFLAGS="$CFLAGS $XBAE_CFLAGS $X_CFLAGS $MOTIF_CFLAGS"
LIBS="$X_LIBS $XBAE_LIBS $MOTIF_LIBS -lXt -lX11 $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
###########################################################################

#
# Find the path to the X11 app_defaults directory
#
AC_PATH_X_APP_DEFAULTS()
APP_DEFAULTS_PATH=$ac_x_app_defaults
AC_SUBST(APP_DEFAULTS_PATH)

#
# Set some variables for user files/dirs
#
USER_NAME=$USER
AC_SUBST(USER_NAME)
HOME_DIR=$HOME
AC_SUBST(HOME_DIR)

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT