From 2122e1296789c162595b5441c1dce349d065255b Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Fri, 27 Feb 2015 08:41:44 +0100 Subject: [PATCH] Finally solving platform specific ncurses check in autoconf - cause: broken SYMLINKs to config.sub/guess > one configure.ac works anywhere now. --- configure.ac | 16 +++++++-- dist/1-dist.sh | 5 ++- dist/mac/configure.ac | 58 --------------------------------- dist/ubuntu-make-all-distros.sh | 2 +- dist/ubuntu-make-distro.sh | 3 +- src/hstr.c | 2 +- 6 files changed, 20 insertions(+), 66 deletions(-) delete mode 100644 dist/mac/configure.ac diff --git a/configure.ac b/configure.ac index 24cd46e..f30ab45 100644 --- a/configure.ac +++ b/configure.ac @@ -16,9 +16,19 @@ AM_INIT_AUTOMAKE # Checks for programs. AC_PROG_CC -# ncurses check. -AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])]) -AC_CHECK_HEADER(ncursesw/curses.h) +# Platform specific ncurses check. +AC_CANONICAL_HOST +AS_CASE([$host_os], + [darwin*], + [ + AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])]) + AC_CHECK_HEADER(curses.h) + ], + [ + AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])]) + AC_CHECK_HEADER(ncursesw/curses.h) + ] +) # Checks for libraries. AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])]) diff --git a/dist/1-dist.sh b/dist/1-dist.sh index eaa3abd..83a2c01 100755 --- a/dist/1-dist.sh +++ b/dist/1-dist.sh @@ -9,7 +9,7 @@ aclocal automake --force-missing --add-missing autoconf -rm -rvf autom*te.cache +rm -rvf autom*te.cache config.sub config.guess if [ -d ${AUTOMAKE_LIB} ] then @@ -18,6 +18,9 @@ then cp -vf ${AUTOMAKE_LIB}/depcomp . cp -vf ${AUTOMAKE_LIB}/install-sh . cp -vf ${AUTOMAKE_LIB}/missing . + # platform specific detection in configure.ac + cp -vf ${AUTOMAKE_LIB}/config.sub . + cp -vf ${AUTOMAKE_LIB}/config.guess . else echo "****************************************************************" echo "Error: automake ${AUTOMAKE_LIB} not found - exiting!" diff --git a/dist/mac/configure.ac b/dist/mac/configure.ac deleted file mode 100644 index f85c8a3..0000000 --- a/dist/mac/configure.ac +++ /dev/null @@ -1,58 +0,0 @@ -# -# Process this file with autoconf to produce a configure script. -# - -AC_PREREQ([2.69]) - -AC_INIT(hh, 1.16, martin.dvorak@mindforger.com) -AC_CONFIG_FILES([Makefile src/Makefile man/Makefile]) - -# Checks for src dir existence. -AC_CONFIG_SRCDIR([src/hstr.c]) - -# Init (no longer takes parameters). -AM_INIT_AUTOMAKE - -# Checks for programs. -AC_PROG_CC - -# Mac specific ncurses check -# Unfortunately AC_CANONICAL_HOST macro cannot be used to -# detect Linux/Mac platform as it actives the use of config.sub/config.guess -# which doesn't work when building for launchpad (and @ launchpad) -AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])]) -AC_CHECK_HEADER(curses.h) - -# Checks for libraries. -AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])]) -AC_CHECK_LIB(readline, using_history, [], [AC_MSG_ERROR([Could not find readline library])]) - -# Checks for header files. -AC_CHECK_HEADER(assert.h) -AC_CHECK_HEADER(ctype.h) -AC_CHECK_HEADER(fcntl.h) -AC_CHECK_HEADER(getopt.h) -AC_CHECK_HEADER(locale.h) -AC_CHECK_HEADER(math.h) -AC_CHECK_HEADER(readline/history.h) -AC_CHECK_HEADER(regex.h) -AC_CHECK_HEADER(signal.h) -AC_CHECK_HEADER(stdbool.h) -AC_CHECK_HEADER(stddef.h) -AC_CHECK_HEADER(stdio.h) -AC_CHECK_HEADER(stdlib.h) -AC_CHECK_HEADER(string.h) -AC_CHECK_HEADER(sys/ioctl.h) -AC_CHECK_HEADER(termios.h) -AC_CHECK_HEADER(unistd.h) -AC_CHECK_HEADER(wchar.h) - -# Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_HEADER_STDBOOL -AC_TYPE_SIZE_T - -# Checks for library functions. -AC_FUNC_MALLOC -AC_CHECK_FUNCS([memset strdup strstr]) - -AC_OUTPUT diff --git a/dist/ubuntu-make-all-distros.sh b/dist/ubuntu-make-all-distros.sh index c45035c..56cd71c 100755 --- a/dist/ubuntu-make-all-distros.sh +++ b/dist/ubuntu-make-all-distros.sh @@ -4,7 +4,7 @@ export HHBZRMSG="History timestamps, Zsh support and management fixes." export VERSION=1.16. export MINOR=1 -# precise quantal saucy / precise trusty utopic +# precise quantal saucy precise / trusty utopic for DISTRO in trusty utopic do diff --git a/dist/ubuntu-make-distro.sh b/dist/ubuntu-make-distro.sh index 9797928..9e82a04 100755 --- a/dist/ubuntu-make-distro.sh +++ b/dist/ubuntu-make-distro.sh @@ -11,6 +11,7 @@ export UBUNTUVERSION=$1 #export UBUNTUVERSION=quantal #export UBUNTUVERSION=saucy #export UBUNTUVERSION=trusty +#export UBUNTUVERSION=utopic export HHVERSION=$2 export HHBZRMSG=$3 @@ -35,8 +36,6 @@ function checkout_hh() { mv ../.bzr . cp -rvf ${HHSRC}/* ${HHSRC}/*.* . cd .. - #tar zcf ${HH}.tgz ${HH} - #cp -vf ${H}.tgz ${HH}.orig.tar.gz mv -v ${HH} hh cd ./hh/dist && ./1-dist.sh && cd ../.. } diff --git a/src/hstr.c b/src/hstr.c index 4b970aa..c040474 100644 --- a/src/hstr.c +++ b/src/hstr.c @@ -203,7 +203,7 @@ static const char *HELP_STRING= "\n"; static const char *VERSION_STRING= - "hh version \"1.15\"" + "hh version \"1.17\"" "\n build \""__DATE__" " __TIME__"\"" "\n";