From f58e60a2b7a16a09279c9e987381ff71ec50df50 Mon Sep 17 00:00:00 2001 From: stan Date: Mon, 16 Sep 2002 17:10:34 +0000 Subject: [PATCH] Added for autoconf support. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@7 e3e1d417-86f3-4887-817a-d78f3d33393f --- configure.in | 53 ++++++++++++++++++++++++++++++ src/Makefile.in | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ src/config.h.in | 64 ++++++++++++++++++++++++++++++++++++ src/configure.in | 53 ++++++++++++++++++++++++++++++ 4 files changed, 254 insertions(+) create mode 100644 configure.in create mode 100644 src/Makefile.in create mode 100644 src/config.h.in create mode 100644 src/configure.in diff --git a/configure.in b/configure.in new file mode 100644 index 000000000..71c95f0da --- /dev/null +++ b/configure.in @@ -0,0 +1,53 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(font_6x11.h) +AC_CONFIG_HEADER(config.h) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL + +# Ask user for path to libmysqlclient stuff:. +AC_ARG_WITH(mysql, + [ --with-mysql= prefix of MySQL installation. e.g. /usr/local or /usr], + [MYSQL_PREFIX=$with_mysql], + AC_MSG_ERROR([You must call configure with the --with-mysql option. + This tells configure where to find the MySql C library and headers. + e.g. --with-mysql=/usr/local or --with-mysql=/usr]) +) +AC_SUBST(MYSQL_PREFIX) +MYSQL_LIBS="-L${MYSQL_PREFIX}/lib/mysql -lmysqlclient" +MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include" +AC_SUBST(MYSQL_LIBS) +AC_SUBST(MYSQL_CFLAGS) + +CFLAGS="$CFLAGS $MYSQL_CFLAGS" +LIBS="$LIBS $MYSQL_LIBS" + +dnl Checks for libraries. +dnl Replace `main' with a function in -ldl: +AC_CHECK_LIB(dl, dlsym) +dnl Replace `main' with a function in -ljpeg: +AC_CHECK_LIB(jpeg, jpeg_stdio_dest) +dnl Replace `main' with a function in -lmysqlclient: +AC_CHECK_LIB(mysqlclient, mysql_init) +dnl Replace `main' with a function in -lz: +AC_CHECK_LIB(z, compress) + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h syslog.h unistd.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_HEADER_TIME + +dnl Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_STRFTIME +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(gettimeofday strerror) + +AC_OUTPUT(Makefile) diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 000000000..4d5273943 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,84 @@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = $(exec_prefix)/bin + +CC = @CC@ +CXX = @CXX@ +CPPFLAGS = @DEFS@ +CFLAGS= @DEFS@ @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ $(CFLAGS) +LDFLAGS = @LDFLAGS@ -Wl,-E +INSTALL = @INSTALL@ +BINDIR = @bindir@ +ZMLIBS = -L/usr/lib/mysql -lmysqlclient @LIBS@ +ZMOBJS = zm.o zmdbg.o jmemdst.o +ZMHDRS = zm.h zmcfg.h zmdbg.h + +all: zmc zma zms zmu + +test: + @echo "No tests available" + +install: + $(INSTALL) $(ZMC) $(BINDIR) + $(INSTALL) $(ZMA) $(BINDIR) + $(INSTALL) $(ZMS) $(BINDIR) + $(INSTALL) $(ZMU) $(BINDIR) + @echo "You will now need to copy index.php to your desired ZoneMinder web document root" + +clean: + @$(RM) $(ZMC) $(ZMCOBJS) $(ZMA) $(ZMAOBJS) $(ZMS) $(ZMSOBJS) $(ZMU) $(ZMUOBJS) + +distclean: + @$(RM) Makefile config.h config.status config.cache config.log + +ZMC = zmc +ZMCOBJS = zmc.o $(ZMOBJS) +ZMCLIBS = $(ZMLIBS) + +ZMA = zma +ZMAOBJS = zma.o $(ZMOBJS) +ZMALIBS = $(ZMLIBS) + +ZMS = zms +ZMSOBJS = zms.o $(ZMOBJS) +ZMSLIBS = $(ZMLIBS) + +ZMU = zmu +ZMUOBJS = zmu.o $(ZMOBJS) +ZMULIBS = $(ZMLIBS) + +zmdbg.o: zmdbg.c zmdbg.h + $(CXX) -c $(CXXFLAGS) $< + +jmemdst.o: jmemdst.c + $(CC) -c $(CFLAGS) $< + +zm.o: zm.cpp $(ZMHDRS) + $(CXX) -c $(CXXFLAGS) $< + +zmc.o: zmc.cpp $(ZMHDRS) + $(CXX) -c $(CXXFLAGS) $< + +zma.o: zma.cpp $(ZMHDRS) + $(CXX) -c $(CXXFLAGS) $< + +zms.o: zms.cpp $(ZMHDRS) + $(CXX) -c $(CXXFLAGS) $< + +zmu.o: zmu.cpp $(ZMHDRS) + $(CXX) -c $(CXXFLAGS) $< + +$(ZMC): $(ZMCOBJS) + $(CXX) $(CXXFLAGS) -o $@ $(ZMCOBJS) $(ZMCLIBS) $(LDFLAGS) + +$(ZMA): $(ZMAOBJS) + $(CXX) $(CXXFLAGS) -o $@ $(ZMAOBJS) $(ZMALIBS) $(LDFLAGS) + +$(ZMS): $(ZMSOBJS) + $(CXX) $(CXXFLAGS) -o $@ $(ZMSOBJS) $(ZMSLIBS) $(LDFLAGS) + +$(ZMU): $(ZMUOBJS) + $(CXX) $(CXXFLAGS) -o $@ $(ZMUOBJS) $(ZMULIBS) $(LDFLAGS) diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 000000000..e8fe7ff09 --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,64 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the dl library (-ldl). */ +#undef HAVE_LIBDL + +/* Define if you have the jpeg library (-ljpeg). */ +#undef HAVE_LIBJPEG + +/* Define if you have the mysqlclient library (-lmysqlclient). */ +#undef HAVE_LIBMYSQLCLIENT + +/* Define if you have the z library (-lz). */ +#undef HAVE_LIBZ diff --git a/src/configure.in b/src/configure.in new file mode 100644 index 000000000..71c95f0da --- /dev/null +++ b/src/configure.in @@ -0,0 +1,53 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(font_6x11.h) +AC_CONFIG_HEADER(config.h) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL + +# Ask user for path to libmysqlclient stuff:. +AC_ARG_WITH(mysql, + [ --with-mysql= prefix of MySQL installation. e.g. /usr/local or /usr], + [MYSQL_PREFIX=$with_mysql], + AC_MSG_ERROR([You must call configure with the --with-mysql option. + This tells configure where to find the MySql C library and headers. + e.g. --with-mysql=/usr/local or --with-mysql=/usr]) +) +AC_SUBST(MYSQL_PREFIX) +MYSQL_LIBS="-L${MYSQL_PREFIX}/lib/mysql -lmysqlclient" +MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include" +AC_SUBST(MYSQL_LIBS) +AC_SUBST(MYSQL_CFLAGS) + +CFLAGS="$CFLAGS $MYSQL_CFLAGS" +LIBS="$LIBS $MYSQL_LIBS" + +dnl Checks for libraries. +dnl Replace `main' with a function in -ldl: +AC_CHECK_LIB(dl, dlsym) +dnl Replace `main' with a function in -ljpeg: +AC_CHECK_LIB(jpeg, jpeg_stdio_dest) +dnl Replace `main' with a function in -lmysqlclient: +AC_CHECK_LIB(mysqlclient, mysql_init) +dnl Replace `main' with a function in -lz: +AC_CHECK_LIB(z, compress) + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h syslog.h unistd.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_HEADER_TIME + +dnl Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_STRFTIME +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(gettimeofday strerror) + +AC_OUTPUT(Makefile)