From c486a60f04933c8227640b8faca0f931afbe32ef Mon Sep 17 00:00:00 2001 From: miwi Date: Tue, 27 May 2008 22:12:09 +0000 Subject: - Add common code to support for cmake based ports. - Update devel/cmake to 2.6.0 (also fix ports/123092) - Use the new CMAKE build framework in all ports using cmake Approved by: portmgr (pav) --- net-mgmt/macroscope/Makefile | 15 ++++-------- net-mgmt/macroscope/files/CheckTypeSize.c.in | 34 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 net-mgmt/macroscope/files/CheckTypeSize.c.in (limited to 'net-mgmt/macroscope') diff --git a/net-mgmt/macroscope/Makefile b/net-mgmt/macroscope/Makefile index 24db587a496d..67f06536684b 100644 --- a/net-mgmt/macroscope/Makefile +++ b/net-mgmt/macroscope/Makefile @@ -14,7 +14,6 @@ MASTER_SITES= ftp://ftp.berlios.de/pub/macroscope/ \ MAINTAINER= white_raven@users.berlios.de COMMENT= User and IP traffic management with Web interface -BUILD_DEPENDS= cmake:${PORTSDIR}/devel/cmake LIB_DEPENDS= lzo2:${PORTSDIR}/archivers/lzo2 \ odbc:${PORTSDIR}/databases/unixODBC \ pcap:${PORTSDIR}/net/libpcap @@ -22,13 +21,7 @@ LIB_DEPENDS= lzo2:${PORTSDIR}/archivers/lzo2 \ USE_RC_SUBR= macroscope USE_BZIP2= yes USE_DOS2UNIX= yes - -CMAKE_ARGS= -DCMAKE_BUILD_TYPE:STRING=Release \ - -DCMAKE_C_COMPILER:STRING="${CC}" \ - -DCMAKE_C_FLAGS:STRING="${CFLAGS}" \ - -DCMAKE_CXX_COMPILER:STRING="${CXX}" \ - -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS}" \ - -DCMAKE_INSTALL_PREFIX=${PREFIX} +USE_CMAKE= yes OPTIONS= MYSQL "With MySQL support" on \ FIREBIRD "With Firebird support" off @@ -55,8 +48,8 @@ USE_FIREBIRD= yes BROKEN= Does not compile .endif -do-configure: - @(cd ${WRKSRC}; \ - ${LOCALBASE}/bin/cmake ${CMAKE_ARGS} .) +post-patch: + @${REINPLACE_CMD} -e 's|".*\.c\.in"|"${FILESDIR}/CheckTypeSize.c.in"|' \ + ${WRKSRC}/builds/cmake/CheckTypeSize.cmake .include diff --git a/net-mgmt/macroscope/files/CheckTypeSize.c.in b/net-mgmt/macroscope/files/CheckTypeSize.c.in new file mode 100644 index 000000000000..8c9a0163e524 --- /dev/null +++ b/net-mgmt/macroscope/files/CheckTypeSize.c.in @@ -0,0 +1,34 @@ +#cmakedefine CHECK_TYPE_SIZE_TYPE @CHECK_TYPE_SIZE_TYPE@ +#ifdef CHECK_TYPE_SIZE_TYPE + +@CHECK_TYPE_SIZE_PREINCLUDE@ +#ifdef HAVE_SYS_TYPES_H +# include +#endif /* HAVE_SYS_TYPES_H */ + +#ifdef HAVE_STDINT_H +# include +#endif /* HAVE_STDINT_H */ + +#ifdef HAVE_STDDEF_H +# include +#endif /* HAVE_STDDEF_H */ + +@CHECK_TYPE_SIZE_PREMAIN@ + +#ifdef __CLASSIC_C__ +int main(){ + int ac; + char*av[]; +#else +int main(int ac, char*av[]){ +#endif + if(ac > 1000){return *av[0];} + return sizeof(CHECK_TYPE_SIZE_TYPE); +} + +#else /* CHECK_TYPE_SIZE_TYPE */ + +# error "CHECK_TYPE_SIZE_TYPE has to specify the type" + +#endif /* CHECK_TYPE_SIZE_TYPE */ -- cgit