|
From: <kr_...@us...> - 2003-09-05 21:44:17
|
Update of /cvsroot/htoolkit/HSQL
In directory sc8-pr-cvs1:/tmp/cvs-serv9791
Modified Files:
Makefile configure.ac hsql.pkg.in
Log Message:
Full redesign of build system
Index: Makefile
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile 5 Sep 2003 11:37:55 -0000 1.1
--- Makefile 5 Sep 2003 21:44:09 -0000 1.2
***************
*** 2,34 ****
ifeq "$(WithODBC)" "YES"
! HS_SRC += src/ODBC/HSQL.hs
! CPPFLAGS += -Isrc/ODBC
endif
ifeq "$(WithPostgreSQL)" "YES"
! HS_SRC += src/PostgreSQL/HSQL.hs
endif
ifeq "$(WithMySQL)" "YES"
! HS_SRC += src/MySQL/HSQL.hs
endif
OBJS = $(patsubst %.hs,%.o, $(HS_SRC))
HI_SRC = $(patsubst %.hs,%.hi,$(HS_SRC))
HS_PPS = $(addsuffix .raw-hs, $(basename $(HS_SRC)))
%.o : %.hs
! $(GHC) $< $($*_HC_OPTS) -O -c -fglasgow-exts -Iincludes $(CPPFLAGS) -package-name HToolkit
%.hs : %.hsc
! $(HSC2HS) $< -Iincludes $(CPPFLAGS)
! %.hi : %.o
! @
%.raw-hs : %.hs
$(GHC) -Iincludes $(CPPFLAGS) -D__HADDOCK__ -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
! all: $(OBJS)
! echo $(HS_SRC)
rm -f libHSsql.a
! $(AR) -q libHSsql.a $^
depend: $(HS_SRC)
--- 2,39 ----
ifeq "$(WithODBC)" "YES"
! HS_SRC += ODBC/HSQL.hs
endif
ifeq "$(WithPostgreSQL)" "YES"
! HS_SRC += PostgreSQL/HSQL.hs
endif
ifeq "$(WithMySQL)" "YES"
! HS_SRC += MySQL/HSQL.hs
endif
OBJS = $(patsubst %.hs,%.o, $(HS_SRC))
HI_SRC = $(patsubst %.hs,%.hi,$(HS_SRC))
+
+ ifneq "$(HADDOCK)" ""
HS_PPS = $(addsuffix .raw-hs, $(basename $(HS_SRC)))
+ endif
%.o : %.hs
! mkdir -p $(basename $^)_split
! $(GHC) $< -O -c -fglasgow-exts -split-objs $(CPPFLAGS) -package-name hsql
! $(LD) -r -o $@ $(basename $^)_split/*.o
%.hs : %.hsc
! $(HSC2HS) $< $(CPPFLAGS)
%.raw-hs : %.hs
$(GHC) -Iincludes $(CPPFLAGS) -D__HADDOCK__ -E -cpp $< -o $<.tmp && sed -e 's/^#.*//' <$<.tmp >$@
! all: libHSsql.a
!
! libHSsql.a: $(OBJS)
rm -f libHSsql.a
! for i in $(patsubst %.o,%_split, $(OBJS)); do \
! $(AR) -q libHSsql.a $$i/*.o; \
! done
depend: $(HS_SRC)
***************
*** 44,53 ****
$(HADDOCK) -h -o doc $(HS_PPS)
! install: libHSsql.a $(HI_SRC)
$(INSTALL) libHSsql.a $(prefix)/libHSsql.a
! $(INSTALL) -d $(prefix)/imports/hsql
for i in $(HI_SRC); do \
! $(INSTALL) -d $(prefix)/imports/hsql/`dirname $$i`; \
! $(INSTALL) -c $$i $(prefix)/imports/hsql/`dirname $$i`; \
done
! $(GHC_PKG) -u -g -i hsql.pkg.in
--- 49,64 ----
$(HADDOCK) -h -o doc $(HS_PPS)
! install: libHSsql.a $(HI_SRC) doc
$(INSTALL) libHSsql.a $(prefix)/libHSsql.a
! $(INSTALL) -d $(prefix)/imports/Database
for i in $(HI_SRC); do \
! $(INSTALL) -d $(prefix)/imports/Database/`dirname $$i`; \
! $(INSTALL) -c $$i $(prefix)/imports/Database/`dirname $$i`; \
done
! if test -d doc; then \
! $(INSTALL) -d $(prefix)/doc/html/hsql; \
! $(INSTALL) -c doc/* $(prefix)/doc/html/hsql; \
! fi
! $(GHC_PKG) -u -g -i hsql.pkg
!
! ODBC/HSQL.hs : ODBC/HSQLStructs.h
Index: configure.ac
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/configure.ac,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** configure.ac 5 Sep 2003 11:37:55 -0000 1.1
--- configure.ac 5 Sep 2003 21:44:10 -0000 1.2
***************
*** 1,3 ****
! AC_INIT([HSQL],[1.0],[ka2...@ya...],[hsql])
AC_CONFIG_FILES([config.mk:config.mk.in hsql.pkg:hsql.pkg.in])
--- 1,3 ----
! AC_INIT([HSQL],[1.0],[hto...@li...],[hsql])
AC_CONFIG_FILES([config.mk:config.mk.in hsql.pkg:hsql.pkg.in])
***************
*** 58,61 ****
--- 58,65 ----
AC_SUBST(GHC)
+ if test "$prefix" = "NONE"; then
+ prefix=`$GHC --print-libdir`
+ fi
+
dnl ***********************************************
dnl hsc2hs
***************
*** 114,117 ****
--- 118,122 ----
AC_PROG_CC
+ AC_PROG_CPP
AC_PROG_INSTALL
***************
*** 127,152 ****
if test $WithODBC = YES; then
! case $ac_cv_target_alias in
! i[[3456]]86-*-cygwin*|i[[3456]]86-*-mingw32*)
! AC_COMPILE_IFELSE(
! [
! #include <windows.h>
! #include <sqlext.h>
!
! int main()
! {
! SQLAllocEnv (NULL);
! return 0;
! }
! ],
! [LIBS="${LIBS} -lodbc32"],
! AC_MSG_ERROR([sqlext.h and libodbc required to build ODBC building.]))
! ;;
! *) AC_CHECK_HEADER(sqlext.h,,AC_MSG_ERROR([sqlext.h and libodbc required to build ODBC building.]))
! AC_CHECK_LIB(odbc,SQLAllocEnv,,AC_MSG_ERROR([sqlext.h and libodbc required to build ODBC building.]))
! ;;
! esac
!
fi
--- 132,157 ----
if test $WithODBC = YES; then
+ case $ac_cv_target_alias in
+ i[[3456]]86-*-cygwin*|i[[3456]]86-*-mingw32*)
+ AC_COMPILE_IFELSE(
+ [
+ #include <windows.h>
+ #include <sqlext.h>
+
+ int main()
+ {
+ SQLAllocEnv (NULL);
+ return 0;
+ }
+ ],
+ [LIBS="${LIBS} -lodbc32"],
+ AC_MSG_ERROR([sqlext.h and libodbc required to build ODBC building.]))
+ ;;
+ *) AC_CHECK_HEADER(sqlext.h,,AC_MSG_ERROR([sqlext.h and libodbc required to build ODBC building.]))
+ AC_CHECK_LIB(odbc,SQLAllocEnv,,AC_MSG_ERROR([sqlext.h and libodbc required to build ODBC building.]))
+ ;;
+ esac
! CPPFLAGS="$CPPFLAGS -IODBC"
fi
***************
*** 156,174 ****
if test $WithPostgreSQL = YES; then
! AC_PATH_PROG(PG_CONFIG, pg_config)
!
! if test x$PG_CONFIG = x || test ! -f $PG_CONFIG; then
! AC_MSG_ERROR([pg_config is required to build PostgreSQL binding])
! fi
!
! LDFLAGS="$LDFLAGS -L`$PG_CONFIG --libdir`"
! CPPFLAGS="$CPPFLAGS -I`$PG_CONFIG --includedir`"
! AC_CHECK_HEADER(libpq-fe.h,[
! AC_CHECK_HEADER(postgres.h,, AC_MSG_ERROR([catalog/postgres.h header not found]))
! ], AC_MSG_ERROR([libpq-fe.h header not found]))
! AC_CHECK_LIB(pq,PQsetdbLogin,,AC_MSG_ERROR([libpq.a library not found]))
fi
--- 161,182 ----
if test $WithPostgreSQL = YES; then
! AC_PATH_PROG(PG_CONFIG, pg_config)
! if test "$PG_CONFIG" = "" || test ! -f $PG_CONFIG; then
! AC_MSG_ERROR([pg_config is required to build PostgreSQL binding])
! fi
! case $ac_cv_target_alias in
! i[[3456]]86-*-cygwin*|i[[3456]]86-*-mingw32*)
! LDFLAGS="$LDFLAGS -L$(cygpath -m `$PG_CONFIG --libdir`)"
! CPPFLAGS="$CPPFLAGS -I$(cygpath -m /usr/include) -I$(cygpath -m `$PG_CONFIG --includedir`)"
! ;;
! *) LDFLAGS="$LDFLAGS -L`$PG_CONFIG --libdir`"
! CPPFLAGS="$CPPFLAGS -I`$PG_CONFIG --includedir`"
! ;;
! esac
+ AC_CHECK_HEADER(libpq-fe.h,,AC_MSG_ERROR([libpq-fe.h header not found]))
+ AC_CHECK_LIB(pq,PQsetdbLogin,,AC_MSG_ERROR([libpq.a library not found]))
fi
***************
*** 180,184 ****
AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
! if test x$MYSQL_CONFIG = x || test ! -f $MYSQL_CONFIG; then
AC_MSG_ERROR([mysql_config is required to build PostgreSQL binding])
fi
--- 188,192 ----
AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
! if test "$MYSQL_CONFIG" = "" || test ! -f $MYSQL_CONFIG; then
AC_MSG_ERROR([mysql_config is required to build PostgreSQL binding])
fi
Index: hsql.pkg.in
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/hsql.pkg.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hsql.pkg.in 5 Sep 2003 11:37:55 -0000 1.1
--- hsql.pkg.in 5 Sep 2003 21:44:10 -0000 1.2
***************
*** 2,6 ****
{name = "hsql",
auto=True,
! import_dirs = ["@prefix@/imports/hsql"],
source_dirs = [],
library_dirs = [@LIB_DIRS@],
--- 2,6 ----
{name = "hsql",
auto=True,
! import_dirs = ["@prefix@/imports"],
source_dirs = [],
library_dirs = [@LIB_DIRS@],
|