From 08122b137e76ffcf7067f634a7668002732e11d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 12 Jun 2015 02:56:58 +0200 Subject: Fix FTBFS on freebsd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 2 +- FindXscreensaver.cmake | 1 + kdesktop/lock/lockprocess.cc | 2 +- khelpcenter/searchhandlers/CMakeLists.txt | 1 + kicker/kicker/ui/k_new_mnu.cpp | 2 +- ksysguard/ksysguardd/CMakeLists.txt | 2 ++ ksysguard/ksysguardd/FreeBSD/CMakeLists.txt | 26 ++++++++++++++++++++++++ kxkb/CMakeLists.txt | 4 ++-- kxkb/ConfigureChecks.cmake | 5 +++++ tdeioslave/media/medianotifier/medianotifier.cpp | 2 +- tdesu/tdesud/tdesud.cpp | 4 ++-- tdm/backend/CMakeLists.txt | 2 +- tdm/backend/dm.h | 8 ++++---- tdm/backend/getfd.c | 2 +- tdm/backend/sessreg.c | 9 ++++++++ tdm/kfrontend/gentdmconf.c | 12 ++++++++++- tdm/kfrontend/kgreeter.cpp | 5 +++-- 17 files changed, 72 insertions(+), 17 deletions(-) create mode 100644 ksysguard/ksysguardd/FreeBSD/CMakeLists.txt diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 5860b88d6..18009f26c 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -50,7 +50,7 @@ if( WITH_PAM AND (BUILD_KCHECKPASS OR BUILD_TDM) ) check_include_file( "security/pam_appl.h" SECURITY_PAM_APPL_H ) endif( ) if( HAVE_PAM AND SECURITY_PAM_APPL_H ) - set( PAM_LIBRARY pam;dl ) + set( PAM_LIBRARY pam ${DL_LIBRARIES} ) else( ) tde_message_fatal( "pam are requested, but not found on your system" ) endif( ) diff --git a/FindXscreensaver.cmake b/FindXscreensaver.cmake index 57236097c..72ee19eda 100644 --- a/FindXscreensaver.cmake +++ b/FindXscreensaver.cmake @@ -41,6 +41,7 @@ bin/xscreensaver-hacks hacks) /usr/share/xscreensaver/ /usr/local/kde/ /usr/local/xscreensaver/ + /usr/local/share/xscreensaver/ /usr/openwin/lib/xscreensaver/ /etc/ ) diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index 37d2b8867..bfafa371b 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -81,8 +81,8 @@ #ifdef __linux__ #include -#include #endif +#include #include #include diff --git a/khelpcenter/searchhandlers/CMakeLists.txt b/khelpcenter/searchhandlers/CMakeLists.txt index 9c2f7b527..3d18a8008 100644 --- a/khelpcenter/searchhandlers/CMakeLists.txt +++ b/khelpcenter/searchhandlers/CMakeLists.txt @@ -16,6 +16,7 @@ if( NOT DEFINED HTDIG_SEARCH_BINARY ) HINTS /srv/www/cgi-bin /usr/lib/cgi-bin + /usr/local/www/cgi-bin ) if( HTDIG_SEARCH_BINARY ) message( STATUS "Looking for htsearch - ${HTDIG_SEARCH_BINARY}" ) diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp index 8d129610d..cdb542a31 100644 --- a/kicker/kicker/ui/k_new_mnu.cpp +++ b/kicker/kicker/ui/k_new_mnu.cpp @@ -95,7 +95,7 @@ #include "flipscrollview.h" #include "itemview.h" #include -#ifdef __OpenBSD__ +#if defined(__OpenBSD__) || defined(__FreeBSD__) #include #include #include diff --git a/ksysguard/ksysguardd/CMakeLists.txt b/ksysguard/ksysguardd/CMakeLists.txt index efb4c9660..58c5f2399 100644 --- a/ksysguard/ksysguardd/CMakeLists.txt +++ b/ksysguard/ksysguardd/CMakeLists.txt @@ -17,6 +17,8 @@ if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" ) set( OS_SPECIFIC_DIR Linux ) elseif( ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" ) set( OS_SPECIFIC_DIR OpenBSD ) +elseif( ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" ) + set( OS_SPECIFIC_DIR FreeBSD ) else() tde_message_fatal( "Your operating system (${CMAKE_SYSTEM_NAME}) is not supported yet." ) endif() diff --git a/ksysguard/ksysguardd/FreeBSD/CMakeLists.txt b/ksysguard/ksysguardd/FreeBSD/CMakeLists.txt new file mode 100644 index 000000000..b99088d1a --- /dev/null +++ b/ksysguard/ksysguardd/FreeBSD/CMakeLists.txt @@ -0,0 +1,26 @@ +################################################# +# +# (C) 2015 Serghei Amelian +# slavek (DOT) banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/ksysguard/CContLib + ${CMAKE_SOURCE_DIR}/ksysguard/ksysguardd +) + + +##### ksysguardd (static) ####################### + +tde_add_library( ksysguardd STATIC + SOURCES + CPU.c Memory.c ProcessList.c apm.c diskstat.c loadavg.c logfile.c netdev.c + LINK kvm +) diff --git a/kxkb/CMakeLists.txt b/kxkb/CMakeLists.txt index 9ba350e94..872443229 100644 --- a/kxkb/CMakeLists.txt +++ b/kxkb/CMakeLists.txt @@ -40,7 +40,7 @@ tde_add_kpart( kcm_keyboard AUTOMOC extension.cpp x11helper.cpp rules.cpp kxkbconfig.cpp pixmap.cpp kcmlayout.cpp kcmlayoutwidget.ui kcmmisc.cpp kcmmiscwidget.ui - LINK tdeio-shared xkbfile ${XTEST_LIBRARIES} + LINK tdeio-shared ${XKBFILE_LIBRARIES} ${XTEST_LIBRARIES} DESTINATION ${PLUGIN_INSTALL_DIR} ) @@ -52,5 +52,5 @@ tde_add_tdeinit_executable( kxkb AUTOMOC extension.cpp x11helper.cpp rules.cpp kxkbconfig.cpp pixmap.cpp layoutmap.cpp kxkb.cpp kxkbtraywindow.cpp kxkb.skel - LINK tdeui-shared xkbfile + LINK tdeui-shared ${XKBFILE_LIBRARIES} ) diff --git a/kxkb/ConfigureChecks.cmake b/kxkb/ConfigureChecks.cmake index 4bf356bc4..edb387849 100644 --- a/kxkb/ConfigureChecks.cmake +++ b/kxkb/ConfigureChecks.cmake @@ -13,3 +13,8 @@ find_program( SETXKBMAP setxkbmap ) if( SETXKBMAP-NOTFOUND ) tde_message_fatal( "setxkbmap is required, but not found on your system" ) endif() + +pkg_search_module( XKBFILE xkbfile ) +if( NOT XKBFILE_FOUND ) + tde_message_fatal( "xkbfile is requested, but was not found on your system" ) +endif() diff --git a/tdeioslave/media/medianotifier/medianotifier.cpp b/tdeioslave/media/medianotifier/medianotifier.cpp index 4de36cad8..d40c5ae27 100644 --- a/tdeioslave/media/medianotifier/medianotifier.cpp +++ b/tdeioslave/media/medianotifier/medianotifier.cpp @@ -19,7 +19,7 @@ #include "medianotifier.h" -#ifdef __OpenBSD__ +#if defined (__OpenBSD__) || defined(__FreeBSD__) #include #include #include diff --git a/tdesu/tdesud/tdesud.cpp b/tdesu/tdesud/tdesud.cpp index 3d64bc840..5fa2f5857 100644 --- a/tdesu/tdesud/tdesud.cpp +++ b/tdesu/tdesud/tdesud.cpp @@ -45,7 +45,7 @@ #include #include -#ifndef __OpenBSD__ +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) #include #endif #include @@ -251,7 +251,7 @@ int create_socket() int main(int argc, char *argv[]) { -#ifndef __OpenBSD__ +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) prctl(PR_SET_DUMPABLE, 0); #endif diff --git a/tdm/backend/CMakeLists.txt b/tdm/backend/CMakeLists.txt index 9f9d0430f..da3f3ac03 100644 --- a/tdm/backend/CMakeLists.txt +++ b/tdm/backend/CMakeLists.txt @@ -43,6 +43,6 @@ tde_add_executable( tdm process.c protodpy.c reset.c resource.c rpcauth.c server.c session.c sessreg.c socket.c streams.c util.c xdmauth.c xdmcp.c - LINK X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${XDMCP_LIBRARIES} + LINK X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${UTIL_LIBRARY} ${XDMCP_LIBRARIES} DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/tdm/backend/dm.h b/tdm/backend/dm.h index c05d4c865..ae731aeca 100644 --- a/tdm/backend/dm.h +++ b/tdm/backend/dm.h @@ -106,7 +106,6 @@ typedef int waitType; # define Jmp_buf sigjmp_buf #endif -#include #ifdef HAVE_UTMPX # include # define STRUCTUTMP struct utmpx @@ -119,6 +118,7 @@ typedef int waitType; # define ut_time ut_tv.tv_sec # define ll_time ll_tv.tv_sec #else +# include # define STRUCTUTMP struct utmp # define UTMPNAME utmpname # define SETUTENT setutent @@ -126,9 +126,9 @@ typedef int waitType; # define PUTUTLINE pututline # define ENDUTENT endutent # define LASTLOG lastlog -#endif -#ifndef HAVE_STRUCT_UTMP_UT_USER -# define ut_user ut_name +# ifndef HAVE_STRUCT_UTMP_UT_USER +# define ut_user ut_name +# endif #endif #ifndef WTMP_FILE # ifdef _PATH_WTMPX diff --git a/tdm/backend/getfd.c b/tdm/backend/getfd.c index 307b2501c..d4f4d8352 100644 --- a/tdm/backend/getfd.c +++ b/tdm/backend/getfd.c @@ -22,7 +22,7 @@ is_a_console(int fd) { char arg; arg = 0; -#ifdef __OpenBSD__ +#if defined(__OpenBSD__) || defined(__FreeBSD__) return arg; #else return (ioctl(fd, KDGKBTYPE, &arg) == 0 diff --git a/tdm/backend/sessreg.c b/tdm/backend/sessreg.c index b507f8141..4167a16e3 100644 --- a/tdm/backend/sessreg.c +++ b/tdm/backend/sessreg.c @@ -42,6 +42,13 @@ from The Open Group. #if defined(__svr4__) || defined(__Lynx__) || defined(__QNX__) || defined(__APPLE__) || defined(_SEQUENT_) /*|| defined(USE_PAM)*/ # define NO_LASTLOG #endif + +#ifdef __FreeBSD__ +# include +# if __FreeBSD_version >= 900007 +# define NO_LASTLOG +# endif +#endif #ifndef NO_LASTLOG # ifdef HAVE_LASTLOG_H @@ -254,7 +261,9 @@ sessreg( struct display *d, int pid, const char *user, int uid ) close( utmp ); } # else +# if !defined(__FreeBSD__) UTMPNAME( UTMP_FILE ); +# endif SETUTENT(); PUTUTLINE( &ut_ent ); ENDUTENT(); diff --git a/tdm/kfrontend/gentdmconf.c b/tdm/kfrontend/gentdmconf.c index 9a7bc1258..0576eef56 100644 --- a/tdm/kfrontend/gentdmconf.c +++ b/tdm/kfrontend/gentdmconf.c @@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include -#ifdef BSD +#if defined(BSD) && !defined(HAVE_UTMPX) # include #endif @@ -1537,8 +1537,13 @@ edit_startup( File *file ) "fi\n") | #else # ifdef BSD +# ifdef HAVE_UTMPX + delstr( file, "\n" +"exec sessreg -a -l $DISPLAY -x */Xservers $USER\n" ) | +# else delstr( file, "\n" "exec sessreg -a -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n" ) | +# endif # endif #endif /* _AIX */ delstr( file, "\n" @@ -1586,8 +1591,13 @@ edit_reset( File *file ) "fi\n" ) | #else # ifdef BSD +# ifdef HAVE_UTMPX + delstr( file, "\n" +"exec sessreg -d -l $DISPLAY -x */Xservers $USER\n" ) | +# else delstr( file, "\n" "exec sessreg -d -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n" ) | +# endif # endif #endif /* _AIX */ delstr( file, "\n" diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp index 74e04bf31..aa89fd78e 100644 --- a/tdm/kfrontend/kgreeter.cpp +++ b/tdm/kfrontend/kgreeter.cpp @@ -70,9 +70,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include -#include #ifdef HAVE_UTMPX -#include +# include +#else +# include #endif #include -- cgit v1.2.1