[Pcsclite-git-commit] [pcsc-tools] 01/32: Convert to autoconf/automake
Ludovic Rousseau
rousseau at moszumanska.debian.org
Thu May 4 15:44:46 UTC 2017
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository pcsc-tools.
commit 54b87b9fd9617a4905969b9801d2a288847ff00f
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date: Sat Apr 8 14:20:00 2017 +0200
Convert to autoconf/automake
---
Makefile | 54 ------------------------------------------------
Makefile.am | 10 +++++++++
bootstrap | 16 +++++++++++++++
configure.ac | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 93 insertions(+), 54 deletions(-)
diff --git a/Makefile b/Makefile
deleted file mode 100644
index eb3157a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-# PC/SC Lite libraries and headers.
-PCSC_CFLAGS ?= $(shell pkg-config libpcsclite --cflags)
-PCSC_LDLIBS ?= $(shell pkg-config libpcsclite --libs)
-
-# by default install in /usr/local
-DESTDIR ?= /usr/local
-
-VERSION := $(shell pwd | sed s/.*tools-//)
-CFLAGS := $(CFLAGS) -DVERSION=\"$(VERSION)\" $(PCSC_CFLAGS)
-LDLIBS := $(PCSC_LDLIBS)
-# On xBSD systems use
-#LDLIBS = -lc_r $(PCSC_LDLIBS)
-# on MacOSX
-#CFLAGS = -Wall -O2 -DVERSION=\"$(VERSION)\"
-#LDLIBS = -framework PCSC
-
-BIN = pcsc_scan
-BIN_SCRIPT = ATR_analysis gscriptor scriptor
-MAN = pcsc_scan.1.gz gscriptor.1p.gz scriptor.1p.gz ATR_analysis.1p.gz
-
-all: $(BIN) $(MAN)
-
-pcsc_scan: pcsc_scan.o
-
-INSTALL_PREFIX ?= /usr
-INSTALL_BIN_DIR ?= $(INSTALL_PREFIX)/bin
-INSTALL_DATA_DIR ?= $(INSTALL_PREFIX)/share
-INSTALL_MAN_DIR ?= $(INSTALL_DATA_DIR)/man
-
-install: all
- install -d $(DESTDIR)$(INSTALL_BIN_DIR)/
- install $(BIN) $(DESTDIR)$(INSTALL_BIN_DIR)/
-
- install $(BIN_SCRIPT) $(DESTDIR)$(INSTALL_BIN_DIR)/
-
- install -d $(DESTDIR)$(INSTALL_DATA_DIR)/pcsc
- install -m 644 smartcard_list.txt $(DESTDIR)$(INSTALL_DATA_DIR)/pcsc
-
- install -d $(DESTDIR)$(INSTALL_MAN_DIR)/man1/
- install -m 644 $(MAN) $(DESTDIR)$(INSTALL_MAN_DIR)/man1/
-
-clean:
- rm -f pcsc_scan.o $(BIN) $(MAN)
-
-%.1.gz: %.1
- gzip --best $^ --to-stdout > $@
-
-%.1p.gz: %.1p
- gzip --best $^ --to-stdout > $@
-
-.PHONY: clean all install Changelog
-
-Changelog:
- git log --stat --decorate=short > $@
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..d18d5e4
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,10 @@
+bin_PROGRAMS = pcsc_scan
+pcsc_scan_SOURCES = pcsc_scan.c pcsc_scan.1
+pcsc_scan_CFLAGS = $(PCSC_CFLAGS)
+pcsc_scan_LDADD = $(PCSC_LIBS)
+
+# uncomment the following if pcsc_scan requires the math library
+#pcsc_scan_LDADD=-lm
+
+# install the man pages
+man_MANS=pcsc_scan.1
diff --git a/bootstrap b/bootstrap
new file mode 100755
index 0000000..b3d9018
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# I use
+# - autoconf (GNU Autoconf) 2.64
+# - automake (GNU automake) 1.11
+# - libtool (GNU libtool) 2.2.6
+
+set -e
+set -x
+if test -f Makefile; then
+ make distclean
+fi
+rm -rf *.cache *.m4 config.guess config.log \
+config.status config.sub depcomp ltmain.sh
+#(cat m4/*.m4 > acinclude.m4 2> /dev/null)
+autoreconf --verbose --install
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..2ce6127
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,67 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+
+AC_INIT([pcsc_scan], [1.4.27])
+AC_CONFIG_SRCDIR([pcsc_scan.c])
+AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip)
+
+dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
+AM_CONFIG_HEADER(config.h)
+
+AC_SUBST(VERSION)
+
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_CANONICAL_HOST
+
+if test `uname` == 'Darwin'; then
+ PCSC_PATH="PCSC/"
+fi
+
+dnl Checks for programs.
+AC_PROG_INSTALL
+AC_PROG_CC
+
+dnl Checks for libraries.
+# check pcsc-lite
+PKG_CHECK_EXISTS([libpcsclite],
+ [PKG_CHECK_MODULES(PCSC, libpcsclite, [],
+ [
+ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc -a "x$PKG_CONFIG" != x ; then
+ AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
+ else
+ AC_MSG_WARN([install pcsc-lite])
+ fi
+ ])],
+ [AC_MSG_WARN([libpcsclite not found by pkg-config])]
+)
+
+saved_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
+PCSC_ERROR_MSG="install pcsc-lite, or use ./configure PCSC_CFLAGS=..."
+AC_CHECK_HEADER("$PCSC_PATH"winscard.h,, [AC_MSG_ERROR([$PCSC_ERROR_MSG])])
+
+saved_LIBS="$LIBS"
+LIBS="$LIBS $PCSC_LIBS"
+AC_MSG_CHECKING([for SCardEstablishContext])
+AC_TRY_LINK_FUNC(SCardEstablishContext,
+ [ AC_MSG_RESULT([yes]) ],
+ [ AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite, or use PCSC_LIBS=... ./configure]) ])
+LIBS="$saved_LIBS"
+CPPFLAGS="$saved_CPPFLAGS"
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h time.h string.h stdio.h stdlib.h sys/time.h)
+
+
+AC_HEADER_MAJOR
+dnl AC_CHECK_FUNCS(mkfifo)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+
+dnl Checks for library functions.
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/pcsc-tools.git
More information about the Pcsclite-cvs-commit
mailing list