Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize #50

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
## Process this file with automake to produce Makefile.in

EXTRA_DIST = xsel.1x

AM_CFLAGS = @X_CFLAGS@
LDADD = @X_LIBS@
AM_CPPFLAGS = $(X_CFLAGS)
LDADD = $(X_LIBS)

bin_PROGRAMS = xsel

xsel_SOURCES = xsel.c xsel.h

man_MANS = xsel.1x
dist_man_MANS = xsel.1x
24 changes: 7 additions & 17 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,49 +1,39 @@
# Process this file with autoconf to produce a configure script.
AC_INIT([xsel.c])
AM_INIT_AUTOMAKE(xsel, 1.2.0)
AC_INIT([xsel],[1.2.0])
AM_INIT_AUTOMAKE([1.14 foreign dist-xz subdir-objects])
AC_CONFIG_SRCDIR([xsel.c])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET

# Checks for libraries.
AC_PATH_XTRA
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LDFLAGS)
AC_SUBST(X_LIBS)
AC_SUBST(X_EXTRA_LIBS)

AC_SEARCH_LIBS([XOpenDisplay], [X11], [], [AC_MSG_ERROR([libX11 is required])])
PKG_CHECK_MODULES([X], [x11])

# Error out on compile warnings
dnl Add some useful warnings if we have gcc.
dnl changequote(,)dnl
if test "x$ac_cv_prog_gcc" = xyes ; then
CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wdeclaration-after-statement -Wno-unused"
fi
AS_IF([test "x$ac_cv_c_compiler_gnu" = xyes], [
CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Wdeclaration-after-statement -Wno-unused"
])
dnl changequote([,])dnl

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h fcntl.h stdlib.h string.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_HEADER_TIME
AC_TYPE_UID_T

# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([dup2 select strdup strerror strtol])

AC_CONFIG_FILES([Makefile])
Expand Down