File: configure.ac

package info (click to toggle)
xpenguins 3.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,588 kB
  • sloc: ansic: 7,680; sh: 1,526; xml: 669; lisp: 118; makefile: 91
file content (130 lines) | stat: -rw-r--r-- 5,022 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -copyright-
#-# 
#-# Copyright (C) 1999-2001  Robin Hogan, 2021-2026 Willem Vermin
#-# 
#-# This program is free software; you can redistribute it and/or modify
#-# it under the terms of the GNU General Public License as published by
#-# the Free Software Foundation; either version 2 of the License, or
#-# (at your option) any later version.
#-# 
#-# This program is distributed in the hope that it will be useful,
#-# but WITHOUT ANY WARRANTY; without even the implied warranty of
#-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#-# GNU General Public License for more details.
#-# 
#-# You should have received a copy of the GNU General Public License
#-# along with this program; if not, write to the Free Software
#-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#-# 
AC_INIT([xpenguins], [3.2.4], [wvermin@gmail.com])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_SUBST([PACKAGE_VERSION],[VERSION])

# When creating a package (e.g. debian)
# Get date from debian/changelog or something like that: (thanks to Bernhard M. Wiedemann)
# First: check if SOURCE_DATE_EPOCH is already defined
# if not: use the file 'bootdate' which should contain the output of 'date +%s'
s="$SOURCE_DATE_EPOCH"
if test "x$s" = x ; then
   AC_MSG_WARN([SOURCE_DATE_EPOCH is not defined])
   if test -f "$srcdir/bootdate" ; then
      AC_MSG_NOTICE([Try to read SOURCE_DATE_EPOCH from file '$srcdir/bootdate'])
      s=`head -n1 "$srcdir/bootdate"`
      xd=`date -u -d "@$s" 2>/dev/null || date -u -r "$s" 2>/dev/null || echo "Invalid date format"`
      AC_MSG_NOTICE([Read SOURCE_DATE_EPOCH=$s, i.e: $xd ])
   fi
else
   xd=`date -u -d "@$s" 2>/dev/null || date -u -r "$s" 2>/dev/null || echo "Invalid date format"`
   AC_MSG_NOTICE([Given SOURCE_DATE_EPOCH=$s, i.e: $xd ])
fi
# final checks on the validity of SOURCE_DATE_EPOCH
# - must be an positive integer
# - date must be within -20 years and +1 year from current date
# if these are not fulfilled, use `date +%s`
x=$(echo "$s" | tr -dc "[0-9]" )
good=no
now=`date "+%s"`
if test "x$x" != x ; then
   firstdate=$( expr "$now" - 631152000 )
   lastdate=$(  expr "$now" + 31536000  )
   if test "$x" -gt "$firstdate" -a "$x" -lt "$lastdate" ; then
      good=yes
   fi
fi


if test x"$good" = xyes ; then
   SOURCE_DATE_EPOCH="$x"
else
   SOURCE_DATE_EPOCH="$now"
   AC_MSG_WARN([SOURCE_DATE_EPOCH set from current date])
fi
xd=`date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null || echo "Invalid date format"`
AC_MSG_NOTICE([Using SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH, i.e: $xd ])

DATE_FMT="+%Y-%m-%d"
DATE=`date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT"`
AC_SUBST([DATE])


# Check if we can create a reproducible 'make dist'.
# If yes: replace the original am__tar (Make's recipe to make a tarball) by
#  a recipe that creates a reproducible tarball
tardir=conftestdir
mkdir "$tardir"
echo "foo" > $tardir/test
AC_MSG_NOTICE([Checking the capabilities of the tar program...])
"${TAR-tar}" --format=posix --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ 
	  --owner=0 --group=0 --numeric-owner --mtime="@${SOURCE_DATE_EPOCH}" --sort=name --mode="a+rwX" -chf - "$tardir" > /dev/null
if test $? -eq 0 ; then
   AC_MSG_NOTICE([The program tar is usable to create a reproducible tar ball.])
   am__tar='$${TAR-tar} --format=posix --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ 
	  --owner=0 --group=0 --numeric-owner --mtime="'"@${SOURCE_DATE_EPOCH}"'" --sort=name --mode="a+rwX" -chf - "$$tardir"'
else
   AC_MSG_WARN([The program tar is not usable to create a reproducible build.])
   AC_MSG_WARN([If a reproducible build is desired, use environment variable 'TAR' to point to a pax-enabled tar,])
   AC_MSG_WARN([or use the flag '--disable-selfrep'.])
fi
rm -r "$tardir"

AC_ARG_ENABLE(selfrep, [AS_HELP_STRING([--enable-selfrep],[Build with self replicating mode @<:@default=yes@:>@])],[],[enable_selfrep=yes])
AM_CONDITIONAL([MAKESELFREP],[test "x$enable_selfrep" = "xyes"])


dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB

LIBS="-lm"

PKG_PROG_PKG_CONFIG

PKG_CHECK_MODULES(X11, [x11 xpm xext xkbcommon xinerama xtst])
PKG_CHECK_MODULES(GTK, [gtk+-3.0 gmodule-2.0])

LIBS="$X11_LIBS"

# check for availability of double buffering
AC_CHECK_FUNCS([XdbeAllocateBackBufferName])

#check for availability of xinerama
AC_CHECK_FUNCS([XineramaQueryScreens])

LIBS="-lm"

AM_CONDITIONAL([CROSSCOMPILE],[test "x$cross_compiling" = "xyes"])

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

AC_CONFIG_FILES(Makefile src/Makefile themes/Makefile themes/Penguins/Makefile \
	  themes/Big_Penguins/Makefile themes/Classic_Penguins/Makefile \
	  themes/Turtles/Makefile themes/Bill/Makefile xpenguins.spec)

AC_OUTPUT