diff --git a/src/squeue/squeue.c b/src/squeue/squeue.c
index 68283f1e283215a46ec68bd7f784fdfac43a19ea..33d0218f3c0e71d39f3472a489c5b1fd51b6990a 100644
--- a/src/squeue/squeue.c
+++ b/src/squeue/squeue.c
@@ -24,8 +24,15 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 \*****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#ifdef HAVE_TERMCAP_H
+#  include <termcap.h>
+#endif
+
 #include <sys/ioctl.h>
-#include <termcap.h>
 #include <termios.h>
 
 #include "src/common/xstring.h"