Permalink
Browse files

Use libtool to build.

  • Loading branch information...
1 parent 232afa4 commit 8ae3f4b027834c0ba4dd7724ae66eb0b4a6836d0 Sascha Schumann committed Oct 4, 1999
Showing with 43 additions and 78 deletions.
  1. +16 −13 Zend/Makefile.am
  2. +0 −4 Zend/acconfig.h
  3. +5 −0 Zend/acinclude.m4
  4. +10 −1 Zend/buildconf
  5. +12 −17 Zend/configure.in
  6. +0 −43 Zend/zend_config.in
View
@@ -2,30 +2,33 @@
#CLEANFILES = zend-parser.c zend-parser.h zend-scanner.c zend-parser.output
+ZEND_SCANNER = @ZEND_SCANNER@
+
AUTOMAKE_OPTIONS=foreign
-noinst_LIBRARIES=libzend.a
-libzend_a_SOURCES=\
- zend-parser.y zend-scanner.l \
+EXTRA_LTLIBRARIES=libzend_cc.la libzend_c.la
+noinst_LTLIBRARIES=$(ZEND_SCANNER) libzend.la
+
+libzend_cc_la_SOURCES=zend-scanner-cc.cc
+libzend_c_la_SOURCES=zend-scanner.c
+
+libzend_la_SOURCES=\
+ zend-parser.y \
zend_alloc.c zend_compile.c zend_constants.c \
zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
zend_list.c zend_indent.c zend_builtin_functions.c
-# taken from automake 1.4
-CXXFLAGS= @CXXFLAGS@
-CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-
+libzend_la_LIBADD = $(ZEND_SCANNER)
+libzend_la_LDFLAGS = @EXTRA_LIBS@
+
# automake isn't too clever about "non-standard" use of lex and yacc
-zend-scanner.o: @ZEND_SCANNER_SRC@
- @ZEND_SCANNER_COMPILE@
-
zend-scanner.c: zend-scanner.l
- $(LEX) -Pzend -ozend-scanner.c -i $(srcdir)/zend-scanner.l
+ $(LEX) -Pzend -o$@ -i $<
-zend-scanner.cc: zend-scanner.l
- $(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -ozend-scanner.cc $(srcdir)/zend-scanner.l
+zend-scanner-cc.cc: zend-scanner.l
+ $(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $<
zend-parser.h: zend-parser.c
zend-parser.c: zend-parser.y
View
@@ -80,10 +80,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
# define zend_sprintf sprintf
#endif
-#if ZEND_DEBUG
-# define inline
-#endif
-
/*
* Local variables:
* tab-width: 4
View
@@ -18,3 +18,8 @@ AC_DEFUN(AC_ZEND_BROKEN_SPRINTF,[
AC_MSG_RESULT(cannot check, guessing ok)
])
])
+
+AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
+ LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
+])
+
View
@@ -1,5 +1,14 @@
#!/bin/sh
+case "$1" in
+--copy)
+ automake_flags=--copy
+ shift
+;;
+esac
+
+libtoolize --force --automake $automake_flags
+
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
@@ -11,7 +20,7 @@ fi
autoheader
-automake --add-missing --include-deps
+automake --add-missing --include-deps $automake_flags
mv configure configure.old 2>/dev/null
autoconf
View
@@ -27,10 +27,13 @@ AC_PROG_CC
if test "$enable_thread_safety" = "yes" ; then
AC_PROG_CXX
fi
-AC_PROG_RANLIB
AC_PROG_CC_C_O
AM_PROG_LEX
+AM_PROG_LIBTOOL
+if test "$enable_debug" != "yes"; then
+ AM_SET_LIBTOOL_VARIABLE([--silent])
+fi
AM_PROG_CC_STDC
AC_C_INLINE
@@ -131,30 +134,26 @@ AC_ARG_ENABLE(memory-limit,
])
+ZEND_SCANNER_TYPE=c
dnl Sigh. This will probably break automake's automatic dependencies..
AC_MSG_CHECKING(whether to build Zend thread-safe)
AC_ARG_ENABLE(thread-safety,
[ --enable-thread-safety Whether to build Zend thread-safe.],[
if test "$enableval" = "yes"; then
AC_DEFINE(ZTS)
- ZEND_SCANNER_SRC=zend-scanner.cc
- ZEND_SCANNER_COMPILE='$(CXXCOMPILE) -c $< -o $@'
+ ZEND_SCANNER_TYPE=cc
CPPFLAGS="$CPPFLAGS -I../TSRM"
AC_MSG_RESULT(yes)
else
- ZEND_SCANNER_SRC=zend-scanner.c
- ZEND_SCANNER_COMPILE='$(COMPILE) -c $<'
AC_MSG_RESULT(no)
fi
],[
- ZEND_SCANNER_SRC=zend-scanner.c
- ZEND_SCANNER_COMPILE='$(COMPILE) -c $<'
AC_MSG_RESULT(no)
])
AC_SUBST(TSRM_DIR)
AC_SUBST(TSRM_LIB)
-AC_SUBST(ZEND_SCANNER_SRC)
-AC_SUBST(ZEND_SCANNER_COMPILE)
+ZEND_SCANNER="libzend_${ZEND_SCANNER_TYPE}.la"
+AC_SUBST(ZEND_SCANNER)
if test "$enable_thread_safety" = "yes" ; then
AC_CHECK_LIB(C, cin)
@@ -181,14 +180,10 @@ AC_LANG_RESTORE
fi
-AC_SUBST(CXXFLAGS)
-
-AC_SUBST(CFLAGS_SHLIB)
-AC_SUBST(LDFLAGS_SHLIB)
-AC_SUBST(LDFLAGS_SHLIB_EXPORT)
-
-AC_OUTPUT(Makefile zend_config)
-AC_OUTPUT_COMMANDS([chmod +x zend_config])
+EXTRA_LIBS="$LIBS"
+LIBS=""
+AC_SUBST(EXTRA_LIBS)
+AC_OUTPUT(Makefile)
# Local Variables:
# tab-width: 4
View
@@ -1,43 +0,0 @@
-#! /bin/sh
-#
-# $Id$
-#
-# Written by Sascha Schumann <sascha@schumann.cx>
-
-
-# taken from autoconf
-
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-flags_libs="@LIBS@"
-flags_ldflags="@LDFLAGS@"
-flags_cflags="@CPPFLAGS@ @CFLAGS@"
-
-case "$1" in
---ldflags)
- echo $ac_n "$flags_ldflags$ac_c"
-;;
---cflags)
- echo $ac_n "$flags_cflags$ac_c"
-;;
---libs)
- echo $ac_n "$flags_libs$ac_c"
-;;
-*)
- echo "$0 [--libs|--cflags|--ldflags]"
- exit 1
-;;
-esac
-
-exit 0

0 comments on commit 8ae3f4b

Please sign in to comment.