Update to xclock 1.0.9

This commit is contained in:
matthieu 2019-08-15 17:19:52 +00:00
parent 180002922b
commit dc74642110
13 changed files with 1926 additions and 503 deletions

View File

@ -1,3 +1,189 @@
commit 755004c87b50e6334c07b0f4b9458a32b8c92566
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jul 14 11:34:07 2019 -0700
xclock 1.0.9
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 0172a3b11f777692ea06c1f3718390ce06b3dcd4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 9 15:06:32 2019 -0700
Clear -Wsign-compare warning from gcc 7.3
xclock.c: In function quit:
xclock.c:133:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
event->xclient.data.l[0] != wm_delete_window) {
^~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 8ef7efe5863ecf6d578900e8ca7398fc10cd566a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 9 15:04:53 2019 -0700
Use _CONST_X_STRING to make libXt declare String as const char *
Clears up 31 of 95 gcc -Wdiscarded-qualifiers warnings from gcc 7.3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 683d3c0cf8c86fb6626e9e85fc0bb99a27833280
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Sat May 4 01:25:22 2019 +0100
Consistently use X_GETTIMEOFDAY
After 7ad730d8, use X_GETTIMEOFDAY() in Initialize() as well as
clock_tic(), to fix compilation on non-POSIX systems where the
gymnastics that X_GETTIMEOFDAY does are necessary (i.e. Win32)
commit d528eca772620bc06c182e03265fc5f70a4d35f7
Author: Niclas Zeising <zeising@daemonic.se>
Date: Wed Feb 27 15:25:28 2019 +0100
Use fabsf when dealing with floating point numbers
commit a212539500a17f265815e77b9a6047279824315f
Author: Niclas Zeising <zeising@daemonic.se>
Date: Wed Feb 27 15:22:41 2019 +0100
Fix logic sourrouning && and ||
Fix the logic sorrounding && and ||. && has higher precedence than ||,
and as such, the if statement probably was incorrect. Fix this by
adding parenthesises around the || statement.
commit 9af0790d71fc321d97486aa40b055656d99050c2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Feb 19 14:12:54 2019 -0800
xclock 1.0.8
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit a646aa84a8892b091bc7b7b24cfa89f8e628ec0e
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jan 6 15:05:13 2019 -0800
Replace remaining sprintf calls with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 62a8e169e13c218dd43e245eea959562769d9ffa
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Wed Nov 21 16:59:51 2018 -0800
Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 1297c089414cb17e684803739f47d9dd9ff5dbe6
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Nov 16 21:14:58 2018 -0800
Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 7ad730d892c899df3bb0b51a757ff2c55b6dc6d1
Author: Keith Packard <keithp@keithp.com>
Date: Sat May 13 23:48:55 2017 -0700
Allow sub-second updates.
Lets you run the clock at whatever tick rate you like.
Note that this changes the behaviour of the clock when the update
isn't a divisor of the number of seconds in a day. In the old code,
the time to display was an integer number of intervals from the start
of the year, in the new code, it is an integer number of intervals
from the start of the day.
I like that better as it makes the seconds consistent from day to day,
even if it means an uneven tick at local midnight. Given that I
suspect no-one has ever done this in practice, I doubt it really
matters.
At least the code is simpler now, while supporting updates at the
level of the Xt timers, which are milliseconds.
Signed-off-by: Keith Packard <keithp@keithp.com>
commit 9fa28e7fe8dc5e883211b29031446b42cbffe31f
Author: Mihail Konev <k.mvc@ya.ru>
Date: Thu Jan 26 14:00:20 2017 +1000
autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
commit 436544737f6a2e4f9669517207db62578cf2917c
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date: Mon Mar 9 12:00:52 2015 +0000
autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 6773417208468060d57c90225009f6f3fab4e244
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jan 24 10:32:07 2017 +1000
autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
commit 4697248c5a3e2aa505eceadd45f17554d4424aff
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Sun Sep 14 18:08:55 2014 +0100
No point in trying to use iconv if we don't have nl_langinfo
This fixes the build for MinGW
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: David Macek <david.macek.0@gmail.com>
commit 67382af06d38fdfd7f08c2bae30a7d5f1bb3fe89
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Jun 2 22:12:53 2014 -0700
autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit a135ec20812ae83c8afc0d7ce6d8f3f15c4aeafe
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Jun 2 22:12:53 2014 -0700
configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 0574c56ea9107eab2597b830bc95e3d62e876060
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Jun 2 22:12:48 2014 -0700
config: Add missing AC_CONFIG_SRCDIR
Regroup AC statements under the Autoconf initialization section.
Regroup AM statements under the Automake initialization section.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 66a2f29e7c649d1eb4079910b0211ffdf7dbbd4d
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Sep 7 23:33:09 2013 -0700

View File

@ -87,7 +87,7 @@ SOFTWARE.
#include <stdio.h>
#include <X11/Xos.h>
#include <X11/Xaw/XawInit.h>
#if !defined(NO_I18N) && defined(HAVE_ICONV)
#if !defined(NO_I18N) && defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
#include <iconv.h>
#include <langinfo.h>
#include <errno.h>
@ -145,8 +145,8 @@ static XtResource resources[] = {
goffset(width), XtRImmediate, (XtPointer) 0},
{XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
goffset(height), XtRImmediate, (XtPointer) 0},
{XtNupdate, XtCInterval, XtRInt, sizeof(int),
offset(update), XtRImmediate, (XtPointer) 60 },
{XtNupdate, XtCInterval, XtRFloat, sizeof(float),
offset(update), XtRString, "60.0" },
#ifndef XRENDER
{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
offset(fgpixel), XtRString, XtDefaultForeground},
@ -226,7 +226,7 @@ static void DrawClockFace ( ClockWidget w );
static int clock_round ( double x );
static Boolean SetValues ( Widget gcurrent, Widget grequest, Widget gnew,
ArgList args, Cardinal *num_args );
#if !defined(NO_I18N) && defined(HAVE_ICONV)
#if !defined(NO_I18N) && defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
static char *clock_to_utf8(const char *str, int in_len);
#endif
@ -521,7 +521,7 @@ TimeString (ClockWidget w, struct tm *tm)
if (w->clock.twentyfour)
{
static char brief[6];
sprintf (brief, "%02d:%02d", tm->tm_hour, tm->tm_min);
snprintf (brief, sizeof(brief), "%02d:%02d", tm->tm_hour, tm->tm_min);
return brief;
}
else
@ -529,7 +529,7 @@ TimeString (ClockWidget w, struct tm *tm)
static char brief[9];
int hour = tm->tm_hour % 12;
if (!hour) hour = 12;
sprintf (brief, "%02d:%02d %cM", hour, tm->tm_min,
snprintf (brief, sizeof(brief), "%02d:%02d %cM", hour, tm->tm_min,
tm->tm_hour >= 12 ? 'P' : 'A');
return brief;
}
@ -539,7 +539,8 @@ TimeString (ClockWidget w, struct tm *tm)
static char utime[35];
Time_t tsec;
tsec = time(NULL);
sprintf (utime, "%10lu seconds since Epoch", (unsigned long)tsec);
snprintf (utime, sizeof(utime), "%10lu seconds since Epoch",
(unsigned long)tsec);
return utime;
} else if (*w->clock.strftime) {
/*Note: this code is probably excessively paranoid
@ -584,7 +585,7 @@ Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args)
if(!w->clock.analog) {
char *str;
struct tm tm;
Time_t time_value;
struct timeval tv;
int len;
#ifndef NO_I18N
@ -612,8 +613,8 @@ Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args)
}
#endif /* NO_I18N */
(void) time(&time_value);
tm = *localtime(&time_value);
X_GETTIMEOFDAY(&tv);
tm = *localtime(&tv.tv_sec);
str = TimeString (w, &tm);
len = strlen(str);
if (len && str[len - 1] == '\n') str[--len] = '\0';
@ -623,13 +624,13 @@ Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args)
{
XGlyphInfo extents;
#ifndef NO_I18N
# ifdef HAVE_ICONV
# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
char *utf8_str;
# endif
if (w->clock.utf8)
XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
(FcChar8 *) str, len, &extents);
# ifdef HAVE_ICONV
# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
else if ((utf8_str = clock_to_utf8(str, len)) != NULL) {
XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
(FcChar8 *)utf8_str, strlen(utf8_str), &extents);
@ -725,7 +726,7 @@ Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args)
/* make invalid update's use a default */
/*if (w->clock.update <= 0) w->clock.update = 60;*/
w->clock.show_second_hand = (abs(w->clock.update) <= SECOND_HAND_TIME);
w->clock.show_second_hand = (abs((int) w->clock.update) <= SECOND_HAND_TIME);
w->clock.numseg = 0;
w->clock.interval_id = 0;
memset (&w->clock.otm, '\0', sizeof (w->clock.otm));
@ -815,7 +816,7 @@ RenderTextBounds (ClockWidget w, char *str, int off, int len,
int x, y;
#ifndef NO_I18N
# ifdef HAVE_ICONV
# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
char *utf8_str;
# endif
if (w->clock.utf8)
@ -825,7 +826,7 @@ RenderTextBounds (ClockWidget w, char *str, int off, int len,
XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
(FcChar8 *) str + off, len - off, &tail);
}
# ifdef HAVE_ICONV
# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
else if ((utf8_str = clock_to_utf8(str, off)) != NULL)
{
XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
@ -1090,15 +1091,21 @@ RenderHands (ClockWidget w, struct tm *tm, Boolean draw)
}
static void
RenderSec (ClockWidget w, struct tm *tm, Boolean draw)
RenderSec (ClockWidget w, struct tm *tm, struct timeval *tv, Boolean draw)
{
double c, s;
XPointDouble poly[10];
double inner_x, middle_x, outer_x, far_x;
double middle_y;
double line_y;
double sec;
ClockAngle (tm->tm_sec * 60, &c, &s);
sec = tm->tm_sec;
if (w->clock.update < 1.0)
sec += tv->tv_usec / 1000000.0;
ClockAngle ((int) (sec * 60.0), &c, &s);
s = -s;
@ -1249,6 +1256,69 @@ Redisplay(Widget gw, XEvent *event, Region region)
clock_tic((XtPointer)w, (XtIntervalId *)NULL);
}
#define USEC_MILLIS(us) ((unsigned long) (us) / 1000)
#define SEC_MILLIS(s) ((unsigned long) (s) * 1000)
#define MIN_MILLIS(m) SEC_MILLIS((unsigned long) (m) * 60)
#define HOUR_MILLIS(h) MIN_MILLIS((unsigned long) (h) * 60)
#define DAY_MILLIS HOUR_MILLIS((unsigned long) 24)
#define MIN_SECS(m) ((unsigned long) (m) * 60)
#define HOUR_SECS(h) MIN_SECS((unsigned long) (h) * 60)
/* Seconds since midnight */
static unsigned long
time_seconds(struct tm *tm)
{
return HOUR_SECS(tm->tm_hour) + MIN_SECS(tm->tm_min) + tm->tm_sec;
}
/* Milliseconds since midnight */
static unsigned long
time_millis(struct tm *tm, struct timeval *tv)
{
return time_seconds(tm) * 1000 + USEC_MILLIS(tv->tv_usec);
}
/* Round milliseconds to number of intervals (measured in milliseconds) */
static unsigned long
time_intervals(unsigned long millis, unsigned long interval)
{
return (millis + interval / 2) / interval;
}
/*
* Round the current time to the nearest update interval using
* milliseconds since midnight
*/
static void
round_time(float _update, struct tm *tm, struct timeval *tv)
{
/* interval in milliseconds */
unsigned long update = (int) (_update * 1000.0 + 0.5);
/* compute milliseconds since midnight */
unsigned long old_secs = time_seconds(tm);
unsigned long old_millis = time_millis(tm, tv);
/* Nearest number of intervals since midnight */
unsigned long intervals = time_intervals(old_millis, update);
/* The number of milliseconds for that number of intervals */
unsigned long new_millis = intervals * update;
time_t t;
if (new_millis > DAY_MILLIS)
new_millis = DAY_MILLIS;
/* Compute the time_t of that interval by subtracting off the real
* seconds and adding back in the desired second
*/
t = tv->tv_sec - old_secs + new_millis / 1000;
*tm = *localtime(&t);
tv->tv_usec = (new_millis % 1000) * 1000;
}
/* Choose the update times for well-defined clock states.
*
* For example, in HH:MM:SS notation the last number rolls over
@ -1329,36 +1399,22 @@ Redisplay(Widget gw, XEvent *event, Region region)
* The code below implements (2) with n this year's duration in seconds
* and using local time year's start as epoch.
*/
static unsigned long
waittime(int update, struct timeval *tv, struct tm *tm)
waittime(float _update, struct timeval *tv, struct tm *tm)
{
int twait;
long twaitms;
unsigned long retval;
unsigned long update_millis = (unsigned long) (_update * 1000 + 0.5);
unsigned long millis = time_millis(tm, tv);
unsigned long intervals = time_intervals(millis, update_millis);
unsigned long next = intervals + 1;
unsigned long next_millis = next * update_millis;
unsigned long result;
if(update>0) {
long tcur;
int trem;
if (next_millis > DAY_MILLIS)
next_millis = DAY_MILLIS;
tcur=tm->tm_sec+60*(tm->tm_min+60*(tm->tm_hour+24*tm->tm_yday));
/* ti=floor(tcur/u)*u, w=u-(tcur-ti), and tcur-ti==tcur % u */
trem=tcur % update;
twait=update-trem;
} else {
twait=-update;
}
if(tv->tv_usec>0) {
long usec;
twait--;
usec=1000000-tv->tv_usec;
twaitms=(usec+999)/1000; /* must round up to avoid zero retval */
} else {
twaitms=0;
}
retval=(unsigned long)labs(twaitms+1000*twait);
return retval;
result = next_millis - millis;
return result;
}
/* ARGSUSED */
@ -1367,20 +1423,20 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
{
ClockWidget w = (ClockWidget)client_data;
struct tm tm;
Time_t time_value;
struct timeval tv;
char *time_ptr;
register Display *dpy = XtDisplay(w);
register Window win = XtWindow(w);
X_GETTIMEOFDAY (&tv);
time_value = tv.tv_sec;
tm = *localtime(&time_value);
tm = *localtime(&tv.tv_sec);
if (w->clock.update && (id || !w->clock.interval_id))
w->clock.interval_id =
XtAppAddTimeOut( XtWidgetToApplicationContext( (Widget) w),
waittime(w->clock.update, &tv, &tm),
clock_tic, (XtPointer)w );
round_time(w->clock.update, &tm, &tv);
/*
* Beep on the half hour; double-beep on the hour.
*/
@ -1422,7 +1478,7 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
{
XRectangle old_tail, new_tail, head;
int x, y;
#if !defined(NO_I18N) && defined(HAVE_ICONV)
#if !defined(NO_I18N) && defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
char *utf8_str;
#endif
@ -1452,7 +1508,7 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
(FcChar8 *) time_ptr + i, len - i);
}
# ifdef HAVE_ICONV
# if defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
else if ((utf8_str =
clock_to_utf8(time_ptr + i, len - i)) != NULL) {
XftDrawStringUtf8 (w->clock.draw,
@ -1555,10 +1611,11 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
RenderHands (w, &tm, False);
}
if (w->clock.show_second_hand &&
tm.tm_sec != w->clock.otm.tm_sec)
(tm.tm_sec != w->clock.otm.tm_sec ||
tv.tv_usec != w->clock.otv.tv_usec))
{
RenderSec (w, &w->clock.otm, False);
RenderSec (w, &tm, False);
RenderSec (w, &w->clock.otm, &w->clock.otv, False);
RenderSec (w, &tm, &tv, False);
}
if (w->clock.damage.width &&
w->clock.damage.height)
@ -1567,9 +1624,10 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
DrawClockFace (w);
RenderHands (w, &tm, True);
if (w->clock.show_second_hand == TRUE)
RenderSec (w, &tm, True);
RenderSec (w, &tm, &tv, True);
}
w->clock.otm = tm;
w->clock.otv = tv;
RenderUpdate (w);
RenderResetBounds (&w->clock.damage);
return;
@ -1580,7 +1638,8 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
if (w->clock.numseg == 0 ||
tm.tm_min != w->clock.otm.tm_min ||
tm.tm_hour != w->clock.otm.tm_hour) {
tm.tm_hour != w->clock.otm.tm_hour ||
tm.tm_sec != w->clock.otm.tm_sec) {
w->clock.segbuffptr = w->clock.segbuff;
w->clock.numseg = 0;
/*
@ -1591,7 +1650,7 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
*/
DrawHand(w,
w->clock.minute_hand_length, w->clock.hand_width,
tm.tm_min * 60
tm.tm_min * 60 + tm.tm_sec
);
if(w->clock.Hdpixel != w->core.background_pixel)
XFillPolygon( dpy,
@ -1629,7 +1688,7 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
w->clock.second_hand_length - 2,
w->clock.second_hand_width,
w->clock.minute_hand_length + 2,
tm.tm_sec * 60
tm.tm_sec * 60 + tv.tv_usec * 60 / 1000000
);
if(w->clock.Hdpixel != w->core.background_pixel)
XFillPolygon( dpy,
@ -1647,6 +1706,7 @@ clock_tic(XtPointer client_data, XtIntervalId *id)
}
w->clock.otm = tm;
w->clock.otv = tv;
}
}
@ -1678,7 +1738,8 @@ erase_hands(ClockWidget w, struct tm *tm)
}
}
if(!tm || tm->tm_min != w->clock.otm.tm_min ||
tm->tm_hour != w->clock.otm.tm_hour)
tm->tm_hour != w->clock.otm.tm_hour ||
tm->tm_sec != w->clock.otm.tm_sec)
{
XDrawLines( dpy, win,
w->clock.EraseGC,
@ -2113,7 +2174,7 @@ SetValues(Widget gcurrent, Widget grequest, Widget gnew,
if (new->clock.update && XtIsRealized( (Widget) new))
new->clock.interval_id = XtAppAddTimeOut(
XtWidgetToApplicationContext(gnew),
abs(new->clock.update)*1000,
fabsf(new->clock.update)*1000,
clock_tic, (XtPointer)gnew);
new->clock.show_second_hand =(abs(new->clock.update) <= SECOND_HAND_TIME);
@ -2207,7 +2268,7 @@ SetValues(Widget gcurrent, Widget grequest, Widget gnew,
}
#if !defined(NO_I18N) && defined(HAVE_ICONV)
#if !defined(NO_I18N) && defined(HAVE_ICONV) && defined(HAVE_NL_LANGINFO)
static char *
clock_to_utf8(const char *str, int in_len)
{

View File

@ -85,7 +85,7 @@ typedef struct {
GC HandGC; /* Hand GC */
GC HighGC; /* Highlighting GC */
/* start of graph stuff */
int update; /* update period in second */
float update; /* update period in second */
Dimension radius; /* radius factor */
int backing_store; /* backing store type */
Boolean chime;
@ -109,6 +109,7 @@ typedef struct {
XPoint *segbuffptr;
XPoint *hour, *sec;
struct tm otm ;
struct timeval otv ;
XtIntervalId interval_id;
char prev_time_string[STRFTIME_BUFF_SIZE];
#ifndef NO_I18N

View File

@ -23,6 +23,7 @@ SUBDIRS = man
bin_PROGRAMS = xclock
AM_CFLAGS = $(CWARNFLAGS) $(XCLOCK_CFLAGS)
AM_CPPFLAGS = -D_CONST_X_STRING
xclock_LDADD = $(XCLOCK_LIBS)
xclock_SOURCES = \
@ -42,6 +43,7 @@ dist_appdefault_DATA = \
app-defaults/XClock
EXTRA_DIST = \
README.md \
clmask.bit \
clock.bit

View File

@ -74,7 +74,7 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = xclock$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
DIST_COMMON = $(am__configure_deps) $(dist_appdefault_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure COPYING \
ChangeLog INSTALL compile config.guess config.rpath config.sub \
@ -348,6 +348,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = man
AM_CFLAGS = $(CWARNFLAGS) $(XCLOCK_CFLAGS)
AM_CPPFLAGS = -D_CONST_X_STRING
xclock_LDADD = $(XCLOCK_LIBS)
xclock_SOURCES = \
Clock.c \
@ -363,6 +364,7 @@ dist_appdefault_DATA = \
app-defaults/XClock
EXTRA_DIST = \
README.md \
clmask.bit \
clock.bit

View File

@ -1,27 +0,0 @@
xclock is the classic X Window System clock utility. It displays
the time in analog or digital form, continuously updated at a
frequency which may be specified by the user.
All questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg
Please submit bug reports to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
The master development code repository can be found at:
git://anongit.freedesktop.org/git/xorg/app/xclock
http://cgit.freedesktop.org/xorg/app/xclock
For patch submission instructions, see:
http://www.x.org/wiki/Development/Documentation/SubmittingPatches
For more information on the git code manager, see:
http://wiki.x.org/wiki/GitPage

19
app/xclock/README.md Normal file
View File

@ -0,0 +1,19 @@
xclock is the classic X Window System clock utility. It displays
the time in analog or digital form, continuously updated at a
frequency which may be specified by the user.
All questions regarding this software should be directed at the
Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
The master development code repository can be found at:
https://gitlab.freedesktop.org/xorg/app/xclock
Please submit bug reports and requests to merge patches there.
For patch submission instructions, see:
https://www.x.org/wiki/Development/Documentation/SubmittingPatches

1137
app/xclock/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify

View File

@ -12,6 +12,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `nl_langinfo' function. */
#undef HAVE_NL_LANGINFO
/* Define to 1 if you have the `pledge' function. */
#undef HAVE_PLEDGE

569
app/xclock/configure vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xclock 1.0.7.
# Generated by GNU Autoconf 2.69 for xclock 1.0.9.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xclock/issues>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@ -267,7 +267,7 @@ fi
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
$0: https://gitlab.freedesktop.org/xorg/app/xclock/issues
$0: about your system, including any error possibly output
$0: before this message. Then install a modern shell, or
$0: manually run the script under such a shell if you do
@ -581,11 +581,12 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xclock'
PACKAGE_TARNAME='xclock'
PACKAGE_VERSION='1.0.7'
PACKAGE_STRING='xclock 1.0.7'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_VERSION='1.0.9'
PACKAGE_STRING='xclock 1.0.9'
PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xclock/issues'
PACKAGE_URL=''
ac_unique_file="Makefile.am"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
@ -1331,7 +1332,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures xclock 1.0.7 to adapt to many kinds of systems.
\`configure' configures xclock 1.0.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1401,7 +1402,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of xclock 1.0.7:";;
short | recursive ) echo "Configuration of xclock 1.0.9:";;
esac
cat <<\_ACEOF
@ -1467,7 +1468,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
Report bugs to <https://gitlab.freedesktop.org/xorg/app/xclock/issues>.
_ACEOF
ac_status=$?
fi
@ -1530,7 +1531,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
xclock configure 1.0.7
xclock configure 1.0.9
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1854,7 +1855,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by xclock $as_me 1.0.7, which was
It was created by xclock $as_me 1.0.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2202,6 +2203,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
# Initialize Automake
am__api_version='1.12'
ac_aux_dir=
@ -2678,7 +2684,7 @@ fi
# Define the identity of the package.
PACKAGE='xclock'
VERSION='1.0.7'
VERSION='1.0.9'
cat >>confdefs.h <<_ACEOF
@ -2725,29 +2731,6 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
$as_echo "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
MAINT=$MAINTAINER_MODE_TRUE
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
@ -10345,10 +10328,11 @@ _ACEOF
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
echo 'git directory not found: installing possibly empty changelog.' >&2)"
|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
touch \$(top_srcdir)/ChangeLog; \
echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
@ -10356,14 +10340,45 @@ echo 'git directory not found: installing possibly empty changelog.' >&2)"
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
touch \$(top_srcdir)/INSTALL; \
echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
case $host_os in
solaris*)
# Solaris 2.0 - 11.3 use SysV man page section numbers, so we
# check for a man page file found in later versions that use
# traditional section numbers instead
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/man/man7/attributes.7" >&5
$as_echo_n "checking for /usr/share/man/man7/attributes.7... " >&6; }
if ${ac_cv_file__usr_share_man_man7_attributes_7+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "/usr/share/man/man7/attributes.7"; then
ac_cv_file__usr_share_man_man7_attributes_7=yes
else
ac_cv_file__usr_share_man_man7_attributes_7=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_man_man7_attributes_7" >&5
$as_echo "$ac_cv_file__usr_share_man_man7_attributes_7" >&6; }
if test "x$ac_cv_file__usr_share_man_man7_attributes_7" = xyes; then :
SYSV_MAN_SECTIONS=false
else
SYSV_MAN_SECTIONS=true
fi
;;
*) SYSV_MAN_SECTIONS=false ;;
esac
if test x$APP_MAN_SUFFIX = x ; then
APP_MAN_SUFFIX=1
fi
@ -10379,8 +10394,8 @@ if test x$LIB_MAN_DIR = x ; then
fi
if test x$FILE_MAN_SUFFIX = x ; then
case $host_os in
solaris*) FILE_MAN_SUFFIX=4 ;;
case $SYSV_MAN_SECTIONS in
true) FILE_MAN_SUFFIX=4 ;;
*) FILE_MAN_SUFFIX=5 ;;
esac
fi
@ -10389,8 +10404,8 @@ if test x$FILE_MAN_DIR = x ; then
fi
if test x$MISC_MAN_SUFFIX = x ; then
case $host_os in
solaris*) MISC_MAN_SUFFIX=5 ;;
case $SYSV_MAN_SECTIONS in
true) MISC_MAN_SUFFIX=5 ;;
*) MISC_MAN_SUFFIX=7 ;;
esac
fi
@ -10399,8 +10414,8 @@ if test x$MISC_MAN_DIR = x ; then
fi
if test x$DRIVER_MAN_SUFFIX = x ; then
case $host_os in
solaris*) DRIVER_MAN_SUFFIX=7 ;;
case $SYSV_MAN_SECTIONS in
true) DRIVER_MAN_SUFFIX=7 ;;
*) DRIVER_MAN_SUFFIX=4 ;;
esac
fi
@ -10409,8 +10424,8 @@ if test x$DRIVER_MAN_DIR = x ; then
fi
if test x$ADMIN_MAN_SUFFIX = x ; then
case $host_os in
solaris*) ADMIN_MAN_SUFFIX=1m ;;
case $SYSV_MAN_SECTIONS in
true) ADMIN_MAN_SUFFIX=1m ;;
*) ADMIN_MAN_SUFFIX=8 ;;
esac
fi
@ -10491,12 +10506,7 @@ AM_BACKSLASH='\'
ac_config_headers="$ac_config_headers config.h"
for ac_func in strlcpy getpid pledge
for ac_func in strlcpy getpid nl_langinfo pledge
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@ -10547,38 +10557,12 @@ if test "${PATH_SEPARATOR+set}" != set; then
}
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
if test -n "$LD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld" >&5
$as_echo_n "checking for ld... " >&6; }
elif test "$GCC" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
$as_echo_n "checking for ld used by $CC... " >&6; }
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[\\/]* | ?:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the pathname of ld
ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
@ -10586,10 +10570,49 @@ else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
$as_echo_n "checking for non-GNU ld... " >&6; }
fi
if ${acl_cv_path_LD+:} false; then :
if test -n "$LD"; then
# Let the user override the test with a path.
:
else
if ${acl_cv_path_LD+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$LD"; then
acl_cv_path_LD= # Final result of this test
ac_prog=ld # Program to search in $PATH
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $acl_output in
# Accept absolute paths.
[\\/]* | ?:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the pathname of ld
acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
done
# Got the pathname. No search in PATH is needed.
acl_cv_path_LD="$acl_output"
ac_prog=
;;
"")
# If it fails, then pretend we aren't using GCC.
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
fi
if test -n "$ac_prog"; then
# Search for $ac_prog in $PATH.
acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$acl_save_ifs"
@ -10610,20 +10633,66 @@ else
fi
done
IFS="$acl_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi
case $host in
*-*-aix*)
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined __powerpc64__ || defined _ARCH_PPC64
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
# The compiler produces 64-bit code. Add option '-b64' so that the
# linker groks 64-bit object files.
case "$acl_cv_path_LD " in
*" -b64 "*) ;;
*) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
sparc64-*-netbsd*)
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined __sparcv9 || defined __arch64__
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
# The compiler produces 32-bit code. Add option '-m elf32_sparc'
# so that the linker groks 32-bit object files.
case "$acl_cv_path_LD " in
*" -m elf32_sparc "*) ;;
*) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
esac
fi
LD="$acl_cv_path_LD"
LD="$acl_cv_path_LD"
fi
if test -n "$LD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
$as_echo "$LD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
if ${acl_cv_prog_gnu_ld+:} false; then :
@ -10680,8 +10749,240 @@ fi
acl_libdirstem=lib
acl_libdirstem2=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5
$as_echo_n "checking 32-bit host C ABI... " >&6; }
if ${gl_cv_host_cpu_c_abi_32bit+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$gl_cv_host_cpu_c_abi"; then
case "$gl_cv_host_cpu_c_abi" in
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
gl_cv_host_cpu_c_abi_32bit=yes ;;
*)
gl_cv_host_cpu_c_abi_32bit=no ;;
esac
else
case "$host_cpu" in
i[4567]86 )
gl_cv_host_cpu_c_abi_32bit=yes
;;
x86_64 )
# On x86_64 systems, the C compiler may be generating code in one of
# these ABIs:
# - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
# - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
# with native Windows (mingw, MSVC).
# - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if (defined __x86_64__ || defined __amd64__ \
|| defined _M_X64 || defined _M_AMD64) \
&& !(defined __ILP32__ || defined _ILP32)
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
arm* | aarch64 )
# Assume arm with EABI.
# On arm64 systems, the C compiler may be generating code in one of
# these ABIs:
# - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
# - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
# - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
# On hppa, the C compiler may be generating 32-bit code or 64-bit
# code. In the latter case, it defines _LP64 and __LP64__.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __LP64__
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
ia64* )
# On ia64 on HP-UX, the C compiler may be generating 64-bit code or
# 32-bit code. In the latter case, it defines _ILP32.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef _ILP32
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=yes
else
gl_cv_host_cpu_c_abi_32bit=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
mips* )
# We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
# at 32.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
powerpc* )
# Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
# No need to distinguish them here; the caller may distinguish
# them based on the OS.
# On powerpc64 systems, the C compiler may still be generating
# 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
# be generating 64-bit code.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined __powerpc64__ || defined _ARCH_PPC64
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
rs6000 )
gl_cv_host_cpu_c_abi_32bit=yes
;;
riscv32 | riscv64 )
# There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
# Size of 'long' and 'void *':
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined __LP64__
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
s390* )
# On s390x, the C compiler may be generating 64-bit (= s390x) code
# or 31-bit (= s390) code.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined __LP64__ || defined __s390x__
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
sparc | sparc64 )
# UltraSPARCs running Linux have `uname -m` = "sparc64", but the
# C compiler still generates 32-bit code.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined __sparcv9 || defined __arch64__
int ok;
#else
error fail
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_host_cpu_c_abi_32bit=no
else
gl_cv_host_cpu_c_abi_32bit=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
*)
gl_cv_host_cpu_c_abi_32bit=no
;;
esac
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5
$as_echo "$gl_cv_host_cpu_c_abi_32bit" >&6; }
HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
case "$host_os" in
solaris*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
@ -10691,24 +10992,34 @@ if ${gl_cv_solaris_64bit+:} false; then :
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef _LP64
sixtyfour bits
#endif
int ok;
#else
error fail
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "sixtyfour bits" >/dev/null 2>&1; then :
if ac_fn_c_try_compile "$LINENO"; then :
gl_cv_solaris_64bit=yes
else
gl_cv_solaris_64bit=no
fi
rm -f conftest*
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
$as_echo "$gl_cv_solaris_64bit" >&6; }
$as_echo "$gl_cv_solaris_64bit" >&6; };;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; }
if ${acl_cv_libdirstems+:} false; then :
$as_echo_n "(cached) " >&6
else
acl_libdirstem=lib
acl_libdirstem2=
case "$host_os" in
solaris*)
if test $gl_cv_solaris_64bit = yes; then
acl_libdirstem=lib/64
case "$host_cpu" in
@ -10718,7 +11029,14 @@ $as_echo "$gl_cv_solaris_64bit" >&6; }
fi
;;
*)
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
if test "$HOST_CPU_C_ABI_32BIT" != yes; then
searchpath=`(if test -f /usr/bin/gcc \
&& LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
LC_ALL=C /usr/bin/gcc -print-search-dirs; \
else \
LC_ALL=C $CC -print-search-dirs; \
fi) 2>/dev/null \
| sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
if test -n "$searchpath"; then
acl_save_IFS="${IFS= }"; IFS=":"
for searchdir in $searchpath; do
@ -10737,10 +11055,18 @@ $as_echo "$gl_cv_solaris_64bit" >&6; }
done
IFS="$acl_save_IFS"
fi
fi
;;
esac
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5
$as_echo "$acl_cv_libdirstems" >&6; }
# Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2.
acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'`
@ -10789,7 +11115,7 @@ if test "${with_libiconv_prefix+set}" = set; then :
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
if test "$acl_libdirstem2" != "$acl_libdirstem" \
&& ! test -d "$withval/$acl_libdirstem"; then
&& test ! -d "$withval/$acl_libdirstem"; then
additional_libdir="$withval/$acl_libdirstem2"
fi
fi
@ -11211,7 +11537,6 @@ fi
am_save_CPPFLAGS="$CPPFLAGS"
for element in $INCICONV; do
@ -11412,15 +11737,27 @@ int result = 0;
#endif
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
provided. */
if (/* Try standardized names. */
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
{
/* Try standardized names. */
iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
/* Try IRIX, OSF/1 names. */
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
/* Try AIX names. */
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
/* Try HP-UX names. */
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
iconv_t cd4 = iconv_open ("utf8", "eucJP");
if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
&& cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
result |= 16;
if (cd1 != (iconv_t)(-1))
iconv_close (cd1);
if (cd2 != (iconv_t)(-1))
iconv_close (cd2);
if (cd3 != (iconv_t)(-1))
iconv_close (cd3);
if (cd4 != (iconv_t)(-1))
iconv_close (cd4);
}
return result;
;
@ -11510,13 +11847,15 @@ fi
$am_cv_proto_iconv" >&5
$as_echo "
$am_cv_proto_iconv" >&6; }
else
am_cv_proto_iconv_arg1=""
fi
cat >>confdefs.h <<_ACEOF
#define ICONV_CONST $am_cv_proto_iconv_arg1
_ACEOF
fi
@ -12115,10 +12454,6 @@ else
am__EXEEXT_FALSE=
fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -12528,7 +12863,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by xclock $as_me 1.0.7, which was
This file was extended by xclock $as_me 1.0.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -12588,13 +12923,13 @@ $config_headers
Configuration commands:
$config_commands
Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
Report bugs to <https://gitlab.freedesktop.org/xorg/app/xclock/issues>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
xclock config.status 1.0.7
xclock config.status 1.0.9
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@ -12723,8 +13058,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;

View File

@ -21,13 +21,17 @@ dnl PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xclock],
[1.0.7],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[1.0.9],
[https://gitlab.freedesktop.org/xorg/app/xclock/issues],
[xclock])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
@ -35,11 +39,7 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AC_CONFIG_HEADERS([config.h])
AC_CHECK_FUNCS([strlcpy getpid pledge])
AC_CHECK_FUNCS([strlcpy getpid nl_langinfo pledge])
AM_ICONV

View File

@ -133,7 +133,7 @@ quit(Widget w, XEvent *event, String *params, Cardinal *num_params)
Arg arg;
if (event->type == ClientMessage &&
event->xclient.data.l[0] != wm_delete_window) {
(Atom)event->xclient.data.l[0] != wm_delete_window) {
#ifdef XKB
XkbStdBell(XtDisplay(w), XtWindow(w), 0, XkbBI_MinorError);
#else
@ -228,6 +228,14 @@ main(int argc, char *argv[])
#endif
#ifdef HAVE_PLEDGE
{
/* force reading of XErrorDB into memory to avoid adding "rpath" to
pledge below */
int r;
char buf[1];
r = XGetErrorDatabaseText(XtDisplay(toplevel), "XProtoError", "0", "", buf, 1);
}
if (pledge("stdio", NULL) == -1)
err(1, "pledge");
#endif