autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

modernizing xdiv


From: James K. Lowden
Subject: modernizing xdiv
Date: Sat, 18 Feb 2012 20:29:06 -0500

I thought I'd update the autoconf setup for xdiv to make it work on
OS X.  I did what I thought was needed, and managed to generate a
non-working configure script.  Where did I go wrong?   

Original tarball: http://math.berkeley.edu/~vojta/xdvi/xdvi-22.85.tar.gz
Modified sources: http://www.schemamania.org/xdvi-22.85/

Full output of "nohup sh -x ../configure > log" is in
        http://www.schemamania.org/xdvi-22.85/build/log

Changes so far:

rename configure.in to configure.ac 
rename Makefile.in to Makefile.am
rename aclocal.m4 to acinclude.m4 
remove acinclude.h
update configure.ac, Makefile.am, and acinclude.h (diff below)
run aclocal, autoreconf, autoconf, and automake

Example result:

$ (cd build/ && ../configure --x-include=/usr/X11/include
--x-lib=/usr/X11/lib 2>&1) | tail 
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for whether setsid() is allowed within vfork()... no
checking for waitpid... yes
../configure: line 10559: syntax error: unexpected end of file

I realize there are many sources of error, but it's difficult to know
where to start.   

Details follow.  Many thanks for your kind assistance.  

--jkl

$ (autoconf --version; automake --version) |  grep ^auto
autoconf (GNU Autoconf) 2.61
automake (GNU automake) 1.10

 --- /tmp/xdvi-22.85/configure.in        2008-03-27 18:04:48.000000000
-0400 +++ configure.ac        2012-02-18 18:19:11.000000000 -0500
@@ -1,7 +1,9 @@
 dnl Process this file with xautoconf (not autoconf!) to produce a
 dnl configure script.  See xautocnf.txt for details on xautoconf.
 dnl
-AC_INIT(xdvi.c)
+AC_INIT([xdvi], [22.85])
+AM_INIT_AUTOMAKE
+AC_CONFIG_SRCDIR([xdvi.c])
 AC_CONFIG_HEADER(config.h:config.hin)
 
 AC_PROG_CC
@@ -24,7 +26,7 @@
 
 AC_PATH_X
 AC_PATH_XTRA
-AC_REQUIRE_X
+dnl jkl AC_REQUIRE_X
 
 ac_save_cpp=$ac_cpp
 ac_cpp="$ac_cpp $X_CFLAGS"
@@ -316,9 +318,10 @@
                           set default print command to CMD],
 DEFAULT_DVIPS_PATH, "dvips")
 
-AC_SUBST(OPT_SRCS)dnl
-AC_SUBST(OPT_OBJS)dnl
+AC_SUBST(OPT_SRCS)
+AC_SUBST(OPT_OBJS)
 
 dnl Done.
 dnl Makefile is automatically included, unless imake is in use.
-AC_OUTPUT()
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT

--- /tmp/xdvi-22.85/Makefile.in 2003-11-17 20:43:12.000000000 -0500
+++ Makefile.am 2012-02-18 18:05:33.000000000 -0500
@@ -27,7 +27,7 @@
 address@hidden@
 
 address@hidden@
address@hidden@ @x_linker_options@ @X_LIBS@
address@hidden@ @x_linker_options@ @X_LIBS@
 address@hidden@ -lX11 @X_EXTRA_LIBS@
 address@hidden@ @MATH_LIB@
 
@@ -38,12 +38,12 @@
 
 address@hidden@
 address@hidden@
address@hidden@
+## jkl address@hidden@
 
 all: xdvi$(EXEEXT) xdvi.man
 
 xdvi$(EXEEXT): $(OBJS)
-       $(CC) $(X_LDFLAGS) -o xdvi $(OBJS) $(X_LIBS) $(LIBS)
+       $(CC) $(LDFLAGS_XDVI) -o xdvi $(OBJS) $(X_LIBS) $(LIBS)
        $(CHMOD) go+rx xdvi$(EXEEXT)
 
 .c.o:

# The m4 stuff is all about quoting 

--- /tmp/xdvi-22.85/aclocal.m4  2003-11-17 20:40:08.000000000 -0500
+++ acinclude.m4        2012-02-18 17:48:19.000000000 -0500
@@ -1,6 +1,6 @@
 dnl ### Determine integer type to use for bitmaps
 
-AC_DEFUN(XDVI_C_BITMAP_TYPE,
+AC_DEFUN([XDVI_C_BITMAP_TYPE],
 [AC_MSG_CHECKING(for integer type to use in bitmaps)
 AC_CACHE_VAL(xdvi_cv_bitmap_type,
 [AC_TRY_RUN(
@@ -29,7 +29,7 @@
 
 dnl ### Check for whether the C compiler does string concatenation
 
-AC_DEFUN(XDVI_CC_CONCAT,
+AC_DEFUN([XDVI_CC_CONCAT],
 [AC_CACHE_CHECK([for whether the C compiler supports string
concatenation], xdvi_cc_concat,
 [AC_TRY_COMPILE(
@@ -46,7 +46,7 @@
 
 dnl ### Check for at-least-pretend Streams capability
 
-AC_DEFUN(XDVI_SYS_STREAMS,
+AC_DEFUN([XDVI_SYS_STREAMS],
 [AC_CACHE_CHECK([for stropts.h and isastream()], xdvi_cv_sys_streams,
 [AC_TRY_LINK(
 [#include <stropts.h>
@@ -62,7 +62,7 @@
 
 dnl ### Check for poll()
 
-AC_DEFUN(XDVI_FUNC_POLL,
+AC_DEFUN([XDVI_FUNC_POLL],
 [AC_CACHE_CHECK([for poll.h and poll()], xdvi_cv_func_poll,
 [AC_TRY_LINK(
 [#include <poll.h>
@@ -77,7 +77,7 @@
 
 dnl ### Check for ulltostr() and for the long long type
 
-AC_DEFUN(XDVI_FUNC_ULLTOSTR,
+AC_DEFUN([XDVI_FUNC_ULLTOSTR],
 [AC_CACHE_CHECK([for the function ulltostr() and the long long type],
 xdvi_cv_func_ulltostr,
 [AC_TRY_LINK(
@@ -97,7 +97,7 @@
 
 dnl ### Check for a C99-compatible implementation of (v)snprintf()
 
-AC_DEFUN(XDVI_FUNC_C99_VSNPRINTF,
+AC_DEFUN([XDVI_FUNC_C99_VSNPRINTF],
 [AC_CACHE_CHECK([for a c99-compatible implementation of (v)snprintf()],
 xdvi_cv_func_good_vsnprintf,
 [AC_TRY_RUN(
@@ -116,7 +116,7 @@
 
 dnl ### Check for SunOS 4
 
-AC_DEFUN(XDVI_SYS_SUNOS_4,
+AC_DEFUN([XDVI_SYS_SUNOS_4],
 [AC_CACHE_CHECK([for SunOS 4], xdvi_cv_sys_sunos_4,
 [case "`(uname -sr) 2>/dev/null`" in
 "SunOS 4."*)
@@ -130,7 +130,7 @@
 
 dnl ### Check for certain broken versions of Linux
 
-AC_DEFUN(XDVI_SYS_OLD_LINUX,
+AC_DEFUN([XDVI_SYS_OLD_LINUX],
 [AC_CACHE_CHECK([for certain old versions of Linux],
xdvi_cv_sys_old_linux, [case "`(uname -sr) 2>/dev/null`" in
 "Linux 2."[[01]].* | "Linux 2.2."[[0-8]] | "Linux 2.2."[[0-8]]-*)
@@ -145,7 +145,7 @@
 dnl ### Process a string argument
 
 dnl XDVI_ARG_STRING(PACKAGE, HELP-STRING, VARIABLE, DEFAULT_VALUE)
-AC_DEFUN(XDVI_ARG_STRING,
+AC_DEFUN([XDVI_ARG_STRING],
 [AC_ARG_WITH($1, [$2], [AC_DEFINE_UNQUOTED($3, "$withval")
 ], [AC_DEFINE($3, [$4])
 ])])
@@ -153,7 +153,7 @@
 
 dnl ### Check for whether we need -lXpm
 
-AC_DEFUN(XDVI_CHECK_XPM,
+AC_DEFUN([XDVI_CHECK_XPM],
 [if test -z "$imake"; then
 # Cygwin needs -lXpm to be linked in explicitly; yet on older (<4.2)
 # versions of XFree86, -lXpm exists, but is not needed.  So we do two
checks. @@ -175,7 +175,7 @@
 dnl ### Check for whether setsid() is allowed within vfork()
 dnl (Mac OS X 10.3 (Panther, 11/2003) is one O/S which does not allow
this.) 
-AC_DEFUN(XDVI_FUNC_SETSID_IN_VFORK,
+AC_DEFUN([XDVI_FUNC_SETSID_IN_VFORK],
 [if test $ac_cv_func_vfork_works = yes; then
 AC_CACHE_CHECK([for whether setsid() is allowed within vfork()],
 xdvi_cv_setsid_in_vfork,
@@ -227,7 +227,7 @@
 dnl ### Check if the --allow-multiple-definition linker flag is
 dnl ### available (assuming that we need to use it if it is)
 
-AC_DEFUN(XDVI_LINKER_MULTIPLE_DEFNS,
+AC_DEFUN([XDVI_LINKER_MULTIPLE_DEFNS],
 [AC_CACHE_CHECK([whether linker supports the
--allow-multiple-definition flag], xdvi_linker_multiple_defns,
 xdvi_save_LDFLAGS="$LDFLAGS"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]