Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 117 lines (94 sloc) 2.62 kB
bd7a799 Check all of the bits of markdown into version control before
David Parsons authored
1 #! /bin/sh
2
3 # local options: ac_help is the help message that describes them
4 # and LOCAL_AC_OPTIONS is the script that interprets them. LOCAL_AC_OPTIONS
5 # is a script that's processed with eval, so you need to be very careful to
6 # make certain that what you quote is what you want to quote.
7
8 # load in the configuration file
9 #
3fc4932 Rework the published interface.
david parsons authored
10 ac_help='--enable-dl-tag Use the DL tag extension
1798e3f aaaaaaaaaarrrrrrrrh. I *HATE HATE HATE HATE HATE* the stupid computer
david parsons authored
11 --enable-pandoc-header Use pandoc-style header blocks
5c6115c 1. Add the new `amalloc` module, which (if enabled with
david parsons authored
12 --with-tabstops=N Set tabstops to N characters (default is 4)
13 --enable-amalloc Enable memory allocation debugging'
3fc4932 Rework the published interface.
david parsons authored
14
15 LOCAL_AC_OPTIONS='
16 set=`locals $*`;
17 if [ "$set" ]; then
18 eval $set
19 shift 1
20 else
21 ac_error=T;
22 fi'
23
24 locals() {
25 K=`echo $1 | tr '[a-z]' '[A-Z]'`
26 case "$K" in
27 --ENABLE-*) enable=`echo $K | sed -e 's/--ENABLE-/WITH-/' | tr '-' '_'`
28 echo ${enable}=T
29 ;;
30 esac
31 }
32
bd7a799 Check all of the bits of markdown into version control before
David Parsons authored
33 TARGET=markdown
34 . ./configure.inc
35
36 AC_INIT $TARGET
37
38 AC_PROG_CC
39
40 case "$AC_CC $AC_CFLAGS" in
41 *-Wall*) AC_DEFINE 'while(x)' 'while( (x) != 0 )'
42 AC_DEFINE 'if(x)' 'if( (x) != 0 )' ;;
43 esac
44
1680ddd Version 0.2 cleans up some of the public interface names, adds
david parsons authored
45 AC_PROG ar || AC_FAIL "$TARGET requires ar"
46 AC_PROG ranlib
47
bd7a799 Check all of the bits of markdown into version control before
David Parsons authored
48 AC_C_VOLATILE
49 AC_C_CONST
50 AC_SCALAR_TYPES
52bc316 1. in `mkdio.h`, tweak the `MMIOT` abstract type from ``void\*'' to `…
david parsons authored
51 AC_CHECK_BASENAME
30296d5 When configuring, check for basename() and <libgen.h>
david parsons authored
52
ba86426 Check for the existance of pwd.h and getpwuid() before doing fancy
david parsons authored
53 AC_CHECK_HEADERS sys/types.h pwd.h && AC_CHECK_FUNCS getpwuid
54
47efa51 Version 1.1.2: more ms-dos portability hackery
david parsons authored
55 if AC_CHECK_FUNCS srandom; then
56 AC_DEFINE 'INITRNG(x)' 'srandom((unsigned int)x)'
57 elif AC_CHECK_FUNCS srand; then
2c2d474 Configuration screwup -- did INITRND instead of INITRNG.
david parsons authored
58 AC_DEFINE 'INITRNG(x)' 'srand((unsigned int)x)'
47efa51 Version 1.1.2: more ms-dos portability hackery
david parsons authored
59 else
2c2d474 Configuration screwup -- did INITRND instead of INITRNG.
david parsons authored
60 AC_DEFINE 'INITRNG(x)' '(void)1'
47efa51 Version 1.1.2: more ms-dos portability hackery
david parsons authored
61 fi
62
63 if AC_CHECK_FUNCS random; then
64 AC_DEFINE 'COINTOSS()' '(random()&1)'
65 elif AC_CHECK_FUNCS rand; then
66 AC_DEFINE 'COINTOSS()' '(rand()&1)'
67 else
68 AC_DEFINE 'COINTOSS()' '1'
69 fi
70
992288b 1. Don't check for alloca (not used any more)
david parsons authored
71 if AC_CHECK_FUNCS strcasecmp; then
72 :
73 elif AC_CHECK_FUNCS stricmp; then
74 AC_DEFINE strcasecmp stricmp
75 else
76 AC_FAIL "$TARGET requires either strcasecmp() or stricmp()"
77 fi
78
79 if AC_CHECK_FUNCS strncasecmp; then
80 :
81 elif AC_CHECK_FUNCS strnicmp; then
82 AC_DEFINE strncasecmp strnicmp
83 else
84 AC_FAIL "$TARGET requires either strncasecmp() or strnicmp()"
85 fi
86
aee5f3b More MS-DOS compatability; fchdir() is not defined in all versions
David Parsons authored
87 if AC_CHECK_FUNCS fchdir || AC_CHECK_FUNCS getcwd ; then
88 AC_SUB 'THEME' ''
89 else
90 AC_SUB 'THEME' '#'
91 fi
92
1798e3f aaaaaaaaaarrrrrrrrh. I *HATE HATE HATE HATE HATE* the stupid computer
david parsons authored
93 if [ -z "$WITH_TABSTOPS" ]; then
75d8583 The -V options that markdown prints are now a part of the version[] n…
david parsons authored
94 TABSTOP=4
1798e3f aaaaaaaaaarrrrrrrrh. I *HATE HATE HATE HATE HATE* the stupid computer
david parsons authored
95 elif [ "$WITH_TABSTOPS" -eq 1 ]; then
75d8583 The -V options that markdown prints are now a part of the version[] n…
david parsons authored
96 TABSTOP=8
1798e3f aaaaaaaaaarrrrrrrrh. I *HATE HATE HATE HATE HATE* the stupid computer
david parsons authored
97 else
75d8583 The -V options that markdown prints are now a part of the version[] n…
david parsons authored
98 TABSTOP=$WITH_TABSTOPS
1798e3f aaaaaaaaaarrrrrrrrh. I *HATE HATE HATE HATE HATE* the stupid computer
david parsons authored
99 fi
75d8583 The -V options that markdown prints are now a part of the version[] n…
david parsons authored
100 AC_DEFINE 'TABSTOP' $TABSTOP
101 AC_SUB 'TABSTOP' $TABSTOP
1798e3f aaaaaaaaaarrrrrrrrh. I *HATE HATE HATE HATE HATE* the stupid computer
david parsons authored
102
5c6115c 1. Add the new `amalloc` module, which (if enabled with
david parsons authored
103
104 if [ "$WITH_AMALLOC" ]; then
105 AC_DEFINE 'USE_AMALLOC' 1
106 AC_SUB 'AMALLOC' 'amalloc.o'
107 else
108 AC_SUB 'AMALLOC' ''
109 fi
110
bd7a799 Check all of the bits of markdown into version control before
David Parsons authored
111 [ "$OS_FREEBSD" -o "$OS_DRAGONFLY" ] || AC_CHECK_HEADERS malloc.h
112
0cca3c2 Add a markdown extension to support definition lists.
david parsons authored
113 [ "$WITH_DL_TAG" ] && AC_DEFINE 'DL_TAG_EXTENSION' '1'
3fc4932 Rework the published interface.
david parsons authored
114 [ "$WITH_PANDOC_HEADER" ] && AC_DEFINE 'PANDOC_HEADER' '1'
0cca3c2 Add a markdown extension to support definition lists.
david parsons authored
115
75d8583 The -V options that markdown prints are now a part of the version[] n…
david parsons authored
116 AC_OUTPUT Makefile version.c
Something went wrong with that request. Please try again.